Java Code Examples for com.chad.library.adapter.base.BaseViewHolder#setGone()

The following examples show how to use com.chad.library.adapter.base.BaseViewHolder#setGone() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CollectionFolderListAdapter.java    From Focus with GNU General Public License v3.0 6 votes vote down vote up
@Override
    protected void convert(final BaseViewHolder helper, CollectionFolder item) {
        helper.setText(R.id.name,item.getName());
//        helper.setText(R.id.info,)
        helper.setGone(R.id.info,false);

        //
        if (selectFolderIds.contains(item.getId())){
            ((CheckBox)(helper.getView(R.id.select))).setChecked(true);
        }else {
            ((CheckBox)(helper.getView(R.id.select))).setChecked(false);
        }

        helper.getView(R.id.select).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ALog.d("什么鬼??");
                click(v,helper.getAdapterPosition(),!((CheckBox)(v.findViewById(R.id.select))).isChecked());

            }
        });

    }
 
Example 2
Source File: OperationListAdapter.java    From Focus with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void convert(BaseViewHolder helper, Operation item) {
    helper.setText(R.id.name,item.getName());
    if (StringUtil.trim(item.getInfo()).equals("")){
        helper.setText(R.id.info,item.getInfo());
    }else {
        helper.setGone(R.id.text_info,true);
    }

    if (item.getDrawable()!=null){
        helper.setGone(R.id.icon,true);
        helper.setImageDrawable(R.id.icon, item.getDrawable());
    }else {
        helper.setGone(R.id.icon,false);
    }

}
 
Example 3
Source File: FeedCategoryRightAdapter.java    From Focus with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void convert(final BaseViewHolder helper, Website item) {
    helper.setText(R.id.name,item.getName());
    if (StringUtil.trim(item.getDesc()).equals("")){
        helper.setGone(R.id.desc,false);
    }else {
        helper.setGone(R.id.desc,true);
        helper.setText(R.id.desc,item.getDesc());
    }

    if (StringUtil.trim(item.getIcon()).equals("")){
        helper.setImageResource(R.id.icon,R.drawable.ic_rss_feed_grey_24dp);
    }else {
        ALog.d("ico图片地址"+item.getIcon());

        ImageLoader.getInstance().displayImage(StringUtil.trim(String.valueOf(item.getIcon())), (ImageView) helper.getView(R.id.icon),ImageLoaderManager.getSubsciptionIconOptions(activity));


    }


}
 
Example 4
Source File: CollectionFolderListAdapter.java    From Focus with GNU General Public License v3.0 6 votes vote down vote up
@Override
    protected void convert(final BaseViewHolder helper, CollectionFolder item) {
        helper.setText(R.id.name,item.getName());
//        helper.setText(R.id.info,)
        helper.setGone(R.id.info,false);

        //
        if (selectFolderIds.contains(item.getId())){
            ((CheckBox)(helper.getView(R.id.select))).setChecked(true);
        }else {
            ((CheckBox)(helper.getView(R.id.select))).setChecked(false);
        }

        helper.getView(R.id.select).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ALog.d("什么鬼??");
                click(v,helper.getAdapterPosition(),!((CheckBox)(v.findViewById(R.id.select))).isChecked());

            }
        });

    }
 
Example 5
Source File: OperationListAdapter.java    From Focus with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void convert(BaseViewHolder helper, Operation item) {
    helper.setText(R.id.name,item.getName());
    if (StringUtil.trim(item.getInfo()).equals("")){
        helper.setText(R.id.info,item.getInfo());
    }else {
        helper.setGone(R.id.text_info,true);
    }

    if (item.getDrawable()!=null){
        helper.setGone(R.id.icon,true);
        helper.setImageDrawable(R.id.icon, item.getDrawable());
    }else {
        helper.setGone(R.id.icon,false);
    }

}
 
Example 6
Source File: FeedCategoryRightAdapter.java    From Focus with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void convert(final BaseViewHolder helper, Website item) {
    helper.setText(R.id.name,item.getName());
    if (StringUtil.trim(item.getDesc()).equals("")){
        helper.setGone(R.id.desc,false);
    }else {
        helper.setGone(R.id.desc,true);
        helper.setText(R.id.desc,item.getDesc());
    }

    if (StringUtil.trim(item.getIcon()).equals("")){
        helper.setImageResource(R.id.icon,R.drawable.ic_rss_feed_grey_24dp);
    }else {
        ALog.d("ico图片地址"+item.getIcon());

        ImageLoader.getInstance().displayImage(StringUtil.trim(String.valueOf(item.getIcon())), (ImageView) helper.getView(R.id.icon),ImageLoaderManager.getSubsciptionIconOptions(activity));


    }


}
 
Example 7
Source File: ReadBackgroundAdapter.java    From Focus with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void convert(BaseViewHolder helper, Background item) {
    GradientDrawable myGrad = (GradientDrawable)helper.getView(R.id.round_rect).getBackground();
    myGrad.setColor(item.getColor());

    //如果当前背景颜色是用户选择的,则显示对号图标
    if (UserPreference.queryValueByKey(UserPreference.READ_BACKGROUND,Background.getColorString(activity,R.color.white)).equals(item.getColor() + "")){
        helper.setGone(R.id.check,true);
    }else {
        helper.setGone(R.id.check,false);
    }
}
 
Example 8
Source File: FeedFolderListMainAdapter.java    From Focus with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void convert(BaseViewHolder helper, FeedFolder item) {
    helper.setText(R.id.title,item.getName());
    helper.setGone(R.id.move_logo,false);
    helper.addOnClickListener(R.id.item_view);
    helper.getView(R.id.main_logo).setPadding(60,0,0,0);
}
 
Example 9
Source File: ReadBackgroundAdapter.java    From Focus with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void convert(BaseViewHolder helper, Background item) {
    GradientDrawable myGrad = (GradientDrawable)helper.getView(R.id.round_rect).getBackground();
    myGrad.setColor(item.getColor());

    //如果当前背景颜色是用户选择的,则显示对号图标
    if (UserPreference.queryValueByKey(UserPreference.READ_BACKGROUND,Background.getColorString(activity,R.color.white)).equals(item.getColor() + "")){
        helper.setGone(R.id.check,true);
    }else {
        helper.setGone(R.id.check,false);
    }
}
 
Example 10
Source File: FeedFolderListMainAdapter.java    From Focus with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void convert(BaseViewHolder helper, FeedFolder item) {
    helper.setText(R.id.title,item.getName());
    helper.setGone(R.id.move_logo,false);
    helper.addOnClickListener(R.id.item_view);
    helper.getView(R.id.main_logo).setPadding(60,0,0,0);
}
 
Example 11
Source File: NewsListAdapterWithThirdLib.java    From JReadHub with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void convert(BaseViewHolder holder, NewsBean newsBean) {
    holder.setText(R.id.tv_title, newsBean.getTitle().trim());
    if (TextUtils.isEmpty(newsBean.getSummaryAuto().trim())) {
        holder.setGone(R.id.tv_summary, false);
    } else {
        holder.setGone(R.id.tv_summary, true);
        holder.setText(R.id.tv_summary, newsBean.getSummaryAuto().trim());
    }

    setInfo(holder, newsBean);
}
 
Example 12
Source File: LoadMoreView.java    From BaseProject with Apache License 2.0 4 votes vote down vote up
private void visibleLoading(BaseViewHolder holder, boolean visible) {
    holder.setGone(getLoadingViewId(), visible);
}
 
Example 13
Source File: LoadMoreView.java    From BaseProject with Apache License 2.0 4 votes vote down vote up
private void visibleLoadFail(BaseViewHolder holder, boolean visible) {
    holder.setGone(getLoadFailViewId(), visible);
}
 
Example 14
Source File: LoadMoreView.java    From BaseProject with Apache License 2.0 4 votes vote down vote up
private void visibleLoadEnd(BaseViewHolder holder, boolean visible) {
    final int loadEndViewId = getLoadEndViewId();
    if (loadEndViewId != 0) {
        holder.setGone(loadEndViewId, visible);
    }
}