本文整理匯總了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;
}
示例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;
}
示例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();
}
示例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);
}
示例5: setChecked
import android.widget.Checkable; //導入方法依賴的package包/類
public RvHolder setChecked(int viewId, boolean checked) {
Checkable view = (Checkable) getView(viewId);
view.setChecked(checked);
return this;
}
示例6: setChecked
import android.widget.Checkable; //導入方法依賴的package包/類
public ViewHolder setChecked(int viewId, boolean checked) {
Checkable view = (Checkable) getView(viewId);
view.setChecked(checked);
return this;
}
示例7: setChecked
import android.widget.Checkable; //導入方法依賴的package包/類
@Override
public EasyLVHolder setChecked(int viewId, boolean checked) {
Checkable view = getView(viewId);
view.setChecked(checked);
return this;
}
示例8: setChecked
import android.widget.Checkable; //導入方法依賴的package包/類
public ViewHolderHelper setChecked(int viewId, boolean checked) {
Checkable view = (Checkable) getView(viewId);
view.setChecked(checked);
return this;
}
示例9: setChecked
import android.widget.Checkable; //導入方法依賴的package包/類
public ViewHolder setChecked(int viewId, boolean checked)
{
Checkable view = (Checkable) getView(viewId);
view.setChecked(checked);
return this;
}
示例10: setChecked
import android.widget.Checkable; //導入方法依賴的package包/類
public BaseRecyclerHolder setChecked(int viewId, boolean checked) {
Checkable view = getView(viewId);
view.setChecked(checked);
return this;
}
示例11: setChecked
import android.widget.Checkable; //導入方法依賴的package包/類
public BaseViewHolder setChecked(int viewId, boolean checked) {
Checkable view = (Checkable) getView(viewId);
view.setChecked(checked);
return this;
}
示例12: setChecked
import android.widget.Checkable; //導入方法依賴的package包/類
public BaseRvViewHolder setChecked(int viewId, boolean checked) {
Checkable view = (Checkable) getView(viewId);
view.setChecked(checked);
return this;
}
示例13: setChecked
import android.widget.Checkable; //導入方法依賴的package包/類
@Override
public EasyRVHolder setChecked(int viewId, boolean checked) {
Checkable view = getView(viewId);
view.setChecked(checked);
return this;
}
示例14: setChecked
import android.widget.Checkable; //導入方法依賴的package包/類
@Override
public HelperViewHolder setChecked(int viewId, boolean checked) {
Checkable view = getView(viewId);
view.setChecked(checked);
return this;
}
示例15: setChecked
import android.widget.Checkable; //導入方法依賴的package包/類
public ViewHolder setChecked(int viewId, boolean checked)
{
Checkable view = (Checkable) getView(viewId);
view.setChecked(checked);
return this;
}