本文整理汇总了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;
}