-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
library draw correct only from API 23 and above #47
Comments
this is an issue with default drawables and the background for the theme on the api16 examples. |
fix default range/track drawable for API 21/23 related to #47
Hello, I would like to know if you got updates on this issue. |
It is partially fixed but didn't gave time to followup. Ill probably wrapup a minor release next week |
Hey, is there any updates on this issue? |
some news about the update? |
I use hack for get all drawables correct like in SeekBar: Helper class for extract Thumb from SeekBar public class HFAppCompatSeekBar extends AppCompatSeekBar {
public HFAppCompatSeekBar(Context context) {
super(context);
}
public HFAppCompatSeekBar(Context context, AttributeSet attrs) {
super(context, attrs);
}
public HFAppCompatSeekBar(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
public Drawable getThumb() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
return super.getThumb();
// Using reflection, don't override setThumb
// because others methods in AbsSeekBar change mThumb
try {
// HFAppCompatSeekBar -> AppCompatSeekBar -> SeekBar -> AbsSeekBar
Class<?> cls = this.getClass().getSuperclass().getSuperclass().getSuperclass();
Field f = cls.getDeclaredField("mThumb");
f.setAccessible(true);
return (Drawable) f.get(this);
} catch (NoSuchFieldException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
return null;
}
} Somewhere in code mMySeekBar = (MultiSlider) view.findViewById(R.id.myseekbar);
// HACK: for draw track
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
HFAppCompatSeekBar mTempSeekBar = new HFAppCompatSeekBar(ctx);
mMySeekBar.setTrackDrawable(mTempSeekBar.getProgressDrawable());
}
for (int i = 0; i < 2; ++i) {
HFAppCompatSeekBar mTempSeekBar = new HFAppCompatSeekBar(ctx);
mMySeekBar.getThumb(i).setThumb(mTempSeekBar.getThumb());
}
// HACK: for draw range
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
HFAppCompatSeekBar mTempSeekBar = new HFAppCompatSeekBar(ctx);
mTempSeekBar.setProgress(100);
mTempSeekBar.refreshDrawableState();
mMySeekBar.getThumb(1).setRange(mTempSeekBar.getProgressDrawable());
} |
@bmx666 this works partially as some cases and states are not properly handled . I have pushed https://github.com/apptik/MultiSlider/tree/issue47 |
Hi, I'm using 1.3.1-SNAPSHOT, but it's still being drawn as a white line and transparent color when user touches, did I skip some step? |
Hi @yeray697, can you give more info and share the code? |
Sure
(colorPrimaryDark = green) |
@yeray697, without colorControlActivated and colorControlHighlight attrs it's work correctly? |
No, it's still white and transparent. I've also tried without style and I got the same result |
@yeray697, which API are you use? |
|
@yeray697, you have similar issue on all emulators/devices (api 21/22/23/25/26/27) ? |
It's working on emulator with api 21, but there's another style problem (or I don't know how to change it), when I touch, appears a red transparent circle and I would like to change it. |
Hi, sorry for the delay. On the other hand, the ripple effect issue is solved as you said on #65. |
@yeray697 for API 19 and lower you should use holo style. If you need material style you can use hack with seekbar to get style and apply it to multislider (see my comment above) |
Nice, thank you, I haven't realized that Holo was neccesary < 19 By the way, I think you have two unused images (or I haven't found where are used): |
Screenshots from emulators:
The text was updated successfully, but these errors were encountered: