-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#6 mypage_fragment/설정 화면 : 4 계정 관리 화면
- 서비스 이용약관과 회원탈퇴가 있는 계정 관리 화면
- Loading branch information
Showing
11 changed files
with
462 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
app/src/main/java/com/ftw/hometerview/ui/manageaccount/ManageAccountActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package com.ftw.hometerview.ui.manageaccount | ||
|
||
import android.content.Context | ||
import android.content.Intent | ||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import androidx.databinding.DataBindingUtil | ||
import androidx.lifecycle.Lifecycle | ||
import androidx.lifecycle.lifecycleScope | ||
import androidx.lifecycle.repeatOnLifecycle | ||
import com.ftw.hometerview.R | ||
import com.ftw.hometerview.databinding.ActivityManageAccountBinding | ||
import dagger.hilt.android.AndroidEntryPoint | ||
import kotlinx.coroutines.launch | ||
import javax.inject.Inject | ||
|
||
@AndroidEntryPoint | ||
class ManageAccountActivity : AppCompatActivity() { | ||
|
||
companion object { | ||
fun newIntent(context: Context): Intent { | ||
return Intent(context, ManageAccountActivity::class.java) | ||
} | ||
} | ||
|
||
@Inject | ||
lateinit var viewModel: ManageAccountViewModel | ||
|
||
private lateinit var binding: ActivityManageAccountBinding | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
binding = DataBindingUtil.setContentView<ActivityManageAccountBinding>( | ||
this, | ||
R.layout.activity_manage_account | ||
).apply { | ||
viewModel = this@ManageAccountActivity.viewModel | ||
} | ||
observe() | ||
} | ||
|
||
|
||
private fun observe() { | ||
lifecycleScope.launch { | ||
repeatOnLifecycle(Lifecycle.State.STARTED) { | ||
viewModel.event.collect { event -> | ||
when (event) { | ||
ManageAccountViewModel.Event.None -> {} | ||
ManageAccountViewModel.Event.onClickServiceUseTerms -> onClickServiceUseTerms() | ||
ManageAccountViewModel.Event.onClickUseUserInfo -> onClickUseUserInfo() | ||
ManageAccountViewModel.Event.onClickLocationForService -> onClickLocationForService() | ||
ManageAccountViewModel.Event.onClickOpenSourceLibrary -> onClickOpenSourceLibrary() | ||
ManageAccountViewModel.Event.onClickWithdrawal -> onClickWithdrawal() | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
private fun onClickServiceUseTerms() { } | ||
private fun onClickUseUserInfo() { } | ||
private fun onClickLocationForService() { } | ||
private fun onClickOpenSourceLibrary() { } | ||
private fun onClickWithdrawal() { } | ||
|
||
} |
39 changes: 39 additions & 0 deletions
39
app/src/main/java/com/ftw/hometerview/ui/manageaccount/ManageAccountViewModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.ftw.hometerview.ui.manageaccount | ||
|
||
import kotlinx.coroutines.flow.* | ||
|
||
class ManageAccountViewModel() { | ||
|
||
sealed class Event { | ||
object None : Event() | ||
object onClickServiceUseTerms : Event() | ||
object onClickUseUserInfo : Event() | ||
object onClickLocationForService : Event() | ||
object onClickOpenSourceLibrary : Event() | ||
object onClickWithdrawal : Event() | ||
} | ||
|
||
private val _event: MutableStateFlow<Event> = MutableStateFlow(Event.None) | ||
val event: StateFlow<Event> = _event.asStateFlow() | ||
|
||
fun onClickServiceUseTerms() { | ||
_event.value = Event.onClickServiceUseTerms | ||
_event.value = Event.None | ||
} | ||
fun onClickUseUserInfo() { | ||
_event.value = Event.onClickUseUserInfo | ||
_event.value = Event.None | ||
} | ||
fun onClickLocationForService() { | ||
_event.value = Event.onClickLocationForService | ||
_event.value = Event.None | ||
} | ||
fun onClickOpenSourceLibrary() { | ||
_event.value = Event.onClickOpenSourceLibrary | ||
_event.value = Event.None | ||
} | ||
fun onClickWithdrawal() { | ||
_event.value = Event.onClickWithdrawal | ||
_event.value = Event.None | ||
} | ||
} |
Oops, something went wrong.