本文整理汇总了Java中com.mob.tools.utils.ResHelper.getColorRes方法的典型用法代码示例。如果您正苦于以下问题:Java ResHelper.getColorRes方法的具体用法?Java ResHelper.getColorRes怎么用?Java ResHelper.getColorRes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.mob.tools.utils.ResHelper
的用法示例。
在下文中一共展示了ResHelper.getColorRes方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDefaultTabView
import com.mob.tools.utils.ResHelper; //导入方法依赖的package包/类
private TextView createDefaultTabView(Context context) {
TextView tvTab = new TextView(context);
tvTab.setGravity(Gravity.CENTER);
TabTextViewStyle tabTextViewStyle = getTabTextViewStyle();
if(tabTextViewStyle == null) {
tabTextViewStyle = new TabTextViewStyle();
}
if(tabTextViewStyle.idTabTextSize == null) {
tabTextViewStyle.idTabTextSize = ResHelper.getResId(context, "dimen", "bbs_menu_tab_txt_size");
}
int tvTabSize = getResources().getDimensionPixelSize(tabTextViewStyle.idTabTextSize);
tvTab.setTextSize(TypedValue.COMPLEX_UNIT_PX, tvTabSize);
if(tabTextViewStyle.idTabTextColor == null) {
tabTextViewStyle.idTabTextColor = ResHelper.getColorRes(context, "bbs_menu_tab_txt_color");
}
ColorStateList csl = context.getResources().getColorStateList(tabTextViewStyle.idTabTextColor);
if (csl != null) {
tvTab.setTextColor(csl);
}
if(tabTextViewStyle.idTabTextLeftRightPadding == null) {
tabTextViewStyle.idTabTextLeftRightPadding = ResHelper.getResId(context, "dimen", "bbs_menu_tab_txt_padding");
}
int tvTabPadding = getResources().getDimensionPixelSize(tabTextViewStyle.idTabTextLeftRightPadding);
tvTab.setPadding(tvTabPadding, 0, tvTabPadding, 0);
return tvTab;
}
示例2: getTabTextViewStyle
import com.mob.tools.utils.ResHelper; //导入方法依赖的package包/类
@Override
protected TabTextViewStyle getTabTextViewStyle() {
TabTextViewStyle tabTextViewStyle = new TabTextViewStyle();
tabTextViewStyle.idTabTextColor = ResHelper.getColorRes(getContext(), "bbs_theme0_forumthreadview_tabtext");
tabTextViewStyle.idTabTextSize = ResHelper.getResId(getContext(), "dimen", "bbs_theme0_menu_tab_txt_size");
return tabTextViewStyle;
}
示例3: getTabTextViewStyle
import com.mob.tools.utils.ResHelper; //导入方法依赖的package包/类
@Override
protected TabTextViewStyle getTabTextViewStyle() {
TabTextViewStyle tabTextViewStyle = new TabTextViewStyle();
tabTextViewStyle.idTabTextColor = ResHelper.getColorRes(getContext(), "bbs_theme0_forumsubjectthreadview_tabunselectedtext");
tabTextViewStyle.idTabTextSize = ResHelper.getResId(getContext(), "dimen", "bbs_theme0_forumsubjectmenu_tab_txt_size");
return tabTextViewStyle;
}
示例4: SlidingTabStrip
import com.mob.tools.utils.ResHelper; //导入方法依赖的package包/类
public SlidingTabStrip(Context context, AttributeSet attrs) {
super(context, attrs);
slidingTabStripStyle = getSlidingTabStripStyle();
if(slidingTabStripStyle == null) {
slidingTabStripStyle = new SlidingTabStripStyle();
}
if(slidingTabStripStyle.idTabUnderLineWidth == null) {
slidingTabStripStyle.idTabUnderLineWidth = ResHelper.getResId(context, "dimen", "bbs_menu_tab_under_line_width");
}
bottomwidth = context.getResources().getDimensionPixelSize(slidingTabStripStyle.idTabUnderLineWidth);
screenWidth = ResHelper.getScreenWidth(context);
setWillNotDraw(false);
if(slidingTabStripStyle.idTabSelectedLineHeight == null) {
slidingTabStripStyle.idTabSelectedLineHeight = ResHelper.getResId(context, "dimen", "bbs_menu_tab_selected_line_height");
}
selectedTabLineHeight = getResources().getDimensionPixelSize(slidingTabStripStyle.idTabSelectedLineHeight);
selectedTabLinePaint = new Paint();
if(slidingTabStripStyle.idTabSelectedLineColor == null) {
slidingTabStripStyle.idTabSelectedLineColor = ResHelper.getColorRes(context, "bbs_menu_tab_selected_line_color");
}
selectedTabLinePaint.setColor(getResources().getColor(slidingTabStripStyle.idTabSelectedLineColor));
if(slidingTabStripStyle.idTabUnderLineHeight == null) {
slidingTabStripStyle.idTabUnderLineHeight = ResHelper.getResId(context, "dimen", "bbs_menu_tab_under_line_height");
}
underLineHeight = getResources().getDimensionPixelSize(slidingTabStripStyle.idTabUnderLineHeight);
underLinePaint = new Paint();
if(slidingTabStripStyle.idTabUnderLineColor == null) {
slidingTabStripStyle.idTabUnderLineColor = ResHelper.getColorRes(context, "bbs_menu_tab_under_line_color");
}
underLinePaint.setColor(getResources().getColor(slidingTabStripStyle.idTabUnderLineColor));
}
示例5: init
import com.mob.tools.utils.ResHelper; //导入方法依赖的package包/类
private void init(Context context) {
SizeHelper.prepare(context);
lvContries = new GroupListView(context);
lvContries.setDividerHeight(SizeHelper.fromPxWidth(1));
int resId = ResHelper.getBitmapRes(context, "smssdk_cl_divider");
if (resId > 0) {
lvContries.setDivider(context.getResources().getDrawable(resId));
}
adapter = new CountryAdapter(lvContries);
lvContries.setAdapter(adapter);
LayoutParams lpContries = new LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
int dp9 = SizeHelper.fromPxWidth(12);
lpContries.setMargins(dp9, 0, dp9, 0);
addView(lvContries, lpContries);
tvScroll = new TextView(context);
resId = ResHelper.getColorRes(context, "smssdk_white");
if (resId > 0) {
tvScroll.setTextColor(context.getResources().getColor(resId));
}
resId = ResHelper.getBitmapRes(context, "smssdk_country_group_scroll_down");
if (resId > 0) {
tvScroll.setBackgroundResource(resId);
}
tvScroll.setTextSize(TypedValue.COMPLEX_UNIT_PX, SizeHelper.fromPxWidth(80));
tvScroll.setTypeface(Typeface.DEFAULT);
tvScroll.setVisibility(GONE);
tvScroll.setGravity(Gravity.CENTER);
int dp80 = SizeHelper.fromPxWidth(120);
LayoutParams lp = new LayoutParams(dp80, dp80);
lp.addRule(CENTER_IN_PARENT);
addView(tvScroll, lp);
llScroll = new LinearLayout(context);
resId = ResHelper.getBitmapRes(context, "smssdk_country_group_scroll_up");
if (resId > 0) {
llScroll.setBackgroundResource(resId);
}
llScroll.setOrientation(LinearLayout.VERTICAL);
llScroll.setOnTouchListener(this);
lp = new LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
lp.addRule(ALIGN_PARENT_RIGHT);
lp.addRule(CENTER_VERTICAL);
lp.rightMargin = SizeHelper.fromPxWidth(7);
addView(llScroll, lp);
initScroll(context);
}
示例6: getSlidingTabStripStyle
import com.mob.tools.utils.ResHelper; //导入方法依赖的package包/类
@Override
protected ForumThreadView.SlidingTabStripStyle getSlidingTabStripStyle() {
SlidingTabStripStyle slidingTabStripStyle = new SlidingTabStripStyle();
slidingTabStripStyle.idTabSelectedLineColor = ResHelper.getColorRes(getContext(), "bbs_theme0_forumthreadview_tabselectedline");
return slidingTabStripStyle;
}
示例7: getSlidingTabStripStyle
import com.mob.tools.utils.ResHelper; //导入方法依赖的package包/类
@Override
protected ForumThreadView.SlidingTabStripStyle getSlidingTabStripStyle() {
SlidingTabStripStyle slidingTabStripStyle = new SlidingTabStripStyle();
slidingTabStripStyle.idTabSelectedLineColor = ResHelper.getColorRes(getContext(), "bbs_theme0_forumsubjectthreadview_tabselectedline");
return slidingTabStripStyle;
}
示例8: initContentView
import com.mob.tools.utils.ResHelper; //导入方法依赖的package包/类
protected View initContentView(Context context, AttributeSet attrs, int defStyleAttr) {
ForumThreadViewStyle viewstyle = getForumThreadViewStyle();
if(viewstyle == null) {
viewstyle = new ForumThreadViewStyle();
}
if(viewstyle.idMenuTabHeight == null) {
viewstyle.idMenuTabHeight = ResHelper.getResId(context, "dimen", "bbs_menu_tab_height");
}
tabHeight = getResources().getDimensionPixelSize(viewstyle.idMenuTabHeight);
LinearLayout llContent = new LinearLayout(context, attrs, defStyleAttr);
llContent.setBackgroundColor(getResources().getColor(ResHelper.getColorRes(getContext(), "bbs_white")));
llContent.setOrientation(LinearLayout.VERTICAL);
hsvContent = new HorizontalScrollView(context);
if(viewstyle.idMenuTabBg == null) {
viewstyle.idMenuTabBg = ResHelper.getColorRes(context, "bbs_menu_tab_bg");
}
hsvContent.setBackgroundColor(context.getResources().getColor(viewstyle.idMenuTabBg));
hsvContent.setHorizontalScrollBarEnabled(false);
hsvContent.setFillViewport(true);
slidingTabStrip = new SlidingTabStrip(context);
initTabStrip();
hsvContent.addView(slidingTabStrip, LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
LinearLayout.LayoutParams llp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, tabHeight);
llContent.addView(hsvContent, llp);
View divider = new View(context);
if(viewstyle.idMenuTabDividerColor == null) {
viewstyle.idMenuTabDividerColor = ResHelper.getColorRes(context, "bbs_divider");
}
divider.setBackgroundColor(context.getResources().getColor(viewstyle.idMenuTabDividerColor));
if(viewstyle.idMenuTabDividerHeight == null) {
viewstyle.idMenuTabDividerHeight = ResHelper.getResId(context, "dimen", "bbs_menu_tab_divider_height");
}
llp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
getResources().getDimensionPixelSize(viewstyle.idMenuTabDividerHeight));
llContent.addView(divider, llp);
viewPager = buildViewPager();
llp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, 0);
llp.weight = 1;
llContent.addView(viewPager, llp);
return llContent;
}
示例9: getColorId
import com.mob.tools.utils.ResHelper; //导入方法依赖的package包/类
public Integer getColorId(String name) {
return ResHelper.getColorRes(getContext(), name);
}