This project is focused on the sample using the API's new preview version of Android-L, use of transitions, shadows etc...

Overview

Android L preview example

Description

This project is focused on the sample using the API's new preview version of Android-L, use of transitions, shadows etc...,

Alt text

UI

This app is aimed to use the new Material Design released at the Google I/0 14, to use the Material theme on your app, you only have to set the parent of your app style to @android:style/Theme.Material or @android:style/Theme.Material.Light and @android:style/Theme.Material.DarkActionBar.

Customize the Color Palette of your app

In the theme.xml of the MainActivity:

    <!-- App colors -->
    <color name="lollipop_theme_default_primary">#3F51B5</color>
    <color name="lollipop_theme_default_primary_dark">#303F9F</color>
    <color name="lollipop_theme_default_accent">#C5CAE9</color>
    <color name="fab_color">#FF4081</color>


    <!-- Main theme colors -->
    <style name="MainLollipopTheme" parent="android:Theme.Material.Light">
        <item name="android:colorPrimary">@color/lollipop_theme_default_primary</item>
        <item name="android:colorPrimaryDark">@color/lollipop_theme_default_primary</item>
        <item name="android:statusBarColor">@color/lollipop_theme_default_primary_dark</item>
        <item name="android:colorAccent">@color/lollipop_theme_default_accent</item>
        <item name="android:colorControlHighlight">@color/lollipop_theme_default_accent</item>
        <item name="android:navigationBarColor">@color/lollipop_theme_default_primary</item>

        <!-- Main theme action bar-->
        <item name="android:actionBarStyle">@style/MainActionBar</item>
        <item name="android:actionBarTheme">@style/MainActionBarThemeOverlay</item>


        <!-- lag indicating whether this window requests that content changes be performed
             as scene changes with transitions -->
        <item name="android:windowContentTransitions">true</item>

        <!-- Flag indicating whether this Window's transition should overlap with
             the exiting transition of the calling Activity. -->
        <item name="android:windowAllowEnterTransitionOverlap">true</item>

        <!--Flag indicating whether this Window's transition should overlap with
             the exiting transition of the called Activity when the called Activity
             finishes. -->
        <item name="android:windowAllowExitTransitionOverlap">true</item>

        <!-- Flag indicating whether this window's Action Bar should overlay -->
        <item name="android:windowActionBarOverlay">false</item>

        <!-- Flag indicating whether this window's Action Bar content should overlay -->
        <item name="android:windowContentOverlay">@null</item>
    </style>

Customizing the material theme <- This easy picture on Android Developers explains where are the attributes that of the previous code.

The FAB Button

Android-L introduces a new way to manage view with elevation and shadows, "Outlines represent the outer shape of a graphics object and define the ripple area for touch feedback." Android Developers, the fab button is defined as a ImageButton in the xml:

...
    <!-- fab button -->
    <ImageButton
        android:id="@+id/fab"
        android:layout_alignParentRight="true"
        android:layout_alignParentBottom="true"
        android:layout_width="@dimen/fab_size"
        android:layout_height="@dimen/fab_size"
        android:layout_gravity="bottom|right"
        android:layout_marginRight="16dp"
        android:layout_marginBottom="16dp"
        android:background="@drawable/fab_ripple"
        android:elevation="@dimen/button_elevation"
        android:onClick="onFabClicked"
        android:src="@drawable/ic_action_add"/>
...
        // Configure the FAB button
        int size = getResources().getDimensionPixelSize(R.dimen.fab_size);
        Outline outline = new Outline();
        outline.setOval(0, 0, size, size);
        findViewById(R.id.fab).setOutline(outline);

Activity transitions

Now, with Android-L you can specify custom animations for enter and exit transitions, and for transition of shared elements between activities, to do that, first, you have to enable the window content transitions, in my case, at themes.xml you can set this values from java code as well.

    <style name="MainLollipopTheme" parent="android:Theme.Material.Light">
        ...
        <!-- lag indicating whether this window requests that content changes be performed
       as scene changes with transitions -->
        <item name="android:windowContentTransitions">true</item>

        <!-- Flag indicating whether this Window's transition should overlap with
             the exiting transition of the calling Activity. -->
        <item name="android:windowAllowEnterTransitionOverlap">true</item>

        <!--Flag indicating whether this Window's transition should overlap with
             the exiting transition of the called Activity when the called Activity
             finishes. -->
        <item name="android:windowAllowExitTransitionOverlap">true</item>

        <!-- Flag indicating whether this window's Action Bar should overlay -->
        <item name="android:windowActionBarOverlay">false</item>

        <!-- Flag indicating whether this window's Action Bar content should overlay -->
        <item name="android:windowContentOverlay">@null</item>
        ...
    </style>
    
        // Setup the transition to the detail activity
        ActivityOptions options =  ActivityOptions.makeSceneTransitionAnimation(MainActivity.this, view, "photo" + i);
        startActivity(detailIntent, options.toBundle());

Tools & References:

You might also like...
Sample Project for Android Support Library 23.2
Sample Project for Android Support Library 23.2

SnapShot: Contains features Vector Drawable Animated Vector Drawable AppCompat DayNight theme Bottom Sheets Using BottomSheetDialog in day-night mode.

Eutamin-C Sample Project
Eutamin-C Sample Project

here-is-my-card About Eutamin-C Sample Project This is an android application using Euphony library "here-is-my-card" makes it easy to share business

A simple app to showcase Androids Material Design and some of the cool new cool stuff in Android Lollipop. RecyclerView, CardView, ActionBarDrawerToggle, DrawerLayout, Animations, Android Compat Design, Toolbar
A simple app to showcase Androids Material Design and some of the cool new cool stuff in Android Lollipop. RecyclerView, CardView, ActionBarDrawerToggle, DrawerLayout, Animations, Android Compat Design, Toolbar

#Android-LollipopShowcase This is a simple showcase to show off Android's all new Material Design and some other cool new stuff which is (new) in Andr

A simple app to showcase Androids Material Design and some of the cool new cool stuff in Android Lollipop. RecyclerView, CardView, ActionBarDrawerToggle, DrawerLayout, Animations, Android Compat Design, Toolbar
A simple app to showcase Androids Material Design and some of the cool new cool stuff in Android Lollipop. RecyclerView, CardView, ActionBarDrawerToggle, DrawerLayout, Animations, Android Compat Design, Toolbar

#Android-LollipopShowcase This is a simple showcase to show off Android's all new Material Design and some other cool new stuff which is (new) in Andr

Check out the new style for App Design aims for the Online Plant Shop Service...πŸ˜‰πŸ˜€πŸ˜πŸ˜Ž
Check out the new style for App Design aims for the Online Plant Shop Service...πŸ˜‰πŸ˜€πŸ˜πŸ˜Ž

PlantShopUI-Android Check out the new style for App Design aims for Online Plant Shop Service... πŸ˜‰ πŸ˜€ 😁 😎 Screenshots Please click the image below

Kotlin Tutorials for new learners.

Kotlin Programming Tutorial for Beginners Learn Kotlin Programming, its basics and Fundamentals from scratch. Topics to be covered Overview Course int

A sample app showing how to build an app using the MVI architecture pattern.
A sample app showing how to build an app using the MVI architecture pattern.

MVI Example This application was streamed live on Twitch to demonstrate how to build an application using MVI. You can find the VOD here for now: http

A sample Grocery Store app built using the Room, MVVM, Live Data, Rx Java, Dependency Injection (Kotlin Injection) and support Dark Mode
A sample Grocery Store app built using the Room, MVVM, Live Data, Rx Java, Dependency Injection (Kotlin Injection) and support Dark Mode

Apps Intro A sample Grocery Store app built using the Room, MVVM, Live Data, Rx Java, Dependency Injection (Kotlin Injection) and support Dark Mode In

Minimal example of how to safely share a file produced by a task in one project, with a task in another project.

How to share files across Gradle subprojects: A minimal example This is the Gradle project: . β”œβ”€β”€ producer β”‚ └── build.gradle.kts β”œβ”€β”€ consumer β”‚ β””

Owner
Saul Molinero
Software engineer
Saul Molinero
πŸ“š Sample Android Components Architecture on a modular word focused on the scalability, testability and maintainability written in Kotlin, following best practices using Jetpack.

Android Components Architecture in a Modular Word Android Components Architecture in a Modular Word is a sample project that presents modern, 2020 app

Madalin Valceleanu 2.3k Dec 30, 2022
A sample project managing the dependencies using Gradle version catalog

playground-gradle-bom-dep-manage A sample project managing the dependencies using Gradle version catalog. Pros/Cons Comparison with dependency managem

Masatoshi Kubode 0 Nov 26, 2021
SquircleView is a library which provides you with Squircle views to use for buttons, views, etc.

SquircleView SquircleView is a library which provides you with Squircle views to use for buttons, views, etc. Screenshots Different kinds of buttons,

Juky 96 Dec 15, 2022
A demo application that uses TMDB APIs to fetch the movie details and cache it using the Room DB.

TMDB App Tmdb sample project is a demo application that is based on modern Android architectures. It will fetch the data from the network and cache it

Clint Paul 38 Nov 28, 2022
Android samples for Google Workspace APIs

Google Workspace Android Samples A collection of samples that demonstrate how to call Google Workspace APIs from Android. Products Drive Deprecation A

Google Workspace 617 Jan 8, 2023
Check out the new style for App Design aims for the Vegetable Order Service using jetpack compose...πŸ˜‰πŸ˜€πŸ˜πŸ˜Ž

VegetableOrderUI-Android Check out the new style for App Design aims for the Vegetable Order Service using jetpack compose... ?? ?? ?? ?? Screenshots

Shashank Singhal 330 Dec 19, 2022
A sample Android app that demonstrates how to use Firebase Authentication, Crashlytics, Cloud Firestore and Hilt with Jetpack Compose UI

showcase.mp4 Make it So This is a sample Android app that demonstrates how to use Firebase Authentication, Crashlytics, Cloud Firestore and Hilt with

null 107 Dec 31, 2022
[] Port of Jake Wharton's U2020 sample app with use of MVP and Dagger 2

U+2020-mvp [DEPRECATED] We recomend to try Moxy framework instead of our solution. Port of Jake Wharton's U2020 sample app with use of MVP pattern and

Live Typing 315 Nov 14, 2022
Quality-Tools-for-Android 7.5 0.0 L5 Java This is an Android sample app + tests that will be used to work on various project to increase the quality of the Android platform.

Quality Tools for Android This is an Android sample app + tests that will be used to work on various project to increase the quality of the Android pl

StΓ©phane Nicolas 1.3k Dec 27, 2022