Skip to content Skip to sidebar Skip to footer

Dumping Appcompat For Api 21

So I'm creating an app that is Lollipop 5.0 API 21 and up with zero interest in supporting older devices. Do I still need the appcompat library when using Material Design like UI e

Solution 1:

Do I still need the appcompat library when using Material Design like UI elements & layouting (sidebar aka nav bar, ink, etc) ?

If you are using classes out of the Design Support library, such as NavigationView, you generally need to use appcompat-v7 and AppCompatActivity. As of early May 2016, Google has not shipped a Design Support library analogue that works with Theme.Material. You may be able to find third-party library replacements for some of those widgets, and seasoned Android developers can sometimes "cross-port" these components to eliminate the appcompat-v7 dependencies.

I've read that this is an android studio issue because it always uses appcompat regardless of your set dependencies & minimum API levels. Forcing you to manually override every implicit hidden appcompat call.

The only place that Android Studio really cares about appcompat-v7 is in the new-activity wizards, which you do not have to use.

When trying to dump AppCompat, what changes to I need to do to make that happen ? Manifest, Activities, Menus, Layout, Styles ?

That is difficult to answer in the abstract. You would need to:

  • Stop using Design Support library widgets and containers

  • Stop inheriting from AppCompatActivity

  • Change your app: attributes in your menu resources to their android: equivalents

  • Change your theme to not use Theme.AppCompat

If going exclusive without Appcompat, do you still need the v21 folders or will it grab the default ones ?

-v21 resource directories are not tied to appcompat-v7. They will still be used, on API Level 21+ devices.

Post a Comment for "Dumping Appcompat For Api 21"