类android.widget.AbsListView.LayoutParams源码实例Demo

下面列出了怎么用android.widget.AbsListView.LayoutParams的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: timecat   文件: EmotionGridViewAdapter.java
@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(EmotionUtil.getImgByName(emotion_map_type, emotionName));
    }

    return iv_emotion;
}
 
源代码2 项目: chatui   文件: EmotionGridViewAdapter.java
@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.EMOTION_STATIC_MAP.get(emotionName));
    }

    return iv_emotion;
}
 
源代码3 项目: letv   文件: HomeFocusView.java
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++;
    }
}
 
源代码4 项目: letv   文件: AlbumHalfCommentController.java
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);
}
 
源代码5 项目: letv   文件: StarActivity.java
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;
        }
    });
}
 
源代码6 项目: sctalk   文件: YayaEmoGridViewAdapter.java
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());
    }
}
 
源代码7 项目: sctalk   文件: EmoGridViewAdapter.java
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());
    }
}
 
源代码8 项目: letv   文件: FirstPageFragment.java
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);
    }
}
 
源代码9 项目: letv   文件: MineFragment.java
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();
}
 
源代码10 项目: letv   文件: StarRankActivity.java
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);
}
 
源代码11 项目: letv   文件: LiveSubTypeActivity.java
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);
    }
}
 
源代码12 项目: letv   文件: LiveSubTypeActivity.java
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);
    }
}
 
源代码13 项目: letv   文件: LiveSubTypeActivity.java
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);
}
 
源代码14 项目: sctalk   文件: EmoGridViewAdapter.java
@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;
    }
}
 
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());
}
 
源代码16 项目: FanXin-based-HuanXin   文件: ImageGridFragment.java
/**
 * 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();
}
 
源代码17 项目: RefreashTabView   文件: Tab1ListFragment.java
private void listViewAddHeader() {
    placeHolderView = new LinearLayout(getActivity());
    AbsListView.LayoutParams params = new LayoutParams(AbsListView.LayoutParams.MATCH_PARENT, scrollTabHolder
            .headerHeight());
    placeHolderView.setLayoutParams(params);
    listView.getRefreshableView().addHeaderView(placeHolderView);
}
 
源代码18 项目: RefreashTabView   文件: Tab3ListFragment.java
private void listViewAddHeader() {
    placeHolderView = new LinearLayout(getActivity());
    AbsListView.LayoutParams params = new LayoutParams(AbsListView.LayoutParams.MATCH_PARENT, scrollTabHolder
            .headerHeight());
    placeHolderView.setLayoutParams(params);
    listView.getRefreshableView().addHeaderView(placeHolderView);
}
 
源代码19 项目: umeng_community_android   文件: FeedImageAdapter.java
@Override
public View getView(int position, View view, ViewGroup parent) {
    SquareImageView imageView;
    if (view == null) {
        LayoutParams mImageViewLayoutParams = new LayoutParams(LayoutParams.MATCH_PARENT
                , ViewGroup.LayoutParams.MATCH_PARENT);
        imageView = new SquareImageView(mContext);
        imageView.setScaleType(ScaleType.CENTER_CROP);
        imageView.setLayoutParams(mImageViewLayoutParams);
    } else {
        imageView = (SquareImageView) view;
    }
    imageView.setImageUrl(getItem(position).thumbnail, mDisplayOption);
    return imageView;
}
 
源代码20 项目: MaterialDateTimePicker   文件: MonthAdapter.java
@Override
@NonNull
public MonthViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {

    MonthView v = createMonthView(parent.getContext());
    // Set up the new view
    LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    v.setLayoutParams(params);
    v.setClickable(true);
    v.setOnDayClickListener(this);

    return new MonthViewHolder(v);
}
 
源代码21 项目: Animated-Expanding-ListView   文件: ListAdapter.java
@Override
@SuppressWarnings("deprecation")
public View getView(int position, View convertView, ViewGroup parent) {
    ListViewHolder holder = null;
    ListItem listItem = listItems.get(position);

    if (convertView == null) {
        LayoutInflater vi = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        convertView = vi.inflate(R.layout.list_item, null);

        LinearLayout textViewWrap = (LinearLayout) convertView.findViewById(R.id.text_wrap);
        TextView text = (TextView) convertView.findViewById(R.id.text);

        holder = new ListViewHolder(text);

        // setViewWrap IS REQUIRED
        holder.setViewWrap(textViewWrap);

    } else {
        holder = (ListViewHolder) convertView.getTag();
    }

    // THIS IS REQUIRED
    holder.getViewWrap().setLayoutParams(new AbsListView.LayoutParams(LayoutParams.MATCH_PARENT, listItem.getCurrentHeight()));

    holder.getTextView().setText(listItem.getText());

    holder.getTextView().setCompoundDrawablesWithIntrinsicBounds(listItem.getDrawable(), 0, 0, 0);

    convertView.setTag(holder);

    // setHolder IS REQUIRED
    listItem.setHolder(holder);

    return convertView;
}
 
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
    float height = (mToHeight - mFromHeight) * interpolatedTime + mFromHeight;
    float width = (mToWidth - mFromWidth) * interpolatedTime + mFromWidth;
    LayoutParams p = (LayoutParams) mView.getLayoutParams();
    p.height = (int) height;
    p.width = (int) width;
    mAelvListItem.setCurrentHeight(p.height);
    mListAdapter.notifyDataSetChanged();
}
 
源代码23 项目: cathode   文件: MonthAdapter.java
@Override public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
  MonthView view = createMonthView(context);
  // Set up the new view
  LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
  view.setLayoutParams(params);
  view.setClickable(true);
  view.setOnDayClickListener(this);

  return new ViewHolder(view);
}
 
源代码24 项目: PersianDateRangePicker   文件: MonthAdapter.java
@SuppressLint("NewApi")
@SuppressWarnings("unchecked")
@Override
public View getView(int position, View convertView, ViewGroup parent) {
  MonthView v;
  HashMap<String, Integer> drawingParams = null;
  if (convertView != null) {
    v = (MonthView) convertView;
    // We store the drawing parameters in the view so it can be recycled
    drawingParams = (HashMap<String, Integer>) v.getTag();
  } else {
    v = createMonthView(mContext);
    // Set up the new view
    LayoutParams params = new LayoutParams(
      LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    v.setLayoutParams(params);
    v.setClickable(true);
    v.setOnDayClickListener(this);
    if (mAccentColor != -1) {
      v.setAccentColor(mAccentColor);
    }
  }
  if (drawingParams == null) {
    drawingParams = new HashMap<String, Integer>();
  }
  drawingParams.clear();

  final int month = position % MONTHS_IN_YEAR;
  final int year = position / MONTHS_IN_YEAR + mController.getMinYear();

  int selectedDay = -1;
  if (isSelectedDayInMonth(year, month)) {
    selectedDay = mSelectedDay.day;
  }

  // Invokes requestLayout() to ensure that the recycled view is set with the appropriate
  // height/number of weeks before being displayed.
  v.reuse();

  drawingParams.put(MonthView.VIEW_PARAMS_SELECTED_DAY, selectedDay);
  drawingParams.put(MonthView.VIEW_PARAMS_YEAR, year);
  drawingParams.put(MonthView.VIEW_PARAMS_MONTH, month);
  drawingParams.put(MonthView.VIEW_PARAMS_WEEK_START, mController.getFirstDayOfWeek());
  v.setMonthParams(drawingParams);
  v.invalidate();
  return v;
}
 
源代码25 项目: AssistantBySDK   文件: MonthAdapter.java
@SuppressLint("NewApi")
@SuppressWarnings("unchecked")
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    MonthView v;
    HashMap<String, Integer> drawingParams = null;
    if (convertView != null) {
        v = (MonthView) convertView;
        // We store the drawing parameters in the view so it can be recycled
        drawingParams = (HashMap<String, Integer>) v.getTag();
    } else {
        v = createMonthView(mContext);
        // Set up the new view
        LayoutParams params = new LayoutParams(
                LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
        v.setLayoutParams(params);
        v.setClickable(true);
        v.setOnDayClickListener(this);
    }
    if (drawingParams == null) {
        drawingParams = new HashMap<>();
    }
    drawingParams.clear();

    final int month = (position + mController.getStartDate().get(Calendar.MONTH)) % MONTHS_IN_YEAR;
    final int year = (position + mController.getStartDate().get(Calendar.MONTH)) / MONTHS_IN_YEAR + mController.getMinYear();

    int selectedDay = -1;
    if (isSelectedDayInMonth(year, month)) {
        selectedDay = mSelectedDay.day;
    }

    // Invokes requestLayout() to ensure that the recycled view is set with the appropriate
    // height/number of weeks before being displayed.
    v.reuse();

    drawingParams.put(MonthView.VIEW_PARAMS_SELECTED_DAY, selectedDay);
    drawingParams.put(MonthView.VIEW_PARAMS_YEAR, year);
    drawingParams.put(MonthView.VIEW_PARAMS_MONTH, month);
    drawingParams.put(MonthView.VIEW_PARAMS_WEEK_START, mController.getFirstDayOfWeek());
    v.setMonthParams(drawingParams);
    v.invalidate();
    return v;
}
 
源代码26 项目: narrate-android   文件: MonthAdapter.java
@SuppressLint("NewApi")
@SuppressWarnings("unchecked")
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    MonthView v;
    HashMap<String, Integer> drawingParams = null;
    if (convertView != null) {
        v = (MonthView) convertView;
        // We store the drawing parameters in the view so it can be recycled
        drawingParams = (HashMap<String, Integer>) v.getTag();
    } else {
        v = createMonthView(mContext);
        // Set up the new view
        LayoutParams params = new LayoutParams(
                LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
        v.setLayoutParams(params);
        v.setClickable(true);
        v.setOnDayClickListener(this);

        if ( mFixedHeightFlag ) {
            v.setFixedHeight(mFixedHeight);
        }
    }
    if (drawingParams == null) {
        drawingParams = new HashMap<String, Integer>();
    }
    drawingParams.clear();

    final int month = position % MONTHS_IN_YEAR;
    final int year = position / MONTHS_IN_YEAR + mController.getMinYear();

    int selectedDay = -1;
    if (isSelectedDayInMonth(year, month)) {
        selectedDay = mSelectedDay.day;
    }

    // Invokes requestLayout() to ensure that the recycled view is set with the appropriate
    // height/number of weeks before being displayed.
    v.reuse();

    drawingParams.put(MonthView.VIEW_PARAMS_SELECTED_DAY, selectedDay);
    drawingParams.put(MonthView.VIEW_PARAMS_YEAR, year);
    drawingParams.put(MonthView.VIEW_PARAMS_MONTH, month);
    drawingParams.put(MonthView.VIEW_PARAMS_WEEK_START, mController.getFirstDayOfWeek());
    v.setMonthParams(drawingParams);
    v.invalidate();
    return v;
}
 
源代码27 项目: BottomSheetPickers   文件: MonthAdapter.java
@SuppressLint("NewApi")
@SuppressWarnings("unchecked")
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    MonthView v;
    HashMap<String, Integer> drawingParams = null;
    if (convertView != null) {
        v = (MonthView) convertView;
        // We store the drawing parameters in the view so it can be recycled
        drawingParams = (HashMap<String, Integer>) v.getTag();
    } else {
        v = createMonthView(mContext, mThemeDark);
        // Set up the new view
        LayoutParams params = new LayoutParams(
                LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
        v.setLayoutParams(params);
        v.setClickable(true);
        v.setOnDayClickListener(this);
    }
    if (drawingParams == null) {
        drawingParams = new HashMap<String, Integer>();
    }
    drawingParams.clear();

    final int month = position % MONTHS_IN_YEAR;
    final int year = position / MONTHS_IN_YEAR + mController.getMinYear();

    int selectedDay = -1;
    if (isSelectedDayInMonth(year, month)) {
        selectedDay = mSelectedDay.day;
    }

    // Invokes requestLayout() to ensure that the recycled view is set with the appropriate
    // height/number of weeks before being displayed.
    v.reuse();

    drawingParams.put(MonthView.VIEW_PARAMS_SELECTED_DAY, selectedDay);
    drawingParams.put(MonthView.VIEW_PARAMS_YEAR, year);
    drawingParams.put(MonthView.VIEW_PARAMS_MONTH, month);
    drawingParams.put(MonthView.VIEW_PARAMS_WEEK_START, mController.getFirstDayOfWeek());
    v.setMonthParams(drawingParams);
    v.invalidate();
    return v;
}
 
@Override
public View getView(int position, View convertView, ViewGroup parent) {
	ViewHolder holder = null;
	if (convertView == null) {
		holder = new ViewHolder();
		convertView = inflate.inflate(R.layout.zg_adapter_item_grid_show,
				null);
		holder.tv_camera = (TextView) convertView
				.findViewById(R.id.tv_camera);
		holder.iv_select = (ImageView) convertView
				.findViewById(R.id.iv_select);
		holder.iv_content = (ImageView) convertView
				.findViewById(R.id.iv_content);
		ViewGroup.LayoutParams params = holder.iv_content.getLayoutParams();
		params.width = mParams.width;
		params.height = mParams.height;
		holder.iv_content.setLayoutParams(params);
		convertView.setLayoutParams(mParams);
		convertView.setTag(holder);
	} else {
		holder = (ViewHolder) convertView.getTag();
	}
	if (position == 0) {
		holder.tv_camera.setText(getMediaText());
		holder.tv_camera.setVisibility(View.VISIBLE);
		holder.iv_content.setVisibility(View.GONE);
	} else if (MediaType == MediaConstants.TYPE_VIDEO) {
		holder.tv_camera.setVisibility(View.GONE);
		holder.iv_content.setVisibility(View.VISIBLE);
		mImageLoader.displayImageAndCachedMemory(
				Scheme.FILE.wrap(getItem(getId(position)).filePath),
				holder.iv_content);
	} else if (MediaType == MediaConstants.TYPE_PIC) {
		holder.tv_camera.setVisibility(View.GONE);
		holder.iv_content.setVisibility(View.VISIBLE);
		MediaInfo _mediaInfo = getItem(getId(position));
		if (_mediaInfo.select) {
			holder.iv_select.setVisibility(View.VISIBLE);
			if (mDeletedMedias != null && mDeletedMedias.size() > 0
					&& mDeletedMedias.remove(_mediaInfo)) {
				_mediaInfo.select = false;
				holder.iv_select.setVisibility(View.GONE);
			}
		} else {
			holder.iv_select.setVisibility(View.GONE);
			if (mSelectedMedias != null && mSelectedMedias.size() > 0
					&& mSelectedMedias.remove(_mediaInfo)) {
				_mediaInfo.select = true;
				holder.iv_select.setVisibility(View.VISIBLE);
			}
		}
		mImageLoader.displayImageAndCachedMemory(
				Scheme.FILE.wrap(getItem(getId(position)).filePath),
				holder.iv_content);
	}
	return convertView;
}
 
源代码29 项目: FanXin-based-HuanXin   文件: ImageGridFragment.java
public ImageAdapter(Context context) {
	super();
	mContext = context;
	mImageViewLayoutParams = new RelativeLayout.LayoutParams(
			LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
}
 
源代码30 项目: RefreashTabView   文件: Tab1ListFragment.java
@Override
public void headerChange() {
    AbsListView.LayoutParams params = (LayoutParams) placeHolderView.getLayoutParams();
    params.height = scrollTabHolder.headerHeight();
    placeHolderView.setLayoutParams(params);
}
 
 类所在包
 类方法
 同包方法