parent
4445a745bf
commit
964b92f83a
|
@ -17,6 +17,7 @@ import kr.co.vividnext.sodalive.common.LoadingDialog
|
|||
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
|
||||
import kr.co.vividnext.sodalive.databinding.FragmentAuditionBinding
|
||||
import kr.co.vividnext.sodalive.extensions.dpToPx
|
||||
import kr.co.vividnext.sodalive.main.MainActivity
|
||||
import org.koin.android.ext.android.inject
|
||||
|
||||
@UnstableApi
|
||||
|
@ -40,7 +41,9 @@ class AuditionFragment : BaseFragment<FragmentAuditionBinding>(
|
|||
override fun onResume() {
|
||||
super.onResume()
|
||||
|
||||
setAuditionNotification(SharedPreferenceManager.isAuditionNotification)
|
||||
if (SharedPreferenceManager.token.isNotBlank()) {
|
||||
setAuditionNotification(SharedPreferenceManager.isAuditionNotification)
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupView() {
|
||||
|
@ -48,11 +51,15 @@ class AuditionFragment : BaseFragment<FragmentAuditionBinding>(
|
|||
|
||||
val recyclerView = binding.rvAudition
|
||||
adapter = AuditionListAdapter {
|
||||
startActivity(
|
||||
Intent(requireContext(), AuditionDetailActivity::class.java).apply {
|
||||
putExtra(Constants.EXTRA_AUDITION_ID, it)
|
||||
}
|
||||
)
|
||||
if (SharedPreferenceManager.token.isNotBlank()) {
|
||||
startActivity(
|
||||
Intent(requireContext(), AuditionDetailActivity::class.java).apply {
|
||||
putExtra(Constants.EXTRA_AUDITION_ID, it)
|
||||
}
|
||||
)
|
||||
} else {
|
||||
(requireActivity() as MainActivity).showLoginActivity()
|
||||
}
|
||||
}
|
||||
|
||||
recyclerView.layoutManager = LinearLayoutManager(
|
||||
|
@ -91,10 +98,15 @@ class AuditionFragment : BaseFragment<FragmentAuditionBinding>(
|
|||
|
||||
recyclerView.adapter = adapter
|
||||
|
||||
binding.ivNotification.setOnClickListener {
|
||||
viewModel.updateNotificationSettings {
|
||||
setAuditionNotification(it)
|
||||
if (SharedPreferenceManager.token.isNotBlank()) {
|
||||
binding.ivNotification.visibility = View.VISIBLE
|
||||
binding.ivNotification.setOnClickListener {
|
||||
viewModel.updateNotificationSettings {
|
||||
setAuditionNotification(it)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
binding.ivNotification.visibility = View.GONE
|
||||
}
|
||||
|
||||
binding.rlHowToUse.setOnClickListener {
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
android:layout_marginEnd="13.3dp"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/btn_audition_notification_normal"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
|
Loading…
Reference in New Issue