From 451a147182e7afd1fc5e43b61d3d6fe65a63cf0f Mon Sep 17 00:00:00 2001 From: Norbel AMBANUMBEN Date: Thu, 27 Jun 2024 17:27:12 +0100 Subject: [PATCH] fix: checkbox padding and activity launch from external app. --- .../ooniprobe/activity/adddescriptor/AddDescriptorActivity.kt | 4 ++-- .../ooniprobe/activity/oonirun/OoniRunV2Activity.kt | 1 + app/src/main/res/layout/activity_overview.xml | 2 +- app/src/main/res/layout/nettest_group_list_item.xml | 3 +-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/org/openobservatory/ooniprobe/activity/adddescriptor/AddDescriptorActivity.kt b/app/src/main/java/org/openobservatory/ooniprobe/activity/adddescriptor/AddDescriptorActivity.kt index 5f424377a..99552ca87 100644 --- a/app/src/main/java/org/openobservatory/ooniprobe/activity/adddescriptor/AddDescriptorActivity.kt +++ b/app/src/main/java/org/openobservatory/ooniprobe/activity/adddescriptor/AddDescriptorActivity.kt @@ -159,8 +159,8 @@ class AddDescriptorActivity : AbstractActivity() { finish() } - viewModel.selectedAllBtnStatus.observe(this) { state -> - binding.testsCheckbox.checkedState = state; + binding.expandableListView.viewTreeObserver.addOnGlobalLayoutListener { + binding.testsCheckbox.checkedState = viewModel.selectedAllBtnStatus.value!! } // This observer is used to change the state of the "Select All" button when a checkbox is clicked. diff --git a/app/src/main/java/org/openobservatory/ooniprobe/activity/oonirun/OoniRunV2Activity.kt b/app/src/main/java/org/openobservatory/ooniprobe/activity/oonirun/OoniRunV2Activity.kt index e832525af..f505d9ebc 100644 --- a/app/src/main/java/org/openobservatory/ooniprobe/activity/oonirun/OoniRunV2Activity.kt +++ b/app/src/main/java/org/openobservatory/ooniprobe/activity/oonirun/OoniRunV2Activity.kt @@ -133,6 +133,7 @@ class OoniRunV2Activity : AbstractActivity() { private fun fetchDescriptorComplete(descriptorResponse: TestDescriptor?) { descriptorResponse?.let { startActivity(AddDescriptorActivity.newIntent(this, descriptorResponse)) + finish() } ?: run { finishWithError() } diff --git a/app/src/main/res/layout/activity_overview.xml b/app/src/main/res/layout/activity_overview.xml index fb50caea0..e5b321a69 100644 --- a/app/src/main/res/layout/activity_overview.xml +++ b/app/src/main/res/layout/activity_overview.xml @@ -243,7 +243,7 @@ android:childDivider="@android:color/transparent" android:divider="@android:color/transparent" android:groupIndicator="@null" - android:paddingHorizontal="16dp" + android:paddingStart="16dp" app:layout_constraintTop_toBottomOf="@id/header" tools:listitem="@layout/overview_test_group_list_item" /> diff --git a/app/src/main/res/layout/nettest_group_list_item.xml b/app/src/main/res/layout/nettest_group_list_item.xml index 6f25be8f4..dab4ab20b 100644 --- a/app/src/main/res/layout/nettest_group_list_item.xml +++ b/app/src/main/res/layout/nettest_group_list_item.xml @@ -4,8 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="horizontal" - android:paddingEnd="16dp" > + android:orientation="horizontal">