本文整理汇总了Java中com.mob.tools.utils.R.getBitmapRes方法的典型用法代码示例。如果您正苦于以下问题:Java R.getBitmapRes方法的具体用法?Java R.getBitmapRes怎么用?Java R.getBitmapRes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.mob.tools.utils.R
的用法示例。
在下文中一共展示了R.getBitmapRes方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPageBody
import com.mob.tools.utils.R; //导入方法依赖的package包/类
private LinearLayout getPageBody() {
this.llBody = new LinearLayout(getContext());
this.llBody.setId(2);
int resId = R.getBitmapRes(this.activity, "edittext_back");
if (resId > 0) {
this.llBody.setBackgroundResource(resId);
}
this.llBody.setOrientation(1);
LayoutParams lpBody = new LayoutParams(-2, -2);
lpBody.addRule(5, this.llTitle.getId());
lpBody.addRule(3, this.llTitle.getId());
lpBody.addRule(7, this.llTitle.getId());
if (!this.dialogMode) {
lpBody.addRule(12);
}
int dp_3 = R.dipToPx(getContext(), 3);
lpBody.setMargins(dp_3, dp_3, dp_3, dp_3);
this.llBody.setLayoutParams(lpBody);
this.llBody.addView(getMainBody());
this.llBody.addView(getSep());
this.llBody.addView(getPlatformList());
return this.llBody;
}
示例2: FriendListItem
import com.mob.tools.utils.R; //导入方法依赖的package包/类
public FriendListItem(Context context, float ratio) {
super(context);
int itemPadding = (int) (ratio * DESIGN_ITEM_PADDING);
setPadding(itemPadding, 0, itemPadding, 0);
setMinimumHeight((int) (ratio * DESIGN_ITEM_HEIGHT));
setBackgroundColor(0xffffffff);
ivCheck = new ImageView(context);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
lp.gravity = Gravity.CENTER_VERTICAL;
addView(ivCheck, lp);
aivIcon = new AsyncImageView(context);
int avatarWidth = (int) (ratio * DESIGN_AVATAR_WIDTH);
lp = new LinearLayout.LayoutParams(avatarWidth, avatarWidth);
lp.gravity = Gravity.CENTER_VERTICAL;
int avatarMargin = (int) (ratio * DESIGN_AVATAR_PADDING);
lp.setMargins(avatarMargin, 0, avatarMargin, 0);
addView(aivIcon, lp);
tvName = new TextView(context);
tvName.setTextColor(0xff000000);
tvName.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
tvName.setSingleLine();
lp = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
lp.gravity = Gravity.CENTER_VERTICAL;
lp.weight = 1;
addView(tvName, lp);
int resId = R.getBitmapRes(context, "ssdk_oks_classic_check_checked");
if (resId > 0) {
bmChd = BitmapFactory.decodeResource(context.getResources(), resId);
}
resId = R.getBitmapRes(getContext(), "ssdk_oks_classic_check_default");
if (resId > 0) {
bmUnch = BitmapFactory.decodeResource(context.getResources(), resId);
}
}
示例3: PRTHeader
import com.mob.tools.utils.R; //导入方法依赖的package包/类
public PRTHeader(Context context) {
super(context);
int[] size = R.getScreenSize(context);
float screenWidth = size[0] < size[1] ? size[0] : size[1];
float ratio = screenWidth / DESIGN_SCREEN_WIDTH;
setOrientation(VERTICAL);
LinearLayout llInner = new LinearLayout(context);
LayoutParams lp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
lp.gravity = Gravity.CENTER_HORIZONTAL;
addView(llInner, lp);
ivArrow = new RotateImageView(context);
int resId = R.getBitmapRes(context, "ssdk_oks_ptr_ptr");
if (resId > 0) {
ivArrow.setImageResource(resId);
}
int avatarWidth = (int) (ratio * DESIGN_AVATAR_WIDTH);
lp = new LayoutParams(avatarWidth, avatarWidth);
lp.gravity = Gravity.CENTER_VERTICAL;
int avataPadding = (int) (ratio * DESIGN_AVATAR_PADDING);
lp.topMargin = lp.bottomMargin = avataPadding;
llInner.addView(ivArrow, lp);
pbRefreshing = new ProgressBar(context);
resId = R.getBitmapRes(context, "ssdk_oks_classic_progressbar");
Drawable pbdrawable = context.getResources().getDrawable(resId);
pbRefreshing.setIndeterminateDrawable(pbdrawable);
llInner.addView(pbRefreshing, lp);
pbRefreshing.setVisibility(View.GONE);
tvHeader = new TextView(getContext());
tvHeader.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
tvHeader.setPadding(avataPadding, 0, avataPadding, 0);
tvHeader.setTextColor(0xff09bb07);
lp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
lp.gravity = Gravity.CENTER_VERTICAL;
llInner.addView(tvHeader, lp);
}
示例4: setActivity
import com.mob.tools.utils.R; //导入方法依赖的package包/类
public void setActivity(Activity activity) {
super.setActivity(activity);
int resId = R.getBitmapRes(activity, "ssdk_oks_shake_to_share_back");
if (resId > 0) {
activity.setTheme(16973835);
activity.requestWindowFeature(1);
activity.getWindow().setBackgroundDrawableResource(resId);
}
}
示例5: 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();
}
}
示例6: FollowAdapter
import com.mob.tools.utils.R; //导入方法依赖的package包/类
public FollowAdapter(PullToRefreshView view) {
super(view);
int resId = R.getBitmapRes(getContext(), "auth_follow_cb_chd");
if (resId > 0) {
this.bmChd = BitmapFactory.decodeResource(view.getResources(), resId);
}
resId = R.getBitmapRes(getContext(), "auth_follow_cb_unc");
if (resId > 0) {
this.bmUnch = BitmapFactory.decodeResource(view.getResources(), resId);
}
}
示例7: PRTHeader
import com.mob.tools.utils.R; //导入方法依赖的package包/类
public PRTHeader(Context context) {
super(context);
setOrientation(1);
LinearLayout llInner = new LinearLayout(context);
LayoutParams lpInner = new LayoutParams(-2, -2);
lpInner.gravity = 1;
addView(llInner, lpInner);
this.ivArrow = new RotateImageView(context);
int resId = R.getBitmapRes(context, "ssdk_oks_ptr_ptr");
if (resId > 0) {
this.ivArrow.setImageResource(resId);
}
int dp_32 = R.dipToPx(context, 32);
LayoutParams lpIv = new LayoutParams(dp_32, dp_32);
lpIv.gravity = 16;
llInner.addView(this.ivArrow, lpIv);
this.pbRefreshing = new ProgressBar(context);
llInner.addView(this.pbRefreshing, lpIv);
this.pbRefreshing.setVisibility(8);
this.tvHeader = new TextView(getContext());
this.tvHeader.setTextSize(1, 18.0f);
this.tvHeader.setGravity(17);
int dp_10 = R.dipToPx(getContext(), 10);
this.tvHeader.setPadding(dp_10, dp_10, dp_10, dp_10);
this.tvHeader.setTextColor(-16777216);
LayoutParams lpTv = new LayoutParams(-2, -2);
lpTv.gravity = 16;
llInner.addView(this.tvHeader, lpTv);
}
示例8: getImagePin
import com.mob.tools.utils.R; //导入方法依赖的package包/类
private ImageView getImagePin() {
this.ivPin = new ImageView(getContext());
int resId = R.getBitmapRes(this.activity, "pin");
if (resId > 0) {
this.ivPin.setImageResource(resId);
}
LayoutParams lp = new LayoutParams(R.dipToPx(getContext(), 80), R.dipToPx(getContext(), 36));
lp.topMargin = R.dipToPx(getContext(), 6);
lp.addRule(6, this.llBody.getId());
lp.addRule(11);
this.ivPin.setLayoutParams(lp);
this.ivPin.setVisibility(8);
return this.ivPin;
}
示例9: getPlatLogo
import com.mob.tools.utils.R; //导入方法依赖的package包/类
private Bitmap getPlatLogo(Platform plat) {
if (plat == null || plat.getName() == null) {
return null;
}
int resId = R.getBitmapRes(this.activity, ("logo_" + plat.getName()).toLowerCase());
if (resId > 0) {
return BitmapFactory.decodeResource(this.activity.getResources(), resId);
}
return null;
}
示例10: 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);
}
示例11: FriendListItem
import com.mob.tools.utils.R; //导入方法依赖的package包/类
public FriendListItem(Context context, float ratio) {
super(context);
int itemPadding = (int) (ratio * DESIGN_ITEM_PADDING);
setPadding(itemPadding, 0, itemPadding, 0);
setMinimumHeight((int) (ratio * DESIGN_ITEM_HEIGHT));
setBackgroundColor(0xffffffff);
ivCheck = new ImageView(context);
LayoutParams lp = new LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
lp.gravity = Gravity.CENTER_VERTICAL;
addView(ivCheck, lp);
aivIcon = new AsyncImageView(context);
int avatarWidth = (int) (ratio * DESIGN_AVATAR_WIDTH);
lp = new LayoutParams(avatarWidth, avatarWidth);
lp.gravity = Gravity.CENTER_VERTICAL;
int avatarMargin = (int) (ratio * DESIGN_AVATAR_PADDING);
lp.setMargins(avatarMargin, 0, avatarMargin, 0);
addView(aivIcon, lp);
tvName = new TextView(context);
tvName.setTextColor(0xff000000);
tvName.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
tvName.setSingleLine();
lp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
lp.gravity = Gravity.CENTER_VERTICAL;
lp.weight = 1;
addView(tvName, lp);
int resId = R.getBitmapRes(context, "ssdk_oks_classic_check_checked");
if (resId > 0) {
bmChd = BitmapFactory.decodeResource(context.getResources(), resId);
}
resId = R.getBitmapRes(getContext(), "ssdk_oks_classic_check_default");
if (resId > 0) {
bmUnch = BitmapFactory.decodeResource(context.getResources(), resId);
}
}
示例12: 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("");
}
}
}
}
}
示例13: 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);
}
示例14: getAtLine
import com.mob.tools.utils.R; //导入方法依赖的package包/类
private LinearLayout getAtLine(String platform) {
if (!isShowAtUserLayout(platform)) {
return null;
}
LinearLayout llAt = new LinearLayout(getContext());
LinearLayout.LayoutParams lpAt = new LinearLayout.LayoutParams(-2, -2);
lpAt.rightMargin = R.dipToPx(getContext(), 4);
lpAt.gravity = 83;
lpAt.weight = 1.0f;
llAt.setLayoutParams(lpAt);
llAt.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
FollowListPage subPage = new FollowListPage();
subPage.setPlatform((Platform) EditPage.this.platforms.get(0));
subPage.showForResult(EditPage.this.activity, null, EditPage.this);
}
});
TextView tvAt = new TextView(getContext());
int resId = R.getBitmapRes(this.activity, "btn_back_nor");
if (resId > 0) {
tvAt.setBackgroundResource(resId);
}
int dp_32 = R.dipToPx(getContext(), 32);
tvAt.setLayoutParams(new LinearLayout.LayoutParams(dp_32, dp_32));
tvAt.setTextSize(1, 18.0f);
tvAt.setText(getAtUserButtonText(platform));
tvAt.setPadding(0, 0, 0, R.dipToPx(getContext(), 2));
tvAt.setTypeface(Typeface.DEFAULT_BOLD);
tvAt.setTextColor(-16777216);
tvAt.setGravity(17);
llAt.addView(tvAt);
TextView tvName = new TextView(getContext());
tvName.setTextSize(1, 18.0f);
tvName.setTextColor(-16777216);
resId = R.getStringRes(this.activity, "list_friends");
tvName.setText(getContext().getString(resId, new Object[]{getName(platform)}));
LinearLayout.LayoutParams lpName = new LinearLayout.LayoutParams(-2, -2);
lpName.gravity = 16;
tvName.setLayoutParams(lpName);
llAt.addView(tvName);
return llAt;
}