Fix to padding on donation and conversation settings.

This commit is contained in:
Greyson Parrelli
2026-07-29 22:26:16 -04:00
parent 74d391d95e
commit 9eb65a86e9
4 changed files with 13 additions and 4 deletions
@@ -14,6 +14,7 @@ import androidx.appcompat.widget.Toolbar
import androidx.core.content.ContextCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.updateLayoutParams
import androidx.core.view.updatePadding
import androidx.recyclerview.widget.ConcatAdapter
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
@@ -43,7 +44,7 @@ abstract class DSLSettingsFragment(
/**
* Set by layouts that anchor the list to the top of the toolbar rather than below it. Those lists scroll
* behind the toolbar, so they have to carry the status bar inset themselves.
* behind the toolbar, so they have to carry the status bar inset and the toolbar height themselves.
*/
protected open val listScrollsBehindToolbar: Boolean = false
@@ -114,6 +115,10 @@ abstract class DSLSettingsFragment(
recyclerView?.let { recycler ->
val insetTypes = WindowInsetsCompat.Type.navigationBars() or if (listScrollsBehindToolbar) WindowInsetsCompat.Type.statusBars() else 0
if (listScrollsBehindToolbar) {
recycler.updatePadding(top = recycler.paddingTop + resources.getDimensionPixelSize(R.dimen.signal_m3_toolbar_height))
}
recycler.clipToPadding = false
SystemWindowInsetsSetter.attach(recycler, viewLifecycleOwner, insetTypes)
}
@@ -109,6 +109,8 @@ class DonateToSignalFragment :
)
}
override val listScrollsBehindToolbar: Boolean = true
override fun onToolbarNavigationClicked() {
requireActivity().onBackPressedDispatcher.onBackPressed()
}
@@ -224,7 +226,7 @@ class DonateToSignalFragment :
private fun getConfiguration(state: DonateToSignalState): DSLConfiguration {
return configure {
space(36.dp)
space(12.dp)
customPref(BadgePreview.BadgeModel.SubscriptionModel(state.badge))
@@ -74,6 +74,8 @@ class ManageDonationsFragment :
private val viewModel: ManageDonationsViewModel by viewModels()
override val listScrollsBehindToolbar: Boolean = true
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
viewLifecycleOwner.lifecycle.addObserver(InAppPaymentsBottomSheetDelegate(childFragmentManager, viewLifecycleOwner))
super.onViewCreated(view, savedInstanceState)
@@ -145,7 +147,7 @@ class ManageDonationsFragment :
private fun getConfiguration(state: ManageDonationsState): DSLConfiguration {
return configure {
space(36.dp)
space(12.dp)
customPref(
BadgePreview.BadgeModel.SubscriptionModel(
@@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
tools:viewBindingIgnore="true"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_marginTop="40dp"
android:layout_marginTop="12dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">