Shawn
Shawn

Reputation: 2735

Android - Material Theme

I'm trying to implement Material Theme with SDK 4.0.0. Here are some issues I have:

  1. 9 patch splash (background.9.png) isn't displayed correctly. Worked fine before (logo centered with all white background, no black spots).

enter image description here

  1. here is my custom theme:
<style name="MyMaterial" parent="@style/Theme.AppCompat.Light.DarkActionBar">
    <item name="colorPrimary">#4CAF50</item>
    <item name="colorPrimaryDark">#388E3C</item>
</style>

There are some windows opened dynamically that I want to have different colorPrimary/colorPrimaryDark than the defaults above. Is it possible?

  1. My app uses a tab group. There is a underline underneath an active tab. I want to change the underline's color to #ffffff without affecting other controls' active color. Unfortunately colorAccent affects all controls' color. What should I do?

  2. Can I remove the default tab divider and add shadow underneath so that the tabs look like the Google Play Store app's?

  3. My app uses push notification. I usually specify my appicon.png for the notification's icon. Now upgraded to SDK 4.0.0 with Material Theme, the appicon shown in the notification becomes all white. Can I show the regular appicon instead?

Upvotes: 3

Views: 536

Answers (1)

Fokke Zandbergen
Fokke Zandbergen

Reputation: 3866

  1. Since Android 5.0, you need to provide the until then optional padding box for nine-patch images. The newest version of the TiCons CLI generates this for you: http://npmjs.com/package/ticons. You need black pixels on the bottom and right side of the image, except for the bottom left + right and top right pixel.
  2. You can define multiple themes and then use the theme property in createWindow() to select one.
  3. Android's new Material Design Theme has limited options in what you can style. See https://developer.android.com/training/material/theme.html
  4. See previous
  5. Not sure about this one but did you check http://docs.appcelerator.com/platform/latest/#!/guide/Sending_and_Scheduling_Push_Notifications-section-43298780_SendingandSchedulingPushNotifications-icon?

Upvotes: 1

Related Questions