Skip to content

Commit

Permalink
refactor: 리소스 리팩터링 및 xml 컨벤션 적용 #473 (#478)
Browse files Browse the repository at this point in the history
* refactor: View 별 스타일 분리 및 세분화

- 너무 많은 스타일을 가지고 있는 View 의 경우 따로 파일을 생성하여 분리
- 연관성 있는 View style 끼리 정렬
- 주석으로 View 별 스타일 구분
- 스타일 추가 및 세분화

* refactor: 사용하지 않는 layout 제거

- Google Map Fragment 레이아웃과 방문기록(현 스타카토) 레이아웃 제거

* refactor: 상세 페이지 Toolbar의 레이아웃을 include

- 기존에 사용하던 toolbar_detail 의 레이아웃을 include 태그로 적용

* refactor: NavigationToolbar 의 paddingEnd 속성을 style에 지정

* refactor: ConstraintLayout 리팩터링

- ConstraintLayout 내부 View 들의 match_parent 속성을 0dp 로 변경하고 constraint 설정
- 중첩된 ConstraintLayout 제거

* refactor: 기분 선택 리사이클러뷰의 padding 속성 수정

* refactor: 이미지 contentDescription 설정 및 lint 설정

* refactor: xml layout 의 ID 네이밍 컨벤션 적용

- 누락된 이미지 contentDescription 설정

* fix: 스타카토 조회 화면에서 사용하는 Toolbar로 롤백

- 수정, 삭제 시 Memory의 ID가 필요하기 때문에 기존에 사용하는 Toolbar 와 동작이 다름

* ui: 추억 소개 InputText 의 크기 축소 및 여백 너비 조정

* refactor: TextInput style의 이름 변경

- TextInputEditTextStyle.OneLine -> TextInputEditTextStyle.SingleLine

* refactor: View 에서 MaterialDivider 로 변경

* refactor: MaterialDivider View의 id명 변경 및 divider 색상 속성 변경

- view_timeline_line -> divider_timeline
- foreground -> dividerColor
  • Loading branch information
Junyoung-WON authored Oct 14, 2024
1 parent 5d4049c commit 73dd678
Show file tree
Hide file tree
Showing 25 changed files with 390 additions and 410 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@
app:layout_constraintTop_toBottomOf="@id/space_login_separating_logo_and_nickname_et">

<com.google.android.material.textfield.TextInputEditText
style="@style/TextInputEditTextStyle.Title"
android:layout_marginHorizontal="0dp"
style="@style/TextInputEditTextStyle.SingleLine"
android:hint="@string/login_nickname_hint"
android:imeOptions="actionDone"
android:maxLength="20"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,11 @@
<androidx.fragment.app.FragmentContainerView
android:id="@+id/fragment_container_view_main_bottom_sheet"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="0dp"
app:defaultNavHost="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/view_main_drag_bar"
app:navGraph="@navigation/bottom_navigation_graph" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar_memory_creation"
style="@style/TitleToolbarStyle"
style="@style/NavigationToolbarStyle"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
Expand Down Expand Up @@ -159,11 +159,9 @@
app:layout_constraintTop_toBottomOf="@id/tv_memory_creation_description">

<com.google.android.material.textfield.TextInputEditText
style="@style/TextInputEditTextStyle"
android:gravity="top"
style="@style/TextInputEditTextStyle.Description"
android:hint="@string/memory_creation_description_hint"
android:maxLength="500"
android:minHeight="255dp"
android:text="@={viewModel.description}" />

</com.google.android.material.textfield.TextInputLayout>
Expand All @@ -172,7 +170,7 @@
android:id="@+id/tv_memory_creation_period_title"
style="@style/SubTitleStyle"
android:layout_marginStart="24dp"
android:layout_marginTop="24dp"
android:layout_marginTop="40dp"
android:text="@string/memory_creation_period_setting"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/text_input_memory_creation_description" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar_memory_update"
style="@style/TitleToolbarStyle"
style="@style/NavigationToolbarStyle"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
Expand Down Expand Up @@ -160,11 +160,9 @@
app:layout_constraintTop_toBottomOf="@id/tv_memory_update_description">

<com.google.android.material.textfield.TextInputEditText
style="@style/TextInputEditTextStyle"
android:gravity="top"
style="@style/TextInputEditTextStyle.Description"
android:hint="@string/memory_creation_description_hint"
android:maxLength="500"
android:minHeight="255dp"
android:text="@={viewModel.description}" />

</com.google.android.material.textfield.TextInputLayout>
Expand All @@ -173,7 +171,7 @@
android:id="@+id/tv_memory_update_period_title"
style="@style/SubTitleStyle"
android:layout_marginStart="24dp"
android:layout_marginTop="24dp"
android:layout_marginTop="40dp"
android:text="@string/memory_creation_period_setting"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/text_input_memory_update_description" />
Expand Down
14 changes: 7 additions & 7 deletions android/Staccato_AN/app/src/main/res/layout/activity_mypage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar_mypage"
style="@style/DefaultToolbarStyle"
style="@style/NavigationToolbarStyle"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
Expand Down Expand Up @@ -61,8 +61,8 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
bind:coilCircleImageUrl="@{viewModel.accountInformation.profileImageUrl}"
bind:coilPlaceHolder="@{@drawable/icon_member}"
tools:src="@drawable/icon_member" />
bind:coilPlaceHolder="@{@drawable/icon_member}"
tools:src="@drawable/icon_member" />

<ImageView
android:layout_width="wrap_content"
Expand All @@ -83,10 +83,10 @@
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="@{viewModel.accountInformation.nickname}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/frame_mypage_profile_image"
tools:text="사용자 닉네임" />
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/frame_mypage_profile_image"
tools:text="사용자 닉네임" />

<TextView
android:id="@+id/tv_mypage_profile_uuid"
Expand Down
103 changes: 55 additions & 48 deletions android/Staccato_AN/app/src/main/res/layout/activity_recovery.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,67 +21,74 @@

<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar_recovery"
style="@style/TitleToolbarStyle"
style="@style/NavigationToolbarStyle"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline_recovery_start_margin"
android:layout_width="0dp"
android:layout_height="0dp"
android:paddingHorizontal="24dp"
android:paddingTop="72dp"
android:paddingBottom="24dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/toolbar_recovery">
android:orientation="vertical"
app:layout_constraintGuide_begin="24dp" />

<TextView
android:id="@+id/tv_recovery_title"
style="@style/Typography.Title1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:text="@string/recovery_title"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline_recovery_end_margin"
android:layout_width="0dp"
android:layout_height="0dp"
android:orientation="vertical"
app:layout_constraintGuide_end="24dp" />

<TextView
android:id="@+id/tv_recovery_subtitle"
style="@style/Typography.Title1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="8dp"
android:text="@string/recovery_subtitle"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_recovery_title" />
<TextView
android:id="@+id/tv_recovery_title"
style="@style/Typography.Title1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="72dp"
android:text="@string/recovery_title"
app:layout_constraintStart_toStartOf="@id/guideline_recovery_start_margin"
app:layout_constraintTop_toBottomOf="@id/toolbar_recovery" />

<EditText
android:id="@+id/et_recovery_code"
style="@style/EditTextStyle"
android:layout_marginTop="40dp"
<TextView
android:id="@+id/tv_recovery_subtitle"
style="@style/Typography.Title1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="8dp"
android:text="@string/recovery_subtitle"
app:layout_constraintStart_toStartOf="@id/guideline_recovery_start_margin"
app:layout_constraintTop_toBottomOf="@id/tv_recovery_title" />

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/text_input_recovery_code"
style="@style/TextInputLayoutStyle"
android:layout_marginTop="40dp"
app:counterMaxLength="36"
app:layout_constraintEnd_toEndOf="@id/guideline_recovery_end_margin"
app:layout_constraintStart_toStartOf="@id/guideline_recovery_start_margin"
app:layout_constraintTop_toBottomOf="@id/tv_recovery_subtitle">

<com.google.android.material.textfield.TextInputEditText
style="@style/TextInputEditTextStyle.SingleLine"
android:hint="@string/recovery_code_hint"
android:imeOptions="actionDone"
android:inputType="text"
android:maxLength="36"
android:maxLines="1"
android:text="@={viewModel.recoveryCode}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_recovery_subtitle" />
android:text="@={viewModel.recoveryCode}" />

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_start_staccato"
style="@style/ButtonStyle.Recovery"
android:onClick="@{() -> handler.onRecoveryClicked()}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
bind:recoveryButtonEnabled="@{viewModel.recoveryCode}" />
</com.google.android.material.textfield.TextInputLayout>

</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_start_staccato"
style="@style/ButtonStyle.Recovery"
android:layout_marginBottom="24dp"
android:onClick="@{() -> handler.onRecoveryClicked()}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/guideline_recovery_end_margin"
app:layout_constraintStart_toStartOf="@id/guideline_recovery_start_margin"
bind:recoveryButtonEnabled="@{viewModel.recoveryCode}" />

</androidx.constraintlayout.widget.ConstraintLayout>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,20 @@

<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar_visit_creation"
style="@style/TitleToolbarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingEnd="8dp"
style="@style/NavigationToolbarStyle"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:subtitle="@string/visit_creation_toolbar_subtitle"
app:title="@string/visit_creation_toolbar_title" />

<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="0dp"
android:overScrollMode="never"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/toolbar_visit_creation">

<androidx.constraintlayout.widget.ConstraintLayout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,20 @@

<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar_visit_update"
style="@style/TitleToolbarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingEnd="8dp"
style="@style/NavigationToolbarStyle"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:subtitle="@string/visit_creation_toolbar_subtitle"
app:title="@string/visit_update_toolbar_title" />

<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="0dp"
android:overScrollMode="never"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/toolbar_visit_update">

<androidx.constraintlayout.widget.ConstraintLayout
Expand Down Expand Up @@ -225,7 +224,7 @@
android:id="@+id/tv_memory_selection_title"
style="@style/SubTitleStyle"
android:layout_marginTop="35dp"
android:text="추억 선택"
android:text="@string/visit_creation_memory_selection"
app:layout_constraintStart_toStartOf="@id/tv_photo_title"
app:layout_constraintTop_toBottomOf="@id/constraint_current_location" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

</data>

<androidx.constraintlayout.widget.ConstraintLayout
style="@style/DialogBackgroundStyle"
android:layout_width="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout style="@style/DialogBackgroundStyle">

<TextView
android:id="@+id/tv_delete_impossibility_dialog_title"
Expand Down
8 changes: 0 additions & 8 deletions android/Staccato_AN/app/src/main/res/layout/fragment_maps.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@

<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar_moment"
style="@style/DefaultToolbarStyle"
android:paddingEnd="8dp"
style="@style/NavigationToolbarStyle"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
Expand Down Expand Up @@ -153,7 +152,7 @@

<androidx.fragment.app.FragmentContainerView
android:id="@+id/container_moment_feeling_selection"
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -162,7 +161,7 @@

<androidx.fragment.app.FragmentContainerView
android:id="@+id/container_moment_comments"
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
Expand Down
Loading

0 comments on commit 73dd678

Please sign in to comment.