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


Java R类代码示例

本文整理汇总了Java中com.mob.tools.utils.R的典型用法代码示例。如果您正苦于以下问题:Java R类的具体用法?Java R怎么用?Java R使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: calculateSize

import com.mob.tools.utils.R; //导入依赖的package包/类
protected void calculateSize(Context context, ArrayList<Object> plats) {
	int screenWidth = R.getScreenWidth(context);
	lineSize = LINE_SIZE_P;

	float ratio = ((float) screenWidth) / DESIGN_SCREEN_WIDTH_P;
	sepLineWidth = (int) (DESIGN_SEP_LINE_WIDTH * ratio);
	sepLineWidth = sepLineWidth < 1 ? 1 : sepLineWidth;
	logoHeight = (int) (DESIGN_LOGO_HEIGHT * ratio);
	paddingTop = (int) (DESIGN_PADDING_TOP * ratio);
	bottomHeight = (int) (DESIGN_BOTTOM_HEIGHT * ratio);
	cellHeight = (screenWidth - sepLineWidth * 3) / 4;
	if (plats.size() <= lineSize) {
		panelHeight = cellHeight + sepLineWidth;
	} else if (plats.size() <= PAGE_SIZE_P - lineSize) {
		panelHeight = (cellHeight + sepLineWidth) * 2;
	} else {
		panelHeight = (cellHeight + sepLineWidth) * 3;
	}
}
 
开发者ID:Jusenr,项目名称:androidgithub,代码行数:20,代码来源:PlatformPageAdapterPort.java

示例2: 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);
}
 
开发者ID:wp521,项目名称:MyFire,代码行数:27,代码来源:OnekeyShareThemeImpl.java

示例3: onMeasure

import com.mob.tools.utils.R; //导入依赖的package包/类
protected void onMeasure(int i, int i2) {
    if (this.adapter == null) {
        super.onMeasure(i, i2);
        return;
    }
    int childCount = getChildCount();
    int makeMeasureSpec = MeasureSpec.makeMeasureSpec(R.getScreenWidth(getContext()),
            1073741824);
    int i3 = 0;
    int i4 = 0;
    while (i3 < childCount) {
        View childAt = getChildAt(i3);
        childAt.measure(makeMeasureSpec, 0);
        int measuredHeight = childAt.getMeasuredHeight();
        if (measuredHeight <= i4) {
            measuredHeight = i4;
        }
        i3++;
        i4 = measuredHeight;
    }
    i4 = MeasureSpec.makeMeasureSpec(i4, 1073741824);
    super.onMeasure(makeMeasureSpec, i4);
    for (measuredHeight = 0; measuredHeight < childCount; measuredHeight++) {
        getChildAt(measuredHeight).measure(makeMeasureSpec, i4);
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:27,代码来源:ViewPagerClassic.java

示例4: initAtUserView

import com.mob.tools.utils.R; //导入依赖的package包/类
private void initAtUserView() {
    LinearLayout atLayout = (LinearLayout) findViewByResName("atLayout");
    for (Platform platform : this.platforms) {
        String platformName = platform.getName();
        if (isShowAtUserLayout(platformName)) {
            View view = LayoutInflater.from(this.activity).inflate(R.getLayoutRes(this.activity, "skyblue_editpage_at_layout"), null);
            TextView atDescTextView = (TextView) view.findViewById(R.getIdRes(this.activity, "atDescTextView"));
            TextView atTextView = (TextView) view.findViewById(R.getIdRes(this.activity, "atTextView"));
            OnClickListener atBtnClickListener = new OnClickListener() {
                public void onClick(View v) {
                    FollowListPage subPage = new FollowListPage();
                    subPage.setPlatform((Platform) v.getTag());
                    subPage.showForResult(EditPage.this.activity, null, EditPage.this);
                }
            };
            atTextView.setTag(platform);
            atTextView.setOnClickListener(atBtnClickListener);
            atDescTextView.setTag(platform);
            atDescTextView.setOnClickListener(atBtnClickListener);
            atTextView.setText(getAtUserButtonText(platformName));
            atDescTextView.setText(getContext().getString(R.getStringRes(this.activity, "list_friends"), new Object[]{getLogoName(platformName)}));
            atLayout.addView(view);
        }
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:26,代码来源:EditPage.java

示例5: calPageSize

import com.mob.tools.utils.R; //导入依赖的package包/类
private void calPageSize() {
    float whR = ((float) R.getScreenWidth(getContext())) / ((float) R.getScreenHeight(getContext()));
    if (((double) whR) < 0.63d) {
        this.COLUMN_PER_LINE = 3;
        this.LINE_PER_PAGE = 3;
    } else if (((double) whR) < 0.75d) {
        this.COLUMN_PER_LINE = 3;
        this.LINE_PER_PAGE = 2;
    } else {
        this.LINE_PER_PAGE = 1;
        if (((double) whR) >= 1.75d) {
            this.COLUMN_PER_LINE = 6;
        } else if (((double) whR) >= 1.5d) {
            this.COLUMN_PER_LINE = 5;
        } else if (((double) whR) >= 1.3d) {
            this.COLUMN_PER_LINE = 4;
        } else {
            this.COLUMN_PER_LINE = 3;
        }
    }
    this.PAGE_SIZE = this.COLUMN_PER_LINE * this.LINE_PER_PAGE;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:23,代码来源:PlatformGridView.java

示例6: getPageView

import com.mob.tools.utils.R; //导入依赖的package包/类
private RelativeLayout getPageView() {
    this.rlPage = new RelativeLayout(getContext());
    this.rlPage.setBackgroundDrawable(this.background);
    if (this.dialogMode) {
        RelativeLayout rlDialog = new RelativeLayout(getContext());
        rlDialog.setBackgroundColor(-1070452174);
        int dp_8 = R.dipToPx(getContext(), 8);
        LayoutParams lpDialog = new LayoutParams(R.getScreenWidth(getContext()) - (dp_8 * 2), -2);
        lpDialog.topMargin = dp_8;
        lpDialog.bottomMargin = dp_8;
        lpDialog.addRule(13);
        rlDialog.setLayoutParams(lpDialog);
        this.rlPage.addView(rlDialog);
        rlDialog.addView(getPageTitle());
        rlDialog.addView(getPageBody());
        rlDialog.addView(getImagePin());
    } else {
        this.rlPage.addView(getPageTitle());
        this.rlPage.addView(getPageBody());
        this.rlPage.addView(getImagePin());
    }
    return this.rlPage;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:24,代码来源:EditPage.java

示例7: getMainBody

import com.mob.tools.utils.R; //导入依赖的package包/类
private LinearLayout getMainBody() {
    LinearLayout llMainBody = new LinearLayout(getContext());
    llMainBody.setOrientation(1);
    LinearLayout.LayoutParams lpMain = new LinearLayout.LayoutParams(-1, -2);
    lpMain.weight = 1.0f;
    int dp_4 = R.dipToPx(getContext(), 4);
    lpMain.setMargins(dp_4, dp_4, dp_4, dp_4);
    llMainBody.setLayoutParams(lpMain);
    LinearLayout llContent = new LinearLayout(getContext());
    LinearLayout.LayoutParams lpContent = new LinearLayout.LayoutParams(-1, -2);
    lpContent.weight = 1.0f;
    llMainBody.addView(llContent, lpContent);
    this.etContent = new EditText(getContext());
    this.etContent.setGravity(51);
    this.etContent.setBackgroundDrawable(null);
    this.etContent.setText(String.valueOf(this.shareParamMap.get("text")));
    this.etContent.addTextChangedListener(this);
    LinearLayout.LayoutParams lpEt = new LinearLayout.LayoutParams(-2, -2);
    lpEt.weight = 1.0f;
    this.etContent.setLayoutParams(lpEt);
    llContent.addView(this.etContent);
    llContent.addView(getThumbView());
    llMainBody.addView(getBodyBottom());
    return llMainBody;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:26,代码来源:EditPage.java

示例8: a

import com.mob.tools.utils.R; //导入依赖的package包/类
public boolean a() {
    String str;
    try {
        str = this.a.getPackageManager().getPackageInfo("com.tencent.mm", 0).versionName;
        Ln.i("wechat versionName ==>> " + str, new Object[0]);
    } catch (Throwable th) {
        Ln.e(th);
        str = "0";
    }
    String[] split = str.split("_")[0].split("\\.");
    int[] iArr = new int[split.length];
    for (int i = 0; i < iArr.length; i++) {
        try {
            iArr[i] = R.parseInt(split[i]);
        } catch (Throwable th2) {
            Ln.e(th2);
            iArr[i] = 0;
        }
    }
    return iArr.length >= 4 && iArr[0] == 6 && iArr[1] == 0 && iArr[2] == 2 && iArr[3] <= 56;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:22,代码来源:j.java

示例9: a

import com.mob.tools.utils.R; //导入依赖的package包/类
public void a(Bundle bundle, AuthorizeListener authorizeListener) {
    String string = bundle.getString("_wxapi_sendauth_resp_url");
    if (!TextUtils.isEmpty(string)) {
        int indexOf = string.indexOf("://oauth?");
        if (indexOf >= 0) {
            string = string.substring(indexOf + 1);
        }
        try {
            a(R.urlToBundle(string).getString("code"), authorizeListener);
        } catch (Throwable th) {
            Ln.e(th);
            if (authorizeListener != null) {
                authorizeListener.onError(th);
            }
        }
    } else if (authorizeListener != null) {
        authorizeListener.onError(null);
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:20,代码来源:g.java

示例10: a

import com.mob.tools.utils.R; //导入依赖的package包/类
public boolean a(HashMap<String, Object> hashMap, HashMap<Integer, HashMap<String, Object>> hashMap2) {
    if (hashMap == null || hashMap.size() <= 0) {
        return false;
    }
    ArrayList arrayList = (ArrayList) hashMap.get("fakelist");
    if (arrayList == null) {
        return false;
    }
    Iterator it = arrayList.iterator();
    while (it.hasNext()) {
        HashMap hashMap3 = (HashMap) it.next();
        if (hashMap3 != null) {
            int parseInt;
            try {
                parseInt = R.parseInt(String.valueOf(hashMap3.get("snsplat")));
            } catch (Throwable th) {
                Ln.e(th);
                parseInt = -1;
            }
            if (parseInt != -1) {
                hashMap2.put(Integer.valueOf(parseInt), hashMap3);
            }
        }
    }
    return true;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:27,代码来源:i.java

示例11: h

import com.mob.tools.utils.R; //导入依赖的package包/类
private long h() {
    if (!f.h()) {
        return 0;
    }
    String str = "{}";
    try {
        str = this.k.httpGet(b(), null, null, null);
    } catch (Throwable th) {
        Ln.e(th);
    }
    HashMap fromJson = new Hashon().fromJson(str);
    if (!fromJson.containsKey("timestamp")) {
        return f.a();
    }
    try {
        long currentTimeMillis = System.currentTimeMillis() - R.parseLong(String.valueOf(fromJson.get("timestamp")));
        f.a("service_time", Long.valueOf(currentTimeMillis));
        return currentTimeMillis;
    } catch (Throwable th2) {
        Ln.w(th2);
        return f.a();
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:24,代码来源:a.java

示例12: a

import com.mob.tools.utils.R; //导入依赖的package包/类
public a(Context context) {
    try {
        DeviceHelper instance = DeviceHelper.getInstance(context);
        String cachePath = R.getCachePath(context, null);
        if (instance.getSdcardState()) {
            File file = new File(instance.getSdcardPath(), "ShareSDK");
            if (file.exists()) {
                this.a = new LocalDB();
                this.a.open(new File(file, ".ba").getAbsolutePath());
                return;
            }
        }
        this.a = new LocalDB();
        File file2 = new File(cachePath, ".ba");
        if (!file2.getParentFile().exists()) {
            file2.getParentFile().mkdirs();
        }
        this.a.open(file2.getAbsolutePath());
    } catch (Throwable e) {
        Ln.e(e);
        if (this.a == null) {
            this.a = new LocalDB();
        }
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:26,代码来源:NewAppReceiver.java

示例13: b

import com.mob.tools.utils.R; //导入依赖的package包/类
public HashMap<String, Object> b(int i, int i2, String str) {
    ArrayList arrayList = new ArrayList();
    arrayList.add(new KVPair(SocialConstants.PARAM_SOURCE, this.c));
    if (this.f != null) {
        arrayList.add(new KVPair("access_token", this.f));
    }
    Object obj = 1;
    try {
        R.parseLong(str);
    } catch (Throwable th) {
        obj = null;
    }
    if (obj != null) {
        arrayList.add(new KVPair(SocializeProtocolConstants.PROTOCOL_KEY_UID, str));
    } else {
        arrayList.add(new KVPair("screen_name", str));
    }
    arrayList.add(new KVPair("count", String.valueOf(i)));
    arrayList.add(new KVPair("cursor", String.valueOf(i2 * i)));
    String a = this.h.a("https://api.weibo.com/2/friendships/friends.json", arrayList, "/2/friendships/friends.json", c());
    return a != null ? new Hashon().fromJson(a) : null;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:23,代码来源:i.java

示例14: c

import com.mob.tools.utils.R; //导入依赖的package包/类
public HashMap<String, Object> c(String str) {
    ArrayList arrayList = new ArrayList();
    arrayList.add(new KVPair(SocialConstants.PARAM_SOURCE, this.c));
    if (this.f != null) {
        arrayList.add(new KVPair("access_token", this.f));
    }
    Object obj = 1;
    try {
        R.parseLong(str);
    } catch (Throwable th) {
        obj = null;
    }
    if (obj != null) {
        arrayList.add(new KVPair(SocializeProtocolConstants.PROTOCOL_KEY_UID, str));
    } else {
        arrayList.add(new KVPair("screen_name", str));
    }
    String a = this.h.a("https://api.weibo.com/2/users/show.json", arrayList, "/2/users/show.json", c());
    return a != null ? new Hashon().fromJson(a) : null;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:21,代码来源:i.java

示例15: 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);
	}
}
 
开发者ID:wp521,项目名称:MyFire,代码行数:40,代码来源:FriendListItem.java


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