From cdefac67a20829a2900259f6832ad4ac6da94056 Mon Sep 17 00:00:00 2001 From: leeeha Date: Sat, 2 Mar 2024 19:45:48 +0900 Subject: [PATCH] =?UTF-8?q?[del]=20#247=20=EB=A7=88=EC=9D=B4=ED=94=BC?= =?UTF-8?q?=EB=93=9C=EA=B0=80=20=ED=94=84=EB=9E=98=EA=B7=B8=EB=A8=BC?= =?UTF-8?q?=ED=8A=B8=EC=97=90=EC=84=9C=20=EC=95=A1=ED=8B=B0=EB=B9=84?= =?UTF-8?q?=ED=8B=B0=EB=A1=9C=20=EB=B0=94=EB=80=8C=EB=A9=B4=EC=84=9C=20?= =?UTF-8?q?=EB=B6=88=ED=95=84=EC=9A=94=ED=95=B4=EC=A7=84=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../winey/presentation/main/MainActivity.kt | 24 ++++++------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/app/src/main/java/org/go/sopt/winey/presentation/main/MainActivity.kt b/app/src/main/java/org/go/sopt/winey/presentation/main/MainActivity.kt index ae3f926f..bc42c514 100644 --- a/app/src/main/java/org/go/sopt/winey/presentation/main/MainActivity.kt +++ b/app/src/main/java/org/go/sopt/winey/presentation/main/MainActivity.kt @@ -41,7 +41,6 @@ class MainActivity : BindingActivity(R.layout.activity_main private val isUploadSuccess by lazy { intent.getBooleanExtra(KEY_FEED_UPLOAD, false) } private val isDeleteSuccess by lazy { intent.getBooleanExtra(KEY_FEED_DELETE, false) } - private val prevScreenName by lazy { intent.getStringExtra(KEY_PREV_SCREEN) } private val notiType by lazy { intent.getStringExtra(KEY_NOTI_TYPE) } private val feedId by lazy { intent.getStringExtra(KEY_FEED_ID) } @@ -126,11 +125,7 @@ class MainActivity : BindingActivity(R.layout.activity_main return } - if (prevScreenName == MY_FEED_SCREEN) { - navigateToMyPageFragment(KEY_TO_MYFEED, true) - } else { - navigateTo() - } + navigateTo() } private fun showWineyFeedResultSnackBar() { @@ -205,12 +200,6 @@ class MainActivity : BindingActivity(R.layout.activity_main } } - private inline fun navigateTo() { - supportFragmentManager.commit { - replace(R.id.fcv_main, T::class.simpleName) - } - } - private fun navigateToMyPageFragment(key: String, value: Boolean) { supportFragmentManager.commit { val bundle = Bundle() @@ -234,19 +223,20 @@ class MainActivity : BindingActivity(R.layout.activity_main startActivity(intent) } + private inline fun navigateTo() { + supportFragmentManager.commit { + replace(R.id.fcv_main, T::class.simpleName) + } + } + companion object { private const val KEY_FEED_UPLOAD = "upload" private const val KEY_FEED_DELETE = "delete" - private const val KEY_NOTI_TYPE = "notiType" private const val KEY_FROM_NOTI = "fromNoti" - private const val KEY_TO_MYFEED = "toMyFeed" const val KEY_FEED_ID = "feedId" const val KEY_TO_MYPAGE = "navigateMypage" const val KEY_FROM_GOAL_PATH = "fromGoalPath" - - private const val KEY_PREV_SCREEN = "PREV_SCREEN_NAME" - private const val MY_FEED_SCREEN = "MyFeedFragment" } }