Fix margin too small in crash activity fab
This commit is contained in:
parent
8c07ac0b7d
commit
74761c8000
2 changed files with 7 additions and 8 deletions
|
|
@ -32,11 +32,10 @@ class CrashActivity : AppCompatActivity() {
|
||||||
ViewCompat.setOnApplyWindowInsetsListener(binding.exitApp) { view, windowInsets ->
|
ViewCompat.setOnApplyWindowInsetsListener(binding.exitApp) { view, windowInsets ->
|
||||||
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
|
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
|
||||||
view.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
view.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||||
leftMargin = insets.left
|
leftMargin = if (insets.left == 0) 16 else insets.left
|
||||||
bottomMargin = insets.bottom
|
bottomMargin = if (insets.bottom == 0) 48 else insets.bottom + 32
|
||||||
rightMargin = insets.right
|
rightMargin = if (insets.right == 0) 48 else insets.right + 32
|
||||||
}
|
}
|
||||||
|
|
||||||
WindowInsetsCompat.CONSUMED
|
WindowInsetsCompat.CONSUMED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,21 +33,21 @@ class MainActivity : AppCompatActivity() {
|
||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
|
|
||||||
setSupportActionBar(binding.toolbar)
|
setSupportActionBar(binding.toolbar)
|
||||||
/*val pref = getSharedPreferences("data",Context.MODE_PRIVATE)
|
/*val pref = getSharedPreferences("data", Context.MODE_PRIVATE)
|
||||||
val isFirstUse = pref.getBoolean("first_use", false)
|
val isFirstUse = pref.getBoolean("first_use", false)
|
||||||
|
|
||||||
if (!isFirstUse) {
|
if (!isFirstUse) {
|
||||||
MaterialAlertDialogBuilder(this)
|
MaterialAlertDialogBuilder(this)
|
||||||
.setTitle("欢迎使用待办")
|
.setTitle("欢迎使用待办")
|
||||||
.setMessage("")
|
.setMessage("本应用不需要任何权限")
|
||||||
.setPositiveButton("确定") { dialog, which ->
|
.setPositiveButton("确定") { dialog, which ->
|
||||||
val editor = getSharedPreferences("data", Context.MODE_PRIVATE).edit()
|
val editor = getSharedPreferences("data", Context.MODE_PRIVATE).edit()
|
||||||
editor.putBoolean("first_use", true)
|
editor.putBoolean("first_use", true)
|
||||||
editor.apply()
|
editor.apply()
|
||||||
}
|
}
|
||||||
.show()
|
.show()
|
||||||
}
|
}*/
|
||||||
*/
|
|
||||||
val isDarkMode = Repository.getPreferenceString(this, "dark_mode", "0")
|
val isDarkMode = Repository.getPreferenceString(this, "dark_mode", "0")
|
||||||
when (isDarkMode) {
|
when (isDarkMode) {
|
||||||
"0" -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM)
|
"0" -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue