diff --git a/presentation/src/main/java/com/kkkk/presentation/main/study/StudyExerciseFragment.kt b/presentation/src/main/java/com/kkkk/presentation/main/study/StudyExerciseFragment.kt new file mode 100644 index 0000000..689c9b8 --- /dev/null +++ b/presentation/src/main/java/com/kkkk/presentation/main/study/StudyExerciseFragment.kt @@ -0,0 +1,9 @@ +package com.kkkk.presentation.main.study + +import com.kkkk.core.base.BaseFragment +import kr.genti.presentation.R +import kr.genti.presentation.databinding.FragmentStudyExerciseBinding + +class StudyExerciseFragment: BaseFragment(R.layout.fragment_study_exercise) { + +} diff --git a/presentation/src/main/java/com/kkkk/presentation/main/study/StudyFragment.kt b/presentation/src/main/java/com/kkkk/presentation/main/study/StudyFragment.kt index 12c6750..77abac1 100644 --- a/presentation/src/main/java/com/kkkk/presentation/main/study/StudyFragment.kt +++ b/presentation/src/main/java/com/kkkk/presentation/main/study/StudyFragment.kt @@ -2,6 +2,7 @@ package com.kkkk.presentation.main.study import android.os.Bundle import android.view.View +import com.google.android.material.tabs.TabLayoutMediator import com.kkkk.core.base.BaseFragment import dagger.hilt.android.AndroidEntryPoint import kr.genti.presentation.R @@ -9,11 +10,33 @@ import kr.genti.presentation.databinding.FragmentStudyBinding @AndroidEntryPoint class StudyFragment : BaseFragment(R.layout.fragment_study) { + private val tabTextList = listOf("재활운동", "정보") + override fun onViewCreated( view: View, savedInstanceState: Bundle?, ) { super.onViewCreated(view, savedInstanceState) + setTabLayout() + setViewPager() + } + + private fun setTabLayout() { + binding.tabStudy.apply { + for (tabName in tabTextList) { + val tab = this.newTab() + tab.text = tabName + this.addTab(tab) + } + } + } + + private fun setViewPager() { + binding.vpStudy.adapter = StudyViewPagerAdapter(requireActivity()) + binding.vpStudy.isUserInputEnabled = false + TabLayoutMediator(binding.tabStudy, binding.vpStudy) { tab, pos -> + tab.text = tabTextList[pos] + }.attach() } -} \ No newline at end of file +} diff --git a/presentation/src/main/java/com/kkkk/presentation/main/study/StudyInformationFragment.kt b/presentation/src/main/java/com/kkkk/presentation/main/study/StudyInformationFragment.kt new file mode 100644 index 0000000..ee57144 --- /dev/null +++ b/presentation/src/main/java/com/kkkk/presentation/main/study/StudyInformationFragment.kt @@ -0,0 +1,10 @@ +package com.kkkk.presentation.main.study + +import com.kkkk.core.base.BaseFragment +import kr.genti.presentation.R +import kr.genti.presentation.databinding.FragmentStudyExerciseBinding +import kr.genti.presentation.databinding.FragmentStudyInformationBinding + +class StudyInformationFragment: BaseFragment(R.layout.fragment_study_information) { + +} diff --git a/presentation/src/main/java/com/kkkk/presentation/main/study/StudyViewPagerAdapter.kt b/presentation/src/main/java/com/kkkk/presentation/main/study/StudyViewPagerAdapter.kt new file mode 100644 index 0000000..cb8bb0d --- /dev/null +++ b/presentation/src/main/java/com/kkkk/presentation/main/study/StudyViewPagerAdapter.kt @@ -0,0 +1,16 @@ +package com.kkkk.presentation.main.study + +import androidx.fragment.app.Fragment +import androidx.fragment.app.FragmentActivity +import androidx.viewpager2.adapter.FragmentStateAdapter + +class StudyViewPagerAdapter(fragment: FragmentActivity) : FragmentStateAdapter(fragment) { + override fun getItemCount(): Int = 2 + + override fun createFragment(position: Int): Fragment { + return when (position) { + 0 -> StudyExerciseFragment() + else -> StudyInformationFragment() + } + } +} \ No newline at end of file diff --git a/presentation/src/main/res/drawable/ic_arrow_left.xml b/presentation/src/main/res/drawable/ic_arrow_left.xml new file mode 100644 index 0000000..74bddd6 --- /dev/null +++ b/presentation/src/main/res/drawable/ic_arrow_left.xml @@ -0,0 +1,9 @@ + + + diff --git a/presentation/src/main/res/drawable/ic_arrow_right.xml b/presentation/src/main/res/drawable/ic_arrow_right.xml new file mode 100644 index 0000000..920a923 --- /dev/null +++ b/presentation/src/main/res/drawable/ic_arrow_right.xml @@ -0,0 +1,9 @@ + + + diff --git a/presentation/src/main/res/drawable/img_default_content.xml b/presentation/src/main/res/drawable/img_default_content.xml new file mode 100644 index 0000000..423e0f4 --- /dev/null +++ b/presentation/src/main/res/drawable/img_default_content.xml @@ -0,0 +1,12 @@ + + + + diff --git a/presentation/src/main/res/drawable/shape_gray200_line_8_rect.xml b/presentation/src/main/res/drawable/shape_gray200_line_8_rect.xml new file mode 100644 index 0000000..0f107aa --- /dev/null +++ b/presentation/src/main/res/drawable/shape_gray200_line_8_rect.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/presentation/src/main/res/drawable/shape_purple50_fill_12_rect.xml b/presentation/src/main/res/drawable/shape_purple50_fill_12_rect.xml new file mode 100644 index 0000000..be0ee21 --- /dev/null +++ b/presentation/src/main/res/drawable/shape_purple50_fill_12_rect.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/presentation/src/main/res/layout/fragment_study.xml b/presentation/src/main/res/layout/fragment_study.xml index a7b7020..4d64e0f 100644 --- a/presentation/src/main/res/layout/fragment_study.xml +++ b/presentation/src/main/res/layout/fragment_study.xml @@ -10,15 +10,29 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - + + + app:layout_constraintTop_toBottomOf="@id/tab_study" /> \ No newline at end of file diff --git a/presentation/src/main/res/layout/fragment_study_exercise.xml b/presentation/src/main/res/layout/fragment_study_exercise.xml new file mode 100644 index 0000000..ea6e79d --- /dev/null +++ b/presentation/src/main/res/layout/fragment_study_exercise.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/presentation/src/main/res/layout/fragment_study_information.xml b/presentation/src/main/res/layout/fragment_study_information.xml new file mode 100644 index 0000000..17c5745 --- /dev/null +++ b/presentation/src/main/res/layout/fragment_study_information.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/presentation/src/main/res/layout/item_study_exercise.xml b/presentation/src/main/res/layout/item_study_exercise.xml new file mode 100644 index 0000000..81e92eb --- /dev/null +++ b/presentation/src/main/res/layout/item_study_exercise.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/presentation/src/main/res/layout/item_study_information.xml b/presentation/src/main/res/layout/item_study_information.xml new file mode 100644 index 0000000..748d5e4 --- /dev/null +++ b/presentation/src/main/res/layout/item_study_information.xml @@ -0,0 +1,55 @@ + + + + + + + + + + \ No newline at end of file diff --git a/presentation/src/main/res/values/strings.xml b/presentation/src/main/res/values/strings.xml index d6f9f97..b1d10b1 100644 --- a/presentation/src/main/res/values/strings.xml +++ b/presentation/src/main/res/values/strings.xml @@ -12,6 +12,8 @@ 시작하기 나중에 할래요 + 이전페이지 + 다음페이지 리듬 기록