From aee7b397d9fb5a5273e9a948e27e6b8f5374e2e3 Mon Sep 17 00:00:00 2001 From: dkyuuum Date: Tue, 20 Feb 2024 01:46:11 +0900 Subject: [PATCH] =?UTF-8?q?Design:=20=ED=96=A5=ED=9B=84=EA=B3=84=ED=9A=8D?= =?UTF-8?q?=20ui=20=EA=B8=80=EC=94=A8=EC=B2=B4=20=EC=A0=81=EC=9A=A9=20?= =?UTF-8?q?=EB=B0=8F=20=ED=99=94=EB=A9=B4=20=EC=A1=B0=EC=A0=95=20#50?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/deploymentTargetDropDown.xml | 12 +- .../project/ui/plan/PlanSettingFragment.kt | 5 - .../project/ui/plan/PlanlicenseFragment.kt | 163 +++++++++--------- .../selector_selected_pink_else_gray.xml | 5 + .../res/drawable/bg_plan_tab_radius_17.xml | 16 ++ .../main/res/layout/fragment_grad_info.xml | 8 +- .../main/res/layout/fragment_plan_free.xml | 114 ++++++------ .../main/res/layout/fragment_planlicense.xml | 45 +++-- .../main/res/layout/plan_time_tab_main.xml | 16 +- app/src/main/res/values/text.xml | 8 + app/src/main/res/values/themes.xml | 8 +- 11 files changed, 206 insertions(+), 194 deletions(-) create mode 100644 app/src/main/res/color/selector_selected_pink_else_gray.xml create mode 100644 app/src/main/res/drawable/bg_plan_tab_radius_17.xml diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml index 9ab3e266..e65faff1 100644 --- a/.idea/deploymentTargetDropDown.xml +++ b/.idea/deploymentTargetDropDown.xml @@ -1,17 +1,17 @@ - + - + - - + + - - + + \ No newline at end of file diff --git a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanSettingFragment.kt b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanSettingFragment.kt index b14bf819..6750ae59 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanSettingFragment.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanSettingFragment.kt @@ -39,12 +39,9 @@ class PlanSettingFragment : Fragment() { container: ViewGroup?, savedInstanceState: Bundle? ): View { - // PlanTimeTabMainBinding을 인플레이트하여 루트 뷰를 가져옴 _binding = PlanTimeTabMainBinding.inflate(inflater, container, false) val view = binding.root - - // 탭 레이아웃 및 뷰페이저 초기화 initTabLayout() initViewPager() @@ -57,11 +54,9 @@ class PlanSettingFragment : Fragment() { val tabTitle = arrayOf("시간표", "자격증", "자유") - viewPager = binding.viewPagerTimeTabMain tabLayout = binding.tabLayoutPlanTime - val adapter = PlanVPAdapter(this) adapter.addFragment(PlanTimeFragment()) diff --git a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanlicenseFragment.kt b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanlicenseFragment.kt index d2f62494..0a8dde84 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanlicenseFragment.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanlicenseFragment.kt @@ -16,125 +16,124 @@ import umc.com.mobile.project.R import umc.com.mobile.project.databinding.FragmentPlanlicenseBinding class PlanlicenseFragment : Fragment() { - private var _binding: FragmentPlanlicenseBinding? = null - private val viewModel: PlanViewModel by activityViewModels() - private val binding get() = _binding!! + private var _binding: FragmentPlanlicenseBinding? = null + private val viewModel: PlanViewModel by activityViewModels() + private val binding get() = _binding!! - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle? - ): View { - _binding = FragmentPlanlicenseBinding.inflate(inflater, container, false) + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + _binding = FragmentPlanlicenseBinding.inflate(inflater, container, false) - viewModel.getLicenseInfo() // api 연결 + viewModel.getLicenseInfo() // api 연결 - // UPlicenseResponse-자격증 정보 불러오기 - viewModel.licenseInfo.observe(viewLifecycleOwner) { licenseInfo -> - licenseInfo?.result?.let { resultList -> - // 첫 번째 Result 객체에 접근하여 데이터 매핑 - resultList.getOrNull(0)?.let { firstResult -> - binding.planLicenseName.setText(firstResult.name) - binding.planLicenseDate.setText(firstResult.date) - } + // UPlicenseResponse-자격증 정보 불러오기 + viewModel.licenseInfo.observe(viewLifecycleOwner) { licenseInfo -> + licenseInfo?.result?.let { resultList -> + // 첫 번째 Result 객체에 접근하여 데이터 매핑 + resultList.getOrNull(0)?.let { firstResult -> + binding.planLicenseName.setText(firstResult.name) + binding.planLicenseDate.setText(firstResult.date) + } - // 두 번째 Result 객체에 접근하여 데이터 매핑 - resultList.getOrNull(1)?.let { secondResult -> - binding.planLicenseName2.setText(secondResult.name) - binding.planLicenseDate2.setText(secondResult.date) + // 두 번째 Result 객체에 접근하여 데이터 매핑 + resultList.getOrNull(1)?.let { secondResult -> + binding.planLicenseName2.setText(secondResult.name) + binding.planLicenseDate2.setText(secondResult.date) - } + } - resultList.getOrNull(2)?.let { thirdResult -> - binding.planLicenseName3.setText(thirdResult.name) - binding.planLicenseDate3.setText(thirdResult.date) + resultList.getOrNull(2)?.let { thirdResult -> + binding.planLicenseName3.setText(thirdResult.name) + binding.planLicenseDate3.setText(thirdResult.date) - } + } - resultList.getOrNull(3)?.let { fourthResult -> - binding.planLicenseName4.setText(fourthResult.name) - binding.planLicenseDate4.setText(fourthResult.date) - } - } - } + resultList.getOrNull(3)?.let { fourthResult -> + binding.planLicenseName4.setText(fourthResult.name) + binding.planLicenseDate4.setText(fourthResult.date) + } + } + } - return binding.root - } + return binding.root + } - private fun submitData() { + private fun submitData() { - val name = binding.planLicenseName.text.toString() - val date = binding.planLicenseDate.text.toString() + val name = binding.planLicenseName.text.toString() + val date = binding.planLicenseDate.text.toString() - // SaveInfo 객체 리스트 생성 - val saveInfoList = listOf(SaveInfo(name, date)) + // SaveInfo 객체 리스트 생성 + val saveInfoList = listOf(SaveInfo(name, date)) - // SavelicenseRequest 객체 생성 + // SavelicenseRequest 객체 생성 - // API 호출 - viewModel.saveLicense(saveInfoList) + // API 호출 + viewModel.saveLicense(saveInfoList) - } + } - private fun setupEditTextListener(){ - val textWatcher = object : TextWatcher { - override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) { - // 필요 없음 - } + private fun setupEditTextListener(){ + val textWatcher = object : TextWatcher { + override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) { + // 필요 없음 + } - override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { - // 입력이 변경될 때마다 호출됩니다. - checkIfAnyInputIsFilled() - } + override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { + // 입력이 변경될 때마다 호출됩니다. + checkIfAnyInputIsFilled() + } - override fun afterTextChanged(s: Editable?) { - // 필요 없음 - } - } - binding.planLicenseName.addTextChangedListener(textWatcher) - } + override fun afterTextChanged(s: Editable?) { + // 필요 없음 + } + } + binding.planLicenseName.addTextChangedListener(textWatcher) + } - private fun checkIfAnyInputIsFilled() { - val isAnyFieldFilled = binding.planLicenseName.text.trim().isNotEmpty() - //버튼 활성화 업데이트 - binding.licenseButtonStore.isEnabled = isAnyFieldFilled + private fun checkIfAnyInputIsFilled() { + val isAnyFieldFilled = binding.planLicenseName.text.trim().isNotEmpty() + //버튼 활성화 업데이트 + binding.licenseButtonStore.isEnabled = isAnyFieldFilled - // 버튼 색상도 업데이트 - val colorResId = if (isAnyFieldFilled) R.color.skyBlue else R.color.gray - val color = ContextCompat.getColor(requireContext(), colorResId) - binding.licenseButtonStore.backgroundTintList = ColorStateList.valueOf(color) + // 버튼 색상도 업데이트 + val colorResId = if (isAnyFieldFilled) R.color.skyBlue else R.color.gray + val color = ContextCompat.getColor(requireContext(), colorResId) + binding.licenseButtonStore.backgroundTintList = ColorStateList.valueOf(color) - } + } - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - setupEditTextListener() - checkIfAnyInputIsFilled() // 초기 상태 확인 - binding.licenseButtonStore.setOnClickListener { - submitData() // 사용자 입력을 기반으로 API 호출 - } + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + setupEditTextListener() + checkIfAnyInputIsFilled() // 초기 상태 확인 + binding.licenseButtonStore.setOnClickListener { + submitData() // 사용자 입력을 기반으로 API 호출 + } - } - - override fun onDestroyView() { - super.onDestroyView() - _binding = null - } - } + } + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } +} diff --git a/app/src/main/res/color/selector_selected_pink_else_gray.xml b/app/src/main/res/color/selector_selected_pink_else_gray.xml new file mode 100644 index 00000000..ff90e52a --- /dev/null +++ b/app/src/main/res/color/selector_selected_pink_else_gray.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_plan_tab_radius_17.xml b/app/src/main/res/drawable/bg_plan_tab_radius_17.xml new file mode 100644 index 00000000..6c2bcdc7 --- /dev/null +++ b/app/src/main/res/drawable/bg_plan_tab_radius_17.xml @@ -0,0 +1,16 @@ + + + + + + + + + + diff --git a/app/src/main/res/layout/fragment_grad_info.xml b/app/src/main/res/layout/fragment_grad_info.xml index cb146212..e67ead0b 100644 --- a/app/src/main/res/layout/fragment_grad_info.xml +++ b/app/src/main/res/layout/fragment_grad_info.xml @@ -13,14 +13,14 @@ android:layout_height="wrap_content" android:layout_marginStart="19dp" android:layout_marginTop="43dp" - android:textColor="@color/black" android:text="졸업요건" + android:textColor="@color/black" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> diff --git a/app/src/main/res/layout/fragment_plan_free.xml b/app/src/main/res/layout/fragment_plan_free.xml index f381ac74..84f2ada6 100644 --- a/app/src/main/res/layout/fragment_plan_free.xml +++ b/app/src/main/res/layout/fragment_plan_free.xml @@ -1,78 +1,68 @@ - - + android:layout_height="match_parent"> - + android:layout_height="0dp"> - - /> + - + - + + - + + - - - \ No newline at end of file + diff --git a/app/src/main/res/layout/fragment_planlicense.xml b/app/src/main/res/layout/fragment_planlicense.xml index 8e895b16..00568ddb 100644 --- a/app/src/main/res/layout/fragment_planlicense.xml +++ b/app/src/main/res/layout/fragment_planlicense.xml @@ -45,19 +45,20 @@ tools:layout_editor_absoluteY="4dp"> + app:layout_constraintEnd_toEndOf="@+id/license_const_layout" + app:layout_constraintTop_toBottomOf="@+id/license_const_layout" /> + app:layout_constraintEnd_toEndOf="@+id/license_const_layout" + app:layout_constraintStart_toStartOf="@+id/license_const_layout" + app:layout_constraintTop_toBottomOf="@+id/license_const_layout" /> diff --git a/app/src/main/res/layout/plan_time_tab_main.xml b/app/src/main/res/layout/plan_time_tab_main.xml index 098b4811..e93e983c 100644 --- a/app/src/main/res/layout/plan_time_tab_main.xml +++ b/app/src/main/res/layout/plan_time_tab_main.xml @@ -12,15 +12,15 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="54dp" - android:textColor="@color/black" android:text="향후계획" + android:textColor="@color/black" + app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintEnd_toEndOf="parent"/> + app:layout_constraintTop_toTopOf="parent" /> 16sp + + + + diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 06dbe6fc..b49f81d5 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -2,12 +2,12 @@