Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix]: Onboarding 모듈 내 파일, 함수명에서 접두사(Onboarding)제거 #281

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/src/main/java/com/hmh/hamyeonham/SampleActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import com.hmh.hamyeonham.common.view.viewBinding
import com.hmh.hamyeonham.databinding.ActivitySampleBinding
import com.hmh.hamyeonham.feature.login.LoginActivity
import com.hmh.hamyeonham.feature.onboarding.OnBoardingActivity
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
Expand Down Expand Up @@ -36,7 +37,7 @@ class SampleActivity : AppCompatActivity() {
}

private fun navigateToLogin() {
startActivity(Intent(this, LoginActivity::class.java))
startActivity(Intent(this, OnBoardingActivity::class.java))
finish()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.hmh.hamyeonham.navigation

import android.content.Context
import android.content.Intent
import androidx.fragment.app.Fragment
import com.hmh.hamyeonham.challenge.point.PointActivity
import com.hmh.hamyeonham.common.navigation.NavigationProvider
import com.hmh.hamyeonham.common.permission.PermissionActivity
Expand All @@ -11,7 +10,6 @@ import com.hmh.hamyeonham.feature.login.LoginActivity
import com.hmh.hamyeonham.feature.main.MainActivity
import com.hmh.hamyeonham.feature.onboarding.OnBoardingActivity
import com.hmh.hamyeonham.feature.onboarding.OnBoardingStoryActivity
import com.hmh.hamyeonham.feature.onboarding.fragment.OnBoardingRequestPermissionFragment
import com.hmh.hamyeonham.feature.store.StoreActivity
import dagger.hilt.android.qualifiers.ApplicationContext
import javax.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import com.hmh.hamyeonham.common.context.getAppNameFromPackageName
import com.hmh.hamyeonham.common.view.ItemDiffCallback
import com.hmh.hamyeonham.feature.onboarding.databinding.ItemAddAppBinding

class OnBoardingAppSelectionAdapter(
class AppSelectionAdapter(
private val onAppCheckboxClicked: (String) -> Unit,
private val onAppCheckboxUnClicked: (String) -> Unit,
) :
ListAdapter<AppInfo, OnBoardingAppSelectionAdapter.OnBoardingAppSelectionViewHolder>(
ListAdapter<AppInfo, AppSelectionAdapter.AppSelectionViewHolder>(
ItemDiffCallback(
onItemsTheSame = { oldItem, newItem ->
oldItem == newItem
Expand All @@ -28,23 +28,23 @@ class OnBoardingAppSelectionAdapter(
override fun onCreateViewHolder(
parent: ViewGroup,
viewType: Int,
): OnBoardingAppSelectionViewHolder {
): AppSelectionViewHolder {
val inflater = LayoutInflater.from(parent.context)
val binding = ItemAddAppBinding.inflate(inflater, parent, false)
return OnBoardingAppSelectionViewHolder(
return AppSelectionViewHolder(
binding,
onAppCheckboxClicked = onAppCheckboxClicked,
onAppCheckboxUnClicked = onAppCheckboxUnClicked,
)
}

override fun onBindViewHolder(holder: OnBoardingAppSelectionViewHolder, position: Int) {
override fun onBindViewHolder(holder: AppSelectionViewHolder, position: Int) {
currentList.getOrNull(position)?.let {
holder.onBind(it.packageName)
}
}

inner class OnBoardingAppSelectionViewHolder(
inner class AppSelectionViewHolder(
private val binding: ItemAddAppBinding,
private val onAppCheckboxClicked: (String) -> Unit,
private val onAppCheckboxUnClicked: (String) -> Unit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package com.hmh.hamyeonham.feature.onboarding.adapter
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.hmh.hamyeonham.feature.onboarding.fragment.OnBoardingAppAddSelectionFragment
import com.hmh.hamyeonham.feature.onboarding.fragment.OnBoardingRequestPermissionFragment
import com.hmh.hamyeonham.feature.onboarding.fragment.OnBoardingSelectAppFragment
import com.hmh.hamyeonham.feature.onboarding.fragment.OnBoardingSelectDataFragment
import com.hmh.hamyeonham.feature.onboarding.fragment.OnBoardingSelectScreenTimeFragment
import com.hmh.hamyeonham.feature.onboarding.fragment.OnBoardingSelectUseTimeFragment
import com.hmh.hamyeonham.feature.onboarding.fragment.AppAddSelectionFragment
import com.hmh.hamyeonham.feature.onboarding.fragment.RequestPermissionFragment
import com.hmh.hamyeonham.feature.onboarding.fragment.SelectAppFragment
import com.hmh.hamyeonham.feature.onboarding.fragment.SelectDataFragment
import com.hmh.hamyeonham.feature.onboarding.fragment.SelectScreenTimeFragment
import com.hmh.hamyeonham.feature.onboarding.fragment.SelectUseTimeFragment

enum class OnBoardingFragmentType {
SELECT_DATA_TIME,
Expand All @@ -33,21 +33,21 @@ class OnBoardingFragmentStateAdapter(fragmentActivity: FragmentActivity) :

override fun createFragment(position: Int): Fragment {
return when (val fragmentType = OnBoardingFragmentType.fromPosition(position)) {
OnBoardingFragmentType.SELECT_DATA_TIME -> OnBoardingSelectDataFragment.newInstance(fragmentType)
OnBoardingFragmentType.SELECT_DATA_TIME -> SelectDataFragment.newInstance(fragmentType)

OnBoardingFragmentType.SELECT_DATA_PROBLEM -> OnBoardingSelectDataFragment.newInstance(
OnBoardingFragmentType.SELECT_DATA_PROBLEM -> SelectDataFragment.newInstance(
fragmentType
)

OnBoardingFragmentType.SELECT_DATA_PERIOD -> OnBoardingSelectDataFragment.newInstance(
OnBoardingFragmentType.SELECT_DATA_PERIOD -> SelectDataFragment.newInstance(
fragmentType
)

OnBoardingFragmentType.SELECT_SCREEN_TIME_GOAL -> OnBoardingSelectScreenTimeFragment()
OnBoardingFragmentType.REQUEST_PERMISSION -> OnBoardingRequestPermissionFragment()
OnBoardingFragmentType.SELECT_APP -> OnBoardingSelectAppFragment()
OnBoardingFragmentType.SELECT_APP_VIEW -> OnBoardingAppAddSelectionFragment()
OnBoardingFragmentType.SELECT_USE_TIME_GOAL -> OnBoardingSelectUseTimeFragment()
OnBoardingFragmentType.SELECT_SCREEN_TIME_GOAL -> SelectScreenTimeFragment()
OnBoardingFragmentType.REQUEST_PERMISSION -> RequestPermissionFragment()
OnBoardingFragmentType.SELECT_APP -> SelectAppFragment()
OnBoardingFragmentType.SELECT_APP_VIEW -> AppAddSelectionFragment()
OnBoardingFragmentType.SELECT_USE_TIME_GOAL -> SelectUseTimeFragment()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import com.hmh.hamyeonham.common.fragment.viewLifeCycle
import com.hmh.hamyeonham.common.fragment.viewLifeCycleScope
import com.hmh.hamyeonham.common.view.viewBinding
import com.hmh.hamyeonham.feature.onboarding.R
import com.hmh.hamyeonham.feature.onboarding.adapter.OnBoardingAppSelectionAdapter
import com.hmh.hamyeonham.feature.onboarding.databinding.FragmentOnBoardingAppAddSelectionBinding
import com.hmh.hamyeonham.feature.onboarding.adapter.AppSelectionAdapter
import com.hmh.hamyeonham.feature.onboarding.databinding.FragmentAppAddSelectionBinding
import com.hmh.hamyeonham.feature.onboarding.viewmodel.OnBoardingAppSelectionEffect
import com.hmh.hamyeonham.feature.onboarding.viewmodel.OnBoardingAppSelectionViewModel
import com.hmh.hamyeonham.feature.onboarding.viewmodel.OnBoardingViewModel
Expand All @@ -27,8 +27,8 @@ import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach

@AndroidEntryPoint
class OnBoardingAppAddSelectionFragment : Fragment() {
private val binding by viewBinding(FragmentOnBoardingAppAddSelectionBinding::bind)
class AppAddSelectionFragment : Fragment() {
private val binding by viewBinding(FragmentAppAddSelectionBinding::bind)
private val viewModel by viewModels<OnBoardingAppSelectionViewModel>()
private val activityViewModel by activityViewModels<OnBoardingViewModel>()

Expand All @@ -37,7 +37,7 @@ class OnBoardingAppAddSelectionFragment : Fragment() {
container: ViewGroup?,
savedInstanceState: Bundle?,
): View {
return FragmentOnBoardingAppAddSelectionBinding.inflate(inflater, container, false).root
return FragmentAppAddSelectionBinding.inflate(inflater, container, false).root
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
Expand All @@ -54,7 +54,7 @@ class OnBoardingAppAddSelectionFragment : Fragment() {

private fun initAppSelectionRecyclerAdapter() {
binding.rvAppSelection.run {
adapter = OnBoardingAppSelectionAdapter(
adapter = AppSelectionAdapter(
onAppCheckboxClicked = ::onAppCheckboxClicked,
onAppCheckboxUnClicked = ::onAppCheckboxUnClicked,
)
Expand All @@ -65,7 +65,7 @@ class OnBoardingAppAddSelectionFragment : Fragment() {
private fun collectState() {
viewModel.installedApps.flowWithLifecycle(viewLifeCycle).onEach {
val onboardingAppSelectionAdapter =
binding.rvAppSelection.adapter as? OnBoardingAppSelectionAdapter
binding.rvAppSelection.adapter as? AppSelectionAdapter
onboardingAppSelectionAdapter?.submitList(it)
}.launchIn(viewLifeCycleScope)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ import com.hmh.hamyeonham.common.permission.hasNotificationPermission
import com.hmh.hamyeonham.common.permission.requestNotificationPermission
import com.hmh.hamyeonham.common.view.viewBinding
import com.hmh.hamyeonham.feature.onboarding.R
import com.hmh.hamyeonham.feature.onboarding.databinding.FragmentOnBoardingRequestPermissionBinding
import com.hmh.hamyeonham.feature.onboarding.databinding.FragmentRequestPermissionBinding
import com.hmh.hamyeonham.feature.onboarding.viewmodel.OnBoardingViewModel
import com.hmh.hamyeonham.feature.onboarding.viewmodel.OnboardEvent
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class OnBoardingRequestPermissionFragment : Fragment() {
private val binding by viewBinding(FragmentOnBoardingRequestPermissionBinding::bind)
class RequestPermissionFragment : Fragment() {
private val binding by viewBinding(FragmentRequestPermissionBinding::bind)
private val activityViewModel by activityViewModels<OnBoardingViewModel>()

private val overlayPermissionLauncher: ActivityResultLauncher<Intent> =
Expand Down Expand Up @@ -57,7 +57,7 @@ class OnBoardingRequestPermissionFragment : Fragment() {
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?,
): View = FragmentOnBoardingRequestPermissionBinding.inflate(inflater, container, false).root
): View = FragmentRequestPermissionBinding.inflate(inflater, container, false).root

override fun onViewCreated(
view: View,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
import com.hmh.hamyeonham.common.amplitude.AmplitudeUtils
import com.hmh.hamyeonham.feature.onboarding.R
import com.hmh.hamyeonham.feature.onboarding.databinding.FragmentOnBoardingSelectAppBinding
import com.hmh.hamyeonham.feature.onboarding.databinding.FragmentSelectAppBinding
import com.hmh.hamyeonham.feature.onboarding.viewmodel.OnBoardingViewModel
import com.hmh.hamyeonham.feature.onboarding.viewmodel.OnboardEvent

class OnBoardingSelectAppFragment : Fragment() {
class SelectAppFragment : Fragment() {
private val activityViewModel by activityViewModels<OnBoardingViewModel>()

override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?,
): View = FragmentOnBoardingSelectAppBinding.inflate(inflater, container, false).root
): View = FragmentSelectAppBinding.inflate(inflater, container, false).root

override fun onResume() {
super.onResume()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import com.hmh.hamyeonham.common.primitive.extractDigits
import com.hmh.hamyeonham.common.view.viewBinding
import com.hmh.hamyeonham.feature.onboarding.R
import com.hmh.hamyeonham.feature.onboarding.adapter.OnBoardingFragmentType
import com.hmh.hamyeonham.feature.onboarding.databinding.FragmentOnBoardingSelectDataBinding
import com.hmh.hamyeonham.feature.onboarding.databinding.FragmentSelectDataBinding
import com.hmh.hamyeonham.feature.onboarding.viewmodel.OnBoardingSelectDataViewModel
import com.hmh.hamyeonham.feature.onboarding.viewmodel.OnBoardingViewModel
import com.hmh.hamyeonham.feature.onboarding.viewmodel.OnboardEvent
Expand All @@ -22,8 +22,8 @@ import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach

@AndroidEntryPoint
class OnBoardingSelectDataFragment : Fragment() {
private val binding by viewBinding(FragmentOnBoardingSelectDataBinding::bind)
class SelectDataFragment : Fragment() {
private val binding by viewBinding(FragmentSelectDataBinding::bind)
private val viewModel by viewModels<OnBoardingSelectDataViewModel>()
private val activityViewModel by activityViewModels<OnBoardingViewModel>()

Expand All @@ -34,8 +34,8 @@ class OnBoardingSelectDataFragment : Fragment() {
companion object {
private const val ARG_FRAGMENT_TYPE = "ARG_FRAGMENT_TYPE"

fun newInstance(fragmentType: OnBoardingFragmentType): OnBoardingSelectDataFragment {
val onBoardingFragment = OnBoardingSelectDataFragment()
fun newInstance(fragmentType: OnBoardingFragmentType): SelectDataFragment {
val onBoardingFragment = SelectDataFragment()
val args =
Bundle().apply {
putString(ARG_FRAGMENT_TYPE, fragmentType.name)
Expand All @@ -49,7 +49,7 @@ class OnBoardingSelectDataFragment : Fragment() {
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?,
): View = FragmentOnBoardingSelectDataBinding.inflate(inflater, container, false).root
): View = FragmentSelectDataBinding.inflate(inflater, container, false).root

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ import androidx.fragment.app.activityViewModels
import com.hmh.hamyeonham.common.view.setupScreentimeGoalRange
import com.hmh.hamyeonham.common.view.viewBinding
import com.hmh.hamyeonham.feature.onboarding.R
import com.hmh.hamyeonham.feature.onboarding.databinding.FragmentOnBoardingSelectScreentimeBinding
import com.hmh.hamyeonham.feature.onboarding.databinding.FragmentSelectScreentimeBinding
import com.hmh.hamyeonham.feature.onboarding.viewmodel.OnBoardingViewModel
import com.hmh.hamyeonham.feature.onboarding.viewmodel.OnboardEvent

class OnBoardingSelectScreenTimeFragment : Fragment() {
private val binding by viewBinding(FragmentOnBoardingSelectScreentimeBinding::bind)
class SelectScreenTimeFragment : Fragment() {
private val binding by viewBinding(FragmentSelectScreentimeBinding::bind)
private val activityViewModel by activityViewModels<OnBoardingViewModel>()
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?,
): View {
return FragmentOnBoardingSelectScreentimeBinding.inflate(
return FragmentSelectScreentimeBinding.inflate(
inflater,
container,
false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ import com.hmh.hamyeonham.common.fragment.viewLifeCycleScope
import com.hmh.hamyeonham.common.view.setupScreentimeGoalRange
import com.hmh.hamyeonham.common.view.viewBinding
import com.hmh.hamyeonham.feature.onboarding.R
import com.hmh.hamyeonham.feature.onboarding.databinding.FragmentOnBoardingSelectUseTimeBinding
import com.hmh.hamyeonham.feature.onboarding.databinding.FragmentSelectUseTimeBinding
import com.hmh.hamyeonham.feature.onboarding.viewmodel.OnBoardingViewModel
import com.hmh.hamyeonham.feature.onboarding.viewmodel.OnboardEvent
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach

class OnBoardingSelectUseTimeFragment : Fragment() {
private val binding by viewBinding(FragmentOnBoardingSelectUseTimeBinding::bind)
class SelectUseTimeFragment : Fragment() {
private val binding by viewBinding(FragmentSelectUseTimeBinding::bind)
private val activityViewModel by activityViewModels<OnBoardingViewModel>()

override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?,
): View {
return FragmentOnBoardingSelectUseTimeBinding.inflate(inflater, container, false).root
return FragmentSelectUseTimeBinding.inflate(inflater, container, false).root
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.OnBoardingRequestPermissionFragment">
tools:context=".fragment.RequestPermissionFragment">


<TextView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.OnBoardingSelectAppFragment">
tools:context=".fragment.SelectAppFragment">

<TextView
android:id="@+id/tv_onboarding_select_app_title"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.OnBoardingSelectDataFragment">
tools:context=".fragment.SelectDataFragment">


<TextView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.OnBoardingSelectUseTimeFragment">
tools:context=".fragment.SelectUseTimeFragment">


<TextView
Expand Down
Loading