Skip to content

Commit 6f89785

Browse files
committed
BasePreferencesFragment: add bottom padding to list
1 parent 605855e commit 6f89785

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app/src/main/java/com/battlelancer/seriesguide/ui/BasePreferencesFragment.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
// Copyright 2023 Uwe Trottmann
21
// SPDX-License-Identifier: Apache-2.0
2+
// SPDX-FileCopyrightText: Copyright © 2014 Uwe Trottmann <[email protected]>
33

44
package com.battlelancer.seriesguide.ui
55

66
import android.content.SharedPreferences
77
import android.os.Bundle
88
import android.view.LayoutInflater
99
import android.view.ViewGroup
10+
import androidx.core.view.updatePadding
1011
import androidx.preference.ListPreference
1112
import androidx.preference.Preference
1213
import androidx.preference.PreferenceFragmentCompat
1314
import androidx.recyclerview.widget.RecyclerView
15+
import com.battlelancer.seriesguide.R
1416
import com.battlelancer.seriesguide.util.ThemeUtils
1517

1618
/**
@@ -26,6 +28,10 @@ abstract class BasePreferencesFragment : PreferenceFragmentCompat() {
2628
savedInstanceState: Bundle?
2729
): RecyclerView {
2830
val recyclerView = super.onCreateRecyclerView(inflater, parent, savedInstanceState)
31+
// Add bottom padding to make it obvious where the list ends and to avoid accidental taps
32+
// on the navigation bar.
33+
val bottomPadding = resources.getDimensionPixelSize(R.dimen.large_padding)
34+
recyclerView.updatePadding(bottom = bottomPadding)
2935
// Adjust preferences RecyclerView bottom padding to navigation bar height.
3036
ThemeUtils.applyBottomPaddingForNavigationBar(recyclerView)
3137
return recyclerView

0 commit comments

Comments
 (0)