Java Code Examples for android.widget.AbsListView.LayoutParams

The following are top voted examples for showing how to use android.widget.AbsListView.LayoutParams. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: EmotionApp   File: EmotionGridViewAdapter.java   View source code 7 votes vote down vote up
@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;
}
 
Example 2
Project: letv   File: HomeFocusView.java   View source code 6 votes vote down vote up
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++;
    }
}
 
Example 3
Project: letv   File: AlbumHalfCommentController.java   View source code 6 votes vote down vote up
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);
}
 
Example 4
Project: letv   File: StarActivity.java   View source code 6 votes vote down vote up
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;
        }
    });
}
 
Example 5
Project: boohee_v5.6   File: GoodsPostsFragment.java   View source code 6 votes vote down vote up
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();
            }
        }
    });
}
 
Example 6
Project: boohee_v5.6   File: ChannelPostsActivity.java   View source code 6 votes vote down vote up
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();
            }
        }
    });
}
 
Example 7
Project: sctalk   File: YayaEmoGridViewAdapter.java   View source code 6 votes vote down vote up
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());
    }
}
 
Example 8
Project: sctalk   File: EmoGridViewAdapter.java   View source code 6 votes vote down vote up
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());
    }
}
 
Example 9
Project: solved-hacking-problem   File: cp.java   View source code 6 votes vote down vote up
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);
    }
}
 
Example 10
Project: solved-hacking-problem   File: cp.java   View source code 6 votes vote down vote up
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);
    }
}
 
Example 11
Project: FMTech   File: BindingDataAdapter.java   View source code 6 votes vote down vote up
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;
}
 
Example 12
Project: FMTech   File: PromptArrayAdapter.java   View source code 6 votes vote down vote up
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);
}
 
Example 13
Project: FMTech   File: cjx.java   View source code 6 votes vote down vote up
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;
  }
}
 
Example 14
Project: PullToRefreshWeiboCommentList   File: MainActivity.java   View source code 6 votes vote down vote up
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);
}
 
Example 15
Project: KJFrameForAndroid   File: EmojiGridAdapter.java   View source code 6 votes vote down vote up
@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;
}
 
Example 16
Project: EasyDice   File: DieViewDieHandAdapter.java   View source code 6 votes vote down vote up
@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;
}
 
Example 17
Project: p1-android   File: LikerFragment.java   View source code 6 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);

    View view = inflater.inflate(R.layout.likers_fragment_layout,
            container, false);
    initActionBar(inflater, view);
    mListHeaderView = new View(getActivity());
    mListHeaderView
            .setLayoutParams(new LayoutParams(
                    AbsListView.LayoutParams.MATCH_PARENT,
                    (int) getActivity().getResources().getDimension(
                            R.dimen.actionbar_height)));

    mProgressBar = view.findViewById(R.id.progressbar);
    mErrorMessage = view.findViewById(R.id.error_message);
    mErrorMessage.setVisibility(View.GONE);
    return view;
}
 
Example 18
Project: letv   File: FirstPageFragment.java   View source code 5 votes vote down vote up
private void addFootLetvImageView() {
    if (this.mLetvImageView == null) {
        this.mLetvImageView = new ImageView(getActivity());
    }
    this.mLetvImageView.setLayoutParams(new LayoutParams(-1, -2));
    this.mLetvImageView.setPadding(0, UIsUtils.zoomWidth(10), 0, UIsUtils.zoomWidth(16));
    this.mLetvImageView.setImageResource(2130838157);
    this.mLetvImageView.setScaleType(ScaleType.CENTER);
    if (this.mListView != null) {
        this.mListView.addFooterView(this.mLetvImageView);
    }
}
 
Example 19
Project: letv   File: MineFragment.java   View source code 5 votes vote down vote up
private void initUI() {
    int i;
    this.mMineListView = (ListView) this.mMineRootLayout.findViewById(R.id.my_list_view);
    this.mHeadLayout = PublicLoadLayout.inflate(getActivity(), R.layout.mine_head_layout, null);
    this.mRoundHead = (RoundImageView) this.mHeadLayout.findViewById(R.id.btn_head_login);
    this.mTitle = (TextView) this.mHeadLayout.findViewById(R.id.head_login_title);
    this.mSubTitle = (TextView) this.mHeadLayout.findViewById(R.id.head_login_subtitle);
    this.mSubTitleOther = (TextView) this.mHeadLayout.findViewById(R.id.head_login_subtitle_other);
    this.mHeadLoginLayout = this.mHeadLayout.findViewById(R.id.layout_head_login);
    this.mMessageIcon = (RelativeLayout) this.mHeadLayout.findViewById(R.id.message_icon);
    this.mNewMessageIcon = (ImageView) this.mHeadLayout.findViewById(R.id.new_message_title);
    ImageView imageView = this.mNewMessageIcon;
    if (this.mIsNewMessageVisible) {
        i = 0;
    } else {
        i = 8;
    }
    imageView.setVisibility(i);
    this.mHeadLayout.findViewById(R.id.title_main_search).setVisibility(8);
    this.mMineListView.addHeaderView(this.mHeadLayout);
    View mFooterView = new View(getActivity());
    mFooterView.setLayoutParams(new LayoutParams(-1, UIsUtils.zoomWidth(15)));
    mFooterView.setBackgroundColor(getActivity().getResources().getColor(2131493362));
    this.mMineListView.addFooterView(mFooterView);
    this.mMineListViewAdapter = new MineListViewAdapter(getActivity());
    this.mMineListView.setAdapter(this.mMineListViewAdapter);
    this.mRoundHead.setOnClickListener(this);
    this.mHeadLoginLayout.setOnClickListener(this);
    this.mMessageIcon.setOnClickListener(this);
    showDefaultProfileList();
}
 
Example 20
Project: letv   File: StarRankActivity.java   View source code 5 votes vote down vote up
private void initListView() {
    this.mStarRankAdapter = new StarRankAdapter(this.mContext);
    this.mListView.setAdapter(this.mStarRankAdapter);
    this.mListView.setHeaderLayoutParams(new LayoutParams(UIsUtils.getScreenWidth(), (int) (9.0f * (((float) UIsUtils.getScreenWidth()) / 16.0f))));
    this.mListView.setScrollViewCallbacks(this);
    ((ExpandableListView) this.mListView.getRootView()).setGroupIndicator(null);
    ((ExpandableListView) this.mListView.getRootView()).setOnGroupClickListener(null);
}
 
Example 21
Project: letv   File: LiveSubTypeActivity.java   View source code 5 votes vote down vote up
private void addHeaderView() {
    if (this.mListView != null && this.mListView.getHeaderViewsCount() == 1) {
        this.mHeaderView = new RelativeLayout(this);
        this.mHeaderView.setLayoutParams(new LayoutParams(-1, -2));
        this.mPlayerView = new LivePlayerView(this);
        this.mPlayerView.init(this.pageIndex, getSupportFragmentManager());
        this.mHeaderView.addView(this.mPlayerView, new RelativeLayout.LayoutParams(-1, -1));
        UIsUtils.zoomView(320, 180, this.mHeaderView);
        this.mListView.addHeaderView(this.mHeaderView);
    }
}
 
Example 22
Project: letv   File: LiveSubTypeActivity.java   View source code 5 votes vote down vote up
private void addFooterView() {
    if (this.mFooterView == null) {
        this.mFooterView = new ImageView(getActivity());
        LayoutParams l = new LayoutParams(-1, Math.min(UIsUtils.getScreenHeight(), UIsUtils.getScreenWidth()) / 6);
        this.mFooterView.setImageResource(2130838157);
        this.mFooterView.setLayoutParams(l);
        this.mFooterView.setBackgroundColor(getActivity().getResources().getColor(2131492949));
        this.mFooterView.setPadding(0, UIsUtils.zoomWidth(5), 0, UIsUtils.zoomWidth(10));
        this.mFooterView.setScaleType(ScaleType.CENTER);
    }
    if (this.mListView.getFooterViewsCount() == 0) {
        this.mListView.addFooterView(this.mFooterView);
    }
}
 
Example 23
Project: letv   File: LiveSubTypeActivity.java   View source code 5 votes vote down vote up
protected void handleFullScreenEvent(FullScreenBtnClickEvent fullScreenEvent) {
    this.mFullScreen = fullScreenEvent.isFull;
    setRedPacketEntryLocation(fullScreenEvent.isFull);
    if (fullScreenEvent.isFull) {
        if (this.mPlayerView != null) {
            getActivity().setRequestedOrientation(0);
            this.mLayoutContainer.setVisibility(0);
            ((ViewGroup) this.mPlayerView.getParent()).removeView(this.mPlayerView);
            this.mLayoutContainer.addView(this.mPlayerView, new ViewGroup.LayoutParams(-1, -1));
            UIsUtils.zoomViewFull(this.mPlayerView);
            UIsUtils.fullScreen(getActivity());
        }
        this.mFullScreenBtn.setImageResource(2130838715);
        return;
    }
    if (this.mPlayerView != null) {
        getActivity().setRequestedOrientation(1);
        this.mLayoutContainer.removeAllViews();
        this.mLayoutContainer.setVisibility(8);
        if (this.mHeaderView != null) {
            this.mHeaderView.addView(this.mPlayerView);
        }
        UIsUtils.zoomView(320, 180, this.mPlayerView);
        UIsUtils.cancelFullScreen(getActivity());
    }
    this.mFullScreenBtn.setImageResource(2130838126);
}
 
Example 24
Project: boohee_v5.6   File: DayPickerView.java   View source code 5 votes vote down vote up
public void init(Context context) {
    this.mHandler = new Handler();
    setLayoutParams(new LayoutParams(-1, -1));
    setDrawSelectorOnTop(false);
    this.mContext = context;
    setUpListView();
}
 
Example 25
Project: boohee_v5.6   File: PinnedSectionListView.java   View source code 5 votes vote down vote up
private void createPinnedShadow(int position) {
    int heightMode;
    int heightSize;
    PinnedViewShadow pinnedShadow = this.mRecycleShadow;
    View recycleView = pinnedShadow == null ? null : pinnedShadow.view;
    this.mRecycleShadow = null;
    View pinnedView = getAdapter().getView(position, recycleView, this);
    LayoutParams layoutParams = (LayoutParams) pinnedView.getLayoutParams();
    if (layoutParams == null) {
        heightMode = Integer.MIN_VALUE;
        heightSize = getHeight();
    } else {
        heightMode = MeasureSpec.getMode(layoutParams.height);
        heightSize = MeasureSpec.getSize(layoutParams.height);
    }
    if (heightMode == 0) {
        heightMode = 1073741824;
    }
    int maxHeight = (getHeight() - getListPaddingTop()) - getListPaddingBottom();
    if (heightSize > maxHeight) {
        heightSize = maxHeight;
    }
    pinnedView.measure(MeasureSpec.makeMeasureSpec((getWidth() - getListPaddingLeft()) -
            getListPaddingRight(), 1073741824), MeasureSpec.makeMeasureSpec(heightSize,
            heightMode));
    pinnedView.layout(0, 0, pinnedView.getMeasuredWidth(), pinnedView.getMeasuredHeight());
    this.mTranslateY = 0;
    if (pinnedShadow == null) {
        pinnedShadow = new PinnedViewShadow();
    }
    pinnedShadow.position = position;
    pinnedShadow.view = pinnedView;
    this.mPinnedShadow = pinnedShadow;
}
 
Example 26
Project: boohee_v5.6   File: ImageGridAdapter.java   View source code 5 votes vote down vote up
public ImageGridAdapter(Context context, boolean showCamera, int mMaxImageNum) {
    this.mMaxImageNum = mMaxImageNum;
    this.mActivity = (MultiImageSelectorActivity) context;
    this.mInflater = (LayoutInflater) context.getSystemService("layout_inflater");
    this.showCamera = showCamera;
    this.mItemLayoutParams = new LayoutParams(-1, -1);
    this.mImageLoader = MultiImageSelector.getImageLoader();
}
 
Example 27
Project: boohee_v5.6   File: ImageGridAdapter.java   View source code 5 votes vote down vote up
public void setItemSize(int columnWidth) {
    if (this.mItemSize != columnWidth) {
        this.mItemSize = columnWidth;
        this.mItemLayoutParams = new LayoutParams(this.mItemSize, this.mItemSize);
        notifyDataSetChanged();
    }
}
 
Example 28
Project: boohee_v5.6   File: ImageGridAdapter.java   View source code 5 votes vote down vote up
public View getView(int i, View view, ViewGroup viewGroup) {
    int type = getItemViewType(i);
    if (type == 0) {
        view = this.mInflater.inflate(R.layout.list_item_camera, viewGroup, false);
        view.setTag(null);
    } else if (type == 1) {
        ViewHolde holde;
        if (view == null) {
            view = this.mInflater.inflate(R.layout.list_item_image, viewGroup, false);
            holde = new ViewHolde(view);
        } else {
            holde = (ViewHolde) view.getTag();
            if (holde == null) {
                view = this.mInflater.inflate(R.layout.list_item_image, viewGroup, false);
                holde = new ViewHolde(view);
            }
        }
        holde.bindData(getItem(i));
        ImageView imageView = holde.indicator;
        if (this.showCamera) {
            i--;
        }
        imageView.setOnClickListener(new CheckClickListener(i));
    }
    if (((LayoutParams) view.getLayoutParams()).height != this.mItemSize) {
        view.setLayoutParams(this.mItemLayoutParams);
    }
    return view;
}
 
Example 29
Project: GCSApp   File: ImageGridFragment.java   View source code 5 votes vote down vote up
/**
 * Sets the item height. Useful for when we know the column width so the
 * height can be set to match.
 * 
 * @param height
 */
public void setItemHeight(int height) {
	if (height == mItemHeight) {
		return;
	}
	mItemHeight = height;
	mImageViewLayoutParams = new RelativeLayout.LayoutParams(
			LayoutParams.MATCH_PARENT, mItemHeight);
	mImageResizer.setImageSize(height);
	notifyDataSetChanged();
}
 
Example 30
Project: sctalk   File: EmoGridViewAdapter.java   View source code 5 votes vote down vote up
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    try {
        GridViewHolder gridViewHolder = null;
        if (null == convertView && null != context) {
            gridViewHolder = new GridViewHolder();
            convertView = gridViewHolder.layoutView;
            if (convertView != null) {
                convertView.setTag(gridViewHolder);
            }
        } else {
            gridViewHolder = (GridViewHolder) convertView.getTag();
        }
        if (null == gridViewHolder || null == convertView) {
            return null;
        }
        gridViewHolder.faceIv.setImageBitmap(getBitmap(position));

        if (position == emoResIds.length - 1) {
            LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
                    LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
            params.topMargin = CommonUtil.getElementSzie(context) / 3;
            gridViewHolder.faceIv.setLayoutParams(params);
        }
        return convertView;
    } catch (Exception e) {
        logger.e(e.getMessage());
        return null;
    }
}
 
Example 31
Project: TAG   File: ImageGridFragment.java   View source code 5 votes vote down vote up
/**
 * Sets the item height. Useful for when we know the column width so the
 * height can be set to match.
 * 
 * @param height
 */
public void setItemHeight(int height) {
	if (height == mItemHeight) {
		return;
	}
	mItemHeight = height;
	mImageViewLayoutParams = new RelativeLayout.LayoutParams(
			LayoutParams.MATCH_PARENT, mItemHeight);
	mImageResizer.setImageSize(height);
	notifyDataSetChanged();
}
 
Example 32
Project: solved-hacking-problem   File: cp.java   View source code 5 votes vote down vote up
private ct m2660a(C0214d c0214d, boolean z) {
    ct ctVar = new ct(this, getContext(), c0214d, z);
    if (z) {
        ctVar.setBackgroundDrawable(null);
        ctVar.setLayoutParams(new LayoutParams(-1, this.f1467h));
    } else {
        ctVar.setFocusable(true);
        if (this.f1463d == null) {
            this.f1463d = new cs();
        }
        ctVar.setOnClickListener(this.f1463d);
    }
    return ctVar;
}
 
Example 33
Project: solved-hacking-problem   File: cp.java   View source code 5 votes vote down vote up
private boolean m2664c() {
    if (m2662a()) {
        removeView(this.f1465f);
        addView(this.f1464e, new ViewGroup.LayoutParams(-2, -1));
        setTabSelected(this.f1465f.getSelectedItemPosition());
    }
    return false;
}
 
Example 34
Project: solved-hacking-problem   File: cp.java   View source code 5 votes vote down vote up
private ct m2660a(C0214d c0214d, boolean z) {
    ct ctVar = new ct(this, getContext(), c0214d, z);
    if (z) {
        ctVar.setBackgroundDrawable(null);
        ctVar.setLayoutParams(new LayoutParams(-1, this.f1467h));
    } else {
        ctVar.setFocusable(true);
        if (this.f1463d == null) {
            this.f1463d = new cs();
        }
        ctVar.setOnClickListener(this.f1463d);
    }
    return ctVar;
}
 
Example 35
Project: solved-hacking-problem   File: cp.java   View source code 5 votes vote down vote up
private boolean m2664c() {
    if (m2662a()) {
        removeView(this.f1465f);
        addView(this.f1464e, new ViewGroup.LayoutParams(-2, -1));
        setTabSelected(this.f1465f.getSelectedItemPosition());
    }
    return false;
}
 
Example 36
Project: RefreshTabView   File: Tab1ListFragment.java   View source code 5 votes vote down vote up
private void listViewAddHeader() {
    placeHolderView = new LinearLayout(getActivity());
    AbsListView.LayoutParams params = new LayoutParams(AbsListView.LayoutParams.MATCH_PARENT, getResources()
            .getDimensionPixelSize(R.dimen.max_header_height));
    placeHolderView.setLayoutParams(params);
    listView.getRefreshableView().addHeaderView(placeHolderView);
}
 
Example 37
Project: RefreshTabView   File: Tab3ListFragment.java   View source code 5 votes vote down vote up
private void listViewAddHeader() {
    placeHolderView = new LinearLayout(getActivity());
    AbsListView.LayoutParams params = new LayoutParams(AbsListView.LayoutParams.MATCH_PARENT, getResources()
            .getDimensionPixelSize(R.dimen.max_header_height));
    placeHolderView.setLayoutParams(params);
    listView.getRefreshableView().addHeaderView(placeHolderView);
}
 
Example 38
Project: RefreshTabView   File: Tab2ListFragment.java   View source code 5 votes vote down vote up
private void listViewAddHeader() {
    placeHolderView = new LinearLayout(getActivity());
    AbsListView.LayoutParams params = new LayoutParams(AbsListView.LayoutParams.MATCH_PARENT, getResources()
            .getDimensionPixelSize(R.dimen.max_header_height));
    placeHolderView.setLayoutParams(params);
    listView.getRefreshableView().addHeaderView(placeHolderView);
}
 
Example 39
Project: BigApp_WordPress_Android   File: AdapterMediaShow.java   View source code 5 votes vote down vote up
public AdapterMediaShow(Context context, int mediaType,
		ArrayList<MediaInfo> selectedMedias) {
	if (selectedMedias != null) {
		mSelectedMedias.addAll(selectedMedias);
	}
	this.context = context;
	this.MediaType = mediaType;
	this.inflate = LayoutInflater.from(context);
	this.mImageLoader = ViewerImageLoader.getInstance();
	mParams = new LayoutParams(getThumbWidth(), getThumbWidth());
}
 
Example 40
Project: ChatDemoUI3.0   File: ImageGridFragment.java   View source code 5 votes vote down vote up
/**
 * Sets the item height. Useful for when we know the column width so the
 * height can be set to match.
 * 
 * @param height
 */
public void setItemHeight(int height) {
	if (height == mItemHeight) {
		return;
	}
	mItemHeight = height;
	mImageViewLayoutParams = new RelativeLayout.LayoutParams(
			LayoutParams.MATCH_PARENT, mItemHeight);
	mImageResizer.setImageSize(height);
	notifyDataSetChanged();
}