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 elements & layouting (sidebar aka nav bar, ink, etc) ? When stripping it down I often encounter crashes when trying to move away from the AppCompat stuff. Changing activity types from the AppCompat one to the Normal one, I end up with problems regarding dependencies on layout types like the coordinator layout that aren't there.
I'm still new to android and this is very confusing, as my theme is currently in limbo somewhere between the appcompat theme & material design when I tried to change it from one of the template.
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.
When trying to dump AppCompat, what changes to I need to do to make that happen ? Manifest, Activities, Menus, Layout, Styles ? It seems to touch all these things. If going exclusive without Appcompat, do you still need the v21 folders or will it grab the default ones ?
If you are using classes out of the Design Support library, such as
NavigationView
, you generally need to useappcompat-v7
andAppCompatActivity
. As of early May 2016, Google has not shipped a Design Support library analogue that works withTheme.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 theappcompat-v7
dependencies.The only place that Android Studio really cares about
appcompat-v7
is in the new-activity wizards, which you do not have to use.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 theirandroid:
equivalentsChange your theme to not use
Theme.AppCompat
-v21
resource directories are not tied toappcompat-v7
. They will still be used, on API Level 21+ devices.