fix some crashes

This commit is contained in:
Phillip Thelen 2020-10-28 16:17:09 +01:00
parent c5d55e05c8
commit 1274414018
2 changed files with 2 additions and 2 deletions

View file

@ -255,7 +255,7 @@ class TaskFormActivity : BaseActivity() {
}
private fun configureForm() {
val firstDayOfWeek = sharedPreferences.getInt("FirstDayOfTheWeek", -1)
val firstDayOfWeek = sharedPreferences.getString("FirstDayOfTheWeek", "-1")?.toInt() ?: -1
val habitViewsVisibility = if (taskType == Task.TYPE_HABIT) View.VISIBLE else View.GONE
binding.habitScoringButtons.visibility = habitViewsVisibility
binding.habitResetStreakTitleView.visibility = habitViewsVisibility

View file

@ -92,7 +92,7 @@ class AvatarOverviewFragment : BaseMainFragment<FragmentAvatarOverviewBinding>()
}
}
override fun onItemSelected(parent: AdapterView<*>, view: View, position: Int, id: Long) {
override fun onItemSelected(parent: AdapterView<*>, view: View?, position: Int, id: Long) {
val newSize: String = if (position == 0) "slim" else "broad"
if (this.user?.isValid == true && this.user?.preferences?.size != newSize) {