diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/about/AboutAdapter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/about/AboutAdapter.kt index 2aeadcf6..cd2dc210 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/about/AboutAdapter.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/about/AboutAdapter.kt @@ -3,9 +3,9 @@ package io.github.wulkanowy.ui.modules.about import android.graphics.drawable.Drawable import android.view.LayoutInflater import android.view.ViewGroup +import android.widget.Toast import androidx.core.content.res.ResourcesCompat import androidx.recyclerview.widget.RecyclerView -import com.google.android.material.snackbar.Snackbar import io.github.wulkanowy.data.repositories.PreferencesRepository import io.github.wulkanowy.databinding.ItemAboutBinding import io.github.wulkanowy.databinding.ScrollableHeaderAboutBinding @@ -15,6 +15,7 @@ class AboutAdapter @Inject constructor( private val preferencesRepository: PreferencesRepository ) : RecyclerView.Adapter() { + private var developerModeClicks = 0 private enum class ViewType(val id: Int) { ITEM_HEADER(1), ITEM_ELEMENT(2) @@ -22,7 +23,6 @@ class AboutAdapter @Inject constructor( var items = emptyList>() - var developerModeClicks = 0 var onClickListener: (name: String) -> Unit = {} override fun getItemCount() = items.size + 1 @@ -52,14 +52,14 @@ class AboutAdapter @Inject constructor( private fun bindHeaderViewHolder(binding: ScrollableHeaderAboutBinding) { with(binding.aboutScrollableHeaderIcon) { setOnClickListener { - if (++developerModeClicks == 5) { + if (++developerModeClicks == 5 && !preferencesRepository.developerMode) { preferencesRepository.developerMode = true developerModeClicks = 0 - Snackbar.make( - binding.root, - "👍🏻", - Snackbar.LENGTH_SHORT + Toast.makeText( + context, + "done!", + Toast.LENGTH_SHORT ).show() } }