mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-05-03 23:15:44 +01:00
committed by
jeffrey-signal
parent
aeeba3d2df
commit
69b6d7ef9a
@@ -7,6 +7,7 @@ import android.view.ViewGroup
|
||||
import android.widget.Toast
|
||||
import androidx.activity.OnBackPressedCallback
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import androidx.core.view.updateLayoutParams
|
||||
import androidx.fragment.app.Fragment
|
||||
@@ -34,6 +35,7 @@ import org.thoughtcrime.securesms.util.adapter.mapping.MappingAdapter
|
||||
import org.thoughtcrime.securesms.util.fragments.requireListener
|
||||
import org.thoughtcrime.securesms.util.livedata.LiveDataUtil
|
||||
import org.thoughtcrime.securesms.util.visible
|
||||
import org.signal.core.ui.R as CoreUiR
|
||||
|
||||
/**
|
||||
* Displays a collection of files and folders to the user to allow them to select
|
||||
@@ -54,7 +56,7 @@ class MediaGalleryFragment : Fragment(R.layout.v2_media_gallery_fragment) {
|
||||
private val selectedAdapter = MappingAdapter()
|
||||
private val mediaGalleryGridItemTouchListener = MediaGalleryGridItemTouchListener()
|
||||
|
||||
private val viewStateLiveData = MutableLiveData(ViewState())
|
||||
private lateinit var viewStateLiveData: MutableLiveData<ViewState>
|
||||
|
||||
private val onBackPressedCallback: OnBackPressedCallback = object : OnBackPressedCallback(false) {
|
||||
override fun handleOnBackPressed() {
|
||||
@@ -63,6 +65,7 @@ class MediaGalleryFragment : Fragment(R.layout.v2_media_gallery_fragment) {
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
viewStateLiveData = MutableLiveData(ViewState(chatColor = ContextCompat.getColor(requireContext(), CoreUiR.color.signal_light_colorPrimary)))
|
||||
callbacks = requireListener()
|
||||
val binding = V2MediaGalleryFragmentBinding.bind(view)
|
||||
|
||||
@@ -343,7 +346,7 @@ class MediaGalleryFragment : Fragment(R.layout.v2_media_gallery_fragment) {
|
||||
|
||||
data class ViewState(
|
||||
val selectedMedia: List<Media> = listOf(),
|
||||
val chatColor: Int? = null
|
||||
val chatColor: Int
|
||||
)
|
||||
|
||||
interface Callbacks {
|
||||
|
||||
Reference in New Issue
Block a user