本文整理汇总了Java中android.widget.CheckedTextView类的典型用法代码示例。如果您正苦于以下问题:Java CheckedTextView类的具体用法?Java CheckedTextView怎么用?Java CheckedTextView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CheckedTextView类属于android.widget包,在下文中一共展示了CheckedTextView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initNetTags
import android.widget.CheckedTextView; //导入依赖的package包/类
private void initNetTags(List<String> allNames) {
TagFlowLayout flowLayoutRecommend = mBinding.flowLayoutRecommend;
TagAdapter adapter = new TagAdapter<String>(allNames) {
@Override
public View getView(FlowLayout parent, int position, String s) {
View view = inflater.inflate(R.layout.item_search_tag, null);
CheckedTextView tag = (CheckedTextView) view.findViewById(R.id.tv_tag);
if (position == 2) tag.setChecked(true);
tag.setText(s);
return tag;
}
};
flowLayoutRecommend.setAdapter(adapter);
flowLayoutRecommend.setOnTagClickListener((view, position, parent) -> {
String item = (String) adapter.getItem(position);
return false;
});
}
示例2: setListItemsStyle
import android.widget.CheckedTextView; //导入依赖的package包/类
private static void setListItemsStyle(ConfigBean bean) {
if(bean.type == DefaultConfig.TYPE_MD_SINGLE_CHOOSE || bean.type == DefaultConfig.TYPE_MD_MULTI_CHOOSE){
ListView listView = bean.alertDialog.getListView();
// listView.getAdapter().
if(listView!=null && listView.getAdapter() !=null){
int count = listView.getChildCount();
for(int i=0;i<count;i++){
View childAt = listView.getChildAt(i);
if(childAt ==null){
continue;
}
CheckedTextView itemView = (CheckedTextView) childAt.findViewById(android.R.id.text1);
Log.e("dd",itemView+"-----"+ i);
if(itemView !=null) {
itemView.setCheckMarkDrawable(R.drawable.bg_toast);
//itemView.setCheckMarkTintList();
// itemView.setCheckMarkTintList();
//itemView.setCheckMarkTintList();
}
}
}
}
}
示例3: getView
import android.widget.CheckedTextView; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
convertView = inflater.inflate(android.R.layout.simple_list_item_multiple_choice,
parent, false);
}
TodoItem item = getItem(position);
CheckedTextView textView = (CheckedTextView) convertView;
textView.setChecked(item.complete());
CharSequence description = item.description();
if (item.complete()) {
SpannableString spannable = new SpannableString(description);
spannable.setSpan(new StrikethroughSpan(), 0, description.length(), 0);
description = spannable;
}
textView.setText(description);
return convertView;
}
示例4: getView
import android.widget.CheckedTextView; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView == null) {
LayoutInflater inflater = ((Activity) getContext()).getLayoutInflater();
convertView = inflater.inflate(R.layout.data_storage_location_item, parent, false);
holder = new ViewHolder();
holder.titleTextView = (TextView) convertView.findViewById(R.id.storage_label);
holder.summaryTextView = (TextView) convertView.findViewById(R.id.available_free_space);
holder.checkedTextView = (CheckedTextView) convertView.findViewById(R.id.checked_text_view);
convertView.setTag(holder);
}
holder = (ViewHolder) convertView.getTag();
holder.titleTextView.setText(getItem(position));
holder.summaryTextView.setText(mFreeSpaces[position]);
holder.checkedTextView.setText(null); // we have a 'custom' label
if (position == mSelectedIndex) {
holder.checkedTextView.setChecked(true);
}
return convertView;
}
示例5: setTabsDisplay
import android.widget.CheckedTextView; //导入依赖的package包/类
/**
* 设置底部导航中图片显示状态和字体颜色
*/
public void setTabsDisplay(int index) {
if (mAttrTa != null) {
int isSpecial = mAttrTa.getInt(index, 0);
if (isSpecial != 0) {
return;
}
}
int size = mCheckedList.size();
for (int i = 0; i < size; i++) {
CheckedTextView checkedTextView = mCheckedList.get(i);
if ((Integer) (checkedTextView.getTag()) == index) {
LogUtils.i(mLabels[index] + " is selected...");
checkedTextView.setChecked(true);
} else {
checkedTextView.setChecked(false);
}
}
}
示例6: getView
import android.widget.CheckedTextView; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
TGToolbarTrackListItem item = (TGToolbarTrackListItem) this.getItem(position);
View view = (convertView != null ? convertView : getLayoutInflater().inflate(R.layout.view_main_drawer_check_item, parent, false));
CheckedTextView checkedTextView = (CheckedTextView) view.findViewById(R.id.main_drawer_check_item);
checkedTextView.setText(item.getLabel());
checkedTextView.setChecked(Boolean.TRUE.equals(item.getSelected()));
checkedTextView.setOnClickListener(this.createGoToTrackAction(item.getTrack()));
CheckBox checkBox = (CheckBox) view.findViewById(R.id.checkbox_mute_track);
checkBox.setChecked(Boolean.TRUE.equals(item.getTrack().isMute()));
checkBox.setOnClickListener(this.createMuteTrackAction(item.getTrack()));
return view;
}
示例7: onCreate
import android.widget.CheckedTextView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_settings_stream_player);
settings = new Settings(getBaseContext());
mShowNavigationBarView = (CheckedTextView) findViewById(R.id.player_show_navigation_title);
mShowViewCountView = (CheckedTextView) findViewById(R.id.player_show_viewercount_title);
mAutoPlaybackView = (CheckedTextView) findViewById(R.id.player_auto_continue_playback_title);
mShowViewCountSummary = (TextView) findViewById(R.id.player_show_viewercount_title_summary);
mShowNavigationBarSummary = (TextView) findViewById(R.id.player_show_navigation_summary);
mAutoPlaybackSummary = (TextView) findViewById(R.id.player_auto_continue_playback_summary);
final Toolbar toolbar = (Toolbar) findViewById(R.id.settings_player_toolbar);
setSupportActionBar(toolbar);
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle(getString(R.string.settings_stream_player_name));
}
updateSummaries();
}
示例8: onCreate
import android.widget.CheckedTextView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_settings_twitch_chat);
settings = new Settings(getBaseContext());
final Toolbar toolbar = (Toolbar) findViewById(R.id.settings_player_toolbar);
setSupportActionBar(toolbar);
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
emoteSizeSummary = (TextView) findViewById(R.id.chat_emote_size_summary);
messageSizeSummary = (TextView) findViewById(R.id.message_size_summary);
emoteStorageSummary = (TextView) findViewById(R.id.emote_storage_summary);
chatLandscapeWidthSummary = (TextView) findViewById(R.id.chat_landscape_summary);
chatLandscapeToggleSummary = (TextView) findViewById(R.id.chat_landscape_enable_summary);
chatLandscapeSwipeToShowSummary = (TextView) findViewById(R.id.chat_landscape_swipe_summary);
chatLandscapeToggle = (CheckedTextView) findViewById(R.id.chat_landscape_enable_title);
chatSwipeToShowToggle = (CheckedTextView) findViewById(R.id.chat_landscape_swipe_title);
updateSummaries();
}
示例9: getView
import android.widget.CheckedTextView; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null)
convertView = LayoutInflater.from(getContext()).inflate(resource, null);
ContactItem contact = getItem(position);
if (contact != null) {
String html = "<b>" + contact.name + "</b> " + contact.number;
Spanned newText;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
newText = Html.fromHtml(html, Html.FROM_HTML_MODE_LEGACY);
else
newText = Html.fromHtml(html);
CheckedTextView textView = (CheckedTextView) convertView;
textView.setText(newText);
textView.setChecked(contact.checked);
textView.jumpDrawablesToCurrentState(); // (!!!) Ferma l'animazione dovuta a setChecked, terribile quando vengono riciclate le view
}
return convertView;
}
示例10: getView
import android.widget.CheckedTextView; //导入依赖的package包/类
@Override public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
convertView = inflater.inflate(android.R.layout.simple_list_item_multiple_choice, parent, false);
}
TodoItem item = getItem(position);
CheckedTextView textView = (CheckedTextView) convertView;
textView.setChecked(item.complete());
CharSequence description = item.description();
if (item.complete()) {
SpannableString spannable = new SpannableString(description);
spannable.setSpan(new StrikethroughSpan(), 0, description.length(), 0);
description = spannable;
}
textView.setText(description);
return convertView;
}
示例11: getChildView
import android.widget.CheckedTextView; //导入依赖的package包/类
/**
* @param groupPosition int
* @param childPosition int
* @param isLastChild boolean
* @param convertView View
* @param parent ViewGroup
* @return View
*/
@Override
public View getChildView(int groupPosition, final int childPosition, boolean isLastChild, View convertView, ViewGroup parent)
{
final String childText = (String) getChild(groupPosition, childPosition);
if (convertView == null)
{
LayoutInflater inflater = (LayoutInflater) this.context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(android.R.layout.simple_list_item_multiple_choice, null);
}
CheckedTextView txtListChild = (CheckedTextView) convertView;
txtListChild.setPadding(PADDING, PADDING, PADDING, PADDING);
txtListChild.setText(childText);
return convertView;
}
示例12: getView
import android.widget.CheckedTextView; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView == null) {
convertView = mInflater.inflate(R.layout.activity_user_tags_list_item, parent, false);
holder = new ViewHolder();
holder.tag = (CheckedTextView) convertView.findViewById(R.id.name);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
TagObject data = new TagObject((JSONObject) getItem(position));
holder.tag.setText(data.getmTagName());
if (mHashSet.contains(data.getmTagId())) {
holder.tag.setChecked(true);
} else {
holder.tag.setChecked(false);
}
return convertView;
}
示例13: getView
import android.widget.CheckedTextView; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = ((Activity)getContext()).getLayoutInflater();
View row = inflater.inflate(R.layout.listitem, parent, false);
ImageView imageView = (ImageView)row.findViewById(R.id.image);
imageView.setImageResource(resourceIds[position]);
CheckedTextView checkedTextView = (CheckedTextView)row.findViewById(
R.id.check);
checkedTextView.setText(getItem(position));
if (position == index) {
checkedTextView.setChecked(true);
}
return row;
}
示例14: setTint
import android.widget.CheckedTextView; //导入依赖的package包/类
public static void setTint(@NonNull CheckedTextView textView, @ColorInt int color) {
ColorStateList sl = new ColorStateList(new int[][]{
new int[]{-android.R.attr.state_checked},
new int[]{android.R.attr.state_checked}
}, new int[]{
ThemeHelper.resolveColor(textView.getContext(), R.attr.colorControlNormal),
color
});
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
textView.setCheckMarkTintList(sl);
} else {
Drawable d = DrawableCompat.wrap(ContextCompat.getDrawable(textView.getContext(), R.drawable.abc_btn_radio_material));
DrawableCompat.setTintList(d, sl);
textView.setCheckMarkDrawable(d);
}
}
示例15: getView
import android.widget.CheckedTextView; //导入依赖的package包/类
@Override
public View getView(final int position, View convertView, ViewGroup parent){
final View v;
ViewHolder holder;
if(convertView == null){
v = LayoutInflater.from(ctx).inflate(R.layout.row_facebook_invite_friends, parent, false);
holder = new ViewHolder();
holder.name = (CheckedTextView) v.findViewById(R.id.username);
holder.avatarImage = (ImageView) v.findViewById(R.id.user_avatar);
v.setTag(holder);
} else {
holder = (ViewHolder)convertView.getTag();
v = convertView;
}
Friend friend = getItem(position);
holder.name.setChecked(((ListView)parent).isItemChecked(position));
holder.name.setText(friend.getUsername());
Log.d("AptoideDebug", friend.getUsername());
Glide.with(ctx).load(friend.getAvatar()).transform(new CircleTransform(ctx)).into(holder.avatarImage);
return v;
}