本文整理汇总了Java中android.widget.AbsListView.LayoutParams类的典型用法代码示例。如果您正苦于以下问题:Java LayoutParams类的具体用法?Java LayoutParams怎么用?Java LayoutParams使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LayoutParams类属于android.widget.AbsListView包,在下文中一共展示了LayoutParams类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getView
import android.widget.AbsListView.LayoutParams; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ImageView iv_emotion = new ImageView(context);
// 设置内边距
iv_emotion.setPadding(itemWidth/8, itemWidth/8, itemWidth/8, itemWidth/8);
LayoutParams params = new LayoutParams(itemWidth, itemWidth);
iv_emotion.setLayoutParams(params);
//判断是否为最后一个item
if(position == getCount() - 1) {
iv_emotion.setImageResource(R.drawable.compose_emotion_delete);
} else {
String emotionName = emotionNames.get(position);
iv_emotion.setImageResource(EmotionUtils.getImgByName(emotion_map_type,emotionName));
}
return iv_emotion;
}
示例2: updataIndicaterView
import android.widget.AbsListView.LayoutParams; //导入依赖的package包/类
private void updataIndicaterView(int position) {
if (BaseTypeUtils.isListEmpty(this.mFocusList) || this.mFocusList.size() == 1) {
this.mIndicaterView.setVisibility(8);
return;
}
this.mIndicaterView.setVisibility(0);
this.mIndicaterView.removeAllViews();
this.mIndicaterView.setPadding(0, 0, 0, UIsUtils.dipToPx(2.0f));
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(UIsUtils.dipToPx(4.0f), UIsUtils.dipToPx(4.0f));
params.setMargins(UIsUtils.dipToPx(3.0f), UIsUtils.dipToPx(4.0f), UIsUtils.dipToPx(3.0f), UIsUtils.dipToPx(4.0f));
int count = this.mFocusList.size();
int i = 0;
while (i < count) {
ImageView imageView = new ImageView(this.mContext);
imageView.setImageResource(i == position ? 2130838111 : 2130838110);
this.mIndicaterView.addView(imageView, params);
i++;
}
}
示例3: initView
import android.widget.AbsListView.LayoutParams; //导入依赖的package包/类
private void initView() {
this.listView = this.fragment.getListView();
this.mCommentRedDot = (ImageView) ((Activity) this.context).findViewById(R.id.iv_comment_dot);
this.barCommentTextView = (TextView) ((Activity) this.context).findViewById(R.id.album_half_comment_count_text);
this.mTotalText = (TextView) ((Activity) this.context).findViewById(R.id.tv_total_text);
this.mTotalText.setText("总评论");
this.mTotalText.setVisibility(8);
this.listFootView = new ChannelListFootView(this.context);
this.listFootLayout = new LinearLayout(this.context);
this.listFootLayout.setLayoutParams(new LayoutParams(-1, -2));
this.listFootLayout.addView(this.listFootView);
this.popupContentView = UIsUtils.inflate(this.context, R.layout.detailplay_half_comment_item_toast_playerlibs, null);
this.copyTextView = (TextView) this.popupContentView.findViewById(R.id.textv_copy);
this.adapter = this.fragment.getAdapter();
this.listView.addFooterView(this.listFootLayout);
this.listView.setOnScrollListener(this);
this.adapter.setOnCommentItemListener(this);
}
示例4: initListView
import android.widget.AbsListView.LayoutParams; //导入依赖的package包/类
private void initListView() {
this.mStarAdapter = new StarAdapter(this, this.mStarName);
this.mStarAdapter.setStarBookCallback(this.mBooedkProgramsCallback);
this.mListView.setAdapter(this.mStarAdapter);
DisplayMetrics displayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
int screenWidth = displayMetrics.widthPixels;
this.mListView.setHeaderLayoutParams(new LayoutParams(screenWidth, (int) (9.0f * (((float) screenWidth) / 16.0f))));
this.mListView.setScrollViewCallbacks(this);
((ExpandableListView) this.mListView.getRootView()).setGroupIndicator(null);
((ExpandableListView) this.mListView.getRootView()).setOnGroupClickListener(new OnGroupClickListener(this) {
final /* synthetic */ StarActivity this$0;
{
if (HotFix.PREVENT_VERIFY) {
System.out.println(VerifyLoad.class);
}
this.this$0 = this$0;
}
public boolean onGroupClick(ExpandableListView expandableListView, View view, int i, long l) {
return true;
}
});
}
示例5: addListener
import android.widget.AbsListView.LayoutParams; //导入依赖的package包/类
protected void addListener() {
this.mHeaderView = new ImageView(getActivity());
this.mHeaderView.setScaleType(ScaleType.CENTER_CROP);
this.mHeaderView.setLayoutParams(new LayoutParams(-1, -2));
((ListView) this.mPullRefreshListView.getRefreshableView()).addHeaderView(this.mHeaderView);
this.mAdapter = new HomeTimelineAdapter(getActivity(), this.mPosts);
this.mPullRefreshListView.setAdapter(this.mAdapter);
this.mPullRefreshListView.setOnRefreshListener(new OnRefreshListener<ListView>() {
public void onRefresh(PullToRefreshBase<ListView> pullToRefreshBase) {
GoodsPostsFragment.this.getCurrentTopic();
}
});
this.mPullRefreshListView.setOnLastItemVisibleListener(new OnLastItemVisibleListener() {
public void onLastItemVisible() {
if (!GoodsPostsFragment.this.isLastVisible) {
GoodsPostsFragment.this.getNextTopic();
}
}
});
}
示例6: findViews
import android.widget.AbsListView.LayoutParams; //导入依赖的package包/类
private void findViews() {
this.fab_button = (FloatingActionButton) findViewById(R.id.fab_button);
this.fab_button.setVisibility(8);
this.mHeaderView = new ImageView(this);
this.mHeaderView.setScaleType(ScaleType.CENTER_CROP);
this.mHeaderView.setLayoutParams(new LayoutParams(-1, -2));
this.mPullRefreshListView = (PullToRefreshListView) findViewById(R.id.listview);
this.mListView = (ListView) this.mPullRefreshListView.getRefreshableView();
this.mListView.addHeaderView(this.mHeaderView);
this.mPullRefreshListView.setOnRefreshListener(new OnRefreshListener<ListView>() {
public void onRefresh(PullToRefreshBase<ListView> pullToRefreshBase) {
ChannelPostsActivity.this.getCurrentTopic();
}
});
this.mPullRefreshListView.setOnLastItemVisibleListener(new OnLastItemVisibleListener() {
public void onLastItemVisible() {
if (!ChannelPostsActivity.this.isLastVisible) {
ChannelPostsActivity.this.getNextTopic();
}
}
});
}
示例7: GridViewHolder
import android.widget.AbsListView.LayoutParams; //导入依赖的package包/类
public GridViewHolder() {
try {
LayoutParams layoutParams = new LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
layoutView = new LinearLayout(context);
faceIv = new ImageView(context);
layoutView.setLayoutParams(layoutParams);
layoutView.setOrientation(LinearLayout.VERTICAL);
layoutView.setGravity(Gravity.CENTER);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
105,
115);
params.gravity = Gravity.CENTER;
layoutView.addView(faceIv, params);
} catch (Exception e) {
logger.e(e.getMessage());
}
}
示例8: GridViewHolder
import android.widget.AbsListView.LayoutParams; //导入依赖的package包/类
public GridViewHolder() {
try {
LayoutParams layoutParams = new LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
layoutView = new LinearLayout(context);
faceIv = new ImageView(context);
layoutView.setLayoutParams(layoutParams);
layoutView.setOrientation(LinearLayout.VERTICAL);
layoutView.setGravity(Gravity.CENTER);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
CommonUtil.getElementSzie(context),
CommonUtil.getElementSzie(context));
params.gravity = Gravity.CENTER;
layoutView.addView(faceIv, params);
} catch (Exception e) {
logger.e(e.getMessage());
}
}
示例9: m2663b
import android.widget.AbsListView.LayoutParams; //导入依赖的package包/类
private void m2663b() {
if (!m2662a()) {
if (this.f1465f == null) {
this.f1465f = m2665d();
}
removeView(this.f1464e);
addView(this.f1465f, new ViewGroup.LayoutParams(-2, -1));
if (this.f1465f.getAdapter() == null) {
this.f1465f.setAdapter(new cr());
}
if (this.f1460a != null) {
removeCallbacks(this.f1460a);
this.f1460a = null;
}
this.f1465f.setSelection(this.f1468i);
}
}
示例10: if
import android.widget.AbsListView.LayoutParams; //导入依赖的package包/类
public final View getView$7f88da85(int paramInt, View paramView, Data paramData)
{
Integer localInteger = (Integer)paramData.get(this.viewResourceIdKey);
if (localInteger == null)
{
ViewGenerator localViewGenerator = (ViewGenerator)paramData.get(this.viewGeneratorKey);
if (localViewGenerator != null) {}
for (boolean bool = true;; bool = false)
{
Util.checkPrecondition(bool, "Missing both view resource ID and view generator");
return localViewGenerator.makeView$4b5572a0();
}
}
View localView = this.viewHeap.get(localInteger.intValue(), paramView, new AbsListView.LayoutParams(-1, -2));
int[] arrayOfInt = (int[])paramData.get(this.equalityFieldsKey);
if ((localView instanceof DataView))
{
DataView localDataView = (DataView)localView;
FilteredDataRow localFilteredDataRow = new FilteredDataRow(this.originalDataList, this.originalDataList.getItemId(paramInt), new LayoutResIdFilter(localInteger.intValue(), this.viewResourceIdKey), arrayOfInt);
localFilteredDataRow.startAutoRefresh();
localDataView.setDataRow(localFilteredDataRow);
}
return localView;
}
示例11: getDropDownView
import android.widget.AbsListView.LayoutParams; //导入依赖的package包/类
public final View getDropDownView(int paramInt, View paramView, ViewGroup paramViewGroup)
{
if (!isEnabled(paramInt))
{
if (this.mHiddenView == null)
{
this.mHiddenView = new View(getContext());
this.mHiddenView.setVisibility(8);
this.mHiddenView.setLayoutParams(new AbsListView.LayoutParams(0, 0));
}
return this.mHiddenView;
}
if (paramView == this.mHiddenView) {
paramView = null;
}
return super.getDropDownView(paramInt, paramView, paramViewGroup);
}
示例12: b
import android.widget.AbsListView.LayoutParams; //导入依赖的package包/类
protected final View b(View paramView)
{
this.al = ((ListView)paramView.findViewById(aaw.ew));
View localView = new View(this.bn);
nj.a.c(localView, 2);
localView.setLayoutParams(new AbsListView.LayoutParams(this.Z.d, this.Z.d));
this.al.addHeaderView(localView);
this.al.addFooterView(localView);
this.ab = true;
if (efj.L(this.bn)) {}
for (int i = this.Z.d;; i = this.Z.f)
{
this.al.setPadding(i, 0, i, 0);
this.al.setScrollBarStyle(33554432);
return paramView;
}
}
示例13: init
import android.widget.AbsListView.LayoutParams; //导入依赖的package包/类
private void init() {
mListView = (ListView) findViewById(R.id.list_view);
mHeaderContentView = new TextView(this);
mHeaderContentView
.setText("用嘀嘀叫车。上车后司机问你装快的了没,我说有。司机说你用这个再下一个假单我来接,我们一起赚这两个冤大头的钱。");
mListView.addHeaderView(mHeaderContentView);
mPlaceHolder = new View(this);
mPlaceHolder.setLayoutParams(new LayoutParams(
LayoutParams.MATCH_PARENT, Utils.dp2px(this, 200)));
mPlaceHolder.setBackgroundColor(Color.BLACK);
mListView.addHeaderView(mPlaceHolder);
mListView.setAdapter(new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, items));
mHeaderTextContentViewHeight = mHeaderContentView.getHeight();
mStickItemView = findViewById(R.id.extend_item);
mStickItemView.setBackgroundColor(Color.BLACK);
}
示例14: getView
import android.widget.AbsListView.LayoutParams; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder = null;
if (convertView == null) {
holder = new ViewHolder();
convertView = new ImageView(cxt);
LayoutParams params = new LayoutParams(120, 120);
convertView.setLayoutParams(params);
convertView.setPadding(10, 10, 10, 10);
holder.image = (ImageView) convertView;
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
holder.image.setImageResource(datas.get(position).getResId());
return convertView;
}
示例15: getView
import android.widget.AbsListView.LayoutParams; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Die die = getDie(position);
boolean selected = getSelected(position);
if (null == die) {
return null;
}
DieView dieView = (DieView) convertView;
if (null == dieView) {
dieView = new DieView(getContext());
int px = dpToPx(dieView, 66);
dieView.setLayoutParams(new AbsListView.LayoutParams(LayoutParams.MATCH_PARENT, px));
}
dieView.setDie(die);
dieView.setSelected(selected);
return dieView;
}