From 8e7f48f86a0859a6540cc2361a27123b3085117c Mon Sep 17 00:00:00 2001 From: mdb1217 Date: Sun, 17 Jul 2022 07:13:03 +0900 Subject: [PATCH] =?UTF-8?q?[feat]=20#98=20-=20=EC=98=86=EC=9C=BC=EB=A1=9C?= =?UTF-8?q?=20=EB=93=9C=EB=A1=9C=EC=9B=8C=20=EB=A0=88=EC=9D=B4=EC=95=84?= =?UTF-8?q?=EC=9B=83=20=EC=A0=9C=EC=8A=A4=EC=B2=98=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/helfoome/presentation/MainActivity.kt | 13 +++- .../presentation/WithdrawalActivity.kt | 20 ++++- .../presentation/drawer/MyReviewActivity.kt | 15 +++- .../drawer/ProfileModifyActivity.kt | 4 + .../presentation/drawer/SettingActivity.kt | 7 ++ .../helfoome/presentation/type/FoodType.kt | 4 +- app/src/main/res/layout/activity_main.xml | 1 + .../layout/activity_main_drawer_header.xml | 1 + .../res/layout/activity_profile_modify.xml | 9 ++- app/src/main/res/layout/activity_setting.xml | 14 +++- .../main/res/layout/activity_withdrawal.xml | 1 + app/src/main/res/layout/dialog_logout.xml | 66 +++++++++++++++++ ...yreview_dialog.xml => dialog_myreview.xml} | 0 ...ithdraw_dialog.xml => dialog_withdraw.xml} | 0 app/src/main/res/layout/logout_dialog.xml | 73 ------------------- app/src/main/res/values/strings.xml | 8 +- 16 files changed, 143 insertions(+), 93 deletions(-) create mode 100644 app/src/main/res/layout/dialog_logout.xml rename app/src/main/res/layout/{myreview_dialog.xml => dialog_myreview.xml} (100%) rename app/src/main/res/layout/{withdraw_dialog.xml => dialog_withdraw.xml} (100%) delete mode 100644 app/src/main/res/layout/logout_dialog.xml diff --git a/app/src/main/java/org/helfoome/presentation/MainActivity.kt b/app/src/main/java/org/helfoome/presentation/MainActivity.kt index 1ec16a64..35fd5d39 100644 --- a/app/src/main/java/org/helfoome/presentation/MainActivity.kt +++ b/app/src/main/java/org/helfoome/presentation/MainActivity.kt @@ -8,6 +8,7 @@ import android.view.LayoutInflater import android.view.View import androidx.activity.viewModels import androidx.constraintlayout.widget.ConstraintLayout +import androidx.drawerlayout.widget.DrawerLayout import androidx.fragment.app.add import androidx.fragment.app.commit import com.google.android.material.appbar.AppBarLayout @@ -25,7 +26,7 @@ import com.navercorp.nid.NaverIdLoginSDK import dagger.hilt.android.AndroidEntryPoint import org.helfoome.R import org.helfoome.databinding.ActivityMainBinding -import org.helfoome.databinding.LogoutDialogBinding +import org.helfoome.databinding.DialogLogoutBinding import org.helfoome.presentation.drawer.MyReviewActivity import org.helfoome.presentation.scrap.MyScrapActivity import org.helfoome.presentation.drawer.ProfileModifyActivity @@ -38,12 +39,16 @@ import org.helfoome.presentation.type.FoodType import org.helfoome.presentation.type.HashtagViewType import org.helfoome.util.ChipFactory import org.helfoome.util.DialogUtil +import org.helfoome.util.ResolutionMetrics import org.helfoome.util.binding.BindingActivity import org.helfoome.util.ext.stringListFrom import timber.log.Timber +import javax.inject.Inject @AndroidEntryPoint class MainActivity : BindingActivity(R.layout.activity_main), OnMapReadyCallback { + @Inject + lateinit var resolutionMetrics: ResolutionMetrics private val String.toChip: Chip get() = ChipFactory.create(layoutInflater).also { it.text = this } private val viewModel: MainViewModel by viewModels() @@ -144,6 +149,7 @@ class MainActivity : BindingActivity(R.layout.activity_main private fun initView() { behavior = BottomSheetBehavior.from(binding.layoutBottomSheet) behavior.state = BottomSheetBehavior.STATE_HIDDEN + binding.layoutDrawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED) with(binding.layoutRestaurantDialog) { vpRestaurantDetail.adapter = restaurantDetailAdapter @@ -219,8 +225,8 @@ class MainActivity : BindingActivity(R.layout.activity_main startActivity(Intent(this@MainActivity, SettingActivity::class.java)) } tvLogout.setOnClickListener { - val bind = LogoutDialogBinding.inflate(LayoutInflater.from(this@MainActivity)) - val dialog = DialogUtil.makeDialog(this@MainActivity, bind, 288, 241) + val bind = DialogLogoutBinding.inflate(LayoutInflater.from(this@MainActivity)) + val dialog = DialogUtil.makeDialog(this@MainActivity, bind, resolutionMetrics.toPixel(288), resolutionMetrics.toPixel(241)) bind.btnYes.setOnClickListener { NaverIdLoginSDK.logout() @@ -308,7 +314,6 @@ class MainActivity : BindingActivity(R.layout.activity_main override fun onStop() { super.onStop() - binding.layoutDrawer.closeDrawers() behavior.removeBottomSheetCallback(bottomSheetCallback) binding.layoutRestaurantDialog.layoutRestaurantTabMenu.removeOnTabSelectedListener(listener) binding.layoutRestaurantDialog.layoutAppBar.removeOnOffsetChangedListener(appbarOffsetListener) diff --git a/app/src/main/java/org/helfoome/presentation/WithdrawalActivity.kt b/app/src/main/java/org/helfoome/presentation/WithdrawalActivity.kt index 76a477a6..e72aad10 100644 --- a/app/src/main/java/org/helfoome/presentation/WithdrawalActivity.kt +++ b/app/src/main/java/org/helfoome/presentation/WithdrawalActivity.kt @@ -4,22 +4,36 @@ import android.content.Intent import android.os.Bundle import android.view.LayoutInflater import androidx.activity.viewModels +import dagger.hilt.android.AndroidEntryPoint import org.helfoome.R import org.helfoome.databinding.ActivityWithdrawalBinding -import org.helfoome.databinding.WithdrawDialogBinding +import org.helfoome.databinding.DialogWithdrawBinding import org.helfoome.util.DialogUtil +import org.helfoome.util.ResolutionMetrics import org.helfoome.util.binding.BindingActivity +import javax.inject.Inject +@AndroidEntryPoint class WithdrawalActivity : BindingActivity(R.layout.activity_withdrawal) { + @Inject + lateinit var resolutionMetrics: ResolutionMetrics private val withdrawalViewModel: WithdrawalViewModel by viewModels() override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding.viewModel = withdrawalViewModel + initListener() + } + + private fun initListener() { + binding.ivBack.setOnClickListener { + finish() + } + binding.btConfirm.setOnClickListener { - val bind: WithdrawDialogBinding = WithdrawDialogBinding.inflate(LayoutInflater.from(this@WithdrawalActivity)) - val dialog = DialogUtil.makeDialog(this, bind, 288, 222) + val bind = DialogWithdrawBinding.inflate(LayoutInflater.from(this@WithdrawalActivity)) + val dialog = DialogUtil.makeDialog(this, bind, resolutionMetrics.toPixel(288), resolutionMetrics.toPixel(222)) bind.btnYes.setOnClickListener { startActivity(Intent(this@WithdrawalActivity, LoginActivity::class.java)) diff --git a/app/src/main/java/org/helfoome/presentation/drawer/MyReviewActivity.kt b/app/src/main/java/org/helfoome/presentation/drawer/MyReviewActivity.kt index 0781bbe7..ac265bfe 100644 --- a/app/src/main/java/org/helfoome/presentation/drawer/MyReviewActivity.kt +++ b/app/src/main/java/org/helfoome/presentation/drawer/MyReviewActivity.kt @@ -3,9 +3,10 @@ package org.helfoome.presentation.drawer import android.os.Bundle import android.view.LayoutInflater import android.view.View +import dagger.hilt.android.AndroidEntryPoint import org.helfoome.R import org.helfoome.databinding.ActivityMyReviewBinding -import org.helfoome.databinding.MyreviewDialogBinding +import org.helfoome.databinding.DialogMyreviewBinding import org.helfoome.domain.entity.MyReviewInfo import org.helfoome.presentation.MainActivity import org.helfoome.presentation.drawer.adapter.MyReviewAdapter @@ -13,10 +14,15 @@ import org.helfoome.presentation.drawer.adapter.MyReviewAdapter.Companion.DELETE import org.helfoome.presentation.drawer.adapter.MyReviewAdapter.Companion.EDIT import org.helfoome.presentation.drawer.adapter.MyReviewAdapter.Companion.ENLARGE import org.helfoome.util.DialogUtil +import org.helfoome.util.ResolutionMetrics import org.helfoome.util.binding.BindingActivity import org.helfoome.util.ext.startActivity +import javax.inject.Inject +@AndroidEntryPoint class MyReviewActivity : BindingActivity(R.layout.activity_my_review) { + @Inject + lateinit var resolutionMetrics: ResolutionMetrics private val myReviewAdapter = MyReviewAdapter { adapterClickListener(it) @@ -48,8 +54,8 @@ class MyReviewActivity : BindingActivity(R.layout.activ startActivity() } DELETE -> { - val bind = MyreviewDialogBinding.inflate(LayoutInflater.from(this@MyReviewActivity)) - val dialog = DialogUtil.makeDialog(this, bind, 288, 223) + val bind = DialogMyreviewBinding.inflate(LayoutInflater.from(this@MyReviewActivity)) + val dialog = DialogUtil.makeDialog(this, bind, resolutionMetrics.toPixel(288), resolutionMetrics.toPixel(223)) bind.btnYes.setOnClickListener { dialog.dismiss() @@ -79,6 +85,9 @@ class MyReviewActivity : BindingActivity(R.layout.activ } private fun initListeners() { + binding.ivBack.setOnClickListener { + finish() + } binding.btnGoToStore.setOnClickListener { finish() } diff --git a/app/src/main/java/org/helfoome/presentation/drawer/ProfileModifyActivity.kt b/app/src/main/java/org/helfoome/presentation/drawer/ProfileModifyActivity.kt index 477d8f87..68e3b0fa 100644 --- a/app/src/main/java/org/helfoome/presentation/drawer/ProfileModifyActivity.kt +++ b/app/src/main/java/org/helfoome/presentation/drawer/ProfileModifyActivity.kt @@ -30,6 +30,10 @@ class ProfileModifyActivity : BindingActivity(R.la } private fun initListener() { + binding.ivBack.setOnClickListener { + finish() + } + binding.btModify.setOnClickListener { viewModel.checkNicknameFormat() // 중복 닉네임 체크 먼저 하기 diff --git a/app/src/main/java/org/helfoome/presentation/drawer/SettingActivity.kt b/app/src/main/java/org/helfoome/presentation/drawer/SettingActivity.kt index 9fd3378c..100a299b 100644 --- a/app/src/main/java/org/helfoome/presentation/drawer/SettingActivity.kt +++ b/app/src/main/java/org/helfoome/presentation/drawer/SettingActivity.kt @@ -11,8 +11,15 @@ class SettingActivity : BindingActivity(R.layout.activit override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + initListener() + } + + private fun initListener() { binding.tvWithdrawal.setOnClickListener { startActivity(Intent(this, WithdrawalActivity::class.java)) } + binding.ivBack.setOnClickListener { + finish() + } } } diff --git a/app/src/main/java/org/helfoome/presentation/type/FoodType.kt b/app/src/main/java/org/helfoome/presentation/type/FoodType.kt index 0a56b8f7..5c312dce 100644 --- a/app/src/main/java/org/helfoome/presentation/type/FoodType.kt +++ b/app/src/main/java/org/helfoome/presentation/type/FoodType.kt @@ -5,10 +5,10 @@ import org.helfoome.R enum class FoodType(val color: Int, val icon: Int, val iconTint: Int) { FOOD_SALAD(R.color.selector_chip_bg_diet, R.drawable.ic_salad, R.color.selector_chip_icon_diet), FOOD_POKE(R.color.selector_chip_bg_diet, R.drawable.ic_poke, R.color.selector_chip_icon_diet), + FOOD_QUITO(R.color.selector_chip_bg_diet, R.drawable.ic_kimbap, R.color.selector_chip_icon_diet), FOOD_SANDWICH(R.color.selector_chip_bg_normal, R.drawable.ic_sandwich, R.color.selector_chip_icon_normal), FOOD_SHABU(R.color.selector_chip_bg_normal, R.drawable.ic_shabushabu, R.color.selector_chip_icon_normal), FOOD_BOSAM(R.color.selector_chip_bg_normal, R.drawable.ic_bossam, R.color.selector_chip_icon_normal), FOOD_MEAT(R.color.selector_chip_bg_normal, R.drawable.ic_meat, R.color.selector_chip_icon_normal), - FOOD_RICEBOWL(R.color.selector_chip_bg_normal, R.drawable.ic_dupbap, R.color.selector_chip_icon_normal), - FOOD_QUITO(R.color.selector_chip_bg_diet, R.drawable.ic_kimbap, R.color.selector_chip_icon_diet) + FOOD_RICEBOWL(R.color.selector_chip_bg_normal, R.drawable.ic_dupbap, R.color.selector_chip_icon_normal) } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 39f31020..e5544880 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -114,6 +114,7 @@ android:backgroundTint="@color/white" android:src="@drawable/ic_currentposition" app:borderWidth="0dp" + app:layout_dodgeInsetEdges="bottom" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" /> diff --git a/app/src/main/res/layout/activity_main_drawer_header.xml b/app/src/main/res/layout/activity_main_drawer_header.xml index 35b91632..590c9f87 100644 --- a/app/src/main/res/layout/activity_main_drawer_header.xml +++ b/app/src/main/res/layout/activity_main_drawer_header.xml @@ -17,6 +17,7 @@ android:layout_height="wrap_content" android:layout_marginStart="20dp" android:layout_marginTop="64dp" + android:lineSpacingExtra="3dp" android:text="@string/main_drawer_welcome" android:textSize="16sp" app:layout_constraintStart_toStartOf="parent" diff --git a/app/src/main/res/layout/activity_profile_modify.xml b/app/src/main/res/layout/activity_profile_modify.xml index 227729df..51f52d75 100644 --- a/app/src/main/res/layout/activity_profile_modify.xml +++ b/app/src/main/res/layout/activity_profile_modify.xml @@ -17,6 +17,7 @@ tools:context=".presentation.drawer.ProfileModifyActivity"> + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_setting.xml b/app/src/main/res/layout/activity_setting.xml index 961cd424..2cc92481 100644 --- a/app/src/main/res/layout/activity_setting.xml +++ b/app/src/main/res/layout/activity_setting.xml @@ -13,6 +13,7 @@ tools:context=".presentation.drawer.SettingActivity"> + + + app:layout_constraintTop_toBottomOf="@id/tv_declaration" /> + + + + + + + + + + + diff --git a/app/src/main/res/layout/myreview_dialog.xml b/app/src/main/res/layout/dialog_myreview.xml similarity index 100% rename from app/src/main/res/layout/myreview_dialog.xml rename to app/src/main/res/layout/dialog_myreview.xml diff --git a/app/src/main/res/layout/withdraw_dialog.xml b/app/src/main/res/layout/dialog_withdraw.xml similarity index 100% rename from app/src/main/res/layout/withdraw_dialog.xml rename to app/src/main/res/layout/dialog_withdraw.xml diff --git a/app/src/main/res/layout/logout_dialog.xml b/app/src/main/res/layout/logout_dialog.xml deleted file mode 100644 index 5c623f81..00000000 --- a/app/src/main/res/layout/logout_dialog.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 6cbe9503..1da37cd6 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -9,12 +9,13 @@ 샐러드 포케 - 샌드위치 + 키토김밥 샤브샤브 보쌈 고깃집 덮밥 - 키토김밥 + 샌드위치 + 프로필 편집 @@ -39,6 +40,7 @@ 고객지원 문의하기 회원탈퇴 + 신고하기 약관 및 정책 오픈 소스 정보 네이버 지도 법적 공지 @@ -52,12 +54,12 @@ @string/main_chip_group_salad @string/main_chip_group_poke + @string/main_chip_group_quito @string/main_chip_group_sandwich @string/main_chip_group_shabu @string/main_chip_group_bosam @string/main_chip_group_meat @string/main_chip_group_ricebowl - @string/main_chip_group_quito