expand the status bar on down fling gesture

This commit is contained in:
tibbi 2022-09-25 12:17:30 +02:00
parent 04f6e14b3f
commit 85d255d434
2 changed files with 9 additions and 1 deletions

View File

@ -9,6 +9,7 @@
tools:ignore="QueryAllPackagesPermission" />
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" />
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
<uses-permission
android:name="android.permission.USE_FINGERPRINT"

View File

@ -324,7 +324,14 @@ class MainActivity : SimpleActivity(), FlingListener {
override fun onFlingDown() {
mIgnoreUpEvent = true
hideFragment(all_apps_fragment)
if (all_apps_fragment.y != mScreenHeight.toFloat()) {
hideFragment(all_apps_fragment)
} else {
try {
Class.forName("android.app.StatusBarManager").getMethod("expandNotificationsPanel").invoke(getSystemService("statusbar"))
} catch (e: Exception) {
}
}
}
@SuppressLint("WrongConstant")