Java Code Examples for com.mob.tools.utils.R#getStringRes()

The following examples show how to use com.mob.tools.utils.R#getStringRes() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FriendListPage.java    From Social with Apache License 2.0 5 votes vote down vote up
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 + ")");
	}
}
 
Example 2
Source File: FriendListPage.java    From GithubApp with Apache License 2.0 5 votes vote down vote up
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 + ")");
	}
}
 
Example 3
Source File: FriendListPage.java    From MyHearts with Apache License 2.0 5 votes vote down vote up
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 + ")");
	}
}
 
Example 4
Source File: FriendListPage.java    From HHComicViewer with Apache License 2.0 5 votes vote down vote up
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 + ")");
	}
}
 
Example 5
Source File: EditPage.java    From fingerpoetry-android with Apache License 2.0 5 votes vote down vote up
/** 执行分享时的方法 */
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();
}
 
Example 6
Source File: EditPage.java    From Mobike with Apache License 2.0 5 votes vote down vote up
/** 执行分享时的方法 */
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();
}
 
Example 7
Source File: EditPagePort.java    From GithubApp with Apache License 2.0 4 votes vote down vote up
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);
}
 
Example 8
Source File: FriendListPage.java    From GithubApp with Apache License 2.0 4 votes vote down vote up
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);
}
 
Example 9
Source File: EditPagePort.java    From MyHearts with Apache License 2.0 4 votes vote down vote up
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);
}
 
Example 10
Source File: FriendListPage.java    From MyHearts with Apache License 2.0 4 votes vote down vote up
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);
}
 
Example 11
Source File: PlatformPageAdapter.java    From MyHearts with Apache License 2.0 4 votes vote down vote up
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("");
				}
			}
		}
	}
}
 
Example 12
Source File: EditPagePort.java    From fingerpoetry-android with Apache License 2.0 4 votes vote down vote up
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);
}
 
Example 13
Source File: EditPageLand.java    From HHComicViewer with Apache License 2.0 4 votes vote down vote up
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);
}
 
Example 14
Source File: EditPagePort.java    From Mobike with Apache License 2.0 4 votes vote down vote up
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);
}
 
Example 15
Source File: EditPageLand.java    From Social with Apache License 2.0 4 votes vote down vote up
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);
}
 
Example 16
Source File: PlatformPageAdapter.java    From Mobike with Apache License 2.0 4 votes vote down vote up
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("");
				}
			}
		}
	}
}
 
Example 17
Source File: OnekeyShareThemeImpl.java    From HHComicViewer with Apache License 2.0 4 votes vote down vote up
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;
}
 
Example 18
Source File: EditPageLand.java    From fingerpoetry-android with Apache License 2.0 4 votes vote down vote up
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);
}
 
Example 19
Source File: EditPageLand.java    From GithubApp with Apache License 2.0 4 votes vote down vote up
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);
}
 
Example 20
Source File: OnekeyShareThemeImpl.java    From GithubApp with Apache License 2.0 4 votes vote down vote up
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;
}