From 3b19598ec1e4d2866dcc50a18c738dacaee712c2 Mon Sep 17 00:00:00 2001 From: Norbel AMBANUMBEN Date: Tue, 26 Mar 2024 07:38:01 +0100 Subject: [PATCH] fix (OONI Run v2) : Hidden `ExpandableListView` section --- .../ResultDetailExpandableListAdapter.kt | 11 +- .../res/layout/activity_result_detail.xml | 129 +++++++------ .../main/res/layout/activity_run_tests.xml | 177 ++++++++++-------- 3 files changed, 176 insertions(+), 141 deletions(-) diff --git a/app/src/main/java/org/openobservatory/ooniprobe/adapters/ResultDetailExpandableListAdapter.kt b/app/src/main/java/org/openobservatory/ooniprobe/adapters/ResultDetailExpandableListAdapter.kt index 46fd48604..61742dff4 100755 --- a/app/src/main/java/org/openobservatory/ooniprobe/adapters/ResultDetailExpandableListAdapter.kt +++ b/app/src/main/java/org/openobservatory/ooniprobe/adapters/ResultDetailExpandableListAdapter.kt @@ -90,10 +90,16 @@ class ResultDetailExpandableListAdapter( is Measurement -> bindMeasurement(groupItem, root) else -> { - root.findViewById(R.id.text).text = groupItem.toString() + val groupMeasurement = (items[groupPosition] as MeasurementGroup) + + groupMeasurement.measurements.firstOrNull()?.let { + root.findViewById(R.id.text).setText(it.getTest().labelResId) + } ?: run { + root.findViewById(R.id.text).text = groupMeasurement.title + } root.findViewById(R.id.indicator).apply { visibility = View.VISIBLE - text = "${(items[groupPosition] as MeasurementGroup).measurements.size} Inputs" + text = "${groupMeasurement.measurements.size} Inputs" setCompoundDrawablesRelativeWithIntrinsicBounds( null, null, @@ -115,6 +121,7 @@ class ResultDetailExpandableListAdapter( ) { view.tag = measurement view.setOnClickListener(onClickListener) + view.findViewById(R.id.indicator).visibility = View.GONE view.findViewById(R.id.text).also { textView -> val test: AbstractTest = measurement.getTest() diff --git a/app/src/main/res/layout/activity_result_detail.xml b/app/src/main/res/layout/activity_result_detail.xml index eaa550612..3ea29f6f7 100644 --- a/app/src/main/res/layout/activity_result_detail.xml +++ b/app/src/main/res/layout/activity_result_detail.xml @@ -1,73 +1,78 @@ + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/coordinatorLayout" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".activity.ResultDetailActivity"> - + - + - + - + - - + + - + - - - + + + - - - + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_run_tests.xml b/app/src/main/res/layout/activity_run_tests.xml index dd3f26875..f67c1ec09 100644 --- a/app/src/main/res/layout/activity_run_tests.xml +++ b/app/src/main/res/layout/activity_run_tests.xml @@ -1,90 +1,113 @@ + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".activity.runtests.RunTestsActivity"> - + - + - + -