-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
21 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
kotlin_arch/src/main/java/com/czq/kotlin_arch/common/util/ext/Activity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.czq.kotlin_arch.common.util.ext | ||
|
||
import android.content.res.Resources | ||
import android.os.Build | ||
import android.view.View | ||
import androidx.appcompat.app.AppCompatActivity | ||
|
||
fun AppCompatActivity.hideBottom() { | ||
//隐藏虚拟按键,并且全屏 | ||
if (Build.VERSION.SDK_INT > 11 && Build.VERSION.SDK_INT < 19) { // lower api | ||
val v = window.decorView | ||
v.systemUiVisibility = View.GONE | ||
} else if (Build.VERSION.SDK_INT >= 19) { //for new api versions. | ||
val decorView = window.decorView | ||
val uiOptions = (View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | ||
or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY or View.SYSTEM_UI_FLAG_FULLSCREEN) | ||
decorView.systemUiVisibility = uiOptions | ||
} | ||
} |