デザイナーが実際に
Androidアプリのレイアウトを
       組んでみた

       秋葉ちひろ
楽しかった!
そも そも

 デザイナーが
なんでXMLを?
デザイナーとして
ハッカソンに参加



     第3回 SHARPハッカソン@東広島が7月23日(土)・24日(日)
動かなかった…
デザイナー主体の
ハッカソンを始めた


   Designers Hack
もう一歩
踏み出したい!
10月17日        12月14日
17:00∼22:00      15日

赤井さんに          自分で
 レクチャー        やってみた
していただく
今回コーディングしたアプリ
今回コーディングしたアプリ
     • 自分のアカウントを持ち、
      自分の猫の写真をひたすら
      アップできる親バカアプリ

     • 友達ならぬ友猫でつなが
      れる
ホーム
ホーム
• 自分の猫の写真一覧
ホーム
• 自分の猫の写真一覧
• アクションバーには検索と
 設定
ホーム
• 自分の猫の写真一覧
• アクションバーには検索と
 設定

• ショートカットボタンが3つ
友猫一覧
友猫一覧
• 友猫の写真一覧
友猫一覧
• 友猫の写真一覧
友猫一覧
• 友猫の写真一覧
• ★マークでお気に入りに追加
友猫の検索結果
• 友猫を探すときの検索結果
• 写真と、名前や種類、プロ
 フィールが出てくる
まず、最低限の
レイアウトで
 作ってみた
<LinearLayout
  android:orientation="horizontal"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:paddingTop="10dp"
  android:paddingBottom="5dp"
  android:background="#fcf9f0"
  >
</LinearLayout>
<LinearLayout
  android:orientation="horizontal"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:paddingTop="10dp"
  android:paddingBottom="5dp"
  android:background="#fcf9f0"
  >
</LinearLayout>
<LinearLayout
  android:orientation="horizontal"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:paddingTop="10dp"
  android:paddingBottom="5dp"
  android:background="#fcf9f0"
  >
</LinearLayout>
<LinearLayout
  android:orientation="horizontal"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:paddingTop="10dp"
  android:paddingBottom="5dp"
  android:background="#fcf9f0"
  >
</LinearLayout>
<LinearLayout
  android:orientation="horizontal"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:paddingTop="10dp"
  android:paddingBottom="5dp"
  android:background="#fcf9f0"
  >




</LinearLayout>
<LinearLayout
            android:orientation="horizontal"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:paddingTop="10dp"
            android:paddingBottom="5dp"
            android:background="#fcf9f0"
            >



<ImageView
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:src="@drawable/icon_search"
   android:padding="10dp"
 ></ImageView>


          </LinearLayout>
<LinearLayout
            android:orientation="horizontal"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:paddingTop="10dp"
            android:paddingBottom="5dp"
            android:background="#fcf9f0"
            >



<ImageView                                         icon_search.png
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:src="@drawable/icon_search"
   android:padding="10dp"
 ></ImageView>


          </LinearLayout>
<LinearLayout
  android:orientation="horizontal"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:paddingTop="10dp"
  android:paddingBottom="5dp"
  android:background="#fcf9f0"
  >
         <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/icon_search"
            android:padding="10dp"
          ></ImageView>




</LinearLayout>
<LinearLayout
            android:orientation="horizontal"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:paddingTop="10dp"
            android:paddingBottom="5dp"
            android:background="#fcf9f0"
            >
                   <ImageView
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:src="@drawable/icon_search"

<EditText             android:padding="10dp"
                    ></ImageView>


  android:id="@+id/editText1"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_weight="1">
  <requestFocus></requestFocus>
</EditText>
          </LinearLayout>
<LinearLayout
  android:orientation="horizontal"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:paddingTop="10dp"
  android:paddingBottom="5dp"
  android:background="#fcf9f0"
  >
         <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/icon_search"
            android:padding="10dp"
          ></ImageView>

          <EditText
            android:id="@+id/editText1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1">
            <requestFocus></requestFocus>
          </EditText>




</LinearLayout>
<LinearLayout
  android:orientation="horizontal"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:paddingTop="10dp"
  android:paddingBottom="5dp"
  android:background="#fcf9f0"
  >
         <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/icon_search"
            android:padding="10dp"
          ></ImageView>

          <EditText
            android:id="@+id/editText1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1">
            <requestFocus></requestFocus>
          </EditText>




</LinearLayout>
<LinearLayout
  android:orientation="horizontal"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:paddingTop="10dp"
  android:paddingBottom="5dp"
  android:background="#fcf9f0"
  >
         <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/icon_search"
            android:padding="10dp"
          ></ImageView>

          <EditText
            android:id="@+id/editText1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1">
            <requestFocus></requestFocus>
          </EditText>

          <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/icon_roope"
            android:padding="10dp"
          ></ImageView>


</LinearLayout>
<RelativeLayout
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  >
</RelativeLayout>
2




1           3


    4       5   6
RelativeLayoutは
わりとなんでもできそう
• ボックスにborderとい
 う概念がない!

• box-shadowはない
• paddingなどのショー
 トハンドはない

• text-shadowは再現で
 きそう
<TextView
   android:textColor="#FFF"
   android:background="#5e4a1a"
   android:shadowDx="-1"
   android:shadowDy="-1"
   android:shadowRadius="1"
   android:shadowColor="#6000"
/>
<TextView
   android:textColor="#FFF"
   android:background="#5e4a1a"
   android:shadowDx="-1"
   android:shadowDy="-1"
   android:shadowRadius="1"
   android:shadowColor="#6000"
/>
<TextView
   android:textColor="#FFF"
   android:background="#5e4a1a"
   android:shadowDx="-1"
   android:shadowDy="-1"
   android:shadowRadius="1"
   android:shadowColor="#6000"
/>
背景をつけたい!
 <bitmap>
res

      drawable

       bg_tile.xml


      drawable-hdpi

       img_bg_tile.png
bg_tile.xml

<bitmap
  android:src=
        "@drawable/img_bg_tile"
  android:antialias="true"
  android:dither="false"
  android:filter="false"
  android:gravity="fill"
  android:tileMode="repeat"
></bitmap>
bg_tile.xml

<bitmap
  android:src=
        "@drawable/img_bg_tile"
  android:antialias="true"
  android:dither="false"
  android:filter="false"
  android:gravity="fill"
  android:tileMode="repeat"
></bitmap>




         img_bg_tile.png
bg_tile.xml

<bitmap
  android:src=
        "@drawable/img_bg_tile"
  android:antialias="true"
  android:dither="false"
  android:filter="false"
  android:gravity="fill"
  android:tileMode="repeat"
></bitmap>




         img_bg_tile.png
main.xml

<LinearLayout
  android:background=
           "@drawable/bg_tile"
>


              bg_tile.xml
グラーデーション
   境界線
    角丸
  <shape>
res

      drawable

       bg_tile.xml


      drawable-hdpi

       img_bg_tile.png
res

      drawable

       bg_tile.xml

       bg_kind.xml


      drawable-hdpi

       img_bg_tile.png
bg_kind.xml

<shape
 android:shape="rectangle">
 <gradient
  android:startColor="#856f2e"
  android:endColor="#b0a278"
  android:angle="270"
 ></gradient>
 <stroke
  android:width="1dp"
  android:color="#856f2e" />
 <corners
  android:radius="10dp" />
</shape>
bg_kind.xml

<shape
 android:shape="rectangle">
 <gradient
  android:startColor="#856f2e"
  android:endColor="#b0a278"
  android:angle="270"
 ></gradient>
 <stroke
  android:width="1dp"
  android:color="#856f2e" />
 <corners
  android:radius="10dp" />
</shape>
bg_kind.xml

<shape
 android:shape="rectangle">
 <gradient
  android:startColor="#856f2e"
  android:endColor="#b0a278"
  android:angle="270"
 ></gradient>
 <stroke
  android:width="1dp"
  android:color="#856f2e" />
 <corners
  android:radius="10dp" />
</shape>
bg_kind.xml

<shape
 android:shape="rectangle">
 <gradient
  android:startColor="#856f2e"
  android:endColor="#b0a278"
  android:angle="270"
 ></gradient>
 <stroke
  android:width="1dp"
  android:color="#856f2e" />
 <corners
  android:radius="10dp" />
</shape>
main.xml

<LinearLayout
  android:background=
           "@drawable/bg_kind"
>


              bg_kind.xml
10月17日        12月14日
17:00∼22:00      15日

赤井さんに          自分で
 レクチャー        やってみた
していただく
とにかくまる1日
アプリとして実機で
見れるとさいこーに
  気分がいい
CSSコーディングの
  知識があれば
 ぜんぜんよゆう!
ぜひ!

デザイナーが実際にAndroidアプリのレイアウトを 組んでみた(秋葉ちひろ)