From e877bfb4a11b7ae16cedee55d0594b7cbc4d19e5 Mon Sep 17 00:00:00 2001 From: swit-jim Date: Sun, 17 Mar 2024 22:45:29 +0900 Subject: [PATCH 1/4] =?UTF-8?q?[fix/design=5Fdetail]:=20Splash/Login=20?= =?UTF-8?q?=EB=94=94=EC=9E=90=EC=9D=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/res/drawable/ic_apple.xml | 9 +++ .../main/res/drawable/ic_jmt_logo_grey.xml | 18 ++++++ .../main/res/drawable/ic_jmt_logo_main.xml | 18 ++++++ .../res/drawable/ic_jmt_logo_title_main.xml | 15 +++++ .../res/drawable/ic_jmt_logo_title_white.xml | 15 +++++ .../main/res/drawable/ic_jmt_logo_white.xml | 18 ++++++ .../src/main/res/layout/activity_splash.xml | 33 ++++++---- .../src/main/res/layout/fragment_login.xml | 60 ++++++++++++------- 8 files changed, 154 insertions(+), 32 deletions(-) create mode 100644 presentation/src/main/res/drawable/ic_apple.xml create mode 100644 presentation/src/main/res/drawable/ic_jmt_logo_grey.xml create mode 100644 presentation/src/main/res/drawable/ic_jmt_logo_main.xml create mode 100644 presentation/src/main/res/drawable/ic_jmt_logo_title_main.xml create mode 100644 presentation/src/main/res/drawable/ic_jmt_logo_title_white.xml create mode 100644 presentation/src/main/res/drawable/ic_jmt_logo_white.xml diff --git a/presentation/src/main/res/drawable/ic_apple.xml b/presentation/src/main/res/drawable/ic_apple.xml new file mode 100644 index 00000000..aaed5892 --- /dev/null +++ b/presentation/src/main/res/drawable/ic_apple.xml @@ -0,0 +1,9 @@ + + + diff --git a/presentation/src/main/res/drawable/ic_jmt_logo_grey.xml b/presentation/src/main/res/drawable/ic_jmt_logo_grey.xml new file mode 100644 index 00000000..afc5705d --- /dev/null +++ b/presentation/src/main/res/drawable/ic_jmt_logo_grey.xml @@ -0,0 +1,18 @@ + + + + + diff --git a/presentation/src/main/res/drawable/ic_jmt_logo_main.xml b/presentation/src/main/res/drawable/ic_jmt_logo_main.xml new file mode 100644 index 00000000..db319929 --- /dev/null +++ b/presentation/src/main/res/drawable/ic_jmt_logo_main.xml @@ -0,0 +1,18 @@ + + + + + diff --git a/presentation/src/main/res/drawable/ic_jmt_logo_title_main.xml b/presentation/src/main/res/drawable/ic_jmt_logo_title_main.xml new file mode 100644 index 00000000..ee28d6d2 --- /dev/null +++ b/presentation/src/main/res/drawable/ic_jmt_logo_title_main.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/presentation/src/main/res/drawable/ic_jmt_logo_title_white.xml b/presentation/src/main/res/drawable/ic_jmt_logo_title_white.xml new file mode 100644 index 00000000..7814d9ca --- /dev/null +++ b/presentation/src/main/res/drawable/ic_jmt_logo_title_white.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/presentation/src/main/res/drawable/ic_jmt_logo_white.xml b/presentation/src/main/res/drawable/ic_jmt_logo_white.xml new file mode 100644 index 00000000..0dc31c61 --- /dev/null +++ b/presentation/src/main/res/drawable/ic_jmt_logo_white.xml @@ -0,0 +1,18 @@ + + + + + diff --git a/presentation/src/main/res/layout/activity_splash.xml b/presentation/src/main/res/layout/activity_splash.xml index 0f2b7bcd..2e9c865e 100644 --- a/presentation/src/main/res/layout/activity_splash.xml +++ b/presentation/src/main/res/layout/activity_splash.xml @@ -4,34 +4,47 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" + android:background="@color/main500" tools:context=".login.SplashActivity"> - + android:layout_height="wrap_content" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent"/> + app:layout_constraintBottom_toTopOf="@+id/titls"/> + + + app:layout_constraintTop_toBottomOf="@+id/barrie"/> diff --git a/presentation/src/main/res/layout/fragment_login.xml b/presentation/src/main/res/layout/fragment_login.xml index ba9ae47b..0f709fac 100644 --- a/presentation/src/main/res/layout/fragment_login.xml +++ b/presentation/src/main/res/layout/fragment_login.xml @@ -6,19 +6,18 @@ android:layout_height="match_parent" tools:context=".login.LoginFragment"> - + android:layout_height="wrap_content" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent"/> @@ -27,12 +26,11 @@ android:id="@+id/title" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="16dp" - android:src="@drawable/login_jmt_title" + android:src="@drawable/ic_jmt_logo_title_main" + android:layout_marginBottom="16dp" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintBottom_toBottomOf="parent" /> + app:layout_constraintBottom_toTopOf="@+id/barrie"/> + android:layout_marginBottom="16dp" + app:layout_constraintBottom_toTopOf="@+id/apple_login_btn"> - + android:minHeight="56dp" + android:gravity="center" + android:clickable="true" + android:layout_marginHorizontal="20dp" + android:backgroundTint="@color/black" + android:background="@drawable/bg_rounded_border_8_grey200" + android:orientation="horizontal" + android:layout_marginBottom="56dp" + app:layout_constraintBottom_toBottomOf="parent"> + + + + \ No newline at end of file From 667a1491c1a15c25e2177af2f14e889e11cc366c Mon Sep 17 00:00:00 2001 From: swit-jim Date: Sun, 17 Mar 2024 22:45:40 +0900 Subject: [PATCH 2/4] =?UTF-8?q?[fix/design=5Fdetail]:=20Empty=20=EB=94=94?= =?UTF-8?q?=EC=9E=90=EC=9D=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/res/drawable/jmt_logo_small.xml | 16 ---------------- .../src/main/res/drawable/jmt_splash_logo.xml | 16 ---------------- .../layout/fragment_registered_restaurant.xml | 7 +++---- presentation/src/main/res/layout/item_empty_.xml | 11 +++++------ .../res/layout/item_registered_restaurant.xml | 2 +- .../src/main/res/layout/not_yet_layout.xml | 7 +++---- 6 files changed, 12 insertions(+), 47 deletions(-) delete mode 100644 presentation/src/main/res/drawable/jmt_logo_small.xml delete mode 100644 presentation/src/main/res/drawable/jmt_splash_logo.xml diff --git a/presentation/src/main/res/drawable/jmt_logo_small.xml b/presentation/src/main/res/drawable/jmt_logo_small.xml deleted file mode 100644 index 388625a3..00000000 --- a/presentation/src/main/res/drawable/jmt_logo_small.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - diff --git a/presentation/src/main/res/drawable/jmt_splash_logo.xml b/presentation/src/main/res/drawable/jmt_splash_logo.xml deleted file mode 100644 index 7990b4a3..00000000 --- a/presentation/src/main/res/drawable/jmt_splash_logo.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - diff --git a/presentation/src/main/res/layout/fragment_registered_restaurant.xml b/presentation/src/main/res/layout/fragment_registered_restaurant.xml index 554af6c2..7f710640 100644 --- a/presentation/src/main/res/layout/fragment_registered_restaurant.xml +++ b/presentation/src/main/res/layout/fragment_registered_restaurant.xml @@ -85,11 +85,10 @@ android:orientation="vertical"> + app:layout_constraintStart_toStartOf="parent" /> Date: Mon, 18 Mar 2024 22:25:14 +0900 Subject: [PATCH 3/4] [fix/design_detail]: currentGroup null safety --- .../java/org/gdsc/presentation/view/home/HomeFragment.kt | 2 +- .../java/org/gdsc/presentation/view/home/HomeViewModel.kt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt b/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt index dcb0bc04..4b01255f 100644 --- a/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt +++ b/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt @@ -3,6 +3,7 @@ package org.gdsc.presentation.view.home import android.content.Intent import android.graphics.PointF import android.os.Bundle +import android.util.Log import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -455,7 +456,6 @@ class HomeFragment : Fragment(), ViewHolderBindListener { val groupList = state.response if (groupList.isEmpty()) { - viewModel.setCurrentGroup(null) bottomSheetDialog.show() } else { groupList.forEach { diff --git a/presentation/src/main/java/org/gdsc/presentation/view/home/HomeViewModel.kt b/presentation/src/main/java/org/gdsc/presentation/view/home/HomeViewModel.kt index 21819f81..a5a9114a 100644 --- a/presentation/src/main/java/org/gdsc/presentation/view/home/HomeViewModel.kt +++ b/presentation/src/main/java/org/gdsc/presentation/view/home/HomeViewModel.kt @@ -85,8 +85,8 @@ class HomeViewModel @Inject constructor( get() = _myGroupList - private var _currentGroup = MutableStateFlow(null) - val currentGroup: StateFlow + private var _currentGroup: MutableStateFlow = MutableStateFlow(Group(0, "", "", "", "", 0, 0, false, false)) + val currentGroup: StateFlow get() = _currentGroup @@ -118,7 +118,7 @@ class HomeViewModel @Inject constructor( _myGroupList.value = ResultState.OnSuccess(groupList) } - fun setCurrentGroup(group: Group?) { + fun setCurrentGroup(group: Group) { _currentGroup.value = group } From 42fbcc084e6bdb862ded62f4e49ffd0066b5dce5 Mon Sep 17 00:00:00 2001 From: swit-jim Date: Mon, 18 Mar 2024 23:01:09 +0900 Subject: [PATCH 4/4] =?UTF-8?q?[fix/design=5Fdetail]:=20GroupList=20?= =?UTF-8?q?=EC=98=B5=EC=A0=80=EB=B9=99=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gdsc/presentation/view/home/HomeFragment.kt | 14 ++------------ .../gdsc/presentation/view/home/HomeViewModel.kt | 4 ++-- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt b/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt index 4b01255f..6078d376 100644 --- a/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt +++ b/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt @@ -198,9 +198,7 @@ class HomeFragment : Fragment(), ViewHolderBindListener { private fun setGroup() { binding.groupArrow.setOnClickListener { lifecycleScope.launch { - viewModel.getMyGroup().let { groupList -> - viewModel.setGroupList(groupList) - } + viewModel.requestGroupList() } BottomSheetDialog(requireContext()) @@ -437,16 +435,8 @@ class HomeFragment : Fragment(), ViewHolderBindListener { viewModel.setSortType(SortType.DISTANCE) } - repeatWhenUiStarted { - viewModel.myGroupList.collect { - binding.groupName.text - } - } - lifecycleScope.launch { - viewModel.getMyGroup().let { groupList -> - viewModel.setGroupList(groupList) - } + viewModel.requestGroupList() } repeatWhenUiStarted { diff --git a/presentation/src/main/java/org/gdsc/presentation/view/home/HomeViewModel.kt b/presentation/src/main/java/org/gdsc/presentation/view/home/HomeViewModel.kt index a5a9114a..79f6c27e 100644 --- a/presentation/src/main/java/org/gdsc/presentation/view/home/HomeViewModel.kt +++ b/presentation/src/main/java/org/gdsc/presentation/view/home/HomeViewModel.kt @@ -163,8 +163,8 @@ class HomeViewModel @Inject constructor( return getRestaurantMapWithLimitCountUseCase(sortType, group) } - suspend fun getMyGroup(): List { - return getMyGroupUseCase() + suspend fun requestGroupList() { + _myGroupList.value = ResultState.OnSuccess(getMyGroupUseCase()) } suspend fun selectGroup(groupID: Int) {