當前位置: 首頁>>代碼示例>>Java>>正文


Java CheckedTextView.setChecked方法代碼示例

本文整理匯總了Java中android.widget.CheckedTextView.setChecked方法的典型用法代碼示例。如果您正苦於以下問題:Java CheckedTextView.setChecked方法的具體用法?Java CheckedTextView.setChecked怎麽用?Java CheckedTextView.setChecked使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.widget.CheckedTextView的用法示例。


在下文中一共展示了CheckedTextView.setChecked方法的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;
    });
}
 
開發者ID:xieyangxuejun,項目名稱:SearchLayout,代碼行數:19,代碼來源:FlowSearchLayout.java

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

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

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

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

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

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

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

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

示例10: singleToggle

import android.widget.CheckedTextView; //導入方法依賴的package包/類
private void singleToggle(View view, String tag){
    if(view instanceof CheckedTextView) {

        CheckedTextView check = ((CheckedTextView)view);
        if(check.getText().equals(tag)){
            check.setChecked(false);
        }
    }

    //If a layout container, iterate over children and seed recursion.
    if (view instanceof ViewGroup) {

        for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {

            View innerView = ((ViewGroup) view).getChildAt(i);

            singleToggle(innerView, tag);
        }
    }
}
 
開發者ID:ch4vi,項目名稱:android-CheckTextList,代碼行數:21,代碼來源:CheckedTextListView.java

示例11: setDebugInfo

import android.widget.CheckedTextView; //導入方法依賴的package包/類
private void setDebugInfo()
{
    PodEmuLog.checkPermissions();
    String enableDebug = sharedPref.getString("enableDebug", "false");

    TextView enableDebugValue = (TextView) findViewById(R.id.enableDebugValue);
    CheckedTextView enableDebugHint = (CheckedTextView) findViewById(R.id.enableDebugHint);

    if( enableDebug.equals("true") )
    {
        enableDebugValue.setText("Debug Enabled");
        enableDebugHint.setChecked(true);
    }
    else
    {
        enableDebugValue.setText("Debug Disabled");
        enableDebugHint.setChecked(false);
    }

    enableDebugHint.setText(getResources().getString(R.string.enable_debug_hint) +
            " Logs will be saved to the following file: " + PodEmuLog.getLogFileName());
}
 
開發者ID:xtensa,項目名稱:PodEmu,代碼行數:23,代碼來源:SettingsActivity.java

示例12: setToggleForceSimpleMode

import android.widget.CheckedTextView; //導入方法依賴的package包/類
private void setToggleForceSimpleMode()
{
    int forceSimpleMode = sharedPref.getInt("ForceSimpleMode", 0);

    RelativeLayout layout = (RelativeLayout) findViewById(R.id.playlistCountLayout);

    CheckedTextView toggleForceSimpleModeView = (CheckedTextView) findViewById(R.id.forceSimpleModeHint);

    if( forceSimpleMode == 1 )
    {
        toggleForceSimpleModeView.setChecked(true);
        if ( enableListCountSelection ) layout.setVisibility(View.INVISIBLE);
    }
    else
    {
        toggleForceSimpleModeView.setChecked(false);
        if ( enableListCountSelection ) layout.setVisibility(View.VISIBLE);
    }
}
 
開發者ID:xtensa,項目名稱:PodEmu,代碼行數:20,代碼來源:SettingsActivity.java

示例13: getInstance

import android.widget.CheckedTextView; //導入方法依賴的package包/類
public ArrayAdapter<String> getInstance(final Context pContext) {
    return new ArrayAdapter<String>(pContext, android.R.layout.simple_spinner_item, names) {

        @Override
        public View getDropDownView(final int pPosition, final View pConvertView, final ViewGroup pParent) {
            final View view;
            if (pConvertView == null) {
                // TODO http://www.doubleencore.com/2013/05/layout-inflation-as-intended/
                view = View.inflate(getApplicationContext(), R.layout.sender_list_item, null);
            } else {
                view = pConvertView;
            }

            final ImageView iconView = (ImageView) view.findViewById(R.id.sender_icon);
            iconView.setImageDrawable(icons.get(pPosition));

            final CheckedTextView tv = (CheckedTextView) view.findViewById(android.R.id.text1);
            tv.setText(names.get(pPosition));
            tv.setChecked(pPosition == mSenderSpinner.getSelectedItemPosition());

            return view;
        }
    };
}
 
開發者ID:neilboyd,項目名稱:SendLog,代碼行數:25,代碼來源:CreateShortcutActivity.java

示例14: bindView

import android.widget.CheckedTextView; //導入方法依賴的package包/類
@Override
public void bindView(View view, Context context, Cursor cursor) {

    final Integer id = cursor.getInt(0);
    final ImageView visibility = (ImageView) view.findViewById(R.id.iv_visibility);
    visibility.setImageDrawable(cursor.getInt(2) != 0 ? mVisibilityOn : mVisibilityOff);
    visibility.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            boolean isVisible = visibility.getDrawable().equals(mVisibilityOn);
            updateRecord(id, !isVisible);
        }
    });

    CheckedTextView name = (CheckedTextView) view.findViewById(R.id.tv_name);
    name.setChecked(mSelectedIds.contains(id + ""));
    name.setText(cursor.getString(1));
}
 
開發者ID:nextgis,項目名稱:android_maplibui,代碼行數:19,代碼來源:TrackView.java

示例15: updateConfigSource

import android.widget.CheckedTextView; //導入方法依賴的package包/類
private void updateConfigSource() {

		int n = mSourceContainer.getChildCount();
		if(mSourceContainer.getChildAt(0).getId() == R.id.empty) {
			return;
		}

		List<String> list = PreferenceHelper.selectedCategoriesFromPref(this);
		mSelectedSet = new HashSet<String>();
		for (String s : list) {
			//Log.d(TAG, "add " + s);
			mSelectedSet.add(s);
		}

		for (int i=0;i<n;i++) {
			CheckedTextView tv = (CheckedTextView) mSourceContainer.getChildAt(i);
			tv.setChecked(mSelectedSet.contains((String)tv.getText()));
		}
	}
 
開發者ID:R3CONN3R,項目名稱:MuzeiWallpaper,代碼行數:20,代碼來源:SettingsActivity.java


注:本文中的android.widget.CheckedTextView.setChecked方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。