當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。