Merge pull request #94 from esensar/fix/73-notch-handling

Allow drawing under notches and system bars
This commit is contained in:
Tibor Kaputa 2023-07-30 23:15:29 +02:00 committed by GitHub
commit 45904bac9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -30,6 +30,7 @@ import android.view.animation.DecelerateInterpolator
import android.widget.PopupMenu
import androidx.core.graphics.drawable.toBitmap
import androidx.core.view.GestureDetectorCompat
import androidx.core.view.WindowCompat
import androidx.core.view.isVisible
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.*
@ -85,9 +86,7 @@ class MainActivity : SimpleActivity(), FlingListener {
mDetector = GestureDetectorCompat(this, MyGestureListener(this))
if (isRPlus()) {
window.setDecorFitsSystemWindows(false)
}
WindowCompat.setDecorFitsSystemWindows(window, false)
mScreenHeight = realScreenSize.y
mAllAppsFragmentY = mScreenHeight
@ -205,6 +204,7 @@ class MainActivity : SimpleActivity(), FlingListener {
val addTopPadding = main_holder.rootWindowInsets?.displayCutout != null
(all_apps_fragment as AllAppsFragment).setupViews(addTopPadding)
(widgets_fragment as WidgetsFragment).setupViews(addTopPadding)
updateStatusbarColor(Color.TRANSPARENT)
}
}

View File

@ -10,6 +10,8 @@
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:enforceNavigationBarContrast">false</item>
<item name="android:enforceStatusBarContrast">false</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>