本文整理汇总了Java中com.mob.tools.utils.R.forceCast方法的典型用法代码示例。如果您正苦于以下问题:Java R.forceCast方法的具体用法?Java R.forceCast怎么用?Java R.forceCast使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.mob.tools.utils.R
的用法示例。
在下文中一共展示了R.forceCast方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shareDataToShareParams
import com.mob.tools.utils.R; //导入方法依赖的package包/类
final ShareParams shareDataToShareParams(Platform plat) {
if (plat == null || shareParamsMap == null) {
toast("ssdk_oks_share_failed");
return null;
}
try {
String imagePath = R.forceCast(shareParamsMap.get("imagePath"));
Bitmap viewToShare = R.forceCast(shareParamsMap.get("viewToShare"));
if (TextUtils.isEmpty(imagePath) && viewToShare != null && !viewToShare.isRecycled()) {
String path = R.getCachePath(plat.getContext(), "screenshot");
File ss = new File(path, String.valueOf(System.currentTimeMillis()) + ".jpg");
FileOutputStream fos = new FileOutputStream(ss);
viewToShare.compress(CompressFormat.JPEG, 100, fos);
fos.flush();
fos.close();
shareParamsMap.put("imagePath", ss.getAbsolutePath());
}
} catch (Throwable t) {
t.printStackTrace();
toast("ssdk_oks_share_failed");
return null;
}
return new ShareParams(shareParamsMap);
}
示例2: getView
import com.mob.tools.utils.R; //导入方法依赖的package包/类
public View getView(int index, View convertView, ViewGroup parent) {
if (convertView == null) {
convertView = createPanel(parent.getContext());
}
LinearLayout llPanel = R.forceCast(convertView);
LinearLayout[] llCells = R.forceCast(llPanel.getTag());
refreshPanel(llCells, cells[index]);
return convertView;
}
示例3: onClick
import com.mob.tools.utils.R; //导入方法依赖的package包/类
public void onClick(View v) {
long time = System.currentTimeMillis();
if (time - lastClickTime < MIN_CLICK_INTERVAL) {
return;
}
lastClickTime = time;
if (v.getTag() instanceof CustomerLogo) {
CustomerLogo logo = R.forceCast(v.getTag());
page.performCustomLogoClick(v, logo);
} else {
Platform plat = R.forceCast(v.getTag());
page.showEditPage(plat);
}
}
示例4: run
import com.mob.tools.utils.R; //导入方法依赖的package包/类
/** 动态适配编辑界面的高度 */
public void run() {
int height = svContent.getChildAt(0).getHeight();
RelativeLayout.LayoutParams lp = R.forceCast(svContent.getLayoutParams());
if (height > maxBodyHeight && lp.height != maxBodyHeight) {
lp.height = maxBodyHeight;
svContent.setLayoutParams(lp);
} else if (height < maxBodyHeight && lp.height == maxBodyHeight) {
lp.height = LayoutParams.WRAP_CONTENT;
svContent.setLayoutParams(lp);
}
}
示例5: setCustomerLogo
import com.mob.tools.utils.R; //导入方法依赖的package包/类
/** 设置自己图标和点击事件,可以重复调用添加多次 */
public void setCustomerLogo(Bitmap logo, String label, OnClickListener ocl) {
CustomerLogo cl = new CustomerLogo();
cl.logo = logo;
cl.label = label;
cl.listener = ocl;
ArrayList<CustomerLogo> customers = R.forceCast(params.get("customers"));
customers.add(cl);
}
示例6: 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("");
}
}
}
}
}
示例7: getShareContentCustomizeCallback
import com.mob.tools.utils.R; //导入方法依赖的package包/类
/** 自定义不同平台分享不同内容的回调 */
public com.sharesdk.onekeyshare.ShareContentCustomizeCallback getShareContentCustomizeCallback() {
return R.forceCast(params.get("customizeCallback"));
}
示例8: addHiddenPlatform
import com.mob.tools.utils.R; //导入方法依赖的package包/类
/** 添加一个隐藏的platform */
public void addHiddenPlatform(String platform) {
HashMap<String, String> hiddenPlatforms = R.forceCast(params.get("hiddenPlatforms"));
hiddenPlatforms.put(platform, platform);
}
示例9: getCallback
import com.mob.tools.utils.R; //导入方法依赖的package包/类
/** 返回操作回调 */
public PlatformActionListener getCallback() {
return R.forceCast(params.get("callback"));
}
示例10: getShareContentCustomizeCallback
import com.mob.tools.utils.R; //导入方法依赖的package包/类
/** 自定义不同平台分享不同内容的回调 */
public ShareContentCustomizeCallback getShareContentCustomizeCallback() {
return R.forceCast(params.get("customizeCallback"));
}