当前位置: 首页>>代码示例>>Java>>正文


Java CheckedTextView.setOnClickListener方法代码示例

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


在下文中一共展示了CheckedTextView.setOnClickListener方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: 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

示例3: setupTopModulePager

import android.widget.CheckedTextView; //导入方法依赖的package包/类
protected void setupTopModulePager(LayoutInflater inflater, ViewGroup container, View view, String[] buttonTitles) {
    int dp4 = DisplayUtils.dpToPx(view.getContext(), 4);
    int dp80 = DisplayUtils.dpToPx(view.getContext(), 80);

    for (int i = 0; i < buttonTitles.length; i++) {
        CheckedTextView rb = (CheckedTextView) inflater.inflate(R.layout.stats_top_module_pager_button, container, false);
        RadioGroup.LayoutParams params = new RadioGroup.LayoutParams(RadioGroup.LayoutParams.MATCH_PARENT,
                RadioGroup.LayoutParams.WRAP_CONTENT);
        params.weight = 1;
        rb.setTypeface((TypefaceCache.getTypeface(view.getContext())));
        if (i == 0) {
            params.setMargins(0, 0, dp4, 0);
        } else {
            params.setMargins(dp4, 0, 0, 0);
        }
        rb.setMinimumWidth(dp80);
        rb.setGravity(Gravity.CENTER);
        rb.setLayoutParams(params);
        rb.setText(buttonTitles[i]);
        rb.setChecked(i == mTopPagerSelectedButtonIndex);
        rb.setOnClickListener(TopModulePagerOnClickListener);
        mTopPagerContainer.addView(rb);
    }
    mTopPagerContainer.setVisibility(View.VISIBLE);
}
 
开发者ID:ldsddn,项目名称:wordpress_app_android,代码行数:26,代码来源:StatsAbstractListFragment.java

示例4: ViewHolder

import android.widget.CheckedTextView; //导入方法依赖的package包/类
public ViewHolder(final View itemView) {
	super(itemView);

	mAppTitleTextView = (CheckedTextView) itemView.findViewById(android.R.id.text1);
	mAppTitleTextView.setOnClickListener(new View.OnClickListener() {
		@Override
		public void onClick(final View v) {
			if (mAdministrationModeManager.isAdministrator() &&
					mAdministrationModeManager.isDeviceOwner()) {
				if (mAppTitleTextView.isChecked()) {
					mAppsManager.hideApp(mAppsList.get(getAdapterPosition()));
				} else {
					mAppsManager.showApp(mAppsList.get(getAdapterPosition()));
				}
				notifyDataSetChanged();
			}
		}
	});
}
 
开发者ID:raynor73,项目名称:DeviceOwner,代码行数:20,代码来源:MainActivity.java

示例5: onCreate

import android.widget.CheckedTextView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    findViewById(R.id.thread_demo).setOnClickListener(v -> startActivity(new Intent(this, DemoActivity.class)));

    check1 = (CheckedTextView) findViewById(R.id.check1);
    check2 = (CheckedTextView) findViewById(R.id.check2);

    check1.setText(MainState.NAME_1);
    check2.setText(MainState.NAME_2);

    check1.setOnClickListener(v -> switchTo(MainState.NAME_1));
    check2.setOnClickListener(v -> switchTo(MainState.NAME_2));

    ListView listView = (ListView) findViewById(R.id.listView);
    listView.setAdapter(adapter = new ArrayAdapter<>(this, R.layout.item));
}
 
开发者ID:konmik,项目名称:Phlux,代码行数:20,代码来源:MainActivity.java

示例6: DialogXRandomInfo

import android.widget.CheckedTextView; //导入方法依赖的package包/类
public DialogXRandomInfo(Context context, boolean guide, boolean auto) {
    super(context);
    setContentView(R.layout.dialog_xrandom_info);
    findViewById(R.id.btn_ok).setOnClickListener(this);
    TextView tv = (TextView) findViewById(R.id.tv);
    if (guide) {
        tv.setText(context.getString(R.string.xrandom_info_detail) + context.getString(R
                .string.xrandom_info_guide));
    } else {
        tv.setText(context.getString(R.string.xrandom_info_detail));
    }
    tv.setMaxWidth(UIUtil.getScreenWidth() - UIUtil.dip2pix(80));
    cbxAutoShowNegative = (CheckedTextView) findViewById(R.id.cbx_auto_show_negative);
    if (auto) {
        cbxAutoShowNegative.setVisibility(View.VISIBLE);
        cbxAutoShowNegative.setOnClickListener(this);
    } else {
        cbxAutoShowNegative.setVisibility(View.GONE);
    }
}
 
开发者ID:bither,项目名称:bither-android,代码行数:21,代码来源:DialogXRandomInfo.java

示例7: getView

import android.widget.CheckedTextView; //导入方法依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
	if(convertView == null)
	{
	convertView = LayoutInflater.from(mActivity).inflate(R.layout.contacter_list_item, null);
	}
	final CheckedTextView textView = (CheckedTextView) convertView.findViewById(R.id.ctv_text);
	ImageView imageView = (ImageView) convertView.findViewById(R.id.iv_image);
	ContacterItem item = mData.get(position);
	if (item.bitmap != null)
	{
		imageView.setImageBitmap(item.bitmap);
	}
	textView.setText(item.name + "[ " + item.phone + " ]");
	textView.setOnClickListener(new OnClickListener()
	{
		public void onClick(View v)
		{
			textView.setChecked(!textView.isChecked());
		}
	});
	return convertView;
}
 
开发者ID:haikuowuya,项目名称:like_googleplus_layout,代码行数:25,代码来源:ContacterAdapter.java

示例8: HeaderViewHolder

import android.widget.CheckedTextView; //导入方法依赖的package包/类
public HeaderViewHolder(final DragSortAdapter<?> dragSortAdapter, final View itemView) {
    super(dragSortAdapter, itemView);
    spinHelper = (Spinner) itemView.findViewById(R.id.spin_helper);
    tvSetupStatus = (TextView) itemView.findViewById(R.id.tv_setup_status);
    tvSetupProvider = (TextView) itemView.findViewById(R.id.tv_setup_provider);
    pbSetup = (ProgressBar) itemView.findViewById(R.id.pb_setup);
    btnForget = (Button) itemView.findViewById(R.id.btn_forget);
    btnInit = (Button) itemView.findViewById(R.id.btn_init);
    btnSetup = (Button) itemView.findViewById(R.id.btn_setup);
    ctvAutoRecover = (CheckedTextView) itemView.findViewById(R.id.ctv_auto_recover);

    final HelpersAdapter adapter = new HelpersAdapter();
    spinHelper.setAdapter(adapter);
    spinHelper.setSelection(adapter.getPosition(TrivialBilling.getHelper()));
    spinHelper.setOnItemSelectedListener(this);

    btnForget.setOnClickListener(this);
    btnInit.setOnClickListener(this);
    btnSetup.setOnClickListener(this);
    ctvAutoRecover.setChecked(TrivialBilling.isAutoRecover());
    ctvAutoRecover.setOnClickListener(this);

    iabHelper.addSetupListener(this);
}
 
开发者ID:onepf,项目名称:OPFIab,代码行数:25,代码来源:TrivialActivity.java

示例9: addArmorButton

import android.widget.CheckedTextView; //导入方法依赖的package包/类
protected TextView addArmorButton(Position pos) {
	CheckedTextView rsText = new CheckedTextView(getContext());

	rsText.setCheckMarkDrawable(0);
	rsText.setBackgroundResource(R.drawable.icon_armor_btn);
	rsText.setOnClickListener(onArmorClickListener);
	rsText.setOnLongClickListener(onArmorLongClickListener);
	rsText.setGravity(Gravity.CENTER);
	rsText.setTextColor(getResources().getColor(android.R.color.primary_text_light));

	addView(rsText, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, null, pos));

	armorButtons.put(pos, rsText);

	rsText.measure(rsWidthMeasureSpec, rsHeightMeasureSpec);

	rsText.setTextSize(TypedValue.COMPLEX_UNIT_PX, rsText.getMeasuredHeight() / 1.7f);

	return rsText;
}
 
开发者ID:gandulf,项目名称:DsaTab,代码行数:21,代码来源:BodyLayout.java

示例10: Holder

import android.widget.CheckedTextView; //导入方法依赖的package包/类
public Holder(View main) {
	text1 = (CheckedTextView) main.findViewById(android.R.id.text1);
	text2 = (CheckedTextView) main.findViewById(android.R.id.text2);

	text1.setOnClickListener(this);
	text2.setOnClickListener(this);
}
 
开发者ID:sunnygoyal,项目名称:PowerToggles,代码行数:8,代码来源:IconThemeEditor.java

示例11: CheckboxPref

import android.widget.CheckedTextView; //导入方法依赖的package包/类
public CheckboxPref(LayoutInflater inflator, String key, SharedPreferences prefs, int textId, boolean defaultValue) {
	mPrefs = prefs;
	view = (CheckedTextView) inflator.inflate(R.layout.ts_pref_checkbox, null);
	view.setChecked(prefs.getBoolean(key, defaultValue));
	view.setText(textId);
	view.setOnClickListener(this);
	
	mKey = key;
}
 
开发者ID:sunnygoyal,项目名称:PowerToggles,代码行数:10,代码来源:CheckboxPref.java

示例12: getNewListItem

import android.widget.CheckedTextView; //导入方法依赖的package包/类
private TextView getNewListItem(int value) {
	CheckedTextView tv = (CheckedTextView) mInflator.inflate(R.layout.ts_pref_checkbox, null);
	tv.setCheckMarkDrawable(new PathDrawable(PATH_CROSS, mContext, 15));
	tv.setBackgroundResource(R.drawable.bg_top_gray_divider);
	tv.setOnClickListener(this);

	int percent = value * 100 / 255;
	tv.setText(String.format("%d (%d%% of 255)", value, percent));
	tv.setTag(value);
	return tv;
}
 
开发者ID:sunnygoyal,项目名称:PowerToggles,代码行数:12,代码来源:BrightModeListPref.java

示例13: AbstractPopupPref

import android.widget.CheckedTextView; //导入方法依赖的package包/类
AbstractPopupPref(LayoutInflater inflator, SharedPreferences prefs, int textId, int itemLayout) {
	super(inflator.getContext(), itemLayout);
	mPrefs = prefs;
	view = (CheckedTextView) inflator.inflate(R.layout.ts_pref_checkbox, null);
	view.setCheckMarkDrawable(new PathDrawable(PATH_POPUP, getContext(), 18));
	view.setText(textId);
	view.setOnClickListener(this);

	mInflator = inflator;
}
 
开发者ID:sunnygoyal,项目名称:PowerToggles,代码行数:11,代码来源:AbstractPopupPref.java

示例14: a

import android.widget.CheckedTextView; //导入方法依赖的package包/类
public final View a(LayoutInflater paramLayoutInflater, ViewGroup paramViewGroup, Bundle paramBundle)
{
  View localView = paramLayoutInflater.inflate(efj.Ki, paramViewGroup, false);
  Bundle localBundle = this.m;
  if ((localBundle == null) || (localBundle.getString("bundled_text_key") == null)) {
    throw new IllegalStateException("This fragment must be called with a String argument.");
  }
  this.c = localBundle.getString("bundled_text_key");
  this.a = ((TextView)localView.findViewById(aau.zP));
  this.a.setMovementMethod(new ScrollingMovementMethod());
  CheckedTextView localCheckedTextView = (CheckedTextView)localView.findViewById(aau.zN);
  localCheckedTextView.setOnClickListener(new htf(this, localCheckedTextView));
  this.a.setText(a(localCheckedTextView.isChecked()));
  return localView;
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:16,代码来源:hte.java

示例15: inflateContent

import android.widget.CheckedTextView; //导入方法依赖的package包/类
public void inflateContent() {
    LayoutInflater inflater = LayoutInflater.from(mContext);
    View content = inflater.inflate(R.layout.find_in_page_content, this);

    content.findViewById(R.id.find_prev).setOnClickListener(this);
    content.findViewById(R.id.find_next).setOnClickListener(this);
    content.findViewById(R.id.find_close).setOnClickListener(this);

    // Capture clicks on the rest of the view to prevent them from
    // leaking into other views positioned below.
    content.setOnClickListener(this);

    mFindText = (CustomEditText) content.findViewById(R.id.find_text);
    mFindText.addTextChangedListener(this);
    mFindText.setOnKeyPreImeListener(new CustomEditText.OnKeyPreImeListener() {
        @Override
        public boolean onKeyPreIme(View v, int keyCode, KeyEvent event) {
            if (keyCode == KeyEvent.KEYCODE_BACK) {
                hide();
                return true;
            }
            return false;
        }
    });

    mMatchCase = (CheckedTextView) content.findViewById(R.id.find_matchcase);
    if (MATCH_CASE_ENABLED) {
        mMatchCase.setOnClickListener(this);
    } else {
        mMatchCase.setVisibility(View.GONE);
    }

    mStatusText = (TextView) content.findViewById(R.id.find_status);

    mInflated = true;
    EventDispatcher.getInstance().registerGeckoThreadListener(this, "TextSelection:Data");
}
 
开发者ID:jrconlin,项目名称:mc_backup,代码行数:38,代码来源:FindInPageBar.java


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