Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AN] hotfix: ui 수정 & 로직 오류 해결 #525

Merged
merged 4 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ class ClubDetailViewModel(
val filters = club.value?.filters ?: listOf()
_clubDetailEvent.emit(ClubDetailEvent.OpenDogSelector(filters))
}
ClubDetailViewType.MINE -> {

ClubDetailViewType.MINE, ClubDetailViewType.PARTICIPATED -> {
val chatRoomId = club.value?.chatRoomId ?: return
_clubDetailEvent.emit(
ClubDetailEvent.Navigation.NavigateToChat(chatRoomId),
)
}

else -> return
}
}
Expand All @@ -74,7 +76,11 @@ class ClubDetailViewModel(
participatingPetsId = dogs,
)
.onSuccess { clubParticipation ->
_clubDetailEvent.emit(ClubDetailEvent.Navigation.NavigateToChat(clubParticipation.chatRoomId))
_clubDetailEvent.emit(
ClubDetailEvent.Navigation.NavigateToChat(
clubParticipation.chatRoomId,
),
)
}
.onFailure {
_clubDetailEvent.emit(ClubDetailEvent.FailParticipation)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class MyPageFragment : BaseFragment<FragmentMyPageBinding>(R.layout.fragment_my_
super.onResume()
viewModel.fetchPetMine()
viewModel.fetchMemberMine()
viewModel.updateCurrentPage(binding.vpPetProfile.currentItem)
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ class PetProfileAdapter(
setHasStableIds(true)
}

override fun getItemId(position: Int): Long {
return getItem(position).id
}

override fun getItemViewType(position: Int): Int {
return if (currentList[position] is PetAddView) PET_ADD_VIEW_TYPE else PET_PROFILE_VIEW_TYPE
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class OtherProfileActivity :
override fun onResume() {
super.onResume()
viewModel.fetchPetMine()
viewModel.updateCurrentPage(binding.vpPetProfile.currentItem)
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ class OtherPetProfileAdapter(
setHasStableIds(true)
}

override fun getItemId(position: Int): Long {
return getItem(position).id
}

override fun onCreateViewHolder(
parent: ViewGroup,
viewType: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ class SettingActivity : BaseActivity<ActivitySettingBinding>(R.layout.activity_s
is SettingNavigationAction.NavigateToAppInfo ->
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(APP_INFO_URL)))

is SettingNavigationAction.NavigateToPrivacyPolicy -> showSnackbar("준비중이에요")
is SettingNavigationAction.NavigateToPrivacyPolicy -> {
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(APP_INFO_URL)))
}
is SettingNavigationAction.NavigateToLogout -> logOutDialog()
is SettingNavigationAction.NavigateToUnsubscribe -> userDeleteDialog()
is SettingNavigationAction.NavigateToRegister -> {
Expand Down Expand Up @@ -179,6 +181,7 @@ class SettingActivity : BaseActivity<ActivitySettingBinding>(R.layout.activity_s

companion object {
private const val APP_INFO_URL = "https://github.com/woowacourse-teams/2024-friendogly"
private const val PRIVATE_INFO_URL = "https://principled-staircase-b45.notion.site/197be0cd421b437698f639cda10ece04?pvs=4"

fun getIntent(context: Context): Intent {
return Intent(context, SettingActivity::class.java)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ fun ImageView.bindGlide(uri: String?) {
.into(this)
}

@BindingAdapter("clubGlide")
fun ImageView.bindClubGlide(uri: String?) {
if (uri.isNullOrBlank()) {
this.setImageResource(R.drawable.ic_club_normal)
return
}
Glide.with(context)
.load(uri)
.into(this)
}

@BindingAdapter("glideProfile1000")
fun ImageView.bindProfile1000(bitmap: Bitmap?) {
if (bitmap == null) {
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/res/drawable/ic_club_normal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
android:viewportHeight="110">
<path
android:pathData="M8,0L102,0A8,8 0,0 1,110 8L110,102A8,8 0,0 1,102 110L8,110A8,8 0,0 1,0 102L0,8A8,8 0,0 1,8 0z"
android:fillColor="@color/coral50"/>
android:fillColor="@color/gray200"/>
<path
android:pathData="M53.51,69.75C52.17,66.8 41.47,54.46 41.47,54.46L32.83,59.62L26.51,83.12L35.93,84.3L44.48,84.75L49.84,81.19L50.27,80.91C50.27,80.91 55.19,73.43 53.51,69.75Z"
android:fillColor="#F5D8AF"/>
Expand Down
4 changes: 2 additions & 2 deletions android/app/src/main/res/layout/activity_club_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
android:backgroundTint="@color/coral30"
android:scaleType="centerCrop"
android:src="@drawable/ic_club_normal"
app:glide="@{vm.club.clubPoster}"
app:clubGlide="@{vm.club.clubPoster}"
app:layout_constraintBottom_toTopOf="@+id/view_club_detail_user_top_bar"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintLeft_toLeftOf="parent"
Expand Down Expand Up @@ -137,7 +137,7 @@
<View
android:id="@+id/view_club_detail_line"
android:layout_width="match_parent"
android:layout_height="6dp"
android:layout_height="2dp"
android:layout_marginTop="10dp"
android:background="@color/gray300"
app:layout_constraintTop_toBottomOf="@id/view_club_detail_user_top_bar" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@
app:myLocation="@{vm.userAddress}"
tools:text="대한민국 제주특별자치도 제주시 이도1동 1250-15" />

<Space
android:layout_width="wrap_content"
android:layout_height="20dp" />

<TextView
style="@style/Theme.AppCompat.TextView.SemiBold.White.Size16"
Expand Down
4 changes: 2 additions & 2 deletions android/app/src/main/res/layout/fragment_woof.xml
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@
android:id="@+id/layout_woof_register_marker"
registeringVisibilityAnimation="@{vm.uiState}"
android:layout_width="match_parent"
android:layout_height="240dp"
android:layout_height="208dp"
android:layout_margin="12dp"
android:background="@drawable/rect_white_fill_30"
android:elevation="10dp"
Expand Down Expand Up @@ -445,7 +445,7 @@
android:text="@{vm.addressLine}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_woof_register_walk_area"
tools:text="서울 송파구 올림픽로35다길 42" />
tools:text="서울 송파구 올림픽로35다길 42서울 송파구 올림픽로35다길 42" />

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_woof_register_footprint"
Expand Down
25 changes: 13 additions & 12 deletions android/app/src/main/res/layout/item_club.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
onSingleClick="@{()->actionHandler.loadClub(club.clubId)}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/rect_gray_fill_radius8"
android:layout_marginVertical="5dp">
android:layout_marginVertical="5dp"
android:background="@drawable/rect_gray_fill_radius8">

<androidx.constraintlayout.widget.ConstraintLayout
android:background="@drawable/ripple_rect_fill8_white"
android:padding="10dp"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:background="@drawable/ripple_rect_fill8_white"
android:padding="10dp">

<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/iv_club_list_poster"
Expand All @@ -34,7 +34,7 @@
android:background="@drawable/rect_gary03_fill_12"
android:scaleType="centerCrop"
android:src="@drawable/ic_club_normal"
app:glide="@{club.clubPoster}"
app:clubGlide="@{club.clubPoster}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toStartOf="@id/ll_club_list_main_content"
Expand All @@ -45,20 +45,21 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/ll_club_list_main_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_height="0dp"
android:orientation="vertical"
android:paddingStart="3dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintBottom_toBottomOf="@id/iv_club_list_poster"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/iv_club_list_poster"
app:layout_constraintTop_toTopOf="parent">
app:layout_constraintTop_toTopOf="@id/iv_club_list_poster">

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rcv_club_list_filter_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="3dp"
android:orientation="horizontal"
android:visibility="gone"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toTopOf="@id/tv_club_list_club_state"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -75,7 +76,7 @@
app:clubStateText="@{club.clubState}"
app:clubStateTextStyle="@{club.clubState}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/rcv_club_list_filter_list"
app:layout_constraintTop_toTopOf="parent"
tools:style="@style/Theme.AppCompat.TextView.SemiBold.Orange.Size14"
tools:text="모집중" />

Expand All @@ -91,7 +92,7 @@
android:text="@{club.title}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/tv_club_list_club_state"
app:layout_constraintTop_toBottomOf="@id/rcv_club_list_filter_list"
app:layout_constraintTop_toTopOf="parent"
tools:text="모임해요~" />

<TextView
Expand All @@ -100,7 +101,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="5dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:ellipsize="end"
android:maxLines="1"
Expand Down
3 changes: 2 additions & 1 deletion android/app/src/main/res/layout/item_filter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</data>

<androidx.constraintlayout.widget.ConstraintLayout
android:background="@drawable/rect_coral100_fill_12"
android:background="@drawable/rect_coral30_fill_8"
android:paddingHorizontal="8dp"
android:paddingVertical="5dp"
android:layout_marginEnd="3dp"
Expand All @@ -21,6 +21,7 @@
tools:text = "중형견"
style="@style/Theme.AppCompat.TextView.Regular.Black.Size14"
app:layout_constraintStart_toStartOf="parent"
android:textColor="@color/coral400"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:text="@{clubFilter.filterName}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="5dp"
android:background="@drawable/rect_coral100_fill_12"
android:background="@drawable/rect_coral30_fill_8"
android:paddingHorizontal="13dp"
android:paddingVertical="6dp">

Expand All @@ -29,6 +29,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingEnd="5dp"
android:textColor="@color/coral400"
android:text="@{clubFilter.filterName}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -38,11 +39,11 @@
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:backgroundTint="@color/white"
android:src="@drawable/ic_close"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/tv_club_list_filter_name"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
android:tint="@color/coral400"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
3 changes: 2 additions & 1 deletion android/app/src/main/res/layout/layout_chat_drawer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@
style="@style/Theme.AppCompat.TextView.Regular.Black.Size12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:layout_marginTop="30dp"
android:text="@string/chat_group_info"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<Button
style="@style/Theme.AppCompat.TextView.SemiBold.Gray07.Size14"
android:textColor="@color/gray900"
android:id="@+id/btn_chat_club"
android:text="@string/chat_go_club_detail"
android:layout_marginTop="15dp"
Expand Down
Loading