Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
285 views
in Technique[技术] by (71.8m points)

android - I want Material Design in Pre 5.0 device in eclipse

I am have made an app and now i am trying to implement material design in my app. Problem is that i have made this app in eclipse. I have downloaded Android Studio too but its not familiar and i am use too eclipse.

My question is how to add material design theme in device lower than 5.0. I have currently 4.3 on my Galaxy S3.

Can any one please guide me on how to achieve material design in eclipse version 20140702

Regards.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

First of all add appcompat_v7 support library in your project. Then use following application style:

AndroidManifest.xml

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/MyMaterialTheme" >
    ......
</application>

styles.xml

<style name="MyMaterialTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="android: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>
    <item name="windowNoTitle">true</item>
</style>

Here is my demo project for Material Design below 5.0 with Toolbar and Recycler view but its in Android Studio, you can use for reference: MaterialDesign_Part1

Hope it helps!!!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...