diff --git a/app/src/main/java/com/sevtinge/hyperceiler/ui/base/NavigationActivity.java b/app/src/main/java/com/sevtinge/hyperceiler/ui/base/NavigationActivity.java index 2d5cd8fcd4..a57e35d288 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/ui/base/NavigationActivity.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/ui/base/NavigationActivity.java @@ -95,6 +95,17 @@ private void initSearchView() { mSearchView.setOnClickListener(v -> startSearchMode()); mSearchAdapter.setOnItemClickListener((view, ad) -> onSearchItemClickListener(ad)); + + ViewCompat.setOnApplyWindowInsetsListener(mSearchResultView, new OnApplyWindowInsetsListener() { + @NonNull + @Override + public WindowInsetsCompat onApplyWindowInsets(@NonNull View v, @NonNull WindowInsetsCompat insets) { + Insets inset = Insets.max(insets.getInsets(WindowInsetsCompat.Type.systemBars()), + insets.getInsets(WindowInsetsCompat.Type.displayCutout())); + v.setPadding(0, 0, 0, inset.bottom); + return insets; + } + }); } private void initNavigationView() { @@ -160,11 +171,6 @@ private void addPaddingForRadioButton(View view, Context context) { @NonNull @Override public WindowInsetsCompat onApplyWindowInsets(@NonNull View v, @NonNull WindowInsetsCompat insets) { - /*WindowManager windowManager = (WindowManager) getSystemService(Context.WINDOW_SERVICE); - Display display = windowManager.getDefaultDisplay(); - DisplayMetrics displayMetrics = new DisplayMetrics(); - display.getMetrics(displayMetrics); - int dpi = displayMetrics.densityDpi;*/ Insets inset = Insets.max(insets.getInsets(WindowInsetsCompat.Type.systemBars()), insets.getInsets(WindowInsetsCompat.Type.displayCutout())); v.setPadding(0, dpToPx(10, context), 0, inset.bottom + dpToPx(18, context)); diff --git a/app/src/main/res/layout/activity_navigation.xml b/app/src/main/res/layout/activity_navigation.xml index 6fdc749db8..a15f5e667f 100644 --- a/app/src/main/res/layout/activity_navigation.xml +++ b/app/src/main/res/layout/activity_navigation.xml @@ -85,6 +85,7 @@ android:layout_height="match_parent" android:layout_marginTop="@dimen/miuix_appcompat_searchbar_result_margin_top" android:background="?android:attr/windowBackground" + android:clipToPadding="false" android:visibility="gone" /> \ No newline at end of file