From b8ed5e755b1aefc0c897c325721b5960af46614f Mon Sep 17 00:00:00 2001 From: Seulgi Kim <7d4z7l@gmail.com> Date: Fri, 5 Mar 2021 11:48:14 +0900 Subject: [PATCH 1/6] [ADD] #92 - KeywordActivity, KeywordSelectFragment --- app/release/output-metadata.json | 18 +++++ app/src/main/AndroidManifest.xml | 34 ++++---- .../ui/view/keyword/KeywordActivity.kt | 29 +++++++ .../ui/view/keyword/KeywordSelectFragment.kt | 31 ++++++++ app/src/main/res/layout/activity_keyword.xml | 25 ++++++ .../res/layout/fragment_keyword_select.xml | 78 +++++++++++++++++++ app/src/main/res/values/strings.xml | 10 ++- 7 files changed, 207 insertions(+), 18 deletions(-) create mode 100644 app/release/output-metadata.json create mode 100644 app/src/main/java/org/mydaily/ui/view/keyword/KeywordActivity.kt create mode 100644 app/src/main/java/org/mydaily/ui/view/keyword/KeywordSelectFragment.kt create mode 100644 app/src/main/res/layout/activity_keyword.xml create mode 100644 app/src/main/res/layout/fragment_keyword_select.xml diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json new file mode 100644 index 0000000..0ab7cc8 --- /dev/null +++ b/app/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "org.mydaily", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 1, + "versionName": "1.0.0", + "outputFile": "app-release.apk" + } + ] +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 1cbfae5..c119032 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -13,8 +13,10 @@ android:supportsRtl="true" android:theme="@style/Theme.MyDaily" android:usesCleartextTraffic="true"> - - + + @@ -28,7 +30,7 @@ android:exported="true" /> + android:windowSoftInputMode="adjustResize" /> @@ -38,38 +40,36 @@ android:windowSoftInputMode="stateAlwaysHidden" /> - + android:windowSoftInputMode="stateAlwaysHidden" /> + - + android:exported="true" + android:windowSoftInputMode="adjustResize"> + android:windowSoftInputMode="adjustResize" /> + android:windowSoftInputMode="adjustResize" /> + android:windowSoftInputMode="adjustResize" /> - - - - + + \ No newline at end of file diff --git a/app/src/main/java/org/mydaily/ui/view/keyword/KeywordActivity.kt b/app/src/main/java/org/mydaily/ui/view/keyword/KeywordActivity.kt new file mode 100644 index 0000000..14e8f8f --- /dev/null +++ b/app/src/main/java/org/mydaily/ui/view/keyword/KeywordActivity.kt @@ -0,0 +1,29 @@ +package org.mydaily.ui.view.keyword + +import org.koin.androidx.viewmodel.ext.android.viewModel +import org.mydaily.R +import org.mydaily.databinding.ActivityKeywordBinding +import org.mydaily.ui.base.BaseActivity +import org.mydaily.ui.view.task.TaskFragment +import org.mydaily.ui.viewmodel.KeywordViewModel +import org.mydaily.util.extension.replace + +class KeywordActivity : BaseActivity() { + override val layoutResourceId: Int + get() = R.layout.activity_keyword + override val viewModel: KeywordViewModel by viewModel() + + private val selectFragment: KeywordSelectFragment by lazy { KeywordSelectFragment() } + + override fun initView() { + replace(R.id.container_keyword, selectFragment) + } + + override fun initBeforeBinding() { + + } + + override fun initAfterBinding() { + + } +} \ No newline at end of file diff --git a/app/src/main/java/org/mydaily/ui/view/keyword/KeywordSelectFragment.kt b/app/src/main/java/org/mydaily/ui/view/keyword/KeywordSelectFragment.kt new file mode 100644 index 0000000..b6a45a9 --- /dev/null +++ b/app/src/main/java/org/mydaily/ui/view/keyword/KeywordSelectFragment.kt @@ -0,0 +1,31 @@ +package org.mydaily.ui.view.keyword + +import org.koin.androidx.viewmodel.ext.android.viewModel +import org.mydaily.R +import org.mydaily.databinding.FragmentKeywordSelectBinding +import org.mydaily.ui.base.BaseFragment +import org.mydaily.ui.viewmodel.KeywordViewModel + +class KeywordSelectFragment : BaseFragment() { + override val layoutResourceId: Int + get() = R.layout.fragment_keyword_select + override val viewModel: KeywordViewModel by viewModel() + + override fun initView() { + initClickEvent() + } + + override fun initBeforeBinding() { + + } + + override fun initAfterBinding() { + + } + + private fun initClickEvent() { + binding.tvSelectMethod.setOnClickListener { + + } + } +} \ No newline at end of file diff --git a/app/src/main/res/layout/activity_keyword.xml b/app/src/main/res/layout/activity_keyword.xml new file mode 100644 index 0000000..5358cdd --- /dev/null +++ b/app/src/main/res/layout/activity_keyword.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_keyword_select.xml b/app/src/main/res/layout/fragment_keyword_select.xml new file mode 100644 index 0000000..c72975b --- /dev/null +++ b/app/src/main/res/layout/fragment_keyword_select.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + \ 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 17884cc..56ecc9b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -68,7 +68,7 @@ 정말 뒤로가시겠어요? 뒤로가기를 누르시면 작성 중인 내용이\n사라지고 이전 페이지로 돌아갑니다. 뒤로가기를 누르시면 수정사항이\n삭제되고 이전 페이지로 돌아갑니다. - 회고 + 회고 삭제하기 취소하기 뒤로가기 @@ -195,4 +195,12 @@ 내 삶의 지향점이 될\n가치관을 정해보세요 가치관에 가까워지기 위한\n일상의 행동을 기록해보세요 한 주간의 행동을 회고하면서\n더 나은 내일을 꿈꿔보세요 + + + + 키워드 생성 + 핵심가치를 정하기 위한\n방법을 선택해주세요! + 가이드 따라가기 + 직접 추가하기 + \ No newline at end of file From c555b1bb20167663d8e3c94db015a01c14bdc736 Mon Sep 17 00:00:00 2001 From: Seulgi Kim <7d4z7l@gmail.com> Date: Fri, 5 Mar 2021 12:14:37 +0900 Subject: [PATCH 2/6] [CHORE] #92 - move KeywordListActivity.kt -> KeywordGuideSelectFragment.kt --- app/src/main/AndroidManifest.xml | 9 +- .../ui/view/keyword/KeywordListActivity.kt | 264 ------------------ .../ui/view/keyword/KeywordSelectFragment.kt | 6 +- .../guide/KeywordGuideSelectFragment.kt | 129 +++++++++ .../{ => guide}/KeywordSelectActivity.kt | 2 +- .../mydaily/ui/view/user/SignInActivity.kt | 4 +- .../res/layout/activity_keyword_select.xml | 2 +- ....xml => fragment_keyword_guide_select.xml} | 69 +---- .../res/layout/fragment_keyword_select.xml | 2 +- app/src/main/res/values/strings.xml | 4 +- 10 files changed, 149 insertions(+), 342 deletions(-) delete mode 100644 app/src/main/java/org/mydaily/ui/view/keyword/KeywordListActivity.kt create mode 100644 app/src/main/java/org/mydaily/ui/view/keyword/guide/KeywordGuideSelectFragment.kt rename app/src/main/java/org/mydaily/ui/view/keyword/{ => guide}/KeywordSelectActivity.kt (99%) rename app/src/main/res/layout/{activity_keyword_list.xml => fragment_keyword_guide_select.xml} (67%) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c119032..a5372d9 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -13,7 +13,8 @@ android:supportsRtl="true" android:theme="@style/Theme.MyDaily" android:usesCleartextTraffic="true"> - + - () { - - private var clickedChipCount: Int = 0 - private var myWordChipCount: Int = 0 - private var addedMyWord = arrayListOf() - private var selectedLifeWord = arrayListOf() - private var selectedWorkWord = arrayListOf() - private var selectedMyWord = arrayListOf() - - override val layoutResourceId: Int - get() = R.layout.activity_keyword_list - override val viewModel: KeywordViewModel by viewModel() - - override fun initView() { - initToolbar() - initAddButton() - //initMyWordText() - //initModifyCompleteButton() - //onClickModifyButton() - //onClickCompleteButton() - onClickSelectFinishButton() - } - - private fun initMyWordText() { - if(binding.cgMyWord.childCount == 1) { - binding.tvMyWord.setTextColor(getColor(R.color.mainBlack)) - } else { - binding.tvMyWord.setTextColor(getColor(R.color.persimmon)) - } - } - -// private fun onClickedCompleteButtonState() { -// TODO -> 완료 버튼 눌렀을 때 상태 세팅 -// } -// -// private fun onClickModifyButtonState() { -// TODO -> 수정 버튼 눌렀을 때 상태 세팅 -// } - - private fun addKeywordList(text: String) { - if (viewModel.lifeWordList.value!!.contains(text)) { - selectedLifeWord.add(text) - } else if (viewModel.workWordList.value!!.contains(text)) { - selectedWorkWord.add(text) - } else if (addedMyWord.contains(text)) { - selectedMyWord.add(text) - } - } - - private fun removeKeywordList(text: String) { - if (viewModel.lifeWordList.value!!.contains(text)) { - selectedLifeWord.remove(text) - } else if (viewModel.workWordList.value!!.contains(text)) { - selectedWorkWord.remove(text) - } else if (addedMyWord.contains(text)) { - selectedMyWord.remove(text) - } - } - - private fun floatingDialog() { - AlertDialog.Builder(this) - .setTitle(R.string.up_to_eight) - .setMessage(R.string.too_many_keyword_selected) - .setPositiveButton("확인", null) - .create() - .show() - } - -// private fun setCompleteState() { -// binding.tvModify.visibility = View.GONE -// binding.tvComplete.visibility = View.VISIBLE -// } -// -// private fun setModifyState() { -// if (myWordChipCount > 0) { -// binding.tvModify.visibility = View.VISIBLE -// binding.tvComplete.visibility = View.GONE -// } -// } - -// private fun initModifyCompleteButton() { -// binding.tvModify.visibility = View.GONE -// binding.tvComplete.visibility = View.GONE -// } - - override fun initBeforeBinding() { - binding.lifecycleOwner = this - viewModel.getLifeWord() - viewModel.getWorkWord() - } - - override fun initAfterBinding() { - observeLifeWordList() - observeWorkWordList() - } - - private fun initToolbar() { - setSupportActionBar(binding.tbKeywordListActivity) - supportActionBar?.setDisplayShowTitleEnabled(false) - supportActionBar?.setBackgroundDrawable( - ColorDrawable( - ContextCompat.getColor( - this, - R.color.white - ) - ) - ) - binding.tbKeywordListActivity.setNavigationOnClickListener { - finish() - } - } - - private fun initAddButton() { - binding.chipAdd.setOnClickListener { - myWordChipCount++ - val intent = Intent(this, KeywordAddActivity::class.java) - intent.putStringArrayListExtra("MyWordList", addedMyWord) - startActivityForResult(intent, 1004) - } - } - - override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { - super.onActivityResult(requestCode, resultCode, data) - if (requestCode == 1004) { - if (resultCode == 1005) { - if (data?.getStringExtra("MyWord") != null) { - addedMyWord.add(data.getStringExtra("MyWord")!!) - addMyWordList() - initMyWordText() - } - } - } - } - - private fun observeLifeWordList() { - viewModel.lifeWordList.observe(this, { list -> - for (str in list) { - binding.cgLife.addView(createChip(str)) - } - }) - } - - private fun observeWorkWordList() { - viewModel.workWordList.observe(this, { list -> - for (str in list) { - binding.cgWork.addView(createChip(str)) - } - }) - } - - private fun addMyWordList() { - binding.cgMyWord.addView( - createChip(addedMyWord.last().toString()), - binding.cgMyWord.childCount - 1 - ) - } - - private fun createChip(str: String): Chip { - val chipDrawable = ChipDrawable.createFromAttributes( - this, - null, - 0, - R.style.Widget_MaterialComponents_Chip_Choice - ) - return Chip(this).apply { - text = str - setChipDrawable(chipDrawable) - setChipBackgroundColorResource(R.color.selector_chip) - setTextAppearance(R.style.MyDailyChipTextStyleAppearance) - setRippleColorResource(android.R.color.transparent) - setOnClickListener { - it as Chip - if (isChecked) { //주황색일 때 - clickedChipCount++ - if (clickedChipCount >= 9) { - binding.btnSelectFinish.isEnabled = true - it.isChecked = false - clickedChipCount-- - floatingDialog() - } else if (clickedChipCount == 8) { - addKeywordList(it.text as String) - binding.btnSelectFinish.isEnabled = true - } else { - addKeywordList(it.text as String) - binding.btnSelectFinish.isEnabled = false - } - } else { - clickedChipCount-- - if (clickedChipCount < 8) { - binding.btnSelectFinish.isEnabled = false - } - removeKeywordList(it.text as String) - } - } - } - } - - override fun onOptionsItemSelected(item: MenuItem): Boolean { - return when (item.itemId) { - R.id.menu_help -> { - val intent = Intent(this, KeywordPopupActivity::class.java) - startActivity(intent) - true - } - else -> super.onOptionsItemSelected(item) - } - } - - override fun onCreateOptionsMenu(menu: Menu?): Boolean { - menuInflater.inflate(R.menu.menu_keyword_list, menu) - return true - } - -// private fun onClickModifyButton() { -// binding.tvModify.setOnClickListener { -// setCompleteState() -// onClickModifyButtonState() -// binding.btnSelectFinish.visibility = View.GONE -// } -// } - -// private fun onClickCompleteButton() { -// binding.tvComplete.setOnClickListener { -// setModifyState() -// onClickedCompleteButtonState() -// binding.btnSelectFinish.visibility = View.VISIBLE -// } -// } - - private fun onClickSelectFinishButton() { - binding.btnSelectFinish.setOnClickListener { - val intent = Intent(this, KeywordSelectActivity::class.java) - intent.putStringArrayListExtra("selectedlifeword", selectedLifeWord) - intent.putStringArrayListExtra("selectedworkword", selectedWorkWord) - intent.putStringArrayListExtra("selectedmyword", selectedMyWord) - startActivity(intent) - } - } - -// override fun onResume() { -// super.onResume() -// setModifyState() -// } -} \ No newline at end of file diff --git a/app/src/main/java/org/mydaily/ui/view/keyword/KeywordSelectFragment.kt b/app/src/main/java/org/mydaily/ui/view/keyword/KeywordSelectFragment.kt index b6a45a9..b24e2d5 100644 --- a/app/src/main/java/org/mydaily/ui/view/keyword/KeywordSelectFragment.kt +++ b/app/src/main/java/org/mydaily/ui/view/keyword/KeywordSelectFragment.kt @@ -4,7 +4,9 @@ import org.koin.androidx.viewmodel.ext.android.viewModel import org.mydaily.R import org.mydaily.databinding.FragmentKeywordSelectBinding import org.mydaily.ui.base.BaseFragment +import org.mydaily.ui.view.keyword.guide.KeywordGuideSelectFragment import org.mydaily.ui.viewmodel.KeywordViewModel +import org.mydaily.util.extension.replace class KeywordSelectFragment : BaseFragment() { override val layoutResourceId: Int @@ -24,8 +26,8 @@ class KeywordSelectFragment : BaseFragment() { + + private var clickedChipCount: Int = 0 + private var addedMyWord = arrayListOf() + private var selectedLifeWord = arrayListOf() + private var selectedWorkWord = arrayListOf() + private var selectedMyWord = arrayListOf() + + override val layoutResourceId: Int + get() = R.layout.fragment_keyword_guide_select + override val viewModel: KeywordViewModel by viewModel() + + override fun initView() { + initToolbar() + } + + override fun initBeforeBinding() { + binding.lifecycleOwner = viewLifecycleOwner + viewModel.getLifeWord() + viewModel.getWorkWord() + } + + override fun initAfterBinding() { + observeLifeWordList() + observeWorkWordList() + } + + private fun initToolbar() { + + } + + private fun addKeywordList(text: String) { + if (viewModel.lifeWordList.value!!.contains(text)) { + selectedLifeWord.add(text) + } else if (viewModel.workWordList.value!!.contains(text)) { + selectedWorkWord.add(text) + } else if (addedMyWord.contains(text)) { + selectedMyWord.add(text) + } + } + + private fun removeKeywordList(text: String) { + if (viewModel.lifeWordList.value!!.contains(text)) { + selectedLifeWord.remove(text) + } else if (viewModel.workWordList.value!!.contains(text)) { + selectedWorkWord.remove(text) + } else if (addedMyWord.contains(text)) { + selectedMyWord.remove(text) + } + } + + private fun floatingDialog() { + AlertDialog.Builder(context) + .setTitle(R.string.up_to_eight) + .setMessage(R.string.too_many_keyword_selected) + .setPositiveButton("확인", null) + .create() + .show() + } + + + private fun observeLifeWordList() { + viewModel.lifeWordList.observe(this, { list -> + for (str in list) { + binding.cgLife.addView(createChip(str)) + } + }) + } + + private fun observeWorkWordList() { + viewModel.workWordList.observe(this, { list -> + for (str in list) { + binding.cgWork.addView(createChip(str)) + } + }) + } + + private fun createChip(str: String): Chip { + val chipDrawable = ChipDrawable.createFromAttributes( + requireContext(), + null, + 0, + R.style.Widget_MaterialComponents_Chip_Choice + ) + return Chip(requireContext()).apply { + text = str + setChipDrawable(chipDrawable) + setChipBackgroundColorResource(R.color.selector_chip) + setTextAppearance(R.style.MyDailyChipTextStyleAppearance) + setRippleColorResource(android.R.color.transparent) + setOnClickListener { + it as Chip + if (isChecked) { //주황색일 때 + clickedChipCount++ + if (clickedChipCount >= 9) { + binding.btnSelectFinish.isEnabled = true + it.isChecked = false + clickedChipCount-- + floatingDialog() + } else if (clickedChipCount == 8) { + addKeywordList(it.text as String) + binding.btnSelectFinish.isEnabled = true + } else { + addKeywordList(it.text as String) + binding.btnSelectFinish.isEnabled = false + } + } else { + clickedChipCount-- + if (clickedChipCount < 8) { + binding.btnSelectFinish.isEnabled = false + } + removeKeywordList(it.text as String) + } + } + } + } +} \ No newline at end of file diff --git a/app/src/main/java/org/mydaily/ui/view/keyword/KeywordSelectActivity.kt b/app/src/main/java/org/mydaily/ui/view/keyword/guide/KeywordSelectActivity.kt similarity index 99% rename from app/src/main/java/org/mydaily/ui/view/keyword/KeywordSelectActivity.kt rename to app/src/main/java/org/mydaily/ui/view/keyword/guide/KeywordSelectActivity.kt index 649dc1e..da1d10b 100644 --- a/app/src/main/java/org/mydaily/ui/view/keyword/KeywordSelectActivity.kt +++ b/app/src/main/java/org/mydaily/ui/view/keyword/guide/KeywordSelectActivity.kt @@ -1,4 +1,4 @@ -package org.mydaily.ui.view.keyword +package org.mydaily.ui.view.keyword.guide import android.app.AlertDialog import android.content.Intent diff --git a/app/src/main/java/org/mydaily/ui/view/user/SignInActivity.kt b/app/src/main/java/org/mydaily/ui/view/user/SignInActivity.kt index 8c2842c..83dfcf3 100644 --- a/app/src/main/java/org/mydaily/ui/view/user/SignInActivity.kt +++ b/app/src/main/java/org/mydaily/ui/view/user/SignInActivity.kt @@ -16,7 +16,7 @@ import org.mydaily.data.local.FourMostPreference.setKeywordExist import org.mydaily.databinding.ActivitySignInBinding import org.mydaily.ui.base.BaseActivity import org.mydaily.ui.view.MainActivity -import org.mydaily.ui.view.keyword.KeywordListActivity +import org.mydaily.ui.view.keyword.guide.KeywordGuideSelectFragment import org.mydaily.ui.viewmodel.UserViewModel import org.mydaily.util.EventObserver import org.mydaily.util.LoginPatternCheckUtil @@ -160,7 +160,7 @@ class SignInActivity : BaseActivity() { } private fun startKeywordListActivity() { - startActivity(Intent(this, KeywordListActivity::class.java)) + startActivity(Intent(this, KeywordGuideSelectFragment::class.java)) finish() } } \ No newline at end of file diff --git a/app/src/main/res/layout/activity_keyword_select.xml b/app/src/main/res/layout/activity_keyword_select.xml index a41e471..cf34585 100644 --- a/app/src/main/res/layout/activity_keyword_select.xml +++ b/app/src/main/res/layout/activity_keyword_select.xml @@ -10,7 +10,7 @@ + tools:context=".ui.view.keyword.guide.KeywordSelectActivity"> + tools:context=".ui.view.keyword.guide.KeywordGuideSelectFragment"> @@ -39,16 +39,17 @@ android:id="@+id/sv_keyword_list" android:layout_width="match_parent" android:layout_height="0dp" + android:layout_marginBottom="16dp" app:layout_constraintBottom_toTopOf="@+id/btn_select_finish" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/tb_keyword_list_activity"> + app:layout_constraintTop_toBottomOf="@+id/tb_keyword_guide_select"> + android:paddingBottom="56dp"> - - - - - - - - - - - - diff --git a/app/src/main/res/layout/fragment_keyword_select.xml b/app/src/main/res/layout/fragment_keyword_select.xml index c72975b..5420e62 100644 --- a/app/src/main/res/layout/fragment_keyword_select.xml +++ b/app/src/main/res/layout/fragment_keyword_select.xml @@ -37,7 +37,7 @@ 이미 생성 된 단어에요! "^[ㄱ-ㅎ가-힣 \u318D\u119E\u11A2\u2022\u2025\u00B7\uFE55]*$" - + 키워드 설정하기 삶에서 중요하게\n생각하는 가치는 무엇인가요? 먼저 8개의 키워드를 선택해보세요! @@ -146,7 +146,7 @@ 자기 분야에서 만큼은 탁월했던 사람\n가까운 주변 사람들에게 사랑 받는 사람 - 키워드 선택하기 + 키워드 선택 선택한 가치 중에서\n더 중요한 것을 골라보세요 최종 키워드를 최대 4개까지 골라보세요! 4개까지 선택 가능해요! From 0b54b1b131372e04822bea6b97da93a84d0af790 Mon Sep 17 00:00:00 2001 From: Seulgi Kim <7d4z7l@gmail.com> Date: Fri, 5 Mar 2021 12:18:47 +0900 Subject: [PATCH 3/6] [CHORE] #92 - move KeywordSelectActivity.kt.kt -> KeywordGuideSelectDeepFragment.kt --- app/src/main/AndroidManifest.xml | 2 +- ...y.kt => KeywordGuideSelectDeepFragment.kt} | 80 +++---------------- .../guide/KeywordGuideSelectFragment.kt | 4 + ...=> fragment_keyword_guide_select_deep.xml} | 30 +------ app/src/main/res/values/strings.xml | 2 +- 5 files changed, 18 insertions(+), 100 deletions(-) rename app/src/main/java/org/mydaily/ui/view/keyword/guide/{KeywordSelectActivity.kt => KeywordGuideSelectDeepFragment.kt} (54%) rename app/src/main/res/layout/{activity_keyword_select.xml => fragment_keyword_guide_select_deep.xml} (82%) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index a5372d9..9815592 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -40,7 +40,7 @@ android:exported="true" android:windowSoftInputMode="stateAlwaysHidden" /> () { +class KeywordGuideSelectDeepFragment : + BaseFragment() { override val layoutResourceId: Int - get() = R.layout.activity_keyword_select + get() = R.layout.fragment_keyword_guide_select_deep override val viewModel: KeywordViewModel by viewModel() @@ -33,29 +26,12 @@ class KeywordSelectActivity : BaseActivity { - val intent = Intent(this, KeywordPopupActivity::class.java) - startActivity(intent) - true - } - else -> super.onOptionsItemSelected(item) - } - } - - override fun onCreateOptionsMenu(menu: Menu?): Boolean { - menuInflater.inflate(R.menu.menu_keyword_list, menu) - return true - } - - private fun onClickBtnSelectFinish() { - binding.btnSelectFourFinish.setOnClickListener { - viewModel.postKeywordSelect(keywords) - - val intent = Intent(this, KeywordSettingsActivity::class.java) - intent.putStringArrayListExtra("keywords", keywords as java.util.ArrayList) - startActivity(intent) - } - } } \ No newline at end of file diff --git a/app/src/main/java/org/mydaily/ui/view/keyword/guide/KeywordGuideSelectFragment.kt b/app/src/main/java/org/mydaily/ui/view/keyword/guide/KeywordGuideSelectFragment.kt index 38c22db..4716b80 100644 --- a/app/src/main/java/org/mydaily/ui/view/keyword/guide/KeywordGuideSelectFragment.kt +++ b/app/src/main/java/org/mydaily/ui/view/keyword/guide/KeywordGuideSelectFragment.kt @@ -8,6 +8,7 @@ import org.mydaily.R import org.mydaily.databinding.FragmentKeywordGuideSelectBinding import org.mydaily.ui.base.BaseFragment import org.mydaily.ui.viewmodel.KeywordViewModel +import org.mydaily.util.extension.replace class KeywordGuideSelectFragment : BaseFragment() { @@ -24,6 +25,9 @@ class KeywordGuideSelectFragment : BaseFragment + tools:context=".ui.view.keyword.guide.KeywordGuideSelectDeepFragment"> + android:paddingBottom="56dp"> - - - - - - diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 950f2ff..3e7e087 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -145,7 +145,7 @@ 퇴근 후 관심사가 비슷한 사람들과\n내가 가진 취미, 강점을 나누면서 소통하는 삶 자기 분야에서 만큼은 탁월했던 사람\n가까운 주변 사람들에게 사랑 받는 사람 - + 키워드 선택 선택한 가치 중에서\n더 중요한 것을 골라보세요 최종 키워드를 최대 4개까지 골라보세요! From 570243fa0ed9b9a5cb827728eb5d0c03dea1c85f Mon Sep 17 00:00:00 2001 From: Seulgi Kim <7d4z7l@gmail.com> Date: Fri, 5 Mar 2021 12:19:54 +0900 Subject: [PATCH 4/6] [FIX] #92 - delete previous KeywordSelectActivity in Manifest --- app/src/main/AndroidManifest.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 9815592..a599f77 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -39,10 +39,6 @@ android:name=".ui.view.keyword.popup.KeywordPopupActivity" android:exported="true" android:windowSoftInputMode="stateAlwaysHidden" /> - From c8973163354422fe4068471fad5ac54ea4890b7c Mon Sep 17 00:00:00 2001 From: Seulgi Kim <7d4z7l@gmail.com> Date: Fri, 5 Mar 2021 12:23:57 +0900 Subject: [PATCH 5/6] [CHORE] #92 - modify keyword view structure --- app/src/main/AndroidManifest.xml | 2 +- .../org/mydaily/ui/view/keyword/KeywordActivity.kt | 4 ++-- .../ui/view/keyword/{ => add}/KeywordAddActivity.kt | 5 +---- .../KeywordMethodFragment.kt} | 8 ++++---- .../view/keyword/settings/KeywordSettingsActivity.kt | 2 +- .../settings/{ => define}/KeywordDefineAddFragment.kt | 2 +- .../{ => define}/KeywordDefineDetailFragment.kt | 2 +- .../settings/{ => define}/KeywordDefineFragment.kt | 3 +-- .../{ => priority}/KeywordPriorityFragment.kt | 11 ++--------- app/src/main/res/layout/activity_keyword_add.xml | 2 +- app/src/main/res/layout/fragment_keyword_define.xml | 2 +- .../main/res/layout/fragment_keyword_define_add.xml | 2 +- ...keyword_select.xml => fragment_keyword_method.xml} | 2 +- app/src/main/res/layout/fragment_keyword_priority.xml | 2 +- 14 files changed, 19 insertions(+), 30 deletions(-) rename app/src/main/java/org/mydaily/ui/view/keyword/{ => add}/KeywordAddActivity.kt (97%) rename app/src/main/java/org/mydaily/ui/view/keyword/{KeywordSelectFragment.kt => method/KeywordMethodFragment.kt} (77%) rename app/src/main/java/org/mydaily/ui/view/keyword/settings/{ => define}/KeywordDefineAddFragment.kt (97%) rename app/src/main/java/org/mydaily/ui/view/keyword/settings/{ => define}/KeywordDefineDetailFragment.kt (96%) rename app/src/main/java/org/mydaily/ui/view/keyword/settings/{ => define}/KeywordDefineFragment.kt (98%) rename app/src/main/java/org/mydaily/ui/view/keyword/settings/{ => priority}/KeywordPriorityFragment.kt (87%) rename app/src/main/res/layout/{fragment_keyword_select.xml => fragment_keyword_method.xml} (97%) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index a599f77..d7b29a6 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -33,7 +33,7 @@ android:name=".ui.view.goal.detail.GoalAddActivity" android:windowSoftInputMode="adjustResize" /> () get() = R.layout.activity_keyword override val viewModel: KeywordViewModel by viewModel() - private val selectFragment: KeywordSelectFragment by lazy { KeywordSelectFragment() } + private val selectFragment: KeywordMethodFragment by lazy { KeywordMethodFragment() } override fun initView() { replace(R.id.container_keyword, selectFragment) diff --git a/app/src/main/java/org/mydaily/ui/view/keyword/KeywordAddActivity.kt b/app/src/main/java/org/mydaily/ui/view/keyword/add/KeywordAddActivity.kt similarity index 97% rename from app/src/main/java/org/mydaily/ui/view/keyword/KeywordAddActivity.kt rename to app/src/main/java/org/mydaily/ui/view/keyword/add/KeywordAddActivity.kt index 4de8513..1ed3cc4 100644 --- a/app/src/main/java/org/mydaily/ui/view/keyword/KeywordAddActivity.kt +++ b/app/src/main/java/org/mydaily/ui/view/keyword/add/KeywordAddActivity.kt @@ -1,17 +1,14 @@ -package org.mydaily.ui.view.keyword +package org.mydaily.ui.view.keyword.add import android.content.Intent import android.text.Editable import android.text.TextWatcher -import android.view.KeyEvent import android.view.View -import android.view.inputmethod.InputMethodManager import org.koin.androidx.viewmodel.ext.android.viewModel import org.mydaily.R import org.mydaily.databinding.ActivityKeywordAddBinding import org.mydaily.ui.base.BaseActivity import org.mydaily.ui.viewmodel.KeywordViewModel -import org.mydaily.util.extension.shortToast import java.util.regex.Pattern diff --git a/app/src/main/java/org/mydaily/ui/view/keyword/KeywordSelectFragment.kt b/app/src/main/java/org/mydaily/ui/view/keyword/method/KeywordMethodFragment.kt similarity index 77% rename from app/src/main/java/org/mydaily/ui/view/keyword/KeywordSelectFragment.kt rename to app/src/main/java/org/mydaily/ui/view/keyword/method/KeywordMethodFragment.kt index b24e2d5..4776ddb 100644 --- a/app/src/main/java/org/mydaily/ui/view/keyword/KeywordSelectFragment.kt +++ b/app/src/main/java/org/mydaily/ui/view/keyword/method/KeywordMethodFragment.kt @@ -1,16 +1,16 @@ -package org.mydaily.ui.view.keyword +package org.mydaily.ui.view.keyword.method import org.koin.androidx.viewmodel.ext.android.viewModel import org.mydaily.R -import org.mydaily.databinding.FragmentKeywordSelectBinding +import org.mydaily.databinding.FragmentKeywordMethodBinding import org.mydaily.ui.base.BaseFragment import org.mydaily.ui.view.keyword.guide.KeywordGuideSelectFragment import org.mydaily.ui.viewmodel.KeywordViewModel import org.mydaily.util.extension.replace -class KeywordSelectFragment : BaseFragment() { +class KeywordMethodFragment : BaseFragment() { override val layoutResourceId: Int - get() = R.layout.fragment_keyword_select + get() = R.layout.fragment_keyword_method override val viewModel: KeywordViewModel by viewModel() override fun initView() { diff --git a/app/src/main/java/org/mydaily/ui/view/keyword/settings/KeywordSettingsActivity.kt b/app/src/main/java/org/mydaily/ui/view/keyword/settings/KeywordSettingsActivity.kt index 57cb6ca..5d69d27 100644 --- a/app/src/main/java/org/mydaily/ui/view/keyword/settings/KeywordSettingsActivity.kt +++ b/app/src/main/java/org/mydaily/ui/view/keyword/settings/KeywordSettingsActivity.kt @@ -1,10 +1,10 @@ package org.mydaily.ui.view.keyword.settings -import android.util.Log import org.koin.androidx.viewmodel.ext.android.viewModel import org.mydaily.R import org.mydaily.databinding.ActivityKeywordSettingsBinding import org.mydaily.ui.base.BaseActivity +import org.mydaily.ui.view.keyword.settings.priority.KeywordPriorityFragment import org.mydaily.ui.viewmodel.KeywordViewModel import org.mydaily.util.extension.replace diff --git a/app/src/main/java/org/mydaily/ui/view/keyword/settings/KeywordDefineAddFragment.kt b/app/src/main/java/org/mydaily/ui/view/keyword/settings/define/KeywordDefineAddFragment.kt similarity index 97% rename from app/src/main/java/org/mydaily/ui/view/keyword/settings/KeywordDefineAddFragment.kt rename to app/src/main/java/org/mydaily/ui/view/keyword/settings/define/KeywordDefineAddFragment.kt index 2fe6064..900dd53 100644 --- a/app/src/main/java/org/mydaily/ui/view/keyword/settings/KeywordDefineAddFragment.kt +++ b/app/src/main/java/org/mydaily/ui/view/keyword/settings/define/KeywordDefineAddFragment.kt @@ -1,4 +1,4 @@ -package org.mydaily.ui.view.keyword.settings +package org.mydaily.ui.view.keyword.settings.define import android.os.Bundle import android.util.Log diff --git a/app/src/main/java/org/mydaily/ui/view/keyword/settings/KeywordDefineDetailFragment.kt b/app/src/main/java/org/mydaily/ui/view/keyword/settings/define/KeywordDefineDetailFragment.kt similarity index 96% rename from app/src/main/java/org/mydaily/ui/view/keyword/settings/KeywordDefineDetailFragment.kt rename to app/src/main/java/org/mydaily/ui/view/keyword/settings/define/KeywordDefineDetailFragment.kt index 93c4330..e171da1 100644 --- a/app/src/main/java/org/mydaily/ui/view/keyword/settings/KeywordDefineDetailFragment.kt +++ b/app/src/main/java/org/mydaily/ui/view/keyword/settings/define/KeywordDefineDetailFragment.kt @@ -1,4 +1,4 @@ -package org.mydaily.ui.view.keyword.settings +package org.mydaily.ui.view.keyword.settings.define import org.koin.androidx.viewmodel.ext.android.sharedViewModel import org.koin.androidx.viewmodel.ext.android.viewModel diff --git a/app/src/main/java/org/mydaily/ui/view/keyword/settings/KeywordDefineFragment.kt b/app/src/main/java/org/mydaily/ui/view/keyword/settings/define/KeywordDefineFragment.kt similarity index 98% rename from app/src/main/java/org/mydaily/ui/view/keyword/settings/KeywordDefineFragment.kt rename to app/src/main/java/org/mydaily/ui/view/keyword/settings/define/KeywordDefineFragment.kt index a5cfd6a..0b714c7 100644 --- a/app/src/main/java/org/mydaily/ui/view/keyword/settings/KeywordDefineFragment.kt +++ b/app/src/main/java/org/mydaily/ui/view/keyword/settings/define/KeywordDefineFragment.kt @@ -1,9 +1,8 @@ -package org.mydaily.ui.view.keyword.settings +package org.mydaily.ui.view.keyword.settings.define import android.app.AlertDialog import android.content.Intent import android.os.Bundle -import android.util.Log import androidx.recyclerview.widget.LinearLayoutManager import org.koin.androidx.viewmodel.ext.android.sharedViewModel import org.mydaily.R diff --git a/app/src/main/java/org/mydaily/ui/view/keyword/settings/KeywordPriorityFragment.kt b/app/src/main/java/org/mydaily/ui/view/keyword/settings/priority/KeywordPriorityFragment.kt similarity index 87% rename from app/src/main/java/org/mydaily/ui/view/keyword/settings/KeywordPriorityFragment.kt rename to app/src/main/java/org/mydaily/ui/view/keyword/settings/priority/KeywordPriorityFragment.kt index a72a202..64c8aa1 100644 --- a/app/src/main/java/org/mydaily/ui/view/keyword/settings/KeywordPriorityFragment.kt +++ b/app/src/main/java/org/mydaily/ui/view/keyword/settings/priority/KeywordPriorityFragment.kt @@ -1,26 +1,19 @@ -package org.mydaily.ui.view.keyword.settings +package org.mydaily.ui.view.keyword.settings.priority import android.os.Bundle -import android.util.Log import androidx.core.content.ContextCompat import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.ItemTouchHelper import androidx.recyclerview.widget.LinearLayoutManager -import kotlinx.android.synthetic.main.fragment_remind_write.view.* -import org.koin.android.ext.android.bind import org.koin.androidx.viewmodel.ext.android.sharedViewModel -import org.koin.androidx.viewmodel.ext.android.viewModel import org.mydaily.R -import org.mydaily.data.local.FourMostPreference -import org.mydaily.data.model.domain.KeywordPriority import org.mydaily.data.model.network.request.ReqKeywordPriority import org.mydaily.databinding.FragmentKeywordPriorityBinding import org.mydaily.ui.adapter.ItemTouchHelperCallback import org.mydaily.ui.adapter.KeywordPriorityAdapter -import org.mydaily.ui.adapter.MyPageKeywordPriorityAdapter import org.mydaily.ui.base.BaseFragment +import org.mydaily.ui.view.keyword.settings.define.KeywordDefineFragment import org.mydaily.ui.viewmodel.KeywordViewModel -import org.mydaily.util.extension.replace import org.mydaily.util.extension.replaceAndAddBackStack class KeywordPriorityFragment : BaseFragment() { diff --git a/app/src/main/res/layout/activity_keyword_add.xml b/app/src/main/res/layout/activity_keyword_add.xml index 9334bfb..f5cb390 100644 --- a/app/src/main/res/layout/activity_keyword_add.xml +++ b/app/src/main/res/layout/activity_keyword_add.xml @@ -10,7 +10,7 @@ + tools:context=".ui.view.keyword.add.KeywordAddActivity"> + tools:context=".ui.view.keyword.settings.define.KeywordDefineFragment"> + tools:context=".ui.view.keyword.settings.define.KeywordDefineAddFragment"> + tools:context=".ui.view.keyword.method.KeywordMethodFragment"> + tools:context=".ui.view.keyword.settings.priority.KeywordPriorityFragment"> Date: Fri, 5 Mar 2021 16:41:08 +0900 Subject: [PATCH 6/6] =?UTF-8?q?[FIX]=20#92=20-=20StartActivity=EC=97=90=20?= =?UTF-8?q?Fragment=EA=B0=80=20=EB=93=A4=EC=96=B4=EA=B0=80=EC=9E=88?= =?UTF-8?q?=EB=8D=98=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/org/mydaily/ui/view/user/SignInActivity.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/mydaily/ui/view/user/SignInActivity.kt b/app/src/main/java/org/mydaily/ui/view/user/SignInActivity.kt index 83dfcf3..3d2e433 100644 --- a/app/src/main/java/org/mydaily/ui/view/user/SignInActivity.kt +++ b/app/src/main/java/org/mydaily/ui/view/user/SignInActivity.kt @@ -16,6 +16,7 @@ import org.mydaily.data.local.FourMostPreference.setKeywordExist import org.mydaily.databinding.ActivitySignInBinding import org.mydaily.ui.base.BaseActivity import org.mydaily.ui.view.MainActivity +import org.mydaily.ui.view.keyword.KeywordActivity import org.mydaily.ui.view.keyword.guide.KeywordGuideSelectFragment import org.mydaily.ui.viewmodel.UserViewModel import org.mydaily.util.EventObserver @@ -160,7 +161,7 @@ class SignInActivity : BaseActivity() { } private fun startKeywordListActivity() { - startActivity(Intent(this, KeywordGuideSelectFragment::class.java)) + startActivity(Intent(this, KeywordActivity::class.java)) finish() } } \ No newline at end of file