checkedtextview

How to customize a set drawable position CheckedTextView?

此生再无相见时 提交于 2019-12-14 01:13:39
问题 public class CheckedTextView extends TextView implements Checkable { private boolean mChecked; private int mCheckMarkResource; private Drawable mCheckMarkDrawable; private int mBasePaddingRight; private int mCheckMarkWidth; private static final int[] CHECKED_STATE_SET = { R.attr.state_checked }; public CheckedTextView(Context context) { this(context, null); } public CheckedTextView(Context context, AttributeSet attrs) { this(context, attrs, 0); } public CheckedTextView(Context context,

i have an issue with checked textview

独自空忆成欢 提交于 2019-12-13 07:21:27
问题 i have used checked textview with base adapter to fill listview it's working fine but when i try to scroll CheckedTextView lost the selection.please find the code bellow and help me. public class AttendancePage extends AppCompatActivity { List<String> studentNames = new ArrayList<String>(); String[] sNames; DatabaseHelper databaseHelper; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_attendance_page);

Android: Un-select all CheckedTextView except present one

眉间皱痕 提交于 2019-12-12 02:34:25
问题 i'm selecting the ListView items by using the bellow code (This is based on CheckedTextView) lvReport.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) { rlAdapterReport = (RelativeLayout) view.findViewById(R.id.rl_lv_report_user); tvAdapterReportOption = (CheckedTextView) view.findViewById(R.id.tv_lv_report_user_title); if (tvAdapterReportOption.isChecked()) { //value = "un-Checked";

Android compatibility between ExpandableListView and CheckTextView/Checkbox

*爱你&永不变心* 提交于 2019-12-11 23:42:25
问题 I've created an activity, which has an expandable list view of category, and some of them as subcategory. They all need to be checkable. I used for subcategory, a checkedTextView. For category, I used a textView and a checkbox, because when we click on the category name, we need to expand it (it is an expandable list view after all !). For the selection, the listview is on "Multiple Choice Mode". The adapter as the list of checked items, and in the getchild/getgroup view(), I set the checkbox

AlertDialog - CheckedTextView doesn't work

一曲冷凌霜 提交于 2019-12-11 13:05:45
问题 I have a custum list displayed on an AlertDialog.I want that whan I click on an item, the CheckedTextView is set checked. I tried for hours, but not setChecked() seems doesn't work... Could anyone help me ? final List<Producteur> p = DAOProducteur.getInstance(null).recherche(producteur); AlertDialog.Builder builder = new AlertDialog.Builder(activity); builder.setTitle("Résultat(s) :"); builder.setSingleChoiceItems( new ArrayAdapter<Producteur>( activity, R.layout.activity_recherche

Customize the CheckedTextView for ListView

不打扰是莪最后的温柔 提交于 2019-12-10 23:37:44
问题 As far as I know, the ListView embeds CheckedTextView to form the list, but every CheckedTextView has only one TextView and a CheckBox. What I want to do is adding some TextViews to the CheckedTextView, like this: TextView | TextView | TextView | CheckBox| ---- CheckedTextView How to customize the CheckedTextView? Any help will be appreciated! 回答1: For that you need to create a custom LinearLayout that implements Checkable and the create your row.xml using that custom LinearLayout which will

CheckedTextView not checked

你。 提交于 2019-12-07 04:15:17
问题 I want a Multiselected (checked) listview . When I select an item then the green check mark must appear. For this I use CheckedTextViews . The ListView gets the data from the database. I'm using a SimpleCursorAdapter for that. When you click on the button then the selected entries(IDs) will be passed to the next activity. My problem is that the check marks of the CheckedTextView does not appear. But the IDs will be passed to the next activity. What am I doing wrong? How to fix it? selecttest

Listview with checkedtextview

夙愿已清 提交于 2019-12-06 11:26:14
问题 I have two questions: If I am using CheckedTextView in a ListView and my class only extends Activity (instead of ListActivity ), since I have another button at the bottom below my ListView , what event should I listen on, when a checkbox is selected in the CheckedTextView ? If I extend my class to use ListActivity , I can use onListItemClick event, right? How can I add a new button to this type of layout? Here is my code.. public void onCreate(Bundle savedInstanceState) { super.onCreate

CheckedTextView not checked

隐身守侯 提交于 2019-12-05 10:11:54
I want a Multiselected (checked) listview . When I select an item then the green check mark must appear. For this I use CheckedTextViews . The ListView gets the data from the database. I'm using a SimpleCursorAdapter for that. When you click on the button then the selected entries(IDs) will be passed to the next activity. My problem is that the check marks of the CheckedTextView does not appear. But the IDs will be passed to the next activity. What am I doing wrong? How to fix it? selecttest.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com

Custom a CheckedTextView in android

二次信任 提交于 2019-12-04 18:54:05
I'm using a code that is not mine in my work. This code uses CheckedTextView, do this: ... AlertDialog.Builder alert; v.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY); switch (soundPreference.getType()) { case BOOLEAN: CheckedTextView checkedTextView = (CheckedTextView) v; boolean checked = !checkedTextView.isChecked(); ((CheckedTextView) v).setChecked(checked); switch (soundPreference.getKey()) { case SOUND_ACTIVE: sound.setAlarmActive(checked); break; ... works perfectly, the problem is that I want I want to change the checkbox graphic. Right now it looks like (defualt, I think):