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

?

 ?

Keishin Yokomaku

February 18, 2015
Tweet

More Decks by Keishin Yokomaku

Other Decks in Technology

Transcript

  1. ?
    @KeithYokoma - Drivemode, Inc.
    potatotips #14

    View full-size slide

  2. KeithYokoma
    Keishin Yokomaku
    Drivemode, Inc.
    Android Engineer
    GitHub: https://github.com/KeithYokoma
    Qiita: http://qiita.com/KeithYokoma
    e-Book: http://amzn.to/1mZNydv

    View full-size slide

  3. xmlns:android=“http://schemas.android.com/apk/res/android"
    android:layout_width=“match_parent”
    android:layout_height=“wrap_content”
    android:minHeight=“?android:attr/listPreferredItemHeight”>


    View full-size slide

  4. xmlns:android=“http://schemas.android.com/apk/res/android"
    android:layout_width=“match_parent”
    android:layout_height=“wrap_content”
    android:minHeight=“?android:attr/listPreferredItemHeight”>


    View full-size slide

  5. xmlns:android=“http://schemas.android.com/apk/res/android"
    android:layout_width=“match_parent”
    android:layout_height=“wrap_content”
    android:minHeight=“?android:attr/listPreferredItemHeight”>


    View full-size slide

  6. Referencing style attributes
    Allows us to reference the value of the attribute in the
    currently-applied theme.
    Format:
    ?[:][/]

    View full-size slide

  7. xmlns:android=“http://schemas.android.com/apk/res/android"
    android:layout_width=“match_parent”
    android:layout_height=“wrap_content”
    android:minHeight=“?android:attr/listPreferredItemHeight”>



    <br/><item name=“android:listPreferredItemHeight”>64dp</item><br/>

    View full-size slide

  8. xmlns:android=“http://schemas.android.com/apk/res/android"
    android:layout_width=“match_parent”
    android:layout_height=“wrap_content”
    android:minHeight=“?android:attr/listPreferredItemHeight”>



    <br/><item name=“android:listPreferredItemHeight”>64dp</item><br/>

    View full-size slide

  9. xmlns:android=“http://schemas.android.com/apk/res/android"
    android:layout_width=“match_parent”
    android:layout_height=“wrap_content”
    android:minHeight=“64dp”>



    <br/><item name=“android:listPreferredItemHeight”>64dp</item><br/>

    View full-size slide

  10. Your own “?”

    View full-size slide

  11. xmlns:android=“http://schemas.android.com/apk/res/android"
    android:layout_width=“match_parent”
    android:layout_height=“wrap_content”
    android:minHeight=“?attr/my_custom_attribute”>


    View full-size slide

  12. xmlns:android=“http://schemas.android.com/apk/res/android"
    android:layout_width=“match_parent”
    android:layout_height=“wrap_content”
    android:minHeight=“?attr/my_custom_attribute”>



    <br/><item name=“my_custom_attribute”>64dp</item><br/>

    View full-size slide

  13. xmlns:android=“http://schemas.android.com/apk/res/android"
    android:layout_width=“match_parent”
    android:layout_height=“wrap_content”
    android:minHeight=“?attr/my_custom_attribute”>



    <br/><item name=“my_custom_attribute”>64dp</item><br/>

    View full-size slide

  14. xmlns:android=“http://schemas.android.com/apk/res/android"
    android:layout_width=“match_parent”
    android:layout_height=“wrap_content”
    android:minHeight=“64dp”>



    <br/><item name=“my_custom_attribute”>64dp</item><br/>

    View full-size slide

  15. Abstract Theme
    Using style attributes reference.
    ✓ Reduce costs to change styles
    ✓ Reusable styling

    View full-size slide

  16. themes_holo.xml

    <br/><—— … ——><br/><item name="colorPrimary">@color/holo_primary</item><br/><item name=“colorEdgeEffect”>?attr/colorPrimary</item><br/><—— … ——><br/>

    View full-size slide

  17. themes_holo.xml

    <br/><—— … ——><br/><item name="colorPrimary">@color/holo_light_primary</item><br/><—— … ——><br/>

    View full-size slide

  18. themes_holo.xml

    <br/><—— … ——><br/><item name="colorPrimary">@color/holo_light_primary</item><br/><—— … ——><br/>
    <br/>

    View full-size slide

  19. –Ryan Brush
    “Code is design”

    View full-size slide

  20. ?
    @KeithYokoma - Drivemode, Inc.
    potatotips #14

    View full-size slide