From 15ff21efbd96c9a734e43512929c7cdacea836ad Mon Sep 17 00:00:00 2001 From: pengcon Date: Sat, 28 Dec 2024 17:58:02 +0900 Subject: [PATCH 1/5] =?UTF-8?q?[Fix]=20=EB=A9=94=EC=9D=B8=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EC=8B=A0=EA=B7=9C=20=EC=95=84=EC=9D=B4=ED=85=9C=20?= =?UTF-8?q?=EB=88=8C=EB=9F=AC=20=EC=83=81=EC=A0=90=EA=B0=94=EB=8B=A4?= =?UTF-8?q?=EA=B0=80=20=EB=8F=8C=EC=95=84=EC=98=A4=EB=A9=B4=20=ED=94=84?= =?UTF-8?q?=EB=9E=98=EA=B7=B8=EB=A8=BC=ED=8A=B8=20=EA=B2=B9=EC=B9=98?= =?UTF-8?q?=EB=8A=94=20=ED=98=84=EC=83=81=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/example/favoriteplace/HomeFragment.kt | 7 ------- 1 file changed, 7 deletions(-) diff --git a/app/src/main/java/com/example/favoriteplace/HomeFragment.kt b/app/src/main/java/com/example/favoriteplace/HomeFragment.kt index 8ad67e8..0cc4702 100644 --- a/app/src/main/java/com/example/favoriteplace/HomeFragment.kt +++ b/app/src/main/java/com/example/favoriteplace/HomeFragment.kt @@ -59,13 +59,6 @@ class HomeFragment : Fragment() { // 신상품 페이지 이동 binding.homeNewItemMoreBtn.setOnClickListener { - - val shopBannerNewFragment = ShopBannerNewFragment() // newItemFragment 인스턴스 생성 - val transaction = parentFragmentManager.beginTransaction() - transaction.replace(R.id.main_frameLayout, shopBannerNewFragment) - transaction.addToBackStack(null) - transaction.commit() - // 바텀 네비게이션 바에서 상점 아이템을 선택된 상태로 설정 (requireActivity() as MainActivity).setSelectedNavItem(R.id.shopFragment) } From ca4ee23ca0841f196ee30e773f00c33dbd5845b9 Mon Sep 17 00:00:00 2001 From: pengcon Date: Sat, 28 Dec 2024 17:59:44 +0900 Subject: [PATCH 2/5] =?UTF-8?q?[Refactor]=20=EB=A9=94=EC=9D=B8=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EC=8B=A0=EA=B7=9C=20=EC=95=84=EC=9D=B4=ED=85=9C=20?= =?UTF-8?q?=ED=81=B4=EB=A6=AD=20=EB=B2=94=EC=9C=84=20=EC=A1=B0=EC=A0=88=20?= =?UTF-8?q?(=ED=99=94=EC=82=B4=ED=91=9C=EC=97=90=EC=84=9C=20=EC=A0=84?= =?UTF-8?q?=EC=B2=B4=EB=A1=9C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/example/favoriteplace/HomeFragment.kt | 2 +- app/src/main/res/layout/fragment_home.xml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/example/favoriteplace/HomeFragment.kt b/app/src/main/java/com/example/favoriteplace/HomeFragment.kt index 0cc4702..c4967f8 100644 --- a/app/src/main/java/com/example/favoriteplace/HomeFragment.kt +++ b/app/src/main/java/com/example/favoriteplace/HomeFragment.kt @@ -58,7 +58,7 @@ class HomeFragment : Fragment() { // clearAccessToken() // 신상품 페이지 이동 - binding.homeNewItemMoreBtn.setOnClickListener { + binding.newitemlayout.setOnClickListener { // 바텀 네비게이션 바에서 상점 아이템을 선택된 상태로 설정 (requireActivity() as MainActivity).setSelectedNavItem(R.id.shopFragment) } diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index b673fc5..52a22d5 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -329,6 +329,7 @@ android:layout_width="180dp" android:layout_height="170dp" android:gravity="center" + android:clickable="true" android:layout_marginEnd="6dp"> Date: Sat, 28 Dec 2024 18:00:56 +0900 Subject: [PATCH 3/5] =?UTF-8?q?[Refactor]=20=EB=A9=94=EC=9D=B8=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EB=B9=84=ED=9A=8C=EC=9B=90=20=EC=B6=94=EC=B2=9C=20?= =?UTF-8?q?=EB=9E=A0=EB=A6=AC=20=EC=9D=B4=EB=8F=99=20=ED=81=B4=EB=A6=AD=20?= =?UTF-8?q?=EB=B2=94=EC=9C=84=20=EC=A1=B0=EC=A0=88=20(=ED=99=94=EC=82=B4?= =?UTF-8?q?=ED=91=9C=EC=97=90=EC=84=9C=20=EC=A0=84=EC=B2=B4=EB=A1=9C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/example/favoriteplace/HomeFragment.kt | 14 +++++++++----- app/src/main/res/layout/fragment_home.xml | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/example/favoriteplace/HomeFragment.kt b/app/src/main/java/com/example/favoriteplace/HomeFragment.kt index c4967f8..7a37576 100644 --- a/app/src/main/java/com/example/favoriteplace/HomeFragment.kt +++ b/app/src/main/java/com/example/favoriteplace/HomeFragment.kt @@ -65,9 +65,8 @@ class HomeFragment : Fragment() { // 추천 랠리 이동 - binding.homeRecommendMoreBtn.setOnClickListener { + binding.nonMembersLayout.setOnClickListener { (requireActivity() as MainActivity).setRecommendRally(R.id.rallyhomeFragment) - } @@ -113,7 +112,8 @@ class HomeFragment : Fragment() { private fun checkLoginStatus() { // SharedPreferences에서 액세스 토큰 가져오기 - val sharedPreferences = requireActivity().getSharedPreferences("MyPrefs", Context.MODE_PRIVATE) + val sharedPreferences = + requireActivity().getSharedPreferences("MyPrefs", Context.MODE_PRIVATE) accessToken = sharedPreferences.getString(ACCESS_TOKEN_KEY, null) // TODO : 로그인 상태 다시 돌려놓기 @@ -144,9 +144,11 @@ class HomeFragment : Fragment() { "자유게시판" -> Intent(context, PostDetailActivity::class.java).apply { putExtra("POST_ID", post.id) // "자유게시판"의 경우 "POST_ID" 사용 } + "성지순례 인증" -> Intent(context, MyGuestBookActivity::class.java).apply { putExtra("GUESTBOOK_ID", post.id) // "성지순례 인증"의 경우 "GUESTBOOK_ID" 사용 } + else -> return } startActivity(intent) @@ -177,7 +179,8 @@ class HomeFragment : Fragment() { private fun getUserInfo(userToken: String) { lifecycleScope.launch { try { - val response: Response = homeService.getUserInfo("Bearer $userToken") + val response: Response = + homeService.getUserInfo("Bearer $userToken") if (response.isSuccessful) { // 로그인 상태인 경우 // 서버로부터 사용자 정보를 성공적으로 받아왔을 때 UI 업데이트 @@ -329,7 +332,8 @@ class HomeFragment : Fragment() { } private fun clearAccessToken() { - val sharedPreferences = requireActivity().getSharedPreferences("MyPrefs", Context.MODE_PRIVATE) + val sharedPreferences = + requireActivity().getSharedPreferences("MyPrefs", Context.MODE_PRIVATE) val editor = sharedPreferences.edit() editor.remove(ACCESS_TOKEN_KEY) // 토큰 삭제 editor.apply() // 변경 사항을 적용 diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index 52a22d5..389ba49 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -190,7 +190,7 @@ android:layout_width="180dp" android:layout_height="170dp" android:gravity="center" - + android:clickable="true" android:layout_marginStart="10dp"> Date: Sat, 28 Dec 2024 18:02:22 +0900 Subject: [PATCH 4/5] =?UTF-8?q?[Fix]=20=EB=A9=94=EC=9D=B8=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=ED=9A=8C=EC=9B=90=20=EC=B6=94=EC=B2=9C=20=EB=9E=A0?= =?UTF-8?q?=EB=A6=AC=20=EC=9D=B4=EB=8F=99=20=EA=B0=80=EB=8A=A5=ED=95=98?= =?UTF-8?q?=EA=B2=8C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/example/favoriteplace/HomeFragment.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/example/favoriteplace/HomeFragment.kt b/app/src/main/java/com/example/favoriteplace/HomeFragment.kt index 7a37576..607cd4e 100644 --- a/app/src/main/java/com/example/favoriteplace/HomeFragment.kt +++ b/app/src/main/java/com/example/favoriteplace/HomeFragment.kt @@ -69,7 +69,10 @@ class HomeFragment : Fragment() { (requireActivity() as MainActivity).setRecommendRally(R.id.rallyhomeFragment) } - + //회원 추천 랠리 이동 + binding.membersRallyLayout.setOnClickListener { + (requireActivity() as MainActivity).setRecommendRally(R.id.rallyhomeFragment) + } return binding.root } From 6003bb072f6d435e02489a5269e541c0b2a82db9 Mon Sep 17 00:00:00 2001 From: pengcon Date: Sat, 28 Dec 2024 19:29:41 +0900 Subject: [PATCH 5/5] =?UTF-8?q?[FIX]:=20=EB=B0=B0=EB=84=88=20=EB=9E=A0?= =?UTF-8?q?=EB=A6=AC=20=EC=9D=B4=EB=8F=99,=20=EC=84=B1=EC=A7=80=20?= =?UTF-8?q?=EC=88=9C=EB=A1=80=20=EC=9D=B8=EC=A6=9D=20=EB=8D=94=EB=AF=B8?= =?UTF-8?q?=EA=B0=92=20=EC=A0=91=EA=B7=BC=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/example/favoriteplace/HomeFragment.kt | 21 ++-- app/src/main/res/layout/fragment_home.xml | 114 ++++++++++-------- 2 files changed, 74 insertions(+), 61 deletions(-) diff --git a/app/src/main/java/com/example/favoriteplace/HomeFragment.kt b/app/src/main/java/com/example/favoriteplace/HomeFragment.kt index 607cd4e..617eab2 100644 --- a/app/src/main/java/com/example/favoriteplace/HomeFragment.kt +++ b/app/src/main/java/com/example/favoriteplace/HomeFragment.kt @@ -69,11 +69,16 @@ class HomeFragment : Fragment() { (requireActivity() as MainActivity).setRecommendRally(R.id.rallyhomeFragment) } - //회원 추천 랠리 이동 + //회원 랠리 이동 binding.membersRallyLayout.setOnClickListener { (requireActivity() as MainActivity).setRecommendRally(R.id.rallyhomeFragment) } + //하단 배너 랠리 이동 + binding.homeBannerIv.setOnClickListener { + (requireActivity() as MainActivity).setRecommendRally(R.id.rallyhomeFragment) + } + return binding.root } @@ -89,12 +94,12 @@ class HomeFragment : Fragment() { homeService = retrofit.create(HomeService::class.java) - - val bannerAdapter = BannerVPAdapter(this) - binding.homeBannerVp.adapter = bannerAdapter - binding.homeBannerVp.orientation = ViewPager2.ORIENTATION_HORIZONTAL - bannerAdapter.addFragment(BannerFragment(R.drawable.img_home_banner1)) - bannerAdapter.addFragment(BannerFragment(R.drawable.demo)) +// val bannerAdapter = BannerVPAdapter(this) +// +// binding.homeBannerVp.adapter = bannerAdapter +// binding.homeBannerVp.orientation = ViewPager2.ORIENTATION_HORIZONTAL +// bannerAdapter.addFragment(BannerFragment(R.drawable.img_home_banner1)) +// bannerAdapter.addFragment(BannerFragment(R.drawable.demo)) //로그인 버튼 @@ -149,7 +154,7 @@ class HomeFragment : Fragment() { } "성지순례 인증" -> Intent(context, MyGuestBookActivity::class.java).apply { - putExtra("GUESTBOOK_ID", post.id) // "성지순례 인증"의 경우 "GUESTBOOK_ID" 사용 + putExtra("GUESTBOOK_ID", post.id.toLong()) // "성지순례 인증"의 경우 "GUESTBOOK_ID" 사용 } else -> return diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index 389ba49..c4edfca 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -80,13 +80,13 @@ android:id="@+id/user_layout" android:layout_width="match_parent" android:layout_height="160dp" - android:orientation="horizontal" - android:gravity="center" + android:layout_gravity="center" android:layout_marginStart="3dp" android:layout_marginTop="15dp" - android:layout_marginBottom="10dp" android:layout_marginEnd="3dp" - android:layout_gravity="center" + android:layout_marginBottom="10dp" + android:gravity="center" + android:orientation="horizontal" android:visibility="gone" > @@ -109,10 +109,10 @@ android:id="@+id/home_member_profile_civ" android:layout_width="130dp" android:layout_height="120dp" - app:civ_border_width="1dp" - app:civ_border_overlay="true" android:src="@drawable/memberimg" - app:civ_border_color="@color/gray"/> + app:civ_border_color="@color/gray" + app:civ_border_overlay="true" + app:civ_border_width="1dp" /> @@ -121,23 +121,23 @@ android:layout_width="130dp" android:layout_height="120dp" - app:srcCompat="@drawable/ic_shop1"/> + app:srcCompat="@drawable/ic_shop1" /> + android:layout_marginStart="35dp" + android:orientation="vertical"> + android:src="@drawable/user_title" /> + android:textSize="20dp" + android:textStyle="bold" /> + + android:textSize="20dp" /> + + android:textSize="20dp" + android:textStyle="bold" /> @@ -189,16 +191,16 @@ android:id="@+id/non_members_layout" android:layout_width="180dp" android:layout_height="170dp" - android:gravity="center" + android:layout_marginStart="10dp" android:clickable="true" - android:layout_marginStart="10dp"> + android:gravity="center"> + android:gravity="center" + android:visibility="gone"> + android:src="@drawable/img3" /> + android:src="@drawable/ic_black_b" /> + android:textColor="@color/white" + android:textStyle="bold" /> + android:orientation="horizontal"> + android:layout_weight="1" /> @@ -328,16 +329,16 @@ android:id="@+id/newitemlayout" android:layout_width="180dp" android:layout_height="170dp" - android:gravity="center" + android:layout_marginEnd="6dp" android:clickable="true" - android:layout_marginEnd="6dp"> + android:gravity="center"> @@ -373,16 +374,16 @@ + android:background="@drawable/edge" + android:orientation="vertical"> @@ -405,27 +406,34 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="10dp" - - tools:listitem="@layout/item_trending_post" - app:layout_constraintTop_toBottomOf="@+id/home_real_time_post_tv"> - + app:layout_constraintTop_toBottomOf="@+id/home_real_time_post_tv" + tools:listitem="@layout/item_trending_post" /> - - - + android:layout_marginTop="20dp" + android:src="@drawable/img_home_banner1" + android:clickable="true" + android:background="@drawable/round" + /> + + + + + + + +