Dan Ballard pushed to branch firefox-android-115.2.1-13.5-1 at The Tor Project / Applications / firefox-android
Commits: 1b8ed990 by clairehurst at 2024-04-17T16:37:37+00:00 fixup! Implement Android-native Connection Assist UI
- - - - -
2 changed files:
- fenix/app/src/main/java/org/mozilla/fenix/tor/TorConnectionAssistFragment.kt - fenix/app/src/main/res/layout/fragment_tor_connection_assist.xml
Changes:
===================================== fenix/app/src/main/java/org/mozilla/fenix/tor/TorConnectionAssistFragment.kt ===================================== @@ -102,7 +102,6 @@ class TorConnectionAssistFragment : Fragment() { binding.torConnectImage.visibility = View.GONE binding.titleLargeTextView.visibility = View.GONE binding.titleDescription.visibility = View.GONE - binding.quickStartDescription.visibility = View.GONE binding.quickstartSwitch.visibility = View.GONE binding.torBootstrapButton1.visibility = View.GONE binding.torBootstrapButton2.visibility = View.GONE @@ -128,7 +127,6 @@ class TorConnectionAssistFragment : Fragment() { binding.titleDescription.visibility = View.VISIBLE binding.titleDescription.text = getString(R.string.preferences_tor_network_settings_explanation) - binding.quickStartDescription.visibility = View.VISIBLE binding.quickstartSwitch.visibility = View.VISIBLE binding.quickstartSwitch.isChecked = viewModel.quickstartToggle().value == true
@@ -172,7 +170,6 @@ class TorConnectionAssistFragment : Fragment() { binding.quickstartSwitch.visibility = View.VISIBLE binding.quickstartSwitch.isChecked = viewModel.quickstartToggle().value == true binding.quickstartSwitch.jumpDrawablesToCurrentState() - binding.quickStartDescription.visibility = View.VISIBLE binding.torBootstrapButton1.visibility = View.INVISIBLE binding.torBootstrapButton2.visibility = View.VISIBLE binding.torBootstrapButton2.text = getString(R.string.btn_cancel) @@ -221,7 +218,6 @@ class TorConnectionAssistFragment : Fragment() { ) handleDescriptionWithClickable(internetErrorDescription, learnMore)
- binding.quickStartDescription.visibility = View.GONE binding.quickstartSwitch.visibility = View.GONE
binding.torBootstrapButton1.visibility = View.VISIBLE @@ -249,7 +245,6 @@ class TorConnectionAssistFragment : Fragment() { getString(R.string.connection_assist_trying_again_waiting_title)
binding.quickstartSwitch.visibility = View.GONE - binding.quickStartDescription.visibility = View.GONE binding.torBootstrapButton1.visibility = View.INVISIBLE binding.torBootstrapButton2.visibility = View.VISIBLE binding.torBootstrapButton2.text = getString(R.string.btn_cancel) @@ -282,7 +277,6 @@ class TorConnectionAssistFragment : Fragment() { ) handleDescriptionWithClickable(tryABridge, learnMore)
- binding.quickStartDescription.visibility = View.GONE binding.quickstartSwitch.visibility = View.GONE binding.unblockTheInternetInCountryDescription.visibility = View.VISIBLE binding.countryDropDown.visibility = View.VISIBLE
===================================== fenix/app/src/main/res/layout/fragment_tor_connection_assist.xml ===================================== @@ -70,85 +70,52 @@ android:visibility="visible" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/tor_bootstrap_progress_bar" - app:layout_constraintVertical_bias="0.075" + app:layout_constraintTop_toBottomOf="@+id/back_button" + app:layout_constraintVertical_bias="0.05" app:srcCompat="@drawable/connect" />
<TextView android:id="@+id/title_large_text_view" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginStart="24dp" - android:layout_marginEnd="24dp" + android:layout_marginTop="24dp" + android:paddingHorizontal="24dp" android:text="@string/connection_assist_tor_connect_title" android:textColor="#FBFBFE" android:textSize="22sp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@id/tor_connect_image" - app:layout_constraintVertical_bias="0.03" /> + app:layout_constraintTop_toBottomOf="@id/tor_connect_image" />
<TextView android:id="@+id/title_description" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginStart="24dp" - android:layout_marginEnd="24dp" android:lineSpacingExtra="6dp" + android:paddingHorizontal="24dp" + android:paddingVertical="16dp" android:text="@string/preferences_tor_network_settings_explanation" android:textColor="#FBFBFE" android:textSize="14sp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.0" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@id/title_large_text_view" - app:layout_constraintVertical_bias="0.03" /> - - - <TextView - android:id="@+id/quick_start_description" - android:layout_width="230dp" - android:layout_height="wrap_content" - android:layout_marginStart="24dp" - android:text="@string/connection_assist_always_connect_automatically_toggle_description" - android:textColor="#FBFBFE" - android:textSize="14sp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/title_description" - app:layout_constraintVertical_bias=".03" /> + app:layout_constraintTop_toBottomOf="@id/title_large_text_view" />
<androidx.appcompat.widget.SwitchCompat android:id="@+id/quickstart_switch" - android:layout_width="wrap_content" + android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginStart="100dp" - android:layout_marginEnd="24dp" - android:layout_marginBottom="24dp" - android:gravity="center" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0" - app:layout_constraintStart_toEndOf="@+id/quick_start_description" - app:layout_constraintTop_toBottomOf="@id/title_description" - app:layout_constraintVertical_bias=".023" - app:layout_goneMarginEnd="6dp" - app:layout_goneMarginTop="9dp" /> + android:paddingHorizontal="24dp" + android:paddingVertical="8dp" + android:text="@string/connection_assist_always_connect_automatically_toggle_description" + android:textColor="#FBFBFE" + app:layout_constraintTop_toBottomOf="@id/title_description" />
<TextView android:id="@+id/unblock_the_internet_in_country_description" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginStart="24dp" + android:paddingHorizontal="24dp" android:layout_marginTop="24dp" - android:layout_marginEnd="24dp" android:text="@string/connection_assist_unblock_the_internet_in_country_or_region" android:textColor="#FBFBFE" - android:visibility="invisible" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" + android:visibility="gone" app:layout_constraintTop_toBottomOf="@id/title_description" />
<androidx.appcompat.widget.AppCompatSpinner @@ -161,7 +128,7 @@ android:layout_marginEnd="24dp" android:textColor="#FBFBFE" android:tooltipText="@string/connection_assist_share_my_location_country_or_region" - android:visibility="invisible" + android:visibility="gone" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/unblock_the_internet_in_country_description" /> @@ -170,13 +137,14 @@ android:id="@+id/wordmarkLogo" android:layout_width="160dp" android:layout_height="160dp" + android:contentDescription="" android:src="@mipmap/ic_launcher_round"
+ android:visibility="gone" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - android:contentDescription="" /> + app:layout_constraintTop_toTopOf="parent" />
<Button android:id="@+id/tor_bootstrap_button_1" @@ -195,9 +163,7 @@ android:textStyle="bold" app:layout_constraintBottom_toTopOf="@id/tor_bootstrap_button_2" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/quickstart_switch" - app:layout_constraintVertical_bias="1" /> + app:layout_constraintStart_toStartOf="parent" />
<Button android:id="@+id/tor_bootstrap_button_2"
View it on GitLab: https://gitlab.torproject.org/tpo/applications/firefox-android/-/commit/1b8e...
tor-commits@lists.torproject.org