Skip to content

Commit

Permalink
[1.1.1/AN-UI] 홈 화면 반응형 UI 구현하기 (#383)
Browse files Browse the repository at this point in the history
* refactor: 불필요한 코드 삭제

* feat: 가로모드시 배틀구도,바이옴 메뉴 추가

* feat: width 600 dimens 추가

* feat: portrait dimens 적용

* feat: land dimens 적용
  • Loading branch information
kkosang authored Oct 23, 2024
1 parent 1aba612 commit 1b08976
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 155 deletions.
115 changes: 78 additions & 37 deletions android/app/src/main/res/layout-land/activity_home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,29 @@
android:layout_width="match_parent"
android:layout_height="match_parent">

<ScrollView
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar_home"
style="@style/CustomToolbarStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_constraintTop_toTopOf="parent" />

<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent">
app:layout_constraintTop_toBottomOf="@id/toolbar_home">

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_height="match_parent"
tools:context=".presentation.home.HomeActivity">

<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar_home"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_constraintTop_toTopOf="parent"
style="@style/CustomToolbarStyle" />

<ImageView
android:id="@+id/iv_home_land_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="?attr/actionBarSize"
android:onClick="@{() -> actionHandler.navigateToPokeRogue()}"
android:src="@drawable/img_home_land_logo"
app:layout_constraintEnd_toEndOf="@id/gl_end"
Expand All @@ -48,8 +47,8 @@
<GridLayout
android:layout_width="0dp"
android:layout_height="0dp"
android:columnCount="4"
android:padding="12dp"
android:columnCount="5"
android:padding="@dimen/home_gridLayout_padding"
android:rowCount="1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="4"
Expand All @@ -62,7 +61,7 @@
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_row="0"
android:layout_column="0"
android:layout_column="2"
android:layout_columnWeight="1"
android:layout_gravity="fill"
android:layout_margin="6dp"
Expand All @@ -79,8 +78,8 @@

<ImageView
android:id="@+id/iv_home_land_type"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_width="@dimen/home_iv_width"
android:layout_height="@dimen/home_iv_height"
android:src="@drawable/img_home_type" />

<TextView
Expand All @@ -90,7 +89,8 @@
android:paddingTop="12dp"
android:text="@string/home_menu_type"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.Poke.TitleBold" />
android:textAppearance="@style/TextAppearance.Poke.TitleBold"
android:textSize="@dimen/home_tv_size" />
</LinearLayout>
</androidx.cardview.widget.CardView>

Expand All @@ -99,7 +99,7 @@
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_row="0"
android:layout_column="1"
android:layout_column="0"
android:layout_columnWeight="1"
android:layout_gravity="fill"
android:layout_margin="6dp"
Expand All @@ -116,8 +116,8 @@

<ImageView
android:id="@+id/iv_home_land_dex"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_width="@dimen/home_iv_width"
android:layout_height="@dimen/home_iv_height"
android:src="@drawable/img_home_dex" />

<TextView
Expand All @@ -127,7 +127,8 @@
android:paddingTop="12dp"
android:text="@string/home_menu_pokemon_detail"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.Poke.TitleBold" />
android:textAppearance="@style/TextAppearance.Poke.TitleBold"
android:textSize="@dimen/home_tv_size" />
</LinearLayout>
</androidx.cardview.widget.CardView>

Expand All @@ -136,7 +137,7 @@
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_row="0"
android:layout_column="2"
android:layout_column="4"
android:layout_columnWeight="1"
android:layout_gravity="fill"
android:layout_margin="6dp"
Expand All @@ -153,8 +154,8 @@

<ImageView
android:id="@+id/iv_home_land_ability"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_width="@dimen/home_iv_width"
android:layout_height="@dimen/home_iv_height"
android:src="@drawable/img_home_ability" />

<TextView
Expand All @@ -164,12 +165,13 @@
android:paddingTop="12dp"
android:text="@string/home_menu_ability"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.Poke.TitleBold" />
android:textAppearance="@style/TextAppearance.Poke.TitleBold"
android:textSize="@dimen/home_tv_size" />
</LinearLayout>
</androidx.cardview.widget.CardView>

<androidx.cardview.widget.CardView
android:id="@+id/cv_home_land_tip"
android:id="@+id/cv_home_land_biome"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_row="0"
Expand All @@ -178,7 +180,45 @@
android:layout_gravity="fill"
android:layout_margin="6dp"
android:backgroundTint="@color/poke_grey_80"
android:onClick="@{() -> actionHandler.navigateToTip()}"
android:onClick="@{() -> actionHandler.navigateToBiome()}"
app:cardCornerRadius="16dp">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical">

<ImageView
android:id="@+id/iv_home_land_biome"
android:layout_width="@dimen/home_iv_width"
android:layout_height="@dimen/home_iv_height"
android:src="@drawable/icon_home_biome" />

<TextView
android:id="@+id/tv_home_land_biome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="12dp"
android:text="@string/home_menu_biome"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.Poke.TitleBold"
android:textSize="@dimen/home_tv_size" />
</LinearLayout>
</androidx.cardview.widget.CardView>

<androidx.cardview.widget.CardView
android:id="@+id/cv_home_battle"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_row="0"
android:layout_column="1"
android:layout_columnWeight="1"
android:layout_gravity="fill"
android:layout_margin="6dp"
android:backgroundTint="@color/poke_grey_80"
android:onClick="@{() -> actionHandler.navigateToBattle()}"
app:cardCornerRadius="16dp">

<LinearLayout
Expand All @@ -189,19 +229,20 @@
android:orientation="vertical">

<ImageView
android:id="@+id/iv_home_land_tip"
android:layout_width="60dp"
android:layout_height="60dp"
android:src="@drawable/img_home_tip" />
android:id="@+id/iv_home_land_battle"
android:layout_width="@dimen/home_iv_width"
android:layout_height="@dimen/home_iv_height"
android:src="@drawable/icon_home_battle" />

<TextView
android:id="@+id/tv_home_land_tip"
android:id="@+id/tv_home_land_battle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="12dp"
android:text="@string/home_menu_tip"
android:text="@string/home_menu_battle"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.Poke.TitleBold" />
android:textAppearance="@style/TextAppearance.Poke.TitleBold"
android:textSize="@dimen/home_tv_size" />
</LinearLayout>
</androidx.cardview.widget.CardView>
</GridLayout>
Expand All @@ -221,6 +262,6 @@
app:layout_constraintGuide_end="25dp" />

</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</HorizontalScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
Loading

0 comments on commit 1b08976

Please sign in to comment.