Android material design in Eclipse

后端 未结 2 2066
隐瞒了意图╮
隐瞒了意图╮ 2020-12-05 20:48

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

相关标签:
2条回答
  • 2020-12-05 21:05

    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.

    0 讨论(0)
  • 2020-12-05 21:18

    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.

    0 讨论(0)
提交回复
热议问题