本文整理汇总了Java中com.mob.tools.utils.R.getStringRes方法的典型用法代码示例。如果您正苦于以下问题:Java R.getStringRes方法的具体用法?Java R.getStringRes怎么用?Java R.getStringRes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.mob.tools.utils.R
的用法示例。
在下文中一共展示了R.getStringRes方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPageTitle
import com.mob.tools.utils.R; //导入方法依赖的package包/类
private TitleLayout getPageTitle() {
this.llTitle = new TitleLayout(getContext());
this.llTitle.setId(1);
this.llTitle.getBtnBack().setOnClickListener(this);
int resId = R.getStringRes(this.activity, "multi_share");
if (resId > 0) {
this.llTitle.getTvTitle().setText(resId);
}
this.llTitle.getBtnRight().setVisibility(0);
resId = R.getStringRes(this.activity, "share");
if (resId > 0) {
this.llTitle.getBtnRight().setText(resId);
}
this.llTitle.getBtnRight().setOnClickListener(this);
LayoutParams lp = new LayoutParams(-2, -2);
lp.addRule(9);
lp.addRule(10);
lp.addRule(11);
this.llTitle.setLayoutParams(lp);
return this.llTitle;
}
示例2: updateConfirmView
import com.mob.tools.utils.R; //导入方法依赖的package包/类
private void updateConfirmView() {
int resId = R.getStringRes(activity, "ssdk_oks_confirm");
String confirm = "Confirm";
if(resId > 0) {
confirm = getContext().getResources().getString(resId);
}
if(checkNum == 0) {
tvConfirm.setText(confirm);
} else if(checkNum > 0) {
tvConfirm.setText(confirm + "(" + checkNum + ")");
}
}
示例3: getPlatformList
import com.mob.tools.utils.R; //导入方法依赖的package包/类
private LinearLayout getPlatformList() {
LinearLayout llToolBar = new LinearLayout(getContext());
llToolBar.setLayoutParams(new LinearLayout.LayoutParams(-1, -2));
TextView tvShareTo = new TextView(getContext());
int resId = R.getStringRes(this.activity, "share_to");
if (resId > 0) {
tvShareTo.setText(resId);
}
tvShareTo.setTextColor(-3158065);
tvShareTo.setTextSize(1, 18.0f);
int dp_9 = R.dipToPx(getContext(), 9);
LinearLayout.LayoutParams lpShareTo = new LinearLayout.LayoutParams(-2, -2);
lpShareTo.gravity = 16;
lpShareTo.setMargins(dp_9, 0, 0, 0);
tvShareTo.setLayoutParams(lpShareTo);
llToolBar.addView(tvShareTo);
HorizontalScrollView sv = new HorizontalScrollView(getContext());
sv.setHorizontalScrollBarEnabled(false);
sv.setHorizontalFadingEdgeEnabled(false);
LinearLayout.LayoutParams lpSv = new LinearLayout.LayoutParams(-2, -2);
lpSv.setMargins(dp_9, dp_9, dp_9, dp_9);
sv.setLayoutParams(lpSv);
llToolBar.addView(sv);
this.llPlat = new LinearLayout(getContext());
this.llPlat.setLayoutParams(new FrameLayout.LayoutParams(-2, -1));
sv.addView(this.llPlat);
return llToolBar;
}
示例4: shareAndFinish
import com.mob.tools.utils.R; //导入方法依赖的package包/类
/** 执行分享时的方法 */
private void shareAndFinish() {
int resId = R.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();
}
示例5: a
import com.mob.tools.utils.R; //导入方法依赖的package包/类
public void a(String str, String str2, String str3, String str4, String str5, boolean z, PlatformActionListener platformActionListener) {
if (TextUtils.isEmpty(str2)) {
throw new Throwable("titleUrl is needed");
} else if (TextUtils.isEmpty(str3)) {
throw new Throwable("text is needed");
} else {
CharSequence substring;
String string;
if (str.length() > 200) {
substring = str.substring(0, 200);
}
String substring2 = str3.length() > Record.TTL_MIN_SECONDS ? str3.substring(0, Record.TTL_MIN_SECONDS) : str3;
if (TextUtils.isEmpty(str5)) {
str5 = DeviceHelper.getInstance(this.a.getContext()).getAppName();
}
String str6 = str5.length() > 20 ? str5.substring(0, 20) + "..." : str5;
if (TextUtils.isEmpty(substring)) {
int stringRes = R.getStringRes(this.a.getContext(), "share_to_qzone_default");
string = stringRes > 0 ? this.a.getContext().getString(stringRes, new Object[]{str6}) : str6;
} else {
CharSequence charSequence = substring;
}
if (z) {
a(string, str2, substring2, str4, str6, platformActionListener);
} else {
b(string, str2, substring2, str4, str6, platformActionListener);
}
}
}
示例6: onCreate
import com.mob.tools.utils.R; //导入方法依赖的package包/类
public void onCreate() {
startSensor();
int resId = R.getBitmapRes(this.activity, "ssdk_oks_yaoyiyao");
if (resId > 0) {
ImageView iv = new ImageView(this.activity);
iv.setScaleType(ScaleType.CENTER_INSIDE);
iv.setImageResource(resId);
this.activity.setContentView(iv);
}
resId = R.getStringRes(this.activity, "shake2share");
if (resId > 0) {
Toast.makeText(this.activity, resId, 0).show();
}
}
示例7: getName
import com.mob.tools.utils.R; //导入方法依赖的package包/类
private String getName(Platform plat) {
if (plat == null) {
return "";
}
if (plat.getName() == null) {
return "";
}
int resId = R.getStringRes(this.context, plat.getName());
if (resId > 0) {
return this.context.getString(resId);
}
return null;
}
示例8: onPullDown
import com.mob.tools.utils.R; //导入方法依赖的package包/类
public void onPullDown(int percent) {
if (percent > 100) {
int degree = ((percent - 100) * 180) / 20;
if (degree > 180) {
degree = 180;
}
if (degree < 0) {
degree = 0;
}
this.ivArrow.setRotation(degree);
} else {
this.ivArrow.setRotation(0);
}
int resId;
if (percent < 100) {
resId = R.getStringRes(getContext(), "pull_to_refresh");
if (resId > 0) {
this.tvHeader.setText(resId);
return;
}
return;
}
resId = R.getStringRes(getContext(), "release_to_refresh");
if (resId > 0) {
this.tvHeader.setText(resId);
}
}
示例9: initPageView
import com.mob.tools.utils.R; //导入方法依赖的package包/类
private void initPageView() {
this.flPage = new FrameLayout(getContext());
this.flPage.setOnClickListener(this);
this.flPage.setBackgroundDrawable(new ColorDrawable(1426063360));
this.llPage = new LinearLayout(getContext()) {
public boolean onTouchEvent(MotionEvent event) {
return true;
}
};
this.llPage.setOrientation(1);
this.llPage.setBackgroundDrawable(new ColorDrawable(-1));
LayoutParams lpLl = new LayoutParams(-1, -2);
lpLl.gravity = 80;
this.llPage.setLayoutParams(lpLl);
this.flPage.addView(this.llPage);
this.grid = new PlatformGridView(getContext());
this.grid.setEditPageBackground(getBackgroundView());
this.grid.setLayoutParams(new LinearLayout.LayoutParams(-1, -2));
this.llPage.addView(this.grid);
this.btnCancel = new Button(getContext());
this.btnCancel.setTextColor(AbstractWheelTextAdapter.DEFAULT_TEXT_COLOR);
this.btnCancel.setTextSize(1, 20.0f);
int resId = R.getStringRes(getContext(), "cancel");
if (resId > 0) {
this.btnCancel.setText(resId);
}
this.btnCancel.setPadding(0, 0, 0, R.dipToPx(getContext(), 5));
resId = R.getBitmapRes(getContext(), "classic_platform_corners_bg");
if (resId > 0) {
this.btnCancel.setBackgroundResource(resId);
} else {
this.btnCancel.setBackgroundDrawable(new ColorDrawable(-1));
}
LinearLayout.LayoutParams lpBtn = new LinearLayout.LayoutParams(-1, R.dipToPx(getContext(), 45));
int dp_10 = R.dipToPx(getContext(), 10);
lpBtn.setMargins(dp_10, dp_10, dp_10, dp_10);
this.btnCancel.setLayoutParams(lpBtn);
this.llPage.addView(this.btnCancel);
}
示例10: initTitle
import com.mob.tools.utils.R; //导入方法依赖的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 = R.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 = R.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 = R.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);
}
示例11: handleMessage
import com.mob.tools.utils.R; //导入方法依赖的package包/类
public final boolean handleMessage(Message msg) {
switch (msg.arg1) {
case 1: {
// 成功
int resId = R.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;
}
示例12: initTitle
import com.mob.tools.utils.R; //导入方法依赖的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 = R.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 = R.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 = R.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);
}
示例13: refreshPanel
import com.mob.tools.utils.R; //导入方法依赖的package包/类
private void refreshPanel(LinearLayout[] llCells, Object[] logos) {
int cellBack = R.getBitmapRes(page.getContext(), "ssdk_oks_classic_platform_cell_back");
int disableBack = R.getBitmapRes(page.getContext(), "ssdk_oks_classic_platfrom_cell_back_nor");
for (int i = 0; i < logos.length; i++) {
ImageView ivLogo = R.forceCast(llCells[i].getChildAt(0));
TextView tvName = R.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 = R.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 = R.forceCast(logos[i]);
String name = plat.getName().toLowerCase();
int resId = R.getBitmapRes(ivLogo.getContext(),"ssdk_oks_classic_" + name);
if (resId > 0) {
ivLogo.setImageResource(resId);
} else {
ivLogo.setImageBitmap(null);
}
resId = R.getStringRes(tvName.getContext(), "ssdk_" + name);
if (resId > 0) {
tvName.setText(resId);
} else {
tvName.setText("");
}
}
}
}
}
示例14: onCreate
import com.mob.tools.utils.R; //导入方法依赖的package包/类
public void onCreate() {
LinearLayout llPage = new LinearLayout(getContext());
llPage.setBackgroundColor(-657931);
llPage.setOrientation(1);
this.activity.setContentView(llPage);
this.llTitle = new TitleLayout(getContext());
int resId = R.getBitmapRes(getContext(), "title_back");
if (resId > 0) {
this.llTitle.setBackgroundResource(resId);
}
this.llTitle.getBtnBack().setOnClickListener(this);
resId = R.getStringRes(getContext(), "multi_share");
if (resId > 0) {
this.llTitle.getTvTitle().setText(resId);
}
this.llTitle.getBtnRight().setVisibility(0);
resId = R.getStringRes(getContext(), SportPlanFragment.COURSE_STATUS_FINISH);
if (resId > 0) {
this.llTitle.getBtnRight().setText(resId);
}
this.llTitle.getBtnRight().setOnClickListener(this);
this.llTitle.setLayoutParams(new LayoutParams(-1, -2));
llPage.addView(this.llTitle);
FrameLayout flPage = new FrameLayout(getContext());
LayoutParams lpFl = new LayoutParams(-1, -2);
lpFl.weight = 1.0f;
flPage.setLayoutParams(lpFl);
llPage.addView(flPage);
PullToRefreshView followList = new PullToRefreshView(getContext());
followList.setLayoutParams(new FrameLayout.LayoutParams(-1, -1));
flPage.addView(followList);
this.adapter = new FollowAdapter(followList);
this.adapter.setPlatform(this.platform);
followList.setAdapter(this.adapter);
this.adapter.getListView().setOnItemClickListener(this);
ImageView ivShadow = new ImageView(getContext());
resId = R.getBitmapRes(getContext(), "title_shadow");
if (resId > 0) {
ivShadow.setBackgroundResource(resId);
}
ivShadow.setLayoutParams(new FrameLayout.LayoutParams(-1, -2));
flPage.addView(ivShadow);
followList.performPulling(true);
}