Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You should be able to add the style, like this (taken from source code for Ringdroid):</p> <pre><code> &lt;style name="AudioFileInfoOverlayText"&gt; &lt;item name="android:paddingLeft"&gt;4px&lt;/item&gt; &lt;item name="android:paddingBottom"&gt;4px&lt;/item&gt; &lt;item name="android:textColor"&gt;#ffffffff&lt;/item&gt; &lt;item name="android:textSize"&gt;12sp&lt;/item&gt; &lt;item name="android:shadowColor"&gt;#000000&lt;/item&gt; &lt;item name="android:shadowDx"&gt;1&lt;/item&gt; &lt;item name="android:shadowDy"&gt;1&lt;/item&gt; &lt;item name="android:shadowRadius"&gt;1&lt;/item&gt; &lt;/style&gt; </code></pre> <p>And in your layout, use the style like this:</p> <pre><code> &lt;TextView android:id="@+id/info" android:layout_width="fill_parent" android:layout_height="wrap_content" style="@style/AudioFileInfoOverlayText" android:gravity="center" /&gt; </code></pre> <p>Edit: the source code can be viewed here: <a href="https://github.com/google/ringdroid" rel="noreferrer">https://github.com/google/ringdroid</a></p> <p>Edit2: To set this style programmatically, you'd do something like this (modified from <a href="https://stackoverflow.com/questions/4630440/how-to-change-a-textviews-style-at-runtime/4632208#4632208">this example</a> to match ringdroid's resources from above)</p> <pre><code>TextView infoTextView = (TextView) findViewById(R.id.info); infoTextView.setTextAppearance(getApplicationContext(), R.style.AudioFileInfoOverlayText); </code></pre> <p>The signature for <code>setTextAppearance</code> is</p> <blockquote> <p>public void setTextAppearance (Context context, int resid)</p> <p>Since: API Level 1<br> Sets the text color, size, style, hint color, and highlight color from the specified TextAppearance resource.</p> </blockquote>
 

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