Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Applying L Design in EZTABLE APP

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →
Avatar for mike mike
August 27, 2014

Applying L Design in EZTABLE APP

Avatar for mike

mike

August 27, 2014

Other Decks in Technology

Transcript

  1. The behide story June 25 ~ 26 L design 釋出

    designer: try it designer: try it 經驗分享 踏出第一步 designer: 你應該看 L guideline
  2. How to? layout way <?xml version="1.0" encoding="utf-8"?> <DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

    android:layout_height="match_parent"> <FrameLayout android:id="@+id/content_frame" android:layout_width="match_parent" android:layout_height="match_parent" /> </DrawerLayout>
  3. How to? layout way <?xml version="1.0" encoding="utf-8"?> <DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

    android:layout_height="match_parent"> <FrameLayout android:id="@+id/content_frame" android:layout_width="match_parent" android:layout_height="match_parent" /> </DrawerLayout> <LinearLayout style="@style/HeaderBar" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <include layout="@layout/toolbar_actionbar" /> </LinearLayout>
  4. How to? layout way <?xml version="1.0" encoding="utf-8"?> <DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

    android:layout_height="match_parent"> <FrameLayout android:id="@+id/content_frame" android:layout_width="match_parent" android:layout_height="match_parent" /> </DrawerLayout> <LinearLayout style="@style/HeaderBar" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <include layout="@layout/toolbar_actionbar" /> </LinearLayout>
  5. How to? layout way: background // defined in style.xml <style

    name="HeaderBar"> <item name="android:elevation">2dp</item> <item name="android:background">?android:colorPrimary</item> </style>
  6. How to? layout way: toolbar // defined in toolbar_actionbar.xml <Toolbar

    xmlns:android="http://schemas.android.com/apk/res/android" android:theme="@style/ActionBarThemeOverlay" android:id="@+id/toolbar_actionbar" android:layout_width="match_parent" android:layout_height="?android:actionBarSize" />
  7. How to? Hide Old ActionBar <style name="EZTABLE_theme" parent="android:Theme.Material.Light.DarkActionBar"> <item name="android:colorPrimary">@color/primary</item>

    <item name="android:colorPrimaryDark">@color/primary_dark</item> <item name="android:colorAccent">@color/accent</item> … <item name="android:windowActionBar">false</item> </style>
  8. How to? in Code initialize toolbar // in onCreate() newActionBar

    = (Toolbar) findViewById(R.id.toolbar_actionbar); if (newActionBar != null) { setActionBar(newActionBar); }
  9. How to? in Code set click event for toolbar newActionBar.setNavigationIcon(R.drawable.ic_drawer);

    newActionBar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (mDrawerLayout.isDrawerOpen(Gravity.START)) { mDrawerLayout.closeDrawer(Gravity.START); } else { mDrawerLayout.openDrawer(Gravity.START); } } });
  10. Activity Animation Transition Step 1: <style name=”EZTABLE_theme.Page” parent=”EZTABLE_theme”> … <item

    name="android:windowContentTransitions">true</item> <item name="android:windowSharedElementEnterTransition"> @transition/move_image/> <item name="android:windowSharedElementExitTransition"> @transition/move_image</item> ... </style>
  11. Activity Animation Transition 設定viewName 注意! For ListView // ith item

    of ListView on Activity 1 android:viewName="photo?" // ?:請塞unique id, e.g: position // layout on Activiy 2 android:viewName="photo"