当前位置: 首页>>代码示例>>Java>>正文


Java Checkable.setChecked方法代码示例

本文整理汇总了Java中android.widget.Checkable.setChecked方法的典型用法代码示例。如果您正苦于以下问题:Java Checkable.setChecked方法的具体用法?Java Checkable.setChecked怎么用?Java Checkable.setChecked使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.Checkable的用法示例。


在下文中一共展示了Checkable.setChecked方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setCheckedAtPosition

import android.widget.Checkable; //导入方法依赖的package包/类
public boolean setCheckedAtPosition(int pos, boolean checked) {
    if (pos < 0) {
        pos = mCurrentPosition;
    }
    int itemCount = getTabItemCount();
    if (pos >= 0 && pos < itemCount) {
        View v = getVirtualChildAt(pos, true);
        if (v instanceof Checkable) {
            Checkable cv = (Checkable) v;
            if (cv.isChecked() != checked) {
                cv.setChecked(checked);
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:rexyren,项目名称:PageScrollView,代码行数:18,代码来源:PageScrollTab.java

示例2: instantiateItem

import android.widget.Checkable; //导入方法依赖的package包/类
@Override
public Object instantiateItem(ViewGroup container, int position) {
    View view = mInflater.inflate(R.layout.sentence_detail, null);
    final Sentence sentence = mSentences.get(position);
    JSONObject content = sentence.getJsonObjectContent();
    final Checkable checkable = (Checkable) view.findViewById(R.id.content);
    checkable.setChecked(sentence.getIsStar());
    final CheckableImageView favoriteBtn = (CheckableImageView) view.findViewById(R.id.favorite);
    favoriteBtn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            checkable.toggle();
            if (mFavoriteClickListener != null) {
                mFavoriteClickListener.onFavoriteClick(sentence, checkable.isChecked());
            }
        }
    });
    ((TextView) view.findViewById(R.id.day)).setText(sentence.getDateline());
    ((TextView) view.findViewById(R.id.en_content)).setText("  " + sentence.getContent());
    ((TextView) view.findViewById(R.id.cn_content)).setText("  " + content.optString("note"));
    loadImg(sentence, (NetworkImageView) view.findViewById(R.id.image));
    container.addView(view);
    return view;
}
 
开发者ID:enuoCM,项目名称:DE-MVP-Clean,代码行数:25,代码来源:SentenceDetailPageAdapter.java

示例3: onBindView

import android.widget.Checkable; //导入方法依赖的package包/类
@Override
protected void onBindView(View view) {
    super.onBindView(view);
    Checkable checkable = (Checkable) view.findViewById(R.id.checkable);
    checkable.setChecked(isChecked());
    syncSummaryView();
}
 
开发者ID:XhinLiang,项目名称:MDPreference,代码行数:8,代码来源:SwitchPreference.java

示例4: onViewCreated

import android.widget.Checkable; //导入方法依赖的package包/类
@Override
protected void onViewCreated() {
    checkableWidget = (Checkable) findViewById(R.id.mp_checkable);
    boolean isChecked = getValue();
    checkableWidget.setChecked(isChecked);
    addPreferenceClickListener(this);
}
 
开发者ID:yarolegovich,项目名称:MaterialPreferences,代码行数:8,代码来源:AbsMaterialCheckablePreference.java

示例5: setChecked

import android.widget.Checkable; //导入方法依赖的package包/类
public RvHolder setChecked(int viewId, boolean checked) {
    Checkable view = (Checkable) getView(viewId);
    view.setChecked(checked);
    return this;
}
 
开发者ID:fengdongfei,项目名称:CXJPadProject,代码行数:6,代码来源:RvHolder.java

示例6: setChecked

import android.widget.Checkable; //导入方法依赖的package包/类
public ViewHolder setChecked(int viewId, boolean checked) {
    Checkable view = (Checkable) getView(viewId);
    view.setChecked(checked);
    return this;
}
 
开发者ID:GuoZhaoHui628,项目名称:SliderStatusBar,代码行数:6,代码来源:ViewHolder.java

示例7: setChecked

import android.widget.Checkable; //导入方法依赖的package包/类
@Override
public EasyLVHolder setChecked(int viewId, boolean checked) {
    Checkable view = getView(viewId);
    view.setChecked(checked);
    return this;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:7,代码来源:EasyLVHolder.java

示例8: setChecked

import android.widget.Checkable; //导入方法依赖的package包/类
public ViewHolderHelper setChecked(int viewId, boolean checked) {
    Checkable view = (Checkable) getView(viewId);
    view.setChecked(checked);
    return this;
}
 
开发者ID:ynztlxdeai,项目名称:MVPtemplate,代码行数:6,代码来源:ViewHolderHelper.java

示例9: setChecked

import android.widget.Checkable; //导入方法依赖的package包/类
public ViewHolder setChecked(int viewId, boolean checked)
{
    Checkable view = (Checkable) getView(viewId);
    view.setChecked(checked);
    return this;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:7,代码来源:ViewHolder.java

示例10: setChecked

import android.widget.Checkable; //导入方法依赖的package包/类
public BaseRecyclerHolder setChecked(int viewId, boolean checked) {
    Checkable view = getView(viewId);
    view.setChecked(checked);
    return this;
}
 
开发者ID:zuoni1018,项目名称:CoordinatorLayoutExample-master,代码行数:6,代码来源:BaseRecyclerHolder.java

示例11: setChecked

import android.widget.Checkable; //导入方法依赖的package包/类
public BaseViewHolder setChecked(int viewId, boolean checked) {
    Checkable view = (Checkable) getView(viewId);
    view.setChecked(checked);
    return this;
}
 
开发者ID:yangchong211,项目名称:YCBaseAdapter,代码行数:6,代码来源:BaseViewHolder.java

示例12: setChecked

import android.widget.Checkable; //导入方法依赖的package包/类
public BaseRvViewHolder setChecked(int viewId, boolean checked) {
    Checkable view = (Checkable) getView(viewId);
    view.setChecked(checked);
    return this;
}
 
开发者ID:yangchong211,项目名称:YCBaseAdapter,代码行数:6,代码来源:BaseRvViewHolder.java

示例13: setChecked

import android.widget.Checkable; //导入方法依赖的package包/类
@Override
public EasyRVHolder setChecked(int viewId, boolean checked) {
    Checkable view = getView(viewId);
    view.setChecked(checked);
    return this;
}
 
开发者ID:zwmlibs,项目名称:BookReader-master,代码行数:7,代码来源:EasyRVHolder.java

示例14: setChecked

import android.widget.Checkable; //导入方法依赖的package包/类
@Override
public HelperViewHolder setChecked(int viewId, boolean checked) {
    Checkable view = getView(viewId);
    view.setChecked(checked);
    return this;
}
 
开发者ID:zengcanxiang,项目名称:BaseAdapter,代码行数:7,代码来源:HelperViewHolder.java

示例15: setChecked

import android.widget.Checkable; //导入方法依赖的package包/类
public ViewHolder setChecked(int viewId, boolean checked)
{
	Checkable view = (Checkable) getView(viewId);
	view.setChecked(checked);
	return this;
}
 
开发者ID:yangqihua,项目名称:awesome-component-Android,代码行数:7,代码来源:ViewHolder.java


注:本文中的android.widget.Checkable.setChecked方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。