Fixed first title being partially obscured by toolbar

This commit is contained in:
Viktor De Pasquale 2020-08-12 13:25:19 +02:00 committed by John Wu
parent feb0f4b7b5
commit d8b1d79879

View File

@ -1,7 +1,10 @@
package com.topjohnwu.magisk.ui.settings package com.topjohnwu.magisk.ui.settings
import android.os.Bundle
import android.view.View
import com.topjohnwu.magisk.R import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.databinding.FragmentSettingsMd2Binding import com.topjohnwu.magisk.databinding.FragmentSettingsMd2Binding
import com.topjohnwu.magisk.ktx.setOnViewReadyListener
import com.topjohnwu.magisk.ui.base.BaseUIFragment import com.topjohnwu.magisk.ui.base.BaseUIFragment
import org.koin.androidx.viewmodel.ext.android.viewModel import org.koin.androidx.viewmodel.ext.android.viewModel
@ -16,6 +19,13 @@ class SettingsFragment : BaseUIFragment<SettingsViewModel, FragmentSettingsMd2Bi
activity.title = resources.getString(R.string.settings) activity.title = resources.getString(R.string.settings)
} }
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
binding.settingsList.setOnViewReadyListener {
binding.settingsList.scrollToPosition(0)
}
}
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
viewModel.items.forEach { it.refresh() } viewModel.items.forEach { it.refresh() }