下面列出了怎么用android.widget.AbsSeekBar的API类实例代码及写法,或者点击链接到github查看源代码。
private CharSequence getFallbackText(
Context context,
AccessibilityNodeInfoCompat node) {
// Order is important below because of class inheritance.
if (matchesAny(context, node, Button.class, ImageButton.class)) {
return context.getString(R.string.type_button);
}
if (matchesAny(context, node, QuickContactBadge.class)) {
return context.getString(R.string.type_quickcontact);
}
if (matchesAny(context, node, ImageView.class)) {
return context.getString(R.string.type_image);
}
if (matchesAny(context, node, EditText.class)) {
return context.getString(R.string.type_edittext);
}
if (matchesAny(context, node, AbsSeekBar.class)) {
return context.getString(R.string.type_seekbar);
}
return "";
}
/**
* Tint the {@link AbsSeekBar} thumb drawable according to the supplied color.
*
* @param seekBar The seek bar to be colorized.
* @param color The color to be used.
*/
public static void setColor(@NonNull AbsSeekBar seekBar, @ColorInt int color) {
try {
Field fThumb = AbsSeekBar.class.getDeclaredField("mThumb");
fThumb.setAccessible(true);
fThumb.set(seekBar, DynamicDrawableUtils.colorizeDrawable(
(Drawable) fThumb.get(seekBar), color));
} catch (Exception e) {
e.printStackTrace();
}
}
public static BaseDSL.ViewClassResult absSeekBar() {
return BaseDSL.v(AbsSeekBar.class);
}
public static Void absSeekBar(Anvil.Renderable r) {
return BaseDSL.v(AbsSeekBar.class, r);
}
public static BaseDSL.ViewClassResult absSeekBar() {
return BaseDSL.v(AbsSeekBar.class);
}
public static Void absSeekBar(Anvil.Renderable r) {
return BaseDSL.v(AbsSeekBar.class, r);
}
public CompatSeekBar(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
mEnvUIChanger = new EnvAbsSeekBarChanger<AbsSeekBar, XAbsSeekBarCall>(context);
mEnvUIChanger.applyStyle(context, attrs, defStyle, 0, ALLOW_SYSRES, isInEditMode());
}
public CompatRatingBar(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
mEnvUIChanger = new EnvAbsSeekBarChanger<AbsSeekBar, XAbsSeekBarCall>(context);
mEnvUIChanger.applyStyle(context, attrs, defStyle, 0, ALLOW_SYSRES, isInEditMode());
}
public AbsSeekBarAssert(AbsSeekBar actual) {
super(actual, AbsSeekBarAssert.class);
}