Note that there are some explanatory texts on larger screens.

plurals
  1. POMatching default color in custom preference
    text
    copied!<p>I have a custom preference that is basically a slider. The custom XML for the preference slider can be used to set text color, but I need to MATCH the text color to the default that the device uses. The Title color seems fine, just uses default (same as another CheckBoxPreference title, or so it looks). The Summary color is also using the default color (same as Title), but I want this to match the default color of the Summary text of a CheckBoxPreference, which is defined right above it in XML. </p> <p>Can I get the color of the Summary text from the CheckBoxPreference and just change the Summary text color of the custom preference to match the CheckBoxPreference Summary color, or is there a global (R.attr.xxxxxxxx whatever) that I can use that exists on all devices?</p> <p>For example, I have a checkbox preference that does not specify title or summary colors - thus, it uses the default color scheme (but this color scheme <em>looks</em> like the title matches, but the summary text in the custom preference (from xml) is the same as the title color, but not the default summary color as default preferences)).</p> <p>My custom slider (which has title and summary fields) needs to match the default OS colors for those two fields to the device default color scheme for those entries (title &amp; summary).</p> <ol> <li><p>How do I get the default device color that is set for a checkboxpreference when no color is specified?</p></li> <li><p>How do I assign that color to my <em>custom</em> preference, which has it's own xml file that defines the custom preference view.</p></li> </ol> <p>Hope this makes perfect sense, if not I'll elaborate a bit more.</p> <p>preference definition for the custom preference (which is further defined in it's xml):</p> <pre><code>&lt;com.xxx.sbp.SeekBarPref android:id="@+id/xmlpreference_seekbar" android:key="preference_seekbar" android:title="Seek Bar Pref" android:summary="Choose seconds" android:defaultValue="20" android:max="300" sbp:min="10" sbp:interval="10" sbp:intervaldivide="10" sbp:unitsLeft="" sbp:unitsRight="s" /&gt; </code></pre>
 

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