android: Persistent scrollbars on home settings fragment
This commit is contained in:
parent
f461465a92
commit
34b7d58157
|
@ -13,6 +13,7 @@ import android.provider.DocumentsContract
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
import android.view.ViewGroup.MarginLayoutParams
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.app.ActivityCompat
|
import androidx.core.app.ActivityCompat
|
||||||
|
@ -241,13 +242,19 @@ class HomeSettingsFragment : Fragment() {
|
||||||
val spacingNavigationRail =
|
val spacingNavigationRail =
|
||||||
resources.getDimensionPixelSize(R.dimen.spacing_navigation_rail)
|
resources.getDimensionPixelSize(R.dimen.spacing_navigation_rail)
|
||||||
|
|
||||||
binding.scrollViewSettings.setPadding(
|
val leftInsets = barInsets.left + cutoutInsets.left
|
||||||
barInsets.left + cutoutInsets.left,
|
val rightInsets = barInsets.right + cutoutInsets.right
|
||||||
barInsets.top,
|
|
||||||
barInsets.right + cutoutInsets.right,
|
binding.scrollViewSettings.updatePadding(
|
||||||
barInsets.bottom
|
top = barInsets.top,
|
||||||
|
bottom = barInsets.bottom
|
||||||
)
|
)
|
||||||
|
|
||||||
|
val mlpScrollSettings = binding.scrollViewSettings.layoutParams as MarginLayoutParams
|
||||||
|
mlpScrollSettings.leftMargin = leftInsets
|
||||||
|
mlpScrollSettings.rightMargin = rightInsets
|
||||||
|
binding.scrollViewSettings.layoutParams = mlpScrollSettings
|
||||||
|
|
||||||
binding.linearLayoutSettings.updatePadding(bottom = spacingNavigation)
|
binding.linearLayoutSettings.updatePadding(bottom = spacingNavigation)
|
||||||
|
|
||||||
if (ViewCompat.getLayoutDirection(view) == ViewCompat.LAYOUT_DIRECTION_LTR) {
|
if (ViewCompat.getLayoutDirection(view) == ViewCompat.LAYOUT_DIRECTION_LTR) {
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/colorSurface"
|
android:background="?attr/colorSurface"
|
||||||
|
android:scrollbars="vertical"
|
||||||
|
android:fadeScrollbars="false"
|
||||||
android:clipToPadding="false">
|
android:clipToPadding="false">
|
||||||
|
|
||||||
<androidx.appcompat.widget.LinearLayoutCompat
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
|
Reference in New Issue