本文整理汇总了Java中org.chromium.base.ApiCompatibilityUtils.getColorStateList方法的典型用法代码示例。如果您正苦于以下问题:Java ApiCompatibilityUtils.getColorStateList方法的具体用法?Java ApiCompatibilityUtils.getColorStateList怎么用?Java ApiCompatibilityUtils.getColorStateList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.chromium.base.ApiCompatibilityUtils
的用法示例。
在下文中一共展示了ApiCompatibilityUtils.getColorStateList方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateVisualsForState
import org.chromium.base.ApiCompatibilityUtils; //导入方法依赖的package包/类
/**
* Call to force the UI to update the state of various buttons based on whether or not the
* current tab is incognito.
*/
@Override
public void updateVisualsForState() {
if (updateUseDarkColors() || mIsEmphasizingHttpsScheme != shouldEmphasizeHttpsScheme()) {
updateSecurityIcon(getSecurityLevel());
}
ColorStateList colorStateList = ApiCompatibilityUtils.getColorStateList(getResources(),
mUseDarkColors ? R.color.dark_mode_tint : R.color.light_mode_tint);
mMicButton.setTint(colorStateList);
mDeleteButton.setTint(colorStateList);
setNavigationButtonType(mNavigationButtonType);
mUrlBar.setUseDarkTextColors(mUseDarkColors);
if (mSuggestionList != null) {
mSuggestionList.setBackground(getSuggestionPopupBackground());
}
mSuggestionListAdapter.setUseDarkColors(mUseDarkColors);
}
示例2: updateVisualsForTabModel
import org.chromium.base.ApiCompatibilityUtils; //导入方法依赖的package包/类
@Override
protected void updateVisualsForTabModel(boolean isIncognito) {
int queryTextColorId;
if (isIncognito) {
setBackgroundResource(R.color.incognito_primary_color);
ColorStateList white = ApiCompatibilityUtils.getColorStateList(getResources(),
R.color.light_mode_tint);
mFindNextButton.setTint(white);
mFindPrevButton.setTint(white);
mCloseFindButton.setTint(white);
queryTextColorId = R.color.find_in_page_query_white_color;
} else {
setBackgroundColor(Color.WHITE);
ColorStateList dark = ApiCompatibilityUtils.getColorStateList(getResources(),
R.color.dark_mode_tint);
mFindNextButton.setTint(dark);
mFindPrevButton.setTint(dark);
mCloseFindButton.setTint(dark);
queryTextColorId = R.color.find_in_page_query_color;
}
mFindQuery.setTextColor(
ApiCompatibilityUtils.getColor(getContext().getResources(), queryTextColorId));
}
示例3: DownloadItemView
import org.chromium.base.ApiCompatibilityUtils; //导入方法依赖的package包/类
/**
* Constructor for inflating from XML.
*/
public DownloadItemView(Context context, AttributeSet attrs) {
super(context, attrs);
mIconBackgroundColor =
ApiCompatibilityUtils.getColor(context.getResources(), R.color.light_active_color);
mIconBackgroundColorSelected =
ApiCompatibilityUtils.getColor(context.getResources(), R.color.google_grey_600);
mWhiteTint =
ApiCompatibilityUtils.getColorStateList(getResources(), R.color.white_mode_tint);
}
示例4: ToolbarLayout
import org.chromium.base.ApiCompatibilityUtils; //导入方法依赖的package包/类
/**
* Basic constructor for {@link ToolbarLayout}.
*/
public ToolbarLayout(Context context, AttributeSet attrs) {
super(context, attrs);
mToolbarHeightWithoutShadow = getResources().getDimensionPixelOffset(
getToolbarHeightWithoutShadowResId());
mDarkModeTint =
ApiCompatibilityUtils.getColorStateList(getResources(), R.color.dark_mode_tint);
mLightModeTint =
ApiCompatibilityUtils.getColorStateList(getResources(), R.color.light_mode_tint);
}
示例5: TintedDrawable
import org.chromium.base.ApiCompatibilityUtils; //导入方法依赖的package包/类
public TintedDrawable(Resources res, Bitmap bitmap) {
super(res, bitmap);
mTint = ApiCompatibilityUtils.getColorStateList(res, R.color.dark_mode_tint);
}