ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • 특이한 UI 구성 소개
    안드로이드/학습&강좌 2011. 6. 11. 22:18

    이번에 소개할 UI는 안드로이드 사이드에서 소개된 적이 있는 Rotation_project라 보면 된다.

    Flipper 로 이벤트가 처리 되어 있어서 약간 부자연 스러운 느낌이 있는데, 갤러리 같은 형식으로 바꿔 보려 했으나 패스...

    나름대로 그냥 버튼을 이미지로 대체 했을뿐이다.

    대략적인 동작 화면을 보자면

    아래의 플래시 화면과 같이 작동 할 것이다.

    0123


    이런식의 UI구성의 xml이 상당히 특이 한데

    각 View마다의 화면을 미리 만들어 놓았던데... 대단하다 노가다의 진수이다. 머리가 지끈거리는게 느껴질 정도이다.

    xml을 설명 하자면

    xml만 해도 라인이 이정도이니...

    main.xml

    <?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"
     android:background="#b3b3b3">
     <ViewFlipper
      android:id = "@+id/V_FLIPPER"
      android:layout_width = "fill_parent"
      android:layout_height = "fill_parent"
      >
      <!-- 1번뷰 시작 -->
      <LinearLayout
       android:layout_width = "fill_parent"
       android:layout_height = "fill_parent"
       android:orientation = "vertical">
       <LinearLayout
        android:id = "@+id/V_L01_01"
        android:layout_width = "fill_parent"
        android:layout_height = "0dip"
        android:layout_weight = "1"
        android:orientation = "horizontal">
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "0.3"
         android:layout_height = "fill_parent"/>
        <Button
         android:id = "@+id/BTN_01_01"
         android:layout_width = "0dip"
         android:layout_weight = "1"
         android:layout_height = "fill_parent"
         android:background="@drawable/f1"
         />
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "2.5"
         android:layout_height = "fill_parent"/>
       </LinearLayout>
       <LinearLayout
        android:id = "@+id/V_L01_02"
        android:layout_width = "fill_parent"
        android:layout_height = "0dip"
        android:layout_weight = "1"
        android:orientation = "horizontal">
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "0.9"
         android:layout_height = "fill_parent"/>
        <Button
         android:id = "@+id/BTN_01_02"
         android:layout_width = "0dip"
         android:layout_weight = "1"
         android:layout_height = "fill_parent"
         android:background="@drawable/f2"/>
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "1.9"
         android:layout_height = "fill_parent"/>
       </LinearLayout>
       <LinearLayout
        android:id = "@+id/V_L01_03"
        android:layout_width = "fill_parent"
        android:layout_height = "0dip"
        android:layout_weight = "1"
        android:orientation = "horizontal">
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "1.2"
         android:layout_height = "fill_parent"/>
        <Button
         android:id = "@+id/BTN_01_03"
         android:layout_width = "0dip"
         android:layout_weight = "1"
         android:layout_height = "fill_parent"
         android:background="@drawable/f3"/>
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "1.6"
         android:layout_height = "fill_parent"/>
       </LinearLayout>
       <LinearLayout
        android:id = "@+id/V_L01_04"
        android:layout_width = "fill_parent"
        android:layout_height = "0dip"
        android:layout_weight = "1"
        android:orientation = "horizontal">
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "0.9"
         android:layout_height = "fill_parent"/>
        <Button
         android:id = "@+id/BTN_01_04"
         android:layout_width = "0dip"
         android:layout_weight = "1"
         android:layout_height = "fill_parent"
         android:background="@drawable/f4"/>
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "1.9"
         android:layout_height = "fill_parent"/>
       </LinearLayout>
        <LinearLayout
         android:id = "@+id/V_L01_05"
         android:layout_width = "fill_parent"
         android:layout_height = "0dip"
         android:layout_weight = "1"
         android:orientation = "horizontal">
         <LinearLayout
          android:layout_width = "0dip"
          android:layout_weight = "0.3"
          android:layout_height = "fill_parent"/>
         <Button
          android:id = "@+id/BTN_01_05"
          android:layout_width = "0dip"
          android:layout_weight = "1"
          android:layout_height = "fill_parent"
          android:background="@drawable/f5"/>
         <LinearLayout
          android:layout_width = "0dip"
          android:layout_weight = "2.5"
          android:layout_height = "fill_parent"/>
        </LinearLayout>
      </LinearLayout>
      <!-- 1번뷰 끝 -->
      <!-- 2번뷰 시작 -->
      <LinearLayout
       android:layout_width = "fill_parent"
       android:layout_height = "fill_parent"
       android:orientation = "vertical">
       <LinearLayout
        android:id = "@+id/V_L02_01"
        android:layout_width = "fill_parent"
        android:layout_height = "0dip"
        android:layout_weight = "1"
        android:orientation = "horizontal">
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "0.3"
         android:layout_height = "fill_parent"/>
        <Button
         android:id = "@+id/BTN_02_01"
         android:layout_width = "0dip"
         android:layout_weight = "1"
         android:layout_height = "fill_parent"
         android:background="@drawable/f6"/>
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "2.5"
         android:layout_height = "fill_parent"/>
       </LinearLayout>
       <LinearLayout
        android:id = "@+id/V_L02_02"
        android:layout_width = "fill_parent"
        android:layout_height = "0dip"
        android:layout_weight = "1"
        android:orientation = "horizontal">
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "0.9"
         android:layout_height = "fill_parent"/>
        <Button
         android:id = "@+id/BTN_02_02"
         android:layout_width = "0dip"
         android:layout_weight = "1"
         android:layout_height = "fill_parent"
         android:background="@drawable/f1"
         />
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "1.9"
         android:layout_height = "fill_parent"/>
       </LinearLayout>
       <LinearLayout
        android:id = "@+id/V_L02_03"
        android:layout_width = "fill_parent"
        android:layout_height = "0dip"
        android:layout_weight = "1"
        android:orientation = "horizontal">
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "1.2"
         android:layout_height = "fill_parent"/>
        <Button
         android:id = "@+id/BTN_02_03"
         android:layout_width = "0dip"
         android:layout_weight = "1"
         android:layout_height = "fill_parent"
         android:background="@drawable/f2"/>
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "1.6"
         android:layout_height = "fill_parent"/>
       </LinearLayout>
       <LinearLayout
        android:id = "@+id/V_L02_04"
        android:layout_width = "fill_parent"
        android:layout_height = "0dip"
        android:layout_weight = "1"
        android:orientation = "horizontal">
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "0.9"
         android:layout_height = "fill_parent"/>
        <Button
         android:id = "@+id/BTN_02_04"
         android:layout_width = "0dip"
         android:layout_weight = "1"
         android:layout_height = "fill_parent"
         android:background="@drawable/f3"/>
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "1.9"
         android:layout_height = "fill_parent"/>
       </LinearLayout>
       <LinearLayout
        android:id = "@+id/V_L02_05"
        android:layout_width = "fill_parent"
        android:layout_height = "0dip"
        android:layout_weight = "1"
        android:orientation = "horizontal">
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "0.3"
         android:layout_height = "fill_parent"/>
        <Button
         android:id = "@+id/BTN_02_05"
         android:layout_width = "0dip"
         android:layout_weight = "1"
         android:layout_height = "fill_parent"
         android:background="@drawable/f4"/>
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "2.5"
         android:layout_height = "fill_parent"/>
       </LinearLayout>
      </LinearLayout>
      <!-- 2번뷰 끝 -->
      <!-- 3번뷰 시작 -->
      <LinearLayout
       android:layout_width = "fill_parent"
       android:layout_height = "fill_parent"
       android:orientation = "vertical">
       <LinearLayout
        android:id = "@+id/V_L03_01"
        android:layout_width = "fill_parent"
        android:layout_height = "0dip"
        android:layout_weight = "1"
        android:orientation = "horizontal">
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "0.3"
         android:layout_height = "fill_parent"/>
        <Button
         android:id = "@+id/BTN_03_01"
         android:layout_width = "0dip"
         android:layout_weight = "1"
         android:layout_height = "fill_parent"
         android:background="@drawable/f5"/>
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "2.5"
         android:layout_height = "fill_parent"/>
       </LinearLayout>
       <LinearLayout
        android:id = "@+id/V_L03_02"
        android:layout_width = "fill_parent"
        android:layout_height = "0dip"
        android:layout_weight = "1"
        android:orientation = "horizontal">
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "0.9"
         android:layout_height = "fill_parent"/>
        <Button
         android:id = "@+id/BTN_03_02"
         android:layout_width = "0dip"
         android:layout_weight = "1"
         android:layout_height = "fill_parent"
         android:background="@drawable/f6"/>
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "1.9"
         android:layout_height = "fill_parent"/>
       </LinearLayout>
       <LinearLayout
        android:id = "@+id/V_L03_03"
        android:layout_width = "fill_parent"
        android:layout_height = "0dip"
        android:layout_weight = "1"
        android:orientation = "horizontal">
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "1.2"
         android:layout_height = "fill_parent"/>
        <Button
         android:id = "@+id/BTN_03_03"
         android:layout_width = "0dip"
         android:layout_weight = "1"
         android:layout_height = "fill_parent"
         android:background="@drawable/f1"
         />
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "1.6"
         android:layout_height = "fill_parent"/>
       </LinearLayout>
       <LinearLayout
        android:id = "@+id/V_L03_04"
        android:layout_width = "fill_parent"
        android:layout_height = "0dip"
        android:layout_weight = "1"
        android:orientation = "horizontal">
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "0.9"
         android:layout_height = "fill_parent"/>
        <Button
         android:id = "@+id/BTN_03_04"
         android:layout_width = "0dip"
         android:layout_weight = "1"
         android:layout_height = "fill_parent"
         android:background="@drawable/f2"/>
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "1.9"
         android:layout_height = "fill_parent"/>
       </LinearLayout>
       <LinearLayout
        android:id = "@+id/V_L03_05"
        android:layout_width = "fill_parent"
        android:layout_height = "0dip"
        android:layout_weight = "1"
        android:orientation = "horizontal">
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "0.3"
         android:layout_height = "fill_parent"/>
        <Button
         android:id = "@+id/BTN_03_05"
         android:layout_width = "0dip"
         android:layout_weight = "1"
         android:layout_height = "fill_parent"
         android:background="@drawable/f3"/>
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "2.5"
         android:layout_height = "fill_parent"/>
       </LinearLayout>
      </LinearLayout>
      <!-- 3번뷰 끝 -->
      <!-- 4번뷰 시작 -->
      <LinearLayout
       android:layout_width = "fill_parent"
       android:layout_height = "fill_parent"
       android:orientation = "vertical">
       <LinearLayout
        android:id = "@+id/V_L04_01"
        android:layout_width = "fill_parent"
        android:layout_height = "0dip"
        android:layout_weight = "1"
        android:orientation = "horizontal">
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "0.3"
         android:layout_height = "fill_parent"/>
        <Button
         android:id = "@+id/BTN_04_01"
         android:layout_width = "0dip"
         android:layout_weight = "1"
         android:layout_height = "fill_parent"
         android:background="@drawable/f4"/>
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "2.5"
         android:layout_height = "fill_parent"/>
       </LinearLayout>
       <LinearLayout
        android:id = "@+id/V_L04_02"
        android:layout_width = "fill_parent"
        android:layout_height = "0dip"
        android:layout_weight = "1"
        android:orientation = "horizontal">
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "0.9"
         android:layout_height = "fill_parent"/>
        <Button
         android:id = "@+id/BTN_04_02"
         android:layout_width = "0dip"
         android:layout_weight = "1"
         android:layout_height = "fill_parent"
         android:background="@drawable/f5"/>
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "1.9"
         android:layout_height = "fill_parent"/>
       </LinearLayout>
       <LinearLayout
        android:id = "@+id/V_L04_03"
        android:layout_width = "fill_parent"
        android:layout_height = "0dip"
        android:layout_weight = "1"
        android:orientation = "horizontal">
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "1.2"
         android:layout_height = "fill_parent"/>
        <Button
         android:id = "@+id/BTN_04_03"
         android:layout_width = "0dip"
         android:layout_weight = "1"
         android:layout_height = "fill_parent"
         android:background="@drawable/f6"/>
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "1.6"
         android:layout_height = "fill_parent"/>
       </LinearLayout>
       <LinearLayout
        android:id = "@+id/V_L04_04"
        android:layout_width = "fill_parent"
        android:layout_height = "0dip"
        android:layout_weight = "1"
        android:orientation = "horizontal">
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "0.9"
         android:layout_height = "fill_parent"/>
        <Button
         android:id = "@+id/BTN_04_04"
         android:layout_width = "0dip"
         android:layout_weight = "1"
         android:layout_height = "fill_parent"
         android:background="@drawable/f1"
         />
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "1.9"
         android:layout_height = "fill_parent"/>
       </LinearLayout>
       <LinearLayout
        android:id = "@+id/V_L04_05"
        android:layout_width = "fill_parent"
        android:layout_height = "0dip"
        android:layout_weight = "1"
        android:orientation = "horizontal">
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "0.3"
         android:layout_height = "fill_parent"/>
        <Button
         android:id = "@+id/BTN_04_05"
         android:layout_width = "0dip"
         android:layout_weight = "1"
         android:layout_height = "fill_parent"
         android:background="@drawable/f2"/>
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "2.5"
         android:layout_height = "fill_parent"/>
       </LinearLayout>
      </LinearLayout>
      <!-- 4번뷰 끝 -->
      <!-- 5번뷰 시작 -->
      <LinearLayout
       android:layout_width = "fill_parent"
       android:layout_height = "fill_parent"
       android:orientation = "vertical">
       <LinearLayout
        android:id = "@+id/V_L05_01"
        android:layout_width = "fill_parent"
        android:layout_height = "0dip"
        android:layout_weight = "1"
        android:orientation = "horizontal">
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "0.3"
         android:layout_height = "fill_parent"/>
        <Button
         android:id = "@+id/BTN_05_01"
         android:layout_width = "0dip"
         android:layout_weight = "1"
         android:layout_height = "fill_parent"
         android:background="@drawable/f3"/>
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "2.5"
         android:layout_height = "fill_parent"/>
       </LinearLayout>
       <LinearLayout
        android:id = "@+id/V_L05_02"
        android:layout_width = "fill_parent"
        android:layout_height = "0dip"
        android:layout_weight = "1"
        android:orientation = "horizontal">
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "0.9"
         android:layout_height = "fill_parent"/>
        <Button
         android:id = "@+id/BTN_05_02"
         android:layout_width = "0dip"
         android:layout_weight = "1"
         android:layout_height = "fill_parent"
         android:background="@drawable/f4"/>
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "1.9"
         android:layout_height = "fill_parent"/>
       </LinearLayout>
       <LinearLayout
        android:id = "@+id/V_L05_03"
        android:layout_width = "fill_parent"
        android:layout_height = "0dip"
        android:layout_weight = "1"
        android:orientation = "horizontal">
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "1.2"
         android:layout_height = "fill_parent"/>
        <Button
         android:id = "@+id/BTN_05_03"
         android:layout_width = "0dip"
         android:layout_weight = "1"
         android:layout_height = "fill_parent"
         android:background="@drawable/f5"/>
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "1.6"
         android:layout_height = "fill_parent"/>
       </LinearLayout>
       <LinearLayout
        android:id = "@+id/V_L05_04"
        android:layout_width = "fill_parent"
        android:layout_height = "0dip"
        android:layout_weight = "1"
        android:orientation = "horizontal">
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "0.9"
         android:layout_height = "fill_parent"/>
        <Button
         android:id = "@+id/BTN_05_04"
         android:layout_width = "0dip"
         android:layout_weight = "1"
         android:layout_height = "fill_parent"
         android:background="@drawable/f6"/>
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "1.9"
         android:layout_height = "fill_parent"/>
       </LinearLayout>
       <LinearLayout
        android:id = "@+id/V_L05_05"
        android:layout_width = "fill_parent"
        android:layout_height = "0dip"
        android:layout_weight = "1"
        android:orientation = "horizontal">
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "0.3"
         android:layout_height = "fill_parent"/>
        <Button
         android:id = "@+id/BTN_05_05"
         android:layout_width = "0dip"
         android:layout_weight = "1"
         android:layout_height = "fill_parent"
         android:background="@drawable/f1"
         />
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "2.5"
         android:layout_height = "fill_parent"/>
       </LinearLayout>
      </LinearLayout>
      <!-- 5번뷰 끝 -->
      <!-- 6번뷰 시작 -->
      <LinearLayout
       android:layout_width = "fill_parent"
       android:layout_height = "fill_parent"
       android:orientation = "vertical">
       <LinearLayout
        android:id = "@+id/V_L06_01"
        android:layout_width = "fill_parent"
        android:layout_height = "0dip"
        android:layout_weight = "1"
        android:orientation = "horizontal">
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "0.3"
         android:layout_height = "fill_parent"/>
        <Button
         android:id = "@+id/BTN_06_01"
         android:layout_width = "0dip"
         android:layout_weight = "1"
         android:layout_height = "fill_parent"
         android:background="@drawable/f2"/>
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "2.5"
         android:layout_height = "fill_parent"/>
       </LinearLayout>
       <LinearLayout
        android:id = "@+id/V_L06_02"
        android:layout_width = "fill_parent"
        android:layout_height = "0dip"
        android:layout_weight = "1"
        android:orientation = "horizontal">
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "0.9"
         android:layout_height = "fill_parent"/>
        <Button
         android:id = "@+id/BTN_06_02"
         android:layout_width = "0dip"
         android:layout_weight = "1"
         android:layout_height = "fill_parent"
         android:background="@drawable/f3"/>
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "1.9"
         android:layout_height = "fill_parent"/>
       </LinearLayout>
       <LinearLayout
        android:id = "@+id/V_L06_03"
        android:layout_width = "fill_parent"
        android:layout_height = "0dip"
        android:layout_weight = "1"
        android:orientation = "horizontal">
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "1.2"
         android:layout_height = "fill_parent"/>
        <Button
         android:id = "@+id/BTN_06_03"
         android:layout_width = "0dip"
         android:layout_weight = "1"
         android:layout_height = "fill_parent"
         android:background="@drawable/f4"/>
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "1.6"
         android:layout_height = "fill_parent"/>
       </LinearLayout>
       <LinearLayout
        android:id = "@+id/V_L06_04"
        android:layout_width = "fill_parent"
        android:layout_height = "0dip"
        android:layout_weight = "1"
        android:orientation = "horizontal">
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "0.9"
         android:layout_height = "fill_parent"/>
        <Button
         android:id = "@+id/BTN_06_04"
         android:layout_width = "0dip"
         android:layout_weight = "1"
         android:layout_height = "fill_parent"
         android:background="@drawable/f5"/>
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "1.9"
         android:layout_height = "fill_parent"/>
       </LinearLayout>
       <LinearLayout
        android:id = "@+id/V_L06_05"
        android:layout_width = "fill_parent"
        android:layout_height = "0dip"
        android:layout_weight = "1"
        android:orientation = "horizontal">
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "0.3"
         android:layout_height = "fill_parent"/>
        <Button
         android:id = "@+id/BTN_06_05"
         android:layout_width = "0dip"
         android:layout_weight = "1"
         android:layout_height = "fill_parent"
         android:background="@drawable/f6"/>
        <LinearLayout
         android:layout_width = "0dip"
         android:layout_weight = "2.5"
         android:layout_height = "fill_parent"/>
       </LinearLayout>
      </LinearLayout>
      <!-- 6번뷰 끝 -->
     </ViewFlipper>
    </LinearLayout>



    코드를 분석해 보면 이 레이아웃이 어떻게 쓰이는지 알게 될 것이니 참고 하기 바란다. 자세한 설명은 생략 한다.

    댓글 0

COPYRIGHT 2010 EpoNg. ALL RIGHTS RESERVED.