当前位置: 首页>>代码示例>>Java>>正文


Java ResHelper.getStringRes方法代码示例

本文整理汇总了Java中com.mob.tools.utils.ResHelper.getStringRes方法的典型用法代码示例。如果您正苦于以下问题:Java ResHelper.getStringRes方法的具体用法?Java ResHelper.getStringRes怎么用?Java ResHelper.getStringRes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.mob.tools.utils.ResHelper的用法示例。


在下文中一共展示了ResHelper.getStringRes方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import com.mob.tools.utils.ResHelper; //导入方法依赖的package包/类
@Override
public void onCreate() {
	ContactDetailPageLayout page = new ContactDetailPageLayout(activity);
	LinearLayout layout = page.getLayout();

	if (layout != null) {
		int resId = 0;
		activity.setContentView(layout);
		activity.findViewById(ResHelper.getIdRes(activity, "ll_back")).setOnClickListener(this);
		TextView tvTitle = (TextView) activity.findViewById(ResHelper.getIdRes(activity, "tv_title"));
		resId = ResHelper.getStringRes(activity, "smssdk_contacts_detail");
		tvTitle.setText(resId);

		TextView tvContactName = (TextView) activity.findViewById(ResHelper.getIdRes(activity, "tv_contact_name"));
		tvContactName.setText(phoneName);

		TextView tvPhonesList = (TextView) activity.findViewById(ResHelper.getIdRes(activity, "tv_contact_phones"));
		StringBuilder phones = new StringBuilder();
		for(String phone : phoneList){
			phones.append("\n");
			phones.append(phone);
		}
		if(phones.length() > 0){
			phones.deleteCharAt(0);
			tvPhonesList.setText(phones.toString());
		}

		TextView tvInviteHint = (TextView) activity.findViewById(ResHelper.getIdRes(activity, "tv_invite_hint"));
		resId = ResHelper.getStringRes(activity, "smssdk_not_invite");
		String hint = getContext().getResources().getString(resId, phoneName);
		tvInviteHint.setText(Html.fromHtml(hint));

		activity.findViewById(ResHelper.getIdRes(activity, "btn_invite")).setOnClickListener(this);
	}
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:36,代码来源:ContactDetailPage.java

示例2: onRequest

import com.mob.tools.utils.ResHelper; //导入方法依赖的package包/类
public void onRequest() {
	ivArrow.setVisibility(View.GONE);
	pbRefreshing.setVisibility(View.VISIBLE);
	int resId = ResHelper.getStringRes(getContext(), "ssdk_oks_refreshing");
	if (resId > 0) {
		tvHeader.setText(resId);
	}
}
 
开发者ID:android-jian,项目名称:topnews,代码行数:9,代码来源:PRTHeader.java

示例3: onItemClick

import com.mob.tools.utils.ResHelper; //导入方法依赖的package包/类
public void onItemClick(GroupListView parent, View view, int group, int position) {
	if(position >= 0){
		String[] country = listView.getCountry(group, position);
		if (countryRules != null && countryRules.containsKey(country[1])) {
			id = country[2];
			finish();
		} else {
			int resId = ResHelper.getStringRes(activity, "smssdk_country_not_support_currently");
			if (resId > 0) {
				Toast.makeText(activity, resId, Toast.LENGTH_SHORT).show();
			}
		}
	}
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:15,代码来源:CountryPage.java

示例4: refreshPanel

import com.mob.tools.utils.ResHelper; //导入方法依赖的package包/类
private void refreshPanel(LinearLayout[] llCells, Object[] logos) {
	int cellBack = ResHelper.getBitmapRes(page.getContext(), "ssdk_oks_classic_platform_cell_back");
	int disableBack = ResHelper.getBitmapRes(page.getContext(), "ssdk_oks_classic_platfrom_cell_back_nor");
	for (int i = 0; i < logos.length; i++) {
		ImageView ivLogo = ResHelper.forceCast(llCells[i].getChildAt(0));
		TextView tvName = ResHelper.forceCast(llCells[i].getChildAt(1));
		if (logos[i] == null) {
			ivLogo.setVisibility(View.INVISIBLE);
			tvName.setVisibility(View.INVISIBLE);
			llCells[i].setBackgroundResource(disableBack);
			llCells[i].setOnClickListener(null);
		} else {
			ivLogo.setVisibility(View.VISIBLE);
			tvName.setVisibility(View.VISIBLE);
			ivLogo.requestLayout();
			tvName.requestLayout();
			llCells[i].setBackgroundResource(cellBack);
			llCells[i].setOnClickListener(this);
			llCells[i].setTag(logos[i]);

			if (logos[i] instanceof CustomerLogo) {
				CustomerLogo logo = ResHelper.forceCast(logos[i]);
				if (logo.logo != null) {
					ivLogo.setImageBitmap(logo.logo);
				} else {
					ivLogo.setImageBitmap(null);
				}
				if (logo.label != null) {
					tvName.setText(logo.label);
				} else {
					tvName.setText("");
				}
			} else {
				Platform plat = ResHelper.forceCast(logos[i]);
				String name = plat.getName().toLowerCase();
				int resId = ResHelper.getBitmapRes(ivLogo.getContext(),"ssdk_oks_classic_" + name);
				if (resId > 0) {
					ivLogo.setImageResource(resId);
				} else {
					ivLogo.setImageBitmap(null);
				}
				resId = ResHelper.getStringRes(tvName.getContext(), "ssdk_" + name);
				if (resId > 0) {
					tvName.setText(resId);
				} else {
					tvName.setText("");
				}
			}
		}
	}
}
 
开发者ID:android-jian,项目名称:topnews,代码行数:52,代码来源:PlatformPageAdapter.java

示例5: shareAndFinish

import com.mob.tools.utils.ResHelper; //导入方法依赖的package包/类
/** 执行分享时的方法 */
private void shareAndFinish() {
	int resId = ResHelper.getStringRes(activity, "ssdk_oks_sharing");
	if (resId > 0) {
		Toast.makeText(activity, resId, Toast.LENGTH_SHORT).show();
	}

	if (isDisableSSO()) {
		platform.SSOSetting(true);
	}
	platform.setPlatformActionListener(getCallback());
	platform.share(sp);

	finish();
}
 
开发者ID:AndroidBoySC,项目名称:Mybilibili,代码行数:16,代码来源:EditPage.java

示例6: initTitle

import com.mob.tools.utils.ResHelper; //导入方法依赖的package包/类
private void initTitle(RelativeLayout rlTitle, float ratio) {
	tvCancel = new TextView(activity);
	tvCancel.setTextColor(0xff3b3b3b);
	tvCancel.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
	tvCancel.setGravity(Gravity.CENTER);
	int resId = ResHelper.getStringRes(activity, "ssdk_oks_cancel");
	if (resId > 0) {
		tvCancel.setText(resId);
	}
	int padding = (int) (DESIGN_LEFT_PADDING * ratio);
	tvCancel.setPadding(padding, 0, padding, 0);
	RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
	rlTitle.addView(tvCancel, lp);
	tvCancel.setOnClickListener(this);

	TextView tvTitle = new TextView(activity);
	tvTitle.setTextColor(0xff3b3b3b);
	tvTitle.setTextSize(TypedValue.COMPLEX_UNIT_SP, 22);
	tvTitle.setGravity(Gravity.CENTER);
	resId = ResHelper.getStringRes(activity, "ssdk_oks_contacts");
	if (resId > 0) {
		tvTitle.setText(resId);
	}
	lp = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
	lp.addRule(RelativeLayout.CENTER_IN_PARENT);
	rlTitle.addView(tvTitle, lp);

	tvConfirm = new TextView(activity);
	tvConfirm.setTextColor(0xffff6d11);
	tvConfirm.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
	tvConfirm.setGravity(Gravity.CENTER);
	resId = ResHelper.getStringRes(activity, "ssdk_oks_confirm");
	if (resId > 0) {
		tvConfirm.setText(resId);
	}
	tvConfirm.setPadding(padding, 0, padding, 0);
	lp = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
	lp.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
	rlTitle.addView(tvConfirm, lp);
	tvConfirm.setOnClickListener(this);
}
 
开发者ID:starryxp,项目名称:LQRWeChat-master,代码行数:42,代码来源:FriendListPage.java

示例7: handleMessage

import com.mob.tools.utils.ResHelper; //导入方法依赖的package包/类
public final boolean handleMessage(Message msg) {
	switch (msg.arg1) {
		case 1: {
			// 成功
			int resId = ResHelper.getStringRes(context, "ssdk_oks_share_completed");
			if (resId > 0) {
				toast(context.getString(resId));
			}
		} break;
		case 2: {
			// 失败
			String expName = msg.obj.getClass().getSimpleName();
			if ("WechatClientNotExistException".equals(expName)
					|| "WechatTimelineNotSupportedException".equals(expName)
					|| "WechatFavoriteNotSupportedException".equals(expName)) {
				toast("ssdk_wechat_client_inavailable");
			} else if ("GooglePlusClientNotExistException".equals(expName)) {
				toast("ssdk_google_plus_client_inavailable");
			} else if ("QQClientNotExistException".equals(expName)) {
				toast("ssdk_qq_client_inavailable");
			} else if ("YixinClientNotExistException".equals(expName)
					|| "YixinTimelineNotSupportedException".equals(expName)) {
				toast("ssdk_yixin_client_inavailable");
			} else if ("KakaoTalkClientNotExistException".equals(expName)) {
				toast("ssdk_kakaotalk_client_inavailable");
			} else if ("KakaoStoryClientNotExistException".equals(expName)) {
				toast("ssdk_kakaostory_client_inavailable");
			} else if("WhatsAppClientNotExistException".equals(expName)){
				toast("ssdk_whatsapp_client_inavailable");
			} else if("FacebookMessengerClientNotExistException".equals(expName)){
				toast("ssdk_facebookmessenger_client_inavailable");
			} else {
				toast("ssdk_oks_share_failed");
			}
		} break;
		case 3: {
			// 取消
			toast("ssdk_oks_share_canceled");
		} break;
	}
	return false;
}
 
开发者ID:android-jian,项目名称:topnews,代码行数:43,代码来源:OnekeyShareThemeImpl.java

示例8: refreshPanel

import com.mob.tools.utils.ResHelper; //导入方法依赖的package包/类
private void refreshPanel(LinearLayout[] llCells, Object[] logos) {
	int cellBack = ResHelper.getBitmapRes(page.getContext(), "ssdk_oks_classic_platform_cell_back");
	int disableBack = ResHelper.getBitmapRes(page.getContext(), "ssdk_oks_classic_platfrom_cell_back_nor");
	for (int i = 0; i < logos.length; i++) {
		ImageView ivLogo = ResHelper.forceCast(llCells[i].getChildAt(0));
		TextView tvName = ResHelper.forceCast(llCells[i].getChildAt(1));
		if (logos[i] == null) {
			ivLogo.setVisibility(View.INVISIBLE);
			tvName.setVisibility(View.INVISIBLE);
			llCells[i].setBackgroundResource(disableBack);
			llCells[i].setOnClickListener(null);
		} else {
			ivLogo.setVisibility(View.VISIBLE);
			tvName.setVisibility(View.VISIBLE);
			llCells[i].setBackgroundResource(cellBack);
			llCells[i].setOnClickListener(this);
			llCells[i].setTag(logos[i]);

			if (logos[i] instanceof CustomerLogo) {
				CustomerLogo logo = ResHelper.forceCast(logos[i]);
				if (logo.logo != null) {
					ivLogo.setImageBitmap(logo.logo);
				} else {
					ivLogo.setImageBitmap(null);
				}
				if (logo.label != null) {
					tvName.setText(logo.label);
				} else {
					tvName.setText("");
				}
			} else {
				Platform plat = ResHelper.forceCast(logos[i]);
				String name = plat.getName().toLowerCase();
				int resId = ResHelper.getBitmapRes(ivLogo.getContext(),"ssdk_oks_classic_" + name);
				if (resId > 0) {
					ivLogo.setImageResource(resId);
				} else {
					ivLogo.setImageBitmap(null);
				}
				resId = ResHelper.getStringRes(tvName.getContext(), "ssdk_" + name);
				if (resId > 0) {
					tvName.setText(resId);
				} else {
					tvName.setText("");
				}
			}
		}
	}
}
 
开发者ID:ittianyu,项目名称:POCenter,代码行数:50,代码来源:PlatformPageAdapter.java

示例9: initTitle

import com.mob.tools.utils.ResHelper; //导入方法依赖的package包/类
private void initTitle(RelativeLayout rlTitle, float ratio) {
	tvCancel = new TextView(activity);
	tvCancel.setTextColor(0xff3b3b3b);
	tvCancel.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
	tvCancel.setGravity(Gravity.CENTER);
	int resId = ResHelper.getStringRes(activity, "ssdk_oks_cancel");
	if (resId > 0) {
		tvCancel.setText(resId);
	}
	int padding = (int) (DESIGN_LEFT_PADDING * ratio);
	tvCancel.setPadding(padding, 0, padding, 0);
	RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
	rlTitle.addView(tvCancel, lp);
	tvCancel.setOnClickListener(this);

	TextView tvTitle = new TextView(activity);
	tvTitle.setTextColor(0xff3b3b3b);
	tvTitle.setTextSize(TypedValue.COMPLEX_UNIT_SP, 22);
	tvTitle.setGravity(Gravity.CENTER);
	resId = ResHelper.getStringRes(activity, "ssdk_oks_multi_share");
	if (resId > 0) {
		tvTitle.setText(resId);
	}
	lp = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
	lp.addRule(RelativeLayout.CENTER_IN_PARENT);
	rlTitle.addView(tvTitle, lp);

	tvShare = new TextView(activity);
	tvShare.setTextColor(0xffff6d11);
	tvShare.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
	tvShare.setGravity(Gravity.CENTER);
	resId = ResHelper.getStringRes(activity, "ssdk_oks_share");
	if (resId > 0) {
		tvShare.setText(resId);
	}
	tvShare.setPadding(padding, 0, padding, 0);
	lp = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
	lp.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
	rlTitle.addView(tvShare, lp);
	tvShare.setOnClickListener(this);
}
 
开发者ID:android-jian,项目名称:topnews,代码行数:42,代码来源:EditPageLand.java

示例10: getEmptyViewStrId

import com.mob.tools.utils.ResHelper; //导入方法依赖的package包/类
@Override
protected Integer getEmptyViewStrId() {
	return ResHelper.getStringRes(getContext(), "bbs_theme1_pullrequestview_nomessage");
}
 
开发者ID:MobClub,项目名称:BBSSDK-for-Android,代码行数:5,代码来源:Theme1MessagesPullRequestView.java


注:本文中的com.mob.tools.utils.ResHelper.getStringRes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。