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


Java SizeHelper.prepare方法代码示例

本文整理汇总了Java中cn.smssdk.gui.layout.SizeHelper.prepare方法的典型用法代码示例。如果您正苦于以下问题:Java SizeHelper.prepare方法的具体用法?Java SizeHelper.prepare怎么用?Java SizeHelper.prepare使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cn.smssdk.gui.layout.SizeHelper的用法示例。


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

示例1: initScroll

import cn.smssdk.gui.layout.SizeHelper; //导入方法依赖的package包/类
private void initScroll(Context context) {
	llScroll.removeAllViews();
	SizeHelper.prepare(context);

	int size = adapter.getGroupCount();
	int dp3 = SizeHelper.fromPxWidth(6);
	int dp2 = SizeHelper.fromPxWidth(4);
	for (int i = 0; i < size; i++) {
		TextView tv = new TextView(context);
		tv.setText(adapter.getGroupTitle(i));
		tv.setTextSize(TypedValue.COMPLEX_UNIT_PX, SizeHelper.fromPxWidth(18));
		tv.setGravity(Gravity.CENTER);
		tv.setPadding(dp3, dp2, dp3, dp2);
		llScroll.addView(tv);
	}
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:17,代码来源:CountryListView.java

示例2: initScroll

import cn.smssdk.gui.layout.SizeHelper; //导入方法依赖的package包/类
private void initScroll(Context context) {
	llScroll.removeAllViews();
	SizeHelper.prepare(context);

	int size = adapter.getGroupCount();
	int dp_3 = SizeHelper.fromPxWidth(6);
	int dp_2 = SizeHelper.fromPxWidth(4);
	for (int i = 0; i < size; i++) {
		TextView tv = new TextView(context);
		tv.setText(adapter.getGroupTitle(i));
		tv.setTextSize(TypedValue.COMPLEX_UNIT_PX, SizeHelper.fromPxWidth(18));
		tv.setGravity(Gravity.CENTER);
		tv.setPadding(dp_3, dp_2, dp_3, dp_2);
		llScroll.addView(tv);
	}
}
 
开发者ID:zzlnewair,项目名称:Myshop,代码行数:17,代码来源:CountryListView.java

示例3: getTitleView

import cn.smssdk.gui.layout.SizeHelper; //导入方法依赖的package包/类
public TextView getTitleView(int group, TextView convertView, ViewGroup parent) {
	if (convertView == null) {
		SizeHelper.prepare(parent.getContext());

		convertView = new TextView(parent.getContext());
		convertView.setBackgroundColor(0xffeae8ee);
		convertView.setTextSize(TypedValue.COMPLEX_UNIT_PX, SizeHelper.fromPxWidth(25));
		convertView.setTextColor(0xff999999);
		int padding = SizeHelper.fromPxWidth(18);
		convertView.setPadding(padding, 0, 0, 0);
		convertView.setWidth(LayoutParams.MATCH_PARENT);
		int height = SizeHelper.fromPxWidth(40);
		convertView.setHeight(height);
		convertView.setGravity(Gravity.CENTER_VERTICAL);
	}
	String title = getGroupTitle(group);
	if (!TextUtils.isEmpty(title)) {
		convertView.setText(title);
	}
	return convertView;
}
 
开发者ID:zzlnewair,项目名称:Myshop,代码行数:22,代码来源:ContactsAdapter.java

示例4: init

import cn.smssdk.gui.layout.SizeHelper; //导入方法依赖的package包/类
private void init(Context context) {
	SizeHelper.prepare(context);

	lvContries = new GroupListView(context);
	lvContries.setDividerHeight(SizeHelper.fromPxWidth(1));
	int resId = ResHelper.getBitmapRes(context, "smssdk_cl_divider");
	if (resId > 0) {
		lvContries.setDivider(context.getResources().getDrawable(resId));
	}
	adapter = new CountryAdapter(lvContries);
	lvContries.setAdapter(adapter);
	LayoutParams lpContries = new LayoutParams(
			LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
	int dp9 = SizeHelper.fromPxWidth(12);
	lpContries.setMargins(dp9, 0, dp9, 0);
	addView(lvContries, lpContries);

	tvScroll = new TextView(context);
	resId = ResHelper.getColorRes(context, "smssdk_white");
	if (resId > 0) {
		tvScroll.setTextColor(context.getResources().getColor(resId));
	}
	resId = ResHelper.getBitmapRes(context, "smssdk_country_group_scroll_down");
	if (resId > 0) {
		tvScroll.setBackgroundResource(resId);
	}
	tvScroll.setTextSize(TypedValue.COMPLEX_UNIT_PX, SizeHelper.fromPxWidth(80));
	tvScroll.setTypeface(Typeface.DEFAULT);
	tvScroll.setVisibility(GONE);
	tvScroll.setGravity(Gravity.CENTER);
	int dp80 = SizeHelper.fromPxWidth(120);
	LayoutParams lp = new LayoutParams(dp80, dp80);
	lp.addRule(CENTER_IN_PARENT);
	addView(tvScroll, lp);

	llScroll = new LinearLayout(context);
	resId = ResHelper.getBitmapRes(context, "smssdk_country_group_scroll_up");
	if (resId > 0) {
		llScroll.setBackgroundResource(resId);
	}
	llScroll.setOrientation(LinearLayout.VERTICAL);
	llScroll.setOnTouchListener(this);
	lp = new LayoutParams(
			LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
	lp.addRule(ALIGN_PARENT_RIGHT);
	lp.addRule(CENTER_VERTICAL);
	lp.rightMargin = SizeHelper.fromPxWidth(7);
	addView(llScroll, lp);

	initScroll(context);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:52,代码来源:CountryListView.java

示例5: init

import cn.smssdk.gui.layout.SizeHelper; //导入方法依赖的package包/类
private void init(Context context) {
	SizeHelper.prepare(context);

	lvContries = new GroupListView(context);
	lvContries.setDividerHeight(SizeHelper.fromPxWidth(1));
	int resId = getBitmapRes(context, "smssdk_cl_divider");
	if (resId > 0) {
		lvContries.setDivider(context.getResources().getDrawable(resId));
	}
	adapter = new CountryAdapter(lvContries);
	lvContries.setAdapter(adapter);
	LayoutParams lpContries = new LayoutParams(
			LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
	int dp_9 = SizeHelper.fromPxWidth(12);
	lpContries.setMargins(dp_9, 0, dp_9, 0);
	addView(lvContries, lpContries);

	tvScroll = new TextView(context);
	resId = getColorRes(context, "smssdk_white");
	if (resId > 0) {
		tvScroll.setTextColor(context.getResources().getColor(resId));
	}
	resId = getBitmapRes(context, "smssdk_country_group_scroll_down");
	if (resId > 0) {
		tvScroll.setBackgroundResource(resId);
	}
	tvScroll.setTextSize(TypedValue.COMPLEX_UNIT_PX, SizeHelper.fromPxWidth(80));
	tvScroll.setTypeface(Typeface.DEFAULT);
	tvScroll.setVisibility(GONE);
	tvScroll.setGravity(Gravity.CENTER);
	int dp_80 = SizeHelper.fromPxWidth(120);
	LayoutParams lp = new LayoutParams(dp_80, dp_80);
	lp.addRule(CENTER_IN_PARENT);
	addView(tvScroll, lp);

	llScroll = new LinearLayout(context);
	resId = getBitmapRes(context, "smssdk_country_group_scroll_up");
	if (resId > 0) {
		llScroll.setBackgroundResource(resId);
	}
	llScroll.setOrientation(LinearLayout.VERTICAL);
	llScroll.setOnTouchListener(this);
	lp = new LayoutParams(
			LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
	lp.addRule(ALIGN_PARENT_RIGHT);
	lp.addRule(CENTER_VERTICAL);
	lp.rightMargin = SizeHelper.fromPxWidth(7);
	addView(llScroll, lp);

	initScroll(context);
}
 
开发者ID:zzlnewair,项目名称:Myshop,代码行数:52,代码来源:CountryListView.java


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