Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

What’s new for Android Developers in 2015 - Material Design, Android Studio, Gradle

2.711 visualizaciones

Publicado el

This is the slide used by Kamal of Travancore Analytics for his session on "What’s new for Android Developers in 2015"

Material Design
Android Studio
Gradle

Publicado en: Tecnología
  • Inicia sesión para ver los comentarios

What’s new for Android Developers in 2015 - Material Design, Android Studio, Gradle

  1. 1. KAMAL K KISHORE 29-Apr-2015 & What’s new in
  2. 2. Material Design
  3. 3. Material Theme • @android:style/Theme.Material (dark version) • @android:style/Theme.Material.Light (light version) • @android:style/Theme.Material.Light.DarkActionBar
  4. 4. Customizing • colorPrimary • textColorPrimary • colorPrimaryDark • windowBackground • navigationBarColor
  5. 5. Customizing <?xml version="1.0" encoding="UTF-8"?> <resources> <!-- inherit from the material theme --> <style name="AppTheme" parent="android:Theme.Material“> <!-- Main theme colors --> <!-- your app branding color for the app bar --> <item name="android:colorPrimary">@color/primary</item> <!-- darker variant for the status bar and contextual app bars  <item name="android:colorPrimaryDark">@color/primary_dark</item> <!-- theme UI controls like checkboxes and text fields  <item name="android:colorAccent">@color/accent</item> </style> </resources>
  6. 6. • A different theme • New widgets for complex views • New API’s for Custom shadows and animations Elements of Material Design
  7. 7. Lists <!-- A RecyclerView with some commonly used attributes --> <android.support.v7.widget.RecyclerVie w android:id="@+id/my_recycler_view“ android:scrollbars="vertical“ android:layout_width="match_parent" android:layout_height="match_parent"/ > public class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewH older> dependencies { compile 'com.android.support:recyclerview- v7:21.0.+‘ }
  8. 8. Cards <android.support.v7.widget.CardView xmlns:card_view="http://schemas.andr oid.com/apk/res-auto" android:id="@+id/card_view" android:layout_gravity="center" android:layout_width="200dp" android:layout_height="200dp" card_view:cardCornerRadius="4dp"> card_view:cardCornerRadius card_view:cardBackgroundColor dependencies { compile 'com.android.support:cardview- v7:21.0.+' }
  9. 9. View Shadows • The Z property – android:elevation attribute
  10. 10. Clip Views • Transforming shape of a view – android:clipToOutline
  11. 11. Animations
  12. 12. Vector Drawables • Drawable tinting – android:tint – android:tintMode • Prominent color extraction – Palette.getVibrantColor • Vector drawables – <vector > – <path android:fillColor="#8fff" – android:pathData=…. – </vector >
  13. 13. Defining Custom Animations • Touch feedback • Circular Reveal • Activity transitions • Curved motion • View state changes
  14. 14. Reveal Effect • create the animator for this view (the start radius is zero) • Animator anim = ViewAnimationUtils.createCircularRev eal(myView, cx, cy, 0, finalRadius); • make the view visible and start the animation • myView.setVisibility(View.VISIBLE); • anim.start();
  15. 15. Compatibility • Using styles – Define a theme that inherits from an older theme (like Holo) in res/values/styles.xml. – Define a theme with the same name that inherits from the material theme in res/values-v21/styles.xml. – Set this theme as your app's theme in the manifest file.
  16. 16. Compatibility • Using layouts – res/layout-v21/ – res/layout/ • Using Support Library v7-21 – Some system widgets when you apply one of the Theme.AppCompat themes. – Color palette theme attributes in the Theme.AppCompat themes. – The RecyclerView widget to display data collections. – The CardView widget to create cards. – The Palette class to extract prominent colors from images.
  17. 17. google.com/design
  18. 18. What is Gradle? • Gradle is an advanced build toolkit that manages dependencies and allows you to define custom build logic. • This means that you can build your Android apps from which Android Studio and from the command line on your machine or on machines where Android Studio is not installed. • The build files are called build.gradle, and they are plain text files that use Groovy syntax
  19. 19. Why Gradle? • The Gradle build system is designed to support complex scenarios in creating Android applications. – Multi-distribution: the same application must be customized for several clients or companies – Multi-apk: supporting the creation of multiple apk for different device types while reusing parts of the the code
  20. 20. Using Gradle to build different variants • applying plugin – apply plugin: 'com.android.application‘ • setting defaultConfig – applicationId, minSdkVersion, targetSdkVersion, versionCode, versionName • setting buildTypes – proguardFiles, minifyEnabled
  21. 21. Using Gradle to build different variants • adding productFlavors – sets applicationId & versionName for different flavors (like paid, free etc.) • adding dependencies – Module dependency - compile project(":lib") – Remote binary dependency - compile 'com.android.support:appcompat-v7:19.0.1' – Local binary dependency - compile fileTree(dir: 'libs', include: ['*.jar'])
  22. 22. gradle.org
  23. 23. Thank you

×