diff --git a/app/src/main/java/com/zfdang/touchhelper/ui/settings/SettingsFragment.java b/app/src/main/java/com/zfdang/touchhelper/ui/settings/SettingsFragment.java index 7f7a5ae..17245a0 100644 --- a/app/src/main/java/com/zfdang/touchhelper/ui/settings/SettingsFragment.java +++ b/app/src/main/java/com/zfdang/touchhelper/ui/settings/SettingsFragment.java @@ -22,6 +22,8 @@ import android.widget.TextView; import android.widget.Toast; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import androidx.preference.CheckBoxPreference; import androidx.preference.EditTextPreference; import androidx.preference.MultiSelectListPreference; @@ -76,6 +78,22 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { packageManager = getActivity().getPackageManager(); } + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + View view = super.onCreateView(inflater, container, savedInstanceState); + + // get the height of BottomNavigationView + int resourceId = getResources().getIdentifier("design_bottom_navigation_height", "dimen", getActivity().getPackageName()); + int height = 147; + if (resourceId > 0) { + height = getResources().getDimensionPixelSize(resourceId); + } + + // set bottom padding for the preference fragment, so that all parts could be shown properly + view.setPadding(view.getPaddingLeft(), view.getPaddingTop(), view.getPaddingRight(), view.getPaddingBottom() + height); + return view; + } + private void initPreferences() { CheckBoxPreference notification = findPreference("skip_ad_notification"); diff --git a/app/src/main/res/xml/touch_helper_preference.xml b/app/src/main/res/xml/touch_helper_preference.xml index 0dc4410..2fa7906 100644 --- a/app/src/main/res/xml/touch_helper_preference.xml +++ b/app/src/main/res/xml/touch_helper_preference.xml @@ -74,11 +74,6 @@ - - - - - \ No newline at end of file