本文整理汇总了Java中com.mob.tools.utils.ResHelper.getResId方法的典型用法代码示例。如果您正苦于以下问题:Java ResHelper.getResId方法的具体用法?Java ResHelper.getResId怎么用?Java ResHelper.getResId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.mob.tools.utils.ResHelper
的用法示例。
在下文中一共展示了ResHelper.getResId方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getForumThreadViewStyle
import com.mob.tools.utils.ResHelper; //导入方法依赖的package包/类
@Override
protected ForumThreadViewStyle getForumThreadViewStyle() {
ForumThreadViewStyle viewstyle = new ForumThreadViewStyle();
viewstyle.idMenuTabDividerHeight = ResHelper.getResId(getContext(), "dimen", "bbs_theme0_forumsubjectthreadview_tab_divider_height");
return viewstyle;
}
示例6: 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;
}
示例7: getMenuRes
import com.mob.tools.utils.ResHelper; //导入方法依赖的package包/类
public static Integer getMenuRes(Context context, String resname) {
return ResHelper.getResId(context, "menu", resname);
}