本文整理汇总了Java中cn.sharesdk.onekeyshare.themes.classic.XView类的典型用法代码示例。如果您正苦于以下问题:Java XView类的具体用法?Java XView怎么用?Java XView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XView类属于cn.sharesdk.onekeyshare.themes.classic包,在下文中一共展示了XView类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initBody
import cn.sharesdk.onekeyshare.themes.classic.XView; //导入依赖的package包/类
private void initBody(RelativeLayout rlBody, float ratio) {
svContent = new ScrollView(activity);
rlBody.addView(svContent, new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
LinearLayout llContent = new LinearLayout(activity);
llContent.setOrientation(LinearLayout.HORIZONTAL);
svContent.addView(llContent, new ScrollView.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
etContent = new EditText(activity);
int padding = (int) (DESIGN_LEFT_PADDING * ratio);
etContent.setPadding(padding, padding, padding, padding);
etContent.setBackgroundDrawable(null);
etContent.setTextColor(0xff3b3b3b);
etContent.setTextSize(TypedValue.COMPLEX_UNIT_SP, 21);
etContent.setText(sp.getText());
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(0, LayoutParams.WRAP_CONTENT);
lp.weight = 1;
llContent.addView(etContent, lp);
etContent.addTextChangedListener(this);
rlThumb = new RelativeLayout(activity);
rlThumb.setBackgroundColor(0xff313131);
int thumbWidth = (int) (DESIGN_THUMB_HEIGHT_L * ratio);
int xWidth = (int) (DESIGN_REMOVE_THUMB_HEIGHT_L * ratio);
lp = new LinearLayout.LayoutParams(thumbWidth, thumbWidth);
lp.rightMargin = lp.bottomMargin = lp.topMargin = padding;
llContent.addView(rlThumb, lp);
aivThumb = new AsyncImageView(activity) {
public void onImageGot(String url, Bitmap bm) {
thumb = bm;
super.onImageGot(url, bm);
}
};
aivThumb.setScaleToCropCenter(true);
RelativeLayout.LayoutParams rllp = new RelativeLayout.LayoutParams(thumbWidth, thumbWidth);
rlThumb.addView(aivThumb, rllp);
aivThumb.setOnClickListener(this);
initThumb(aivThumb);
xvRemove = new XView(activity);
xvRemove.setRatio(ratio);
rllp = new RelativeLayout.LayoutParams(xWidth, xWidth);
rllp.addRule(RelativeLayout.ALIGN_PARENT_TOP);
rllp.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
rlThumb.addView(xvRemove, rllp);
xvRemove.setOnClickListener(this);
}
开发者ID:Zyj163,项目名称:yyox,代码行数:49,代码来源:EditPageLand.java
示例2: initBody
import cn.sharesdk.onekeyshare.themes.classic.XView; //导入依赖的package包/类
private void initBody(RelativeLayout rlBody, float ratio) {
svContent = new ScrollView(activity);
rlBody.addView(svContent, new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
LinearLayout llContent = new LinearLayout(activity);
llContent.setOrientation(LinearLayout.VERTICAL);
svContent.addView(llContent, new ScrollView.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
etContent = new EditText(activity);
int padding = (int) (DESIGN_LEFT_PADDING * ratio);
etContent.setPadding(padding, padding, padding, padding);
etContent.setBackgroundDrawable(null);
etContent.setTextColor(0xff3b3b3b);
etContent.setTextSize(TypedValue.COMPLEX_UNIT_SP, 21);
etContent.setText(sp.getText());
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
llContent.addView(etContent, lp);
etContent.addTextChangedListener(this);
rlThumb = new RelativeLayout(activity);
rlThumb.setBackgroundColor(0xff313131);
int thumbWidth = (int) (DESIGN_THUMB_HEIGHT * ratio);
int xWidth = (int) (DESIGN_REMOVE_THUMB_HEIGHT * ratio);
lp = new LinearLayout.LayoutParams(thumbWidth, thumbWidth);
lp.leftMargin = lp.rightMargin = lp.bottomMargin = lp.topMargin = padding;
llContent.addView(rlThumb, lp);
aivThumb = new AsyncImageView(activity) {
public void onImageGot(String url, Bitmap bm) {
thumb = bm;
super.onImageGot(url, bm);
}
};
aivThumb.setScaleToCropCenter(true);
RelativeLayout.LayoutParams rllp = new RelativeLayout.LayoutParams(thumbWidth, thumbWidth);
rlThumb.addView(aivThumb, rllp);
aivThumb.setOnClickListener(this);
initThumb(aivThumb);
xvRemove = new XView(activity);
xvRemove.setRatio(ratio);
rllp = new RelativeLayout.LayoutParams(xWidth, xWidth);
rllp.addRule(RelativeLayout.ALIGN_PARENT_TOP);
rllp.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
rlThumb.addView(xvRemove, rllp);
xvRemove.setOnClickListener(this);
}
开发者ID:gaolhjy,项目名称:cniao5,代码行数:48,代码来源:EditPagePort.java
注:本文中的cn.sharesdk.onekeyshare.themes.classic.XView类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论