fix: follow activity crash

This commit is contained in:
rebelonion 2024-03-06 08:38:55 -06:00
parent acef7c3d5e
commit e50a65571f

View file

@ -36,20 +36,22 @@ class FollowActivity : AppCompatActivity(){
private lateinit var selected: ImageButton private lateinit var selected: ImageButton
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
val immersiveMode = PrefManager.getVal<Boolean>(PrefName.ImmersiveMode)
if (immersiveMode) {
requestWindowFeature(Window.FEATURE_NO_TITLE)
}
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
ThemeManager(this).applyTheme() ThemeManager(this).applyTheme()
initActivity(this) initActivity(this)
binding = ActivityFollowBinding.inflate(layoutInflater) binding = ActivityFollowBinding.inflate(layoutInflater)
setContentView(binding.root)
if (!PrefManager.getVal<Boolean>(PrefName.ImmersiveMode)) { if (!immersiveMode) {
this.window.statusBarColor = this.window.statusBarColor =
ContextCompat.getColor(this, R.color.nav_bg_inv) ContextCompat.getColor(this, R.color.nav_bg_inv)
binding.root.fitsSystemWindows = true binding.root.fitsSystemWindows = true
} else { } else {
binding.root.fitsSystemWindows = false binding.root.fitsSystemWindows = false
requestWindowFeature(Window.FEATURE_NO_TITLE)
window.setFlags( window.setFlags(
WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN WindowManager.LayoutParams.FLAG_FULLSCREEN
@ -58,6 +60,8 @@ class FollowActivity : AppCompatActivity(){
topMargin = statusBarHeight topMargin = statusBarHeight
} }
} }
setContentView(binding.root)
val layoutType = PrefManager.getVal<Int>(PrefName.FollowerLayout) val layoutType = PrefManager.getVal<Int>(PrefName.FollowerLayout)
selected = getSelected(layoutType) selected = getSelected(layoutType)
binding.followerGrid.alpha = 0.33f binding.followerGrid.alpha = 0.33f