Skip to content

Commit

Permalink
Issues boostcampwm-2022#287 feat: Setting과 연결된 빈 화면을 정의
Browse files Browse the repository at this point in the history
  • Loading branch information
audxo112 committed Feb 28, 2023
1 parent ddef227 commit 5f23822
Show file tree
Hide file tree
Showing 35 changed files with 446 additions and 1 deletion.
6 changes: 6 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,18 @@ dependencies {
implementation(projects.dataDatabase)
implementation(projects.dataPreference)
implementation(projects.dataRemote)
implementation(projects.uiCoffee)
implementation(projects.uiCommon)
implementation(projects.uiIntro)
implementation(projects.uiMain)
implementation(projects.uiGifticonlist)
implementation(projects.uiHome)
implementation(projects.uiOpensourcelicense)
implementation(projects.uiPersonalinfopolicy)
implementation(projects.uiSecurity)
implementation(projects.uiSetting)
implementation(projects.uiTermsofuse)
implementation(projects.uiUsedgifticon)

implementation(libs.androidX.core.splashscreen)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.lighthouse.domain.usecase.setting

import com.lighthouse.domain.repository.auth.AuthRepository
import com.lighthouse.domain.repository.user.UserRepository
import javax.inject.Inject

class SetNotificationOptionUseCase @Inject constructor(
private val authRepository: AuthRepository,
private val userRepository: UserRepository
) {

suspend operator fun invoke(enable: Boolean): Result<Unit> {
val userId = authRepository.getCurrentUserId()
return userRepository.setNotificationEnable(userId, enable)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.lighthouse.domain.usecase.setting

import com.lighthouse.beep.model.user.SecurityOption
import com.lighthouse.domain.repository.auth.AuthRepository
import com.lighthouse.domain.repository.user.UserRepository
import javax.inject.Inject

class SetSecurityOptionUseCase @Inject constructor(
private val authRepository: AuthRepository,
private val userRepository: UserRepository
) {

suspend operator fun invoke(options: SecurityOption): Result<Unit> {
val userId = authRepository.getCurrentUserId()
return userRepository.setSecurityOption(userId, options)
}
}
1 change: 1 addition & 0 deletions features/ui-coffee/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
30 changes: 30 additions & 0 deletions features/ui-coffee/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
plugins {
id("beep.android.library")
id("beep.android.hilt")
}

android {
namespace = "com.lighthouse.features.coffee"
}

dependencies {
implementation(projects.core)
implementation(projects.coreAndroid)
implementation(projects.model)
implementation(projects.domain)
implementation(projects.common)
implementation(projects.commonAndroid)
implementation(projects.uiCommon)

implementation(libs.androidX.core.ktx)
implementation(libs.androidX.appcompat)
implementation(libs.androidX.constraintlayout)
implementation(libs.androidX.fragment.ktx)

implementation(libs.androidX.navigation.ui.ktx)
implementation(libs.androidX.navigation.fragment.ktx)

implementation(libs.material)

implementation(libs.timber)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.lighthouse.features.coffee.ui

import androidx.fragment.app.Fragment
import com.lighthouse.features.coffee.R
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class CoffeeFragment : Fragment(R.layout.fragment_coffee)
9 changes: 9 additions & 0 deletions features/ui-coffee/src/main/res/layout/fragment_coffee.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
10 changes: 10 additions & 0 deletions features/ui-coffee/src/main/res/navigation/coffee_nav_graph.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/coffee_nav_graph"
app:startDestination="@id/coffee_fragment">

<fragment
android:id="@+id/coffee_fragment"
android:name="com.lighthouse.features.coffee.ui.CoffeeFragment" />
</navigation>
1 change: 1 addition & 0 deletions features/ui-opensourcelicense/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
30 changes: 30 additions & 0 deletions features/ui-opensourcelicense/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
plugins {
id("beep.android.library")
id("beep.android.hilt")
}

android {
namespace = "com.lighthouse.features.opensourcelicense"
}

dependencies {
implementation(projects.core)
implementation(projects.coreAndroid)
implementation(projects.model)
implementation(projects.domain)
implementation(projects.common)
implementation(projects.commonAndroid)
implementation(projects.uiCommon)

implementation(libs.androidX.core.ktx)
implementation(libs.androidX.appcompat)
implementation(libs.androidX.constraintlayout)
implementation(libs.androidX.fragment.ktx)

implementation(libs.androidX.navigation.ui.ktx)
implementation(libs.androidX.navigation.fragment.ktx)

implementation(libs.material)

implementation(libs.timber)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.lighthouse.features.opensourcelicense.ui

import androidx.fragment.app.Fragment
import com.lighthouse.features.opensourcelicense.R
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class OpenSourceLicenseFragment : Fragment(R.layout.fragment_open_source_license)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/open_source_license_nav_graph"
app:startDestination="@id/open_source_license_fragment">

<fragment
android:id="@+id/open_source_license_fragment"
android:name="com.lighthouse.features.opensourcelicense.ui.OpenSourceLicenseFragment" />
</navigation>
1 change: 1 addition & 0 deletions features/ui-personalinfopolicy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
30 changes: 30 additions & 0 deletions features/ui-personalinfopolicy/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
plugins {
id("beep.android.library")
id("beep.android.hilt")
}

android {
namespace = "com.lighthouse.features.personalinfopolicy"
}

dependencies {
implementation(projects.core)
implementation(projects.coreAndroid)
implementation(projects.model)
implementation(projects.domain)
implementation(projects.common)
implementation(projects.commonAndroid)
implementation(projects.uiCommon)

implementation(libs.androidX.core.ktx)
implementation(libs.androidX.appcompat)
implementation(libs.androidX.constraintlayout)
implementation(libs.androidX.fragment.ktx)

implementation(libs.androidX.navigation.ui.ktx)
implementation(libs.androidX.navigation.fragment.ktx)

implementation(libs.material)

implementation(libs.timber)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.lighthouse.geatures.personalinfopolicy.ui

import androidx.fragment.app.Fragment
import com.lighthouse.features.personalinfopolicy.R
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class PersonalInfoPolicyFragment : Fragment(R.layout.fragment_personal_info_policy)
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/personal_info_policy_nav_graph"
app:startDestination="@id/personal_info_policy_fragment">

<fragment
android:id="@+id/personal_info_policy_fragment"
android:name="com.lighthouse.geatures.personalinfopolicy.ui.PersonalInfoPolicyFragment" />
</navigation>
30 changes: 30 additions & 0 deletions features/ui-security/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
plugins {
id("beep.android.library")
id("beep.android.hilt")
}

android {
namespace = "com.lighthouse.features.security"
}

dependencies {
implementation(projects.core)
implementation(projects.coreAndroid)
implementation(projects.model)
implementation(projects.domain)
implementation(projects.common)
implementation(projects.commonAndroid)
implementation(projects.uiCommon)

implementation(libs.androidX.core.ktx)
implementation(libs.androidX.appcompat)
implementation(libs.androidX.constraintlayout)
implementation(libs.androidX.fragment.ktx)

implementation(libs.androidX.navigation.ui.ktx)
implementation(libs.androidX.navigation.fragment.ktx)

implementation(libs.material)

implementation(libs.timber)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.lighthouse.features.security.ui

import androidx.fragment.app.Fragment
import com.lighthouse.features.security.R

class SecurityFragment : Fragment(R.layout.fragment_security)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/security_nav_graph"
app:startDestination="@id/security_fragment">

<fragment
android:id="@+id/security_fragment"
android:name="com.lighthouse.features.security.ui.SecurityFragment"/>
</navigation>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
import com.lighthouse.features.common.binding.viewBindings
import com.lighthouse.features.setting.R
import com.lighthouse.features.setting.adapter.SettingAdapter
import com.lighthouse.features.setting.databinding.FragmentSettingBinding
import com.lighthouse.features.setting.model.SettingMenu
import com.lighthouse.features.setting.navigator.SettingNav
import dagger.hilt.android.AndroidEntryPoint
import javax.inject.Inject
Expand All @@ -18,10 +20,45 @@ class SettingFragment : Fragment(R.layout.fragment_setting) {

private val viewModel: SettingViewModel by viewModels()

private val adapter = SettingAdapter(
onClick = { menu ->
setUpMenuOnClick(menu)
},
onCheckedChange = { menu, isChecked ->
setUpMenuOnCheckedChange(menu, isChecked)
}
)

@Inject
lateinit var nav: SettingNav

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
}

private fun setUpSettingMenu() {
}

private fun setUpMenuOnClick(menu: SettingMenu) {
when (menu) {
SettingMenu.USED_GIFTICON -> {}
SettingMenu.SECURITY -> {}
SettingMenu.LOCATION -> {}
SettingMenu.SIGN_IN -> {}
SettingMenu.SIGN_OUT -> {}
SettingMenu.WITHDRAWAL -> {}
SettingMenu.COFFEE -> {}
SettingMenu.TERMS_OF_USE -> {}
SettingMenu.PERSONAL_INFO_POLICY -> {}
SettingMenu.OPEN_SOURCE_LICENSE -> {}
else -> Unit
}
}

private fun setUpMenuOnCheckedChange(menu: SettingMenu, isChecked: Boolean) {
when (menu) {
SettingMenu.IMMINENT_NOTIFICATION -> viewModel.setNotificationEnable(isChecked)
else -> Unit
}
}
}
Loading

0 comments on commit 5f23822

Please sign in to comment.