Fix edge-to-edge issues with notification profiles and chat folders.

This commit is contained in:
Greyson Parrelli
2026-08-03 12:26:38 -04:00
parent eb850a970d
commit 07a250a63d
2 changed files with 26 additions and 0 deletions
@@ -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() {
@@ -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