Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
3d06ba18
Commit
3d06ba18
authored
Jan 23, 2022
by
vvb2060
Committed by
John Wu
Jan 23, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use WindowCompat
parent
8a23d1da
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
UIActivity.kt
app/src/main/java/com/topjohnwu/magisk/arch/UIActivity.kt
+4
-7
No files found.
app/src/main/java/com/topjohnwu/magisk/arch/UIActivity.kt
View file @
3d06ba18
...
@@ -7,6 +7,7 @@ import android.os.Bundle
...
@@ -7,6 +7,7 @@ import android.os.Bundle
import
android.view.View
import
android.view.View
import
androidx.appcompat.app.AppCompatDelegate
import
androidx.appcompat.app.AppCompatDelegate
import
androidx.core.content.res.use
import
androidx.core.content.res.use
import
androidx.core.view.WindowCompat
import
androidx.databinding.DataBindingUtil
import
androidx.databinding.DataBindingUtil
import
androidx.databinding.ViewDataBinding
import
androidx.databinding.ViewDataBinding
import
com.topjohnwu.magisk.BR
import
com.topjohnwu.magisk.BR
...
@@ -42,17 +43,13 @@ abstract class UIActivity<Binding : ViewDataBinding> : BaseActivity(), ViewModel
...
@@ -42,17 +43,13 @@ abstract class UIActivity<Binding : ViewDataBinding> : BaseActivity(), ViewModel
.
use
{
it
.
getDrawable
(
0
)
}
.
use
{
it
.
getDrawable
(
0
)
}
.
also
{
window
.
setBackgroundDrawable
(
it
)
}
.
also
{
window
.
setBackgroundDrawable
(
it
)
}
window
?.
decorView
?.
let
{
WindowCompat
.
setDecorFitsSystemWindows
(
window
,
false
)
it
.
systemUiVisibility
=
(
it
.
systemUiVisibility
or
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
or
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
or
View
.
SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
)
}
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
window
?.
decorView
?.
post
{
window
?.
decorView
?.
post
{
// If navigation bar is short enough (gesture navigation enabled), make it transparent
// If navigation bar is short enough (gesture navigation enabled), make it transparent
if
(
window
.
decorView
.
rootWindowInsets
?.
systemWindowInsetBottom
?:
0
<
Resources
.
getSystem
().
displayMetrics
.
density
*
40
)
{
if
((
window
.
decorView
.
rootWindowInsets
?.
systemWindowInsetBottom
?:
0
)
<
Resources
.
getSystem
().
displayMetrics
.
density
*
40
)
{
window
.
navigationBarColor
=
Color
.
TRANSPARENT
window
.
navigationBarColor
=
Color
.
TRANSPARENT
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
P
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
P
)
{
window
.
navigationBarDividerColor
=
Color
.
TRANSPARENT
window
.
navigationBarDividerColor
=
Color
.
TRANSPARENT
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment