mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-08-05 04:45:14 +01:00
Fix to padding on donation and conversation settings.
This commit is contained in:
+6
-1
@@ -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)
|
||||
}
|
||||
|
||||
+3
-1
@@ -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))
|
||||
|
||||
|
||||
+3
-1
@@ -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">
|
||||
|
||||
|
||||
Reference in New Issue
Block a user