dronjo_night_yanzm

slide for dronjo night created by yanzm »
Yuki Anzai

何をすればいいの・・・?
menu ボタンを押さないとわからない
sdk のサンプル Note pad アプリをカスタマイズしてみた。
android-sdk/platforms/android-1.5/samples/NotePad
menu・・・かな?
ちょっと不親切・・・
item が無いときに文字を出してみる
<?xml version="1.0" encoding="utf-8" ?>
<LinearLayout 
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent">
  <ListView 
    android:id="@+id/android:list"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    />
  <TextView
    android:id="@+id/android:empty"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="登録されたメモがありません。menu ボタンを押してメモを追加してください。"
    />
</LinearLayout>
でも、ちょっと無愛想だし、カッコ悪い・・・
<?xml version="1.0" encoding="utf-8" ?>
<LinearLayout   
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent">
  <ListView 
    android:id="@+id/android:list"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
  />
  <ImageView
    android:id="@+id/android:empty"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:src="@drawable/pressmenu"
  />
</LinearLayout>
画像にしちゃう!
説明がなくても使える
じゃあどうすればいいの?
よく使う機能なら最初から出ていたほうがいい
menu (っぽいの) を作って最初から表示
ImageView
ListView
RelativeLayout
translate animation
ボタンの配置って実は大事
add note の隣に delete は危険!
よく使うボタンは右端
間違えて押すと困るボタンは左端
押したときの画像にもこだわりたい
<?xml version="1.0" encoding="utf-8" ?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true" android:drawable="@drawable/edittitle_on" />
    <item android:state_pressed="false" android:drawable="@drawable/edittitle_off" />
</selector>


edittitle_on
edittitle_off
@drawable/edittitle_stateful.xml
<ImageButton
  android:id="@+id/edittitlebtn"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"    
  android:layout_alignParentBottom="true"
  android:layout_toLeftOf="@id/addnotebtn"
  android:background="@drawable/edittitle_stateful"
/>

1. からっぽのListはやめようよ!
2. menu をカスタマイズしちゃえ
3. ボタン→画像でモテアプリ
5. Custom Dialog で一段上へ
menu ボタンを押したときに
デフォルトのDialog はこんな感じ
背景とかと合わない・・・
<activity android:name="TitleEditor"   
  android:label="@string/title_edit_title"
  android:theme="@style/Theme.CustomDialog"
  android:windowSoftInputMode="stateVisible">

@values/styles.xml
    <style name="Theme.CustomDialog" parent="android:style/Theme.Dialog">
        <item name="android:windowBackground">@drawable/dialogbox</item>
        <item name="android:textColor">#ff000000</item>
    </style>
dialogbox.png
AndroidManifest.xml
自己紹介
あんざい ゆき
@yanzm
大学院生(あと1ヶ月半だけ)
マーケットにアプリだしてます。
最近、自分の HT03-A の中身を公開しました。。。
半年前くらいから Android はじめました。
女子部発起人(嘘)
    MLにやりませんかメール書いただけの人
ちょっと宣伝させてね。その1
対応図書館リスト
Libraroid - 図書館検索&予約
http://d.hatena.ne.jp/libraroid/
対応図書館を増やすのに協力して
いただける方を大大大募集中です。
おらの町の図書館も対応してほしいなぁ。という方
@yanzm に D してください。お願いします!
libraroid@gmail.com にメールでもOKです!
ちょっと宣伝させてね。その2
andronavi さん の
 「これが俺のアンドロイドだ!:001 ・・・」
http://andronavi.com/2010/02/7605
4. 神は細部に宿る。実はラインが・・・
ここをカスタマイズ
されてると、
おぉ!ってなるよ
<ListView
  android:id="@+id/android:list"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:divider="@drawable/title_line"
/>

title_line.png
背景は透過にしてね
xml だけで結構いろいろ見た目をカスタマイズできるので、
ぜひ、女子がおぉ!きゃー!すてき!となるアプリをお願いします。
おしまい。
ありがとうございました。
CheckedTextView 
(をちょっとごにょごにょした View)
CheckedTextView って?
widget です。ApiDemo では
Views -> Lists -> 10. Single choice list 
ここのボタンの画像を変える
<dronjo.products.notepad.CustomCheckedTextView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/textview1"
    android:layout_width="fill_parent"
    android:layout_height="?android:attr/listPreferredItemHeight"
    android:gravity="center_vertical"
    android:paddingLeft="15dip"
    android:paddingRight="35dip"
    android:singleLine="true"
    android:textSize="20sp"
    android:checkMark="@drawable/checkbox_stateful"
/>

@drawable/checkbox_stateful.xml
<?xml version="1.0" encoding="utf-8" ?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
  <item
    android:state_checked="true"
    android:state_pressed="true"
    android:drawable="@drawable/checkbox_on" />
  <item
    android:state_checked="true"
    android:drawable="@drawable/checkbox_on" />
  <item
    android:state_checked="false"
    android:state_pressed="true"
    android:drawable="@drawable/checkbox_off" />
  <item
    android:state_checked="false"
    android:drawable="@drawable/checkbox_off" />
</selector>
checkbox_off.png
checkbox_on.png
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout  xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/parentlayout"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/bg"
>
  <ListView
    android:id="@+id/android:list"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:divider="@drawable/title_line"
  />
  <ImageView
    android:id="@+id/menuimage"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:background="@drawable/button_bg2"
  />
  <ImageView
    android:id="@+id/menuimageall"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:background="@drawable/button_bg4"
    android:visibility="gone"
  />
  <ImageButton
    android:id="@+id/deletebtn"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    android:background="@drawable/delete_stateful"
  />
・・・
</RelativeLayout>

button_bg2.png
button_bg4.png
今日のスライド http://prezi.com/wk5hprc059gd

Loading comments...

Please log in to add your comment.

Report abuse

More presentations by Yuki Anzai

More prezis by author