Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android material design in Eclipse

Is there any way to create an app with Material design in Eclipse? Hamburger to arrow animation, full screen height navigation drawer...

like image 876
Arnes Avatar asked Mar 24 '15 19:03

Arnes


1 Answers

Yes you can create an app with material design using eclipse. Please follow each steps below carefully without any error.

Steps:

  1. Create a new Android Project with Target SDK version 21. If your project already exists then just change the Target SDK version.
  2. Add Appcompat v7 lib to your workspace and add this lib to build path of your project. You can find this lib at sdk\extras\android\support\v7.
  3. Set Project build target to version 21.
  4. There should be only 2 values folder in res folder.
    1. values
    2. values-v21

values/styles.xml should be as below.

<style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
         ....
         // Your style here

</style>

values-v21/style.xml should be as below.

<style name="AppBaseTheme" parent="@android:style/Theme.Material.Light.DarkActionBar">

            ....
            // Your style here
</style>

You can find different style attributes here https://developer.android.com/training/material/theme.html

After following above steps, your app will be ready with material design theme.

Now your second question regarding navigation drawer you can use following link for simple and step by step implementation.

Part 1 http://www.android4devs.com/2014/12/how-to-make-material-design-navigation-drawer.html4

Part 2 http://www.android4devs.com/2015/01/recycler-view-handling-onitemtouch-for.html

This implementation uses recycler view. For that you need to add recycler view lib (location - sdk\extras\android\support\v7) to your project and add it to build path.

like image 55
Pooja Avatar answered Sep 17 '22 21:09

Pooja