status bar height fix
This commit is contained in:
parent
5bd8f1a3c7
commit
91b1f4775b
1 changed files with 9 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
package ani.dantotsu
|
||||
|
||||
import android.animation.ObjectAnimator
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.drawable.Animatable
|
||||
|
@ -68,6 +69,7 @@ class MainActivity : AppCompatActivity() {
|
|||
private var uiSettings = UserInterfaceSettings()
|
||||
|
||||
|
||||
@SuppressLint("InternalInsetResource", "DiscouragedApi")
|
||||
@OptIn(UnstableApi::class)
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
ThemeManager(this).applyTheme()
|
||||
|
@ -96,8 +98,14 @@ class MainActivity : AppCompatActivity() {
|
|||
|
||||
}
|
||||
|
||||
val offset = try {
|
||||
val statusBarHeightId = resources.getIdentifier("status_bar_height", "dimen", "android")
|
||||
resources.getDimensionPixelSize(statusBarHeightId)
|
||||
} catch (e: Exception) {
|
||||
statusBarHeight
|
||||
}
|
||||
val layoutParams = binding.incognitoTextView.layoutParams as ViewGroup.MarginLayoutParams
|
||||
layoutParams.topMargin = 11 * statusBarHeight / 12
|
||||
layoutParams.topMargin = 11 * offset / 12
|
||||
binding.incognitoTextView.layoutParams = layoutParams
|
||||
incognitoLiveData = SharedPreferenceBooleanLiveData(
|
||||
sharedPreferences,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue