mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-08-05 04:45:14 +01:00
Fix edge-to-edge issues with notification profiles and chat folders.
This commit is contained in:
+12
@@ -5,6 +5,7 @@ import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import com.google.android.material.button.MaterialButton
|
||||
@@ -19,6 +20,7 @@ import org.thoughtcrime.securesms.contacts.paged.ChatType
|
||||
import org.thoughtcrime.securesms.contacts.selection.ContactSelectionArguments
|
||||
import org.thoughtcrime.securesms.groups.SelectionLimits
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId
|
||||
import org.thoughtcrime.securesms.util.SystemWindowInsetsSetter
|
||||
import org.thoughtcrime.securesms.util.ViewUtil
|
||||
import java.util.Optional
|
||||
import java.util.function.Consumer
|
||||
@@ -85,6 +87,16 @@ class ChooseChatsFragment : LoggingFragment(), ContactSelectionListFragment.OnCo
|
||||
findNavController().popBackStack()
|
||||
}
|
||||
doneButton.isEnabled = false
|
||||
|
||||
applyEdgeToEdgeInsets(view, toolbar)
|
||||
}
|
||||
|
||||
private fun applyEdgeToEdgeInsets(view: View, toolbar: Toolbar) {
|
||||
SystemWindowInsetsSetter.attach(toolbar, viewLifecycleOwner, WindowInsetsCompat.Type.statusBars())
|
||||
|
||||
val bottomInsetTypes = WindowInsetsCompat.Type.navigationBars() or WindowInsetsCompat.Type.ime()
|
||||
SystemWindowInsetsSetter.attach(view.findViewById(R.id.contact_selection_list), viewLifecycleOwner, bottomInsetTypes)
|
||||
SystemWindowInsetsSetter.attach(doneButton, viewLifecycleOwner, bottomInsetTypes, SystemWindowInsetsSetter.ApplyMode.MARGIN)
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
|
||||
+14
@@ -5,6 +5,8 @@ import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import androidx.core.view.updateLayoutParams
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.navigation.fragment.findNavController
|
||||
@@ -19,6 +21,7 @@ import org.thoughtcrime.securesms.contacts.paged.ChatType
|
||||
import org.thoughtcrime.securesms.contacts.selection.ContactSelectionArguments
|
||||
import org.thoughtcrime.securesms.groups.SelectionLimits
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId
|
||||
import org.thoughtcrime.securesms.util.SystemWindowInsetsSetter
|
||||
import org.thoughtcrime.securesms.util.ViewUtil
|
||||
import org.thoughtcrime.securesms.util.views.CircularProgressMaterialButton
|
||||
import java.util.Optional
|
||||
@@ -90,9 +93,20 @@ class SelectRecipientsFragment : LoggingFragment(), ContactSelectionListFragment
|
||||
.subscribeBy(onSuccess = { findNavController().navigateUp() })
|
||||
}
|
||||
|
||||
applyEdgeToEdgeInsets(view, toolbar)
|
||||
|
||||
updateAddToProfile()
|
||||
}
|
||||
|
||||
private fun applyEdgeToEdgeInsets(view: View, toolbar: Toolbar) {
|
||||
toolbar.updateLayoutParams { height = ViewGroup.LayoutParams.WRAP_CONTENT }
|
||||
SystemWindowInsetsSetter.attach(toolbar, viewLifecycleOwner, WindowInsetsCompat.Type.statusBars())
|
||||
|
||||
val bottomInsetTypes = WindowInsetsCompat.Type.navigationBars() or WindowInsetsCompat.Type.ime()
|
||||
SystemWindowInsetsSetter.attach(view.findViewById(R.id.contact_selection_list_fragment), viewLifecycleOwner, bottomInsetTypes)
|
||||
SystemWindowInsetsSetter.attach(view.findViewById(R.id.select_recipients_add), viewLifecycleOwner, bottomInsetTypes, SystemWindowInsetsSetter.ApplyMode.MARGIN)
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
addToProfile = null
|
||||
|
||||
Reference in New Issue
Block a user