• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Listview Mixed Font Size

foxy69

Lurker
I'm trying to create a listview thats similar to the 'Wireless & network settings' menu.

I can create my equivalants of 'Airplane mode' and 'Wi-Fi' with checkboxes but I would like to know how to add the smaller text underneath each option i.e. 'Disable all wireless connections'.

I also want the text to centre just like it does when you turn airplane mode on.

Thanks
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<TableRow xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/detail_row"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:padding="6dip"
          >
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    >
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_centerVertical="true"
        >
        <TextView
            android:id="@+id/tv1"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="Line 1"
            android:textAppearance="?android:attr/textAppearanceLarge"
            />
        <TextView
            android:id="@+id/tv2"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="Line 2"
            android:textAppearance="?android:attr/textAppearanceLarge"
            />
        <TextView
            android:id="@+id/tv3"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="Line 3"
            android:textAppearance="?android:attr/textAppearanceLarge"
            />
    </LinearLayout>
    <CheckBox
        android:id="@+id/cb1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        /> 
</RelativeLayout>
</TableRow>
I've come up with the above which does what I need. However, from code I want to blank the text of tv2 or set it to invisible and for the screen to refresh removing the 'Line 2' but also move 'Line 3' to where 'Line 2' was i.e. re-center. Is this possible?
 

Attachments

  • screen.jpg
    screen.jpg
    8 KB · Views: 73
Back
Top Bottom