summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Jacquart <guillaume.jacquart@hoodbrains.com>2022-11-23 07:51:59 +0000
committerGuillaume Jacquart <guillaume.jacquart@hoodbrains.com>2022-11-23 07:51:59 +0000
commitff6e8c83f1dd95daaadeb950efe90f7016c09458 (patch)
tree1cbbb02709c2f50335ccc3d7a5bd747f76375c9e
parent84bdb74c79a41c90d4d374bf5eb963191de3e7b3 (diff)
829: Fix toggles layout for various tranlsation lengths.
-rw-r--r--app/src/main/res/layout/dashboard_item_submenu_button.xml2
-rw-r--r--app/src/main/res/layout/fragment_dashboard.xml192
-rw-r--r--app/src/main/res/layout/trackers_item_graph.xml17
-rw-r--r--app/src/main/res/layout/widget.xml174
4 files changed, 215 insertions, 170 deletions
diff --git a/app/src/main/res/layout/dashboard_item_submenu_button.xml b/app/src/main/res/layout/dashboard_item_submenu_button.xml
index 9129d07..ef03ea3 100644
--- a/app/src/main/res/layout/dashboard_item_submenu_button.xml
+++ b/app/src/main/res/layout/dashboard_item_submenu_button.xml
@@ -27,7 +27,7 @@
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:padding="16dp"
+ android:paddingHorizontal="16dp"
android:background="?attr/selectableItemBackground"
>
<ImageView
diff --git a/app/src/main/res/layout/fragment_dashboard.xml b/app/src/main/res/layout/fragment_dashboard.xml
index cedf569..b1fdaa0 100644
--- a/app/src/main/res/layout/fragment_dashboard.xml
+++ b/app/src/main/res/layout/fragment_dashboard.xml
@@ -49,122 +49,154 @@
android:background="@color/divider"
/>
-
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:padding="16dp"
+ android:layout_marginTop="8dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
- android:padding="16dp"
-
- android:layout_marginTop="8dp"
- android:layout_marginBottom="16dp">
- <LinearLayout
+ android:layout_marginBottom="8dp"
+ android:gravity="bottom"
+ android:baselineAligned="false"
+ >
+ <TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
- android:orientation="vertical"
android:gravity="center_horizontal"
- >
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/dashboard_state_trackers_label"
- android:textSize="12sp"
- android:textColor="@color/secondary_text"
- android:layout_marginBottom="8dp"
- android:textAllCaps="true"
- />
- <TextView
- android:id="@+id/state_trackers"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/dashboard_state_trackers_off"
- android:textSize="12sp"
- android:textColor="@color/primary_text"
- android:textAllCaps="true"
- />
- <Switch
- android:id="@+id/toggle_trackers"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_margin="12dp"
- />
- </LinearLayout>
- <LinearLayout
+ android:text="@string/dashboard_state_trackers_label"
+ android:textSize="12sp"
+ android:textColor="@color/secondary_text"
+ android:textAllCaps="true"
+ />
+ <TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
- android:orientation="vertical"
android:gravity="center_horizontal"
- >
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/dashboard_state_geolocation_label"
- android:textSize="12sp"
- android:textColor="@color/secondary_text"
- android:layout_marginBottom="8dp"
- android:textAllCaps="true"
- />
- <TextView
- android:id="@+id/state_geolocation"
- android:layout_width="wrap_content"
+ android:text="@string/dashboard_state_geolocation_label"
+ android:textSize="12sp"
+ android:textColor="@color/secondary_text"
+ android:textAllCaps="true"
+ />
+ <TextView
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:gravity="center_horizontal"
+ android:text="@string/dashboard_state_ipaddress_label"
+ android:textSize="12sp"
+ android:textColor="@color/secondary_text"
+ android:textAllCaps="true"
+ />
+ </LinearLayout>
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:gravity="bottom"
+ android:baselineAligned="false"
+ >
+ <TextView
+ android:id="@+id/state_trackers"
+ android:layout_width="0dp"
+ android:layout_weight="1"
+ android:gravity="center_horizontal"
android:layout_height="wrap_content"
- android:text="@string/dashboard_state_geolocation_off"
+ android:text="@string/dashboard_state_trackers_off"
android:textSize="12sp"
android:textColor="@color/primary_text"
android:textAllCaps="true"
/>
- <Switch
- android:id="@+id/toggle_location"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_margin="12dp"
- />
- </LinearLayout>
- <LinearLayout
+
+ <TextView
+ android:id="@+id/state_geolocation"
android:layout_width="0dp"
+ android:layout_weight="1"
+ android:gravity="center_horizontal"
android:layout_height="wrap_content"
+ android:text="@string/dashboard_state_geolocation_off"
+ android:textSize="12sp"
+ android:textColor="@color/primary_text"
+ android:textAllCaps="true"
+ />
+ <FrameLayout
+ android:layout_width="0dp"
android:layout_weight="1"
- android:orientation="vertical"
android:gravity="center_horizontal"
- >
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/dashboard_state_ipaddress_label"
- android:textSize="12sp"
- android:textColor="@color/secondary_text"
- android:layout_marginBottom="8dp"
- android:textAllCaps="true"
- />
+ android:layout_height="wrap_content">
<TextView
android:id="@+id/state_ip_address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
-android:text="@string/dashboard_state_ipaddress_off"
+ android:layout_gravity="center_horizontal"
+ android:gravity="center_horizontal"
+ android:text="@string/dashboard_state_ipaddress_off"
android:textSize="12sp"
android:textColor="@color/primary_text"
android:textAllCaps="true"
- android:visibility="gone"
+ android:visibility="visible"
/>
<ProgressBar
android:id="@+id/state_ip_address_loader"
+ android:layout_gravity="center_horizontal"
android:layout_width="16dp"
android:layout_height="16dp"
android:indeterminate="true"
+
android:visibility="visible"/>
+ </FrameLayout>
+ </LinearLayout>
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ >
+ <View
+ android:layout_width="0dp"
+ android:layout_height="1dp"
+ android:layout_weight="1"
+ />
+ <Switch
+ android:id="@+id/toggle_trackers"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:padding="12dp"
+ />
+ <View
+ android:layout_width="0dp"
+ android:layout_height="1dp"
+ android:layout_weight="2"
+ />
+ <Switch
+ android:id="@+id/toggle_location"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:padding="12dp"
+ />
+ <View
+ android:layout_width="0dp"
+ android:layout_height="1dp"
+ android:layout_weight="2"
+ />
<Switch
android:id="@+id/toggle_ipscrambling"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
- android:layout_margin="12dp"
+ android:padding="12dp"
/>
+ <View
+ android:layout_width="0dp"
+ android:layout_height="1dp"
+ android:layout_weight="1"
+ />
</LinearLayout>
</LinearLayout>
-
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -219,7 +251,7 @@ android:text="@string/dashboard_state_ipaddress_off"
android:padding="1dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/graph_legend"
- android:layout_marginTop="8dp"
+ android:layout_marginTop="9dp"
android:layout_marginStart="16dp"
android:background="@drawable/ic_legend_blocked"
/>
@@ -227,13 +259,11 @@ android:text="@string/dashboard_state_ipaddress_off"
android:id="@+id/graph_legend_blocked"
android:layout_width="0dp"
android:layout_height="wrap_content"
- tools:text="0 Trackers"
- android:ellipsize="end"
- android:maxLines="1"
+ tools:text="Blockierte Datenlecks"
android:layout_marginStart="8dp"
android:textSize="12sp"
app:layout_constraintLeft_toRightOf="@+id/graph_legend_blocked_icon"
- app:layout_constraintBottom_toBottomOf="@+id/graph_legend_blocked_icon"
+ app:layout_constraintTop_toBottomOf="@+id/graph_legend"
app:layout_constraintRight_toLeftOf="@id/graph_legend_allowed_icon"
android:layout_marginTop="8dp"
android:text="@string/graph_legend_blocked"
@@ -247,22 +277,20 @@ android:text="@string/dashboard_state_ipaddress_off"
app:layout_constraintLeft_toRightOf="@+id/graph_legend_blocked"
app:layout_constraintBottom_toBottomOf="@+id/graph_legend_blocked_icon"
app:layout_constraintRight_toLeftOf="@id/graph_legend_allowed"
- android:layout_marginTop="8dp"
+ android:layout_marginTop="9dp"
android:layout_marginStart="16dp"
android:background="@drawable/ic_legend_leaked"
/>
<TextView
android:id="@+id/graph_legend_allowed"
android:layout_width="0dp"
- android:ellipsize="end"
- android:maxLines="1"
android:layout_height="wrap_content"
tools:text="0 Trackers"
android:layout_marginStart="8dp"
android:textSize="12sp"
app:layout_constraintRight_toLeftOf="@id/leaking_app_button"
app:layout_constraintLeft_toRightOf="@+id/graph_legend_allowed_icon"
- app:layout_constraintBottom_toBottomOf="@+id/graph_legend_blocked_icon"
+ app:layout_constraintTop_toBottomOf="@+id/graph_legend"
android:layout_marginTop="8dp"
android:text="@string/graph_legend_allowed"
/>
diff --git a/app/src/main/res/layout/trackers_item_graph.xml b/app/src/main/res/layout/trackers_item_graph.xml
index 20106f7..aabc108 100644
--- a/app/src/main/res/layout/trackers_item_graph.xml
+++ b/app/src/main/res/layout/trackers_item_graph.xml
@@ -63,22 +63,19 @@
android:padding="1dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/graph"
- android:layout_marginTop="8dp"
+ android:layout_marginTop="9dp"
android:layout_marginStart="16dp"
android:background="@drawable/ic_legend_blocked"
/>
<TextView
android:id="@+id/graph_legend_blocked"
android:layout_width="0dp"
- android:maxLines="1"
- android:ellipsize="end"
android:layout_height="wrap_content"
tools:text="0 Trackers"
android:layout_marginStart="8dp"
android:textSize="12sp"
app:layout_constraintLeft_toRightOf="@+id/graph_legend_blocked_icon"
- app:layout_constraintBottom_toBottomOf="@+id/graph_legend_blocked_icon"
- app:layout_constraintRight_toLeftOf="@id/graph_legend_allowed_icon"
+ app:layout_constraintTop_toBottomOf="@+id/graph" app:layout_constraintRight_toLeftOf="@id/graph_legend_allowed_icon"
android:layout_marginTop="8dp"
android:text="@string/graph_legend_blocked"
/>
@@ -89,9 +86,8 @@
android:layout_height="16dp"
android:padding="1dp"
app:layout_constraintLeft_toRightOf="@+id/graph_legend_blocked"
- app:layout_constraintBottom_toBottomOf="@+id/graph_legend_blocked_icon"
- app:layout_constraintRight_toLeftOf="@id/graph_legend_allowed"
- android:layout_marginTop="8dp"
+ app:layout_constraintTop_toBottomOf="@+id/graph" app:layout_constraintRight_toLeftOf="@id/graph_legend_allowed"
+ android:layout_marginTop="9dp"
android:layout_marginStart="16dp"
android:background="@drawable/ic_legend_leaked"
/>
@@ -99,14 +95,11 @@
android:id="@+id/graph_legend_allowed"
android:layout_width="0dp"
android:layout_height="wrap_content"
- android:maxLines="1"
- android:ellipsize="end"
tools:text="0 Trackers"
android:layout_marginStart="8dp"
android:textSize="12sp"
app:layout_constraintLeft_toRightOf="@+id/graph_legend_allowed_icon"
- app:layout_constraintBottom_toBottomOf="@+id/graph_legend_blocked_icon"
- app:layout_constraintRight_toRightOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/graph" app:layout_constraintRight_toRightOf="parent"
android:layout_marginTop="8dp"
android:layout_marginRight="16dp"
android:text="@string/graph_legend_allowed"
diff --git a/app/src/main/res/layout/widget.xml b/app/src/main/res/layout/widget.xml
index 1e78bc7..ad7e2b9 100644
--- a/app/src/main/res/layout/widget.xml
+++ b/app/src/main/res/layout/widget.xml
@@ -73,132 +73,158 @@
android:textColor="@color/on_primary_medium_emphasis"
/>
</LinearLayout>
+
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="horizontal"
+ android:orientation="vertical"
android:layout_marginHorizontal="24dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp">
+
<LinearLayout
- android:layout_width="0dp"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_weight="1"
- android:orientation="vertical"
- android:gravity="center_horizontal"
+ android:orientation="horizontal"
+ android:layout_marginBottom="4dp"
+ android:gravity="bottom"
+ android:baselineAligned="false"
>
<TextView
android:id="@+id/trackers_label"
- android:layout_width="wrap_content"
+ android:layout_width="0dp"
+ android:layout_weight="1"
+ android:layout_marginHorizontal="2dp"
+ android:gravity="center_horizontal"
android:layout_height="wrap_content"
android:text="@string/dashboard_state_trackers_label"
android:textSize="10sp"
android:textColor="@color/on_primary_disabled"
- android:layout_marginBottom="4dp"
android:textAllCaps="true"
/>
<TextView
- android:id="@+id/state_trackers"
- android:layout_width="wrap_content"
- android:layout_height="18dp"
- android:text="@string/dashboard_state_trackers_off"
- android:textSize="12sp"
- android:textColor="@color/on_primary_high_emphasis"
+ android:id="@+id/geolocation_label"
+ android:layout_width="0dp"
+ android:layout_weight="1"
+ android:layout_marginHorizontal="2dp"
+ android:gravity="center_horizontal"
+ android:layout_height="wrap_content"
+ android:text="@string/dashboard_state_geolocation_label"
+ android:textSize="10sp"
+ android:textColor="@color/on_primary_disabled"
android:textAllCaps="true"
- android:gravity="center"
/>
- <ImageView
- android:id="@+id/toggle_trackers"
- android:layout_width="wrap_content"
+ <TextView
+ android:id="@+id/ip_address_label"
+ android:layout_width="0dp"
+ android:layout_weight="1"
+ android:layout_marginHorizontal="2dp"
+ android:gravity="center_horizontal"
android:layout_height="wrap_content"
- android:layout_marginTop="8dp"
- android:src="@drawable/ic_switch_disabled"
+ android:text="@string/dashboard_state_ipaddress_label"
+ android:textSize="10sp"
+ android:textColor="@color/on_primary_disabled"
+ android:textAllCaps="true"
/>
</LinearLayout>
<LinearLayout
- android:layout_width="0dp"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_weight="1"
- android:orientation="vertical"
- android:gravity="center_horizontal"
+ android:orientation="horizontal"
+ android:gravity="bottom"
+ android:baselineAligned="false"
>
<TextView
- android:id="@+id/geolocation_label"
- android:layout_width="wrap_content"
+ android:id="@+id/state_trackers"
android:layout_height="wrap_content"
- android:text="@string/dashboard_state_geolocation_label"
- android:textSize="10sp"
- android:textColor="@color/on_primary_disabled"
- android:layout_marginBottom="4dp"
+ android:layout_width="0dp"
+ android:layout_weight="1"
+ android:layout_marginHorizontal="2dp"
+ android:gravity="center_horizontal"
+ android:text="@string/dashboard_state_trackers_off"
+ android:textSize="12sp"
+ android:textColor="@color/on_primary_high_emphasis"
android:textAllCaps="true"
/>
<TextView
android:id="@+id/state_geolocation"
- android:layout_width="wrap_content"
- android:layout_height="18dp"
+ android:layout_height="wrap_content"
+ android:layout_width="0dp"
+ android:layout_weight="1"
+ android:layout_marginHorizontal="2dp"
android:text="@string/dashboard_state_geolocation_off"
android:textSize="12sp"
android:textColor="@color/on_primary_high_emphasis"
android:textAllCaps="true"
- android:gravity="center"
+ android:gravity="center_horizontal"
/>
- <ImageView
- android:id="@+id/toggle_location"
- android:layout_width="wrap_content"
+ <FrameLayout
android:layout_height="wrap_content"
- android:layout_marginTop="8dp"
- android:src="@drawable/ic_switch_disabled"
- />
+ android:layout_width="0dp"
+ android:layout_weight="1"
+ android:layout_marginHorizontal="2dp"
+ android:gravity="center_horizontal"
+ >
+ <TextView
+ android:id="@+id/state_ip_address"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center"
+ android:gravity="center_horizontal"
+ android:text="@string/dashboard_state_ipaddress_off"
+ android:textSize="12sp"
+ android:textColor="@color/on_primary_high_emphasis"
+ android:textAllCaps="true"
+ android:visibility="gone"
+ />
+ <ProgressBar
+ android:id="@+id/state_ip_address_loader"
+ android:layout_width="16dp"
+ android:layout_height="16dp"
+ android:layout_gravity="center"
+ android:indeterminate="true"
+ android:visibility="visible"
+
+ />
+ </FrameLayout>
</LinearLayout>
<LinearLayout
- android:layout_width="0dp"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_weight="1"
- android:orientation="vertical"
- android:gravity="center_horizontal"
+ android:orientation="horizontal"
+ android:gravity="center"
>
- <TextView
- android:id="@+id/ip_address_label"
- android:layout_width="wrap_content"
+ <ImageView
+ android:id="@+id/toggle_trackers"
+ android:layout_width="0dp"
+ android:layout_weight="1"
android:layout_height="wrap_content"
- android:text="@string/dashboard_state_ipaddress_label"
- android:textSize="10sp"
- android:textColor="@color/on_primary_disabled"
- android:layout_marginBottom="4dp"
- android:textAllCaps="true"
+ android:padding="8dp"
+ android:src="@drawable/ic_switch_disabled"
/>
- <TextView
- android:id="@+id/state_ip_address"
- android:layout_width="wrap_content"
- android:layout_height="18dp"
- android:text="@string/dashboard_state_ipaddress_off"
- android:textSize="12sp"
- android:textColor="@color/on_primary_high_emphasis"
- android:textAllCaps="true"
- android:visibility="gone"
- android:gravity="center"
+ <ImageView
+ android:id="@+id/toggle_location"
+ android:layout_width="0dp"
+ android:layout_weight="1"
+ android:layout_height="wrap_content"
+ android:padding="8dp"
+ android:src="@drawable/ic_switch_disabled"
/>
- <ProgressBar
- android:id="@+id/state_ip_address_loader"
- android:layout_width="18dp"
- android:layout_height="18dp"
- android:indeterminate="true"
- android:visibility="visible"/>
<ImageView
android:id="@+id/toggle_ipscrambling"
- android:layout_width="wrap_content"
+ android:layout_width="0dp"
+ android:layout_weight="1"
android:layout_height="wrap_content"
- android:layout_marginTop="8dp"
+ android:padding="8dp"
android:src="@drawable/ic_switch_disabled"
/>
</LinearLayout>
</LinearLayout>
-
<LinearLayout
android:id="@+id/graph"
android:layout_width="match_parent"
- android:layout_marginTop="16dp"
+ android:layout_marginTop="8dp"
android:layout_marginHorizontal="24dp"
android:layout_height="26dp"
>
@@ -711,7 +737,7 @@
android:layout_marginTop="16dp"
android:layout_marginHorizontal="24dp"
android:layout_marginBottom="24dp"
- android:gravity="center_vertical"
+ android:gravity="top"
>
<ImageView
@@ -719,15 +745,14 @@
android:layout_width="16dp"
android:layout_height="16dp"
android:padding="1dp"
+ android:layout_marginTop="4dp"
android:src="@drawable/ic_legend_blocked"
/>
<TextView
- android:ellipsize="end"
android:id="@+id/graph_legend_blocked"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
- android:maxLines="1"
tools:text="0 Trackers"
android:textColor="@color/on_primary_medium_emphasis"
android:layout_marginStart="8dp"
@@ -740,17 +765,16 @@
android:layout_width="16dp"
android:layout_height="16dp"
android:padding="1dp"
+ android:layout_marginTop="4dp"
android:layout_marginStart="10dp"
android:src="@drawable/ic_legend_leaked"
/>
<TextView
- android:ellipsize="end"
android:id="@+id/graph_legend_allowed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
- android:maxLines="1"
tools:text="0 Trackers"
android:textColor="@color/on_primary_medium_emphasis"
android:layout_marginStart="8dp"