atelier:mitsuba

i love UI/UX, Blend, XAML, Behavior, P5, oF, Web, Tangible Bits and Physical computing. なにかあればお気軽にご連絡ください。atelier@c-mitsuba.com

AndroidのUI部分を適当に触ってみた。

とりあえず適当にさわってみた。

UIはXMLベースだって聞いていたけど、まさかここまでやると思ってなかったw

Layout Editorいいね
でもドロップでオブジェクトを設置できるのに、ドラッグで移動できないのは勿体ないなぁ。

で、xmlをみてみる。

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="@string/hello"
    />

<Button 
    android:text="Button01" 
    android:id="@+id/Button01"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">
</Button>

<AnalogClock
    android:id="@+id/AnalogClock01" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content">
</AnalogClock>

<CheckBox 
    android:text="CheckBox01"
    android:id="@+id/CheckBox01" 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">
</CheckBox>

<ProgressBar
    android:id="@+id/ProgressBar01"
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content">
</ProgressBar>

</LinearLayout>

あれ、Text ViewにHello Worldの文字がない!?
@string/helloとな?
でvalue>string.xmlを見てみる。

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="hello">Hello World, Hello!</string>
    <string name="app_name">Hello android</string>
</resources>

あったーw
ほう、なるほど。
レイアウトのソースと値のソースは全く別ものなのかぁ。
これはこれで分かりやすいね
ファイル名はタグごとでxmlを区切るのもいいけど、画面遷移が多くなりそうなアプリケーションだったら、ページごとにxml切りたいなぁ。
そのへんどうなんだろう。
そもそも設計の仕方をあまり知らないから、そんなプロジェクト管理はだめだよーって話なのかもしれないけども。

とりあえず、うん、分かりやすいし面白そう。
あとはlayoutで画面つくって、valueで値定義してってことは.javaでイベント作るんかな?
んーxamlC#みたいで取っ付きやすい(ぁw