本文整理匯總了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;
}