Android CheckedTextView - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android CheckedTextView class.

This code example shows how to use the following methods:setChecked, setText
		checkbox = (CheckedTextView)findViewById(android.R.id.text1);
	} 
 
	public void setTask(Task task) {
		this.task = task;
		checkbox.setText(task.getName());
		checkbox.setChecked(task.isComplete());
	} 
 
	public Task getTask() { 
		return task;
	} 
 
} 
7
CodeRank
This code example shows how to use the following methods:isChecked, toggle, getPaintFlags, setPaintFlags
This code example shows how to use the following methods:setChecked, setText
		CheckedTextView text1 = (CheckedTextView) view.findViewById(android.R.id.text1);
		TextView text2 = (TextView) view.findViewById(android.R.id.text2);
		 
		String tag = texts.get(position).toString();
		 
		text1.setText(tag);
		text2.setText(subtexts.get(position));
		ColorScheme colorScheme = PreferenceHelper.getColorScheme(context);
 
		int backgroundColor = colorScheme.getSpinnerColor(context);
		text2.setBackgroundColor(backgroundColor);
		 
		if (position == 0) { // tag
			// color should match whatever's in the main log line listview 
			text2.setTextColor(tagColor);
			 
		} else { // process id 
			text2.setTextColor(colorScheme.getForegroundColor(context));
		} 
		 

6
CodeRank
This code example shows how to use the following methods:setChecked, setText
		checkbox = (CheckedTextView) findViewById(android.R.id.text1);		
	} 
 
	public void setTask(Task task) {
		this.task = task;
		checkbox.setText(task.getName());
		checkbox.setChecked(task.isComplete());
	} 
 
	public Task getTask() { 
		return task;
	} 
} 
6
CodeRank
This code example shows how to use the following methods:isChecked
        } 
    } 
 
    @Override 
    public boolean isChecked() { 
        return mCheckbox != null ? mCheckbox.isChecked() : false;
    } 
 
    @Override 
    public void setChecked(boolean checked) {
        if (mCheckbox != null) {
            mCheckbox.setChecked(checked);
        } 
    } 
 
    @Override 
    public void toggle() { 
        if (mCheckbox != null) {
            mCheckbox.toggle();
        } 
6
CodeRank
This code example shows how to use the following methods:setCompoundDrawablePadding, setCompoundDrawablesWithIntrinsicBounds, setPadding, setText
	protected View createEntry(LayoutInflater inflater, int resIcon, boolean multipleChoice, ServerInfo.ResourceInfo info) {
		CheckedTextView view = (CheckedTextView) inflater.inflate(multipleChoice ?
			android.R.layout.simple_list_item_multiple_choice :
			android.R.layout.simple_list_item_single_choice, null);
		 
		view.setPadding(10, 10, 10, 10);
		view.setCompoundDrawablesWithIntrinsicBounds(resIcon, 0, 0, 0);
		view.setCompoundDrawablePadding(10);
		 
		String description = info.getDescription();
		if (description == null)
			description = info.getPath();
		 
		// FIXME escape HTML 
		view.setText(Html.fromHtml("<b>" + info.getTitle() + "</b><br/>" + description));
		 
		return view;
	} 
 
	@Override 
6
CodeRank
This code example shows how to use the following methods:isChecked
        checkedTextView.setChecked(b);
    } 
 
    @Override 
    public boolean isChecked() { 
        return checkedTextView.isChecked();
    } 
 
    @Override 
    public void toggle() { 
        checkedTextView.toggle();
    } 
} 
6
CodeRank
This code example shows how to use the following methods:setChecked
This code example shows how to use the following methods:setLayoutParams, setGravity, setPadding, setText
        	lp = new AbsListView.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, 64);
        } 
        else{ 
        	lp = new AbsListView.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, 64);
        } 
        CheckedTextView textView = new CheckedTextView(context);
        textView.setLayoutParams(lp);
        // Center the text vertically 
        textView.setGravity(Gravity.CENTER_VERTICAL | Gravity.CENTER);
         
        // Set the text starting position 
        textView.setPadding(36, 0, 0, 0);
        textView.setText(text);
        return textView;
    } 
	 
	public View getGroupView(int groupPosition, boolean isExpanded,
			View convertView, ViewGroup parent) {
		CheckedTextView textView = getGenericView(getGroup(groupPosition).toString(),true);       
        return textView;
6
CodeRank
This code example shows how to use the following methods:isChecked, setChecked
            }); 
        } else if (answerType.equals(TestAnswer.TYPE_MULTIPLE_CHOICE)) { 
            tt.setOnClickListener(new OnClickListener() { 
                public void onClick(View v) {
                    CheckedTextView rb = (CheckedTextView) v;
                    rb.setChecked(!rb.isChecked());
                } 
            }); 
        } 
 
        if (evaluated) { 
            tt.setOnClickListener(null); 
            answerFeedback = (TextView) convertView.findViewById(android.R.id.text2); 
            answerFeedback.setText(Html.fromHtml(a.getFeedback())); 
 
            feedbackLevel = Test.FEEDBACK_VALUES.indexOf(feedback); 
            if ((feedbackLevel > Test.FEEDBACK_VALUES.indexOf(Test.FEEDBACK_MEDIUM)) && a.getCorrect()) { 
                tt.setTextColor(context.getResources().getColor(R.color.green)); 
            } else { 
                tt.setTextColor(Color.BLACK); 
5
CodeRank

Related Android CheckedTextView Questions & Answers:

See Code Examples for Android CheckedTextView Methods: