0

I'm using AppCompat ver 22 and I want to achieve the same look and feel for pre lollipop devices.

My styles.xml file looks like that:

<style name="YesNoAppTheme" parent="Theme.AppCompat.Light">
    <item name="colorPrimary">@color/ActionBarBackground</item>
    <item name="colorPrimaryDark">#0094b8</item>
</style>

and I'm setting this after onCreate:

getSupportActionBar().setElevation(DisplayUtilities.dpsToPixels(this, 4));

furthermore, I'm using a custom action bar like this:

getSupportActionBar().setDisplayShowCustomEnabled(true);
getSupportActionBar().setCustomView(R.layout.base_action_bar_menu_layout);

and the devices look like that (left 4.4, right 5):

Example

I want to get the size shadow size in 4.4 and the status bar colouring. Is that possible?

Thanks

Rotem
  • 2,306
  • 3
  • 26
  • 44
  • You could use this library for the tint on the status bar https://github.com/jgilfelt/SystemBarTint – Daniel Julio Aug 03 '15 at 14:04
  • OK, thanks. What about the shadow? – Rotem Aug 03 '15 at 14:08
  • As far as I know there isn't an easy way to set a shadow on pre-lollipop devices like setElevation. This answer goes through some of the options you have. http://stackoverflow.com/a/27615879/2350917 If I'm going to be honest with you, the way your action bar looks, looks absolutely fine, and a shadow was already added, even though you won't be able to control it's size. – Daniel Julio Aug 03 '15 at 14:17
  • Well, I guess it looks fine. Thanks I will drop it. – Rotem Aug 03 '15 at 14:26
  • BTW, I couldn't manage to get SystemBarTint working with the AppCompat theme – Rotem Aug 03 '15 at 14:46

0 Answers0