Learn about the most popular Android library used for designing consistent UI across all the Android Platforms from API 7+
Learn about few of the amazing features of AppCompat Library and new things about AppCompat v23.2.0 like Vector Assets
2. About me
~3 years of Android
Development Experience
Pursing Bachelor Degree in
Computer Engineering
Akshay Chordiya
+AkshayChordiya
3. Portfolio
Automaton Locker - 100K downloads
Active Notify - 64K downloads
Jair Player - 100K downloads
Few other apps too
4. What’s
AppCompat?
It’s now becoming the crux of
every Android app
It’s a support library from Android
Developers Team
It provides consistent UI across
all the Android versions*
Used to support backward
compatibility
It provides really great features
It’s the most used and popular
library in all Android apps
*Upto API 7
5. Pre-requisites for AppCompat
1. Need Android Studio 2.0
2. Download Support Library Repository from SDK manager
3. Switch to new AppCompat library (v23.2.0)
8. Major Delights of AppCompat
1. Make beautiful apps
2. Support Widgets. (Toolbar, a
lot more custom widgets)
3. Easier theming and tinting
4. Theming the complete app
5. Backward compatibility
9. Theming the app
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
15. Day Night Theme
This theme allows apps to easily support both a Light and
Dark theme, effectively switching from a Light theme to a
Dark theme based on whether it is ‘night’
It is handled automatic! That’s awesome!
16. #ProTip for DayNight
● It is critical that you test your app thoroughly when using the
DayNight themes as hardcoded colors can easily make for
unreadable text or icons.
● Use the standard TextAppearance.AppCompat styles for your text or
colors pulled from your theme such as android:textColorPrimary,
you’ll find these automatically update for you.
18. New additions
❖support-vector-drawable
➢ Replace multiple bitmap graphics with single vector graphic XML file
➢ Supports backward compatibility up to API 7
❖animated-vector-drawable
➢ Crisp animations using vectors with few vector graphic XML files
➢ Supports backward compatibility up to API 11
19. Pre-requisites for Vector Assets
1. Switch to new AppCompat library (v23.2.0)
2. Switch to new Android Studio 2.0
3. That’s it!
20. How it works
Step 1
Add in module build.gradle
android {
defaultConfig {
vectorDrawables.u
seSupportLibrary =
true
}
}
Step 2
Add vector icons
Setup all the vector icons
in your app
Step 3
Replace src with srcCompat
<ImageView
android:layout_width="wrap_
content"
android:layout_height="wrap
_content"
app:srcCompat="@drawable/ic
_avatar"/>
21. Further Links
All the logos used are trademarks of respective companies.
Android AppCompat v23.2.0
Android AppCompat v21
Android AppCompat v23.2.0 Video
AppCompat Day Night
Android Studio for Experts
Vector Asset Studio
Exploring AppCompat talk will have most of the codes shown and some examples shown
I have experienced developing Android apps using Eclipse IDE to Android Studio
We all got the basic idea about AppCompat library. I’ll not tell all about AppCompat because it’s a vast library, today I’ll be focusing on AppCompat v23.2.0 and it’s new features
Your HOLO ICS dialog will automatically change to Material Dialog without any significant code change
There are lots of features and functionality from AppCompat
AppCompat is extremely huge library with lots of stuff. V23.2.0 is the latest release version.
AppCompat features lots of theme which are backward compatible. With this latest release they have added a new theme called as Day Night which is combination of Theme.AppCompat and Theme.AppCompat.Light. It supports from API 14+.
switches the