summaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2021-11-07 19:54:46 +0100
committercyBerta <cyberta@riseup.net>2021-11-07 19:54:46 +0100
commit6ef5241baf6a1fa2bc4e6f3ecd805edf4827e712 (patch)
tree12d584701d4e0b86e2c37ec3ef2aa8bb963ec961 /app/src
parent840b2ca0dea22bba983698d832d3f4d1e7efacf8 (diff)
tweak loading screen - hide connection details behind a clickable lable
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/providersetup/activities/ConfigWizardBaseActivity.java27
-rw-r--r--app/src/main/res/layout-xlarge/v_loading_screen.xml52
-rw-r--r--app/src/main/res/layout/v_loading_screen.xml50
-rw-r--r--app/src/main/res/values/strings.xml1
4 files changed, 90 insertions, 40 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/providersetup/activities/ConfigWizardBaseActivity.java b/app/src/main/java/se/leap/bitmaskclient/providersetup/activities/ConfigWizardBaseActivity.java
index 12c237c5..546beb18 100644
--- a/app/src/main/java/se/leap/bitmaskclient/providersetup/activities/ConfigWizardBaseActivity.java
+++ b/app/src/main/java/se/leap/bitmaskclient/providersetup/activities/ConfigWizardBaseActivity.java
@@ -71,7 +71,15 @@ public abstract class ConfigWizardBaseActivity extends ButterKnifeActivity imple
@Nullable
@BindView(R.id.btn_connection_detail)
- protected Button connectionDetailBtn;
+ protected AppCompatTextView connectionDetailBtn;
+
+ @Nullable
+ @BindView(R.id.connection_detail_header_container)
+ protected RelativeLayout connectionDetailHeaderContainer;
+
+ @Nullable
+ @BindView(R.id.connection_details_title)
+ protected AppCompatTextView connectionDetailsTitle;
@Nullable
@BindView(R.id.connection_detail_container)
@@ -224,7 +232,7 @@ public abstract class ConfigWizardBaseActivity extends ButterKnifeActivity imple
return;
}
- connectionDetailBtn.setVisibility(VISIBLE);
+ connectionDetailHeaderContainer.setVisibility(GONE);
connectionDetailContainer.setVisibility(GONE);
logsContainer.setVisibility(GONE);
}
@@ -254,10 +262,19 @@ public abstract class ConfigWizardBaseActivity extends ButterKnifeActivity imple
snowflakeState.setText(getLastSnowflakeLog());
torState.setText(getLastTorLog());
connectionDetailBtn.setOnClickListener(v -> {
- connectionDetailBtn.setVisibility(GONE);
- logsContainer.setVisibility(VISIBLE);
+ if (logsContainer.getVisibility() == VISIBLE) {
+ logsContainer.setVisibility(GONE);
+ connectionDetailContainer.setVisibility(GONE);
+ connectionDetailsTitle.setVisibility(GONE);
+ connectionDetailBtn.setText(R.string.show_connection_details);
+ } else {
+ logsContainer.setVisibility(VISIBLE);
+ connectionDetailContainer.setVisibility(VISIBLE);
+ connectionDetailsTitle.setVisibility(VISIBLE);
+ connectionDetailBtn.setText(R.string.hide_connection_details);
+ }
});
- connectionDetailContainer.setVisibility(VISIBLE);
+ connectionDetailHeaderContainer.setVisibility(VISIBLE);
}
private int getFirstVisibleItemPosion() {
diff --git a/app/src/main/res/layout-xlarge/v_loading_screen.xml b/app/src/main/res/layout-xlarge/v_loading_screen.xml
index 0b71099e..24b44f9a 100644
--- a/app/src/main/res/layout-xlarge/v_loading_screen.xml
+++ b/app/src/main/res/layout-xlarge/v_loading_screen.xml
@@ -57,17 +57,36 @@
/>
<RelativeLayout
- android:id="@+id/connection_detail_container"
+ android:id="@+id/connection_detail_header_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginTop="30dp"
- android:visibility="gone"
- tools:visibility="visible"
+ android:layout_marginTop="@dimen/stdpadding"
>
+
+ <androidx.appcompat.widget.AppCompatTextView
+ android:id="@+id/btn_connection_detail"
+ android:layout_marginTop="@dimen/stdpadding"
+ android:paddingLeft="@dimen/stdpadding"
+ android:paddingStart="@dimen/stdpadding"
+ android:paddingEnd="@dimen/stdpadding"
+ android:paddingRight="@dimen/stdpadding"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentEnd="true"
+ android:layout_alignParentRight="true"
+ android:layout_alignParentTop="true"
+ android:text="@string/show_connection_details"
+ android:textColor="@color/colorPrimaryDark"
+ android:maxLines="1"
+ android:ellipsize="end"
+ android:visibility="visible"
+ tools:text="@string/hide_connection_details"
+ />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/connection_details_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_alignBaseline="@id/btn_connection_detail"
android:text="@string/connection_details"
android:gravity="start"
android:textAppearance="@style/Base.TextAppearance.AppCompat.Medium"
@@ -76,14 +95,24 @@
android:paddingLeft="4dp"
android:paddingEnd="4dp"
android:paddingRight="4dp"
+ tools:visibility="visible"
+ android:visibility="gone"
/>
+ </RelativeLayout>
+ <RelativeLayout
+ android:id="@+id/connection_detail_container"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:visibility="gone"
+ tools:visibility="visible"
+ >
+
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/tor_icon"
android:layout_width="35dp"
android:layout_height="35dp"
android:src="@drawable/ic_tor"
- android:layout_below="@id/connection_details_title"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="@dimen/stdpadding"
@@ -92,7 +121,6 @@
android:id="@+id/tor_state"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_below="@id/connection_details_title"
android:fadingEdge="horizontal"
android:maxLines="2"
android:text="@string/configuring_provider"
@@ -105,7 +133,6 @@
android:gravity="bottom"
tools:text="test 12321 123 \n sdf,sdf,m\nn 123 "
android:ellipsize="end"
-
tools:visibility="visible"
/>
@@ -140,17 +167,6 @@
android:ellipsize="end"
tools:visibility="visible"
/>
- <Button
- android:id="@+id/btn_connection_detail"
- android:layout_marginTop="30dp"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentEnd="true"
- android:layout_alignParentRight="true"
- android:layout_below="@id/snowflake_icon"
- android:text="@string/show_log"
- android:visibility="visible"
- />
</RelativeLayout>
<RelativeLayout
android:id="@+id/log_container"
diff --git a/app/src/main/res/layout/v_loading_screen.xml b/app/src/main/res/layout/v_loading_screen.xml
index b489f71f..26ab25cc 100644
--- a/app/src/main/res/layout/v_loading_screen.xml
+++ b/app/src/main/res/layout/v_loading_screen.xml
@@ -55,18 +55,37 @@
android:layout_marginTop="@dimen/standard_margin"
/>
+
<RelativeLayout
- android:id="@+id/connection_detail_container"
+ android:id="@+id/connection_detail_header_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginTop="30dp"
- android:visibility="gone"
- tools:visibility="visible"
+ android:layout_marginTop="@dimen/stdpadding"
>
+
+ <androidx.appcompat.widget.AppCompatTextView
+ android:id="@+id/btn_connection_detail"
+ android:layout_marginTop="@dimen/stdpadding"
+ android:paddingLeft="@dimen/stdpadding"
+ android:paddingStart="@dimen/stdpadding"
+ android:paddingEnd="@dimen/stdpadding"
+ android:paddingRight="@dimen/stdpadding"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentEnd="true"
+ android:layout_alignParentRight="true"
+ android:layout_alignParentTop="true"
+ android:text="@string/show_connection_details"
+ android:textColor="@color/colorPrimaryDark"
+ android:maxLines="1"
+ android:ellipsize="end"
+ android:visibility="visible"
+ />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/connection_details_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_alignBaseline="@id/btn_connection_detail"
android:text="@string/connection_details"
android:gravity="start"
android:textAppearance="@style/Base.TextAppearance.AppCompat.Medium"
@@ -75,14 +94,23 @@
android:paddingLeft="4dp"
android:paddingEnd="4dp"
android:paddingRight="4dp"
+ android:visibility="gone"
/>
+ </RelativeLayout>
+
+ <RelativeLayout
+ android:id="@+id/connection_detail_container"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:visibility="gone"
+ tools:visibility="visible"
+ >
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/tor_icon"
android:layout_width="35dp"
android:layout_height="35dp"
android:src="@drawable/ic_tor"
- android:layout_below="@id/connection_details_title"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="@dimen/stdpadding"
@@ -91,7 +119,6 @@
android:id="@+id/tor_state"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_below="@id/connection_details_title"
android:fadingEdge="horizontal"
android:maxLines="2"
android:text="@string/configuring_provider"
@@ -139,17 +166,6 @@
android:ellipsize="end"
tools:visibility="visible"
/>
- <Button
- android:id="@+id/btn_connection_detail"
- android:layout_marginTop="30dp"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentEnd="true"
- android:layout_alignParentRight="true"
- android:layout_below="@id/snowflake_icon"
- android:text="@string/show_log"
- android:visibility="visible"
- />
</RelativeLayout>
<RelativeLayout
android:id="@+id/log_container"
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index dbe386b3..c700231d 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -178,6 +178,7 @@
<string name="channel_description_tor_service">Informs about usage of bridges while configuring %s.</string>
<string name="error_tor_timeout">Starting bridges failed. Do you want to retry or continue with an unobfuscated secure connection to configure %s?</string>
<string name="retry_unobfuscated">Retry unobfuscated</string>
+ <string name="hide_connection_details">Hide connection details</string>
</resources>