0

I have an app which runs on Android 2.3 and above.

Recently, I'm in the process of migrating it from SherlockActionBar, to AppCompat, by following guideline from What are the common issues when migrating from ActionBarSherlock to ActionBarCompat?

This is what I had done so far.

Upgrade SDK version

Change SDK from

<uses-sdk
    android:minSdkVersion="10"
    android:targetSdkVersion="21" />

to

<uses-sdk
    android:minSdkVersion="10"
    android:targetSdkVersion="22" />

Theme Upgrade

Change theme from

Theme.Sherlock.Light.DarkActionBar

to

Theme.AppCompat.Light.DarkActionBar

Code update

Following code change guideline from What are the common issues when migrating from ActionBarSherlock to ActionBarCompat?.

Note, I'm still stick to ActionBar instead of Toolbar. Eventually, I shall move the code to Toolbar. Since migration is a HUGE project. I rather done it bit by bit.

My expectation is that

  1. App which runs on Android 2.3 till Android 4, should have old school holo design. I expect the app will look the same, as the one built using SherlockActionBar.
  2. App which runs on Android 5+, will have new material design.

However, here's how the app before & after migration, for an 2.3 App.

Before Migration

enter image description here

enter image description here

After Migration

enter image description here

enter image description here

It seems that after migration, I can observe that

  1. Action bar height is higher.
  2. The dialog box OK to Cancel buttons, had changed from 3D to Material flat.

I was wondering, what should be the correct expectation on old App (App which runs on 2.3 till 4+), when we built against AppCompat, with latest SDK 22 as target? Should they look like Material app, or Holo app?

Community
  • 1
  • 1
Cheok Yan Cheng
  • 47,586
  • 132
  • 466
  • 875

1 Answers1

1

From the Support Library Features section for AppCompat:

This library adds support for the Action Bar user interface design pattern. This library includes support for material design user interface implementations.

So what you are seeing is the expected behavior- AppCompat is designed to bring the ActionBar and Material to all devices with API 7 and up.

Prior to the release of version 21 of AppCompat alongside Android Lollipop (API 21), AppCompat did indeed provide an ActionBar with Holo theming. However, it never styled other components, only ever the ActionBar itself.

Bryan Herbst
  • 66,602
  • 10
  • 133
  • 120
  • Does that mean, the correct direction is that, we need to manually theme up other components for app in old Android, so that it looks "material" instead of "holo"? – Cheok Yan Cheng May 11 '15 at 17:47
  • The good news is that AppCompat gives you a lot of that for free. Many common components are already themed in there for you, and AppCompat will often replace the framework components with their AppCompat counterparts for you during View XML inflation. How far you go with "materializing" your app is really up to you though. – Bryan Herbst May 11 '15 at 17:49