feat(notification): 알림 수신 설정 화면을 추가한다
This commit is contained in:
@@ -150,6 +150,7 @@
|
|||||||
<activity android:name=".settings.event.EventActivity" />
|
<activity android:name=".settings.event.EventActivity" />
|
||||||
<activity android:name=".settings.event.EventDetailActivity" />
|
<activity android:name=".settings.event.EventDetailActivity" />
|
||||||
<activity android:name=".settings.notification.NotificationSettingsActivity" />
|
<activity android:name=".settings.notification.NotificationSettingsActivity" />
|
||||||
|
<activity android:name=".settings.notification.NotificationReceiveSettingsActivity" />
|
||||||
<activity android:name=".settings.ContentSettingsActivity" />
|
<activity android:name=".settings.ContentSettingsActivity" />
|
||||||
<activity android:name=".live.reservation_status.LiveReservationStatusActivity" />
|
<activity android:name=".live.reservation_status.LiveReservationStatusActivity" />
|
||||||
<activity android:name=".live.reservation_status.LiveReservationCancelActivity" />
|
<activity android:name=".live.reservation_status.LiveReservationCancelActivity" />
|
||||||
|
|||||||
@@ -160,6 +160,7 @@ import kr.co.vividnext.sodalive.settings.event.EventViewModel
|
|||||||
import kr.co.vividnext.sodalive.settings.notice.NoticeApi
|
import kr.co.vividnext.sodalive.settings.notice.NoticeApi
|
||||||
import kr.co.vividnext.sodalive.settings.notice.NoticeRepository
|
import kr.co.vividnext.sodalive.settings.notice.NoticeRepository
|
||||||
import kr.co.vividnext.sodalive.settings.notice.NoticeViewModel
|
import kr.co.vividnext.sodalive.settings.notice.NoticeViewModel
|
||||||
|
import kr.co.vividnext.sodalive.settings.notification.NotificationReceiveSettingsViewModel
|
||||||
import kr.co.vividnext.sodalive.settings.notification.NotificationSettingsViewModel
|
import kr.co.vividnext.sodalive.settings.notification.NotificationSettingsViewModel
|
||||||
import kr.co.vividnext.sodalive.settings.signout.SignOutViewModel
|
import kr.co.vividnext.sodalive.settings.signout.SignOutViewModel
|
||||||
import kr.co.vividnext.sodalive.settings.terms.TermsApi
|
import kr.co.vividnext.sodalive.settings.terms.TermsApi
|
||||||
@@ -329,6 +330,7 @@ class AppDI(private val context: Context, isDebugMode: Boolean) {
|
|||||||
viewModel { NoticeViewModel(get()) }
|
viewModel { NoticeViewModel(get()) }
|
||||||
viewModel { EventViewModel(get()) }
|
viewModel { EventViewModel(get()) }
|
||||||
viewModel { NotificationSettingsViewModel(get()) }
|
viewModel { NotificationSettingsViewModel(get()) }
|
||||||
|
viewModel { NotificationReceiveSettingsViewModel(get(), get()) }
|
||||||
viewModel { ContentSettingsViewModel() }
|
viewModel { ContentSettingsViewModel() }
|
||||||
viewModel { SettingsViewModel(get(), get()) }
|
viewModel { SettingsViewModel(get(), get()) }
|
||||||
viewModel { SeriesDetailViewModel(get(), get()) }
|
viewModel { SeriesDetailViewModel(get(), get()) }
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import kr.co.vividnext.sodalive.common.LoadingDialog
|
|||||||
import kr.co.vividnext.sodalive.databinding.ActivityPushNotificationListBinding
|
import kr.co.vividnext.sodalive.databinding.ActivityPushNotificationListBinding
|
||||||
import kr.co.vividnext.sodalive.extensions.dpToPx
|
import kr.co.vividnext.sodalive.extensions.dpToPx
|
||||||
import kr.co.vividnext.sodalive.home.HomeContentThemeAdapter
|
import kr.co.vividnext.sodalive.home.HomeContentThemeAdapter
|
||||||
|
import kr.co.vividnext.sodalive.settings.notification.NotificationReceiveSettingsActivity
|
||||||
import org.koin.android.ext.android.inject
|
import org.koin.android.ext.android.inject
|
||||||
|
|
||||||
class PushNotificationListActivity : BaseActivity<ActivityPushNotificationListBinding>(
|
class PushNotificationListActivity : BaseActivity<ActivityPushNotificationListBinding>(
|
||||||
@@ -37,6 +38,9 @@ class PushNotificationListActivity : BaseActivity<ActivityPushNotificationListBi
|
|||||||
loadingDialog = LoadingDialog(this, layoutInflater)
|
loadingDialog = LoadingDialog(this, layoutInflater)
|
||||||
binding.tvBack.text = getString(R.string.screen_push_notification_title)
|
binding.tvBack.text = getString(R.string.screen_push_notification_title)
|
||||||
binding.tvBack.setOnClickListener { finish() }
|
binding.tvBack.setOnClickListener { finish() }
|
||||||
|
binding.ivSettings.setOnClickListener {
|
||||||
|
startActivity(Intent(this, NotificationReceiveSettingsActivity::class.java))
|
||||||
|
}
|
||||||
|
|
||||||
setupCategoryList()
|
setupCategoryList()
|
||||||
setupNotificationList()
|
setupNotificationList()
|
||||||
|
|||||||
@@ -0,0 +1,185 @@
|
|||||||
|
package kr.co.vividnext.sodalive.settings.notification
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
import android.content.Intent
|
||||||
|
import android.graphics.Rect
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.view.View
|
||||||
|
import android.widget.Toast
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import kr.co.vividnext.sodalive.R
|
||||||
|
import kr.co.vividnext.sodalive.base.BaseActivity
|
||||||
|
import kr.co.vividnext.sodalive.common.Constants
|
||||||
|
import kr.co.vividnext.sodalive.common.LoadingDialog
|
||||||
|
import kr.co.vividnext.sodalive.databinding.ActivityNotificationReceiveSettingsBinding
|
||||||
|
import kr.co.vividnext.sodalive.explorer.profile.CreatorFollowNotifyFragment
|
||||||
|
import kr.co.vividnext.sodalive.explorer.profile.UserProfileActivity
|
||||||
|
import kr.co.vividnext.sodalive.extensions.dpToPx
|
||||||
|
import kr.co.vividnext.sodalive.following.FollowingCreatorAdapter
|
||||||
|
import org.koin.android.ext.android.inject
|
||||||
|
|
||||||
|
class NotificationReceiveSettingsActivity : BaseActivity<ActivityNotificationReceiveSettingsBinding>(
|
||||||
|
ActivityNotificationReceiveSettingsBinding::inflate
|
||||||
|
) {
|
||||||
|
|
||||||
|
private val viewModel: NotificationReceiveSettingsViewModel by inject()
|
||||||
|
|
||||||
|
private lateinit var loadingDialog: LoadingDialog
|
||||||
|
private lateinit var adapter: FollowingCreatorAdapter
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
bindData()
|
||||||
|
|
||||||
|
viewModel.getNotificationSettings()
|
||||||
|
viewModel.getFollowedCreatorAllList()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun setupView() {
|
||||||
|
loadingDialog = LoadingDialog(this, layoutInflater)
|
||||||
|
|
||||||
|
binding.toolbar.tvBack.text = getString(R.string.screen_notification_receive_settings_title)
|
||||||
|
binding.toolbar.tvBack.setOnClickListener { finish() }
|
||||||
|
|
||||||
|
binding.ivNotifiedLive.setOnClickListener {
|
||||||
|
viewModel.toggleFollowingChannelLiveNotice()
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.ivNotifiedUploadContent.setOnClickListener {
|
||||||
|
viewModel.toggleFollowingChannelUploadContentNotice()
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.ivMessage.setOnClickListener { viewModel.toggleMessage() }
|
||||||
|
|
||||||
|
setupFollowingChannels()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setupFollowingChannels() {
|
||||||
|
adapter = FollowingCreatorAdapter(
|
||||||
|
onClickItem = { creatorId ->
|
||||||
|
startActivity(
|
||||||
|
Intent(applicationContext, UserProfileActivity::class.java).apply {
|
||||||
|
putExtra(Constants.EXTRA_USER_ID, creatorId)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
|
onClickFollow = { creatorId, isFollow ->
|
||||||
|
if (isFollow) {
|
||||||
|
val notifyFragment = CreatorFollowNotifyFragment(
|
||||||
|
onClickNotifyAll = {
|
||||||
|
viewModel.follow(creatorId, follow = true, notify = true)
|
||||||
|
},
|
||||||
|
onClickNotifyNone = {
|
||||||
|
viewModel.follow(creatorId, follow = true, notify = false)
|
||||||
|
},
|
||||||
|
onClickUnFollow = {
|
||||||
|
viewModel.follow(creatorId, follow = false, notify = false)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
if (notifyFragment.isAdded) return@FollowingCreatorAdapter
|
||||||
|
notifyFragment.show(supportFragmentManager, notifyFragment.tag)
|
||||||
|
} else {
|
||||||
|
viewModel.follow(creatorId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
binding.rvFollowingChannel.layoutManager = LinearLayoutManager(
|
||||||
|
applicationContext,
|
||||||
|
LinearLayoutManager.VERTICAL,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
|
||||||
|
binding.rvFollowingChannel.addItemDecoration(object : RecyclerView.ItemDecoration() {
|
||||||
|
override fun getItemOffsets(
|
||||||
|
outRect: Rect,
|
||||||
|
view: View,
|
||||||
|
parent: RecyclerView,
|
||||||
|
state: RecyclerView.State
|
||||||
|
) {
|
||||||
|
super.getItemOffsets(outRect, view, parent, state)
|
||||||
|
outRect.left = 13.3f.dpToPx().toInt()
|
||||||
|
outRect.right = 13.3f.dpToPx().toInt()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
binding.rvFollowingChannel.adapter = adapter
|
||||||
|
|
||||||
|
binding.nsvContent.setOnScrollChangeListener { _, _, scrollY, _, _ ->
|
||||||
|
val contentView = binding.nsvContent.getChildAt(0) ?: return@setOnScrollChangeListener
|
||||||
|
if (scrollY >= contentView.measuredHeight - binding.nsvContent.measuredHeight) {
|
||||||
|
viewModel.getFollowedCreatorAllList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
|
private fun bindData() {
|
||||||
|
viewModel.followingChannelLiveNotice.observe(this) {
|
||||||
|
binding.ivNotifiedLive.setImageResource(
|
||||||
|
if (it) {
|
||||||
|
R.drawable.btn_toggle_on_big
|
||||||
|
} else {
|
||||||
|
R.drawable.btn_toggle_off_big
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
viewModel.followingChannelUploadContentNotice.observe(this) {
|
||||||
|
binding.ivNotifiedUploadContent.setImageResource(
|
||||||
|
if (it) {
|
||||||
|
R.drawable.btn_toggle_on_big
|
||||||
|
} else {
|
||||||
|
R.drawable.btn_toggle_off_big
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
viewModel.isMessage.observe(this) {
|
||||||
|
binding.ivMessage.setImageResource(
|
||||||
|
if (it) {
|
||||||
|
R.drawable.btn_toggle_on_big
|
||||||
|
} else {
|
||||||
|
R.drawable.btn_toggle_off_big
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
viewModel.creatorListLiveData.observe(this) {
|
||||||
|
if (viewModel.page == 2) adapter.clear()
|
||||||
|
adapter.addAll(it)
|
||||||
|
}
|
||||||
|
|
||||||
|
viewModel.creatorListTotalCountLiveData.observe(this) {
|
||||||
|
binding.tvTotalCount.text = " ${getString(
|
||||||
|
R.string.following_creator_total_count_value,
|
||||||
|
it
|
||||||
|
)} "
|
||||||
|
|
||||||
|
if (it > 0) {
|
||||||
|
binding.tvNone.visibility = View.GONE
|
||||||
|
binding.rvFollowingChannel.visibility = View.VISIBLE
|
||||||
|
} else {
|
||||||
|
binding.tvNone.visibility = View.VISIBLE
|
||||||
|
binding.rvFollowingChannel.visibility = View.GONE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
viewModel.isLoading.observe(this) {
|
||||||
|
if (it) {
|
||||||
|
loadingDialog.show(screenWidth, "")
|
||||||
|
} else {
|
||||||
|
loadingDialog.dismiss()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
viewModel.toastLiveData.observe(this) {
|
||||||
|
val text = it?.message ?: it?.resId?.let { resId -> getString(resId) }
|
||||||
|
text?.let { message ->
|
||||||
|
Toast.makeText(applicationContext, message, Toast.LENGTH_LONG).show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,218 @@
|
|||||||
|
package kr.co.vividnext.sodalive.settings.notification
|
||||||
|
|
||||||
|
import androidx.lifecycle.LiveData
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import com.orhanobut.logger.Logger
|
||||||
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
|
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||||
|
import kr.co.vividnext.sodalive.R
|
||||||
|
import kr.co.vividnext.sodalive.base.BaseViewModel
|
||||||
|
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
|
||||||
|
import kr.co.vividnext.sodalive.common.ToastMessage
|
||||||
|
import kr.co.vividnext.sodalive.following.FollowingCreatorRepository
|
||||||
|
import kr.co.vividnext.sodalive.following.GetCreatorFollowingAllListItem
|
||||||
|
import kr.co.vividnext.sodalive.user.UserRepository
|
||||||
|
|
||||||
|
class NotificationReceiveSettingsViewModel(
|
||||||
|
private val userRepository: UserRepository,
|
||||||
|
private val followingCreatorRepository: FollowingCreatorRepository
|
||||||
|
) : BaseViewModel() {
|
||||||
|
|
||||||
|
private val _toastLiveData = MutableLiveData<ToastMessage?>()
|
||||||
|
val toastLiveData: LiveData<ToastMessage?>
|
||||||
|
get() = _toastLiveData
|
||||||
|
|
||||||
|
private val _isLoading = MutableLiveData(false)
|
||||||
|
val isLoading: LiveData<Boolean>
|
||||||
|
get() = _isLoading
|
||||||
|
|
||||||
|
private val _followingChannelLiveNotice = MutableLiveData(false)
|
||||||
|
val followingChannelLiveNotice: LiveData<Boolean>
|
||||||
|
get() = _followingChannelLiveNotice
|
||||||
|
|
||||||
|
private val _isMessage = MutableLiveData(false)
|
||||||
|
val isMessage: LiveData<Boolean>
|
||||||
|
get() = _isMessage
|
||||||
|
|
||||||
|
private val _followingChannelUploadContentNotice = MutableLiveData(false)
|
||||||
|
val followingChannelUploadContentNotice: LiveData<Boolean>
|
||||||
|
get() = _followingChannelUploadContentNotice
|
||||||
|
|
||||||
|
private val _creatorListLiveData = MutableLiveData<List<GetCreatorFollowingAllListItem>>()
|
||||||
|
val creatorListLiveData: LiveData<List<GetCreatorFollowingAllListItem>>
|
||||||
|
get() = _creatorListLiveData
|
||||||
|
|
||||||
|
private val _creatorListTotalCountLiveData = MutableLiveData(0)
|
||||||
|
val creatorListTotalCountLiveData: LiveData<Int>
|
||||||
|
get() = _creatorListTotalCountLiveData
|
||||||
|
|
||||||
|
private var _isFollowingListLoading = MutableLiveData(false)
|
||||||
|
|
||||||
|
var page = 1
|
||||||
|
var isLast = false
|
||||||
|
private var pageSize = PAGE_SIZE
|
||||||
|
|
||||||
|
fun getNotificationSettings() {
|
||||||
|
_isLoading.value = true
|
||||||
|
|
||||||
|
compositeDisposable.add(
|
||||||
|
userRepository.getMemberInfo(token = "Bearer ${SharedPreferenceManager.token}")
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(
|
||||||
|
{
|
||||||
|
_isLoading.value = false
|
||||||
|
|
||||||
|
if (it.success && it.data != null) {
|
||||||
|
val data = it.data
|
||||||
|
_isMessage.value = data.messageNotice ?: false
|
||||||
|
_followingChannelUploadContentNotice.value =
|
||||||
|
data.followingChannelUploadContentNotice ?: false
|
||||||
|
_followingChannelLiveNotice.value =
|
||||||
|
data.followingChannelLiveNotice ?: false
|
||||||
|
} else {
|
||||||
|
if (it.message != null) {
|
||||||
|
_toastLiveData.postValue(ToastMessage(message = it.message))
|
||||||
|
} else {
|
||||||
|
_toastLiveData.postValue(
|
||||||
|
ToastMessage(resId = R.string.common_error_unknown)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
_isLoading.value = false
|
||||||
|
it.message?.let { message -> Logger.e(message) }
|
||||||
|
_toastLiveData.postValue(ToastMessage(resId = R.string.retry))
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun toggleFollowingChannelLiveNotice() {
|
||||||
|
val nextValue = !(_followingChannelLiveNotice.value ?: false)
|
||||||
|
_followingChannelLiveNotice.value = nextValue
|
||||||
|
updateNotificationSettings(live = nextValue)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun toggleFollowingChannelUploadContentNotice() {
|
||||||
|
val nextValue = !(_followingChannelUploadContentNotice.value ?: false)
|
||||||
|
_followingChannelUploadContentNotice.value = nextValue
|
||||||
|
updateNotificationSettings(uploadContent = nextValue)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun toggleMessage() {
|
||||||
|
val nextValue = !(_isMessage.value ?: false)
|
||||||
|
_isMessage.value = nextValue
|
||||||
|
updateNotificationSettings(message = nextValue)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun updateNotificationSettings(
|
||||||
|
live: Boolean? = null,
|
||||||
|
uploadContent: Boolean? = null,
|
||||||
|
message: Boolean? = null
|
||||||
|
) {
|
||||||
|
if (live != null || uploadContent != null || message != null) {
|
||||||
|
compositeDisposable.add(
|
||||||
|
userRepository.updateNotificationSettings(
|
||||||
|
request = UpdateNotificationSettingRequest(
|
||||||
|
live = live,
|
||||||
|
uploadContent = uploadContent,
|
||||||
|
message = message
|
||||||
|
),
|
||||||
|
token = "Bearer ${SharedPreferenceManager.token}"
|
||||||
|
)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe({}, {})
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getFollowedCreatorAllList() {
|
||||||
|
if (isLast || _isFollowingListLoading.value == true) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
_isFollowingListLoading.value = true
|
||||||
|
|
||||||
|
compositeDisposable.add(
|
||||||
|
followingCreatorRepository.getFollowedCreatorAllList(
|
||||||
|
page = page,
|
||||||
|
size = pageSize,
|
||||||
|
token = "Bearer ${SharedPreferenceManager.token}"
|
||||||
|
)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(
|
||||||
|
{
|
||||||
|
_isFollowingListLoading.value = false
|
||||||
|
pageSize = PAGE_SIZE
|
||||||
|
|
||||||
|
if (it.success && it.data != null) {
|
||||||
|
if (it.data.items.isEmpty()) {
|
||||||
|
isLast = true
|
||||||
|
} else {
|
||||||
|
page += 1
|
||||||
|
_creatorListTotalCountLiveData.value = it.data.totalCount
|
||||||
|
_creatorListLiveData.value = it.data.items
|
||||||
|
}
|
||||||
|
} else if (it.message != null) {
|
||||||
|
_toastLiveData.postValue(ToastMessage(message = it.message))
|
||||||
|
} else {
|
||||||
|
_toastLiveData.postValue(
|
||||||
|
ToastMessage(resId = R.string.common_error_unknown)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
_isFollowingListLoading.value = false
|
||||||
|
it.message?.let { message -> Logger.e(message) }
|
||||||
|
_toastLiveData.postValue(ToastMessage(resId = R.string.common_error_unknown))
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun follow(creatorId: Long, follow: Boolean = true, notify: Boolean = true) {
|
||||||
|
_isLoading.value = true
|
||||||
|
|
||||||
|
compositeDisposable.add(
|
||||||
|
userRepository.creatorFollow(
|
||||||
|
creatorId = creatorId,
|
||||||
|
follow = follow,
|
||||||
|
notify = notify,
|
||||||
|
token = "Bearer ${SharedPreferenceManager.token}"
|
||||||
|
)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(
|
||||||
|
{
|
||||||
|
_isLoading.value = false
|
||||||
|
|
||||||
|
if (it.success && it.data != null) {
|
||||||
|
isLast = false
|
||||||
|
pageSize *= page
|
||||||
|
page = 1
|
||||||
|
getFollowedCreatorAllList()
|
||||||
|
} else if (it.message != null) {
|
||||||
|
_toastLiveData.postValue(ToastMessage(message = it.message))
|
||||||
|
} else {
|
||||||
|
_toastLiveData.postValue(
|
||||||
|
ToastMessage(resId = R.string.common_error_unknown)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
_isLoading.value = false
|
||||||
|
it.message?.let { message -> Logger.e(message) }
|
||||||
|
_toastLiveData.postValue(ToastMessage(resId = R.string.common_error_unknown))
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private const val PAGE_SIZE = 20
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,204 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/black"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<include
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
layout="@layout/detail_toolbar" />
|
||||||
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
|
android:id="@+id/nsv_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:fillViewport="true"
|
||||||
|
android:scrollbars="none">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingBottom="13.3dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="13.3dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:fontFamily="@font/bold"
|
||||||
|
android:text="@string/screen_notification_receive_settings_service_section"
|
||||||
|
android:textColor="@color/color_eeeeee"
|
||||||
|
android:textSize="13.3sp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="13.3dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:background="@drawable/bg_round_corner_6_7_222222"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingVertical="13.3dp"
|
||||||
|
android:paddingStart="16.7dp"
|
||||||
|
android:paddingEnd="13.3dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:fontFamily="@font/bold"
|
||||||
|
android:text="@string/notification_settings_live"
|
||||||
|
android:textColor="@color/color_eeeeee"
|
||||||
|
android:textSize="14.7sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_notified_live"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
tools:src="@drawable/btn_toggle_off_big" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_marginHorizontal="13.3dp"
|
||||||
|
android:background="@color/color_88909090" />
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingVertical="13.3dp"
|
||||||
|
android:paddingStart="16.7dp"
|
||||||
|
android:paddingEnd="13.3dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:fontFamily="@font/bold"
|
||||||
|
android:text="@string/notification_settings_upload"
|
||||||
|
android:textColor="@color/color_eeeeee"
|
||||||
|
android:textSize="14.7sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_notified_upload_content"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
tools:src="@drawable/btn_toggle_on_big" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_marginHorizontal="13.3dp"
|
||||||
|
android:background="@color/color_88909090" />
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingVertical="13.3dp"
|
||||||
|
android:paddingStart="16.7dp"
|
||||||
|
android:paddingEnd="13.3dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:fontFamily="@font/bold"
|
||||||
|
android:text="@string/notification_settings_message"
|
||||||
|
android:textColor="@color/color_eeeeee"
|
||||||
|
android:textSize="14.7sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_message"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
tools:src="@drawable/btn_toggle_on_big" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="13.3dp"
|
||||||
|
android:layout_marginTop="26.7dp"
|
||||||
|
android:fontFamily="@font/bold"
|
||||||
|
android:text="@string/screen_notification_receive_settings_following_section"
|
||||||
|
android:textColor="@color/color_eeeeee"
|
||||||
|
android:textSize="13.3sp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_total_count"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="13.3dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingHorizontal="13.3dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="@font/medium"
|
||||||
|
android:text="@string/following_creator_total_prefix"
|
||||||
|
android:textColor="@color/color_eeeeee"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_total_count"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="@font/medium"
|
||||||
|
android:textColor="@color/color_dd4500"
|
||||||
|
android:textSize="12sp"
|
||||||
|
tools:text=" 10" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="@font/medium"
|
||||||
|
android:text="@string/following_creator_total_suffix"
|
||||||
|
android:textColor="@color/color_eeeeee"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/rv_following_channel"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="13.3dp"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:nestedScrollingEnabled="false"
|
||||||
|
android:paddingBottom="13.3dp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_none"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="13.3dp"
|
||||||
|
android:fontFamily="@font/medium"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingVertical="40dp"
|
||||||
|
android:text="@string/following_creator_empty"
|
||||||
|
android:textColor="@color/color_bbbbbb" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -988,6 +988,9 @@
|
|||||||
<string name="screen_content_settings_male">Male-oriented</string>
|
<string name="screen_content_settings_male">Male-oriented</string>
|
||||||
<string name="screen_content_settings_female">Female-oriented</string>
|
<string name="screen_content_settings_female">Female-oriented</string>
|
||||||
<string name="screen_notification_settings_title">Notification settings</string>
|
<string name="screen_notification_settings_title">Notification settings</string>
|
||||||
|
<string name="screen_notification_receive_settings_title">Notification receive settings</string>
|
||||||
|
<string name="screen_notification_receive_settings_service_section">Service notifications</string>
|
||||||
|
<string name="screen_notification_receive_settings_following_section">Following channels</string>
|
||||||
<string name="notification_settings_live">Live notifications</string>
|
<string name="notification_settings_live">Live notifications</string>
|
||||||
<string name="notification_settings_upload">Content upload notifications</string>
|
<string name="notification_settings_upload">Content upload notifications</string>
|
||||||
<string name="notification_settings_message">Message notifications</string>
|
<string name="notification_settings_message">Message notifications</string>
|
||||||
|
|||||||
@@ -988,6 +988,9 @@
|
|||||||
<string name="screen_content_settings_male">男性向け</string>
|
<string name="screen_content_settings_male">男性向け</string>
|
||||||
<string name="screen_content_settings_female">女性向け</string>
|
<string name="screen_content_settings_female">女性向け</string>
|
||||||
<string name="screen_notification_settings_title">通知設定</string>
|
<string name="screen_notification_settings_title">通知設定</string>
|
||||||
|
<string name="screen_notification_receive_settings_title">通知受信設定</string>
|
||||||
|
<string name="screen_notification_receive_settings_service_section">サービス通知</string>
|
||||||
|
<string name="screen_notification_receive_settings_following_section">フォロー中のチャンネル</string>
|
||||||
<string name="notification_settings_live">ライブ通知</string>
|
<string name="notification_settings_live">ライブ通知</string>
|
||||||
<string name="notification_settings_upload">コンテンツ投稿通知</string>
|
<string name="notification_settings_upload">コンテンツ投稿通知</string>
|
||||||
<string name="notification_settings_message">メッセージ通知</string>
|
<string name="notification_settings_message">メッセージ通知</string>
|
||||||
|
|||||||
@@ -987,6 +987,9 @@
|
|||||||
<string name="screen_content_settings_male">남성향</string>
|
<string name="screen_content_settings_male">남성향</string>
|
||||||
<string name="screen_content_settings_female">여성향</string>
|
<string name="screen_content_settings_female">여성향</string>
|
||||||
<string name="screen_notification_settings_title">알림 설정</string>
|
<string name="screen_notification_settings_title">알림 설정</string>
|
||||||
|
<string name="screen_notification_receive_settings_title">알림 수신 설정</string>
|
||||||
|
<string name="screen_notification_receive_settings_service_section">서비스 알림</string>
|
||||||
|
<string name="screen_notification_receive_settings_following_section">팔로잉 채널</string>
|
||||||
<string name="notification_settings_live">라이브 알림</string>
|
<string name="notification_settings_live">라이브 알림</string>
|
||||||
<string name="notification_settings_upload">콘텐츠 업로드 알림</string>
|
<string name="notification_settings_upload">콘텐츠 업로드 알림</string>
|
||||||
<string name="notification_settings_message">메시지 알림</string>
|
<string name="notification_settings_message">메시지 알림</string>
|
||||||
|
|||||||
38
docs/20260313_알림수신설정페이지개발.md
Normal file
38
docs/20260313_알림수신설정페이지개발.md
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
# 2026-03-13 알림 수신 설정 페이지 개발
|
||||||
|
|
||||||
|
## 완료 기준
|
||||||
|
- [x] 알림 리스트 우측 상단 이미지(`iv_settings`) 터치 시 신규 알림 수신 설정 페이지로 이동한다.
|
||||||
|
- [x] 신규 페이지는 기존 알림 설정 페이지를 대체하지 않고 별도 Activity로 생성된다.
|
||||||
|
- [x] 페이지는 `서비스 알림` + `팔로잉 채널` 2개 섹션이며 전체가 하나의 스크롤로 동작한다.
|
||||||
|
- [x] `서비스 알림` 섹션 UI/토글 액션은 기존 `NotificationSettingsActivity`와 동일하게 동작한다.
|
||||||
|
- [x] `팔로잉 채널` 섹션 UI는 기존 팔로잉 리스트와 동일하며 무한 스크롤로 20개씩 로드한다.
|
||||||
|
|
||||||
|
## 체크리스트
|
||||||
|
- [x] 기존 진입/재사용 패턴 분석
|
||||||
|
- [x] 신규 알림 수신 설정 Activity/ViewModel/Layout 구현
|
||||||
|
- [x] 서비스 알림 토글 액션 기존 로직과 동일하게 연결
|
||||||
|
- [x] 팔로잉 채널 리스트(20개 페이징/무한 스크롤) 연결
|
||||||
|
- [x] 알림 리스트 우측 상단 이미지 진입 연결
|
||||||
|
- [x] 검증(진단/테스트/빌드) 수행 및 기록
|
||||||
|
|
||||||
|
## 검증 기록
|
||||||
|
- 2026-03-13
|
||||||
|
- 무엇/왜/어떻게: 작업 시작 전 요구사항을 완료 기준으로 고정하고 구현 체크리스트를 문서화했다.
|
||||||
|
- 실행 명령: `glob(pattern="docs/*.md", path="/Users/klaus/Develop/sodalive/Android/SodaLive")`, `read(filePath="/Users/klaus/Develop/sodalive/Android/SodaLive/docs/20260312_알림리스트구현.md")`
|
||||||
|
- 결과: 기존 문서 형식을 확인하고 신규 계획 문서를 생성했다.
|
||||||
|
- 2026-03-13
|
||||||
|
- 무엇/왜/어떻게: 알림 리스트 진입점과 재사용 가능한 알림/팔로잉 구현 패턴을 교차 확인해 신규 화면 구성 근거를 확보했다.
|
||||||
|
- 실행 명령: `background_output(task_id="bg_8f327a73")`, `background_output(task_id="bg_d549966d")`, `read(filePath="/Users/klaus/Develop/sodalive/Android/SodaLive/app/src/main/java/kr/co/vividnext/sodalive/home/pushnotification/PushNotificationListActivity.kt")`, `read(filePath="/Users/klaus/Develop/sodalive/Android/SodaLive/app/src/main/java/kr/co/vividnext/sodalive/settings/notification/NotificationSettingsActivity.kt")`, `read(filePath="/Users/klaus/Develop/sodalive/Android/SodaLive/app/src/main/java/kr/co/vividnext/sodalive/following/FollowingCreatorActivity.kt")`
|
||||||
|
- 결과: `iv_settings` 클릭 미연결 상태를 확인했고, 토글/팔로잉 리스트 패턴 및 페이징 구조를 신규 화면에 반영했다.
|
||||||
|
- 2026-03-13
|
||||||
|
- 무엇/왜/어떻게: 신규 화면/연결 코드의 정적 진단 가능 여부를 확인했다.
|
||||||
|
- 실행 명령: `lsp_diagnostics(filePath="/Users/klaus/Develop/sodalive/Android/SodaLive/app/src/main/java/kr/co/vividnext/sodalive/settings/notification/NotificationReceiveSettingsActivity.kt")`, `lsp_diagnostics(filePath="/Users/klaus/Develop/sodalive/Android/SodaLive/app/src/main/java/kr/co/vividnext/sodalive/settings/notification/NotificationReceiveSettingsViewModel.kt")`, `lsp_diagnostics(filePath="/Users/klaus/Develop/sodalive/Android/SodaLive/app/src/main/res/layout/activity_notification_receive_settings.xml")`
|
||||||
|
- 결과: 현 환경은 `.kt`, `.xml` LSP 서버 미구성으로 진단 실행이 불가함을 확인했다.
|
||||||
|
- 2026-03-13
|
||||||
|
- 무엇/왜/어떻게: 구현 변경분의 컴파일/테스트/코드스타일 상태를 검증해 배포 전 안정성을 확인했다.
|
||||||
|
- 실행 명령: `./gradlew :app:assembleDebug :app:testDebugUnitTest :app:ktlintCheck`
|
||||||
|
- 결과: `BUILD SUCCESSFUL`.
|
||||||
|
- 2026-03-13
|
||||||
|
- 무엇/왜/어떻게: 연결된 단말에서 수동 실행 가능성을 점검했다.
|
||||||
|
- 실행 명령: `adb devices`, `./gradlew :app:installDebug`, `adb shell am start -W -n kr.co.vividnext.sodalive.debug/kr.co.vividnext.sodalive.settings.notification.NotificationReceiveSettingsActivity`, `adb shell run-as kr.co.vividnext.sodalive.debug am start --user 0 -n kr.co.vividnext.sodalive.debug/kr.co.vividnext.sodalive.settings.notification.NotificationReceiveSettingsActivity`
|
||||||
|
- 결과: APK 설치는 성공했고, 쉘 직접 실행은 non-exported Activity 정책으로 차단됨을 확인했다. 내부 네비게이션(`PushNotificationListActivity`의 `iv_settings`)을 통한 진입은 앱 내 수동 확인이 필요하다.
|
||||||
Reference in New Issue
Block a user