• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java CheckedTextView类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中android.widget.CheckedTextView的典型用法代码示例。如果您正苦于以下问题:Java CheckedTextView类的具体用法?Java CheckedTextView怎么用?Java CheckedTextView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CheckedTextView类属于android.widget包,在下文中一共展示了CheckedTextView类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
    });
}
 
开发者ID:xieyangxuejun,项目名称:SearchLayout,代码行数:19,代码来源:FlowSearchLayout.java


示例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();

                }

            }

        }

    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:29,代码来源:Tool.java


示例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;
}
 
开发者ID:geralt-encore,项目名称:Delightful-SQLBrite,代码行数:23,代码来源:ItemsAdapter.java


示例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;
}
 
开发者ID:Elias33,项目名称:Quran,代码行数:25,代码来源:DataListPreference.java


示例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);
		}
	}
}
 
开发者ID:SavorGit,项目名称:Hotspot-master-devp,代码行数:22,代码来源:MyTabWidget.java


示例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;
}
 
开发者ID:axlecho,项目名称:tuxguitar,代码行数:17,代码来源:TGToolbarTrackListAdapter.java


示例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();
}
 
开发者ID:SebastianRask,项目名称:Pocket-Plays-for-Twitch,代码行数:24,代码来源:SettingsStreamPlayerActivity.java


示例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();
}
 
开发者ID:SebastianRask,项目名称:Pocket-Plays-for-Twitch,代码行数:24,代码来源:SettingsTwitchChatActivity.java


示例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;
}
 
开发者ID:gvinciguerra,项目名称:custode,代码行数:23,代码来源:ContactsAdapter.java


示例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;
}
 
开发者ID:jiechic,项目名称:sqlbrite-sqlcipher,代码行数:21,代码来源:ItemsAdapter.java


示例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;
}
 
开发者ID:hcmlab,项目名称:ssj,代码行数:24,代码来源:ListAdapter.java


示例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;
}
 
开发者ID:huang303513,项目名称:Coding-Android,代码行数:22,代码来源:UserTagAdapter.java


示例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;
}
 
开发者ID:suomi35,项目名称:empeg-remote,代码行数:23,代码来源:ImageArrayAdapter.java


示例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);
    }
}
 
开发者ID:iQuick,项目名称:NewsMe,代码行数:17,代码来源:MDTintHelper.java


示例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;
}
 
开发者ID:Aptoide,项目名称:aptoide-client,代码行数:27,代码来源:TimeLineFriendsCheckableListAdapter.java


示例16: 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_check_material));
        DrawableCompat.setTintList(d, sl);
        textView.setCheckMarkDrawable(d);
    }
}
 
开发者ID:iQuick,项目名称:AndroidTint,代码行数:17,代码来源:EmTintUtils.java


示例17: getView

import android.widget.CheckedTextView; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public View getView(int position, View convertView, ViewGroup parent) {

    LayoutInflater inflater = ((Activity) getContext()).getLayoutInflater();
    View row = inflater.inflate(R.layout.preference_language, parent, false);
    ImageView imageView = (ImageView)row.findViewById(R.id.lanpref_image);
    imageView.setImageResource(resourceIds[position]);

    CheckedTextView checkedTextView = (CheckedTextView)row.findViewById(
            R.id.lanpref_check);

    checkedTextView.setText(getItem(position));

    if (position == index) {
        checkedTextView.setChecked(true);
    }

    return row;
}
 
开发者ID:paolo-optc,项目名称:optc-mobile-db,代码行数:22,代码来源:ImageArrayAdapter.java


示例18: isTextChecked

import android.widget.CheckedTextView; //导入依赖的package包/类
/**
 * Checks if the specified text is checked.
 *
 * @param text the text that the {@link CheckedTextView} or {@link CompoundButton} objects display, specified as a regular expression
 * @return {@code true} if the specified text is checked and {@code false} if it is not checked
 */

@SuppressWarnings("unchecked")
public boolean isTextChecked(String text){
	if(config.commandLogging){
		Log.d(config.commandLoggingTag, "isTextChecked(\""+text+"\")");
	}
	
	waiter.waitForViews(false, CheckedTextView.class, CompoundButton.class);

	if(viewFetcher.getCurrentViews(CheckedTextView.class, true).size() > 0 && checker.isCheckedTextChecked(text))
		return true;

	if(viewFetcher.getCurrentViews(CompoundButton.class, true).size() > 0 && checker.isButtonChecked(CompoundButton.class, text))
		return true;

	return false;
}
 
开发者ID:IfengAutomation,项目名称:test_agent_android,代码行数:24,代码来源:Solo.java


示例19: SettingItem

import android.widget.CheckedTextView; //导入依赖的package包/类
/**
 * @param context
 * @param attrs
 */
public SettingItem(Context context, AttributeSet attrs) {
    super(context, attrs);
    LayoutInflater.from(context).inflate(R.layout.detaillist_item, this, true);

    mContent = (LinearLayout) findViewById(R.id.content);
    mTitle = (TextView) findViewById(android.R.id.title);
    mSummary = (TextView) findViewById(android.R.id.summary);
    mNewUpdate = (TextView) findViewById(R.id.text_tv_one);
    mCheckedTextView = (CheckedTextView) findViewById(R.id.accessory_checked);
    mDividerView = findViewById(R.id.item_bottom_divider);

    TypedArray localTypedArray = context.obtainStyledAttributes(attrs, R.styleable.setting_info);
    setTitleText(localTypedArray.getString(R.styleable.setting_info_item_titleText));
    setDetailText(localTypedArray.getString(R.styleable.setting_info_item_detailText));
    setAccessoryType(localTypedArray.getInt(R.styleable.setting_info_item_accessoryType , 0));
    setShowDivider(localTypedArray.getBoolean(R.styleable.setting_info_item_showDivider , true));
    localTypedArray.recycle();

    mNewUpdate.setVisibility(View.GONE);
}
 
开发者ID:zhangjingpu,项目名称:youkes_vr,代码行数:25,代码来源:SettingItem.java


示例20: configureView

import android.widget.CheckedTextView; //导入依赖的package包/类
/**
 * Construit une vue sur base du layout joueur_list_view_item et
 * de l'élément courant du curseur
 * @param context
 * @param convertView
 * @param cursor
 * @return
 */
public View configureView(Context context, View convertView, Cursor cursor) {
    final Commentaire commentaire = DAO.getCommentaireFromCursor(cursor);

    final CheckedTextView texteC = (CheckedTextView)convertView.findViewById(R.id.item_commentaire_etablissement);
    texteC.setText(commentaire.getTexte());

    texteC.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (texteC.isChecked()) {
                texteC.setChecked(false);
                listeCommDel.remove(new Integer(commentaire.getId()));
                Log.i("TAILLE arraylist :", "apres un remove :" + listeCommDel.size());

            } else {
                texteC.setChecked(true);
                listeCommDel.add(commentaire.getId());
                Log.i("TAILLE arraylist :", "apres un add :" + listeCommDel.size());
            }
        }
    });
    return convertView;
}
 
开发者ID:mikdom,项目名称:CampusAlma,代码行数:32,代码来源:CommentaireCursorAdapter.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ReflectionUtils类代码示例发布时间:2022-05-20
下一篇:
Java FillLayout类代码示例发布时间:2022-05-20
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap