I'm not wrong. But it seems you aren't wrong either!

I was consulting the source. It's definitely a CheckedTextView. I just
confirmed it with the Hierarchy Viewer; there's no discrepancy.

But I definitely see the radio button icon.

Here's what's going on:

The layout:
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/
android"
    android:id="@android:id/text1"
    android:layout_width="fill_parent"
    android:layout_height="?android:attr/listPreferredItemHeight"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:gravity="center_vertical"
    android:checkMark="?android:attr/listChoiceIndicatorSingle"
    android:paddingLeft="6dip"
    android:paddingRight="6dip"
/>

The applicable theme element:
<item name="listChoiceIndicatorSingle">@android:drawable/btn_radio</
item>

And the drawable (a selector, as expected):
<selector xmlns:android="http://schemas.android.com/apk/res/android";>
    <item android:state_checked="true"
android:state_window_focused="false"
          android:drawable="@drawable/btn_radio_on" />
    <item android:state_checked="false"
android:state_window_focused="false"
          android:drawable="@drawable/btn_radio_off" />

    <item android:state_checked="true" android:state_pressed="true"
          android:drawable="@drawable/btn_radio_on_pressed" />
    <item android:state_checked="false" android:state_pressed="true"
          android:drawable="@drawable/btn_radio_off_pressed" />

    <item android:state_checked="true" android:state_focused="true"
          android:drawable="@drawable/btn_radio_on_selected" />
    <item android:state_checked="false" android:state_focused="true"
          android:drawable="@drawable/btn_radio_off_selected" />

    <item android:state_checked="false" android:drawable="@drawable/
btn_radio_off" />
    <item android:state_checked="true" android:drawable="@drawable/
btn_radio_on" />
</selector>

I didn't have the API demo on my device or in my Eclipse at the time,
so I checked the source, especially since you cited the layout rather
than the visual effect.

So it can be a checkmark if you override the theme...

It's completely unclear to me why both CheckedTextView and RadioButton
exist. RadioButton seems to implement all the functionality of
CheckedTextView, plus a bit more protocol due to CompoundButton. Does
anyone have any idea why?

On Apr 8, 7:01 pm, DonFrench <dcfre...@gmail.com> wrote:
>
> You are also wrong about simple_list_item_single_choice, the row
> template I cited in my post.  If you don't believe me, run the
> ApiDemos example and choose View in the first list that appears, List
> in the one that follows, then 10. Single Choice List in the one that
> follows that.  As I am sure you know, those round do-hickeys on the
> right side of every item in the list are Google's version of radio
> buttons.  Notice that in the code for this activity, which follows,
> the row template ID is simple_list_item_single_choice, as I indicated.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using "remove me" as the subject.

Reply via email to