ale
ale

Reputation: 11830

Using pre-written themes for Android

This is driving my nuts and it's probably really simple.

I know how to change a theme in my app. I think I just need to change this line in AndroidManifest.xml:

android:theme="@style/AppTheme"

You just change AppTheme to whatever themes you have in values/styles.xml.

However, my styles.xml file is boring:

<style name="AppBaseTheme" parent="android:Theme.Light">

</style>
<style name="AppTheme" parent="AppBaseTheme">

</style>

I.e. I don't think there is a theme?

Where do I download themes? What do I need.. presumably a styles.xml and some assets (e.g. images). I'm mainly a back-end programmer and I just want something that looks a little more interesting than the default theme.

Thanks.

Upvotes: 0

Views: 88

Answers (1)

user2511882
user2511882

Reputation: 9152

You can't download pre-written themes for android that i know of. You can use some snippets from the internet and make a styles.xml for yourself. For example the code below is a custom theme:

<resources>
  <!-- Base application theme is the default theme. -->
  <style name="Theme" parent="android:Theme">
  </style>

  <!-- Variation on our application theme that has a translucent
 background. -->
  <style name="Theme.Translucent">
    <item name="android:windowBackground">@drawable/translucent_background</item>
    <item name="android:windowNoTitle">true</item>
    <item name="android:colorForeground">#fff</item>
  </style>

  <!-- Variation on our application theme that has a transparent
background; this example completely removes the background,
allowing the activity to decide how to composite. -->
  <style name="Theme.Transparent">
    <item name="android:windowBackground">@drawable/transparent_background</item>
    <item name="android:windowNoTitle">true</item>
    <item name="android:colorForeground">#fff</item>
  </style>
  <style name="TextAppearance.Theme.PlainText" parent="android:TextAppearance.Theme">
    <item name="android:textStyle">normal</item>
  </style>

</resources>

Put this thing in the styles.xml file in the values folder. Change the colorForeground etc to create your own theme. Add your own images in the drawable folder and reference them here and so on.

Upvotes: 1

Related Questions