From 495e385228a906f220ea1b97cfba786f3562d406 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Borcz?= Date: Thu, 25 Nov 2021 23:48:08 +0100 Subject: [PATCH] Fix snackbar crash in grade statistics view (#1682) --- .../io/github/wulkanowy/utils/LoggerUtils.kt | 10 +- .../res/layout/fragment_grade_statistics.xml | 266 +++++++++--------- 2 files changed, 137 insertions(+), 139 deletions(-) diff --git a/app/src/main/java/io/github/wulkanowy/utils/LoggerUtils.kt b/app/src/main/java/io/github/wulkanowy/utils/LoggerUtils.kt index ee18453ff..1e9f49a66 100644 --- a/app/src/main/java/io/github/wulkanowy/utils/LoggerUtils.kt +++ b/app/src/main/java/io/github/wulkanowy/utils/LoggerUtils.kt @@ -123,14 +123,6 @@ class FragmentLifecycleLogger @Inject constructor() : Timber.d("${f::class.java.simpleName} VIEW DESTROYED") } - override fun onFragmentActivityCreated( - fm: FragmentManager, - f: Fragment, - savedInstanceState: Bundle? - ) { - Timber.d("${f::class.java.simpleName} ACTIVITY CREATED ${savedInstanceState.checkSavedState()}") - } - override fun onFragmentPaused(fm: FragmentManager, f: Fragment) { Timber.d("${f::class.java.simpleName} PAUSED") } @@ -141,5 +133,5 @@ class FragmentLifecycleLogger @Inject constructor() : } private fun Bundle?.checkSavedState() = - if (this == null) "(STATE IS NULL)" else "(STATE IS NOT NULL)" + if (this == null) "(STATE IS NULL)" else "(RESTORE STATE)" diff --git a/app/src/main/res/layout/fragment_grade_statistics.xml b/app/src/main/res/layout/fragment_grade_statistics.xml index 981ee48f3..4cf541e44 100644 --- a/app/src/main/res/layout/fragment_grade_statistics.xml +++ b/app/src/main/res/layout/fragment_grade_statistics.xml @@ -1,158 +1,164 @@ - + android:layout_height="match_parent"> - + android:layout_height="match_parent" + android:orientation="vertical" + tools:ignore="UselessParent"> - - + android:background="?android:windowBackground" + android:padding="5dp" + android:visibility="visible" + app:layout_constraintTop_toTopOf="parent" + tools:ignore="UnusedAttribute" + tools:listitem="@layout/item_attendance_summary" + tools:visibility="visible"> - + + - - - - + android:layout_height="match_parent"> - + - + android:layout_height="wrap_content" + app:layout_constraintTop_toTopOf="parent" + tools:listitem="@layout/item_grade_statistics_pie" + tools:visibility="visible" /> - + + - - - - - - - - - - - + android:layout_height="wrap_content"> + android:orientation="vertical" + android:visibility="invisible" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintTop_toTopOf="parent" + tools:ignore="UseCompoundDrawables" + tools:visibility="gone"> - + + - - + android:layout_marginTop="20dp" + android:gravity="center" + android:text="@string/grade_no_items" + android:textSize="20sp" /> - - - - - - + + + + + + + + + + + + + + + + + + + +