Note that there are some explanatory texts on larger screens.

plurals
  1. POCustom ListView in Fragment not adhering to parent theme
    primarykey
    data
    text
    <p>I'm currently having an issue with using custom ListView adapters with the Holo.Light theme. Within the activities and fragments, any TextViews are displayed in the theme's normal colours (<code>textColorPrimary</code>). However, any text within the custom ListAdapter uses <code>textColorPrimary</code> from the default Holo theme, effectively making the text unreadable.</p> <p>Here is an example from my app's main menu:</p> <hr> <p><strong>list_main_menu.xml</strong> - The row layout for the ListAdapter</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent" &gt; &lt;ImageView android:id="@+id/imgIcon" android:layout_height="48dip" android:layout_width="48dip" android:src="@drawable/ic_launcher" /&gt; &lt;TextView android:id="@+id/txtFirstLine" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_toRightOf="@id/imgIcon" android:text="Line 1" android:textSize="12pt" /&gt; &lt;TextView android:id="@+id/txtSecondLine" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_toRightOf="@id/imgIcon" android:layout_below="@id/txtFirstLine" android:text="Line 2" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p><em>Note:</em> I'm currently having to use <code>android:textColor="?android:attr/textColorPrimaryInverse"</code> to make the text readable.</p> <hr> <p><strong>fragment_main_menu.xml</strong> - The Main Menu fragment.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;TextView android:id="@+id/txtWelcome" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Username" android:textSize="18sp" /&gt; &lt;ListView android:id="@id/android:list" android:layout_width="fill_parent" android:layout_height="fill_parent" /&gt; &lt;/LinearLayout&gt; </code></pre> <hr> <p><strong>AndroidManifext.xml</strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="net.michaeldodd.treasurehunter" android:versionCode="1" android:versionName="0.0.1" &gt; &lt;uses-sdk android:minSdkVersion="11" /&gt; &lt;uses-permission android:name="android.permission.INTERNET"/&gt; &lt;application android:icon="@drawable/ic_launcher" android:label="@string/app_name" &gt; &lt;activity android:label="@string/app_name" android:name=".gui.Login" android:theme="@android:style/Theme.Holo.Light"&gt; &lt;intent-filter &gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name=".gui.Home" android:theme="@android:style/Theme.Holo.Light" /&gt; &lt;activity android:name=".gui.UserProfile" android:theme="@android:style/Theme.Holo.Light" /&gt; &lt;activity android:name=".gui.MapList" android:theme="@android:style/Theme.Holo.Light" /&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre> <hr> <p>I'm not currently using any custom styles. Thanks for reading, and any useful comments will be greatly appreciated.</p> <p><strong>EDIT 1:</strong> Here's the requested screenshots. <img src="https://i.stack.imgur.com/9Sl3W.png" alt="asdf"> This is how it looks if I don't specify the text colour, it seems to be using the default text colour for Holo Dark</p> <p><img src="https://i.stack.imgur.com/Zdxtx.png" alt="asdf"> Manually specifying <code>android:textColor="?android:attr/textColorPrimaryInverse"</code> gives this result, but I'm uneasy at using a workaround like this.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload