Material Design with Support Design Library

65

Transcript of Material Design with Support Design Library

compile ‘com.android.support:design:23.2.1'

compile ‘com.android.support:appcompat-v7:23.2.1’

<resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="colorAccent">#FF4081</item> <item name="colorPrimary">#3F51B5</item> <item name="colorPrimaryDark">#303F9F</item> <item name="colorControlHighlight">#00CC55</item> <item name="colorControlNormal">#FF0000</item> </style> </resources>

<resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="colorAccent">#FF4081</item> <item name="colorPrimary">#3F51B5</item> <item name="colorPrimaryDark">#303F9F</item> <item name="colorControlHighlight">#00CC55</item> <item name="colorControlNormal">#FF0000</item> </style> </resources>

<manifest> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name="com.androidhuman.example.materialcolor.MainActivity" android:windowSoftInputMode="stateHidden" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>

<manifest> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name="com.androidhuman.example.materialcolor.MainActivity" android:windowSoftInputMode="stateHidden" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>

colorPrimaryDarkcolorPrimary

colorControlNormal

colorAccent

colorControlNormal

colorAccent

android:navigationBarColor

colorAccent

colorControlHighlight

colorControlHighlight

colorControlNormal

colorPrimary

<menu> <item android:id="@+id/nv_refill_coin" android:icon="@drawable/ic_refill_coin" android:title="@string/lzb_refill_coin" /> <group android:id="@+id/nv_group_extras"> <item android:id="@+id/nv_notice" android:icon="@drawable/ic_notice" android:title="@string/notice" /> <item android:id="@+id/nv_customer_support" android:icon="@drawable/ic_help" android:title="@string/customer_support" /> </group> </menu>

<menu> <item android:id="@+id/nv_refill_coin" android:icon="@drawable/ic_refill_coin" android:title="@string/lzb_refill_coin" /> <group android:id="@+id/nv_group_extras"> <item android:id="@+id/nv_notice" android:icon="@drawable/ic_notice" android:title="@string/notice" /> <item android:id="@+id/nv_customer_support" android:icon="@drawable/ic_help" android:title="@string/customer_support" /> </group> </menu>

<android.support.v4.widget.DrawerLayout android:fitsSystemWindows="true"> <android.support.design.widget.CoordinatorLayout> <android.support.design.widget.AppBarLayout/> <FrameLayout/> </android.support.design.widget.CoordinatorLayout> <com.lezhin.ui.widget.LezhinNavigationView android:id="@+id/nv_activity_main" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="start" android:fitsSystemWindows="true" app:menu="@menu/nv_default" /></android.support.v4.widget.DrawerLayout>

<android.support.v4.widget.DrawerLayout android:fitsSystemWindows="true"> <android.support.design.widget.CoordinatorLayout> <android.support.design.widget.AppBarLayout/> <FrameLayout/> </android.support.design.widget.CoordinatorLayout> <com.lezhin.ui.widget.LezhinNavigationView android:id="@+id/nv_activity_main" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="start" android:fitsSystemWindows="true" app:menu="@menu/nv_default" /></android.support.v4.widget.DrawerLayout>

<android.support.design.widget.TextInputLayout android:id="@+id/lza_til_activity_sign_up_email" android:layout_width="match_parent" android:layout_height="wrap_content" app:errorEnabled="true"> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/lza_email" android:inputType="textEmailAddress" android:singleLine="true" /></android.support.design.widget.TextInputLayout>

<android.support.design.widget.TextInputLayout android:id="@+id/lza_til_activity_sign_up_email" android:layout_width="match_parent" android:layout_height="wrap_content" app:errorEnabled="true"> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/lza_email" android:inputType="textEmailAddress" android:singleLine="true" /></android.support.design.widget.TextInputLayout>

<android.support.design.widget.CoordinatorLayout> <android.support.design.widget.AppBarLayout android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> <android.support.v7.widget.Toolbar android:id="@+id/lzc_toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="?attr/actionBarSize" app:layout_scrollFlags="scroll|enterAlways" app:popupTheme=“@style/ThemeOverlay.AppCompat.Light"/>

<android.support.design.widget.TabLayout android:id="@+id/tl_activity_base_content" android:layout_width="match_parent" android:layout_height=“wrap_content" />

</android.support.design.widget.AppBarLayout> <android.support.v7.widget.RecyclerView android:id="@+id/rv_activity_main" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior" /></android.support.design.widget.CoordinatorLayout>

<android.support.design.widget.CoordinatorLayout> <android.support.design.widget.AppBarLayout android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> <android.support.v7.widget.Toolbar android:id="@+id/lzc_toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="?attr/actionBarSize" app:layout_scrollFlags="scroll|enterAlways" app:popupTheme=“@style/ThemeOverlay.AppCompat.Light"/>

<android.support.design.widget.TabLayout android:id="@+id/tl_activity_base_content" android:layout_width="match_parent" android:layout_height=“wrap_content" />

</android.support.design.widget.AppBarLayout> <android.support.v7.widget.RecyclerView android:id="@+id/rv_activity_main" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior" /></android.support.design.widget.CoordinatorLayout>