com.mob.tools.gui.AsyncImageView Java Examples
The following examples show how to use
com.mob.tools.gui.AsyncImageView.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FriendListItem.java From MyHearts with Apache License 2.0 | 5 votes |
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); } }
Example #2
Source File: FriendListItem.java From YiZhi with Apache License 2.0 | 5 votes |
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 = ResHelper.getBitmapRes(context, "ssdk_oks_classic_check_checked"); if (resId > 0) { bmChd = BitmapFactory.decodeResource(context.getResources(), resId); } resId = ResHelper.getBitmapRes(getContext(), "ssdk_oks_classic_check_default"); if (resId > 0) { bmUnch = BitmapFactory.decodeResource(context.getResources(), resId); } }
Example #3
Source File: FriendListItem.java From HHComicViewer with Apache License 2.0 | 5 votes |
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); } }
Example #4
Source File: FriendListItem.java From BaoKanAndroid with MIT License | 5 votes |
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 = ResHelper.getBitmapRes(context, "ssdk_oks_classic_check_checked"); if (resId > 0) { bmChd = BitmapFactory.decodeResource(context.getResources(), resId); } resId = ResHelper.getBitmapRes(getContext(), "ssdk_oks_classic_check_default"); if (resId > 0) { bmUnch = BitmapFactory.decodeResource(context.getResources(), resId); } }
Example #5
Source File: FriendListItem.java From enjoyshop with Apache License 2.0 | 5 votes |
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 = ResHelper.getBitmapRes(context, "ssdk_oks_classic_check_checked"); if (resId > 0) { bmChd = BitmapFactory.decodeResource(context.getResources(), resId); } resId = ResHelper.getBitmapRes(getContext(), "ssdk_oks_classic_check_default"); if (resId > 0) { bmUnch = BitmapFactory.decodeResource(context.getResources(), resId); } }
Example #6
Source File: FriendListItem.java From POCenter with MIT License | 5 votes |
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 = ResHelper.getBitmapRes(context, "ssdk_oks_classic_check_checked"); if (resId > 0) { bmChd = BitmapFactory.decodeResource(context.getResources(), resId); } resId = ResHelper.getBitmapRes(getContext(), "ssdk_oks_classic_check_default"); if (resId > 0) { bmUnch = BitmapFactory.decodeResource(context.getResources(), resId); } }
Example #7
Source File: FriendListItem.java From fingerpoetry-android with Apache License 2.0 | 5 votes |
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); } }
Example #8
Source File: FriendListItem.java From LiuAGeAndroid with MIT License | 5 votes |
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 = ResHelper.getBitmapRes(context, "ssdk_oks_classic_check_checked"); if (resId > 0) { bmChd = BitmapFactory.decodeResource(context.getResources(), resId); } resId = ResHelper.getBitmapRes(getContext(), "ssdk_oks_classic_check_default"); if (resId > 0) { bmUnch = BitmapFactory.decodeResource(context.getResources(), resId); } }
Example #9
Source File: FriendListItem.java From LQRWeChat with MIT License | 5 votes |
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 = ResHelper.getBitmapRes(context, "ssdk_oks_classic_check_checked"); if (resId > 0) { bmChd = BitmapFactory.decodeResource(context.getResources(), resId); } resId = ResHelper.getBitmapRes(getContext(), "ssdk_oks_classic_check_default"); if (resId > 0) { bmUnch = BitmapFactory.decodeResource(context.getResources(), resId); } }
Example #10
Source File: FriendListItem.java From Social with Apache License 2.0 | 5 votes |
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); } }
Example #11
Source File: FriendListItem.java From GithubApp with Apache License 2.0 | 5 votes |
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); } }
Example #12
Source File: FriendListItem.java From Mobike with Apache License 2.0 | 5 votes |
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); } }
Example #13
Source File: FollowListPage.java From BigApp_Discuz_Android with Apache License 2.0 | 4 votes |
public View getView(int position, View convertView, ViewGroup parent) { FollowListItem item = null; boolean simpleMode = "FacebookMessenger".equals(platform.getName()); if (convertView == null) { LinearLayout llItem = new LinearLayout(parent.getContext()); item = new FollowListItem(); llItem.setTag(item); convertView = llItem; int dp_52 = com.mob.tools.utils.R.dipToPx(getContext(), 52); int dp_10 = com.mob.tools.utils.R.dipToPx(parent.getContext(), 10); int dp_5 = com.mob.tools.utils.R.dipToPx(parent.getContext(), 5); if(!simpleMode) { item.aivIcon = new AsyncImageView(getContext()); LinearLayout.LayoutParams lpIcon = new LinearLayout.LayoutParams(dp_52, dp_52); lpIcon.gravity = Gravity.CENTER_VERTICAL; lpIcon.setMargins(dp_10, dp_5, dp_10, dp_5); item.aivIcon.setLayoutParams(lpIcon); llItem.addView(item.aivIcon); } LinearLayout llText = new LinearLayout(parent.getContext()); llText.setPadding(0, dp_10, dp_10, dp_10); llText.setOrientation(LinearLayout.VERTICAL); LinearLayout.LayoutParams lpText = new LinearLayout.LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); lpText.gravity = Gravity.CENTER_VERTICAL; lpText.weight = 1; llText.setLayoutParams(lpText); llItem.addView(llText); item.tvName = new TextView(parent.getContext()); item.tvName.setTextColor(0xff000000); item.tvName.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18); item.tvName.setSingleLine(); if(simpleMode) { item.tvName.setPadding(dp_10, 0, 0, 0); } llText.addView(item.tvName); if(!simpleMode) { item.tvSign = new TextView(parent.getContext()); item.tvSign.setTextColor(0x7f000000); item.tvSign.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14); item.tvSign.setSingleLine(); llText.addView(item.tvSign); } item.ivCheck = new ImageView(parent.getContext()); item.ivCheck.setPadding(0, 0, dp_10, 0); LinearLayout.LayoutParams lpCheck = new LinearLayout.LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); lpCheck.gravity = Gravity.CENTER_VERTICAL; item.ivCheck.setLayoutParams(lpCheck); llItem.addView(item.ivCheck); } else { item = (FollowListItem) convertView.getTag(); } Following following = getItem(position); item.tvName.setText(following.screenName); if(!simpleMode) { item.tvSign.setText(following.description); } item.ivCheck.setImageBitmap(following.checked ? bmChd : bmUnch); if(!simpleMode) { if (isFling()) { Bitmap bm = BitmapProcessor.getBitmapFromCache(following.icon); if (bm != null && !bm.isRecycled()) { item.aivIcon.setImageBitmap(bm); } else { item.aivIcon.execute(null, 0); } } else { item.aivIcon.execute(following.icon,0); } } if (position == getCount() - 1) { next(); } return convertView; }
Example #14
Source File: EditPagePort.java From LQRWeChat with MIT License | 4 votes |
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); }
Example #15
Source File: EditPageLand.java From MyHearts with Apache License 2.0 | 4 votes |
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); }
Example #16
Source File: EditPagePort.java From MyHearts with Apache License 2.0 | 4 votes |
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); }
Example #17
Source File: EditPageLand.java From GithubApp with Apache License 2.0 | 4 votes |
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); }
Example #18
Source File: EditPagePort.java From GithubApp with Apache License 2.0 | 4 votes |
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); }
Example #19
Source File: FollowListPage.java From BigApp_WordPress_Android with Apache License 2.0 | 4 votes |
public View getView(int position, View convertView, ViewGroup parent) { FollowListItem item = null; boolean simpleMode = "FacebookMessenger".equals(platform.getName()); if (convertView == null) { LinearLayout llItem = new LinearLayout(parent.getContext()); item = new FollowListItem(); llItem.setTag(item); convertView = llItem; int dp_52 = com.mob.tools.utils.R.dipToPx(getContext(), 52); int dp_10 = com.mob.tools.utils.R.dipToPx(parent.getContext(), 10); int dp_5 = com.mob.tools.utils.R.dipToPx(parent.getContext(), 5); if(!simpleMode) { item.aivIcon = new AsyncImageView(getContext()); LayoutParams lpIcon = new LayoutParams(dp_52, dp_52); lpIcon.gravity = Gravity.CENTER_VERTICAL; lpIcon.setMargins(dp_10, dp_5, dp_10, dp_5); item.aivIcon.setLayoutParams(lpIcon); llItem.addView(item.aivIcon); } LinearLayout llText = new LinearLayout(parent.getContext()); llText.setPadding(0, dp_10, dp_10, dp_10); llText.setOrientation(LinearLayout.VERTICAL); LayoutParams lpText = new LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); lpText.gravity = Gravity.CENTER_VERTICAL; lpText.weight = 1; llText.setLayoutParams(lpText); llItem.addView(llText); item.tvName = new TextView(parent.getContext()); item.tvName.setTextColor(0xff000000); item.tvName.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18); item.tvName.setSingleLine(); if(simpleMode) { item.tvName.setPadding(dp_10, 0, 0, 0); } llText.addView(item.tvName); if(!simpleMode) { item.tvSign = new TextView(parent.getContext()); item.tvSign.setTextColor(0x7f000000); item.tvSign.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14); item.tvSign.setSingleLine(); llText.addView(item.tvSign); } item.ivCheck = new ImageView(parent.getContext()); item.ivCheck.setPadding(0, 0, dp_10, 0); LayoutParams lpCheck = new LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); lpCheck.gravity = Gravity.CENTER_VERTICAL; item.ivCheck.setLayoutParams(lpCheck); llItem.addView(item.ivCheck); } else { item = (FollowListItem) convertView.getTag(); } Following following = getItem(position); item.tvName.setText(following.screenName); if(!simpleMode) { item.tvSign.setText(following.description); } item.ivCheck.setImageBitmap(following.checked ? bmChd : bmUnch); if(!simpleMode) { if (isFling()) { Bitmap bm = BitmapProcessor.getBitmapFromCache(following.icon); if (bm != null && !bm.isRecycled()) { item.aivIcon.setImageBitmap(bm); } else { item.aivIcon.execute(null, 0); } } else { item.aivIcon.execute(following.icon,0); } } if (position == getCount() - 1) { next(); } return convertView; }
Example #20
Source File: FollowListPage.java From BigApp_WordPress_Android with Apache License 2.0 | 4 votes |
public View getView(int position, View convertView, ViewGroup parent) { FollowListItem item = null; boolean simpleMode = "FacebookMessenger".equals(platform.getName()); if (convertView == null) { LinearLayout llItem = new LinearLayout(parent.getContext()); item = new FollowListItem(); llItem.setTag(item); convertView = llItem; int dp_52 = com.mob.tools.utils.R.dipToPx(getContext(), 52); int dp_10 = com.mob.tools.utils.R.dipToPx(parent.getContext(), 10); int dp_5 = com.mob.tools.utils.R.dipToPx(parent.getContext(), 5); if(!simpleMode) { item.aivIcon = new AsyncImageView(getContext()); LayoutParams lpIcon = new LayoutParams(dp_52, dp_52); lpIcon.gravity = Gravity.CENTER_VERTICAL; lpIcon.setMargins(dp_10, dp_5, dp_10, dp_5); item.aivIcon.setLayoutParams(lpIcon); llItem.addView(item.aivIcon); } LinearLayout llText = new LinearLayout(parent.getContext()); llText.setPadding(0, dp_10, dp_10, dp_10); llText.setOrientation(LinearLayout.VERTICAL); LayoutParams lpText = new LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); lpText.gravity = Gravity.CENTER_VERTICAL; lpText.weight = 1; llText.setLayoutParams(lpText); llItem.addView(llText); item.tvName = new TextView(parent.getContext()); item.tvName.setTextColor(0xff000000); item.tvName.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18); item.tvName.setSingleLine(); if(simpleMode) { item.tvName.setPadding(dp_10, 0, 0, 0); } llText.addView(item.tvName); if(!simpleMode) { item.tvSign = new TextView(parent.getContext()); item.tvSign.setTextColor(0x7f000000); item.tvSign.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14); item.tvSign.setSingleLine(); llText.addView(item.tvSign); } item.ivCheck = new ImageView(parent.getContext()); item.ivCheck.setPadding(0, 0, dp_10, 0); LayoutParams lpCheck = new LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); lpCheck.gravity = Gravity.CENTER_VERTICAL; item.ivCheck.setLayoutParams(lpCheck); llItem.addView(item.ivCheck); } else { item = (FollowListItem) convertView.getTag(); } Following following = getItem(position); item.tvName.setText(following.screenName); if(!simpleMode) { item.tvSign.setText(following.description); } item.ivCheck.setImageBitmap(following.checked ? bmChd : bmUnch); if(!simpleMode) { if (isFling()) { Bitmap bm = BitmapProcessor.getBitmapFromCache(following.icon); if (bm != null && !bm.isRecycled()) { item.aivIcon.setImageBitmap(bm); } else { item.aivIcon.execute(null, 0); } } else { item.aivIcon.execute(following.icon,0); } } if (position == getCount() - 1) { next(); } return convertView; }
Example #21
Source File: EditPageLand.java From fingerpoetry-android with Apache License 2.0 | 4 votes |
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); }
Example #22
Source File: EditPagePort.java From fingerpoetry-android with Apache License 2.0 | 4 votes |
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); }
Example #23
Source File: EditPageLand.java From HHComicViewer with Apache License 2.0 | 4 votes |
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); }
Example #24
Source File: EditPagePort.java From HHComicViewer with Apache License 2.0 | 4 votes |
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); }
Example #25
Source File: FollowListPage.java From BigApp_Discuz_Android with Apache License 2.0 | 4 votes |
public View getView(int position, View convertView, ViewGroup parent) { FollowListItem item = null; boolean simpleMode = "FacebookMessenger".equals(platform.getName()); if (convertView == null) { LinearLayout llItem = new LinearLayout(parent.getContext()); item = new FollowListItem(); llItem.setTag(item); convertView = llItem; int dp_52 = com.mob.tools.utils.R.dipToPx(getContext(), 52); int dp_10 = com.mob.tools.utils.R.dipToPx(parent.getContext(), 10); int dp_5 = com.mob.tools.utils.R.dipToPx(parent.getContext(), 5); if(!simpleMode) { item.aivIcon = new AsyncImageView(getContext()); LinearLayout.LayoutParams lpIcon = new LinearLayout.LayoutParams(dp_52, dp_52); lpIcon.gravity = Gravity.CENTER_VERTICAL; lpIcon.setMargins(dp_10, dp_5, dp_10, dp_5); item.aivIcon.setLayoutParams(lpIcon); llItem.addView(item.aivIcon); } LinearLayout llText = new LinearLayout(parent.getContext()); llText.setPadding(0, dp_10, dp_10, dp_10); llText.setOrientation(LinearLayout.VERTICAL); LinearLayout.LayoutParams lpText = new LinearLayout.LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); lpText.gravity = Gravity.CENTER_VERTICAL; lpText.weight = 1; llText.setLayoutParams(lpText); llItem.addView(llText); item.tvName = new TextView(parent.getContext()); item.tvName.setTextColor(0xff000000); item.tvName.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18); item.tvName.setSingleLine(); if(simpleMode) { item.tvName.setPadding(dp_10, 0, 0, 0); } llText.addView(item.tvName); if(!simpleMode) { item.tvSign = new TextView(parent.getContext()); item.tvSign.setTextColor(0x7f000000); item.tvSign.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14); item.tvSign.setSingleLine(); llText.addView(item.tvSign); } item.ivCheck = new ImageView(parent.getContext()); item.ivCheck.setPadding(0, 0, dp_10, 0); LinearLayout.LayoutParams lpCheck = new LinearLayout.LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); lpCheck.gravity = Gravity.CENTER_VERTICAL; item.ivCheck.setLayoutParams(lpCheck); llItem.addView(item.ivCheck); } else { item = (FollowListItem) convertView.getTag(); } Following following = getItem(position); item.tvName.setText(following.screenName); if(!simpleMode) { item.tvSign.setText(following.description); } item.ivCheck.setImageBitmap(following.checked ? bmChd : bmUnch); if(!simpleMode) { if (isFling()) { Bitmap bm = BitmapProcessor.getBitmapFromCache(following.icon); if (bm != null && !bm.isRecycled()) { item.aivIcon.setImageBitmap(bm); } else { item.aivIcon.execute(null, 0); } } else { item.aivIcon.execute(following.icon,0); } } if (position == getCount() - 1) { next(); } return convertView; }
Example #26
Source File: EditPagePort.java From BaoKanAndroid with MIT License | 4 votes |
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); }
Example #27
Source File: EditPageLand.java From BaoKanAndroid with MIT License | 4 votes |
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); }
Example #28
Source File: EditPageLand.java From LQRWeChat with MIT License | 4 votes |
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); }
Example #29
Source File: EditPagePort.java From Mobike with Apache License 2.0 | 4 votes |
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); }
Example #30
Source File: EditPageLand.java From Mobike with Apache License 2.0 | 4 votes |
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); }