10

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

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
Arnes
  • 403
  • 1
  • 5
  • 20

2 Answers2

15

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.

Pooja
  • 2,417
  • 20
  • 39
  • Thanks a lot... but, I have an error: "invalid resource directory name: D:\Workspace\test2\res values-21" – Arnes Mar 25 '15 at 13:53
  • What error you are getting with values-v21? And sorry for my typing mistake. I have edited answer. @Arnes – Pooja Mar 25 '15 at 17:23
  • `No resource found that matches the given name Theme.AppCompat.Light.DarkActionBar` is saying in `styles.xml` in `values` folder. @Pooja – Arnes Mar 26 '15 at 09:54
  • You have not properly perform step 2 from my answer. @Arnes – Pooja Mar 26 '15 at 10:02
  • Check 2nd answer of this question to get step 2 perform well. http://stackoverflow.com/questions/21900853/no-resource-found-theme-appcompat-light-darkactionbar @Arnes – Pooja Mar 26 '15 at 10:16
  • Ok. I did that and all went well but now when I try to create navigation drawer many complications and problems pop up. :( – Arnes Mar 26 '15 at 11:29
  • If you find navigation drawer implementation complex then try to implement according to accepted answer of this question. http://stackoverflow.com/questions/26476837/android-5-0-material-design-style-navigation-drawer-for-kitkat @Arnes – Pooja Mar 26 '15 at 11:47
  • @Pooja: is it possible to use the following style – DKV Jun 23 '15 at 08:02
  • @VV yes you can change `AppCompat` theme according to your use case. – Pooja Jun 23 '15 at 09:00
  • @Pooja: but when i change the theme it showing error error: "Error retrieving parent for item: No resource found that matches the given name 'android:style/Theme.AppCompat.Light.NoActionBar'." http://stackoverflow.com/questions/30979051/style-showing-error-in-android – DKV Jun 23 '15 at 09:14
  • You have not follow step 2 from my answer properly. @VV – Pooja Jun 23 '15 at 09:20
  • @Pooja: i already did , I am able to get the theme which you use above. my problem is on the particular theme – DKV Jun 23 '15 at 09:37
  • Will it support lower version? – Madhu Jul 01 '15 at 10:28
0

You can develop apps with Material Design in Eclipse by using the libraries provided by google. You need to follow the below steps to do that.

  • Properties> Android> Add...>appcompat_v7
  • Add...> Android Design Support Library(You can import it from android-sdk\extras\android\support\)
  • Add...> RecycleViewLibrary & CardViewLibrary libraries for RecycleView and cardView, better material look and feel. (You can import it from android-sdk\extras\android\support\v7\)
  • Add/Edit values\styles.xml

    <style name="MyMaterialTheme.Base" parent="Base.Theme.AppCompat.Light.DarkActionBar">
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>
    
  • Change theme in AndroidManifest.xml file. android:theme="@style/MyMaterialTheme"

  • extend your Activity by AppCompatActivity.

Hope you can develop Material Designed apps in Eclipse throgh these steps.

Important: Support for the Android Developer Tools (ADT) in Eclipse is ending. You should migrate your app development projects to Android Studio as soon as possible.

Alex Chengalan
  • 8,211
  • 4
  • 42
  • 56