本文整理了Java中android.widget.Switch.getTrackDrawable()
方法的一些代码示例,展示了Switch.getTrackDrawable()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Switch.getTrackDrawable()
方法的具体详情如下:
包路径:android.widget.Switch
类名称:Switch
方法名:getTrackDrawable
暂无
代码示例来源:origin: square/assertj-android
@TargetApi(JELLY_BEAN)
public SwitchAssert hasTrackDrawable(Drawable drawable) {
isNotNull();
Drawable actualDrawable = actual.getTrackDrawable();
assertThat(actualDrawable) //
.overridingErrorMessage("Expected track drawable <%s> but was <%s>.", drawable,
actualDrawable) //
.isSameAs(drawable);
return this;
}
}
代码示例来源:origin: willowtreeapps/Hyperion-Android
attributes.add(new ViewAttribute<Void>("TrackDrawable", view.getTrackDrawable()));
代码示例来源:origin: com.squareup.assertj/assertj-android
@TargetApi(JELLY_BEAN)
public SwitchAssert hasTrackDrawable(Drawable drawable) {
isNotNull();
Drawable actualDrawable = actual.getTrackDrawable();
assertThat(actualDrawable) //
.overridingErrorMessage("Expected track drawable <%s> but was <%s>.", drawable,
actualDrawable) //
.isSameAs(drawable);
return this;
}
}
代码示例来源:origin: xuancao/DynamicSkin
public static void setTint(@NonNull Switch switchView, @ColorInt int color, boolean useDarker) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) return;
if (switchView.getTrackDrawable() != null) {
switchView.setTrackDrawable(modifySwitchDrawable(switchView.getContext(),
switchView.getTrackDrawable(), color, 0.5f, false, useDarker));
}
if (switchView.getThumbDrawable() != null) {
switchView.setThumbDrawable(modifySwitchDrawable(switchView.getContext(),
switchView.getThumbDrawable(), color, 1.0f, true, useDarker));
}
}
代码示例来源:origin: garretyoder/app-theme-engine
public static void setTint(@NonNull Switch switchView, @ColorInt int color, boolean useDarker) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) return;
if (switchView.getTrackDrawable() != null) {
switchView.setTrackDrawable(modifySwitchDrawable(switchView.getContext(),
switchView.getTrackDrawable(), color, false, false, useDarker));
}
if (switchView.getThumbDrawable() != null) {
switchView.setThumbDrawable(modifySwitchDrawable(switchView.getContext(),
switchView.getThumbDrawable(), color, true, false, useDarker));
}
}
代码示例来源:origin: h4h13/RetroMusicPlayer
public static void setTint(@NonNull Switch switchView, @ColorInt int color, boolean useDarker) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) return;
if (switchView.getTrackDrawable() != null) {
switchView.setTrackDrawable(modifySwitchDrawable(switchView.getContext(),
switchView.getTrackDrawable(), color, false, false, useDarker));
}
if (switchView.getThumbDrawable() != null) {
switchView.setThumbDrawable(modifySwitchDrawable(switchView.getContext(),
switchView.getThumbDrawable(), color, true, false, useDarker));
}
}
内容来源于网络,如有侵权,请联系作者删除!