本文整理汇总了Java中org.telegram.ui.Cells.DividerCell类的典型用法代码示例。如果您正苦于以下问题:Java DividerCell类的具体用法?Java DividerCell怎么用?Java DividerCell使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DividerCell类属于org.telegram.ui.Cells包,在下文中一共展示了DividerCell类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getItemView
import org.telegram.ui.Cells.DividerCell; //导入依赖的package包/类
@Override
public View getItemView(int section, int position, View convertView, ViewGroup parent) {
View x = null;
if (x == null) {
LinearLayout base = new LinearLayout(context);
base.setOrientation(LinearLayout.VERTICAL);
base.setGravity(Gravity.CENTER_VERTICAL);
LinearLayout l = new LinearLayout(context);
l.setOrientation(LinearLayout.HORIZONTAL);
l.setGravity((LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT));
l.setPadding(50,0,50,0);
picup = new ImageView(context);
picup.setScaleType(ImageView.ScaleType.CENTER);
picup.setVisibility(View.GONE);
picup.setBackgroundDrawable(context.getResources().getDrawable(R.drawable.attach_file));
statusup = new ImageView(context);
statusup.setScaleType(ImageView.ScaleType.CENTER);
statusup.setVisibility(View.GONE);
statusup.setBackgroundDrawable(context.getResources().getDrawable(R.drawable.attach_contact));
phoneup = new ImageView(context);
phoneup.setScaleType(ImageView.ScaleType.CENTER);
phoneup.setVisibility(View.GONE);
phoneup.setBackgroundDrawable(context.getResources().getDrawable(R.drawable.specific_phoneup));
isonetime = new ImageView(context);
isonetime.setScaleType(ImageView.ScaleType.CENTER);
isonetime.setVisibility(View.GONE);
isonetime.setBackgroundDrawable(context.getResources().getDrawable(R.drawable.specific_one_time));
setVisiblity(users.get(position));
l.addView(picup , 100 , 100);
l.addView(statusup , 100 , 100);
l.addView(phoneup , 100 , 100);
l.addView(isonetime , 100 , 100);
x = new CustomUserCell(context, 5, 1, false);
base.addView(x , LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT , LayoutHelper.WRAP_CONTENT ));
base.addView(l , LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT , LayoutHelper.WRAP_CONTENT ));
base.addView(new DividerCell(context) , LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT , LayoutHelper.WRAP_CONTENT ));
convertView = base ;
((CustomUserCell) x).setStatusColors(0xffa8a8a8, 0xff3b84c0);
convertView.setTag("Contacts");
}
TLRPC.User user = MessagesController.getInstance().getUser(users.get(position).getUid());
((CustomUserCell) x).setData(user, null,null, 0);
convertView.setTag("Contacts");
return convertView;
}
示例2: getItemView
import org.telegram.ui.Cells.DividerCell; //导入依赖的package包/类
@Override
public View getItemView(int section, int position, View convertView, ViewGroup parent) {
View x = null;
if (x == null) {
LinearLayout base = new LinearLayout(context);
base.setOrientation(LinearLayout.VERTICAL);
LinearLayout l = new LinearLayout(context);
l.setOrientation(LinearLayout.VERTICAL);
l.setGravity((LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT));
l.setPadding(50, 0, 50, 0);
typetext = new TextView(context);
typetext.setPadding(28, 0, 28, 0);
typetext.setGravity(LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT);
typetext.setTextColor(typecolor);
typetext.setTextSize(14);
timetext = new TextView(context);
timetext.setPadding(28, 0, 28, 0);
timetext.setGravity(LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT);
timetext.setTextColor(nameColor);
timetext.setTextSize(14);
setText(changes.get(position), context);
l.addView(typetext);
l.addView(timetext);
x = new CustomUserCell(context, 5, 1, false);
base.addView(x, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT));
base.addView(l, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT));
base.addView(new DividerCell(context), LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT));
convertView = base;
((CustomUserCell) x).setStatusColors(0xffa8a8a8, 0xff3b84c0);
convertView.setTag("Contacts");
}
TLRPC.User user = MessagesController.getInstance().getUser(changes.get(position).getUid());
((CustomUserCell) x).setData(user, null, null, 0);
convertView.setTag("Contacts");
return convertView;
}