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

The following examples show how to use android.view.View#setBackgroundTintMode() . 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: ViewUtils.java    From DevUtils with Apache License 2.0 5 votes vote down vote up
/**
 * 设置背景着色模式
 * @param view     {@link View}
 * @param tintMode 着色模式 {@link PorterDuff.Mode}
 * @return {@link View}
 */
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public static View setBackgroundTintMode(final View view, final PorterDuff.Mode tintMode) {
    if (view != null) {
        try {
            view.setBackgroundTintMode(tintMode);
        } catch (Exception e) {
            LogPrintUtils.eTag(TAG, e, "setBackgroundTintMode");
        }
    }
    return view;
}
 
Example 2
Source File: ViewCompatLollipop.java    From letv with Apache License 2.0 4 votes vote down vote up
static void setBackgroundTintMode(View view, Mode mode) {
    view.setBackgroundTintMode(mode);
}