From 28f547f8512e37dd1b526776b24badbd40fbc75a Mon Sep 17 00:00:00 2001 From: kangyuri1114 Date: Sun, 21 Apr 2024 03:13:59 +0900 Subject: [PATCH 1/6] =?UTF-8?q?[move]:=20=ED=8C=A8=ED=82=A4=EC=A7=80=20?= =?UTF-8?q?=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- feature/projects/src/main/AndroidManifest.xml | 4 ++-- .../zucchini/projects/{ => developer}/DevDetailActivity.kt | 4 ++-- .../zucchini/projects/{ => developer}/DevInfoFragment.kt | 4 ++-- .../{ => developer}/adapter/DevDetailProjectAdapter.kt | 5 ++--- .../{ => developer}/adapter/DeveloperInfoAdapter.kt | 4 ++-- .../com/zucchini/projects/{ => mypage}/MypageFragment.kt | 2 +- .../projects/{ => projects}/ProjectDetailActivity.kt | 4 ++-- .../zucchini/projects/{ => projects}/ProjectsFragment.kt | 6 +++--- .../{ => projects}/adapter/ProjectDetailDevAdapter.kt | 2 +- .../projects/{ => projects}/adapter/ProjectsAdapter.kt | 4 ++-- .../projects/{ => projects}/adapter/SearchKeywordAdapter.kt | 2 +- .../projects/src/main/res/layout/activity_dev_detail.xml | 2 +- .../src/main/res/layout/activity_project_detail.xml | 2 +- feature/projects/src/main/res/layout/fragment_dev_info.xml | 2 +- feature/projects/src/main/res/layout/fragment_mypage.xml | 2 +- feature/projects/src/main/res/layout/fragment_projects.xml | 2 +- feature/projects/src/main/res/navigation/nav_graph.xml | 6 +++--- 17 files changed, 28 insertions(+), 29 deletions(-) rename feature/projects/src/main/java/com/zucchini/projects/{ => developer}/DevDetailActivity.kt (89%) rename feature/projects/src/main/java/com/zucchini/projects/{ => developer}/DevInfoFragment.kt (91%) rename feature/projects/src/main/java/com/zucchini/projects/{ => developer}/adapter/DevDetailProjectAdapter.kt (93%) rename feature/projects/src/main/java/com/zucchini/projects/{ => developer}/adapter/DeveloperInfoAdapter.kt (95%) rename feature/projects/src/main/java/com/zucchini/projects/{ => mypage}/MypageFragment.kt (97%) rename feature/projects/src/main/java/com/zucchini/projects/{ => projects}/ProjectDetailActivity.kt (89%) rename feature/projects/src/main/java/com/zucchini/projects/{ => projects}/ProjectsFragment.kt (90%) rename feature/projects/src/main/java/com/zucchini/projects/{ => projects}/adapter/ProjectDetailDevAdapter.kt (97%) rename feature/projects/src/main/java/com/zucchini/projects/{ => projects}/adapter/ProjectsAdapter.kt (94%) rename feature/projects/src/main/java/com/zucchini/projects/{ => projects}/adapter/SearchKeywordAdapter.kt (96%) diff --git a/feature/projects/src/main/AndroidManifest.xml b/feature/projects/src/main/AndroidManifest.xml index 13a68c9..5188984 100644 --- a/feature/projects/src/main/AndroidManifest.xml +++ b/feature/projects/src/main/AndroidManifest.xml @@ -8,7 +8,7 @@ android:theme="@style/Theme.AppCompat.Light.NoActionBar" android:exported="false" /> @@ -18,7 +18,7 @@ android:screenOrientation="portrait" android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> diff --git a/feature/projects/src/main/java/com/zucchini/projects/DevDetailActivity.kt b/feature/projects/src/main/java/com/zucchini/projects/developer/DevDetailActivity.kt similarity index 89% rename from feature/projects/src/main/java/com/zucchini/projects/DevDetailActivity.kt rename to feature/projects/src/main/java/com/zucchini/projects/developer/DevDetailActivity.kt index 58e33e0..89a8674 100644 --- a/feature/projects/src/main/java/com/zucchini/projects/DevDetailActivity.kt +++ b/feature/projects/src/main/java/com/zucchini/projects/developer/DevDetailActivity.kt @@ -1,10 +1,10 @@ -package com.zucchini.projects +package com.zucchini.projects.developer import android.os.Bundle import androidx.appcompat.app.AppCompatActivity import androidx.recyclerview.widget.LinearLayoutManager import com.zucchini.feature.projects.databinding.ActivityDevDetailBinding -import com.zucchini.projects.adapter.DevDetailProjectAdapter +import com.zucchini.projects.developer.adapter.DevDetailProjectAdapter import com.zucchini.projects.dummy.DevProjectsDummy class DevDetailActivity : AppCompatActivity() { diff --git a/feature/projects/src/main/java/com/zucchini/projects/DevInfoFragment.kt b/feature/projects/src/main/java/com/zucchini/projects/developer/DevInfoFragment.kt similarity index 91% rename from feature/projects/src/main/java/com/zucchini/projects/DevInfoFragment.kt rename to feature/projects/src/main/java/com/zucchini/projects/developer/DevInfoFragment.kt index 2914b03..93d9603 100644 --- a/feature/projects/src/main/java/com/zucchini/projects/DevInfoFragment.kt +++ b/feature/projects/src/main/java/com/zucchini/projects/developer/DevInfoFragment.kt @@ -1,4 +1,4 @@ -package com.zucchini.projects +package com.zucchini.projects.developer import android.os.Bundle import android.view.LayoutInflater @@ -7,7 +7,7 @@ import android.view.ViewGroup import androidx.fragment.app.Fragment import androidx.recyclerview.widget.GridLayoutManager import com.zucchini.feature.projects.databinding.FragmentDevInfoBinding -import com.zucchini.projects.adapter.DeveloperInfoAdapter +import com.zucchini.projects.developer.adapter.DeveloperInfoAdapter import com.zucchini.projects.dummy.DeveloperInfoDummy class DevInfoFragment : Fragment() { diff --git a/feature/projects/src/main/java/com/zucchini/projects/adapter/DevDetailProjectAdapter.kt b/feature/projects/src/main/java/com/zucchini/projects/developer/adapter/DevDetailProjectAdapter.kt similarity index 93% rename from feature/projects/src/main/java/com/zucchini/projects/adapter/DevDetailProjectAdapter.kt rename to feature/projects/src/main/java/com/zucchini/projects/developer/adapter/DevDetailProjectAdapter.kt index 703541a..fa7f976 100644 --- a/feature/projects/src/main/java/com/zucchini/projects/adapter/DevDetailProjectAdapter.kt +++ b/feature/projects/src/main/java/com/zucchini/projects/developer/adapter/DevDetailProjectAdapter.kt @@ -1,4 +1,4 @@ -package com.zucchini.projects.adapter +package com.zucchini.projects.developer.adapter import android.content.Intent import android.view.LayoutInflater @@ -9,8 +9,7 @@ import androidx.recyclerview.widget.RecyclerView import com.zucchini.domain.model.DevDetailProjectInfo import com.zucchini.feature.projects.R import com.zucchini.feature.projects.databinding.ItemDevDetailProjectsBinding -import com.zucchini.projects.DevDetailActivity -import com.zucchini.projects.ProjectDetailActivity +import com.zucchini.projects.projects.ProjectDetailActivity import com.zucchini.view.ItemDiffCallback class DevDetailProjectAdapter : diff --git a/feature/projects/src/main/java/com/zucchini/projects/adapter/DeveloperInfoAdapter.kt b/feature/projects/src/main/java/com/zucchini/projects/developer/adapter/DeveloperInfoAdapter.kt similarity index 95% rename from feature/projects/src/main/java/com/zucchini/projects/adapter/DeveloperInfoAdapter.kt rename to feature/projects/src/main/java/com/zucchini/projects/developer/adapter/DeveloperInfoAdapter.kt index 4694302..c7c0a0a 100644 --- a/feature/projects/src/main/java/com/zucchini/projects/adapter/DeveloperInfoAdapter.kt +++ b/feature/projects/src/main/java/com/zucchini/projects/developer/adapter/DeveloperInfoAdapter.kt @@ -1,4 +1,4 @@ -package com.zucchini.projects.adapter +package com.zucchini.projects.developer.adapter import android.content.Intent import android.view.LayoutInflater @@ -9,7 +9,7 @@ import androidx.recyclerview.widget.RecyclerView import com.zucchini.domain.model.DeveloperInfo import com.zucchini.feature.projects.R import com.zucchini.feature.projects.databinding.ItemDeveloperBinding -import com.zucchini.projects.DevDetailActivity +import com.zucchini.projects.developer.DevDetailActivity import com.zucchini.view.ItemDiffCallback class DeveloperInfoAdapter : diff --git a/feature/projects/src/main/java/com/zucchini/projects/MypageFragment.kt b/feature/projects/src/main/java/com/zucchini/projects/mypage/MypageFragment.kt similarity index 97% rename from feature/projects/src/main/java/com/zucchini/projects/MypageFragment.kt rename to feature/projects/src/main/java/com/zucchini/projects/mypage/MypageFragment.kt index 437ceec..0f35292 100644 --- a/feature/projects/src/main/java/com/zucchini/projects/MypageFragment.kt +++ b/feature/projects/src/main/java/com/zucchini/projects/mypage/MypageFragment.kt @@ -1,4 +1,4 @@ -package com.zucchini.projects +package com.zucchini.projects.mypage import android.content.Intent import android.net.Uri diff --git a/feature/projects/src/main/java/com/zucchini/projects/ProjectDetailActivity.kt b/feature/projects/src/main/java/com/zucchini/projects/projects/ProjectDetailActivity.kt similarity index 89% rename from feature/projects/src/main/java/com/zucchini/projects/ProjectDetailActivity.kt rename to feature/projects/src/main/java/com/zucchini/projects/projects/ProjectDetailActivity.kt index b057bc8..881b694 100644 --- a/feature/projects/src/main/java/com/zucchini/projects/ProjectDetailActivity.kt +++ b/feature/projects/src/main/java/com/zucchini/projects/projects/ProjectDetailActivity.kt @@ -1,10 +1,10 @@ -package com.zucchini.projects +package com.zucchini.projects.projects import android.os.Bundle import androidx.appcompat.app.AppCompatActivity import androidx.recyclerview.widget.GridLayoutManager import com.zucchini.feature.projects.databinding.ActivityProjectDetailBinding -import com.zucchini.projects.adapter.ProjectDetailDevAdapter +import com.zucchini.projects.projects.adapter.ProjectDetailDevAdapter import com.zucchini.projects.dummy.ProjectDetailDevDummy class ProjectDetailActivity : AppCompatActivity() { diff --git a/feature/projects/src/main/java/com/zucchini/projects/ProjectsFragment.kt b/feature/projects/src/main/java/com/zucchini/projects/projects/ProjectsFragment.kt similarity index 90% rename from feature/projects/src/main/java/com/zucchini/projects/ProjectsFragment.kt rename to feature/projects/src/main/java/com/zucchini/projects/projects/ProjectsFragment.kt index f2421a4..6f81ed1 100644 --- a/feature/projects/src/main/java/com/zucchini/projects/ProjectsFragment.kt +++ b/feature/projects/src/main/java/com/zucchini/projects/projects/ProjectsFragment.kt @@ -1,4 +1,4 @@ -package com.zucchini.projects +package com.zucchini.projects.projects import android.os.Bundle import android.view.LayoutInflater @@ -9,8 +9,8 @@ import androidx.recyclerview.widget.LinearLayoutManager import com.zucchini.domain.model.Keyword import com.zucchini.domain.model.KeywordList import com.zucchini.feature.projects.databinding.FragmentProjectsBinding -import com.zucchini.projects.adapter.ProjectsAdapter -import com.zucchini.projects.adapter.SearchKeywordAdapter +import com.zucchini.projects.projects.adapter.ProjectsAdapter +import com.zucchini.projects.projects.adapter.SearchKeywordAdapter import com.zucchini.projects.dummy.ProjectDummyList class ProjectsFragment : Fragment() { diff --git a/feature/projects/src/main/java/com/zucchini/projects/adapter/ProjectDetailDevAdapter.kt b/feature/projects/src/main/java/com/zucchini/projects/projects/adapter/ProjectDetailDevAdapter.kt similarity index 97% rename from feature/projects/src/main/java/com/zucchini/projects/adapter/ProjectDetailDevAdapter.kt rename to feature/projects/src/main/java/com/zucchini/projects/projects/adapter/ProjectDetailDevAdapter.kt index 765269f..7c92458 100644 --- a/feature/projects/src/main/java/com/zucchini/projects/adapter/ProjectDetailDevAdapter.kt +++ b/feature/projects/src/main/java/com/zucchini/projects/projects/adapter/ProjectDetailDevAdapter.kt @@ -1,4 +1,4 @@ -package com.zucchini.projects.adapter +package com.zucchini.projects.projects.adapter import android.view.LayoutInflater import android.view.ViewGroup diff --git a/feature/projects/src/main/java/com/zucchini/projects/adapter/ProjectsAdapter.kt b/feature/projects/src/main/java/com/zucchini/projects/projects/adapter/ProjectsAdapter.kt similarity index 94% rename from feature/projects/src/main/java/com/zucchini/projects/adapter/ProjectsAdapter.kt rename to feature/projects/src/main/java/com/zucchini/projects/projects/adapter/ProjectsAdapter.kt index a1972e4..187c0c7 100644 --- a/feature/projects/src/main/java/com/zucchini/projects/adapter/ProjectsAdapter.kt +++ b/feature/projects/src/main/java/com/zucchini/projects/projects/adapter/ProjectsAdapter.kt @@ -1,4 +1,4 @@ -package com.zucchini.projects.adapter +package com.zucchini.projects.projects.adapter import android.content.Intent import android.view.LayoutInflater @@ -8,7 +8,7 @@ import androidx.recyclerview.widget.ListAdapter import androidx.recyclerview.widget.RecyclerView import com.zucchini.domain.model.ProjectInfo import com.zucchini.feature.projects.databinding.ItemProjectsBinding -import com.zucchini.projects.ProjectDetailActivity +import com.zucchini.projects.projects.ProjectDetailActivity import com.zucchini.view.ItemDiffCallback class ProjectsAdapter : ListAdapter( diff --git a/feature/projects/src/main/java/com/zucchini/projects/adapter/SearchKeywordAdapter.kt b/feature/projects/src/main/java/com/zucchini/projects/projects/adapter/SearchKeywordAdapter.kt similarity index 96% rename from feature/projects/src/main/java/com/zucchini/projects/adapter/SearchKeywordAdapter.kt rename to feature/projects/src/main/java/com/zucchini/projects/projects/adapter/SearchKeywordAdapter.kt index 20cc8af..92b2713 100644 --- a/feature/projects/src/main/java/com/zucchini/projects/adapter/SearchKeywordAdapter.kt +++ b/feature/projects/src/main/java/com/zucchini/projects/projects/adapter/SearchKeywordAdapter.kt @@ -1,4 +1,4 @@ -package com.zucchini.projects.adapter +package com.zucchini.projects.projects.adapter import android.view.LayoutInflater import android.view.ViewGroup diff --git a/feature/projects/src/main/res/layout/activity_dev_detail.xml b/feature/projects/src/main/res/layout/activity_dev_detail.xml index bd255d6..c5ac666 100644 --- a/feature/projects/src/main/res/layout/activity_dev_detail.xml +++ b/feature/projects/src/main/res/layout/activity_dev_detail.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context="com.zucchini.projects.DevDetailActivity"> + tools:context="com.zucchini.projects.developer.DevDetailActivity"> + tools:context="com.zucchini.projects.projects.ProjectDetailActivity"> + tools:context="com.zucchini.projects.developer.DevInfoFragment"> + tools:context="com.zucchini.projects.mypage.MypageFragment"> + tools:context="com.zucchini.projects.projects.ProjectsFragment"> From f11ce92f9f8e0ffddee4cac49ac4265e1eca215f Mon Sep 17 00:00:00 2001 From: kangyuri1114 Date: Sun, 21 Apr 2024 04:40:46 +0900 Subject: [PATCH 2/6] =?UTF-8?q?[feat]:=20=ED=8E=98=EC=9D=B4=EC=A7=95=20ui?= =?UTF-8?q?=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projects/adapter/PageIndicatorAdapter.kt | 47 +++++++++++++++++++ .../projects/developer/DevInfoFragment.kt | 15 +++++- .../developer/adapter/DeveloperInfoAdapter.kt | 1 + .../projects/projects/ProjectsFragment.kt | 11 ++++- .../projects/adapter/ProjectsAdapter.kt | 2 + .../main/res/drawable/arrow_left_24_gray.xml | 5 ++ .../main/res/drawable/arrow_right_24_gray.xml | 5 ++ .../src/main/res/layout/fragment_dev_info.xml | 36 +++++++++++++- .../src/main/res/layout/fragment_projects.xml | 36 +++++++++++++- .../main/res/layout/item_page_indicator.xml | 22 +++++++++ 10 files changed, 175 insertions(+), 5 deletions(-) create mode 100644 feature/projects/src/main/java/com/zucchini/projects/adapter/PageIndicatorAdapter.kt create mode 100644 feature/projects/src/main/res/drawable/arrow_left_24_gray.xml create mode 100644 feature/projects/src/main/res/drawable/arrow_right_24_gray.xml create mode 100644 feature/projects/src/main/res/layout/item_page_indicator.xml diff --git a/feature/projects/src/main/java/com/zucchini/projects/adapter/PageIndicatorAdapter.kt b/feature/projects/src/main/java/com/zucchini/projects/adapter/PageIndicatorAdapter.kt new file mode 100644 index 0000000..384fe60 --- /dev/null +++ b/feature/projects/src/main/java/com/zucchini/projects/adapter/PageIndicatorAdapter.kt @@ -0,0 +1,47 @@ +package com.zucchini.projects.adapter + +import android.content.Context +import android.view.LayoutInflater +import android.view.ViewGroup +import androidx.core.content.ContextCompat +import androidx.recyclerview.widget.RecyclerView +import com.zucchini.feature.projects.databinding.ItemPageIndicatorBinding + +class PageIndicatorAdapter(private val context: Context) : + RecyclerView.Adapter() { + private var currentPage = 0 + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): PageIndicatorViewHolder { + val inflater = LayoutInflater.from(parent.context) + val binding = ItemPageIndicatorBinding.inflate(inflater, parent, false) + return PageIndicatorViewHolder(binding) + } + + override fun onBindViewHolder(holder: PageIndicatorViewHolder, position: Int) { + holder.bind(position) + } + + override fun getItemCount(): Int = 4 + + fun setCurrentPage(page: Int) { + currentPage = page + notifyDataSetChanged() + } + + inner class PageIndicatorViewHolder(private val binding: ItemPageIndicatorBinding) : + RecyclerView.ViewHolder(binding.root) { + + fun bind(position: Int) { + binding.pageNumber.text = (position + 1).toString() + + if (position == currentPage) { + binding.pageNumber.setTextColor( + ContextCompat.getColor( + context, + com.zucchini.core.designsystem.R.color.olive_black, + ), + ) + } + } + } +} diff --git a/feature/projects/src/main/java/com/zucchini/projects/developer/DevInfoFragment.kt b/feature/projects/src/main/java/com/zucchini/projects/developer/DevInfoFragment.kt index 93d9603..19dc2aa 100644 --- a/feature/projects/src/main/java/com/zucchini/projects/developer/DevInfoFragment.kt +++ b/feature/projects/src/main/java/com/zucchini/projects/developer/DevInfoFragment.kt @@ -6,14 +6,19 @@ import android.view.View import android.view.ViewGroup import androidx.fragment.app.Fragment import androidx.recyclerview.widget.GridLayoutManager +import androidx.recyclerview.widget.LinearLayoutManager import com.zucchini.feature.projects.databinding.FragmentDevInfoBinding import com.zucchini.projects.developer.adapter.DeveloperInfoAdapter +import com.zucchini.projects.adapter.PageIndicatorAdapter import com.zucchini.projects.dummy.DeveloperInfoDummy class DevInfoFragment : Fragment() { private var _binding: FragmentDevInfoBinding? = null private val binding: FragmentDevInfoBinding get() = _binding!! + private lateinit var developerInfoAdapter: DeveloperInfoAdapter + private lateinit var pageIndicatorAdapter: PageIndicatorAdapter + override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, @@ -22,17 +27,25 @@ class DevInfoFragment : Fragment() { _binding = FragmentDevInfoBinding.inflate(inflater, container, false) initDeveloperAdapter() + initPageIndicator() return binding.root } private fun initDeveloperAdapter() { - val developerInfoAdapter = DeveloperInfoAdapter() + developerInfoAdapter = DeveloperInfoAdapter() binding.rvDevinfo.adapter = developerInfoAdapter binding.rvDevinfo.layoutManager = GridLayoutManager(context, 2) developerInfoAdapter.submitList(DeveloperInfoDummy.developerInfoList) } + private fun initPageIndicator() { + pageIndicatorAdapter = PageIndicatorAdapter(requireContext()) + binding.rvPageIndicator.adapter = pageIndicatorAdapter + binding.rvPageIndicator.layoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false) + } + + override fun onDestroyView() { super.onDestroyView() _binding = null diff --git a/feature/projects/src/main/java/com/zucchini/projects/developer/adapter/DeveloperInfoAdapter.kt b/feature/projects/src/main/java/com/zucchini/projects/developer/adapter/DeveloperInfoAdapter.kt index c7c0a0a..49093e7 100644 --- a/feature/projects/src/main/java/com/zucchini/projects/developer/adapter/DeveloperInfoAdapter.kt +++ b/feature/projects/src/main/java/com/zucchini/projects/developer/adapter/DeveloperInfoAdapter.kt @@ -32,6 +32,7 @@ class DeveloperInfoAdapter : override fun onBindViewHolder(holder: DeveloperInfoViewHolder, position: Int) { holder.bind(getItem(position)) } + override fun getItemCount(): Int = 8 inner class DeveloperInfoViewHolder(private val binding: ItemDeveloperBinding) : RecyclerView.ViewHolder(binding.root) { diff --git a/feature/projects/src/main/java/com/zucchini/projects/projects/ProjectsFragment.kt b/feature/projects/src/main/java/com/zucchini/projects/projects/ProjectsFragment.kt index 6f81ed1..4a05fd6 100644 --- a/feature/projects/src/main/java/com/zucchini/projects/projects/ProjectsFragment.kt +++ b/feature/projects/src/main/java/com/zucchini/projects/projects/ProjectsFragment.kt @@ -9,6 +9,7 @@ import androidx.recyclerview.widget.LinearLayoutManager import com.zucchini.domain.model.Keyword import com.zucchini.domain.model.KeywordList import com.zucchini.feature.projects.databinding.FragmentProjectsBinding +import com.zucchini.projects.adapter.PageIndicatorAdapter import com.zucchini.projects.projects.adapter.ProjectsAdapter import com.zucchini.projects.projects.adapter.SearchKeywordAdapter import com.zucchini.projects.dummy.ProjectDummyList @@ -16,6 +17,9 @@ import com.zucchini.projects.dummy.ProjectDummyList class ProjectsFragment : Fragment() { private var _binding: FragmentProjectsBinding? = null private val binding: FragmentProjectsBinding get() = _binding!! + + private lateinit var pageIndicatorAdapter: PageIndicatorAdapter + override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, @@ -25,6 +29,7 @@ class ProjectsFragment : Fragment() { initKeywordAdapter() initProjectsAdapter() + initPageIndicator() return binding.root } @@ -43,7 +48,11 @@ class ProjectsFragment : Fragment() { binding.rvSearchKeyword.adapter = searchKeywordAdapter searchKeywordAdapter.submitList(KeywordList.searchKeyword.map { Keyword(it) }) } - + private fun initPageIndicator() { + pageIndicatorAdapter = PageIndicatorAdapter(requireContext()) + binding.rvPageIndicator.adapter = pageIndicatorAdapter + binding.rvPageIndicator.layoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false) + } override fun onDestroyView() { super.onDestroyView() _binding = null diff --git a/feature/projects/src/main/java/com/zucchini/projects/projects/adapter/ProjectsAdapter.kt b/feature/projects/src/main/java/com/zucchini/projects/projects/adapter/ProjectsAdapter.kt index 187c0c7..b51cfbe 100644 --- a/feature/projects/src/main/java/com/zucchini/projects/projects/adapter/ProjectsAdapter.kt +++ b/feature/projects/src/main/java/com/zucchini/projects/projects/adapter/ProjectsAdapter.kt @@ -30,6 +30,8 @@ class ProjectsAdapter : ListAdapter + + diff --git a/feature/projects/src/main/res/drawable/arrow_right_24_gray.xml b/feature/projects/src/main/res/drawable/arrow_right_24_gray.xml new file mode 100644 index 0000000..83794c5 --- /dev/null +++ b/feature/projects/src/main/res/drawable/arrow_right_24_gray.xml @@ -0,0 +1,5 @@ + + + diff --git a/feature/projects/src/main/res/layout/fragment_dev_info.xml b/feature/projects/src/main/res/layout/fragment_dev_info.xml index bd9a8e4..08e9a92 100644 --- a/feature/projects/src/main/res/layout/fragment_dev_info.xml +++ b/feature/projects/src/main/res/layout/fragment_dev_info.xml @@ -32,13 +32,45 @@ + + + + + + + app:layout_constraintTop_toBottomOf="@+id/rv_devinfo" /> + + + + + + + + + + + + From 0e591ae7991d98f41833763bfe794535213dafb6 Mon Sep 17 00:00:00 2001 From: kangyuri1114 Date: Sun, 21 Apr 2024 05:05:31 +0900 Subject: [PATCH 3/6] =?UTF-8?q?[feat]:=20=ED=8E=98=EC=9D=B4=EC=A7=95=20?= =?UTF-8?q?=EB=B2=88=ED=98=B8=20=ED=81=B4=EB=A6=AD=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zucchini/projects/adapter/PageIndicatorAdapter.kt | 11 +++++++++++ .../zucchini/projects/developer/DevInfoFragment.kt | 6 +++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/feature/projects/src/main/java/com/zucchini/projects/adapter/PageIndicatorAdapter.kt b/feature/projects/src/main/java/com/zucchini/projects/adapter/PageIndicatorAdapter.kt index 384fe60..d8b32ef 100644 --- a/feature/projects/src/main/java/com/zucchini/projects/adapter/PageIndicatorAdapter.kt +++ b/feature/projects/src/main/java/com/zucchini/projects/adapter/PageIndicatorAdapter.kt @@ -34,6 +34,10 @@ class PageIndicatorAdapter(private val context: Context) : fun bind(position: Int) { binding.pageNumber.text = (position + 1).toString() + binding.pageNumber.setOnClickListener { + currentPage = position + notifyDataSetChanged() + } if (position == currentPage) { binding.pageNumber.setTextColor( ContextCompat.getColor( @@ -41,6 +45,13 @@ class PageIndicatorAdapter(private val context: Context) : com.zucchini.core.designsystem.R.color.olive_black, ), ) + } else { + binding.pageNumber.setTextColor( + ContextCompat.getColor( + context, + com.zucchini.core.designsystem.R.color.gray1, + ), + ) } } } diff --git a/feature/projects/src/main/java/com/zucchini/projects/developer/DevInfoFragment.kt b/feature/projects/src/main/java/com/zucchini/projects/developer/DevInfoFragment.kt index 19dc2aa..6d4b18f 100644 --- a/feature/projects/src/main/java/com/zucchini/projects/developer/DevInfoFragment.kt +++ b/feature/projects/src/main/java/com/zucchini/projects/developer/DevInfoFragment.kt @@ -8,8 +8,8 @@ import androidx.fragment.app.Fragment import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.LinearLayoutManager import com.zucchini.feature.projects.databinding.FragmentDevInfoBinding -import com.zucchini.projects.developer.adapter.DeveloperInfoAdapter import com.zucchini.projects.adapter.PageIndicatorAdapter +import com.zucchini.projects.developer.adapter.DeveloperInfoAdapter import com.zucchini.projects.dummy.DeveloperInfoDummy class DevInfoFragment : Fragment() { @@ -42,10 +42,10 @@ class DevInfoFragment : Fragment() { private fun initPageIndicator() { pageIndicatorAdapter = PageIndicatorAdapter(requireContext()) binding.rvPageIndicator.adapter = pageIndicatorAdapter - binding.rvPageIndicator.layoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false) + binding.rvPageIndicator.layoutManager = + LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false) } - override fun onDestroyView() { super.onDestroyView() _binding = null From 9475eebf3cd2972fa4cb1bac12cfbc056b479c1c Mon Sep 17 00:00:00 2001 From: kangyuri1114 Date: Sun, 21 Apr 2024 05:35:18 +0900 Subject: [PATCH 4/6] =?UTF-8?q?[feat]:=20=EC=A0=84=EC=B2=B4=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EC=A3=BC=EC=9E=85=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/zucchini/projects/adapter/PageIndicatorAdapter.kt | 4 ++-- .../java/com/zucchini/projects/developer/DevInfoFragment.kt | 4 +++- .../java/com/zucchini/projects/projects/ProjectsFragment.kt | 3 ++- feature/projects/src/main/res/layout/fragment_dev_info.xml | 4 ++-- feature/projects/src/main/res/layout/fragment_projects.xml | 4 ++-- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/feature/projects/src/main/java/com/zucchini/projects/adapter/PageIndicatorAdapter.kt b/feature/projects/src/main/java/com/zucchini/projects/adapter/PageIndicatorAdapter.kt index d8b32ef..8e221f0 100644 --- a/feature/projects/src/main/java/com/zucchini/projects/adapter/PageIndicatorAdapter.kt +++ b/feature/projects/src/main/java/com/zucchini/projects/adapter/PageIndicatorAdapter.kt @@ -7,7 +7,7 @@ import androidx.core.content.ContextCompat import androidx.recyclerview.widget.RecyclerView import com.zucchini.feature.projects.databinding.ItemPageIndicatorBinding -class PageIndicatorAdapter(private val context: Context) : +class PageIndicatorAdapter(private val context: Context, private val totalPage: Int) : RecyclerView.Adapter() { private var currentPage = 0 @@ -21,7 +21,7 @@ class PageIndicatorAdapter(private val context: Context) : holder.bind(position) } - override fun getItemCount(): Int = 4 + override fun getItemCount(): Int = totalPage fun setCurrentPage(page: Int) { currentPage = page diff --git a/feature/projects/src/main/java/com/zucchini/projects/developer/DevInfoFragment.kt b/feature/projects/src/main/java/com/zucchini/projects/developer/DevInfoFragment.kt index 6d4b18f..64efd31 100644 --- a/feature/projects/src/main/java/com/zucchini/projects/developer/DevInfoFragment.kt +++ b/feature/projects/src/main/java/com/zucchini/projects/developer/DevInfoFragment.kt @@ -19,6 +19,8 @@ class DevInfoFragment : Fragment() { private lateinit var developerInfoAdapter: DeveloperInfoAdapter private lateinit var pageIndicatorAdapter: PageIndicatorAdapter + private val totalPage = 4 + override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, @@ -40,7 +42,7 @@ class DevInfoFragment : Fragment() { } private fun initPageIndicator() { - pageIndicatorAdapter = PageIndicatorAdapter(requireContext()) + pageIndicatorAdapter = PageIndicatorAdapter(requireContext(), totalPage) binding.rvPageIndicator.adapter = pageIndicatorAdapter binding.rvPageIndicator.layoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false) diff --git a/feature/projects/src/main/java/com/zucchini/projects/projects/ProjectsFragment.kt b/feature/projects/src/main/java/com/zucchini/projects/projects/ProjectsFragment.kt index 4a05fd6..5c4b0f5 100644 --- a/feature/projects/src/main/java/com/zucchini/projects/projects/ProjectsFragment.kt +++ b/feature/projects/src/main/java/com/zucchini/projects/projects/ProjectsFragment.kt @@ -20,6 +20,7 @@ class ProjectsFragment : Fragment() { private lateinit var pageIndicatorAdapter: PageIndicatorAdapter + private val totalPage = 4 override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, @@ -49,7 +50,7 @@ class ProjectsFragment : Fragment() { searchKeywordAdapter.submitList(KeywordList.searchKeyword.map { Keyword(it) }) } private fun initPageIndicator() { - pageIndicatorAdapter = PageIndicatorAdapter(requireContext()) + pageIndicatorAdapter = PageIndicatorAdapter(requireContext(), totalPage) binding.rvPageIndicator.adapter = pageIndicatorAdapter binding.rvPageIndicator.layoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false) } diff --git a/feature/projects/src/main/res/layout/fragment_dev_info.xml b/feature/projects/src/main/res/layout/fragment_dev_info.xml index 08e9a92..d039d64 100644 --- a/feature/projects/src/main/res/layout/fragment_dev_info.xml +++ b/feature/projects/src/main/res/layout/fragment_dev_info.xml @@ -39,7 +39,7 @@ app:layout_constraintHorizontal_bias="0.501" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/cl_top_app_bar" /> - + - + Date: Sun, 21 Apr 2024 05:44:43 +0900 Subject: [PATCH 5/6] =?UTF-8?q?[feat]:=20=EC=A0=95=EB=A0=AC=20=ED=82=A4?= =?UTF-8?q?=EC=9B=8C=EB=93=9C=20=ED=81=B4=EB=A6=AD=20=EC=9D=B4=EB=B2=A4?= =?UTF-8?q?=ED=8A=B8=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projects/projects/ProjectsFragment.kt | 73 ++++++++++++++++++- 1 file changed, 70 insertions(+), 3 deletions(-) diff --git a/feature/projects/src/main/java/com/zucchini/projects/projects/ProjectsFragment.kt b/feature/projects/src/main/java/com/zucchini/projects/projects/ProjectsFragment.kt index 5c4b0f5..19453ce 100644 --- a/feature/projects/src/main/java/com/zucchini/projects/projects/ProjectsFragment.kt +++ b/feature/projects/src/main/java/com/zucchini/projects/projects/ProjectsFragment.kt @@ -4,15 +4,16 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment import androidx.recyclerview.widget.LinearLayoutManager import com.zucchini.domain.model.Keyword import com.zucchini.domain.model.KeywordList import com.zucchini.feature.projects.databinding.FragmentProjectsBinding import com.zucchini.projects.adapter.PageIndicatorAdapter +import com.zucchini.projects.dummy.ProjectDummyList import com.zucchini.projects.projects.adapter.ProjectsAdapter import com.zucchini.projects.projects.adapter.SearchKeywordAdapter -import com.zucchini.projects.dummy.ProjectDummyList class ProjectsFragment : Fragment() { private var _binding: FragmentProjectsBinding? = null @@ -31,7 +32,7 @@ class ProjectsFragment : Fragment() { initKeywordAdapter() initProjectsAdapter() initPageIndicator() - + setSortingKeyword() return binding.root } @@ -49,11 +50,77 @@ class ProjectsFragment : Fragment() { binding.rvSearchKeyword.adapter = searchKeywordAdapter searchKeywordAdapter.submitList(KeywordList.searchKeyword.map { Keyword(it) }) } + private fun initPageIndicator() { pageIndicatorAdapter = PageIndicatorAdapter(requireContext(), totalPage) binding.rvPageIndicator.adapter = pageIndicatorAdapter - binding.rvPageIndicator.layoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false) + binding.rvPageIndicator.layoutManager = + LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false) + } + + private fun setSortingKeyword() { + binding.tvSortRecent.setOnClickListener { + binding.tvSortRecent.setTextColor( + ContextCompat.getColor( + requireContext(), + com.zucchini.core.designsystem.R.color.olive_black, + ), + ) + binding.tvSortHighCheck.setTextColor( + ContextCompat.getColor( + requireContext(), + com.zucchini.core.designsystem.R.color.gray1, + ), + ) + binding.tvSortLowCheck.setTextColor( + ContextCompat.getColor( + requireContext(), + com.zucchini.core.designsystem.R.color.gray1, + ), + ) + } + binding.tvSortHighCheck.setOnClickListener { + binding.tvSortRecent.setTextColor( + ContextCompat.getColor( + requireContext(), + com.zucchini.core.designsystem.R.color.gray1, + ), + ) + binding.tvSortHighCheck.setTextColor( + ContextCompat.getColor( + requireContext(), + com.zucchini.core.designsystem.R.color.olive_black, + ), + ) + binding.tvSortLowCheck.setTextColor( + ContextCompat.getColor( + requireContext(), + com.zucchini.core.designsystem.R.color.gray1, + ), + ) + } + binding.tvSortLowCheck.setOnClickListener { + binding.tvSortRecent.setTextColor( + ContextCompat.getColor( + requireContext(), + com.zucchini.core.designsystem.R.color.gray1, + ), + ) + binding.tvSortHighCheck.setTextColor( + ContextCompat.getColor( + requireContext(), + com.zucchini.core.designsystem.R.color.gray1, + ), + ) + binding.tvSortLowCheck.setTextColor( + ContextCompat.getColor( + requireContext(), + com.zucchini.core.designsystem.R.color.olive_black, + ), + ) + } } + override fun onDestroyView() { super.onDestroyView() _binding = null From 14a1f465b904c34dbe43bd520573ca045b1826ff Mon Sep 17 00:00:00 2001 From: kangyuri1114 Date: Sun, 21 Apr 2024 05:49:07 +0900 Subject: [PATCH 6/6] =?UTF-8?q?[feat]:=20=EA=B2=80=EC=83=89=20=EC=95=84?= =?UTF-8?q?=EC=9D=B4=EC=BD=98=20=EB=94=B0=EB=A1=9C=20=EB=A7=8C=EB=93=A4?= =?UTF-8?q?=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/res/layout/fragment_projects.xml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/feature/projects/src/main/res/layout/fragment_projects.xml b/feature/projects/src/main/res/layout/fragment_projects.xml index 0e335cc..f09f63d 100644 --- a/feature/projects/src/main/res/layout/fragment_projects.xml +++ b/feature/projects/src/main/res/layout/fragment_projects.xml @@ -37,9 +37,8 @@ android:layout_marginHorizontal="20dp" android:background="@drawable/search_background" android:cursorVisible="true" - android:drawableStart="@drawable/ic_search_24" android:drawablePadding="7dp" - android:fontFamily="@font/pretendardblack" + android:fontFamily="@font/pretendardmedium" android:hint="@string/searchbar_hint" android:inputType="text" android:paddingStart="20dp" @@ -51,6 +50,18 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/cl_top_app_bar" /> + +