Java Code Examples for android.view.View#getBackgroundTintList()

The following examples show how to use android.view.View#getBackgroundTintList() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PreviewMorphAnimator.java    From PreviewSeekBar with Apache License 2.0 5 votes vote down vote up
private void tintViews(PreviewBar previewBar,
                       View morphView,
                       View frameView) {
    int color = previewBar.getScrubberColor();
    if (morphView.getBackgroundTintList() == null
            || morphView.getBackgroundTintList().getDefaultColor() != color) {
        Drawable drawable = DrawableCompat.wrap(morphView.getBackground());
        DrawableCompat.setTint(drawable, color);
        morphView.setBackground(drawable);
        frameView.setBackgroundColor(color);
    }
}
 
Example 2
Source File: ViewUtils.java    From DevUtils with Apache License 2.0 4 votes vote down vote up
/**
 * 获取 View 背景着色颜色
 * @param view {@link View}
 * @return 背景着色颜色 {@link ColorStateList}
 */
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public static ColorStateList getBackgroundTintList(final View view) {
    if (view != null) return view.getBackgroundTintList();
    return null;
}
 
Example 3
Source File: ViewCompatLollipop.java    From letv with Apache License 2.0 4 votes vote down vote up
static ColorStateList getBackgroundTintList(View view) {
    return view.getBackgroundTintList();
}