-
Notifications
You must be signed in to change notification settings - Fork 392
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix statusbar content overlap for Android 15
- Loading branch information
1 parent
121daab
commit 3c2012c
Showing
11 changed files
with
30 additions
and
33 deletions.
There are no files selected for viewing
25 changes: 2 additions & 23 deletions
25
app/src/main/java/io/horizontalsystems/bankwallet/core/BaseActivity.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 |
---|---|---|
@@ -1,42 +1,21 @@ | ||
package io.horizontalsystems.bankwallet.core | ||
|
||
import android.content.Context | ||
import android.graphics.Color | ||
import android.os.Build | ||
import android.os.Bundle | ||
import android.view.View | ||
import android.view.WindowManager | ||
import androidx.activity.enableEdgeToEdge | ||
import androidx.appcompat.app.AppCompatActivity | ||
import androidx.core.view.WindowCompat | ||
import io.horizontalsystems.core.CoreApp | ||
|
||
abstract class BaseActivity : AppCompatActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
|
||
enableEdgeToEdge() | ||
window.decorView.layoutDirection = if (CoreApp.instance.isLocaleRTL()) View.LAYOUT_DIRECTION_RTL else View.LAYOUT_DIRECTION_LTR | ||
} | ||
|
||
override fun attachBaseContext(newBase: Context) { | ||
super.attachBaseContext(CoreApp.instance.localeAwareContext(newBase)) | ||
} | ||
|
||
protected fun setStatusBarTransparent() { | ||
if (Build.VERSION.SDK_INT in 26..29) { | ||
window.statusBarColor = Color.TRANSPARENT | ||
|
||
@Suppress("DEPRECATION") | ||
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS) | ||
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) | ||
@Suppress("DEPRECATION") | ||
window.decorView.systemUiVisibility = | ||
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_LAYOUT_STABLE | ||
|
||
} else if (Build.VERSION.SDK_INT >= 30) { | ||
window.statusBarColor = Color.TRANSPARENT | ||
// Making status bar overlaps with the activity | ||
WindowCompat.setDecorFitsSystemWindows(window, false) | ||
} | ||
} | ||
} |
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
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
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
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
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
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
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
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
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
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