From 7141c0dd2bd0e7cd766f08e49821b4abc778de9c Mon Sep 17 00:00:00 2001 From: cyberta Date: Wed, 30 Nov 2022 01:37:33 +0100 Subject: rename drawables and colors according to the state they're representing --- app/src/main/res/values/colors.xml | 1 - 1 file changed, 1 deletion(-) (limited to 'app') diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index c3a519cf..62f6d163 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -37,7 +37,6 @@ #20000000 #05000000 - @color/black800 @color/black800 @color/white -- cgit v1.2.3 From c0e9e9122e011911e40cfceae45d5ac535b77b94 Mon Sep 17 00:00:00 2001 From: cyberta Date: Wed, 30 Nov 2022 14:02:52 +0100 Subject: keep default EipFragment layout for backwards compatibility --- app/src/main/res/layout-port/f_eip.xml | 113 ++++++++++++++++++++++++ app/src/main/res/layout-xlarge/f_eip.xml | 122 ++++++++++++++++++++++++++ app/src/main/res/layout/f_eip.xml | 146 +++++++++++++++++++++++++++++++ 3 files changed, 381 insertions(+) create mode 100644 app/src/main/res/layout-port/f_eip.xml create mode 100644 app/src/main/res/layout-xlarge/f_eip.xml create mode 100644 app/src/main/res/layout/f_eip.xml (limited to 'app') diff --git a/app/src/main/res/layout-port/f_eip.xml b/app/src/main/res/layout-port/f_eip.xml new file mode 100644 index 00000000..cb99a700 --- /dev/null +++ b/app/src/main/res/layout-port/f_eip.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout-xlarge/f_eip.xml b/app/src/main/res/layout-xlarge/f_eip.xml new file mode 100644 index 00000000..10b7a7e3 --- /dev/null +++ b/app/src/main/res/layout-xlarge/f_eip.xml @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/f_eip.xml b/app/src/main/res/layout/f_eip.xml new file mode 100644 index 00000000..9a823b65 --- /dev/null +++ b/app/src/main/res/layout/f_eip.xml @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3 From 709362f5adefdf0727aa0ea111b3a5105c7ed8d0 Mon Sep 17 00:00:00 2001 From: cyberta Date: Wed, 30 Nov 2022 14:03:40 +0100 Subject: fix default location button design --- app/src/main/res/layout/v_location_button.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/src/main/res/layout/v_location_button.xml b/app/src/main/res/layout/v_location_button.xml index aa4af10c..e8a0c885 100644 --- a/app/src/main/res/layout/v_location_button.xml +++ b/app/src/main/res/layout/v_location_button.xml @@ -6,7 +6,7 @@ android:layout_width="match_parent" android:layout_gravity="center_vertical" android:padding="@dimen/stdpadding" - android:background="@drawable/cust_button_light_rect" + android:background="@drawable/cust_button_primary_rect" android:layout_height="match_parent" > @@ -58,6 +58,7 @@ android:paddingRight="@dimen/stdpadding" android:textAppearance="@style/TextAppearance.AppCompat.Large" android:textStyle="bold" + android:textColor="@color/colorLocationButtonTint" app:autoSizeMaxTextSize="24sp" app:autoSizeMinTextSize="15sp" app:autoSizeTextType="uniform" -- cgit v1.2.3 From be9fba479233fa7dfd3d4b71069f091aeb667d47 Mon Sep 17 00:00:00 2001 From: cyberta Date: Wed, 30 Nov 2022 14:19:06 +0100 Subject: add missing default EipFragment layout file for x-large portrait displays --- app/src/main/res/layout-xlarge-port/f_eip.xml | 122 ++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 app/src/main/res/layout-xlarge-port/f_eip.xml (limited to 'app') diff --git a/app/src/main/res/layout-xlarge-port/f_eip.xml b/app/src/main/res/layout-xlarge-port/f_eip.xml new file mode 100644 index 00000000..10b7a7e3 --- /dev/null +++ b/app/src/main/res/layout-xlarge-port/f_eip.xml @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3 From 905cf37dc3e5e7a3a3ffdd80b09cb4be3ccfc806 Mon Sep 17 00:00:00 2001 From: cyberta Date: Wed, 30 Nov 2022 16:01:52 +0100 Subject: add new drawables for riseupVPN --- app/src/custom/res/drawable-hdpi/bg_connected.png | Bin 0 -> 147673 bytes app/src/custom/res/drawable-hdpi/bg_connecting.png | Bin 0 -> 237385 bytes .../custom/res/drawable-hdpi/bg_disconnected.png | Bin 0 -> 123636 bytes app/src/custom/res/drawable-xhdpi/bg_connected.png | Bin 0 -> 228442 bytes .../custom/res/drawable-xhdpi/bg_connecting.png | Bin 0 -> 402134 bytes .../custom/res/drawable-xhdpi/bg_disconnected.png | Bin 0 -> 200573 bytes .../custom/res/drawable-xxhdpi/bg_connected.png | Bin 0 -> 460545 bytes .../custom/res/drawable-xxhdpi/bg_connecting.png | Bin 0 -> 831328 bytes .../custom/res/drawable-xxhdpi/bg_disconnected.png | Bin 0 -> 417997 bytes .../custom/res/drawable-xxxhdpi/bg_connected.png | Bin 0 -> 765207 bytes .../custom/res/drawable-xxxhdpi/bg_connecting.png | Bin 0 -> 1492820 bytes .../res/drawable-xxxhdpi/bg_disconnected.png | Bin 0 -> 683759 bytes app/src/custom/res/drawable/bg_connected.png | Bin 0 -> 77818 bytes app/src/custom/res/drawable/bg_connecting.png | Bin 0 -> 112675 bytes app/src/custom/res/drawable/bg_disconnected.png | Bin 0 -> 63491 bytes app/src/custom/res/drawable/state_connected.xml | 15 +++ app/src/custom/res/layout/v_location_button.xml | 104 +++++++++++++++ app/src/custom/res/layout/v_main_button.xml | 142 +++++++++++++++++++++ 18 files changed, 261 insertions(+) create mode 100644 app/src/custom/res/drawable-hdpi/bg_connected.png create mode 100644 app/src/custom/res/drawable-hdpi/bg_connecting.png create mode 100644 app/src/custom/res/drawable-hdpi/bg_disconnected.png create mode 100644 app/src/custom/res/drawable-xhdpi/bg_connected.png create mode 100644 app/src/custom/res/drawable-xhdpi/bg_connecting.png create mode 100644 app/src/custom/res/drawable-xhdpi/bg_disconnected.png create mode 100644 app/src/custom/res/drawable-xxhdpi/bg_connected.png create mode 100644 app/src/custom/res/drawable-xxhdpi/bg_connecting.png create mode 100644 app/src/custom/res/drawable-xxhdpi/bg_disconnected.png create mode 100644 app/src/custom/res/drawable-xxxhdpi/bg_connected.png create mode 100644 app/src/custom/res/drawable-xxxhdpi/bg_connecting.png create mode 100644 app/src/custom/res/drawable-xxxhdpi/bg_disconnected.png create mode 100644 app/src/custom/res/drawable/bg_connected.png create mode 100644 app/src/custom/res/drawable/bg_connecting.png create mode 100644 app/src/custom/res/drawable/bg_disconnected.png create mode 100644 app/src/custom/res/drawable/state_connected.xml create mode 100644 app/src/custom/res/layout/v_location_button.xml create mode 100644 app/src/custom/res/layout/v_main_button.xml (limited to 'app') diff --git a/app/src/custom/res/drawable-hdpi/bg_connected.png b/app/src/custom/res/drawable-hdpi/bg_connected.png new file mode 100644 index 00000000..53648c23 Binary files /dev/null and b/app/src/custom/res/drawable-hdpi/bg_connected.png differ diff --git a/app/src/custom/res/drawable-hdpi/bg_connecting.png b/app/src/custom/res/drawable-hdpi/bg_connecting.png new file mode 100644 index 00000000..a62d308c Binary files /dev/null and b/app/src/custom/res/drawable-hdpi/bg_connecting.png differ diff --git a/app/src/custom/res/drawable-hdpi/bg_disconnected.png b/app/src/custom/res/drawable-hdpi/bg_disconnected.png new file mode 100644 index 00000000..c2e031df Binary files /dev/null and b/app/src/custom/res/drawable-hdpi/bg_disconnected.png differ diff --git a/app/src/custom/res/drawable-xhdpi/bg_connected.png b/app/src/custom/res/drawable-xhdpi/bg_connected.png new file mode 100644 index 00000000..4491692a Binary files /dev/null and b/app/src/custom/res/drawable-xhdpi/bg_connected.png differ diff --git a/app/src/custom/res/drawable-xhdpi/bg_connecting.png b/app/src/custom/res/drawable-xhdpi/bg_connecting.png new file mode 100644 index 00000000..703a77c4 Binary files /dev/null and b/app/src/custom/res/drawable-xhdpi/bg_connecting.png differ diff --git a/app/src/custom/res/drawable-xhdpi/bg_disconnected.png b/app/src/custom/res/drawable-xhdpi/bg_disconnected.png new file mode 100644 index 00000000..4e05614e Binary files /dev/null and b/app/src/custom/res/drawable-xhdpi/bg_disconnected.png differ diff --git a/app/src/custom/res/drawable-xxhdpi/bg_connected.png b/app/src/custom/res/drawable-xxhdpi/bg_connected.png new file mode 100644 index 00000000..29bd3a05 Binary files /dev/null and b/app/src/custom/res/drawable-xxhdpi/bg_connected.png differ diff --git a/app/src/custom/res/drawable-xxhdpi/bg_connecting.png b/app/src/custom/res/drawable-xxhdpi/bg_connecting.png new file mode 100644 index 00000000..9b91293c Binary files /dev/null and b/app/src/custom/res/drawable-xxhdpi/bg_connecting.png differ diff --git a/app/src/custom/res/drawable-xxhdpi/bg_disconnected.png b/app/src/custom/res/drawable-xxhdpi/bg_disconnected.png new file mode 100644 index 00000000..c4a09aa7 Binary files /dev/null and b/app/src/custom/res/drawable-xxhdpi/bg_disconnected.png differ diff --git a/app/src/custom/res/drawable-xxxhdpi/bg_connected.png b/app/src/custom/res/drawable-xxxhdpi/bg_connected.png new file mode 100644 index 00000000..d1e95fb6 Binary files /dev/null and b/app/src/custom/res/drawable-xxxhdpi/bg_connected.png differ diff --git a/app/src/custom/res/drawable-xxxhdpi/bg_connecting.png b/app/src/custom/res/drawable-xxxhdpi/bg_connecting.png new file mode 100644 index 00000000..e6d36eb0 Binary files /dev/null and b/app/src/custom/res/drawable-xxxhdpi/bg_connecting.png differ diff --git a/app/src/custom/res/drawable-xxxhdpi/bg_disconnected.png b/app/src/custom/res/drawable-xxxhdpi/bg_disconnected.png new file mode 100644 index 00000000..df597f2f Binary files /dev/null and b/app/src/custom/res/drawable-xxxhdpi/bg_disconnected.png differ diff --git a/app/src/custom/res/drawable/bg_connected.png b/app/src/custom/res/drawable/bg_connected.png new file mode 100644 index 00000000..a375181d Binary files /dev/null and b/app/src/custom/res/drawable/bg_connected.png differ diff --git a/app/src/custom/res/drawable/bg_connecting.png b/app/src/custom/res/drawable/bg_connecting.png new file mode 100644 index 00000000..eccf184b Binary files /dev/null and b/app/src/custom/res/drawable/bg_connecting.png differ diff --git a/app/src/custom/res/drawable/bg_disconnected.png b/app/src/custom/res/drawable/bg_disconnected.png new file mode 100644 index 00000000..cc3ead9a Binary files /dev/null and b/app/src/custom/res/drawable/bg_disconnected.png differ diff --git a/app/src/custom/res/drawable/state_connected.xml b/app/src/custom/res/drawable/state_connected.xml new file mode 100644 index 00000000..c9854d69 --- /dev/null +++ b/app/src/custom/res/drawable/state_connected.xml @@ -0,0 +1,15 @@ + + + + + \ No newline at end of file diff --git a/app/src/custom/res/layout/v_location_button.xml b/app/src/custom/res/layout/v_location_button.xml new file mode 100644 index 00000000..8aaf4978 --- /dev/null +++ b/app/src/custom/res/layout/v_location_button.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/custom/res/layout/v_main_button.xml b/app/src/custom/res/layout/v_main_button.xml new file mode 100644 index 00000000..e3f96693 --- /dev/null +++ b/app/src/custom/res/layout/v_main_button.xml @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3 From 5afe57ab868ee9e2e27f5b26b9b14de3519c0402 Mon Sep 17 00:00:00 2001 From: cyberta Date: Fri, 2 Dec 2022 02:08:55 +0100 Subject: rearranging assets, split them into normal and custom flavor --- .../bitmaskclient/base/fragments/EipFragment.java | 686 --------------------- .../leap/bitmaskclient/base/views/MainButton.java | 124 ---- app/src/custom/res/animator/alpha2.xml | 10 + app/src/custom/res/animator/alpha3.xml | 4 + app/src/custom/res/drawable-ldpi/logo.png | Bin 8743 -> 0 bytes app/src/custom/res/drawable-mdpi/logo.png | Bin 6324 -> 0 bytes app/src/custom/res/drawable-xxxhdpi/logo.png | Bin 43251 -> 0 bytes app/src/custom/res/drawable/background_eip.xml | 11 - app/src/custom/res/drawable/crow.xml | 9 - app/src/custom/res/drawable/ravens.xml | 33 + app/src/custom/res/drawable/ravens1.xml | 16 - app/src/custom/res/drawable/ravens2.xml | 24 - app/src/custom/res/drawable/ravens3.xml | 33 - .../custom/res/drawable/rotate_progress_image.xml | 14 + app/src/custom/res/drawable/state_connecting.xml | 4 + app/src/custom/res/drawable/state_disconnected.xml | 9 + app/src/custom/res/layout-port/f_eip.xml | 113 ---- app/src/custom/res/layout-xlarge-port/f_eip.xml | 122 ---- app/src/custom/res/layout-xlarge/f_eip.xml | 127 ---- app/src/custom/res/layout/f_eip.xml | 146 ----- app/src/custom/res/layout/v_location_button.xml | 104 ---- app/src/custom/res/layout/v_main_button.xml | 142 ----- .../bitmaskclient/base/fragments/EipFragment.java | 654 ++++++++++++++++++++ .../leap/bitmaskclient/base/views/MainButton.java | 57 ++ app/src/main/res/drawable-hdpi/bg_connected.png | Bin 190405 -> 0 bytes app/src/main/res/drawable-hdpi/bg_connecting.png | Bin 236571 -> 0 bytes app/src/main/res/drawable-hdpi/bg_disconnected.png | Bin 143331 -> 0 bytes app/src/main/res/drawable-hdpi/green_mask.png | Bin 81235 -> 0 bytes app/src/main/res/drawable-hdpi/red_mask.png | Bin 73514 -> 0 bytes app/src/main/res/drawable-hdpi/yellow_mask.png | Bin 80386 -> 0 bytes app/src/main/res/drawable-xhdpi/bg_connected.png | Bin 319429 -> 0 bytes app/src/main/res/drawable-xhdpi/bg_connecting.png | Bin 400307 -> 0 bytes .../main/res/drawable-xhdpi/bg_disconnected.png | Bin 220676 -> 0 bytes app/src/main/res/drawable-xhdpi/green_mask.png | Bin 121655 -> 0 bytes app/src/main/res/drawable-xhdpi/red_mask.png | Bin 116193 -> 0 bytes app/src/main/res/drawable-xhdpi/yellow_mask.png | Bin 122701 -> 0 bytes app/src/main/res/drawable-xxhdpi/bg_connected.png | Bin 701727 -> 0 bytes app/src/main/res/drawable-xxhdpi/bg_connecting.png | Bin 828368 -> 0 bytes .../main/res/drawable-xxhdpi/bg_disconnected.png | Bin 446155 -> 0 bytes app/src/main/res/drawable-xxhdpi/bg_switchbar.xml | 9 - app/src/main/res/drawable-xxhdpi/green_mask.png | Bin 220730 -> 0 bytes app/src/main/res/drawable-xxhdpi/red_mask.png | Bin 222370 -> 0 bytes app/src/main/res/drawable-xxhdpi/yellow_mask.png | Bin 226345 -> 0 bytes app/src/main/res/drawable-xxxhdpi/bg_connected.png | Bin 1228810 -> 0 bytes .../main/res/drawable-xxxhdpi/bg_connecting.png | Bin 1489207 -> 0 bytes .../main/res/drawable-xxxhdpi/bg_disconnected.png | Bin 745847 -> 0 bytes app/src/main/res/drawable-xxxhdpi/green_mask.png | Bin 324196 -> 0 bytes app/src/main/res/drawable-xxxhdpi/red_mask.png | Bin 362086 -> 0 bytes app/src/main/res/drawable-xxxhdpi/yellow_mask.png | Bin 334967 -> 0 bytes app/src/main/res/drawable/bg_connected.png | Bin 90299 -> 0 bytes app/src/main/res/drawable/bg_connecting.png | Bin 112042 -> 0 bytes app/src/main/res/drawable/bg_disconnected.png | Bin 143331 -> 0 bytes app/src/main/res/drawable/green_mask.png | Bin 47593 -> 0 bytes app/src/main/res/drawable/logo.png | Bin 0 -> 18877 bytes app/src/main/res/drawable/red_mask.png | Bin 40172 -> 0 bytes .../main/res/drawable/rotate_progress_image.xml | 12 - app/src/main/res/drawable/yellow_mask.png | Bin 47055 -> 0 bytes app/src/main/res/layout-port/f_eip.xml | 85 ++- app/src/main/res/layout-xlarge-port/f_eip.xml | 117 ++-- app/src/main/res/layout-xlarge/f_eip.xml | 117 ++-- app/src/main/res/layout/f_eip.xml | 68 +- app/src/main/res/layout/v_location_button.xml | 38 +- app/src/main/res/layout/v_main_button.xml | 142 +++++ .../EipFragment.java | 654 -------------------- .../leap/bitmaskclient/base/views/MainButton.java | 57 -- app/src/normal/res/drawable-hdpi/bg_connected.png | Bin 0 -> 190405 bytes app/src/normal/res/drawable-hdpi/bg_connecting.png | Bin 0 -> 236571 bytes .../normal/res/drawable-hdpi/bg_disconnected.png | Bin 0 -> 143331 bytes .../res/drawable-hdpi/ic_splash_background.png | Bin 39702 -> 0 bytes .../normal/res/drawable-hdpi/state_connected.png | Bin 0 -> 81235 bytes .../normal/res/drawable-hdpi/state_connecting.png | Bin 0 -> 80386 bytes .../res/drawable-hdpi/state_disconnected.png | Bin 0 -> 73514 bytes app/src/normal/res/drawable-xhdpi/bg_connected.png | Bin 0 -> 319429 bytes .../normal/res/drawable-xhdpi/bg_connecting.png | Bin 0 -> 400307 bytes .../normal/res/drawable-xhdpi/bg_disconnected.png | Bin 0 -> 220676 bytes .../res/drawable-xhdpi/ic_splash_background.png | Bin 64868 -> 0 bytes .../normal/res/drawable-xhdpi/state_connected.png | Bin 0 -> 121655 bytes .../normal/res/drawable-xhdpi/state_connecting.png | Bin 0 -> 122701 bytes .../res/drawable-xhdpi/state_disconnected.png | Bin 0 -> 116193 bytes .../normal/res/drawable-xxhdpi/bg_connected.png | Bin 0 -> 701727 bytes .../normal/res/drawable-xxhdpi/bg_connecting.png | Bin 0 -> 828368 bytes .../normal/res/drawable-xxhdpi/bg_disconnected.png | Bin 0 -> 446155 bytes .../normal/res/drawable-xxhdpi/state_connected.png | Bin 0 -> 220730 bytes .../res/drawable-xxhdpi/state_connecting.png | Bin 0 -> 226345 bytes .../res/drawable-xxhdpi/state_disconnected.png | Bin 0 -> 222370 bytes .../normal/res/drawable-xxxhdpi/bg_connected.png | Bin 0 -> 1228810 bytes .../normal/res/drawable-xxxhdpi/bg_connecting.png | Bin 0 -> 1489207 bytes .../res/drawable-xxxhdpi/bg_disconnected.png | Bin 0 -> 745847 bytes .../res/drawable-xxxhdpi/ic_splash_background.png | Bin 131879 -> 0 bytes .../res/drawable-xxxhdpi/state_connected.png | Bin 0 -> 324196 bytes .../res/drawable-xxxhdpi/state_connecting.png | Bin 0 -> 334967 bytes .../res/drawable-xxxhdpi/state_disconnected.png | Bin 0 -> 362086 bytes app/src/normal/res/drawable/bg_connected.png | Bin 0 -> 90299 bytes app/src/normal/res/drawable/bg_connecting.png | Bin 0 -> 112042 bytes app/src/normal/res/drawable/bg_disconnected.png | Bin 0 -> 143331 bytes .../normal/res/drawable/ic_splash_background.xml | 4 + app/src/normal/res/drawable/state_connected.png | Bin 0 -> 47593 bytes app/src/normal/res/drawable/state_connecting.png | Bin 0 -> 47055 bytes app/src/normal/res/drawable/state_disconnected.png | Bin 0 -> 40172 bytes app/src/normal/res/layout-port/f_eip.xml | 154 ----- app/src/normal/res/layout-xlarge-port/f_eip.xml | 162 ----- app/src/normal/res/layout-xlarge/f_eip.xml | 155 ----- app/src/normal/res/layout/f_eip.xml | 164 ----- app/src/normal/res/layout/v_location_button.xml | 104 ---- app/src/normal/res/layout/v_main_button.xml | 142 ----- 105 files changed, 1206 insertions(+), 3420 deletions(-) delete mode 100644 app/src/custom/java/se/leap/bitmaskclient/base/fragments/EipFragment.java delete mode 100644 app/src/custom/java/se/leap/bitmaskclient/base/views/MainButton.java create mode 100644 app/src/custom/res/animator/alpha2.xml create mode 100644 app/src/custom/res/animator/alpha3.xml delete mode 100644 app/src/custom/res/drawable-ldpi/logo.png delete mode 100644 app/src/custom/res/drawable-mdpi/logo.png delete mode 100644 app/src/custom/res/drawable-xxxhdpi/logo.png delete mode 100644 app/src/custom/res/drawable/background_eip.xml delete mode 100644 app/src/custom/res/drawable/crow.xml create mode 100644 app/src/custom/res/drawable/ravens.xml delete mode 100644 app/src/custom/res/drawable/ravens1.xml delete mode 100644 app/src/custom/res/drawable/ravens2.xml delete mode 100644 app/src/custom/res/drawable/ravens3.xml create mode 100644 app/src/custom/res/drawable/rotate_progress_image.xml create mode 100644 app/src/custom/res/drawable/state_connecting.xml create mode 100644 app/src/custom/res/drawable/state_disconnected.xml delete mode 100644 app/src/custom/res/layout-port/f_eip.xml delete mode 100644 app/src/custom/res/layout-xlarge-port/f_eip.xml delete mode 100644 app/src/custom/res/layout-xlarge/f_eip.xml delete mode 100644 app/src/custom/res/layout/f_eip.xml delete mode 100644 app/src/custom/res/layout/v_location_button.xml delete mode 100644 app/src/custom/res/layout/v_main_button.xml create mode 100644 app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java create mode 100644 app/src/main/java/se/leap/bitmaskclient/base/views/MainButton.java delete mode 100644 app/src/main/res/drawable-hdpi/bg_connected.png delete mode 100644 app/src/main/res/drawable-hdpi/bg_connecting.png delete mode 100644 app/src/main/res/drawable-hdpi/bg_disconnected.png delete mode 100644 app/src/main/res/drawable-hdpi/green_mask.png delete mode 100644 app/src/main/res/drawable-hdpi/red_mask.png delete mode 100644 app/src/main/res/drawable-hdpi/yellow_mask.png delete mode 100644 app/src/main/res/drawable-xhdpi/bg_connected.png delete mode 100644 app/src/main/res/drawable-xhdpi/bg_connecting.png delete mode 100644 app/src/main/res/drawable-xhdpi/bg_disconnected.png delete mode 100644 app/src/main/res/drawable-xhdpi/green_mask.png delete mode 100644 app/src/main/res/drawable-xhdpi/red_mask.png delete mode 100644 app/src/main/res/drawable-xhdpi/yellow_mask.png delete mode 100644 app/src/main/res/drawable-xxhdpi/bg_connected.png delete mode 100644 app/src/main/res/drawable-xxhdpi/bg_connecting.png delete mode 100644 app/src/main/res/drawable-xxhdpi/bg_disconnected.png delete mode 100644 app/src/main/res/drawable-xxhdpi/bg_switchbar.xml delete mode 100644 app/src/main/res/drawable-xxhdpi/green_mask.png delete mode 100644 app/src/main/res/drawable-xxhdpi/red_mask.png delete mode 100644 app/src/main/res/drawable-xxhdpi/yellow_mask.png delete mode 100644 app/src/main/res/drawable-xxxhdpi/bg_connected.png delete mode 100644 app/src/main/res/drawable-xxxhdpi/bg_connecting.png delete mode 100644 app/src/main/res/drawable-xxxhdpi/bg_disconnected.png delete mode 100644 app/src/main/res/drawable-xxxhdpi/green_mask.png delete mode 100644 app/src/main/res/drawable-xxxhdpi/red_mask.png delete mode 100644 app/src/main/res/drawable-xxxhdpi/yellow_mask.png delete mode 100644 app/src/main/res/drawable/bg_connected.png delete mode 100644 app/src/main/res/drawable/bg_connecting.png delete mode 100644 app/src/main/res/drawable/bg_disconnected.png delete mode 100644 app/src/main/res/drawable/green_mask.png create mode 100644 app/src/main/res/drawable/logo.png delete mode 100644 app/src/main/res/drawable/red_mask.png delete mode 100644 app/src/main/res/drawable/rotate_progress_image.xml delete mode 100644 app/src/main/res/drawable/yellow_mask.png create mode 100644 app/src/main/res/layout/v_main_button.xml delete mode 100644 app/src/normal/java/se.leap.bitmaskclient.base.fragments/EipFragment.java delete mode 100644 app/src/normal/java/se/leap/bitmaskclient/base/views/MainButton.java create mode 100644 app/src/normal/res/drawable-hdpi/bg_connected.png create mode 100644 app/src/normal/res/drawable-hdpi/bg_connecting.png create mode 100644 app/src/normal/res/drawable-hdpi/bg_disconnected.png delete mode 100644 app/src/normal/res/drawable-hdpi/ic_splash_background.png create mode 100644 app/src/normal/res/drawable-hdpi/state_connected.png create mode 100644 app/src/normal/res/drawable-hdpi/state_connecting.png create mode 100644 app/src/normal/res/drawable-hdpi/state_disconnected.png create mode 100644 app/src/normal/res/drawable-xhdpi/bg_connected.png create mode 100644 app/src/normal/res/drawable-xhdpi/bg_connecting.png create mode 100644 app/src/normal/res/drawable-xhdpi/bg_disconnected.png delete mode 100644 app/src/normal/res/drawable-xhdpi/ic_splash_background.png create mode 100644 app/src/normal/res/drawable-xhdpi/state_connected.png create mode 100644 app/src/normal/res/drawable-xhdpi/state_connecting.png create mode 100644 app/src/normal/res/drawable-xhdpi/state_disconnected.png create mode 100644 app/src/normal/res/drawable-xxhdpi/bg_connected.png create mode 100644 app/src/normal/res/drawable-xxhdpi/bg_connecting.png create mode 100644 app/src/normal/res/drawable-xxhdpi/bg_disconnected.png create mode 100644 app/src/normal/res/drawable-xxhdpi/state_connected.png create mode 100644 app/src/normal/res/drawable-xxhdpi/state_connecting.png create mode 100644 app/src/normal/res/drawable-xxhdpi/state_disconnected.png create mode 100644 app/src/normal/res/drawable-xxxhdpi/bg_connected.png create mode 100644 app/src/normal/res/drawable-xxxhdpi/bg_connecting.png create mode 100644 app/src/normal/res/drawable-xxxhdpi/bg_disconnected.png delete mode 100644 app/src/normal/res/drawable-xxxhdpi/ic_splash_background.png create mode 100644 app/src/normal/res/drawable-xxxhdpi/state_connected.png create mode 100644 app/src/normal/res/drawable-xxxhdpi/state_connecting.png create mode 100644 app/src/normal/res/drawable-xxxhdpi/state_disconnected.png create mode 100644 app/src/normal/res/drawable/bg_connected.png create mode 100644 app/src/normal/res/drawable/bg_connecting.png create mode 100644 app/src/normal/res/drawable/bg_disconnected.png create mode 100644 app/src/normal/res/drawable/ic_splash_background.xml create mode 100644 app/src/normal/res/drawable/state_connected.png create mode 100644 app/src/normal/res/drawable/state_connecting.png create mode 100644 app/src/normal/res/drawable/state_disconnected.png delete mode 100644 app/src/normal/res/layout-port/f_eip.xml delete mode 100644 app/src/normal/res/layout-xlarge-port/f_eip.xml delete mode 100644 app/src/normal/res/layout-xlarge/f_eip.xml delete mode 100644 app/src/normal/res/layout/f_eip.xml delete mode 100644 app/src/normal/res/layout/v_location_button.xml delete mode 100644 app/src/normal/res/layout/v_main_button.xml (limited to 'app') diff --git a/app/src/custom/java/se/leap/bitmaskclient/base/fragments/EipFragment.java b/app/src/custom/java/se/leap/bitmaskclient/base/fragments/EipFragment.java deleted file mode 100644 index 2588f436..00000000 --- a/app/src/custom/java/se/leap/bitmaskclient/base/fragments/EipFragment.java +++ /dev/null @@ -1,686 +0,0 @@ -/** - * Copyright (c) 2018 LEAP Encryption Access Project and contributers - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package se.leap.bitmaskclient.base.fragments; - -import static de.blinkt.openvpn.core.ConnectionStatus.LEVEL_NONETWORK; -import static se.leap.bitmaskclient.R.string.vpn_certificate_user_message; -import static se.leap.bitmaskclient.base.models.Constants.ASK_TO_CANCEL_VPN; -import static se.leap.bitmaskclient.base.models.Constants.EIP_ACTION_START; -import static se.leap.bitmaskclient.base.models.Constants.EIP_EARLY_ROUTES; -import static se.leap.bitmaskclient.base.models.Constants.EIP_RESTART_ON_BOOT; -import static se.leap.bitmaskclient.base.models.Constants.PROVIDER_KEY; -import static se.leap.bitmaskclient.base.models.Constants.REQUEST_CODE_CONFIGURE_LEAP; -import static se.leap.bitmaskclient.base.models.Constants.REQUEST_CODE_LOG_IN; -import static se.leap.bitmaskclient.base.models.Constants.REQUEST_CODE_SWITCH_PROVIDER; -import static se.leap.bitmaskclient.base.models.Constants.SHARED_PREFERENCES; -import static se.leap.bitmaskclient.base.utils.ConfigHelper.isDefaultBitmask; -import static se.leap.bitmaskclient.base.utils.PreferenceHelper.getPreferredCity; -import static se.leap.bitmaskclient.base.utils.ViewHelper.convertDimensionToPx; -import static se.leap.bitmaskclient.eip.EipSetupObserver.gatewayOrder; -import static se.leap.bitmaskclient.eip.EipSetupObserver.reconnectingWithDifferentGateway; -import static se.leap.bitmaskclient.eip.GatewaysManager.Load.UNKNOWN; -import static se.leap.bitmaskclient.providersetup.ProviderAPI.DOWNLOAD_GEOIP_JSON; -import static se.leap.bitmaskclient.providersetup.ProviderAPI.UPDATE_INVALID_VPN_CERTIFICATE; -import static se.leap.bitmaskclient.providersetup.ProviderAPI.USER_MESSAGE; - -import android.app.Activity; -import android.content.ComponentName; -import android.content.Context; -import android.content.Intent; -import android.content.ServiceConnection; -import android.content.SharedPreferences; -import android.graphics.ColorMatrix; -import android.graphics.ColorMatrixColorFilter; -import android.os.Bundle; -import android.os.IBinder; -import android.os.Vibrator; -import android.text.Spannable; -import android.text.SpannableString; -import android.text.TextUtils; -import android.text.style.RelativeSizeSpan; -import android.util.Log; -import android.view.Gravity; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.Toast; - -import androidx.annotation.NonNull; -import androidx.appcompat.app.AlertDialog; -import androidx.appcompat.widget.AppCompatImageView; -import androidx.appcompat.widget.AppCompatTextView; -import androidx.fragment.app.DialogFragment; -import androidx.fragment.app.Fragment; -import androidx.fragment.app.FragmentTransaction; - -import java.util.Observable; -import java.util.Observer; -import java.util.concurrent.atomic.AtomicBoolean; - -import butterknife.BindView; -import butterknife.ButterKnife; -import butterknife.OnClick; -import butterknife.Unbinder; -import de.blinkt.openvpn.core.ConnectionStatus; -import de.blinkt.openvpn.core.IOpenVPNServiceInternal; -import de.blinkt.openvpn.core.OpenVPNService; -import de.blinkt.openvpn.core.VpnStatus; -import de.blinkt.openvpn.core.connection.Connection; -import se.leap.bitmaskclient.BuildConfig; -import se.leap.bitmaskclient.R; -import se.leap.bitmaskclient.base.FragmentManagerEnhanced; -import se.leap.bitmaskclient.base.MainActivity; -import se.leap.bitmaskclient.base.fragments.DonationReminderDialog; -import se.leap.bitmaskclient.base.fragments.GatewaySelectionFragment; -import se.leap.bitmaskclient.base.models.Provider; -import se.leap.bitmaskclient.base.models.ProviderObservable; -import se.leap.bitmaskclient.base.utils.PreferenceHelper; -import se.leap.bitmaskclient.base.views.LocationButton; -import se.leap.bitmaskclient.base.views.MainButton; -import se.leap.bitmaskclient.eip.EipCommand; -import se.leap.bitmaskclient.eip.EipStatus; -import se.leap.bitmaskclient.eip.GatewaysManager; -import se.leap.bitmaskclient.providersetup.ProviderAPICommand; -import se.leap.bitmaskclient.providersetup.ProviderListActivity; -import se.leap.bitmaskclient.providersetup.activities.CustomProviderSetupActivity; -import se.leap.bitmaskclient.providersetup.activities.LoginActivity; -import se.leap.bitmaskclient.providersetup.models.LeapSRPSession; -import se.leap.bitmaskclient.tor.TorServiceCommand; -import se.leap.bitmaskclient.tor.TorStatusObservable; - -public class EipFragment extends Fragment implements Observer { - - public final static String TAG = EipFragment.class.getSimpleName(); - - - private SharedPreferences preferences; - private Provider provider; - - @BindView(R.id.background) - AppCompatImageView background; - - @BindView(R.id.main_button) - MainButton mainButton; - - @BindView(R.id.gateway_location_button) - LocationButton locationButton; - - @BindView(R.id.main_description) - AppCompatTextView mainDescription; - - @BindView(R.id.sub_description) - AppCompatTextView subDescription; - - private Unbinder unbinder; - private EipStatus eipStatus; - private ProviderObservable providerObservable; - private TorStatusObservable torStatusObservable; - - private GatewaysManager gatewaysManager; - - //---saved Instance ------- - private final String KEY_SHOW_PENDING_START_CANCELLATION = "KEY_SHOW_PENDING_START_CANCELLATION"; - private final String KEY_SHOW_ASK_TO_STOP_EIP = "KEY_SHOW_ASK_TO_STOP_EIP"; - private boolean showPendingStartCancellation = false; - private boolean showAskToStopEip = false; - //------------------------ - AlertDialog alertDialog; - - private IOpenVPNServiceInternal mService; - // We use this service connection to detect if openvpn is running without network - private EipFragmentServiceConnection openVpnConnection; - - @Override - public void onAttach(Context context) { - super.onAttach(context); - Bundle arguments = getArguments(); - Activity activity = getActivity(); - if (activity != null) { - if (arguments != null) { - provider = arguments.getParcelable(PROVIDER_KEY); - if (provider == null) { - handleNoProvider(activity); - } else { - Log.d(TAG, provider.getName() + " configured as provider"); - } - } else { - handleNoProvider(activity); - } - } - } - - private void handleNoProvider(Activity activity) { - if (isDefaultBitmask()) { - activity.startActivityForResult(new Intent(activity, ProviderListActivity.class), REQUEST_CODE_SWITCH_PROVIDER); - } else { - Log.e(TAG, "no provider given - try to reconfigure custom provider"); - startActivityForResult(new Intent(activity, CustomProviderSetupActivity.class), REQUEST_CODE_CONFIGURE_LEAP); - - } - - } - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - openVpnConnection = new EipFragmentServiceConnection(); - eipStatus = EipStatus.getInstance(); - providerObservable = ProviderObservable.getInstance(); - torStatusObservable = TorStatusObservable.getInstance(); - Activity activity = getActivity(); - if (activity != null) { - preferences = getActivity().getSharedPreferences(SHARED_PREFERENCES, Context.MODE_PRIVATE); - } else { - Log.e(TAG, "activity is null in onCreate - no preferences set!"); - } - - gatewaysManager = new GatewaysManager(getContext()); - - - } - - @Override - public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - eipStatus.addObserver(this); - torStatusObservable.addObserver(this); - providerObservable.addObserver(this); - View view = inflater.inflate(R.layout.f_eip, container, false); - unbinder = ButterKnife.bind(this, view); - - try { - Bundle arguments = getArguments(); - if (arguments != null && arguments.containsKey(ASK_TO_CANCEL_VPN) && arguments.getBoolean(ASK_TO_CANCEL_VPN)) { - arguments.remove(ASK_TO_CANCEL_VPN); - setArguments(arguments); - askToStopEIP(); - } - } catch (IllegalStateException e) { - // probably setArguments failed because the fragments state is already saved - e.printStackTrace(); - } - - restoreFromSavedInstance(savedInstanceState); - locationButton.setOnClickListener(v -> { - FragmentManagerEnhanced fragmentManager = new FragmentManagerEnhanced(getActivity().getSupportFragmentManager()); - Fragment fragment = new GatewaySelectionFragment(); - fragmentManager.replace(R.id.main_container, fragment, MainActivity.TAG); - }); - return view; - } - - @Override - public void onStart() { - super.onStart(); - if (DonationReminderDialog.isCallable(getContext())) { - showDonationReminderDialog(); - } - } - - @Override - public void onResume() { - super.onResume(); - if (!eipStatus.isDisconnected()) { - openVpnConnection.bindService(); - } - handleNewState(); - } - - @Override - public void onPause() { - super.onPause(); - openVpnConnection.unbindService(); - } - - @Override - public void onSaveInstanceState(@NonNull Bundle outState) { - super.onSaveInstanceState(outState); - if (showAskToStopEip) { - outState.putBoolean(KEY_SHOW_ASK_TO_STOP_EIP, true); - alertDialog.dismiss(); - } else if (showPendingStartCancellation) { - outState.putBoolean(KEY_SHOW_PENDING_START_CANCELLATION, true); - alertDialog.dismiss(); - } - } - - private void restoreFromSavedInstance(Bundle savedInstanceState) { - if (savedInstanceState != null && savedInstanceState.containsKey(KEY_SHOW_PENDING_START_CANCELLATION)) { - showPendingStartCancellation = true; - askPendingStartCancellation(); - } else if (savedInstanceState != null && savedInstanceState.containsKey(KEY_SHOW_ASK_TO_STOP_EIP)) { - showAskToStopEip = true; - askToStopEIP(); - } - } - - @Override - public void onDestroyView() { - super.onDestroyView(); - eipStatus.deleteObserver(this); - providerObservable.deleteObserver(this); - torStatusObservable.deleteObserver(this); - unbinder.unbind(); - } - - private void saveStatus(boolean restartOnBoot) { - preferences.edit().putBoolean(EIP_RESTART_ON_BOOT, restartOnBoot).apply(); - } - - @OnClick(R.id.main_button) - void onButtonClick() { - handleIcon(); - } - - void handleIcon() { - if (isOpenVpnRunningWithoutNetwork() || eipStatus.isConnected() || eipStatus.isConnecting() || eipStatus.isUpdatingVpnCert()) - handleSwitchOff(); - else - handleSwitchOn(); - } - - private void handleSwitchOn() { - Context context = getContext(); - if (context == null) { - Log.e(TAG, "context is null when switch turning on"); - return; - } - - if (canStartEIP()) { - startEipFromScratch(); - } else if (canLogInToStartEIP()) { - askUserToLogIn(getString(vpn_certificate_user_message)); - } else { - // provider has no VpnCertificate but user is logged in - updateInvalidVpnCertificate(); - } - } - - private boolean canStartEIP() { - boolean certificateExists = provider.hasVpnCertificate(); - boolean isAllowedAnon = provider.allowsAnonymous(); - return (isAllowedAnon || certificateExists) && !eipStatus.isConnected() && !eipStatus.isConnecting(); - } - - private boolean canLogInToStartEIP() { - boolean isAllowedRegistered = provider.allowsRegistered(); - boolean isLoggedIn = LeapSRPSession.loggedIn(); - return isAllowedRegistered && !isLoggedIn && !eipStatus.isConnecting() && !eipStatus.isConnected(); - } - - private void handleSwitchOff() { - if (isOpenVpnRunningWithoutNetwork() || eipStatus.isConnecting() || eipStatus.isUpdatingVpnCert()) { - askPendingStartCancellation(); - } else if (eipStatus.isConnected()) { - askToStopEIP(); - } - } - - private void setMainButtonEnabled(boolean enabled) { - locationButton.setEnabled(enabled); - mainButton.setEnabled(enabled); - } - - public void startEipFromScratch() { - saveStatus(true); - Context context = getContext(); - if (context == null) { - Log.e(TAG, "context is null when trying to start VPN"); - return; - } - if (!provider.getGeoipUrl().isDefault() && provider.shouldUpdateGeoIpJson()) { - Bundle bundle = new Bundle(); - bundle.putBoolean(EIP_ACTION_START, true); - bundle.putBoolean(EIP_EARLY_ROUTES, false); - ProviderAPICommand.execute(context, DOWNLOAD_GEOIP_JSON, bundle, provider); - } else { - EipCommand.startVPN(context, false); - } - EipStatus.getInstance().updateState("UI_CONNECTING", "", 0, ConnectionStatus.LEVEL_START); - } - - protected void stopEipIfPossible() { - Context context = getContext(); - if (context == null) { - Log.e(TAG, "context is null when trying to stop EIP"); - return; - } - EipCommand.stopVPN(context); - } - - private void askPendingStartCancellation() { - Activity activity = getActivity(); - if (activity == null) { - Log.e(TAG, "activity is null when asking to cancel"); - return; - } - - try { - AlertDialog.Builder alertBuilder = new AlertDialog.Builder(getActivity()); - showPendingStartCancellation = true; - alertDialog = alertBuilder.setTitle(activity.getString(R.string.eip_cancel_connect_title)) - .setMessage(activity.getString(R.string.eip_cancel_connect_text)) - .setPositiveButton((android.R.string.yes), (dialog, which) -> { - Context context = getContext(); - if (context != null && eipStatus.isUpdatingVpnCert() && - TorStatusObservable.isRunning()) { - TorServiceCommand.stopTorServiceAsync(context.getApplicationContext()); - } - stopEipIfPossible(); - }) - .setNegativeButton(activity.getString(android.R.string.no), (dialog, which) -> { - }).setOnDismissListener(dialog -> showPendingStartCancellation = false).show(); - } catch (IllegalStateException e) { - e.printStackTrace(); - } - - } - - protected void askToStopEIP() { - Activity activity = getActivity(); - if (activity == null) { - Log.e(TAG, "activity is null when asking to stop EIP"); - return; - } - try { - AlertDialog.Builder alertBuilder = new AlertDialog.Builder(activity); - showAskToStopEip = true; - alertDialog = alertBuilder.setTitle(activity.getString(R.string.eip_cancel_connect_title)) - .setMessage(activity.getString(R.string.eip_warning_browser_inconsistency)) - .setPositiveButton((android.R.string.yes), (dialog, which) -> stopEipIfPossible()) - .setNegativeButton(activity.getString(android.R.string.no), (dialog, which) -> { - }).setOnDismissListener(dialog -> showAskToStopEip = false).show(); - } catch (IllegalStateException e) { - e.printStackTrace(); - } - - } - - @Override - public void update(Observable observable, Object data) { - if (observable instanceof EipStatus) { - eipStatus = (EipStatus) observable; - handleNewStateOnMain(); - - if (eipStatus.isConnecting()) { - openVpnConnection.bindService(); - } - if ("NOPROCESS".equals(EipStatus.getInstance().getState())) { - //assure that the Service is shutdown completely if openvpn was stopped - openVpnConnection.unbindService(); - } - } else if (observable instanceof ProviderObservable) { - provider = ((ProviderObservable) observable).getCurrentProvider(); - } else if (observable instanceof TorStatusObservable && EipStatus.getInstance().isUpdatingVpnCert()) { - handleNewStateOnMain(); - } - } - - private void handleNewStateOnMain() { - Activity activity = getActivity(); - if (activity != null) { - activity.runOnUiThread(this::handleNewState); - } else { - Log.e("EipFragment", "activity is null"); - } - } - - private void handleNewState() { - Activity activity = getActivity(); - if (activity == null) { - Log.e(TAG, "activity is null while trying to handle new state"); - return; - } - - Log.d(TAG, "eip fragment eipStatus state: " + eipStatus.getState() + " - level: " + eipStatus.getLevel() + " - is reconnecting: " + eipStatus.isReconnecting()); - if (eipStatus.isUpdatingVpnCert()) { - setMainButtonEnabled(true); - showConnectionTransitionLayout(true); - locationButton.setText(getString(R.string.eip_status_start_pending)); - locationButton.setLocationLoad(UNKNOWN); - locationButton.showBridgeIndicator(false); - locationButton.showRecommendedIndicator(false); - mainDescription.setText(null); - String torStatus = TorStatusObservable.getStringForCurrentStatus(getContext()); - if (!TextUtils.isEmpty(torStatus)) { - Spannable spannable = new SpannableString(torStatus); - spannable.setSpan(new RelativeSizeSpan(0.75f), 0, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); - subDescription.setText(TextUtils.concat(getString(R.string.updating_certificate_message) + "\n", spannable)); - } else { - subDescription.setText(getString(R.string.updating_certificate_message)); - } - } else if (eipStatus.isConnecting()) { - setMainButtonEnabled(true); - showConnectionTransitionLayout(true); - locationButton.setText(getString(R.string.eip_status_start_pending)); - locationButton.setLocationLoad(UNKNOWN); - locationButton.showBridgeIndicator(false); - locationButton.showRecommendedIndicator(false); - mainDescription.setText(null); - subDescription.setText(null); - } else if (eipStatus.isConnected()) { - setMainButtonEnabled(true); - mainButton.updateState(true, false, false); - Connection.TransportType transportType = PreferenceHelper.getUseBridges(getContext()) ? Connection.TransportType.OBFS4 : Connection.TransportType.OPENVPN; - locationButton.setLocationLoad(PreferenceHelper.useObfuscationPinning(getContext()) ? GatewaysManager.Load.UNKNOWN : gatewaysManager.getLoadForLocation(VpnStatus.getLastConnectedVpnName(), transportType)); - locationButton.setText(VpnStatus.getLastConnectedVpnName()); - locationButton.showBridgeIndicator(VpnStatus.isUsingBridges()); - locationButton.showRecommendedIndicator(getPreferredCity(getContext())== null); - mainDescription.setText(R.string.eip_state_connected); - subDescription.setText(null); - colorBackground(); - } else if(isOpenVpnRunningWithoutNetwork()) { - Log.d(TAG, "eip fragment eipStatus - isOpenVpnRunningWithoutNetwork"); - setMainButtonEnabled(true); - mainButton.updateState(true, false, true); - locationButton.setText(VpnStatus.getCurrentlyConnectingVpnName()); - locationButton.showBridgeIndicator(VpnStatus.isUsingBridges()); - locationButton.showBridgeIndicator(VpnStatus.isUsingBridges()); - locationButton.showRecommendedIndicator(getPreferredCity(getContext())== null); - colorBackgroundALittle(); - mainDescription.setText(R.string.eip_state_connected); - subDescription.setText(R.string.eip_state_no_network); - } else if (eipStatus.isDisconnected() && reconnectingWithDifferentGateway()) { - showConnectionTransitionLayout(true); - // showRetryToast(activity); - locationButton.setText(getString(R.string.eip_status_start_pending)); - locationButton.setLocationLoad(UNKNOWN); - locationButton.showBridgeIndicator(false); - locationButton.showRecommendedIndicator(false); - mainDescription.setText(null); - subDescription.setText(R.string.reconnecting); - } else if (eipStatus.isDisconnecting()) { - setMainButtonEnabled(false); - showConnectionTransitionLayout(false); - mainDescription.setText(R.string.eip_state_insecure); - } else if (eipStatus.isBlocking()) { - setMainButtonEnabled(true); - mainButton.updateState(true, false, true); - colorBackgroundALittle(); - locationButton.setText(getString(R.string.no_location)); - locationButton.setLocationLoad(UNKNOWN); - locationButton.showBridgeIndicator(false); - locationButton.showRecommendedIndicator(false); - mainDescription.setText(R.string.eip_state_connected); - subDescription.setText(getString(R.string.eip_state_blocking, getString(R.string.app_name))); - } else { - locationButton.setText(activity.getString(R.string.vpn_button_turn_on)); - setMainButtonEnabled(true); - mainButton.updateState(false, false, false); - greyscaleBackground(); - locationButton.setLocationLoad(UNKNOWN); - locationButton.showBridgeIndicator(false); - String city = getPreferredCity(getContext()); - locationButton.setText(city == null ? getString(R.string.gateway_selection_recommended_location) : city); - locationButton.showRecommendedIndicator(false); - mainDescription.setText(R.string.eip_state_insecure); - subDescription.setText(R.string.connection_not_connected); - } - } - - private void showToast(Activity activity, String message, boolean vibrateLong) { - LayoutInflater inflater = getLayoutInflater(); - View layout = inflater.inflate(R.layout.custom_toast, - activity.findViewById(R.id.custom_toast_container)); - - AppCompatTextView text = layout.findViewById(R.id.text); - text.setText(message); - - Vibrator v = (Vibrator) activity.getSystemService(Context.VIBRATOR_SERVICE); - if (vibrateLong) { - v.vibrate(100); - v.vibrate(200); - } else { - v.vibrate(100); - } - - Toast toast = new Toast(activity.getApplicationContext()); - toast.setGravity(Gravity.BOTTOM, 0, convertDimensionToPx(this.getContext(), R.dimen.stdpadding)); - toast.setDuration(Toast.LENGTH_LONG); - toast.setView(layout); - toast.show(); - } - - private void showRetryToast(Activity activity) { - int nClosestGateway = gatewayOrder(); - String message = String.format("Server number " + nClosestGateway + " not reachable. Trying next gateway."); - showToast(activity, message, true ); - } - - private void showConnectionTransitionLayout(boolean isConnecting) { - mainButton.updateState(true, isConnecting, false); - if (isConnecting) { - colorBackgroundALittle(); - } else { - greyscaleBackground(); - } - } - - private boolean isOpenVpnRunningWithoutNetwork() { - boolean isRunning = false; - try { - isRunning = eipStatus.getLevel() == LEVEL_NONETWORK && - mService.isVpnRunning(); - } catch (Exception e) { - //eat me - e.printStackTrace(); - } - - return isRunning; - } - - private void greyscaleBackground() { - if (BuildConfig.use_color_filter) { - ColorMatrix matrix = new ColorMatrix(); - matrix.setSaturation(0); - ColorMatrixColorFilter cf = new ColorMatrixColorFilter(matrix); - background.setColorFilter(cf); - background.setImageAlpha(255); - } - } - - private void colorBackgroundALittle() { - if (BuildConfig.use_color_filter) { - background.setColorFilter(null); - background.setImageAlpha(144); - } - } - - private void colorBackground() { - if (BuildConfig.use_color_filter) { - background.setColorFilter(null); - background.setImageAlpha(210); - } - } - - private void updateInvalidVpnCertificate() { - eipStatus.setUpdatingVpnCert(true); - ProviderAPICommand.execute(getContext(), UPDATE_INVALID_VPN_CERTIFICATE, provider); - } - - private void askUserToLogIn(String userMessage) { - Intent intent = new Intent(getContext(), LoginActivity.class); - intent.putExtra(PROVIDER_KEY, provider); - - if(userMessage != null) { - intent.putExtra(USER_MESSAGE, userMessage); - } - - Activity activity = getActivity(); - if (activity != null) { - activity.startActivityForResult(intent, REQUEST_CODE_LOG_IN); - } - } - - private class EipFragmentServiceConnection implements ServiceConnection { - private final AtomicBoolean bind = new AtomicBoolean(false); - - void bindService() { - Activity activity = getActivity(); - if (activity == null) { - Log.e(TAG, "activity is null when binding OpenVpn"); - return; - } - if (!bind.get()) { - activity.runOnUiThread(() -> { - Intent intent = new Intent(activity, OpenVPNService.class); - intent.setAction(OpenVPNService.START_SERVICE); - - activity.bindService(intent, EipFragmentServiceConnection.this, Context.BIND_AUTO_CREATE); - bind.set(true); - }); - } - } - - void unbindService() { - Activity activity = getActivity(); - if (activity == null) { - return; - } - if (bind.get()) { - activity.runOnUiThread(() -> { - activity.unbindService(EipFragmentServiceConnection.this); - bind.set(false); - }); - } - } - - @Override - public void onServiceConnected(ComponentName className, - IBinder service) { - mService = IOpenVPNServiceInternal.Stub.asInterface(service); - handleNewState(); - } - - @Override - public void onServiceDisconnected(ComponentName arg0) { - mService = null; - } - } - - public void showDonationReminderDialog() { - try { - FragmentTransaction fragmentTransaction = new FragmentManagerEnhanced( - getActivity().getSupportFragmentManager()).removePreviousFragment( - DonationReminderDialog.TAG); - DialogFragment newFragment = new DonationReminderDialog(); - newFragment.setCancelable(false); - newFragment.show(fragmentTransaction, DonationReminderDialog.TAG); - } catch (IllegalStateException | NullPointerException e) { - e.printStackTrace(); - } - } -} diff --git a/app/src/custom/java/se/leap/bitmaskclient/base/views/MainButton.java b/app/src/custom/java/se/leap/bitmaskclient/base/views/MainButton.java deleted file mode 100644 index c5ac4544..00000000 --- a/app/src/custom/java/se/leap/bitmaskclient/base/views/MainButton.java +++ /dev/null @@ -1,124 +0,0 @@ -package se.leap.bitmaskclient.base.views; - -import android.annotation.TargetApi; -import android.content.Context; -import android.graphics.PorterDuff; -import android.graphics.drawable.AnimationDrawable; -import android.util.AttributeSet; -import android.view.LayoutInflater; -import android.view.View; -import android.view.animation.AlphaAnimation; -import android.view.animation.Animation; -import android.widget.RelativeLayout; - -import androidx.annotation.ColorRes; -import androidx.annotation.DrawableRes; -import androidx.appcompat.widget.AppCompatImageView; -import androidx.core.content.ContextCompat; - -import se.leap.bitmaskclient.R; - -public class MainButton extends RelativeLayout { - - private static final String TAG = MainButton.class.getSimpleName(); - - AppCompatImageView glow; - AppCompatImageView shadowLight; - AnimationDrawable glowAnimation; - - private boolean isOn = false; - private boolean isProcessing = false; - private boolean isError = true; - - - public MainButton(Context context) { - super(context); - initLayout(context); - } - - public MainButton(Context context, AttributeSet attrs) { - super(context, attrs); - initLayout(context); - } - - public MainButton(Context context, AttributeSet attrs, int defStyleAttr) { - super(context, attrs, defStyleAttr); - initLayout(context); - } - - - @TargetApi(21) - public MainButton(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { - super(context, attrs, defStyleAttr, defStyleRes); - initLayout(context); - } - - private void initLayout(Context context) { - LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); - View rootview = inflater.inflate(R.layout.v_main_btn, this, true); - - glow = rootview.findViewById(R.id.vpn_btn_glow); - glowAnimation = (AnimationDrawable) glow.getBackground(); - shadowLight = rootview.findViewById(R.id.vpn_btn_shadow_light); - } - - - private void stopGlowAnimation() { - AlphaAnimation fadeOutAnimation = new AlphaAnimation(1.0f, 0.0f); - fadeOutAnimation.setDuration(300); - fadeOutAnimation.setAnimationListener(new Animation.AnimationListener() { - @Override - public void onAnimationStart(Animation animation) {} - - @Override - public void onAnimationEnd(Animation animation) { - glow.setVisibility(GONE); - glowAnimation.stop(); - } - - @Override - public void onAnimationRepeat(Animation animation) {} - }); - glow.startAnimation(fadeOutAnimation); - } - - private void startGlowAnimation() { - glow.setAlpha(1.0f); - glow.setVisibility(VISIBLE); - glowAnimation.start(); - } - - public void updateState(boolean isOn, boolean isProcessing, boolean isError) { - if (this.isOn != isOn) { - this.isOn = isOn; - shadowLight.setVisibility(isOn ? VISIBLE : GONE); - } - - if (this.isProcessing != isProcessing) { - if (!isProcessing) { - stopGlowAnimation(); - } else { - startGlowAnimation(); - } - this.isProcessing = isProcessing; - } - - if (this.isError != isError) { - @DrawableRes int drawableResource = isOn ? R.drawable.on_off_btn_start_2_enabled : R.drawable.on_off_btn_start_2_disabled; - if (!isError) { - setImageWithTint(shadowLight, drawableResource, R.color.colorMainBtnHighlight); - } else { - setImageWithTint(shadowLight, drawableResource, R.color.colorMainBtnError); - } - this.isError = isError; - } - } - - private void setImageWithTint(AppCompatImageView view, @DrawableRes int resourceId, @ColorRes int color) { - view.setImageDrawable(ContextCompat.getDrawable(getContext(), resourceId)); - view.setColorFilter(ContextCompat.getColor(getContext(), color), PorterDuff.Mode.SRC_ATOP); - } - - - -} diff --git a/app/src/custom/res/animator/alpha2.xml b/app/src/custom/res/animator/alpha2.xml new file mode 100644 index 00000000..bf997dea --- /dev/null +++ b/app/src/custom/res/animator/alpha2.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/app/src/custom/res/animator/alpha3.xml b/app/src/custom/res/animator/alpha3.xml new file mode 100644 index 00000000..d05f36c2 --- /dev/null +++ b/app/src/custom/res/animator/alpha3.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/app/src/custom/res/drawable-ldpi/logo.png b/app/src/custom/res/drawable-ldpi/logo.png deleted file mode 100644 index 4e22d99f..00000000 Binary files a/app/src/custom/res/drawable-ldpi/logo.png and /dev/null differ diff --git a/app/src/custom/res/drawable-mdpi/logo.png b/app/src/custom/res/drawable-mdpi/logo.png deleted file mode 100644 index e53cb15c..00000000 Binary files a/app/src/custom/res/drawable-mdpi/logo.png and /dev/null differ diff --git a/app/src/custom/res/drawable-xxxhdpi/logo.png b/app/src/custom/res/drawable-xxxhdpi/logo.png deleted file mode 100644 index 4297d90c..00000000 Binary files a/app/src/custom/res/drawable-xxxhdpi/logo.png and /dev/null differ diff --git a/app/src/custom/res/drawable/background_eip.xml b/app/src/custom/res/drawable/background_eip.xml deleted file mode 100644 index a2364794..00000000 --- a/app/src/custom/res/drawable/background_eip.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/custom/res/drawable/crow.xml b/app/src/custom/res/drawable/crow.xml deleted file mode 100644 index 3d3660b8..00000000 --- a/app/src/custom/res/drawable/crow.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - \ No newline at end of file diff --git a/app/src/custom/res/drawable/ravens.xml b/app/src/custom/res/drawable/ravens.xml new file mode 100644 index 00000000..f97a3532 --- /dev/null +++ b/app/src/custom/res/drawable/ravens.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/custom/res/drawable/ravens1.xml b/app/src/custom/res/drawable/ravens1.xml deleted file mode 100644 index d38b0c19..00000000 --- a/app/src/custom/res/drawable/ravens1.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/custom/res/drawable/ravens2.xml b/app/src/custom/res/drawable/ravens2.xml deleted file mode 100644 index 0a3cbb7e..00000000 --- a/app/src/custom/res/drawable/ravens2.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/app/src/custom/res/drawable/ravens3.xml b/app/src/custom/res/drawable/ravens3.xml deleted file mode 100644 index f97a3532..00000000 --- a/app/src/custom/res/drawable/ravens3.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/custom/res/drawable/rotate_progress_image.xml b/app/src/custom/res/drawable/rotate_progress_image.xml new file mode 100644 index 00000000..f84f9034 --- /dev/null +++ b/app/src/custom/res/drawable/rotate_progress_image.xml @@ -0,0 +1,14 @@ + + + + \ No newline at end of file diff --git a/app/src/custom/res/drawable/state_connecting.xml b/app/src/custom/res/drawable/state_connecting.xml new file mode 100644 index 00000000..3ef89983 --- /dev/null +++ b/app/src/custom/res/drawable/state_connecting.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/app/src/custom/res/drawable/state_disconnected.xml b/app/src/custom/res/drawable/state_disconnected.xml new file mode 100644 index 00000000..3d3660b8 --- /dev/null +++ b/app/src/custom/res/drawable/state_disconnected.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/app/src/custom/res/layout-port/f_eip.xml b/app/src/custom/res/layout-port/f_eip.xml deleted file mode 100644 index cb99a700..00000000 --- a/app/src/custom/res/layout-port/f_eip.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/custom/res/layout-xlarge-port/f_eip.xml b/app/src/custom/res/layout-xlarge-port/f_eip.xml deleted file mode 100644 index 10b7a7e3..00000000 --- a/app/src/custom/res/layout-xlarge-port/f_eip.xml +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/custom/res/layout-xlarge/f_eip.xml b/app/src/custom/res/layout-xlarge/f_eip.xml deleted file mode 100644 index e6b28c67..00000000 --- a/app/src/custom/res/layout-xlarge/f_eip.xml +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/custom/res/layout/f_eip.xml b/app/src/custom/res/layout/f_eip.xml deleted file mode 100644 index 9a823b65..00000000 --- a/app/src/custom/res/layout/f_eip.xml +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/custom/res/layout/v_location_button.xml b/app/src/custom/res/layout/v_location_button.xml deleted file mode 100644 index 8aaf4978..00000000 --- a/app/src/custom/res/layout/v_location_button.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/custom/res/layout/v_main_button.xml b/app/src/custom/res/layout/v_main_button.xml deleted file mode 100644 index e3f96693..00000000 --- a/app/src/custom/res/layout/v_main_button.xml +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java new file mode 100644 index 00000000..0210077c --- /dev/null +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java @@ -0,0 +1,654 @@ +/** + * Copyright (c) 2018 LEAP Encryption Access Project and contributers + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package se.leap.bitmaskclient.base.fragments; + +import static de.blinkt.openvpn.core.ConnectionStatus.LEVEL_NONETWORK; +import static se.leap.bitmaskclient.R.string.vpn_certificate_user_message; +import static se.leap.bitmaskclient.base.models.Constants.ASK_TO_CANCEL_VPN; +import static se.leap.bitmaskclient.base.models.Constants.EIP_ACTION_START; +import static se.leap.bitmaskclient.base.models.Constants.EIP_EARLY_ROUTES; +import static se.leap.bitmaskclient.base.models.Constants.EIP_RESTART_ON_BOOT; +import static se.leap.bitmaskclient.base.models.Constants.PROVIDER_KEY; +import static se.leap.bitmaskclient.base.models.Constants.REQUEST_CODE_CONFIGURE_LEAP; +import static se.leap.bitmaskclient.base.models.Constants.REQUEST_CODE_LOG_IN; +import static se.leap.bitmaskclient.base.models.Constants.REQUEST_CODE_SWITCH_PROVIDER; +import static se.leap.bitmaskclient.base.models.Constants.SHARED_PREFERENCES; +import static se.leap.bitmaskclient.base.utils.ConfigHelper.isDefaultBitmask; +import static se.leap.bitmaskclient.base.utils.PreferenceHelper.getPreferredCity; +import static se.leap.bitmaskclient.eip.EipSetupObserver.reconnectingWithDifferentGateway; +import static se.leap.bitmaskclient.eip.GatewaysManager.Load.UNKNOWN; +import static se.leap.bitmaskclient.providersetup.ProviderAPI.DOWNLOAD_GEOIP_JSON; +import static se.leap.bitmaskclient.providersetup.ProviderAPI.UPDATE_INVALID_VPN_CERTIFICATE; +import static se.leap.bitmaskclient.providersetup.ProviderAPI.USER_MESSAGE; + +import android.app.Activity; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.ServiceConnection; +import android.content.SharedPreferences; +import android.os.Bundle; +import android.os.IBinder; +import android.text.Spannable; +import android.text.SpannableString; +import android.text.TextUtils; +import android.text.style.RelativeSizeSpan; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.ColorRes; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.widget.AppCompatImageView; +import androidx.appcompat.widget.AppCompatTextView; +import androidx.core.content.ContextCompat; +import androidx.fragment.app.DialogFragment; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentTransaction; + +import java.util.Observable; +import java.util.Observer; +import java.util.concurrent.atomic.AtomicBoolean; + +import de.blinkt.openvpn.core.ConnectionStatus; +import de.blinkt.openvpn.core.IOpenVPNServiceInternal; +import de.blinkt.openvpn.core.OpenVPNService; +import de.blinkt.openvpn.core.VpnStatus; +import de.blinkt.openvpn.core.connection.Connection; +import se.leap.bitmaskclient.R; +import se.leap.bitmaskclient.base.FragmentManagerEnhanced; +import se.leap.bitmaskclient.base.MainActivity; +import se.leap.bitmaskclient.base.models.Provider; +import se.leap.bitmaskclient.base.models.ProviderObservable; +import se.leap.bitmaskclient.base.utils.PreferenceHelper; +import se.leap.bitmaskclient.base.views.LocationButton; +import se.leap.bitmaskclient.base.views.MainButton; +import se.leap.bitmaskclient.databinding.FEipBinding; +import se.leap.bitmaskclient.eip.EipCommand; +import se.leap.bitmaskclient.eip.EipStatus; +import se.leap.bitmaskclient.eip.GatewaysManager; +import se.leap.bitmaskclient.providersetup.ProviderAPICommand; +import se.leap.bitmaskclient.providersetup.ProviderListActivity; +import se.leap.bitmaskclient.providersetup.activities.CustomProviderSetupActivity; +import se.leap.bitmaskclient.providersetup.activities.LoginActivity; +import se.leap.bitmaskclient.providersetup.models.LeapSRPSession; +import se.leap.bitmaskclient.tor.TorServiceCommand; +import se.leap.bitmaskclient.tor.TorStatusObservable; + +public class EipFragment extends Fragment implements Observer { + + public final static String TAG = EipFragment.class.getSimpleName(); + + + private SharedPreferences preferences; + private Provider provider; + + AppCompatImageView background; + AppCompatImageView stateView; + MainButton mainButton; + LocationButton locationButton; + AppCompatTextView mainDescription; + AppCompatTextView subDescription; + + private EipStatus eipStatus; + private ProviderObservable providerObservable; + private TorStatusObservable torStatusObservable; + + private GatewaysManager gatewaysManager; + + //---saved Instance ------- + private final String KEY_SHOW_PENDING_START_CANCELLATION = "KEY_SHOW_PENDING_START_CANCELLATION"; + private final String KEY_SHOW_ASK_TO_STOP_EIP = "KEY_SHOW_ASK_TO_STOP_EIP"; + private boolean showPendingStartCancellation = false; + private boolean showAskToStopEip = false; + //------------------------ + AlertDialog alertDialog; + + private IOpenVPNServiceInternal mService; + // We use this service connection to detect if openvpn is running without network + private EipFragmentServiceConnection openVpnConnection; + + @Override + public void onAttach(Context context) { + super.onAttach(context); + Bundle arguments = getArguments(); + Activity activity = getActivity(); + if (activity != null) { + if (arguments != null) { + provider = arguments.getParcelable(PROVIDER_KEY); + if (provider == null) { + handleNoProvider(activity); + } else { + Log.d(TAG, provider.getName() + " configured as provider"); + } + } else { + handleNoProvider(activity); + } + } + } + + private void handleNoProvider(Activity activity) { + if (isDefaultBitmask()) { + activity.startActivityForResult(new Intent(activity, ProviderListActivity.class), REQUEST_CODE_SWITCH_PROVIDER); + } else { + Log.e(TAG, "no provider given - try to reconfigure custom provider"); + startActivityForResult(new Intent(activity, CustomProviderSetupActivity.class), REQUEST_CODE_CONFIGURE_LEAP); + + } + + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + openVpnConnection = new EipFragmentServiceConnection(); + eipStatus = EipStatus.getInstance(); + providerObservable = ProviderObservable.getInstance(); + torStatusObservable = TorStatusObservable.getInstance(); + Activity activity = getActivity(); + if (activity != null) { + preferences = getActivity().getSharedPreferences(SHARED_PREFERENCES, Context.MODE_PRIVATE); + } else { + Log.e(TAG, "activity is null in onCreate - no preferences set!"); + } + + gatewaysManager = new GatewaysManager(getContext()); + + + } + + @Override + public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + FEipBinding binding = FEipBinding.inflate(LayoutInflater.from(getContext()), container, false); + background = binding.background; + mainButton = binding.mainButton; + locationButton = binding.gatewayLocationButton; + locationButton.setTextColor(R.color.black800); + mainDescription = binding.mainDescription; + subDescription = binding.subDescription; + stateView = binding.stateView; + + eipStatus.addObserver(this); + torStatusObservable.addObserver(this); + providerObservable.addObserver(this); + + try { + Bundle arguments = getArguments(); + if (arguments != null && arguments.containsKey(ASK_TO_CANCEL_VPN) && arguments.getBoolean(ASK_TO_CANCEL_VPN)) { + arguments.remove(ASK_TO_CANCEL_VPN); + setArguments(arguments); + askToStopEIP(); + } + } catch (IllegalStateException e) { + // probably setArguments failed because the fragments state is already saved + e.printStackTrace(); + } + + restoreFromSavedInstance(savedInstanceState); + locationButton.setOnClickListener(v -> { + FragmentManagerEnhanced fragmentManager = new FragmentManagerEnhanced(getActivity().getSupportFragmentManager()); + Fragment fragment = new GatewaySelectionFragment(); + fragmentManager.replace(R.id.main_container, fragment, MainActivity.TAG); + }); + + mainButton.setOnClickListener(v -> { + handleIcon(); + }); + return binding.getRoot(); + } + + @Override + public void onStart() { + super.onStart(); + if (DonationReminderDialog.isCallable(getContext())) { + showDonationReminderDialog(); + } + } + + @Override + public void onResume() { + super.onResume(); + if (!eipStatus.isDisconnected()) { + openVpnConnection.bindService(); + } + handleNewState(); + } + + @Override + public void onPause() { + super.onPause(); + openVpnConnection.unbindService(); + } + + @Override + public void onSaveInstanceState(@NonNull Bundle outState) { + super.onSaveInstanceState(outState); + if (showAskToStopEip) { + outState.putBoolean(KEY_SHOW_ASK_TO_STOP_EIP, true); + alertDialog.dismiss(); + } else if (showPendingStartCancellation) { + outState.putBoolean(KEY_SHOW_PENDING_START_CANCELLATION, true); + alertDialog.dismiss(); + } + } + + private void restoreFromSavedInstance(Bundle savedInstanceState) { + if (savedInstanceState != null && savedInstanceState.containsKey(KEY_SHOW_PENDING_START_CANCELLATION)) { + showPendingStartCancellation = true; + askPendingStartCancellation(); + } else if (savedInstanceState != null && savedInstanceState.containsKey(KEY_SHOW_ASK_TO_STOP_EIP)) { + showAskToStopEip = true; + askToStopEIP(); + } + } + + @Override + public void onDestroyView() { + super.onDestroyView(); + Activity activity = getActivity(); + if (activity != null) { + ((MainActivity) activity).setDefaultActivityBarColor(); + } + eipStatus.deleteObserver(this); + providerObservable.deleteObserver(this); + torStatusObservable.deleteObserver(this); + background = null; + mainButton = null; + locationButton = null; + mainDescription = null; + subDescription = null; + stateView = null; + } + + private void saveStatus(boolean restartOnBoot) { + preferences.edit().putBoolean(EIP_RESTART_ON_BOOT, restartOnBoot).apply(); + } + + void handleIcon() { + if (isOpenVpnRunningWithoutNetwork() || eipStatus.isConnected() || eipStatus.isConnecting() || eipStatus.isUpdatingVpnCert()) + handleSwitchOff(); + else + handleSwitchOn(); + } + + private void handleSwitchOn() { + Context context = getContext(); + if (context == null) { + Log.e(TAG, "context is null when switch turning on"); + return; + } + + if (canStartEIP()) { + startEipFromScratch(); + } else if (canLogInToStartEIP()) { + askUserToLogIn(getString(vpn_certificate_user_message)); + } else { + // provider has no VpnCertificate but user is logged in + updateInvalidVpnCertificate(); + } + } + + private boolean canStartEIP() { + boolean certificateExists = provider.hasVpnCertificate(); + boolean isAllowedAnon = provider.allowsAnonymous(); + return (isAllowedAnon || certificateExists) && !eipStatus.isConnected() && !eipStatus.isConnecting(); + } + + private boolean canLogInToStartEIP() { + boolean isAllowedRegistered = provider.allowsRegistered(); + boolean isLoggedIn = LeapSRPSession.loggedIn(); + return isAllowedRegistered && !isLoggedIn && !eipStatus.isConnecting() && !eipStatus.isConnected(); + } + + private void handleSwitchOff() { + if (isOpenVpnRunningWithoutNetwork() || eipStatus.isConnecting() || eipStatus.isUpdatingVpnCert()) { + askPendingStartCancellation(); + } else if (eipStatus.isConnected()) { + askToStopEIP(); + } + } + + private void setMainButtonEnabled(boolean enabled) { + locationButton.setEnabled(enabled); + mainButton.setEnabled(enabled); + } + + public void startEipFromScratch() { + saveStatus(true); + Context context = getContext(); + if (context == null) { + Log.e(TAG, "context is null when trying to start VPN"); + return; + } + if (!provider.getGeoipUrl().isDefault() && provider.shouldUpdateGeoIpJson()) { + Bundle bundle = new Bundle(); + bundle.putBoolean(EIP_ACTION_START, true); + bundle.putBoolean(EIP_EARLY_ROUTES, false); + ProviderAPICommand.execute(context, DOWNLOAD_GEOIP_JSON, bundle, provider); + } else { + EipCommand.startVPN(context, false); + } + EipStatus.getInstance().updateState("UI_CONNECTING", "", 0, ConnectionStatus.LEVEL_START); + } + + protected void stopEipIfPossible() { + Context context = getContext(); + if (context == null) { + Log.e(TAG, "context is null when trying to stop EIP"); + return; + } + EipCommand.stopVPN(context); + } + + private void askPendingStartCancellation() { + Activity activity = getActivity(); + if (activity == null) { + Log.e(TAG, "activity is null when asking to cancel"); + return; + } + + try { + AlertDialog.Builder alertBuilder = new AlertDialog.Builder(getActivity()); + showPendingStartCancellation = true; + alertDialog = alertBuilder.setTitle(activity.getString(R.string.eip_cancel_connect_title)) + .setMessage(activity.getString(R.string.eip_cancel_connect_text)) + .setPositiveButton((android.R.string.yes), (dialog, which) -> { + Context context = getContext(); + if (context != null && eipStatus.isUpdatingVpnCert() && + TorStatusObservable.isRunning()) { + TorServiceCommand.stopTorServiceAsync(context.getApplicationContext()); + } + stopEipIfPossible(); + }) + .setNegativeButton(activity.getString(android.R.string.no), (dialog, which) -> { + }).setOnDismissListener(dialog -> showPendingStartCancellation = false).show(); + } catch (IllegalStateException e) { + e.printStackTrace(); + } + + } + + protected void askToStopEIP() { + Activity activity = getActivity(); + if (activity == null) { + Log.e(TAG, "activity is null when asking to stop EIP"); + return; + } + try { + AlertDialog.Builder alertBuilder = new AlertDialog.Builder(activity); + showAskToStopEip = true; + alertDialog = alertBuilder.setTitle(activity.getString(R.string.eip_cancel_connect_title)) + .setMessage(activity.getString(R.string.eip_warning_browser_inconsistency)) + .setPositiveButton((android.R.string.yes), (dialog, which) -> stopEipIfPossible()) + .setNegativeButton(activity.getString(android.R.string.no), (dialog, which) -> { + }).setOnDismissListener(dialog -> showAskToStopEip = false).show(); + } catch (IllegalStateException e) { + e.printStackTrace(); + } + + } + + @Override + public void update(Observable observable, Object data) { + if (observable instanceof EipStatus) { + eipStatus = (EipStatus) observable; + handleNewStateOnMain(); + + if (eipStatus.isConnecting()) { + openVpnConnection.bindService(); + } + if ("NOPROCESS".equals(EipStatus.getInstance().getState())) { + //assure that the Service is shutdown completely if openvpn was stopped + openVpnConnection.unbindService(); + } + } else if (observable instanceof ProviderObservable) { + provider = ((ProviderObservable) observable).getCurrentProvider(); + } else if (observable instanceof TorStatusObservable && EipStatus.getInstance().isUpdatingVpnCert()) { + handleNewStateOnMain(); + } + } + + private void handleNewStateOnMain() { + Activity activity = getActivity(); + if (activity != null) { + activity.runOnUiThread(this::handleNewState); + } else { + Log.e("EipFragment", "activity is null"); + } + } + + private void setActivityBarColor(@ColorRes int primaryColor, @ColorRes int secondaryColor) { + Activity activity = getActivity(); + if (activity == null) { + return; + } + ((MainActivity) getActivity()).setActivityBarColor(primaryColor, secondaryColor, R.color.actionbar_dark_color); + } + + private void handleNewState() { + Activity activity = getActivity(); + if (activity == null) { + Log.e(TAG, "activity is null while trying to handle new state"); + return; + } + + Log.d(TAG, "eip fragment eipStatus state: " + eipStatus.getState() + " - level: " + eipStatus.getLevel() + " - is reconnecting: " + eipStatus.isReconnecting()); + if (eipStatus.isUpdatingVpnCert()) { + setMainButtonEnabled(true); + String city = getPreferredCity(getContext()); + String locationName = VpnStatus.getCurrentlyConnectingVpnName() != null ? + VpnStatus.getCurrentlyConnectingVpnName() : + city == null ? getString(R.string.gateway_selection_recommended_location) : city; + locationButton.setText(locationName); + locationButton.setLocationLoad(UNKNOWN); + locationButton.showBridgeIndicator(false); + locationButton.showRecommendedIndicator(false); + mainDescription.setText(R.string.eip_status_connecting); + String torStatus = TorStatusObservable.getStringForCurrentStatus(getContext()); + if (!TextUtils.isEmpty(torStatus)) { + Spannable spannable = new SpannableString(torStatus); + spannable.setSpan(new RelativeSizeSpan(0.75f), 0, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + subDescription.setText(TextUtils.concat(getString(R.string.updating_certificate_message) + "\n", spannable)); + } else { + subDescription.setText(getString(R.string.updating_certificate_message)); + } + background.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.bg_connecting)); + stateView.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.yellow_mask)); + mainButton.updateState(false, true, false); + setActivityBarColor(R.color.bg_connecting_top, R.color.bg_connecting_top_light_transparent); + } else if (eipStatus.isConnecting()) { + setMainButtonEnabled(true); + String city = getPreferredCity(getContext()); + String locationName = VpnStatus.getCurrentlyConnectingVpnName() != null ? + VpnStatus.getCurrentlyConnectingVpnName() : + city == null ? getString(R.string.gateway_selection_recommended_location) : city; + locationButton.setText(locationName); + locationButton.setLocationLoad(UNKNOWN); + locationButton.showBridgeIndicator(false); + locationButton.showRecommendedIndicator(false); + mainDescription.setText(R.string.eip_status_connecting); + subDescription.setText(null); + background.setImageDrawable(ContextCompat.getDrawable(activity, R.drawable.bg_connecting)); + stateView.setImageDrawable(ContextCompat.getDrawable(activity, R.drawable.yellow_mask)); + mainButton.updateState(false, true, false); + setActivityBarColor(R.color.bg_connecting_top, R.color.bg_connecting_top_light_transparent); + } else if (eipStatus.isConnected()) { + setMainButtonEnabled(true); + mainButton.updateState(true, false, false); + Connection.TransportType transportType = PreferenceHelper.getUseBridges(getContext()) ? Connection.TransportType.OBFS4 : Connection.TransportType.OPENVPN; + locationButton.setLocationLoad(PreferenceHelper.useObfuscationPinning(getContext()) ? GatewaysManager.Load.UNKNOWN : gatewaysManager.getLoadForLocation(VpnStatus.getLastConnectedVpnName(), transportType)); + locationButton.setText(VpnStatus.getLastConnectedVpnName()); + locationButton.showBridgeIndicator(VpnStatus.isUsingBridges()); + locationButton.showRecommendedIndicator(getPreferredCity(getContext()) == null); + mainDescription.setText(R.string.eip_status_secured); + subDescription.setText(null); + background.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.bg_connected)); + stateView.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.green_mask)); + setActivityBarColor(R.color.bg_running_top, R.color.bg_running_top_light_transparent); + } else if(isOpenVpnRunningWithoutNetwork()) { + Log.d(TAG, "eip fragment eipStatus - isOpenVpnRunningWithoutNetwork"); + setMainButtonEnabled(true); + mainButton.updateState(true, false, true); + locationButton.setText(VpnStatus.getCurrentlyConnectingVpnName()); + locationButton.showBridgeIndicator(VpnStatus.isUsingBridges()); + locationButton.showBridgeIndicator(VpnStatus.isUsingBridges()); + locationButton.showRecommendedIndicator(getPreferredCity(getContext())== null); + mainDescription.setText(R.string.eip_state_connected); + subDescription.setText(R.string.eip_state_no_network); + background.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.bg_connecting)); + stateView.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.yellow_mask)); + setActivityBarColor(R.color.bg_connecting_top, R.color.bg_connecting_top_light_transparent); + } else if (eipStatus.isDisconnected() && reconnectingWithDifferentGateway()) { + locationButton.setText(VpnStatus.getCurrentlyConnectingVpnName()); + locationButton.setLocationLoad(UNKNOWN); + locationButton.showBridgeIndicator(false); + locationButton.showRecommendedIndicator(false); + mainDescription.setText(R.string.eip_status_connecting); + subDescription.setText(R.string.reconnecting); + background.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.bg_connecting)); + stateView.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.yellow_mask)); + setActivityBarColor(R.color.bg_connecting_top, R.color.bg_connecting_top_light_transparent); + + } else if (eipStatus.isDisconnecting()) { + setMainButtonEnabled(false); + background.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.bg_disconnected)); + stateView.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.red_mask)); + mainButton.updateState(false, false, false); + mainDescription.setText(R.string.eip_status_unsecured); + setActivityBarColor(R.color.bg_disconnected_top, R.color.bg_disconnected_top_light_transparent); + } else if (eipStatus.isBlocking()) { + setMainButtonEnabled(true); + mainButton.updateState(true, false, true); + locationButton.setText(getString(R.string.no_location)); + locationButton.setLocationLoad(UNKNOWN); + locationButton.showBridgeIndicator(false); + locationButton.showRecommendedIndicator(false); + mainDescription.setText(R.string.eip_state_connected); + subDescription.setText(getString(R.string.eip_state_blocking, getString(R.string.app_name))); + background.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.bg_disconnected)); + stateView.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.red_mask)); + setActivityBarColor(R.color.bg_disconnected_top, R.color.bg_disconnected_top_light_transparent); + } else { + locationButton.setText(getContext().getString(R.string.vpn_button_turn_on)); + setMainButtonEnabled(true); + mainButton.updateState(false, false, false); + locationButton.setLocationLoad(UNKNOWN); + locationButton.showBridgeIndicator(false); + String city = getPreferredCity(getContext()); + locationButton.setText(city == null ? getString(R.string.gateway_selection_recommended_location) : city); + locationButton.showRecommendedIndicator(false); + mainDescription.setText(R.string.eip_status_unsecured); + subDescription.setText(null); + background.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.bg_disconnected)); + stateView.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.red_mask)); + setActivityBarColor(R.color.bg_disconnected_top, R.color.bg_disconnected_top_light_transparent); + } + } + + private boolean isOpenVpnRunningWithoutNetwork() { + boolean isRunning = false; + try { + isRunning = eipStatus.getLevel() == LEVEL_NONETWORK && + mService.isVpnRunning(); + } catch (Exception e) { + //eat me + e.printStackTrace(); + } + + return isRunning; + } + + private void updateInvalidVpnCertificate() { + eipStatus.setUpdatingVpnCert(true); + ProviderAPICommand.execute(getContext(), UPDATE_INVALID_VPN_CERTIFICATE, provider); + } + + private void askUserToLogIn(String userMessage) { + Intent intent = new Intent(getContext(), LoginActivity.class); + intent.putExtra(PROVIDER_KEY, provider); + + if(userMessage != null) { + intent.putExtra(USER_MESSAGE, userMessage); + } + + Activity activity = getActivity(); + if (activity != null) { + activity.startActivityForResult(intent, REQUEST_CODE_LOG_IN); + } + } + + private class EipFragmentServiceConnection implements ServiceConnection { + private final AtomicBoolean bind = new AtomicBoolean(false); + + void bindService() { + Activity activity = getActivity(); + if (activity == null) { + Log.e(TAG, "activity is null when binding OpenVpn"); + return; + } + if (!bind.get()) { + activity.runOnUiThread(() -> { + Intent intent = new Intent(activity, OpenVPNService.class); + intent.setAction(OpenVPNService.START_SERVICE); + + activity.bindService(intent, EipFragmentServiceConnection.this, Context.BIND_AUTO_CREATE); + bind.set(true); + }); + } + } + + void unbindService() { + Activity activity = getActivity(); + if (activity == null) { + return; + } + if (bind.get()) { + activity.runOnUiThread(() -> { + activity.unbindService(EipFragmentServiceConnection.this); + bind.set(false); + }); + } + } + + @Override + public void onServiceConnected(ComponentName className, + IBinder service) { + mService = IOpenVPNServiceInternal.Stub.asInterface(service); + handleNewState(); + } + + @Override + public void onServiceDisconnected(ComponentName arg0) { + mService = null; + } + } + + public void showDonationReminderDialog() { + try { + FragmentTransaction fragmentTransaction = new FragmentManagerEnhanced( + getActivity().getSupportFragmentManager()).removePreviousFragment( + DonationReminderDialog.TAG); + DialogFragment newFragment = new DonationReminderDialog(); + newFragment.setCancelable(false); + newFragment.show(fragmentTransaction, DonationReminderDialog.TAG); + } catch (IllegalStateException | NullPointerException e) { + e.printStackTrace(); + } + } +} diff --git a/app/src/main/java/se/leap/bitmaskclient/base/views/MainButton.java b/app/src/main/java/se/leap/bitmaskclient/base/views/MainButton.java new file mode 100644 index 00000000..715063b5 --- /dev/null +++ b/app/src/main/java/se/leap/bitmaskclient/base/views/MainButton.java @@ -0,0 +1,57 @@ +package se.leap.bitmaskclient.base.views; + +import android.annotation.TargetApi; +import android.content.Context; +import android.util.AttributeSet; +import android.view.LayoutInflater; +import android.widget.RelativeLayout; + +import androidx.appcompat.widget.AppCompatImageView; +import androidx.core.content.ContextCompat; + +import se.leap.bitmaskclient.R; +import se.leap.bitmaskclient.databinding.VMainButtonBinding; + +public class MainButton extends RelativeLayout { + + private static final String TAG = MainButton.class.getSimpleName(); + + AppCompatImageView button; + + public MainButton(Context context) { + super(context); + initLayout(context); + } + + public MainButton(Context context, AttributeSet attrs) { + super(context, attrs); + initLayout(context); + } + + public MainButton(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + initLayout(context); + } + + + @TargetApi(21) + public MainButton(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); + initLayout(context); + } + + private void initLayout(Context context) { + VMainButtonBinding binding = VMainButtonBinding.inflate(LayoutInflater.from(context), this, true); + button = binding.button; + } + + public void updateState(boolean isOn, boolean isProcessing, boolean isError) { + if (isProcessing) { + button.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.button_circle_cancel)); + } else { + button.setImageDrawable( + ContextCompat.getDrawable(getContext(), + isOn ? R.drawable.button_circle_stop : R.drawable.button_circle_start)); + } + } +} diff --git a/app/src/main/res/drawable-hdpi/bg_connected.png b/app/src/main/res/drawable-hdpi/bg_connected.png deleted file mode 100644 index 0e98f705..00000000 Binary files a/app/src/main/res/drawable-hdpi/bg_connected.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/bg_connecting.png b/app/src/main/res/drawable-hdpi/bg_connecting.png deleted file mode 100644 index 24632712..00000000 Binary files a/app/src/main/res/drawable-hdpi/bg_connecting.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/bg_disconnected.png b/app/src/main/res/drawable-hdpi/bg_disconnected.png deleted file mode 100644 index de96be57..00000000 Binary files a/app/src/main/res/drawable-hdpi/bg_disconnected.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/green_mask.png b/app/src/main/res/drawable-hdpi/green_mask.png deleted file mode 100644 index fccc060a..00000000 Binary files a/app/src/main/res/drawable-hdpi/green_mask.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/red_mask.png b/app/src/main/res/drawable-hdpi/red_mask.png deleted file mode 100644 index d2ef7d99..00000000 Binary files a/app/src/main/res/drawable-hdpi/red_mask.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/yellow_mask.png b/app/src/main/res/drawable-hdpi/yellow_mask.png deleted file mode 100644 index 72e3ae45..00000000 Binary files a/app/src/main/res/drawable-hdpi/yellow_mask.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/bg_connected.png b/app/src/main/res/drawable-xhdpi/bg_connected.png deleted file mode 100644 index 915dff95..00000000 Binary files a/app/src/main/res/drawable-xhdpi/bg_connected.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/bg_connecting.png b/app/src/main/res/drawable-xhdpi/bg_connecting.png deleted file mode 100644 index be4469df..00000000 Binary files a/app/src/main/res/drawable-xhdpi/bg_connecting.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/bg_disconnected.png b/app/src/main/res/drawable-xhdpi/bg_disconnected.png deleted file mode 100644 index 433c776f..00000000 Binary files a/app/src/main/res/drawable-xhdpi/bg_disconnected.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/green_mask.png b/app/src/main/res/drawable-xhdpi/green_mask.png deleted file mode 100644 index c852459d..00000000 Binary files a/app/src/main/res/drawable-xhdpi/green_mask.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/red_mask.png b/app/src/main/res/drawable-xhdpi/red_mask.png deleted file mode 100644 index c0d57a03..00000000 Binary files a/app/src/main/res/drawable-xhdpi/red_mask.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/yellow_mask.png b/app/src/main/res/drawable-xhdpi/yellow_mask.png deleted file mode 100644 index d81190fe..00000000 Binary files a/app/src/main/res/drawable-xhdpi/yellow_mask.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/bg_connected.png b/app/src/main/res/drawable-xxhdpi/bg_connected.png deleted file mode 100644 index cd78d865..00000000 Binary files a/app/src/main/res/drawable-xxhdpi/bg_connected.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/bg_connecting.png b/app/src/main/res/drawable-xxhdpi/bg_connecting.png deleted file mode 100644 index 718e102f..00000000 Binary files a/app/src/main/res/drawable-xxhdpi/bg_connecting.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/bg_disconnected.png b/app/src/main/res/drawable-xxhdpi/bg_disconnected.png deleted file mode 100644 index ffbcdb79..00000000 Binary files a/app/src/main/res/drawable-xxhdpi/bg_disconnected.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/bg_switchbar.xml b/app/src/main/res/drawable-xxhdpi/bg_switchbar.xml deleted file mode 100644 index 7af57ad3..00000000 --- a/app/src/main/res/drawable-xxhdpi/bg_switchbar.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable-xxhdpi/green_mask.png b/app/src/main/res/drawable-xxhdpi/green_mask.png deleted file mode 100644 index 32286177..00000000 Binary files a/app/src/main/res/drawable-xxhdpi/green_mask.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/red_mask.png b/app/src/main/res/drawable-xxhdpi/red_mask.png deleted file mode 100644 index ac560317..00000000 Binary files a/app/src/main/res/drawable-xxhdpi/red_mask.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/yellow_mask.png b/app/src/main/res/drawable-xxhdpi/yellow_mask.png deleted file mode 100644 index 75cf3782..00000000 Binary files a/app/src/main/res/drawable-xxhdpi/yellow_mask.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/bg_connected.png b/app/src/main/res/drawable-xxxhdpi/bg_connected.png deleted file mode 100644 index 3c9d97b4..00000000 Binary files a/app/src/main/res/drawable-xxxhdpi/bg_connected.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/bg_connecting.png b/app/src/main/res/drawable-xxxhdpi/bg_connecting.png deleted file mode 100644 index bff2004c..00000000 Binary files a/app/src/main/res/drawable-xxxhdpi/bg_connecting.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/bg_disconnected.png b/app/src/main/res/drawable-xxxhdpi/bg_disconnected.png deleted file mode 100644 index 2503f135..00000000 Binary files a/app/src/main/res/drawable-xxxhdpi/bg_disconnected.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/green_mask.png b/app/src/main/res/drawable-xxxhdpi/green_mask.png deleted file mode 100644 index f5a5adaf..00000000 Binary files a/app/src/main/res/drawable-xxxhdpi/green_mask.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/red_mask.png b/app/src/main/res/drawable-xxxhdpi/red_mask.png deleted file mode 100644 index 9e216955..00000000 Binary files a/app/src/main/res/drawable-xxxhdpi/red_mask.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/yellow_mask.png b/app/src/main/res/drawable-xxxhdpi/yellow_mask.png deleted file mode 100644 index 806dcbf4..00000000 Binary files a/app/src/main/res/drawable-xxxhdpi/yellow_mask.png and /dev/null differ diff --git a/app/src/main/res/drawable/bg_connected.png b/app/src/main/res/drawable/bg_connected.png deleted file mode 100644 index 6da7878d..00000000 Binary files a/app/src/main/res/drawable/bg_connected.png and /dev/null differ diff --git a/app/src/main/res/drawable/bg_connecting.png b/app/src/main/res/drawable/bg_connecting.png deleted file mode 100644 index c371f3f0..00000000 Binary files a/app/src/main/res/drawable/bg_connecting.png and /dev/null differ diff --git a/app/src/main/res/drawable/bg_disconnected.png b/app/src/main/res/drawable/bg_disconnected.png deleted file mode 100644 index de96be57..00000000 Binary files a/app/src/main/res/drawable/bg_disconnected.png and /dev/null differ diff --git a/app/src/main/res/drawable/green_mask.png b/app/src/main/res/drawable/green_mask.png deleted file mode 100644 index e515f3f5..00000000 Binary files a/app/src/main/res/drawable/green_mask.png and /dev/null differ diff --git a/app/src/main/res/drawable/logo.png b/app/src/main/res/drawable/logo.png new file mode 100644 index 00000000..773937ff Binary files /dev/null and b/app/src/main/res/drawable/logo.png differ diff --git a/app/src/main/res/drawable/red_mask.png b/app/src/main/res/drawable/red_mask.png deleted file mode 100644 index a4bd4a78..00000000 Binary files a/app/src/main/res/drawable/red_mask.png and /dev/null differ diff --git a/app/src/main/res/drawable/rotate_progress_image.xml b/app/src/main/res/drawable/rotate_progress_image.xml deleted file mode 100644 index 7b539720..00000000 --- a/app/src/main/res/drawable/rotate_progress_image.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/yellow_mask.png b/app/src/main/res/drawable/yellow_mask.png deleted file mode 100644 index 98dd7978..00000000 Binary files a/app/src/main/res/drawable/yellow_mask.png and /dev/null differ diff --git a/app/src/main/res/layout-port/f_eip.xml b/app/src/main/res/layout-port/f_eip.xml index cb99a700..1b3225cc 100644 --- a/app/src/main/res/layout-port/f_eip.xml +++ b/app/src/main/res/layout-port/f_eip.xml @@ -5,7 +5,6 @@ android:layout_height="match_parent" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/eipServiceFragment" - tools:viewBindingIgnore="true" > + + + + + + + android:layout_marginTop="-300dp" + android:layout_marginBottom="-300dp" + android:layout_marginLeft="-300dp" + android:layout_marginRight="-300dp" + + /> + - + + + + + + + app:layout_constraintGuide_percent="0.25" + /> + app:layout_constraintGuide_percent="0.3" /> + + + + + app:layout_constraintGuide_percent="0.7" /> + android:layout_marginLeft="-300dp" + android:layout_marginRight="-300dp" + android:layout_marginTop="-300dp" + android:layout_marginBottom="-300dp" + app:srcCompat="@drawable/bg_disconnected" /> - - + + + + + + diff --git a/app/src/main/res/layout-xlarge/f_eip.xml b/app/src/main/res/layout-xlarge/f_eip.xml index 10b7a7e3..9617b679 100644 --- a/app/src/main/res/layout-xlarge/f_eip.xml +++ b/app/src/main/res/layout-xlarge/f_eip.xml @@ -1,30 +1,32 @@ + + + + app:layout_constraintGuide_percent="0.25" + /> + app:layout_constraintGuide_percent="0.3" /> + + + + + app:layout_constraintGuide_percent="0.7" /> + android:layout_marginLeft="-300dp" + android:layout_marginRight="-300dp" + android:layout_marginTop="-300dp" + android:layout_marginBottom="-300dp" + app:srcCompat="@drawable/bg_disconnected" /> - - + + + + + + diff --git a/app/src/main/res/layout/f_eip.xml b/app/src/main/res/layout/f_eip.xml index 9a823b65..7a6c89c3 100644 --- a/app/src/main/res/layout/f_eip.xml +++ b/app/src/main/res/layout/f_eip.xml @@ -9,7 +9,6 @@ android:layout_height="match_parent" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/eipServiceFragment" - tools:viewBindingIgnore="true" > + /> + + @@ -35,16 +40,13 @@ android:layout_width="0dp" android:layout_height="0dp" android:orientation="horizontal" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintGuide_percent="0.55" - app:layout_constraintRight_toRightOf="parent" /> + app:layout_constraintGuide_percent="0.45" /> @@ -53,9 +55,8 @@ android:layout_width="0dp" android:layout_height="0dp" android:orientation="horizontal" - app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintGuide_percent="0.98" - app:layout_constraintRight_toRightOf="parent" /> + /> + android:layout_marginLeft="-300dp" + android:layout_marginRight="-300dp" + android:layout_marginTop="-300dp" + android:layout_marginBottom="-300dp" + app:srcCompat="@drawable/bg_disconnected" /> - - + + + + + - + android:textColor="@color/white" + tools:text="Seattle along message" + /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/normal/java/se.leap.bitmaskclient.base.fragments/EipFragment.java b/app/src/normal/java/se.leap.bitmaskclient.base.fragments/EipFragment.java deleted file mode 100644 index 0210077c..00000000 --- a/app/src/normal/java/se.leap.bitmaskclient.base.fragments/EipFragment.java +++ /dev/null @@ -1,654 +0,0 @@ -/** - * Copyright (c) 2018 LEAP Encryption Access Project and contributers - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package se.leap.bitmaskclient.base.fragments; - -import static de.blinkt.openvpn.core.ConnectionStatus.LEVEL_NONETWORK; -import static se.leap.bitmaskclient.R.string.vpn_certificate_user_message; -import static se.leap.bitmaskclient.base.models.Constants.ASK_TO_CANCEL_VPN; -import static se.leap.bitmaskclient.base.models.Constants.EIP_ACTION_START; -import static se.leap.bitmaskclient.base.models.Constants.EIP_EARLY_ROUTES; -import static se.leap.bitmaskclient.base.models.Constants.EIP_RESTART_ON_BOOT; -import static se.leap.bitmaskclient.base.models.Constants.PROVIDER_KEY; -import static se.leap.bitmaskclient.base.models.Constants.REQUEST_CODE_CONFIGURE_LEAP; -import static se.leap.bitmaskclient.base.models.Constants.REQUEST_CODE_LOG_IN; -import static se.leap.bitmaskclient.base.models.Constants.REQUEST_CODE_SWITCH_PROVIDER; -import static se.leap.bitmaskclient.base.models.Constants.SHARED_PREFERENCES; -import static se.leap.bitmaskclient.base.utils.ConfigHelper.isDefaultBitmask; -import static se.leap.bitmaskclient.base.utils.PreferenceHelper.getPreferredCity; -import static se.leap.bitmaskclient.eip.EipSetupObserver.reconnectingWithDifferentGateway; -import static se.leap.bitmaskclient.eip.GatewaysManager.Load.UNKNOWN; -import static se.leap.bitmaskclient.providersetup.ProviderAPI.DOWNLOAD_GEOIP_JSON; -import static se.leap.bitmaskclient.providersetup.ProviderAPI.UPDATE_INVALID_VPN_CERTIFICATE; -import static se.leap.bitmaskclient.providersetup.ProviderAPI.USER_MESSAGE; - -import android.app.Activity; -import android.content.ComponentName; -import android.content.Context; -import android.content.Intent; -import android.content.ServiceConnection; -import android.content.SharedPreferences; -import android.os.Bundle; -import android.os.IBinder; -import android.text.Spannable; -import android.text.SpannableString; -import android.text.TextUtils; -import android.text.style.RelativeSizeSpan; -import android.util.Log; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; - -import androidx.annotation.ColorRes; -import androidx.annotation.NonNull; -import androidx.appcompat.app.AlertDialog; -import androidx.appcompat.widget.AppCompatImageView; -import androidx.appcompat.widget.AppCompatTextView; -import androidx.core.content.ContextCompat; -import androidx.fragment.app.DialogFragment; -import androidx.fragment.app.Fragment; -import androidx.fragment.app.FragmentTransaction; - -import java.util.Observable; -import java.util.Observer; -import java.util.concurrent.atomic.AtomicBoolean; - -import de.blinkt.openvpn.core.ConnectionStatus; -import de.blinkt.openvpn.core.IOpenVPNServiceInternal; -import de.blinkt.openvpn.core.OpenVPNService; -import de.blinkt.openvpn.core.VpnStatus; -import de.blinkt.openvpn.core.connection.Connection; -import se.leap.bitmaskclient.R; -import se.leap.bitmaskclient.base.FragmentManagerEnhanced; -import se.leap.bitmaskclient.base.MainActivity; -import se.leap.bitmaskclient.base.models.Provider; -import se.leap.bitmaskclient.base.models.ProviderObservable; -import se.leap.bitmaskclient.base.utils.PreferenceHelper; -import se.leap.bitmaskclient.base.views.LocationButton; -import se.leap.bitmaskclient.base.views.MainButton; -import se.leap.bitmaskclient.databinding.FEipBinding; -import se.leap.bitmaskclient.eip.EipCommand; -import se.leap.bitmaskclient.eip.EipStatus; -import se.leap.bitmaskclient.eip.GatewaysManager; -import se.leap.bitmaskclient.providersetup.ProviderAPICommand; -import se.leap.bitmaskclient.providersetup.ProviderListActivity; -import se.leap.bitmaskclient.providersetup.activities.CustomProviderSetupActivity; -import se.leap.bitmaskclient.providersetup.activities.LoginActivity; -import se.leap.bitmaskclient.providersetup.models.LeapSRPSession; -import se.leap.bitmaskclient.tor.TorServiceCommand; -import se.leap.bitmaskclient.tor.TorStatusObservable; - -public class EipFragment extends Fragment implements Observer { - - public final static String TAG = EipFragment.class.getSimpleName(); - - - private SharedPreferences preferences; - private Provider provider; - - AppCompatImageView background; - AppCompatImageView stateView; - MainButton mainButton; - LocationButton locationButton; - AppCompatTextView mainDescription; - AppCompatTextView subDescription; - - private EipStatus eipStatus; - private ProviderObservable providerObservable; - private TorStatusObservable torStatusObservable; - - private GatewaysManager gatewaysManager; - - //---saved Instance ------- - private final String KEY_SHOW_PENDING_START_CANCELLATION = "KEY_SHOW_PENDING_START_CANCELLATION"; - private final String KEY_SHOW_ASK_TO_STOP_EIP = "KEY_SHOW_ASK_TO_STOP_EIP"; - private boolean showPendingStartCancellation = false; - private boolean showAskToStopEip = false; - //------------------------ - AlertDialog alertDialog; - - private IOpenVPNServiceInternal mService; - // We use this service connection to detect if openvpn is running without network - private EipFragmentServiceConnection openVpnConnection; - - @Override - public void onAttach(Context context) { - super.onAttach(context); - Bundle arguments = getArguments(); - Activity activity = getActivity(); - if (activity != null) { - if (arguments != null) { - provider = arguments.getParcelable(PROVIDER_KEY); - if (provider == null) { - handleNoProvider(activity); - } else { - Log.d(TAG, provider.getName() + " configured as provider"); - } - } else { - handleNoProvider(activity); - } - } - } - - private void handleNoProvider(Activity activity) { - if (isDefaultBitmask()) { - activity.startActivityForResult(new Intent(activity, ProviderListActivity.class), REQUEST_CODE_SWITCH_PROVIDER); - } else { - Log.e(TAG, "no provider given - try to reconfigure custom provider"); - startActivityForResult(new Intent(activity, CustomProviderSetupActivity.class), REQUEST_CODE_CONFIGURE_LEAP); - - } - - } - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - openVpnConnection = new EipFragmentServiceConnection(); - eipStatus = EipStatus.getInstance(); - providerObservable = ProviderObservable.getInstance(); - torStatusObservable = TorStatusObservable.getInstance(); - Activity activity = getActivity(); - if (activity != null) { - preferences = getActivity().getSharedPreferences(SHARED_PREFERENCES, Context.MODE_PRIVATE); - } else { - Log.e(TAG, "activity is null in onCreate - no preferences set!"); - } - - gatewaysManager = new GatewaysManager(getContext()); - - - } - - @Override - public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - FEipBinding binding = FEipBinding.inflate(LayoutInflater.from(getContext()), container, false); - background = binding.background; - mainButton = binding.mainButton; - locationButton = binding.gatewayLocationButton; - locationButton.setTextColor(R.color.black800); - mainDescription = binding.mainDescription; - subDescription = binding.subDescription; - stateView = binding.stateView; - - eipStatus.addObserver(this); - torStatusObservable.addObserver(this); - providerObservable.addObserver(this); - - try { - Bundle arguments = getArguments(); - if (arguments != null && arguments.containsKey(ASK_TO_CANCEL_VPN) && arguments.getBoolean(ASK_TO_CANCEL_VPN)) { - arguments.remove(ASK_TO_CANCEL_VPN); - setArguments(arguments); - askToStopEIP(); - } - } catch (IllegalStateException e) { - // probably setArguments failed because the fragments state is already saved - e.printStackTrace(); - } - - restoreFromSavedInstance(savedInstanceState); - locationButton.setOnClickListener(v -> { - FragmentManagerEnhanced fragmentManager = new FragmentManagerEnhanced(getActivity().getSupportFragmentManager()); - Fragment fragment = new GatewaySelectionFragment(); - fragmentManager.replace(R.id.main_container, fragment, MainActivity.TAG); - }); - - mainButton.setOnClickListener(v -> { - handleIcon(); - }); - return binding.getRoot(); - } - - @Override - public void onStart() { - super.onStart(); - if (DonationReminderDialog.isCallable(getContext())) { - showDonationReminderDialog(); - } - } - - @Override - public void onResume() { - super.onResume(); - if (!eipStatus.isDisconnected()) { - openVpnConnection.bindService(); - } - handleNewState(); - } - - @Override - public void onPause() { - super.onPause(); - openVpnConnection.unbindService(); - } - - @Override - public void onSaveInstanceState(@NonNull Bundle outState) { - super.onSaveInstanceState(outState); - if (showAskToStopEip) { - outState.putBoolean(KEY_SHOW_ASK_TO_STOP_EIP, true); - alertDialog.dismiss(); - } else if (showPendingStartCancellation) { - outState.putBoolean(KEY_SHOW_PENDING_START_CANCELLATION, true); - alertDialog.dismiss(); - } - } - - private void restoreFromSavedInstance(Bundle savedInstanceState) { - if (savedInstanceState != null && savedInstanceState.containsKey(KEY_SHOW_PENDING_START_CANCELLATION)) { - showPendingStartCancellation = true; - askPendingStartCancellation(); - } else if (savedInstanceState != null && savedInstanceState.containsKey(KEY_SHOW_ASK_TO_STOP_EIP)) { - showAskToStopEip = true; - askToStopEIP(); - } - } - - @Override - public void onDestroyView() { - super.onDestroyView(); - Activity activity = getActivity(); - if (activity != null) { - ((MainActivity) activity).setDefaultActivityBarColor(); - } - eipStatus.deleteObserver(this); - providerObservable.deleteObserver(this); - torStatusObservable.deleteObserver(this); - background = null; - mainButton = null; - locationButton = null; - mainDescription = null; - subDescription = null; - stateView = null; - } - - private void saveStatus(boolean restartOnBoot) { - preferences.edit().putBoolean(EIP_RESTART_ON_BOOT, restartOnBoot).apply(); - } - - void handleIcon() { - if (isOpenVpnRunningWithoutNetwork() || eipStatus.isConnected() || eipStatus.isConnecting() || eipStatus.isUpdatingVpnCert()) - handleSwitchOff(); - else - handleSwitchOn(); - } - - private void handleSwitchOn() { - Context context = getContext(); - if (context == null) { - Log.e(TAG, "context is null when switch turning on"); - return; - } - - if (canStartEIP()) { - startEipFromScratch(); - } else if (canLogInToStartEIP()) { - askUserToLogIn(getString(vpn_certificate_user_message)); - } else { - // provider has no VpnCertificate but user is logged in - updateInvalidVpnCertificate(); - } - } - - private boolean canStartEIP() { - boolean certificateExists = provider.hasVpnCertificate(); - boolean isAllowedAnon = provider.allowsAnonymous(); - return (isAllowedAnon || certificateExists) && !eipStatus.isConnected() && !eipStatus.isConnecting(); - } - - private boolean canLogInToStartEIP() { - boolean isAllowedRegistered = provider.allowsRegistered(); - boolean isLoggedIn = LeapSRPSession.loggedIn(); - return isAllowedRegistered && !isLoggedIn && !eipStatus.isConnecting() && !eipStatus.isConnected(); - } - - private void handleSwitchOff() { - if (isOpenVpnRunningWithoutNetwork() || eipStatus.isConnecting() || eipStatus.isUpdatingVpnCert()) { - askPendingStartCancellation(); - } else if (eipStatus.isConnected()) { - askToStopEIP(); - } - } - - private void setMainButtonEnabled(boolean enabled) { - locationButton.setEnabled(enabled); - mainButton.setEnabled(enabled); - } - - public void startEipFromScratch() { - saveStatus(true); - Context context = getContext(); - if (context == null) { - Log.e(TAG, "context is null when trying to start VPN"); - return; - } - if (!provider.getGeoipUrl().isDefault() && provider.shouldUpdateGeoIpJson()) { - Bundle bundle = new Bundle(); - bundle.putBoolean(EIP_ACTION_START, true); - bundle.putBoolean(EIP_EARLY_ROUTES, false); - ProviderAPICommand.execute(context, DOWNLOAD_GEOIP_JSON, bundle, provider); - } else { - EipCommand.startVPN(context, false); - } - EipStatus.getInstance().updateState("UI_CONNECTING", "", 0, ConnectionStatus.LEVEL_START); - } - - protected void stopEipIfPossible() { - Context context = getContext(); - if (context == null) { - Log.e(TAG, "context is null when trying to stop EIP"); - return; - } - EipCommand.stopVPN(context); - } - - private void askPendingStartCancellation() { - Activity activity = getActivity(); - if (activity == null) { - Log.e(TAG, "activity is null when asking to cancel"); - return; - } - - try { - AlertDialog.Builder alertBuilder = new AlertDialog.Builder(getActivity()); - showPendingStartCancellation = true; - alertDialog = alertBuilder.setTitle(activity.getString(R.string.eip_cancel_connect_title)) - .setMessage(activity.getString(R.string.eip_cancel_connect_text)) - .setPositiveButton((android.R.string.yes), (dialog, which) -> { - Context context = getContext(); - if (context != null && eipStatus.isUpdatingVpnCert() && - TorStatusObservable.isRunning()) { - TorServiceCommand.stopTorServiceAsync(context.getApplicationContext()); - } - stopEipIfPossible(); - }) - .setNegativeButton(activity.getString(android.R.string.no), (dialog, which) -> { - }).setOnDismissListener(dialog -> showPendingStartCancellation = false).show(); - } catch (IllegalStateException e) { - e.printStackTrace(); - } - - } - - protected void askToStopEIP() { - Activity activity = getActivity(); - if (activity == null) { - Log.e(TAG, "activity is null when asking to stop EIP"); - return; - } - try { - AlertDialog.Builder alertBuilder = new AlertDialog.Builder(activity); - showAskToStopEip = true; - alertDialog = alertBuilder.setTitle(activity.getString(R.string.eip_cancel_connect_title)) - .setMessage(activity.getString(R.string.eip_warning_browser_inconsistency)) - .setPositiveButton((android.R.string.yes), (dialog, which) -> stopEipIfPossible()) - .setNegativeButton(activity.getString(android.R.string.no), (dialog, which) -> { - }).setOnDismissListener(dialog -> showAskToStopEip = false).show(); - } catch (IllegalStateException e) { - e.printStackTrace(); - } - - } - - @Override - public void update(Observable observable, Object data) { - if (observable instanceof EipStatus) { - eipStatus = (EipStatus) observable; - handleNewStateOnMain(); - - if (eipStatus.isConnecting()) { - openVpnConnection.bindService(); - } - if ("NOPROCESS".equals(EipStatus.getInstance().getState())) { - //assure that the Service is shutdown completely if openvpn was stopped - openVpnConnection.unbindService(); - } - } else if (observable instanceof ProviderObservable) { - provider = ((ProviderObservable) observable).getCurrentProvider(); - } else if (observable instanceof TorStatusObservable && EipStatus.getInstance().isUpdatingVpnCert()) { - handleNewStateOnMain(); - } - } - - private void handleNewStateOnMain() { - Activity activity = getActivity(); - if (activity != null) { - activity.runOnUiThread(this::handleNewState); - } else { - Log.e("EipFragment", "activity is null"); - } - } - - private void setActivityBarColor(@ColorRes int primaryColor, @ColorRes int secondaryColor) { - Activity activity = getActivity(); - if (activity == null) { - return; - } - ((MainActivity) getActivity()).setActivityBarColor(primaryColor, secondaryColor, R.color.actionbar_dark_color); - } - - private void handleNewState() { - Activity activity = getActivity(); - if (activity == null) { - Log.e(TAG, "activity is null while trying to handle new state"); - return; - } - - Log.d(TAG, "eip fragment eipStatus state: " + eipStatus.getState() + " - level: " + eipStatus.getLevel() + " - is reconnecting: " + eipStatus.isReconnecting()); - if (eipStatus.isUpdatingVpnCert()) { - setMainButtonEnabled(true); - String city = getPreferredCity(getContext()); - String locationName = VpnStatus.getCurrentlyConnectingVpnName() != null ? - VpnStatus.getCurrentlyConnectingVpnName() : - city == null ? getString(R.string.gateway_selection_recommended_location) : city; - locationButton.setText(locationName); - locationButton.setLocationLoad(UNKNOWN); - locationButton.showBridgeIndicator(false); - locationButton.showRecommendedIndicator(false); - mainDescription.setText(R.string.eip_status_connecting); - String torStatus = TorStatusObservable.getStringForCurrentStatus(getContext()); - if (!TextUtils.isEmpty(torStatus)) { - Spannable spannable = new SpannableString(torStatus); - spannable.setSpan(new RelativeSizeSpan(0.75f), 0, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); - subDescription.setText(TextUtils.concat(getString(R.string.updating_certificate_message) + "\n", spannable)); - } else { - subDescription.setText(getString(R.string.updating_certificate_message)); - } - background.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.bg_connecting)); - stateView.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.yellow_mask)); - mainButton.updateState(false, true, false); - setActivityBarColor(R.color.bg_connecting_top, R.color.bg_connecting_top_light_transparent); - } else if (eipStatus.isConnecting()) { - setMainButtonEnabled(true); - String city = getPreferredCity(getContext()); - String locationName = VpnStatus.getCurrentlyConnectingVpnName() != null ? - VpnStatus.getCurrentlyConnectingVpnName() : - city == null ? getString(R.string.gateway_selection_recommended_location) : city; - locationButton.setText(locationName); - locationButton.setLocationLoad(UNKNOWN); - locationButton.showBridgeIndicator(false); - locationButton.showRecommendedIndicator(false); - mainDescription.setText(R.string.eip_status_connecting); - subDescription.setText(null); - background.setImageDrawable(ContextCompat.getDrawable(activity, R.drawable.bg_connecting)); - stateView.setImageDrawable(ContextCompat.getDrawable(activity, R.drawable.yellow_mask)); - mainButton.updateState(false, true, false); - setActivityBarColor(R.color.bg_connecting_top, R.color.bg_connecting_top_light_transparent); - } else if (eipStatus.isConnected()) { - setMainButtonEnabled(true); - mainButton.updateState(true, false, false); - Connection.TransportType transportType = PreferenceHelper.getUseBridges(getContext()) ? Connection.TransportType.OBFS4 : Connection.TransportType.OPENVPN; - locationButton.setLocationLoad(PreferenceHelper.useObfuscationPinning(getContext()) ? GatewaysManager.Load.UNKNOWN : gatewaysManager.getLoadForLocation(VpnStatus.getLastConnectedVpnName(), transportType)); - locationButton.setText(VpnStatus.getLastConnectedVpnName()); - locationButton.showBridgeIndicator(VpnStatus.isUsingBridges()); - locationButton.showRecommendedIndicator(getPreferredCity(getContext()) == null); - mainDescription.setText(R.string.eip_status_secured); - subDescription.setText(null); - background.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.bg_connected)); - stateView.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.green_mask)); - setActivityBarColor(R.color.bg_running_top, R.color.bg_running_top_light_transparent); - } else if(isOpenVpnRunningWithoutNetwork()) { - Log.d(TAG, "eip fragment eipStatus - isOpenVpnRunningWithoutNetwork"); - setMainButtonEnabled(true); - mainButton.updateState(true, false, true); - locationButton.setText(VpnStatus.getCurrentlyConnectingVpnName()); - locationButton.showBridgeIndicator(VpnStatus.isUsingBridges()); - locationButton.showBridgeIndicator(VpnStatus.isUsingBridges()); - locationButton.showRecommendedIndicator(getPreferredCity(getContext())== null); - mainDescription.setText(R.string.eip_state_connected); - subDescription.setText(R.string.eip_state_no_network); - background.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.bg_connecting)); - stateView.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.yellow_mask)); - setActivityBarColor(R.color.bg_connecting_top, R.color.bg_connecting_top_light_transparent); - } else if (eipStatus.isDisconnected() && reconnectingWithDifferentGateway()) { - locationButton.setText(VpnStatus.getCurrentlyConnectingVpnName()); - locationButton.setLocationLoad(UNKNOWN); - locationButton.showBridgeIndicator(false); - locationButton.showRecommendedIndicator(false); - mainDescription.setText(R.string.eip_status_connecting); - subDescription.setText(R.string.reconnecting); - background.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.bg_connecting)); - stateView.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.yellow_mask)); - setActivityBarColor(R.color.bg_connecting_top, R.color.bg_connecting_top_light_transparent); - - } else if (eipStatus.isDisconnecting()) { - setMainButtonEnabled(false); - background.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.bg_disconnected)); - stateView.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.red_mask)); - mainButton.updateState(false, false, false); - mainDescription.setText(R.string.eip_status_unsecured); - setActivityBarColor(R.color.bg_disconnected_top, R.color.bg_disconnected_top_light_transparent); - } else if (eipStatus.isBlocking()) { - setMainButtonEnabled(true); - mainButton.updateState(true, false, true); - locationButton.setText(getString(R.string.no_location)); - locationButton.setLocationLoad(UNKNOWN); - locationButton.showBridgeIndicator(false); - locationButton.showRecommendedIndicator(false); - mainDescription.setText(R.string.eip_state_connected); - subDescription.setText(getString(R.string.eip_state_blocking, getString(R.string.app_name))); - background.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.bg_disconnected)); - stateView.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.red_mask)); - setActivityBarColor(R.color.bg_disconnected_top, R.color.bg_disconnected_top_light_transparent); - } else { - locationButton.setText(getContext().getString(R.string.vpn_button_turn_on)); - setMainButtonEnabled(true); - mainButton.updateState(false, false, false); - locationButton.setLocationLoad(UNKNOWN); - locationButton.showBridgeIndicator(false); - String city = getPreferredCity(getContext()); - locationButton.setText(city == null ? getString(R.string.gateway_selection_recommended_location) : city); - locationButton.showRecommendedIndicator(false); - mainDescription.setText(R.string.eip_status_unsecured); - subDescription.setText(null); - background.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.bg_disconnected)); - stateView.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.red_mask)); - setActivityBarColor(R.color.bg_disconnected_top, R.color.bg_disconnected_top_light_transparent); - } - } - - private boolean isOpenVpnRunningWithoutNetwork() { - boolean isRunning = false; - try { - isRunning = eipStatus.getLevel() == LEVEL_NONETWORK && - mService.isVpnRunning(); - } catch (Exception e) { - //eat me - e.printStackTrace(); - } - - return isRunning; - } - - private void updateInvalidVpnCertificate() { - eipStatus.setUpdatingVpnCert(true); - ProviderAPICommand.execute(getContext(), UPDATE_INVALID_VPN_CERTIFICATE, provider); - } - - private void askUserToLogIn(String userMessage) { - Intent intent = new Intent(getContext(), LoginActivity.class); - intent.putExtra(PROVIDER_KEY, provider); - - if(userMessage != null) { - intent.putExtra(USER_MESSAGE, userMessage); - } - - Activity activity = getActivity(); - if (activity != null) { - activity.startActivityForResult(intent, REQUEST_CODE_LOG_IN); - } - } - - private class EipFragmentServiceConnection implements ServiceConnection { - private final AtomicBoolean bind = new AtomicBoolean(false); - - void bindService() { - Activity activity = getActivity(); - if (activity == null) { - Log.e(TAG, "activity is null when binding OpenVpn"); - return; - } - if (!bind.get()) { - activity.runOnUiThread(() -> { - Intent intent = new Intent(activity, OpenVPNService.class); - intent.setAction(OpenVPNService.START_SERVICE); - - activity.bindService(intent, EipFragmentServiceConnection.this, Context.BIND_AUTO_CREATE); - bind.set(true); - }); - } - } - - void unbindService() { - Activity activity = getActivity(); - if (activity == null) { - return; - } - if (bind.get()) { - activity.runOnUiThread(() -> { - activity.unbindService(EipFragmentServiceConnection.this); - bind.set(false); - }); - } - } - - @Override - public void onServiceConnected(ComponentName className, - IBinder service) { - mService = IOpenVPNServiceInternal.Stub.asInterface(service); - handleNewState(); - } - - @Override - public void onServiceDisconnected(ComponentName arg0) { - mService = null; - } - } - - public void showDonationReminderDialog() { - try { - FragmentTransaction fragmentTransaction = new FragmentManagerEnhanced( - getActivity().getSupportFragmentManager()).removePreviousFragment( - DonationReminderDialog.TAG); - DialogFragment newFragment = new DonationReminderDialog(); - newFragment.setCancelable(false); - newFragment.show(fragmentTransaction, DonationReminderDialog.TAG); - } catch (IllegalStateException | NullPointerException e) { - e.printStackTrace(); - } - } -} diff --git a/app/src/normal/java/se/leap/bitmaskclient/base/views/MainButton.java b/app/src/normal/java/se/leap/bitmaskclient/base/views/MainButton.java deleted file mode 100644 index 715063b5..00000000 --- a/app/src/normal/java/se/leap/bitmaskclient/base/views/MainButton.java +++ /dev/null @@ -1,57 +0,0 @@ -package se.leap.bitmaskclient.base.views; - -import android.annotation.TargetApi; -import android.content.Context; -import android.util.AttributeSet; -import android.view.LayoutInflater; -import android.widget.RelativeLayout; - -import androidx.appcompat.widget.AppCompatImageView; -import androidx.core.content.ContextCompat; - -import se.leap.bitmaskclient.R; -import se.leap.bitmaskclient.databinding.VMainButtonBinding; - -public class MainButton extends RelativeLayout { - - private static final String TAG = MainButton.class.getSimpleName(); - - AppCompatImageView button; - - public MainButton(Context context) { - super(context); - initLayout(context); - } - - public MainButton(Context context, AttributeSet attrs) { - super(context, attrs); - initLayout(context); - } - - public MainButton(Context context, AttributeSet attrs, int defStyleAttr) { - super(context, attrs, defStyleAttr); - initLayout(context); - } - - - @TargetApi(21) - public MainButton(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { - super(context, attrs, defStyleAttr, defStyleRes); - initLayout(context); - } - - private void initLayout(Context context) { - VMainButtonBinding binding = VMainButtonBinding.inflate(LayoutInflater.from(context), this, true); - button = binding.button; - } - - public void updateState(boolean isOn, boolean isProcessing, boolean isError) { - if (isProcessing) { - button.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.button_circle_cancel)); - } else { - button.setImageDrawable( - ContextCompat.getDrawable(getContext(), - isOn ? R.drawable.button_circle_stop : R.drawable.button_circle_start)); - } - } -} diff --git a/app/src/normal/res/drawable-hdpi/bg_connected.png b/app/src/normal/res/drawable-hdpi/bg_connected.png new file mode 100644 index 00000000..0e98f705 Binary files /dev/null and b/app/src/normal/res/drawable-hdpi/bg_connected.png differ diff --git a/app/src/normal/res/drawable-hdpi/bg_connecting.png b/app/src/normal/res/drawable-hdpi/bg_connecting.png new file mode 100644 index 00000000..24632712 Binary files /dev/null and b/app/src/normal/res/drawable-hdpi/bg_connecting.png differ diff --git a/app/src/normal/res/drawable-hdpi/bg_disconnected.png b/app/src/normal/res/drawable-hdpi/bg_disconnected.png new file mode 100644 index 00000000..de96be57 Binary files /dev/null and b/app/src/normal/res/drawable-hdpi/bg_disconnected.png differ diff --git a/app/src/normal/res/drawable-hdpi/ic_splash_background.png b/app/src/normal/res/drawable-hdpi/ic_splash_background.png deleted file mode 100644 index 3e5f7871..00000000 Binary files a/app/src/normal/res/drawable-hdpi/ic_splash_background.png and /dev/null differ diff --git a/app/src/normal/res/drawable-hdpi/state_connected.png b/app/src/normal/res/drawable-hdpi/state_connected.png new file mode 100644 index 00000000..fccc060a Binary files /dev/null and b/app/src/normal/res/drawable-hdpi/state_connected.png differ diff --git a/app/src/normal/res/drawable-hdpi/state_connecting.png b/app/src/normal/res/drawable-hdpi/state_connecting.png new file mode 100644 index 00000000..72e3ae45 Binary files /dev/null and b/app/src/normal/res/drawable-hdpi/state_connecting.png differ diff --git a/app/src/normal/res/drawable-hdpi/state_disconnected.png b/app/src/normal/res/drawable-hdpi/state_disconnected.png new file mode 100644 index 00000000..d2ef7d99 Binary files /dev/null and b/app/src/normal/res/drawable-hdpi/state_disconnected.png differ diff --git a/app/src/normal/res/drawable-xhdpi/bg_connected.png b/app/src/normal/res/drawable-xhdpi/bg_connected.png new file mode 100644 index 00000000..915dff95 Binary files /dev/null and b/app/src/normal/res/drawable-xhdpi/bg_connected.png differ diff --git a/app/src/normal/res/drawable-xhdpi/bg_connecting.png b/app/src/normal/res/drawable-xhdpi/bg_connecting.png new file mode 100644 index 00000000..be4469df Binary files /dev/null and b/app/src/normal/res/drawable-xhdpi/bg_connecting.png differ diff --git a/app/src/normal/res/drawable-xhdpi/bg_disconnected.png b/app/src/normal/res/drawable-xhdpi/bg_disconnected.png new file mode 100644 index 00000000..433c776f Binary files /dev/null and b/app/src/normal/res/drawable-xhdpi/bg_disconnected.png differ diff --git a/app/src/normal/res/drawable-xhdpi/ic_splash_background.png b/app/src/normal/res/drawable-xhdpi/ic_splash_background.png deleted file mode 100644 index c2135c04..00000000 Binary files a/app/src/normal/res/drawable-xhdpi/ic_splash_background.png and /dev/null differ diff --git a/app/src/normal/res/drawable-xhdpi/state_connected.png b/app/src/normal/res/drawable-xhdpi/state_connected.png new file mode 100644 index 00000000..c852459d Binary files /dev/null and b/app/src/normal/res/drawable-xhdpi/state_connected.png differ diff --git a/app/src/normal/res/drawable-xhdpi/state_connecting.png b/app/src/normal/res/drawable-xhdpi/state_connecting.png new file mode 100644 index 00000000..d81190fe Binary files /dev/null and b/app/src/normal/res/drawable-xhdpi/state_connecting.png differ diff --git a/app/src/normal/res/drawable-xhdpi/state_disconnected.png b/app/src/normal/res/drawable-xhdpi/state_disconnected.png new file mode 100644 index 00000000..c0d57a03 Binary files /dev/null and b/app/src/normal/res/drawable-xhdpi/state_disconnected.png differ diff --git a/app/src/normal/res/drawable-xxhdpi/bg_connected.png b/app/src/normal/res/drawable-xxhdpi/bg_connected.png new file mode 100644 index 00000000..cd78d865 Binary files /dev/null and b/app/src/normal/res/drawable-xxhdpi/bg_connected.png differ diff --git a/app/src/normal/res/drawable-xxhdpi/bg_connecting.png b/app/src/normal/res/drawable-xxhdpi/bg_connecting.png new file mode 100644 index 00000000..718e102f Binary files /dev/null and b/app/src/normal/res/drawable-xxhdpi/bg_connecting.png differ diff --git a/app/src/normal/res/drawable-xxhdpi/bg_disconnected.png b/app/src/normal/res/drawable-xxhdpi/bg_disconnected.png new file mode 100644 index 00000000..ffbcdb79 Binary files /dev/null and b/app/src/normal/res/drawable-xxhdpi/bg_disconnected.png differ diff --git a/app/src/normal/res/drawable-xxhdpi/state_connected.png b/app/src/normal/res/drawable-xxhdpi/state_connected.png new file mode 100644 index 00000000..32286177 Binary files /dev/null and b/app/src/normal/res/drawable-xxhdpi/state_connected.png differ diff --git a/app/src/normal/res/drawable-xxhdpi/state_connecting.png b/app/src/normal/res/drawable-xxhdpi/state_connecting.png new file mode 100644 index 00000000..75cf3782 Binary files /dev/null and b/app/src/normal/res/drawable-xxhdpi/state_connecting.png differ diff --git a/app/src/normal/res/drawable-xxhdpi/state_disconnected.png b/app/src/normal/res/drawable-xxhdpi/state_disconnected.png new file mode 100644 index 00000000..ac560317 Binary files /dev/null and b/app/src/normal/res/drawable-xxhdpi/state_disconnected.png differ diff --git a/app/src/normal/res/drawable-xxxhdpi/bg_connected.png b/app/src/normal/res/drawable-xxxhdpi/bg_connected.png new file mode 100644 index 00000000..3c9d97b4 Binary files /dev/null and b/app/src/normal/res/drawable-xxxhdpi/bg_connected.png differ diff --git a/app/src/normal/res/drawable-xxxhdpi/bg_connecting.png b/app/src/normal/res/drawable-xxxhdpi/bg_connecting.png new file mode 100644 index 00000000..bff2004c Binary files /dev/null and b/app/src/normal/res/drawable-xxxhdpi/bg_connecting.png differ diff --git a/app/src/normal/res/drawable-xxxhdpi/bg_disconnected.png b/app/src/normal/res/drawable-xxxhdpi/bg_disconnected.png new file mode 100644 index 00000000..2503f135 Binary files /dev/null and b/app/src/normal/res/drawable-xxxhdpi/bg_disconnected.png differ diff --git a/app/src/normal/res/drawable-xxxhdpi/ic_splash_background.png b/app/src/normal/res/drawable-xxxhdpi/ic_splash_background.png deleted file mode 100644 index 1b8046fa..00000000 Binary files a/app/src/normal/res/drawable-xxxhdpi/ic_splash_background.png and /dev/null differ diff --git a/app/src/normal/res/drawable-xxxhdpi/state_connected.png b/app/src/normal/res/drawable-xxxhdpi/state_connected.png new file mode 100644 index 00000000..f5a5adaf Binary files /dev/null and b/app/src/normal/res/drawable-xxxhdpi/state_connected.png differ diff --git a/app/src/normal/res/drawable-xxxhdpi/state_connecting.png b/app/src/normal/res/drawable-xxxhdpi/state_connecting.png new file mode 100644 index 00000000..806dcbf4 Binary files /dev/null and b/app/src/normal/res/drawable-xxxhdpi/state_connecting.png differ diff --git a/app/src/normal/res/drawable-xxxhdpi/state_disconnected.png b/app/src/normal/res/drawable-xxxhdpi/state_disconnected.png new file mode 100644 index 00000000..9e216955 Binary files /dev/null and b/app/src/normal/res/drawable-xxxhdpi/state_disconnected.png differ diff --git a/app/src/normal/res/drawable/bg_connected.png b/app/src/normal/res/drawable/bg_connected.png new file mode 100644 index 00000000..6da7878d Binary files /dev/null and b/app/src/normal/res/drawable/bg_connected.png differ diff --git a/app/src/normal/res/drawable/bg_connecting.png b/app/src/normal/res/drawable/bg_connecting.png new file mode 100644 index 00000000..c371f3f0 Binary files /dev/null and b/app/src/normal/res/drawable/bg_connecting.png differ diff --git a/app/src/normal/res/drawable/bg_disconnected.png b/app/src/normal/res/drawable/bg_disconnected.png new file mode 100644 index 00000000..de96be57 Binary files /dev/null and b/app/src/normal/res/drawable/bg_disconnected.png differ diff --git a/app/src/normal/res/drawable/ic_splash_background.xml b/app/src/normal/res/drawable/ic_splash_background.xml new file mode 100644 index 00000000..aa2618c1 --- /dev/null +++ b/app/src/normal/res/drawable/ic_splash_background.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/app/src/normal/res/drawable/state_connected.png b/app/src/normal/res/drawable/state_connected.png new file mode 100644 index 00000000..e515f3f5 Binary files /dev/null and b/app/src/normal/res/drawable/state_connected.png differ diff --git a/app/src/normal/res/drawable/state_connecting.png b/app/src/normal/res/drawable/state_connecting.png new file mode 100644 index 00000000..98dd7978 Binary files /dev/null and b/app/src/normal/res/drawable/state_connecting.png differ diff --git a/app/src/normal/res/drawable/state_disconnected.png b/app/src/normal/res/drawable/state_disconnected.png new file mode 100644 index 00000000..a4bd4a78 Binary files /dev/null and b/app/src/normal/res/drawable/state_disconnected.png differ diff --git a/app/src/normal/res/layout-port/f_eip.xml b/app/src/normal/res/layout-port/f_eip.xml deleted file mode 100644 index eed5fde6..00000000 --- a/app/src/normal/res/layout-port/f_eip.xml +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/normal/res/layout-xlarge-port/f_eip.xml b/app/src/normal/res/layout-xlarge-port/f_eip.xml deleted file mode 100644 index ae548c82..00000000 --- a/app/src/normal/res/layout-xlarge-port/f_eip.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/normal/res/layout-xlarge/f_eip.xml b/app/src/normal/res/layout-xlarge/f_eip.xml deleted file mode 100644 index a4d94394..00000000 --- a/app/src/normal/res/layout-xlarge/f_eip.xml +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/normal/res/layout/f_eip.xml b/app/src/normal/res/layout/f_eip.xml deleted file mode 100644 index 9c921721..00000000 --- a/app/src/normal/res/layout/f_eip.xml +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/normal/res/layout/v_location_button.xml b/app/src/normal/res/layout/v_location_button.xml deleted file mode 100644 index 8aaf4978..00000000 --- a/app/src/normal/res/layout/v_location_button.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/normal/res/layout/v_main_button.xml b/app/src/normal/res/layout/v_main_button.xml deleted file mode 100644 index e3f96693..00000000 --- a/app/src/normal/res/layout/v_main_button.xml +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file -- cgit v1.2.3 From 33bae6bada5aadc3ab3919fa04233d2d916e5721 Mon Sep 17 00:00:00 2001 From: cyberta Date: Fri, 2 Dec 2022 02:18:48 +0100 Subject: implement connecting animation for riseup --- app/src/custom/res/animator/alpha1.xml | 11 +++++ app/src/custom/res/animator/alpha2.xml | 16 ++++--- app/src/custom/res/animator/alpha3.xml | 11 ++++- app/src/custom/res/drawable/ravens.xml | 6 +++ app/src/custom/res/drawable/state_connecting.xml | 17 +++++-- .../bitmaskclient/base/fragments/EipFragment.java | 54 ++++++++++++++-------- 6 files changed, 85 insertions(+), 30 deletions(-) create mode 100644 app/src/custom/res/animator/alpha1.xml (limited to 'app') diff --git a/app/src/custom/res/animator/alpha1.xml b/app/src/custom/res/animator/alpha1.xml new file mode 100644 index 00000000..94192a0b --- /dev/null +++ b/app/src/custom/res/animator/alpha1.xml @@ -0,0 +1,11 @@ + + + + + diff --git a/app/src/custom/res/animator/alpha2.xml b/app/src/custom/res/animator/alpha2.xml index bf997dea..b66ef59c 100644 --- a/app/src/custom/res/animator/alpha2.xml +++ b/app/src/custom/res/animator/alpha2.xml @@ -1,10 +1,12 @@ - \ No newline at end of file + android:duration="1000" + android:propertyName="fillColor" + android:valueFrom="#00000000" + android:valueTo="#000000" + android:startOffset="1000" + android:valueType="colorType" + /> + + diff --git a/app/src/custom/res/animator/alpha3.xml b/app/src/custom/res/animator/alpha3.xml index d05f36c2..2a1e0ba4 100644 --- a/app/src/custom/res/animator/alpha3.xml +++ b/app/src/custom/res/animator/alpha3.xml @@ -1,4 +1,11 @@ - - \ No newline at end of file + + diff --git a/app/src/custom/res/drawable/ravens.xml b/app/src/custom/res/drawable/ravens.xml index f97a3532..788aef84 100644 --- a/app/src/custom/res/drawable/ravens.xml +++ b/app/src/custom/res/drawable/ravens.xml @@ -4,29 +4,35 @@ android:width="342dp" android:height="206dp"> diff --git a/app/src/custom/res/drawable/state_connecting.xml b/app/src/custom/res/drawable/state_connecting.xml index 3ef89983..267ba791 100644 --- a/app/src/custom/res/drawable/state_connecting.xml +++ b/app/src/custom/res/drawable/state_connecting.xml @@ -1,4 +1,15 @@ - - - \ No newline at end of file + + + + + + \ No newline at end of file diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java index 0210077c..81a9f9eb 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java @@ -41,6 +41,7 @@ import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; import android.content.SharedPreferences; +import android.graphics.drawable.Animatable; import android.os.Bundle; import android.os.IBinder; import android.text.Spannable; @@ -53,11 +54,11 @@ import android.view.View; import android.view.ViewGroup; import androidx.annotation.ColorRes; +import androidx.annotation.DrawableRes; import androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.widget.AppCompatImageView; import androidx.appcompat.widget.AppCompatTextView; -import androidx.core.content.ContextCompat; import androidx.fragment.app.DialogFragment; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentTransaction; @@ -468,8 +469,8 @@ public class EipFragment extends Fragment implements Observer { } else { subDescription.setText(getString(R.string.updating_certificate_message)); } - background.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.bg_connecting)); - stateView.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.yellow_mask)); + background.setImageResource(R.drawable.bg_connecting); + animateState(R.drawable.state_connecting); mainButton.updateState(false, true, false); setActivityBarColor(R.color.bg_connecting_top, R.color.bg_connecting_top_light_transparent); } else if (eipStatus.isConnecting()) { @@ -484,8 +485,8 @@ public class EipFragment extends Fragment implements Observer { locationButton.showRecommendedIndicator(false); mainDescription.setText(R.string.eip_status_connecting); subDescription.setText(null); - background.setImageDrawable(ContextCompat.getDrawable(activity, R.drawable.bg_connecting)); - stateView.setImageDrawable(ContextCompat.getDrawable(activity, R.drawable.yellow_mask)); + background.setImageResource(R.drawable.bg_connecting); + animateState(R.drawable.state_connecting); mainButton.updateState(false, true, false); setActivityBarColor(R.color.bg_connecting_top, R.color.bg_connecting_top_light_transparent); } else if (eipStatus.isConnected()) { @@ -498,8 +499,8 @@ public class EipFragment extends Fragment implements Observer { locationButton.showRecommendedIndicator(getPreferredCity(getContext()) == null); mainDescription.setText(R.string.eip_status_secured); subDescription.setText(null); - background.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.bg_connected)); - stateView.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.green_mask)); + background.setImageResource(R.drawable.bg_connected); + animateState(R.drawable.state_connected); setActivityBarColor(R.color.bg_running_top, R.color.bg_running_top_light_transparent); } else if(isOpenVpnRunningWithoutNetwork()) { Log.d(TAG, "eip fragment eipStatus - isOpenVpnRunningWithoutNetwork"); @@ -511,8 +512,8 @@ public class EipFragment extends Fragment implements Observer { locationButton.showRecommendedIndicator(getPreferredCity(getContext())== null); mainDescription.setText(R.string.eip_state_connected); subDescription.setText(R.string.eip_state_no_network); - background.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.bg_connecting)); - stateView.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.yellow_mask)); + background.setImageResource(R.drawable.bg_connecting); + animateState(R.drawable.state_connecting); setActivityBarColor(R.color.bg_connecting_top, R.color.bg_connecting_top_light_transparent); } else if (eipStatus.isDisconnected() && reconnectingWithDifferentGateway()) { locationButton.setText(VpnStatus.getCurrentlyConnectingVpnName()); @@ -521,16 +522,15 @@ public class EipFragment extends Fragment implements Observer { locationButton.showRecommendedIndicator(false); mainDescription.setText(R.string.eip_status_connecting); subDescription.setText(R.string.reconnecting); - background.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.bg_connecting)); - stateView.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.yellow_mask)); + background.setImageResource(R.drawable.bg_connecting); + animateState(R.drawable.state_connecting); setActivityBarColor(R.color.bg_connecting_top, R.color.bg_connecting_top_light_transparent); - } else if (eipStatus.isDisconnecting()) { setMainButtonEnabled(false); - background.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.bg_disconnected)); - stateView.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.red_mask)); mainButton.updateState(false, false, false); mainDescription.setText(R.string.eip_status_unsecured); + background.setImageResource(R.drawable.bg_disconnected); + animateState(R.drawable.state_disconnected); setActivityBarColor(R.color.bg_disconnected_top, R.color.bg_disconnected_top_light_transparent); } else if (eipStatus.isBlocking()) { setMainButtonEnabled(true); @@ -541,8 +541,8 @@ public class EipFragment extends Fragment implements Observer { locationButton.showRecommendedIndicator(false); mainDescription.setText(R.string.eip_state_connected); subDescription.setText(getString(R.string.eip_state_blocking, getString(R.string.app_name))); - background.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.bg_disconnected)); - stateView.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.red_mask)); + background.setImageResource(R.drawable.bg_disconnected); + animateState(R.drawable.state_disconnected); setActivityBarColor(R.color.bg_disconnected_top, R.color.bg_disconnected_top_light_transparent); } else { locationButton.setText(getContext().getString(R.string.vpn_button_turn_on)); @@ -555,12 +555,30 @@ public class EipFragment extends Fragment implements Observer { locationButton.showRecommendedIndicator(false); mainDescription.setText(R.string.eip_status_unsecured); subDescription.setText(null); - background.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.bg_disconnected)); - stateView.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.red_mask)); + background.setImageResource(R.drawable.bg_disconnected); + animateState(R.drawable.state_disconnected); setActivityBarColor(R.color.bg_disconnected_top, R.color.bg_disconnected_top_light_transparent); } } + private void animateState(@DrawableRes int drawableRes) { + try { + int lastDrawableId = (int) stateView.getTag(); + if (lastDrawableId == drawableRes) { + return; + } + } catch (NullPointerException | ClassCastException e) { + // eat me + } + + stateView.setImageResource(drawableRes); + stateView.setTag(drawableRes); + if (stateView.getDrawable() instanceof Animatable) { + Animatable animatedDrawable = (Animatable) stateView.getDrawable(); + animatedDrawable.start(); + } + } + private boolean isOpenVpnRunningWithoutNetwork() { boolean isRunning = false; try { -- cgit v1.2.3 From 9ec59148a926a5c8e5fecfbb64b6418d1dbb852d Mon Sep 17 00:00:00 2001 From: cyberta Date: Fri, 2 Dec 2022 15:37:59 +0100 Subject: implement transition animation between connected and disconnected state for RiseupVPn --- .../state_transition_connceted_disconnected.xml | 4 + app/src/custom/res/drawable/state_connected.xml | 30 ++++--- app/src/custom/res/drawable/state_disconnected.xml | 22 +++-- .../state_transition_connected_disconnected.xml | 89 +++++++++++++++++++++ .../bitmaskclient/base/fragments/EipFragment.java | 31 ++++++- app/src/main/res/layout/v_main_btn.xml | 55 ------------- .../state_transition_connected_disconnected.png | Bin 0 -> 40172 bytes 7 files changed, 158 insertions(+), 73 deletions(-) create mode 100644 app/src/custom/res/animator/state_transition_connceted_disconnected.xml create mode 100644 app/src/custom/res/drawable/state_transition_connected_disconnected.xml delete mode 100644 app/src/main/res/layout/v_main_btn.xml create mode 100644 app/src/normal/res/drawable/state_transition_connected_disconnected.png (limited to 'app') diff --git a/app/src/custom/res/animator/state_transition_connceted_disconnected.xml b/app/src/custom/res/animator/state_transition_connceted_disconnected.xml new file mode 100644 index 00000000..751d2da5 --- /dev/null +++ b/app/src/custom/res/animator/state_transition_connceted_disconnected.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/app/src/custom/res/drawable/state_connected.xml b/app/src/custom/res/drawable/state_connected.xml index c9854d69..e0a9005f 100644 --- a/app/src/custom/res/drawable/state_connected.xml +++ b/app/src/custom/res/drawable/state_connected.xml @@ -3,13 +3,25 @@ android:viewportHeight="220" android:width="166dp" android:height="220dp"> - - - + + + + + + + + \ No newline at end of file diff --git a/app/src/custom/res/drawable/state_disconnected.xml b/app/src/custom/res/drawable/state_disconnected.xml index 3d3660b8..7c49a537 100644 --- a/app/src/custom/res/drawable/state_disconnected.xml +++ b/app/src/custom/res/drawable/state_disconnected.xml @@ -1,9 +1,17 @@ - + android:viewportWidth="166" + android:viewportHeight="220" + android:width="166dp" + android:height="220dp"> + + + + \ No newline at end of file diff --git a/app/src/custom/res/drawable/state_transition_connected_disconnected.xml b/app/src/custom/res/drawable/state_transition_connected_disconnected.xml new file mode 100644 index 00000000..0496e729 --- /dev/null +++ b/app/src/custom/res/drawable/state_transition_connected_disconnected.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java index 81a9f9eb..470470ac 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java @@ -42,6 +42,8 @@ import android.content.Intent; import android.content.ServiceConnection; import android.content.SharedPreferences; import android.graphics.drawable.Animatable; +import android.graphics.drawable.Animatable2; +import android.graphics.drawable.Drawable; import android.os.Bundle; import android.os.IBinder; import android.text.Spannable; @@ -59,9 +61,13 @@ import androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.widget.AppCompatImageView; import androidx.appcompat.widget.AppCompatTextView; +import androidx.core.content.ContextCompat; import androidx.fragment.app.DialogFragment; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentTransaction; +import androidx.vectordrawable.graphics.drawable.Animatable2Compat; +import androidx.vectordrawable.graphics.drawable.Animatable2Compat.AnimationCallback; +import androidx.vectordrawable.graphics.drawable.AnimatedVectorDrawableCompat; import java.util.Observable; import java.util.Observer; @@ -111,6 +117,7 @@ public class EipFragment extends Fragment implements Observer { private ProviderObservable providerObservable; private TorStatusObservable torStatusObservable; + private @DrawableRes int pendingAnimationState; private GatewaysManager gatewaysManager; //---saved Instance ------- @@ -530,7 +537,7 @@ public class EipFragment extends Fragment implements Observer { mainButton.updateState(false, false, false); mainDescription.setText(R.string.eip_status_unsecured); background.setImageResource(R.drawable.bg_disconnected); - animateState(R.drawable.state_disconnected); + animateState(R.drawable.state_transition_connected_disconnected); setActivityBarColor(R.color.bg_disconnected_top, R.color.bg_disconnected_top_light_transparent); } else if (eipStatus.isBlocking()) { setMainButtonEnabled(true); @@ -556,25 +563,45 @@ public class EipFragment extends Fragment implements Observer { mainDescription.setText(R.string.eip_status_unsecured); subDescription.setText(null); background.setImageResource(R.drawable.bg_disconnected); + animateState(R.drawable.state_disconnected); setActivityBarColor(R.color.bg_disconnected_top, R.color.bg_disconnected_top_light_transparent); } } private void animateState(@DrawableRes int drawableRes) { + @DrawableRes int lastDrawableId; try { - int lastDrawableId = (int) stateView.getTag(); + lastDrawableId = (int) stateView.getTag(); if (lastDrawableId == drawableRes) { return; } + + Drawable lastDrawable = ContextCompat.getDrawable(getContext(), lastDrawableId); + if (lastDrawable instanceof Animatable && ((Animatable) lastDrawable).isRunning()) { + pendingAnimationState = drawableRes; + } + } catch (NullPointerException | ClassCastException e) { // eat me } + stateView.setImageResource(drawableRes); stateView.setTag(drawableRes); if (stateView.getDrawable() instanceof Animatable) { Animatable animatedDrawable = (Animatable) stateView.getDrawable(); + AnimatedVectorDrawableCompat.registerAnimationCallback(stateView.getDrawable(), new AnimationCallback() { + @Override + public void onAnimationEnd(Drawable drawable) { + super.onAnimationEnd(drawable); + if (pendingAnimationState != 0) { + int newAnimationRes = pendingAnimationState; + pendingAnimationState = 0; + animateState(newAnimationRes); + } + } + }); animatedDrawable.start(); } } diff --git a/app/src/main/res/layout/v_main_btn.xml b/app/src/main/res/layout/v_main_btn.xml deleted file mode 100644 index 3ab62e5a..00000000 --- a/app/src/main/res/layout/v_main_btn.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/normal/res/drawable/state_transition_connected_disconnected.png b/app/src/normal/res/drawable/state_transition_connected_disconnected.png new file mode 100644 index 00000000..a4bd4a78 Binary files /dev/null and b/app/src/normal/res/drawable/state_transition_connected_disconnected.png differ -- cgit v1.2.3 From 1709558fd2025a62931248b4c021f379172de70f Mon Sep 17 00:00:00 2001 From: cyberta Date: Fri, 2 Dec 2022 15:40:37 +0100 Subject: fix colors --- app/src/custom/res/values/custom-theme.xml | 5 ++++- app/src/main/java/se/leap/bitmaskclient/base/MainActivity.java | 2 +- .../main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java | 2 +- app/src/main/res/values/colors.xml | 5 +++-- 4 files changed, 9 insertions(+), 5 deletions(-) (limited to 'app') diff --git a/app/src/custom/res/values/custom-theme.xml b/app/src/custom/res/values/custom-theme.xml index a17b401c..b1a8d0cd 100644 --- a/app/src/custom/res/values/custom-theme.xml +++ b/app/src/custom/res/values/custom-theme.xml @@ -9,8 +9,11 @@ #ffffff #cccccc + + @color/black800_dark + @color/white - #ffffff + @color/black800_dark #58FFA9 diff --git a/app/src/main/java/se/leap/bitmaskclient/base/MainActivity.java b/app/src/main/java/se/leap/bitmaskclient/base/MainActivity.java index 28b981be..f56f2223 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/MainActivity.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/MainActivity.java @@ -263,7 +263,7 @@ public class MainActivity extends AppCompatActivity implements EipSetupListener, } if (textColor == 0) { - actionBarTextColor = isBrightColor(color) ? R.color.actionbar_dark_color : R.color.actionbar_light_color; + actionBarTextColor = isBrightColor(color) ? R.color.actionbar_connectivity_state_text_color_dark : R.color.actionbar_connectivity_state_text_color_light; } else { actionBarTextColor = textColor; } diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java index 470470ac..4df568b9 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java @@ -446,7 +446,7 @@ public class EipFragment extends Fragment implements Observer { if (activity == null) { return; } - ((MainActivity) getActivity()).setActivityBarColor(primaryColor, secondaryColor, R.color.actionbar_dark_color); + ((MainActivity) getActivity()).setActivityBarColor(primaryColor, secondaryColor, R.color.actionbar_connectivity_state_text_color_dark); } private void handleNewState() { diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 62f6d163..4bf2cb93 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -10,6 +10,7 @@ #03DAC6 #eF2222 + #1b1b1b #424242 #3b3b3b #AA424242 @@ -65,8 +66,8 @@ #ffffea - @color/black800 - @color/white + @color/black800 + @color/white @color/white @color/black800 -- cgit v1.2.3 From 4647d86693065a5a52558cc8f8e340cb48f5353d Mon Sep 17 00:00:00 2001 From: cyberta Date: Fri, 2 Dec 2022 16:02:26 +0100 Subject: add another setText() method in LocationButton that allows to pass a string resource id instead of a string --- .../main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java | 4 ++-- .../main/java/se/leap/bitmaskclient/base/views/LocationButton.java | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java index 4df568b9..d63d9c72 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java @@ -542,7 +542,7 @@ public class EipFragment extends Fragment implements Observer { } else if (eipStatus.isBlocking()) { setMainButtonEnabled(true); mainButton.updateState(true, false, true); - locationButton.setText(getString(R.string.no_location)); + locationButton.setText(R.string.no_location); locationButton.setLocationLoad(UNKNOWN); locationButton.showBridgeIndicator(false); locationButton.showRecommendedIndicator(false); @@ -552,7 +552,7 @@ public class EipFragment extends Fragment implements Observer { animateState(R.drawable.state_disconnected); setActivityBarColor(R.color.bg_disconnected_top, R.color.bg_disconnected_top_light_transparent); } else { - locationButton.setText(getContext().getString(R.string.vpn_button_turn_on)); + locationButton.setText(R.string.vpn_button_turn_on); setMainButtonEnabled(true); mainButton.updateState(false, false, false); locationButton.setLocationLoad(UNKNOWN); diff --git a/app/src/main/java/se/leap/bitmaskclient/base/views/LocationButton.java b/app/src/main/java/se/leap/bitmaskclient/base/views/LocationButton.java index 7ad044bd..ae77d60e 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/views/LocationButton.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/views/LocationButton.java @@ -8,6 +8,7 @@ import android.widget.RelativeLayout; import androidx.annotation.ColorRes; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.annotation.StringRes; import androidx.appcompat.widget.AppCompatImageView; import androidx.appcompat.widget.AppCompatTextView; import androidx.core.content.ContextCompat; @@ -52,6 +53,10 @@ public class LocationButton extends RelativeLayout { textView.setText(text); } + public void setText(@StringRes int resId) { + textView.setText(resId); + } + public void showBridgeIndicator(boolean show) { bridgeView.setVisibility(show ? VISIBLE : GONE); } -- cgit v1.2.3 From 22146b69ccb987bc1ac316b3b43ea46e3bdbd221 Mon Sep 17 00:00:00 2001 From: cyberta Date: Fri, 2 Dec 2022 17:04:00 +0100 Subject: tweak on/off button size --- app/src/main/res/layout-port/f_eip.xml | 5 ++--- app/src/main/res/layout-xlarge/f_eip.xml | 1 - app/src/main/res/layout/f_eip.xml | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) (limited to 'app') diff --git a/app/src/main/res/layout-port/f_eip.xml b/app/src/main/res/layout-port/f_eip.xml index 1b3225cc..6d24f5ce 100644 --- a/app/src/main/res/layout-port/f_eip.xml +++ b/app/src/main/res/layout-port/f_eip.xml @@ -20,8 +20,7 @@ android:layout_width="0dp" android:layout_height="0dp" android:orientation="horizontal" - app:layout_constraintGuide_percent="0.175" - /> + app:layout_constraintGuide_percent="0.25" /> diff --git a/app/src/main/res/layout-xlarge/f_eip.xml b/app/src/main/res/layout-xlarge/f_eip.xml index 9617b679..b2b8915d 100644 --- a/app/src/main/res/layout-xlarge/f_eip.xml +++ b/app/src/main/res/layout-xlarge/f_eip.xml @@ -127,7 +127,6 @@ android:id="@+id/main_button" android:layout_width="0dp" android:layout_height="0dp" - android:layout_margin="@dimen/stdpadding" app:layout_constraintTop_toBottomOf="@id/guideline_horizontal_bottom" app:layout_constraintBottom_toTopOf="@+id/guideline_horizontal_button_top" app:layout_constraintEnd_toStartOf="@+id/guideline_vertical_right" diff --git a/app/src/main/res/layout/f_eip.xml b/app/src/main/res/layout/f_eip.xml index 7a6c89c3..7fb2d2d4 100644 --- a/app/src/main/res/layout/f_eip.xml +++ b/app/src/main/res/layout/f_eip.xml @@ -136,7 +136,6 @@ android:id="@+id/main_button" android:layout_width="0dp" android:layout_height="0dp" - android:layout_margin="@dimen/stdpadding" app:layout_constraintTop_toBottomOf="@id/guideline_horizontal_bottom" app:layout_constraintBottom_toTopOf="@+id/guideline_horizontal_button_top" app:layout_constraintEnd_toStartOf="@+id/guideline_vertical_right" -- cgit v1.2.3 From 091487bfe760aacd8d4dc8eedcf5a07e4e5b53e3 Mon Sep 17 00:00:00 2001 From: cyberta Date: Fri, 2 Dec 2022 18:33:28 +0100 Subject: replace button pngs with vector graphics --- app/src/main/res/drawable-hdpi/ic_btn_cancel.png | Bin 486 -> 0 bytes app/src/main/res/drawable-hdpi/ic_btn_on.png | Bin 1091 -> 0 bytes app/src/main/res/drawable-xhdpi/ic_btn_cancel.png | Bin 617 -> 0 bytes app/src/main/res/drawable-xhdpi/ic_btn_on.png | Bin 1460 -> 0 bytes app/src/main/res/drawable-xxhdpi/ic_btn_cancel.png | Bin 1009 -> 0 bytes app/src/main/res/drawable-xxhdpi/ic_btn_on.png | Bin 2211 -> 0 bytes .../main/res/drawable-xxxhdpi/ic_btn_cancel.png | Bin 1361 -> 0 bytes app/src/main/res/drawable-xxxhdpi/ic_btn_on.png | Bin 3115 -> 0 bytes .../res/drawable/button_circle_cancel_pressed.xml | 6 +----- .../res/drawable/button_circle_cancel_released.xml | 5 ++--- .../res/drawable/button_circle_start_pressed.xml | 5 +---- .../res/drawable/button_circle_start_released.xml | 4 +--- .../res/drawable/button_circle_stop_pressed.xml | 5 +---- .../res/drawable/button_circle_stop_released.xml | 5 ++--- app/src/main/res/drawable/ic_btn_cancel.png | Bin 338 -> 0 bytes app/src/main/res/drawable/ic_btn_cancel.xml | 9 ++++++++ app/src/main/res/drawable/ic_btn_on.png | Bin 777 -> 0 bytes app/src/main/res/drawable/ic_btn_on.xml | 10 +++++++++ app/src/main/res/drawable/main_btn_glow.xml | 12 ----------- app/src/main/res/drawable/main_btn_shadow.xml | 5 ----- app/src/main/res/drawable/on_off_btn_an1.png | Bin 16186 -> 0 bytes app/src/main/res/drawable/on_off_btn_an2.png | Bin 12771 -> 0 bytes app/src/main/res/drawable/on_off_btn_an3.png | Bin 10006 -> 0 bytes app/src/main/res/drawable/on_off_btn_an4.png | Bin 9308 -> 0 bytes app/src/main/res/drawable/on_off_btn_fill.png | Bin 41384 -> 0 bytes .../res/drawable/on_off_btn_start_2_disabled.png | Bin 33323 -> 0 bytes .../res/drawable/on_off_btn_start_2_enabled.png | Bin 31261 -> 0 bytes .../res/drawable/on_off_btn_start_2_no_shadow.png | Bin 20182 -> 0 bytes .../res/drawable/on_off_btn_start_2_pressed.png | Bin 28721 -> 0 bytes app/src/main/res/drawable/progressbar_circle.xml | 24 --------------------- 30 files changed, 27 insertions(+), 63 deletions(-) delete mode 100644 app/src/main/res/drawable-hdpi/ic_btn_cancel.png delete mode 100644 app/src/main/res/drawable-hdpi/ic_btn_on.png delete mode 100644 app/src/main/res/drawable-xhdpi/ic_btn_cancel.png delete mode 100644 app/src/main/res/drawable-xhdpi/ic_btn_on.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_btn_cancel.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_btn_on.png delete mode 100644 app/src/main/res/drawable-xxxhdpi/ic_btn_cancel.png delete mode 100644 app/src/main/res/drawable-xxxhdpi/ic_btn_on.png delete mode 100644 app/src/main/res/drawable/ic_btn_cancel.png create mode 100644 app/src/main/res/drawable/ic_btn_cancel.xml delete mode 100644 app/src/main/res/drawable/ic_btn_on.png create mode 100644 app/src/main/res/drawable/ic_btn_on.xml delete mode 100644 app/src/main/res/drawable/main_btn_glow.xml delete mode 100644 app/src/main/res/drawable/main_btn_shadow.xml delete mode 100644 app/src/main/res/drawable/on_off_btn_an1.png delete mode 100644 app/src/main/res/drawable/on_off_btn_an2.png delete mode 100644 app/src/main/res/drawable/on_off_btn_an3.png delete mode 100644 app/src/main/res/drawable/on_off_btn_an4.png delete mode 100644 app/src/main/res/drawable/on_off_btn_fill.png delete mode 100644 app/src/main/res/drawable/on_off_btn_start_2_disabled.png delete mode 100644 app/src/main/res/drawable/on_off_btn_start_2_enabled.png delete mode 100644 app/src/main/res/drawable/on_off_btn_start_2_no_shadow.png delete mode 100644 app/src/main/res/drawable/on_off_btn_start_2_pressed.png delete mode 100644 app/src/main/res/drawable/progressbar_circle.xml (limited to 'app') diff --git a/app/src/main/res/drawable-hdpi/ic_btn_cancel.png b/app/src/main/res/drawable-hdpi/ic_btn_cancel.png deleted file mode 100644 index 00feedcd..00000000 Binary files a/app/src/main/res/drawable-hdpi/ic_btn_cancel.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/ic_btn_on.png b/app/src/main/res/drawable-hdpi/ic_btn_on.png deleted file mode 100644 index 2b37d25e..00000000 Binary files a/app/src/main/res/drawable-hdpi/ic_btn_on.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/ic_btn_cancel.png b/app/src/main/res/drawable-xhdpi/ic_btn_cancel.png deleted file mode 100644 index d623f8f5..00000000 Binary files a/app/src/main/res/drawable-xhdpi/ic_btn_cancel.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/ic_btn_on.png b/app/src/main/res/drawable-xhdpi/ic_btn_on.png deleted file mode 100644 index 4fdc9464..00000000 Binary files a/app/src/main/res/drawable-xhdpi/ic_btn_on.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_btn_cancel.png b/app/src/main/res/drawable-xxhdpi/ic_btn_cancel.png deleted file mode 100644 index af604d9b..00000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_btn_cancel.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_btn_on.png b/app/src/main/res/drawable-xxhdpi/ic_btn_on.png deleted file mode 100644 index d6cfc10b..00000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_btn_on.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_btn_cancel.png b/app/src/main/res/drawable-xxxhdpi/ic_btn_cancel.png deleted file mode 100644 index 6c17bd78..00000000 Binary files a/app/src/main/res/drawable-xxxhdpi/ic_btn_cancel.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_btn_on.png b/app/src/main/res/drawable-xxxhdpi/ic_btn_on.png deleted file mode 100644 index b0e54b8c..00000000 Binary files a/app/src/main/res/drawable-xxxhdpi/ic_btn_on.png and /dev/null differ diff --git a/app/src/main/res/drawable/button_circle_cancel_pressed.xml b/app/src/main/res/drawable/button_circle_cancel_pressed.xml index 690baa0c..b2efa78b 100644 --- a/app/src/main/res/drawable/button_circle_cancel_pressed.xml +++ b/app/src/main/res/drawable/button_circle_cancel_pressed.xml @@ -55,10 +55,6 @@ android:bottom="62dp" android:left="50dp" android:right="50dp" - > - - - + android:drawable="@drawable/ic_btn_cancel" /> \ No newline at end of file diff --git a/app/src/main/res/drawable/button_circle_cancel_released.xml b/app/src/main/res/drawable/button_circle_cancel_released.xml index 833a9076..efe0cc14 100644 --- a/app/src/main/res/drawable/button_circle_cancel_released.xml +++ b/app/src/main/res/drawable/button_circle_cancel_released.xml @@ -56,7 +56,6 @@ android:bottom="65dp" android:left="50dp" android:right="50dp" - > - - + android:drawable="@drawable/ic_btn_cancel" + /> \ No newline at end of file diff --git a/app/src/main/res/drawable/button_circle_start_pressed.xml b/app/src/main/res/drawable/button_circle_start_pressed.xml index 4157ffe0..dd8496c3 100644 --- a/app/src/main/res/drawable/button_circle_start_pressed.xml +++ b/app/src/main/res/drawable/button_circle_start_pressed.xml @@ -40,8 +40,5 @@ android:bottom="62dp" android:left="50dp" android:right="50dp" - > - - + android:drawable="@drawable/ic_btn_on" /> \ No newline at end of file diff --git a/app/src/main/res/drawable/button_circle_start_released.xml b/app/src/main/res/drawable/button_circle_start_released.xml index 671d06dc..700ded89 100644 --- a/app/src/main/res/drawable/button_circle_start_released.xml +++ b/app/src/main/res/drawable/button_circle_start_released.xml @@ -40,7 +40,5 @@ android:bottom="65dp" android:left="50dp" android:right="50dp" - > - - + android:drawable="@drawable/ic_btn_on" /> \ No newline at end of file diff --git a/app/src/main/res/drawable/button_circle_stop_pressed.xml b/app/src/main/res/drawable/button_circle_stop_pressed.xml index ce7583f1..79f794b2 100644 --- a/app/src/main/res/drawable/button_circle_stop_pressed.xml +++ b/app/src/main/res/drawable/button_circle_stop_pressed.xml @@ -40,8 +40,5 @@ android:bottom="62dp" android:left="50dp" android:right="50dp" - > - - + android:drawable="@drawable/ic_btn_cancel" /> \ No newline at end of file diff --git a/app/src/main/res/drawable/button_circle_stop_released.xml b/app/src/main/res/drawable/button_circle_stop_released.xml index ed786ee0..b0d47d78 100644 --- a/app/src/main/res/drawable/button_circle_stop_released.xml +++ b/app/src/main/res/drawable/button_circle_stop_released.xml @@ -40,7 +40,6 @@ android:bottom="65dp" android:left="50dp" android:right="50dp" - > - - + android:drawable="@drawable/ic_btn_cancel" + /> \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_btn_cancel.png b/app/src/main/res/drawable/ic_btn_cancel.png deleted file mode 100644 index 0b55460a..00000000 Binary files a/app/src/main/res/drawable/ic_btn_cancel.png and /dev/null differ diff --git a/app/src/main/res/drawable/ic_btn_cancel.xml b/app/src/main/res/drawable/ic_btn_cancel.xml new file mode 100644 index 00000000..9870cd4f --- /dev/null +++ b/app/src/main/res/drawable/ic_btn_cancel.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_btn_on.png b/app/src/main/res/drawable/ic_btn_on.png deleted file mode 100644 index be160a33..00000000 Binary files a/app/src/main/res/drawable/ic_btn_on.png and /dev/null differ diff --git a/app/src/main/res/drawable/ic_btn_on.xml b/app/src/main/res/drawable/ic_btn_on.xml new file mode 100644 index 00000000..0f3fc0f4 --- /dev/null +++ b/app/src/main/res/drawable/ic_btn_on.xml @@ -0,0 +1,10 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/main_btn_glow.xml b/app/src/main/res/drawable/main_btn_glow.xml deleted file mode 100644 index 5ed57dd5..00000000 --- a/app/src/main/res/drawable/main_btn_glow.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/main_btn_shadow.xml b/app/src/main/res/drawable/main_btn_shadow.xml deleted file mode 100644 index 94cf379f..00000000 --- a/app/src/main/res/drawable/main_btn_shadow.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/on_off_btn_an1.png b/app/src/main/res/drawable/on_off_btn_an1.png deleted file mode 100644 index c80feeb7..00000000 Binary files a/app/src/main/res/drawable/on_off_btn_an1.png and /dev/null differ diff --git a/app/src/main/res/drawable/on_off_btn_an2.png b/app/src/main/res/drawable/on_off_btn_an2.png deleted file mode 100644 index 73f4cb7e..00000000 Binary files a/app/src/main/res/drawable/on_off_btn_an2.png and /dev/null differ diff --git a/app/src/main/res/drawable/on_off_btn_an3.png b/app/src/main/res/drawable/on_off_btn_an3.png deleted file mode 100644 index 98ad0220..00000000 Binary files a/app/src/main/res/drawable/on_off_btn_an3.png and /dev/null differ diff --git a/app/src/main/res/drawable/on_off_btn_an4.png b/app/src/main/res/drawable/on_off_btn_an4.png deleted file mode 100644 index 49070e5f..00000000 Binary files a/app/src/main/res/drawable/on_off_btn_an4.png and /dev/null differ diff --git a/app/src/main/res/drawable/on_off_btn_fill.png b/app/src/main/res/drawable/on_off_btn_fill.png deleted file mode 100644 index 8394ccfb..00000000 Binary files a/app/src/main/res/drawable/on_off_btn_fill.png and /dev/null differ diff --git a/app/src/main/res/drawable/on_off_btn_start_2_disabled.png b/app/src/main/res/drawable/on_off_btn_start_2_disabled.png deleted file mode 100644 index 4675e48d..00000000 Binary files a/app/src/main/res/drawable/on_off_btn_start_2_disabled.png and /dev/null differ diff --git a/app/src/main/res/drawable/on_off_btn_start_2_enabled.png b/app/src/main/res/drawable/on_off_btn_start_2_enabled.png deleted file mode 100644 index 383e1076..00000000 Binary files a/app/src/main/res/drawable/on_off_btn_start_2_enabled.png and /dev/null differ diff --git a/app/src/main/res/drawable/on_off_btn_start_2_no_shadow.png b/app/src/main/res/drawable/on_off_btn_start_2_no_shadow.png deleted file mode 100644 index 941bdef1..00000000 Binary files a/app/src/main/res/drawable/on_off_btn_start_2_no_shadow.png and /dev/null differ diff --git a/app/src/main/res/drawable/on_off_btn_start_2_pressed.png b/app/src/main/res/drawable/on_off_btn_start_2_pressed.png deleted file mode 100644 index 7ff60cdb..00000000 Binary files a/app/src/main/res/drawable/on_off_btn_start_2_pressed.png and /dev/null differ diff --git a/app/src/main/res/drawable/progressbar_circle.xml b/app/src/main/res/drawable/progressbar_circle.xml deleted file mode 100644 index 3d5f6026..00000000 --- a/app/src/main/res/drawable/progressbar_circle.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - \ No newline at end of file -- cgit v1.2.3 From ed85b09daec4e36db366264bba644982abda3291 Mon Sep 17 00:00:00 2001 From: cyberta Date: Fri, 2 Dec 2022 20:09:24 +0100 Subject: increase shadow of main button --- .../main/res/drawable/button_circle_cancel_released.xml | 14 +++++++------- app/src/main/res/drawable/button_circle_start_released.xml | 6 +++--- app/src/main/res/drawable/button_circle_stop_released.xml | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'app') diff --git a/app/src/main/res/drawable/button_circle_cancel_released.xml b/app/src/main/res/drawable/button_circle_cancel_released.xml index efe0cc14..70d47257 100644 --- a/app/src/main/res/drawable/button_circle_cancel_released.xml +++ b/app/src/main/res/drawable/button_circle_cancel_released.xml @@ -8,10 +8,10 @@ --> + android:thickness="15dp"> diff --git a/app/src/main/res/drawable/button_circle_start_released.xml b/app/src/main/res/drawable/button_circle_start_released.xml index 700ded89..ad748e9c 100644 --- a/app/src/main/res/drawable/button_circle_start_released.xml +++ b/app/src/main/res/drawable/button_circle_start_released.xml @@ -21,14 +21,14 @@ > + android:thickness="15dp"> diff --git a/app/src/main/res/drawable/button_circle_stop_released.xml b/app/src/main/res/drawable/button_circle_stop_released.xml index b0d47d78..62827b66 100644 --- a/app/src/main/res/drawable/button_circle_stop_released.xml +++ b/app/src/main/res/drawable/button_circle_stop_released.xml @@ -21,14 +21,14 @@ > + android:thickness="15dp"> -- cgit v1.2.3 From 72759fe4be7e0557bfb251ba99de77e7ece6e1f7 Mon Sep 17 00:00:00 2001 From: cyberta Date: Fri, 2 Dec 2022 20:09:48 +0100 Subject: clean up --- app/src/main/res/layout/v_main_button.xml | 32 ------------------------------- 1 file changed, 32 deletions(-) (limited to 'app') diff --git a/app/src/main/res/layout/v_main_button.xml b/app/src/main/res/layout/v_main_button.xml index e3f96693..72981238 100644 --- a/app/src/main/res/layout/v_main_button.xml +++ b/app/src/main/res/layout/v_main_button.xml @@ -91,38 +91,6 @@ android:orientation="horizontal" app:layout_constraintGuide_percent="0.975" /> - - - - - Date: Fri, 2 Dec 2022 20:43:15 +0100 Subject: fix location button icon color for RiseupVPN --- app/src/custom/res/values/custom-theme.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/src/custom/res/values/custom-theme.xml b/app/src/custom/res/values/custom-theme.xml index b1a8d0cd..48d04322 100644 --- a/app/src/custom/res/values/custom-theme.xml +++ b/app/src/custom/res/values/custom-theme.xml @@ -19,6 +19,6 @@ #eF2222 - #ffffff - #22ffffff + @color/black800 + @color/black800_transparent -- cgit v1.2.3 From e8625b3fb29285d73033efb3aab96263528e270a Mon Sep 17 00:00:00 2001 From: cyberta Date: Sun, 4 Dec 2022 02:07:49 +0100 Subject: replace connected state background pngs for RiseupVPN with vector graphics --- app/src/custom/res/drawable-hdpi/bg_connected.png | Bin 147673 -> 0 bytes app/src/custom/res/drawable-hdpi/bg_connecting.png | Bin 237385 -> 0 bytes .../custom/res/drawable-hdpi/bg_disconnected.png | Bin 123636 -> 0 bytes app/src/custom/res/drawable-xhdpi/bg_connected.png | Bin 228442 -> 0 bytes .../custom/res/drawable-xhdpi/bg_connecting.png | Bin 402134 -> 0 bytes .../custom/res/drawable-xhdpi/bg_disconnected.png | Bin 200573 -> 0 bytes .../custom/res/drawable-xxhdpi/bg_connected.png | Bin 460545 -> 0 bytes .../custom/res/drawable-xxhdpi/bg_connecting.png | Bin 831328 -> 0 bytes .../custom/res/drawable-xxhdpi/bg_disconnected.png | Bin 417997 -> 0 bytes .../custom/res/drawable-xxxhdpi/bg_connected.png | Bin 765207 -> 0 bytes .../custom/res/drawable-xxxhdpi/bg_connecting.png | Bin 1492820 -> 0 bytes .../res/drawable-xxxhdpi/bg_disconnected.png | Bin 683759 -> 0 bytes app/src/custom/res/drawable/bg_connected.png | Bin 77818 -> 0 bytes app/src/custom/res/drawable/bg_connected.xml | 13 ++++++ .../custom/res/drawable/bg_connected_effect.xml | 25 ++++++++++++ app/src/custom/res/drawable/bg_connecting.png | Bin 112675 -> 0 bytes app/src/custom/res/drawable/bg_connecting.xml | 13 ++++++ .../custom/res/drawable/bg_connecting_effect.xml | 44 ++++++++++++++++++++ app/src/custom/res/drawable/bg_disconnected.png | Bin 63491 -> 0 bytes app/src/custom/res/drawable/bg_disconnected.xml | 15 +++++++ .../custom/res/drawable/bg_disconnected_effect.xml | 45 +++++++++++++++++++++ app/src/main/res/color/main_button_state_color.xml | 5 --- app/src/main/res/layout-port/f_eip.xml | 5 --- app/src/main/res/layout-xlarge-port/f_eip.xml | 6 +-- app/src/main/res/layout-xlarge/f_eip.xml | 6 +-- app/src/main/res/layout/f_eip.xml | 6 +-- app/src/main/res/values/colors.xml | 5 +++ 27 files changed, 163 insertions(+), 25 deletions(-) delete mode 100644 app/src/custom/res/drawable-hdpi/bg_connected.png delete mode 100644 app/src/custom/res/drawable-hdpi/bg_connecting.png delete mode 100644 app/src/custom/res/drawable-hdpi/bg_disconnected.png delete mode 100644 app/src/custom/res/drawable-xhdpi/bg_connected.png delete mode 100644 app/src/custom/res/drawable-xhdpi/bg_connecting.png delete mode 100644 app/src/custom/res/drawable-xhdpi/bg_disconnected.png delete mode 100644 app/src/custom/res/drawable-xxhdpi/bg_connected.png delete mode 100644 app/src/custom/res/drawable-xxhdpi/bg_connecting.png delete mode 100644 app/src/custom/res/drawable-xxhdpi/bg_disconnected.png delete mode 100644 app/src/custom/res/drawable-xxxhdpi/bg_connected.png delete mode 100644 app/src/custom/res/drawable-xxxhdpi/bg_connecting.png delete mode 100644 app/src/custom/res/drawable-xxxhdpi/bg_disconnected.png delete mode 100644 app/src/custom/res/drawable/bg_connected.png create mode 100644 app/src/custom/res/drawable/bg_connected.xml create mode 100644 app/src/custom/res/drawable/bg_connected_effect.xml delete mode 100644 app/src/custom/res/drawable/bg_connecting.png create mode 100644 app/src/custom/res/drawable/bg_connecting.xml create mode 100644 app/src/custom/res/drawable/bg_connecting_effect.xml delete mode 100644 app/src/custom/res/drawable/bg_disconnected.png create mode 100644 app/src/custom/res/drawable/bg_disconnected.xml create mode 100644 app/src/custom/res/drawable/bg_disconnected_effect.xml delete mode 100644 app/src/main/res/color/main_button_state_color.xml (limited to 'app') diff --git a/app/src/custom/res/drawable-hdpi/bg_connected.png b/app/src/custom/res/drawable-hdpi/bg_connected.png deleted file mode 100644 index 53648c23..00000000 Binary files a/app/src/custom/res/drawable-hdpi/bg_connected.png and /dev/null differ diff --git a/app/src/custom/res/drawable-hdpi/bg_connecting.png b/app/src/custom/res/drawable-hdpi/bg_connecting.png deleted file mode 100644 index a62d308c..00000000 Binary files a/app/src/custom/res/drawable-hdpi/bg_connecting.png and /dev/null differ diff --git a/app/src/custom/res/drawable-hdpi/bg_disconnected.png b/app/src/custom/res/drawable-hdpi/bg_disconnected.png deleted file mode 100644 index c2e031df..00000000 Binary files a/app/src/custom/res/drawable-hdpi/bg_disconnected.png and /dev/null differ diff --git a/app/src/custom/res/drawable-xhdpi/bg_connected.png b/app/src/custom/res/drawable-xhdpi/bg_connected.png deleted file mode 100644 index 4491692a..00000000 Binary files a/app/src/custom/res/drawable-xhdpi/bg_connected.png and /dev/null differ diff --git a/app/src/custom/res/drawable-xhdpi/bg_connecting.png b/app/src/custom/res/drawable-xhdpi/bg_connecting.png deleted file mode 100644 index 703a77c4..00000000 Binary files a/app/src/custom/res/drawable-xhdpi/bg_connecting.png and /dev/null differ diff --git a/app/src/custom/res/drawable-xhdpi/bg_disconnected.png b/app/src/custom/res/drawable-xhdpi/bg_disconnected.png deleted file mode 100644 index 4e05614e..00000000 Binary files a/app/src/custom/res/drawable-xhdpi/bg_disconnected.png and /dev/null differ diff --git a/app/src/custom/res/drawable-xxhdpi/bg_connected.png b/app/src/custom/res/drawable-xxhdpi/bg_connected.png deleted file mode 100644 index 29bd3a05..00000000 Binary files a/app/src/custom/res/drawable-xxhdpi/bg_connected.png and /dev/null differ diff --git a/app/src/custom/res/drawable-xxhdpi/bg_connecting.png b/app/src/custom/res/drawable-xxhdpi/bg_connecting.png deleted file mode 100644 index 9b91293c..00000000 Binary files a/app/src/custom/res/drawable-xxhdpi/bg_connecting.png and /dev/null differ diff --git a/app/src/custom/res/drawable-xxhdpi/bg_disconnected.png b/app/src/custom/res/drawable-xxhdpi/bg_disconnected.png deleted file mode 100644 index c4a09aa7..00000000 Binary files a/app/src/custom/res/drawable-xxhdpi/bg_disconnected.png and /dev/null differ diff --git a/app/src/custom/res/drawable-xxxhdpi/bg_connected.png b/app/src/custom/res/drawable-xxxhdpi/bg_connected.png deleted file mode 100644 index d1e95fb6..00000000 Binary files a/app/src/custom/res/drawable-xxxhdpi/bg_connected.png and /dev/null differ diff --git a/app/src/custom/res/drawable-xxxhdpi/bg_connecting.png b/app/src/custom/res/drawable-xxxhdpi/bg_connecting.png deleted file mode 100644 index e6d36eb0..00000000 Binary files a/app/src/custom/res/drawable-xxxhdpi/bg_connecting.png and /dev/null differ diff --git a/app/src/custom/res/drawable-xxxhdpi/bg_disconnected.png b/app/src/custom/res/drawable-xxxhdpi/bg_disconnected.png deleted file mode 100644 index df597f2f..00000000 Binary files a/app/src/custom/res/drawable-xxxhdpi/bg_disconnected.png and /dev/null differ diff --git a/app/src/custom/res/drawable/bg_connected.png b/app/src/custom/res/drawable/bg_connected.png deleted file mode 100644 index a375181d..00000000 Binary files a/app/src/custom/res/drawable/bg_connected.png and /dev/null differ diff --git a/app/src/custom/res/drawable/bg_connected.xml b/app/src/custom/res/drawable/bg_connected.xml new file mode 100644 index 00000000..f851203d --- /dev/null +++ b/app/src/custom/res/drawable/bg_connected.xml @@ -0,0 +1,13 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/custom/res/drawable/bg_connected_effect.xml b/app/src/custom/res/drawable/bg_connected_effect.xml new file mode 100644 index 00000000..75e79573 --- /dev/null +++ b/app/src/custom/res/drawable/bg_connected_effect.xml @@ -0,0 +1,25 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/custom/res/drawable/bg_connecting.png b/app/src/custom/res/drawable/bg_connecting.png deleted file mode 100644 index eccf184b..00000000 Binary files a/app/src/custom/res/drawable/bg_connecting.png and /dev/null differ diff --git a/app/src/custom/res/drawable/bg_connecting.xml b/app/src/custom/res/drawable/bg_connecting.xml new file mode 100644 index 00000000..8482d30e --- /dev/null +++ b/app/src/custom/res/drawable/bg_connecting.xml @@ -0,0 +1,13 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/custom/res/drawable/bg_connecting_effect.xml b/app/src/custom/res/drawable/bg_connecting_effect.xml new file mode 100644 index 00000000..fd462a54 --- /dev/null +++ b/app/src/custom/res/drawable/bg_connecting_effect.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/custom/res/drawable/bg_disconnected.png b/app/src/custom/res/drawable/bg_disconnected.png deleted file mode 100644 index cc3ead9a..00000000 Binary files a/app/src/custom/res/drawable/bg_disconnected.png and /dev/null differ diff --git a/app/src/custom/res/drawable/bg_disconnected.xml b/app/src/custom/res/drawable/bg_disconnected.xml new file mode 100644 index 00000000..bfc3c1d1 --- /dev/null +++ b/app/src/custom/res/drawable/bg_disconnected.xml @@ -0,0 +1,15 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/custom/res/drawable/bg_disconnected_effect.xml b/app/src/custom/res/drawable/bg_disconnected_effect.xml new file mode 100644 index 00000000..d19c2f7f --- /dev/null +++ b/app/src/custom/res/drawable/bg_disconnected_effect.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/color/main_button_state_color.xml b/app/src/main/res/color/main_button_state_color.xml deleted file mode 100644 index 9650b033..00000000 --- a/app/src/main/res/color/main_button_state_color.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-port/f_eip.xml b/app/src/main/res/layout-port/f_eip.xml index 6d24f5ce..83aabcde 100644 --- a/app/src/main/res/layout-port/f_eip.xml +++ b/app/src/main/res/layout-port/f_eip.xml @@ -62,11 +62,6 @@ android:layout_height="match_parent" app:srcCompat="@drawable/bg_disconnected" android:scaleType="fitXY" - android:layout_marginTop="-300dp" - android:layout_marginBottom="-300dp" - android:layout_marginLeft="-300dp" - android:layout_marginRight="-300dp" - /> diff --git a/app/src/main/res/layout-xlarge-port/f_eip.xml b/app/src/main/res/layout-xlarge-port/f_eip.xml index 9617b679..ee0fbac9 100644 --- a/app/src/main/res/layout-xlarge-port/f_eip.xml +++ b/app/src/main/res/layout-xlarge-port/f_eip.xml @@ -34,7 +34,7 @@ android:layout_width="0dp" android:layout_height="0dp" android:orientation="horizontal" - app:layout_constraintGuide_percent="0.55" /> + app:layout_constraintGuide_percent="0.65" /> diff --git a/app/src/main/res/layout-xlarge/f_eip.xml b/app/src/main/res/layout-xlarge/f_eip.xml index b2b8915d..e413319a 100644 --- a/app/src/main/res/layout-xlarge/f_eip.xml +++ b/app/src/main/res/layout-xlarge/f_eip.xml @@ -34,7 +34,7 @@ android:layout_width="0dp" android:layout_height="0dp" android:orientation="horizontal" - app:layout_constraintGuide_percent="0.55" /> + app:layout_constraintGuide_percent="0.6" /> diff --git a/app/src/main/res/layout/f_eip.xml b/app/src/main/res/layout/f_eip.xml index 7fb2d2d4..1e1f8e41 100644 --- a/app/src/main/res/layout/f_eip.xml +++ b/app/src/main/res/layout/f_eip.xml @@ -40,7 +40,7 @@ android:layout_width="0dp" android:layout_height="0dp" android:orientation="horizontal" - app:layout_constraintGuide_percent="0.45" /> + app:layout_constraintGuide_percent="0.50" /> diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 4bf2cb93..35e49370 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -57,6 +57,11 @@ #CCFFFEFE #CCCCCBCB + + #DC6F6B + #FADD85 + #CCDCB8 + #EC6767 #CCff9895 -- cgit v1.2.3 From 7bb9d4210d1411294bc2d8152d6d56a5e5f8e207 Mon Sep 17 00:00:00 2001 From: cyberta Date: Sun, 4 Dec 2022 04:08:12 +0100 Subject: replace vpn state background pngs for Bitmask with vector graphics --- app/src/normal/res/drawable-hdpi/bg_connected.png | Bin 190405 -> 0 bytes app/src/normal/res/drawable-hdpi/bg_connecting.png | Bin 236571 -> 0 bytes .../normal/res/drawable-hdpi/bg_disconnected.png | Bin 143331 -> 0 bytes app/src/normal/res/drawable-xhdpi/bg_connected.png | Bin 319429 -> 0 bytes .../normal/res/drawable-xhdpi/bg_connecting.png | Bin 400307 -> 0 bytes .../normal/res/drawable-xhdpi/bg_disconnected.png | Bin 220676 -> 0 bytes .../normal/res/drawable-xxhdpi/bg_connected.png | Bin 701727 -> 0 bytes .../normal/res/drawable-xxhdpi/bg_connecting.png | Bin 828368 -> 0 bytes .../normal/res/drawable-xxhdpi/bg_disconnected.png | Bin 446155 -> 0 bytes .../normal/res/drawable-xxxhdpi/bg_connected.png | Bin 1228810 -> 0 bytes .../normal/res/drawable-xxxhdpi/bg_connecting.png | Bin 1489207 -> 0 bytes .../res/drawable-xxxhdpi/bg_disconnected.png | Bin 745847 -> 0 bytes app/src/normal/res/drawable/bg_connected.png | Bin 90299 -> 0 bytes app/src/normal/res/drawable/bg_connected.xml | 14 +++++++ .../normal/res/drawable/bg_connected_effect.xml | 44 +++++++++++++++++++++ app/src/normal/res/drawable/bg_connecting.png | Bin 112042 -> 0 bytes app/src/normal/res/drawable/bg_connecting.xml | 13 ++++++ .../normal/res/drawable/bg_connecting_effect.xml | 44 +++++++++++++++++++++ app/src/normal/res/drawable/bg_disconnected.png | Bin 143331 -> 0 bytes app/src/normal/res/drawable/bg_disconnected.xml | 13 ++++++ .../normal/res/drawable/bg_disconnected_effect.xml | 33 ++++++++++++++++ 21 files changed, 161 insertions(+) delete mode 100644 app/src/normal/res/drawable-hdpi/bg_connected.png delete mode 100644 app/src/normal/res/drawable-hdpi/bg_connecting.png delete mode 100644 app/src/normal/res/drawable-hdpi/bg_disconnected.png delete mode 100644 app/src/normal/res/drawable-xhdpi/bg_connected.png delete mode 100644 app/src/normal/res/drawable-xhdpi/bg_connecting.png delete mode 100644 app/src/normal/res/drawable-xhdpi/bg_disconnected.png delete mode 100644 app/src/normal/res/drawable-xxhdpi/bg_connected.png delete mode 100644 app/src/normal/res/drawable-xxhdpi/bg_connecting.png delete mode 100644 app/src/normal/res/drawable-xxhdpi/bg_disconnected.png delete mode 100644 app/src/normal/res/drawable-xxxhdpi/bg_connected.png delete mode 100644 app/src/normal/res/drawable-xxxhdpi/bg_connecting.png delete mode 100644 app/src/normal/res/drawable-xxxhdpi/bg_disconnected.png delete mode 100644 app/src/normal/res/drawable/bg_connected.png create mode 100644 app/src/normal/res/drawable/bg_connected.xml create mode 100644 app/src/normal/res/drawable/bg_connected_effect.xml delete mode 100644 app/src/normal/res/drawable/bg_connecting.png create mode 100644 app/src/normal/res/drawable/bg_connecting.xml create mode 100644 app/src/normal/res/drawable/bg_connecting_effect.xml delete mode 100644 app/src/normal/res/drawable/bg_disconnected.png create mode 100644 app/src/normal/res/drawable/bg_disconnected.xml create mode 100644 app/src/normal/res/drawable/bg_disconnected_effect.xml (limited to 'app') diff --git a/app/src/normal/res/drawable-hdpi/bg_connected.png b/app/src/normal/res/drawable-hdpi/bg_connected.png deleted file mode 100644 index 0e98f705..00000000 Binary files a/app/src/normal/res/drawable-hdpi/bg_connected.png and /dev/null differ diff --git a/app/src/normal/res/drawable-hdpi/bg_connecting.png b/app/src/normal/res/drawable-hdpi/bg_connecting.png deleted file mode 100644 index 24632712..00000000 Binary files a/app/src/normal/res/drawable-hdpi/bg_connecting.png and /dev/null differ diff --git a/app/src/normal/res/drawable-hdpi/bg_disconnected.png b/app/src/normal/res/drawable-hdpi/bg_disconnected.png deleted file mode 100644 index de96be57..00000000 Binary files a/app/src/normal/res/drawable-hdpi/bg_disconnected.png and /dev/null differ diff --git a/app/src/normal/res/drawable-xhdpi/bg_connected.png b/app/src/normal/res/drawable-xhdpi/bg_connected.png deleted file mode 100644 index 915dff95..00000000 Binary files a/app/src/normal/res/drawable-xhdpi/bg_connected.png and /dev/null differ diff --git a/app/src/normal/res/drawable-xhdpi/bg_connecting.png b/app/src/normal/res/drawable-xhdpi/bg_connecting.png deleted file mode 100644 index be4469df..00000000 Binary files a/app/src/normal/res/drawable-xhdpi/bg_connecting.png and /dev/null differ diff --git a/app/src/normal/res/drawable-xhdpi/bg_disconnected.png b/app/src/normal/res/drawable-xhdpi/bg_disconnected.png deleted file mode 100644 index 433c776f..00000000 Binary files a/app/src/normal/res/drawable-xhdpi/bg_disconnected.png and /dev/null differ diff --git a/app/src/normal/res/drawable-xxhdpi/bg_connected.png b/app/src/normal/res/drawable-xxhdpi/bg_connected.png deleted file mode 100644 index cd78d865..00000000 Binary files a/app/src/normal/res/drawable-xxhdpi/bg_connected.png and /dev/null differ diff --git a/app/src/normal/res/drawable-xxhdpi/bg_connecting.png b/app/src/normal/res/drawable-xxhdpi/bg_connecting.png deleted file mode 100644 index 718e102f..00000000 Binary files a/app/src/normal/res/drawable-xxhdpi/bg_connecting.png and /dev/null differ diff --git a/app/src/normal/res/drawable-xxhdpi/bg_disconnected.png b/app/src/normal/res/drawable-xxhdpi/bg_disconnected.png deleted file mode 100644 index ffbcdb79..00000000 Binary files a/app/src/normal/res/drawable-xxhdpi/bg_disconnected.png and /dev/null differ diff --git a/app/src/normal/res/drawable-xxxhdpi/bg_connected.png b/app/src/normal/res/drawable-xxxhdpi/bg_connected.png deleted file mode 100644 index 3c9d97b4..00000000 Binary files a/app/src/normal/res/drawable-xxxhdpi/bg_connected.png and /dev/null differ diff --git a/app/src/normal/res/drawable-xxxhdpi/bg_connecting.png b/app/src/normal/res/drawable-xxxhdpi/bg_connecting.png deleted file mode 100644 index bff2004c..00000000 Binary files a/app/src/normal/res/drawable-xxxhdpi/bg_connecting.png and /dev/null differ diff --git a/app/src/normal/res/drawable-xxxhdpi/bg_disconnected.png b/app/src/normal/res/drawable-xxxhdpi/bg_disconnected.png deleted file mode 100644 index 2503f135..00000000 Binary files a/app/src/normal/res/drawable-xxxhdpi/bg_disconnected.png and /dev/null differ diff --git a/app/src/normal/res/drawable/bg_connected.png b/app/src/normal/res/drawable/bg_connected.png deleted file mode 100644 index 6da7878d..00000000 Binary files a/app/src/normal/res/drawable/bg_connected.png and /dev/null differ diff --git a/app/src/normal/res/drawable/bg_connected.xml b/app/src/normal/res/drawable/bg_connected.xml new file mode 100644 index 00000000..19dac103 --- /dev/null +++ b/app/src/normal/res/drawable/bg_connected.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/normal/res/drawable/bg_connected_effect.xml b/app/src/normal/res/drawable/bg_connected_effect.xml new file mode 100644 index 00000000..08ef8172 --- /dev/null +++ b/app/src/normal/res/drawable/bg_connected_effect.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + diff --git a/app/src/normal/res/drawable/bg_connecting.png b/app/src/normal/res/drawable/bg_connecting.png deleted file mode 100644 index c371f3f0..00000000 Binary files a/app/src/normal/res/drawable/bg_connecting.png and /dev/null differ diff --git a/app/src/normal/res/drawable/bg_connecting.xml b/app/src/normal/res/drawable/bg_connecting.xml new file mode 100644 index 00000000..8482d30e --- /dev/null +++ b/app/src/normal/res/drawable/bg_connecting.xml @@ -0,0 +1,13 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/normal/res/drawable/bg_connecting_effect.xml b/app/src/normal/res/drawable/bg_connecting_effect.xml new file mode 100644 index 00000000..fd462a54 --- /dev/null +++ b/app/src/normal/res/drawable/bg_connecting_effect.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/normal/res/drawable/bg_disconnected.png b/app/src/normal/res/drawable/bg_disconnected.png deleted file mode 100644 index de96be57..00000000 Binary files a/app/src/normal/res/drawable/bg_disconnected.png and /dev/null differ diff --git a/app/src/normal/res/drawable/bg_disconnected.xml b/app/src/normal/res/drawable/bg_disconnected.xml new file mode 100644 index 00000000..a5729185 --- /dev/null +++ b/app/src/normal/res/drawable/bg_disconnected.xml @@ -0,0 +1,13 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/normal/res/drawable/bg_disconnected_effect.xml b/app/src/normal/res/drawable/bg_disconnected_effect.xml new file mode 100644 index 00000000..bcc6064a --- /dev/null +++ b/app/src/normal/res/drawable/bg_disconnected_effect.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3 From e963546dd01627d1a7c9f38467733ae80cddaef3 Mon Sep 17 00:00:00 2001 From: cyberta Date: Sun, 4 Dec 2022 16:59:59 +0100 Subject: implement RiseupVPN splash screen for Android API 31+ --- app/src/custom/res/drawable/splash_branding.xml | 47 +++++++++++++++++++++++++ app/src/custom/res/drawable/splash_icon.xml | 17 +++++++++ app/src/custom/res/drawable/splash_page.xml | 10 ++++++ app/src/main/res/values-v31/themes.xml | 8 +++++ 4 files changed, 82 insertions(+) create mode 100644 app/src/custom/res/drawable/splash_branding.xml create mode 100644 app/src/custom/res/drawable/splash_icon.xml create mode 100644 app/src/main/res/values-v31/themes.xml (limited to 'app') diff --git a/app/src/custom/res/drawable/splash_branding.xml b/app/src/custom/res/drawable/splash_branding.xml new file mode 100644 index 00000000..8bbd83ca --- /dev/null +++ b/app/src/custom/res/drawable/splash_branding.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + diff --git a/app/src/custom/res/drawable/splash_icon.xml b/app/src/custom/res/drawable/splash_icon.xml new file mode 100644 index 00000000..e8335bc6 --- /dev/null +++ b/app/src/custom/res/drawable/splash_icon.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/app/src/custom/res/drawable/splash_page.xml b/app/src/custom/res/drawable/splash_page.xml index 4c72dfe2..48a622ac 100644 --- a/app/src/custom/res/drawable/splash_page.xml +++ b/app/src/custom/res/drawable/splash_page.xml @@ -1,4 +1,14 @@ + diff --git a/app/src/main/res/values-v31/themes.xml b/app/src/main/res/values-v31/themes.xml new file mode 100644 index 00000000..81d6c19e --- /dev/null +++ b/app/src/main/res/values-v31/themes.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file -- cgit v1.2.3 From 1b981b7971e207e892a4f457d455f0856533540f Mon Sep 17 00:00:00 2001 From: cyberta Date: Mon, 5 Dec 2022 13:23:14 +0100 Subject: replace motd png with vector graphic --- app/src/custom/res/drawable/ic_motd.png | Bin 34639 -> 0 bytes app/src/custom/res/drawable/ic_motd.xml | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+) delete mode 100644 app/src/custom/res/drawable/ic_motd.png create mode 100644 app/src/custom/res/drawable/ic_motd.xml (limited to 'app') diff --git a/app/src/custom/res/drawable/ic_motd.png b/app/src/custom/res/drawable/ic_motd.png deleted file mode 100644 index 5d2efea4..00000000 Binary files a/app/src/custom/res/drawable/ic_motd.png and /dev/null differ diff --git a/app/src/custom/res/drawable/ic_motd.xml b/app/src/custom/res/drawable/ic_motd.xml new file mode 100644 index 00000000..85c9e58a --- /dev/null +++ b/app/src/custom/res/drawable/ic_motd.xml @@ -0,0 +1,18 @@ + + + + + + + \ No newline at end of file -- cgit v1.2.3 From 8510b91343e234d559b39e8e5e14acc7a975506a Mon Sep 17 00:00:00 2001 From: cyberta Date: Mon, 5 Dec 2022 14:31:21 +0100 Subject: Bitmask splash screen for Android 12+ --- app/src/main/res/drawable/footer_text_drawable.xml | 2 ++ app/src/normal/res/drawable/splash_branding.xml | 3 +++ app/src/normal/res/drawable/splash_icon.xml | 14 ++++++++++++++ app/src/normal/res/values-v31/themes.xml | 8 ++++++++ 4 files changed, 27 insertions(+) create mode 100644 app/src/normal/res/drawable/splash_branding.xml create mode 100644 app/src/normal/res/drawable/splash_icon.xml create mode 100644 app/src/normal/res/values-v31/themes.xml (limited to 'app') diff --git a/app/src/main/res/drawable/footer_text_drawable.xml b/app/src/main/res/drawable/footer_text_drawable.xml index 801746df..e3ec5005 100644 --- a/app/src/main/res/drawable/footer_text_drawable.xml +++ b/app/src/main/res/drawable/footer_text_drawable.xml @@ -13,6 +13,8 @@ android:gravity="center" android:top="@dimen/footer_text_padding" android:bottom="@dimen/footer_text_padding" + android:left="20dp" + android:right="20dp" > diff --git a/app/src/normal/res/drawable/splash_branding.xml b/app/src/normal/res/drawable/splash_branding.xml new file mode 100644 index 00000000..8c4ee21c --- /dev/null +++ b/app/src/normal/res/drawable/splash_branding.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/app/src/normal/res/drawable/splash_icon.xml b/app/src/normal/res/drawable/splash_icon.xml new file mode 100644 index 00000000..f882d322 --- /dev/null +++ b/app/src/normal/res/drawable/splash_icon.xml @@ -0,0 +1,14 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/normal/res/values-v31/themes.xml b/app/src/normal/res/values-v31/themes.xml new file mode 100644 index 00000000..7ea17424 --- /dev/null +++ b/app/src/normal/res/values-v31/themes.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file -- cgit v1.2.3 From ec380e8b8913835cc50448aa51b75b3925644957 Mon Sep 17 00:00:00 2001 From: cyberta Date: Tue, 6 Dec 2022 03:17:15 +0100 Subject: re-adding pngs as fallback for pre-API 24, appearantly Android 6's vector graphic rendering is really broken --- .../res/drawable-anydpi-v24/bg_connected.xml | 13 +++ .../drawable-anydpi-v24/bg_connected_effect.xml | 25 +++++ .../res/drawable-anydpi-v24/bg_connecting.xml | 13 +++ .../drawable-anydpi-v24/bg_connecting_effect.xml | 44 +++++++++ .../res/drawable-anydpi-v24/bg_disconnected.xml | 15 +++ .../drawable-anydpi-v24/bg_disconnected_effect.xml | 45 +++++++++ app/src/custom/res/drawable-anydpi-v24/ic_motd.xml | 18 ++++ app/src/custom/res/drawable-anydpi-v24/ravens.xml | 39 ++++++++ .../drawable-anydpi-v24/rotate_progress_image.xml | 14 +++ .../res/drawable-anydpi-v24/state_connected.xml | 27 ++++++ .../res/drawable-anydpi-v24/state_connecting.xml | 15 +++ .../res/drawable-anydpi-v24/state_disconnected.xml | 17 ++++ .../state_transition_connected_disconnected.xml | 89 ++++++++++++++++++ app/src/custom/res/drawable-hdpi/bg_connected.png | Bin 0 -> 61315 bytes app/src/custom/res/drawable-hdpi/bg_connecting.png | Bin 0 -> 137369 bytes .../custom/res/drawable-hdpi/bg_disconnected.png | Bin 0 -> 116565 bytes app/src/custom/res/drawable-xhdpi/bg_connected.png | Bin 0 -> 85060 bytes .../custom/res/drawable-xhdpi/bg_connecting.png | Bin 0 -> 230677 bytes .../custom/res/drawable-xhdpi/bg_disconnected.png | Bin 0 -> 164266 bytes .../custom/res/drawable-xxhdpi/bg_connected.png | Bin 0 -> 136989 bytes .../custom/res/drawable-xxhdpi/bg_connecting.png | Bin 0 -> 422556 bytes .../custom/res/drawable-xxhdpi/bg_disconnected.png | Bin 0 -> 258953 bytes app/src/custom/res/drawable/bg_connected.png | Bin 0 -> 39210 bytes app/src/custom/res/drawable/bg_connected.xml | 13 --- .../custom/res/drawable/bg_connected_effect.xml | 25 ----- app/src/custom/res/drawable/bg_connecting.png | Bin 0 -> 68160 bytes app/src/custom/res/drawable/bg_connecting.xml | 13 --- .../custom/res/drawable/bg_connecting_effect.xml | 44 --------- app/src/custom/res/drawable/bg_disconnected.png | Bin 0 -> 71570 bytes app/src/custom/res/drawable/bg_disconnected.xml | 15 --- .../custom/res/drawable/bg_disconnected_effect.xml | 45 --------- app/src/custom/res/drawable/ic_motd.png | Bin 0 -> 34639 bytes app/src/custom/res/drawable/ic_motd.xml | 18 ---- app/src/custom/res/drawable/ravens.xml | 39 -------- .../custom/res/drawable/rotate_progress_image.png | Bin 0 -> 161 bytes .../custom/res/drawable/rotate_progress_image.xml | 14 --- app/src/custom/res/drawable/state_connected.png | Bin 0 -> 48758 bytes app/src/custom/res/drawable/state_connected.xml | 27 ------ app/src/custom/res/drawable/state_connecting.png | Bin 0 -> 111663 bytes app/src/custom/res/drawable/state_connecting.xml | 15 --- app/src/custom/res/drawable/state_disconnected.xml | 23 ++--- .../state_transition_connected_disconnected.xml | 89 ------------------ .../main/res/drawable-anydpi-v24/ic_btn_cancel.xml | 9 ++ app/src/main/res/drawable-anydpi-v24/ic_btn_on.xml | 10 ++ app/src/main/res/drawable/ic_btn_cancel.png | Bin 0 -> 1009 bytes app/src/main/res/drawable/ic_btn_cancel.xml | 9 -- app/src/main/res/drawable/ic_btn_on.png | Bin 0 -> 2211 bytes app/src/main/res/drawable/ic_btn_on.xml | 10 -- app/src/main/res/drawable/ic_btn_on_connecting.xml | 22 ----- app/src/main/res/drawable/ic_btn_on_disabled.xml | 20 ---- .../main/res/drawable/ic_btn_on_primary_color.xml | 22 ----- .../main/res/layout/allowed_application_layout.xml | 1 - .../res/drawable-anydpi-v24/background_main.xml | 52 +++++++++++ .../res/drawable-anydpi-v24/bg_connected.xml | 14 +++ .../drawable-anydpi-v24/bg_connected_effect.xml | 44 +++++++++ .../res/drawable-anydpi-v24/bg_connecting.xml | 13 +++ .../drawable-anydpi-v24/bg_connecting_effect.xml | 44 +++++++++ .../res/drawable-anydpi-v24/bg_disconnected.xml | 13 +++ .../drawable-anydpi-v24/bg_disconnected_effect.xml | 33 +++++++ .../drawable-anydpi-v24/rotate_progress_image.xml | 103 +++++++++++++++++++++ .../normal/res/drawable-anydpi-v24/splash_icon.xml | 14 +++ app/src/normal/res/drawable-hdpi/bg_connected.png | Bin 0 -> 101464 bytes app/src/normal/res/drawable-hdpi/bg_connecting.png | Bin 0 -> 137369 bytes .../normal/res/drawable-hdpi/bg_disconnected.png | Bin 0 -> 59922 bytes .../res/drawable-hdpi/rotate_progress_image.png | Bin 0 -> 6427 bytes .../normal/res/drawable-xhdpi/background_main.png | Bin 0 -> 64868 bytes app/src/normal/res/drawable-xhdpi/bg_connected.png | Bin 0 -> 168784 bytes .../normal/res/drawable-xhdpi/bg_connecting.png | Bin 0 -> 230677 bytes .../normal/res/drawable-xhdpi/bg_disconnected.png | Bin 0 -> 79223 bytes .../res/drawable-xhdpi/rotate_progress_image.png | Bin 0 -> 9736 bytes .../res/drawable-xxhdpi/rotate_progress_image.png | Bin 0 -> 12752 bytes .../res/drawable-xxxhdpi/background_main.png | Bin 0 -> 131879 bytes app/src/normal/res/drawable/background_eip.xml | 52 ----------- app/src/normal/res/drawable/background_main.png | Bin 0 -> 39702 bytes app/src/normal/res/drawable/background_main.xml | 52 ----------- app/src/normal/res/drawable/bg_connected.png | Bin 0 -> 50250 bytes app/src/normal/res/drawable/bg_connected.xml | 14 --- .../normal/res/drawable/bg_connected_effect.xml | 44 --------- app/src/normal/res/drawable/bg_connecting.png | Bin 0 -> 68160 bytes app/src/normal/res/drawable/bg_connecting.xml | 13 --- .../normal/res/drawable/bg_connecting_effect.xml | 44 --------- app/src/normal/res/drawable/bg_disconnected.png | Bin 0 -> 59917 bytes app/src/normal/res/drawable/bg_disconnected.xml | 13 --- .../normal/res/drawable/bg_disconnected_effect.xml | 33 ------- .../normal/res/drawable/rotate_progress_image.png | Bin 0 -> 4945 bytes .../normal/res/drawable/rotate_progress_image.xml | 103 --------------------- app/src/normal/res/drawable/splash_icon.xml | 14 --- 87 files changed, 729 insertions(+), 840 deletions(-) create mode 100644 app/src/custom/res/drawable-anydpi-v24/bg_connected.xml create mode 100644 app/src/custom/res/drawable-anydpi-v24/bg_connected_effect.xml create mode 100644 app/src/custom/res/drawable-anydpi-v24/bg_connecting.xml create mode 100644 app/src/custom/res/drawable-anydpi-v24/bg_connecting_effect.xml create mode 100644 app/src/custom/res/drawable-anydpi-v24/bg_disconnected.xml create mode 100644 app/src/custom/res/drawable-anydpi-v24/bg_disconnected_effect.xml create mode 100644 app/src/custom/res/drawable-anydpi-v24/ic_motd.xml create mode 100644 app/src/custom/res/drawable-anydpi-v24/ravens.xml create mode 100644 app/src/custom/res/drawable-anydpi-v24/rotate_progress_image.xml create mode 100644 app/src/custom/res/drawable-anydpi-v24/state_connected.xml create mode 100644 app/src/custom/res/drawable-anydpi-v24/state_connecting.xml create mode 100644 app/src/custom/res/drawable-anydpi-v24/state_disconnected.xml create mode 100644 app/src/custom/res/drawable-anydpi-v24/state_transition_connected_disconnected.xml create mode 100644 app/src/custom/res/drawable-hdpi/bg_connected.png create mode 100644 app/src/custom/res/drawable-hdpi/bg_connecting.png create mode 100644 app/src/custom/res/drawable-hdpi/bg_disconnected.png create mode 100644 app/src/custom/res/drawable-xhdpi/bg_connected.png create mode 100644 app/src/custom/res/drawable-xhdpi/bg_connecting.png create mode 100644 app/src/custom/res/drawable-xhdpi/bg_disconnected.png create mode 100644 app/src/custom/res/drawable-xxhdpi/bg_connected.png create mode 100644 app/src/custom/res/drawable-xxhdpi/bg_connecting.png create mode 100644 app/src/custom/res/drawable-xxhdpi/bg_disconnected.png create mode 100644 app/src/custom/res/drawable/bg_connected.png delete mode 100644 app/src/custom/res/drawable/bg_connected.xml delete mode 100644 app/src/custom/res/drawable/bg_connected_effect.xml create mode 100644 app/src/custom/res/drawable/bg_connecting.png delete mode 100644 app/src/custom/res/drawable/bg_connecting.xml delete mode 100644 app/src/custom/res/drawable/bg_connecting_effect.xml create mode 100644 app/src/custom/res/drawable/bg_disconnected.png delete mode 100644 app/src/custom/res/drawable/bg_disconnected.xml delete mode 100644 app/src/custom/res/drawable/bg_disconnected_effect.xml create mode 100644 app/src/custom/res/drawable/ic_motd.png delete mode 100644 app/src/custom/res/drawable/ic_motd.xml delete mode 100644 app/src/custom/res/drawable/ravens.xml create mode 100644 app/src/custom/res/drawable/rotate_progress_image.png delete mode 100644 app/src/custom/res/drawable/rotate_progress_image.xml create mode 100644 app/src/custom/res/drawable/state_connected.png delete mode 100644 app/src/custom/res/drawable/state_connected.xml create mode 100644 app/src/custom/res/drawable/state_connecting.png delete mode 100644 app/src/custom/res/drawable/state_connecting.xml delete mode 100644 app/src/custom/res/drawable/state_transition_connected_disconnected.xml create mode 100644 app/src/main/res/drawable-anydpi-v24/ic_btn_cancel.xml create mode 100644 app/src/main/res/drawable-anydpi-v24/ic_btn_on.xml create mode 100644 app/src/main/res/drawable/ic_btn_cancel.png delete mode 100644 app/src/main/res/drawable/ic_btn_cancel.xml create mode 100644 app/src/main/res/drawable/ic_btn_on.png delete mode 100644 app/src/main/res/drawable/ic_btn_on.xml delete mode 100644 app/src/main/res/drawable/ic_btn_on_connecting.xml delete mode 100644 app/src/main/res/drawable/ic_btn_on_disabled.xml delete mode 100644 app/src/main/res/drawable/ic_btn_on_primary_color.xml create mode 100644 app/src/normal/res/drawable-anydpi-v24/background_main.xml create mode 100644 app/src/normal/res/drawable-anydpi-v24/bg_connected.xml create mode 100644 app/src/normal/res/drawable-anydpi-v24/bg_connected_effect.xml create mode 100644 app/src/normal/res/drawable-anydpi-v24/bg_connecting.xml create mode 100644 app/src/normal/res/drawable-anydpi-v24/bg_connecting_effect.xml create mode 100644 app/src/normal/res/drawable-anydpi-v24/bg_disconnected.xml create mode 100644 app/src/normal/res/drawable-anydpi-v24/bg_disconnected_effect.xml create mode 100644 app/src/normal/res/drawable-anydpi-v24/rotate_progress_image.xml create mode 100644 app/src/normal/res/drawable-anydpi-v24/splash_icon.xml create mode 100644 app/src/normal/res/drawable-hdpi/bg_connected.png create mode 100644 app/src/normal/res/drawable-hdpi/bg_connecting.png create mode 100644 app/src/normal/res/drawable-hdpi/bg_disconnected.png create mode 100644 app/src/normal/res/drawable-hdpi/rotate_progress_image.png create mode 100644 app/src/normal/res/drawable-xhdpi/background_main.png create mode 100644 app/src/normal/res/drawable-xhdpi/bg_connected.png create mode 100644 app/src/normal/res/drawable-xhdpi/bg_connecting.png create mode 100644 app/src/normal/res/drawable-xhdpi/bg_disconnected.png create mode 100644 app/src/normal/res/drawable-xhdpi/rotate_progress_image.png create mode 100644 app/src/normal/res/drawable-xxhdpi/rotate_progress_image.png create mode 100644 app/src/normal/res/drawable-xxxhdpi/background_main.png delete mode 100644 app/src/normal/res/drawable/background_eip.xml create mode 100644 app/src/normal/res/drawable/background_main.png delete mode 100644 app/src/normal/res/drawable/background_main.xml create mode 100644 app/src/normal/res/drawable/bg_connected.png delete mode 100644 app/src/normal/res/drawable/bg_connected.xml delete mode 100644 app/src/normal/res/drawable/bg_connected_effect.xml create mode 100644 app/src/normal/res/drawable/bg_connecting.png delete mode 100644 app/src/normal/res/drawable/bg_connecting.xml delete mode 100644 app/src/normal/res/drawable/bg_connecting_effect.xml create mode 100644 app/src/normal/res/drawable/bg_disconnected.png delete mode 100644 app/src/normal/res/drawable/bg_disconnected.xml delete mode 100644 app/src/normal/res/drawable/bg_disconnected_effect.xml create mode 100644 app/src/normal/res/drawable/rotate_progress_image.png delete mode 100644 app/src/normal/res/drawable/rotate_progress_image.xml delete mode 100644 app/src/normal/res/drawable/splash_icon.xml (limited to 'app') diff --git a/app/src/custom/res/drawable-anydpi-v24/bg_connected.xml b/app/src/custom/res/drawable-anydpi-v24/bg_connected.xml new file mode 100644 index 00000000..f851203d --- /dev/null +++ b/app/src/custom/res/drawable-anydpi-v24/bg_connected.xml @@ -0,0 +1,13 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/custom/res/drawable-anydpi-v24/bg_connected_effect.xml b/app/src/custom/res/drawable-anydpi-v24/bg_connected_effect.xml new file mode 100644 index 00000000..75e79573 --- /dev/null +++ b/app/src/custom/res/drawable-anydpi-v24/bg_connected_effect.xml @@ -0,0 +1,25 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/custom/res/drawable-anydpi-v24/bg_connecting.xml b/app/src/custom/res/drawable-anydpi-v24/bg_connecting.xml new file mode 100644 index 00000000..8482d30e --- /dev/null +++ b/app/src/custom/res/drawable-anydpi-v24/bg_connecting.xml @@ -0,0 +1,13 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/custom/res/drawable-anydpi-v24/bg_connecting_effect.xml b/app/src/custom/res/drawable-anydpi-v24/bg_connecting_effect.xml new file mode 100644 index 00000000..fd462a54 --- /dev/null +++ b/app/src/custom/res/drawable-anydpi-v24/bg_connecting_effect.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/custom/res/drawable-anydpi-v24/bg_disconnected.xml b/app/src/custom/res/drawable-anydpi-v24/bg_disconnected.xml new file mode 100644 index 00000000..bfc3c1d1 --- /dev/null +++ b/app/src/custom/res/drawable-anydpi-v24/bg_disconnected.xml @@ -0,0 +1,15 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/custom/res/drawable-anydpi-v24/bg_disconnected_effect.xml b/app/src/custom/res/drawable-anydpi-v24/bg_disconnected_effect.xml new file mode 100644 index 00000000..d19c2f7f --- /dev/null +++ b/app/src/custom/res/drawable-anydpi-v24/bg_disconnected_effect.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/custom/res/drawable-anydpi-v24/ic_motd.xml b/app/src/custom/res/drawable-anydpi-v24/ic_motd.xml new file mode 100644 index 00000000..85c9e58a --- /dev/null +++ b/app/src/custom/res/drawable-anydpi-v24/ic_motd.xml @@ -0,0 +1,18 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/custom/res/drawable-anydpi-v24/ravens.xml b/app/src/custom/res/drawable-anydpi-v24/ravens.xml new file mode 100644 index 00000000..788aef84 --- /dev/null +++ b/app/src/custom/res/drawable-anydpi-v24/ravens.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/custom/res/drawable-anydpi-v24/rotate_progress_image.xml b/app/src/custom/res/drawable-anydpi-v24/rotate_progress_image.xml new file mode 100644 index 00000000..f84f9034 --- /dev/null +++ b/app/src/custom/res/drawable-anydpi-v24/rotate_progress_image.xml @@ -0,0 +1,14 @@ + + + + \ No newline at end of file diff --git a/app/src/custom/res/drawable-anydpi-v24/state_connected.xml b/app/src/custom/res/drawable-anydpi-v24/state_connected.xml new file mode 100644 index 00000000..e0a9005f --- /dev/null +++ b/app/src/custom/res/drawable-anydpi-v24/state_connected.xml @@ -0,0 +1,27 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/custom/res/drawable-anydpi-v24/state_connecting.xml b/app/src/custom/res/drawable-anydpi-v24/state_connecting.xml new file mode 100644 index 00000000..267ba791 --- /dev/null +++ b/app/src/custom/res/drawable-anydpi-v24/state_connecting.xml @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/custom/res/drawable-anydpi-v24/state_disconnected.xml b/app/src/custom/res/drawable-anydpi-v24/state_disconnected.xml new file mode 100644 index 00000000..7c49a537 --- /dev/null +++ b/app/src/custom/res/drawable-anydpi-v24/state_disconnected.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/app/src/custom/res/drawable-anydpi-v24/state_transition_connected_disconnected.xml b/app/src/custom/res/drawable-anydpi-v24/state_transition_connected_disconnected.xml new file mode 100644 index 00000000..0496e729 --- /dev/null +++ b/app/src/custom/res/drawable-anydpi-v24/state_transition_connected_disconnected.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/custom/res/drawable-hdpi/bg_connected.png b/app/src/custom/res/drawable-hdpi/bg_connected.png new file mode 100644 index 00000000..aa29fd90 Binary files /dev/null and b/app/src/custom/res/drawable-hdpi/bg_connected.png differ diff --git a/app/src/custom/res/drawable-hdpi/bg_connecting.png b/app/src/custom/res/drawable-hdpi/bg_connecting.png new file mode 100644 index 00000000..49620c2c Binary files /dev/null and b/app/src/custom/res/drawable-hdpi/bg_connecting.png differ diff --git a/app/src/custom/res/drawable-hdpi/bg_disconnected.png b/app/src/custom/res/drawable-hdpi/bg_disconnected.png new file mode 100644 index 00000000..35180222 Binary files /dev/null and b/app/src/custom/res/drawable-hdpi/bg_disconnected.png differ diff --git a/app/src/custom/res/drawable-xhdpi/bg_connected.png b/app/src/custom/res/drawable-xhdpi/bg_connected.png new file mode 100644 index 00000000..f9588d56 Binary files /dev/null and b/app/src/custom/res/drawable-xhdpi/bg_connected.png differ diff --git a/app/src/custom/res/drawable-xhdpi/bg_connecting.png b/app/src/custom/res/drawable-xhdpi/bg_connecting.png new file mode 100644 index 00000000..294e4708 Binary files /dev/null and b/app/src/custom/res/drawable-xhdpi/bg_connecting.png differ diff --git a/app/src/custom/res/drawable-xhdpi/bg_disconnected.png b/app/src/custom/res/drawable-xhdpi/bg_disconnected.png new file mode 100644 index 00000000..d18bc78e Binary files /dev/null and b/app/src/custom/res/drawable-xhdpi/bg_disconnected.png differ diff --git a/app/src/custom/res/drawable-xxhdpi/bg_connected.png b/app/src/custom/res/drawable-xxhdpi/bg_connected.png new file mode 100644 index 00000000..14c58b03 Binary files /dev/null and b/app/src/custom/res/drawable-xxhdpi/bg_connected.png differ diff --git a/app/src/custom/res/drawable-xxhdpi/bg_connecting.png b/app/src/custom/res/drawable-xxhdpi/bg_connecting.png new file mode 100644 index 00000000..062e84c4 Binary files /dev/null and b/app/src/custom/res/drawable-xxhdpi/bg_connecting.png differ diff --git a/app/src/custom/res/drawable-xxhdpi/bg_disconnected.png b/app/src/custom/res/drawable-xxhdpi/bg_disconnected.png new file mode 100644 index 00000000..cd014703 Binary files /dev/null and b/app/src/custom/res/drawable-xxhdpi/bg_disconnected.png differ diff --git a/app/src/custom/res/drawable/bg_connected.png b/app/src/custom/res/drawable/bg_connected.png new file mode 100644 index 00000000..78a09cae Binary files /dev/null and b/app/src/custom/res/drawable/bg_connected.png differ diff --git a/app/src/custom/res/drawable/bg_connected.xml b/app/src/custom/res/drawable/bg_connected.xml deleted file mode 100644 index f851203d..00000000 --- a/app/src/custom/res/drawable/bg_connected.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/src/custom/res/drawable/bg_connected_effect.xml b/app/src/custom/res/drawable/bg_connected_effect.xml deleted file mode 100644 index 75e79573..00000000 --- a/app/src/custom/res/drawable/bg_connected_effect.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/src/custom/res/drawable/bg_connecting.png b/app/src/custom/res/drawable/bg_connecting.png new file mode 100644 index 00000000..d85ddd4b Binary files /dev/null and b/app/src/custom/res/drawable/bg_connecting.png differ diff --git a/app/src/custom/res/drawable/bg_connecting.xml b/app/src/custom/res/drawable/bg_connecting.xml deleted file mode 100644 index 8482d30e..00000000 --- a/app/src/custom/res/drawable/bg_connecting.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/src/custom/res/drawable/bg_connecting_effect.xml b/app/src/custom/res/drawable/bg_connecting_effect.xml deleted file mode 100644 index fd462a54..00000000 --- a/app/src/custom/res/drawable/bg_connecting_effect.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/custom/res/drawable/bg_disconnected.png b/app/src/custom/res/drawable/bg_disconnected.png new file mode 100644 index 00000000..029c5d5a Binary files /dev/null and b/app/src/custom/res/drawable/bg_disconnected.png differ diff --git a/app/src/custom/res/drawable/bg_disconnected.xml b/app/src/custom/res/drawable/bg_disconnected.xml deleted file mode 100644 index bfc3c1d1..00000000 --- a/app/src/custom/res/drawable/bg_disconnected.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/src/custom/res/drawable/bg_disconnected_effect.xml b/app/src/custom/res/drawable/bg_disconnected_effect.xml deleted file mode 100644 index d19c2f7f..00000000 --- a/app/src/custom/res/drawable/bg_disconnected_effect.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/custom/res/drawable/ic_motd.png b/app/src/custom/res/drawable/ic_motd.png new file mode 100644 index 00000000..5d2efea4 Binary files /dev/null and b/app/src/custom/res/drawable/ic_motd.png differ diff --git a/app/src/custom/res/drawable/ic_motd.xml b/app/src/custom/res/drawable/ic_motd.xml deleted file mode 100644 index 85c9e58a..00000000 --- a/app/src/custom/res/drawable/ic_motd.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/app/src/custom/res/drawable/ravens.xml b/app/src/custom/res/drawable/ravens.xml deleted file mode 100644 index 788aef84..00000000 --- a/app/src/custom/res/drawable/ravens.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/custom/res/drawable/rotate_progress_image.png b/app/src/custom/res/drawable/rotate_progress_image.png new file mode 100644 index 00000000..ca160d00 Binary files /dev/null and b/app/src/custom/res/drawable/rotate_progress_image.png differ diff --git a/app/src/custom/res/drawable/rotate_progress_image.xml b/app/src/custom/res/drawable/rotate_progress_image.xml deleted file mode 100644 index f84f9034..00000000 --- a/app/src/custom/res/drawable/rotate_progress_image.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/custom/res/drawable/state_connected.png b/app/src/custom/res/drawable/state_connected.png new file mode 100644 index 00000000..0fbb82f2 Binary files /dev/null and b/app/src/custom/res/drawable/state_connected.png differ diff --git a/app/src/custom/res/drawable/state_connected.xml b/app/src/custom/res/drawable/state_connected.xml deleted file mode 100644 index e0a9005f..00000000 --- a/app/src/custom/res/drawable/state_connected.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/src/custom/res/drawable/state_connecting.png b/app/src/custom/res/drawable/state_connecting.png new file mode 100644 index 00000000..7d78587e Binary files /dev/null and b/app/src/custom/res/drawable/state_connecting.png differ diff --git a/app/src/custom/res/drawable/state_connecting.xml b/app/src/custom/res/drawable/state_connecting.xml deleted file mode 100644 index 267ba791..00000000 --- a/app/src/custom/res/drawable/state_connecting.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/app/src/custom/res/drawable/state_disconnected.xml b/app/src/custom/res/drawable/state_disconnected.xml index 7c49a537..ee11473d 100644 --- a/app/src/custom/res/drawable/state_disconnected.xml +++ b/app/src/custom/res/drawable/state_disconnected.xml @@ -1,17 +1,6 @@ - - - - - - \ No newline at end of file + + + + + + \ No newline at end of file diff --git a/app/src/custom/res/drawable/state_transition_connected_disconnected.xml b/app/src/custom/res/drawable/state_transition_connected_disconnected.xml deleted file mode 100644 index 0496e729..00000000 --- a/app/src/custom/res/drawable/state_transition_connected_disconnected.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/drawable-anydpi-v24/ic_btn_cancel.xml b/app/src/main/res/drawable-anydpi-v24/ic_btn_cancel.xml new file mode 100644 index 00000000..9870cd4f --- /dev/null +++ b/app/src/main/res/drawable-anydpi-v24/ic_btn_cancel.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-anydpi-v24/ic_btn_on.xml b/app/src/main/res/drawable-anydpi-v24/ic_btn_on.xml new file mode 100644 index 00000000..0f3fc0f4 --- /dev/null +++ b/app/src/main/res/drawable-anydpi-v24/ic_btn_on.xml @@ -0,0 +1,10 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_btn_cancel.png b/app/src/main/res/drawable/ic_btn_cancel.png new file mode 100644 index 00000000..af604d9b Binary files /dev/null and b/app/src/main/res/drawable/ic_btn_cancel.png differ diff --git a/app/src/main/res/drawable/ic_btn_cancel.xml b/app/src/main/res/drawable/ic_btn_cancel.xml deleted file mode 100644 index 9870cd4f..00000000 --- a/app/src/main/res/drawable/ic_btn_cancel.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_btn_on.png b/app/src/main/res/drawable/ic_btn_on.png new file mode 100644 index 00000000..d6cfc10b Binary files /dev/null and b/app/src/main/res/drawable/ic_btn_on.png differ diff --git a/app/src/main/res/drawable/ic_btn_on.xml b/app/src/main/res/drawable/ic_btn_on.xml deleted file mode 100644 index 0f3fc0f4..00000000 --- a/app/src/main/res/drawable/ic_btn_on.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_btn_on_connecting.xml b/app/src/main/res/drawable/ic_btn_on_connecting.xml deleted file mode 100644 index 4b3d1384..00000000 --- a/app/src/main/res/drawable/ic_btn_on_connecting.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - diff --git a/app/src/main/res/drawable/ic_btn_on_disabled.xml b/app/src/main/res/drawable/ic_btn_on_disabled.xml deleted file mode 100644 index 9c83422d..00000000 --- a/app/src/main/res/drawable/ic_btn_on_disabled.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - diff --git a/app/src/main/res/drawable/ic_btn_on_primary_color.xml b/app/src/main/res/drawable/ic_btn_on_primary_color.xml deleted file mode 100644 index 9f449299..00000000 --- a/app/src/main/res/drawable/ic_btn_on_primary_color.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - diff --git a/app/src/main/res/layout/allowed_application_layout.xml b/app/src/main/res/layout/allowed_application_layout.xml index 671a54fc..bb8e4e5d 100644 --- a/app/src/main/res/layout/allowed_application_layout.xml +++ b/app/src/main/res/layout/allowed_application_layout.xml @@ -25,7 +25,6 @@ android:layout_rowSpan="1" android:layout_marginEnd="8dip" android:scaleType="centerInside" - tools:background="@drawable/ic_btn_on_connecting" android:contentDescription="@null" /> + + + + + + + + + + + + + + + + + + diff --git a/app/src/normal/res/drawable-anydpi-v24/bg_connected.xml b/app/src/normal/res/drawable-anydpi-v24/bg_connected.xml new file mode 100644 index 00000000..19dac103 --- /dev/null +++ b/app/src/normal/res/drawable-anydpi-v24/bg_connected.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/normal/res/drawable-anydpi-v24/bg_connected_effect.xml b/app/src/normal/res/drawable-anydpi-v24/bg_connected_effect.xml new file mode 100644 index 00000000..08ef8172 --- /dev/null +++ b/app/src/normal/res/drawable-anydpi-v24/bg_connected_effect.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + diff --git a/app/src/normal/res/drawable-anydpi-v24/bg_connecting.xml b/app/src/normal/res/drawable-anydpi-v24/bg_connecting.xml new file mode 100644 index 00000000..8482d30e --- /dev/null +++ b/app/src/normal/res/drawable-anydpi-v24/bg_connecting.xml @@ -0,0 +1,13 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/normal/res/drawable-anydpi-v24/bg_connecting_effect.xml b/app/src/normal/res/drawable-anydpi-v24/bg_connecting_effect.xml new file mode 100644 index 00000000..fd462a54 --- /dev/null +++ b/app/src/normal/res/drawable-anydpi-v24/bg_connecting_effect.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/normal/res/drawable-anydpi-v24/bg_disconnected.xml b/app/src/normal/res/drawable-anydpi-v24/bg_disconnected.xml new file mode 100644 index 00000000..a5729185 --- /dev/null +++ b/app/src/normal/res/drawable-anydpi-v24/bg_disconnected.xml @@ -0,0 +1,13 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/normal/res/drawable-anydpi-v24/bg_disconnected_effect.xml b/app/src/normal/res/drawable-anydpi-v24/bg_disconnected_effect.xml new file mode 100644 index 00000000..bcc6064a --- /dev/null +++ b/app/src/normal/res/drawable-anydpi-v24/bg_disconnected_effect.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/normal/res/drawable-anydpi-v24/rotate_progress_image.xml b/app/src/normal/res/drawable-anydpi-v24/rotate_progress_image.xml new file mode 100644 index 00000000..44a35ba9 --- /dev/null +++ b/app/src/normal/res/drawable-anydpi-v24/rotate_progress_image.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/normal/res/drawable-anydpi-v24/splash_icon.xml b/app/src/normal/res/drawable-anydpi-v24/splash_icon.xml new file mode 100644 index 00000000..f882d322 --- /dev/null +++ b/app/src/normal/res/drawable-anydpi-v24/splash_icon.xml @@ -0,0 +1,14 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/normal/res/drawable-hdpi/bg_connected.png b/app/src/normal/res/drawable-hdpi/bg_connected.png new file mode 100644 index 00000000..7c64939a Binary files /dev/null and b/app/src/normal/res/drawable-hdpi/bg_connected.png differ diff --git a/app/src/normal/res/drawable-hdpi/bg_connecting.png b/app/src/normal/res/drawable-hdpi/bg_connecting.png new file mode 100644 index 00000000..49620c2c Binary files /dev/null and b/app/src/normal/res/drawable-hdpi/bg_connecting.png differ diff --git a/app/src/normal/res/drawable-hdpi/bg_disconnected.png b/app/src/normal/res/drawable-hdpi/bg_disconnected.png new file mode 100644 index 00000000..36a048d5 Binary files /dev/null and b/app/src/normal/res/drawable-hdpi/bg_disconnected.png differ diff --git a/app/src/normal/res/drawable-hdpi/rotate_progress_image.png b/app/src/normal/res/drawable-hdpi/rotate_progress_image.png new file mode 100644 index 00000000..d7c85e02 Binary files /dev/null and b/app/src/normal/res/drawable-hdpi/rotate_progress_image.png differ diff --git a/app/src/normal/res/drawable-xhdpi/background_main.png b/app/src/normal/res/drawable-xhdpi/background_main.png new file mode 100644 index 00000000..c2135c04 Binary files /dev/null and b/app/src/normal/res/drawable-xhdpi/background_main.png differ diff --git a/app/src/normal/res/drawable-xhdpi/bg_connected.png b/app/src/normal/res/drawable-xhdpi/bg_connected.png new file mode 100644 index 00000000..ca129080 Binary files /dev/null and b/app/src/normal/res/drawable-xhdpi/bg_connected.png differ diff --git a/app/src/normal/res/drawable-xhdpi/bg_connecting.png b/app/src/normal/res/drawable-xhdpi/bg_connecting.png new file mode 100644 index 00000000..294e4708 Binary files /dev/null and b/app/src/normal/res/drawable-xhdpi/bg_connecting.png differ diff --git a/app/src/normal/res/drawable-xhdpi/bg_disconnected.png b/app/src/normal/res/drawable-xhdpi/bg_disconnected.png new file mode 100644 index 00000000..15bdb108 Binary files /dev/null and b/app/src/normal/res/drawable-xhdpi/bg_disconnected.png differ diff --git a/app/src/normal/res/drawable-xhdpi/rotate_progress_image.png b/app/src/normal/res/drawable-xhdpi/rotate_progress_image.png new file mode 100644 index 00000000..d6eb6b65 Binary files /dev/null and b/app/src/normal/res/drawable-xhdpi/rotate_progress_image.png differ diff --git a/app/src/normal/res/drawable-xxhdpi/rotate_progress_image.png b/app/src/normal/res/drawable-xxhdpi/rotate_progress_image.png new file mode 100644 index 00000000..893b074b Binary files /dev/null and b/app/src/normal/res/drawable-xxhdpi/rotate_progress_image.png differ diff --git a/app/src/normal/res/drawable-xxxhdpi/background_main.png b/app/src/normal/res/drawable-xxxhdpi/background_main.png new file mode 100644 index 00000000..1b8046fa Binary files /dev/null and b/app/src/normal/res/drawable-xxxhdpi/background_main.png differ diff --git a/app/src/normal/res/drawable/background_eip.xml b/app/src/normal/res/drawable/background_eip.xml deleted file mode 100644 index 9b20a8fd..00000000 --- a/app/src/normal/res/drawable/background_eip.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/app/src/normal/res/drawable/background_main.png b/app/src/normal/res/drawable/background_main.png new file mode 100644 index 00000000..3e5f7871 Binary files /dev/null and b/app/src/normal/res/drawable/background_main.png differ diff --git a/app/src/normal/res/drawable/background_main.xml b/app/src/normal/res/drawable/background_main.xml deleted file mode 100644 index 4b60e9dc..00000000 --- a/app/src/normal/res/drawable/background_main.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/app/src/normal/res/drawable/bg_connected.png b/app/src/normal/res/drawable/bg_connected.png new file mode 100644 index 00000000..9741dcba Binary files /dev/null and b/app/src/normal/res/drawable/bg_connected.png differ diff --git a/app/src/normal/res/drawable/bg_connected.xml b/app/src/normal/res/drawable/bg_connected.xml deleted file mode 100644 index 19dac103..00000000 --- a/app/src/normal/res/drawable/bg_connected.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/src/normal/res/drawable/bg_connected_effect.xml b/app/src/normal/res/drawable/bg_connected_effect.xml deleted file mode 100644 index 08ef8172..00000000 --- a/app/src/normal/res/drawable/bg_connected_effect.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/app/src/normal/res/drawable/bg_connecting.png b/app/src/normal/res/drawable/bg_connecting.png new file mode 100644 index 00000000..d85ddd4b Binary files /dev/null and b/app/src/normal/res/drawable/bg_connecting.png differ diff --git a/app/src/normal/res/drawable/bg_connecting.xml b/app/src/normal/res/drawable/bg_connecting.xml deleted file mode 100644 index 8482d30e..00000000 --- a/app/src/normal/res/drawable/bg_connecting.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/src/normal/res/drawable/bg_connecting_effect.xml b/app/src/normal/res/drawable/bg_connecting_effect.xml deleted file mode 100644 index fd462a54..00000000 --- a/app/src/normal/res/drawable/bg_connecting_effect.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/normal/res/drawable/bg_disconnected.png b/app/src/normal/res/drawable/bg_disconnected.png new file mode 100644 index 00000000..a22b7097 Binary files /dev/null and b/app/src/normal/res/drawable/bg_disconnected.png differ diff --git a/app/src/normal/res/drawable/bg_disconnected.xml b/app/src/normal/res/drawable/bg_disconnected.xml deleted file mode 100644 index a5729185..00000000 --- a/app/src/normal/res/drawable/bg_disconnected.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/src/normal/res/drawable/bg_disconnected_effect.xml b/app/src/normal/res/drawable/bg_disconnected_effect.xml deleted file mode 100644 index bcc6064a..00000000 --- a/app/src/normal/res/drawable/bg_disconnected_effect.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/normal/res/drawable/rotate_progress_image.png b/app/src/normal/res/drawable/rotate_progress_image.png new file mode 100644 index 00000000..fe7f3526 Binary files /dev/null and b/app/src/normal/res/drawable/rotate_progress_image.png differ diff --git a/app/src/normal/res/drawable/rotate_progress_image.xml b/app/src/normal/res/drawable/rotate_progress_image.xml deleted file mode 100644 index 44a35ba9..00000000 --- a/app/src/normal/res/drawable/rotate_progress_image.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/normal/res/drawable/splash_icon.xml b/app/src/normal/res/drawable/splash_icon.xml deleted file mode 100644 index f882d322..00000000 --- a/app/src/normal/res/drawable/splash_icon.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - \ No newline at end of file -- cgit v1.2.3 From 16d41d3df2c2405c9f716675841c53c41fbf8400 Mon Sep 17 00:00:00 2001 From: cyberta Date: Tue, 6 Dec 2022 04:07:50 +0100 Subject: repeat connecting animation, fade out before restarting --- app/src/custom/res/animator/alpha4.xml | 10 ++++++++++ app/src/custom/res/drawable-anydpi-v24/ravens.xml | 8 +++++--- app/src/custom/res/drawable-anydpi-v24/state_connecting.xml | 3 +++ .../java/se/leap/bitmaskclient/base/fragments/EipFragment.java | 2 ++ 4 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 app/src/custom/res/animator/alpha4.xml (limited to 'app') diff --git a/app/src/custom/res/animator/alpha4.xml b/app/src/custom/res/animator/alpha4.xml new file mode 100644 index 00000000..75dc9c78 --- /dev/null +++ b/app/src/custom/res/animator/alpha4.xml @@ -0,0 +1,10 @@ + + + + + diff --git a/app/src/custom/res/drawable-anydpi-v24/ravens.xml b/app/src/custom/res/drawable-anydpi-v24/ravens.xml index 788aef84..a4c3023d 100644 --- a/app/src/custom/res/drawable-anydpi-v24/ravens.xml +++ b/app/src/custom/res/drawable-anydpi-v24/ravens.xml @@ -2,6 +2,8 @@ android:viewportWidth="342" android:viewportHeight="206" android:width="342dp" + android:name="ravens" + android:alpha="1" android:height="206dp"> + android:fillColor="#00000000" /> + android:fillColor="#00000000" /> + android:fillColor="#00000000" /> \ No newline at end of file diff --git a/app/src/custom/res/drawable-anydpi-v24/state_connecting.xml b/app/src/custom/res/drawable-anydpi-v24/state_connecting.xml index 267ba791..77207966 100644 --- a/app/src/custom/res/drawable-anydpi-v24/state_connecting.xml +++ b/app/src/custom/res/drawable-anydpi-v24/state_connecting.xml @@ -2,6 +2,9 @@ + diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java index d63d9c72..69e3aca1 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java @@ -599,6 +599,8 @@ public class EipFragment extends Fragment implements Observer { int newAnimationRes = pendingAnimationState; pendingAnimationState = 0; animateState(newAnimationRes); + } else if (drawable instanceof Animatable){ + ((Animatable) drawable).start(); } } }); -- cgit v1.2.3 From 4c6f49fe5ec695541be06322a1cf227e2d6d083d Mon Sep 17 00:00:00 2001 From: cyberta Date: Tue, 6 Dec 2022 04:22:39 +0100 Subject: restrict transition animation to connected -> disconnected state change --- .../java/se/leap/bitmaskclient/base/fragments/EipFragment.java | 8 +++++++- app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java | 3 +-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java index 69e3aca1..a5ccb81d 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java @@ -113,6 +113,7 @@ public class EipFragment extends Fragment implements Observer { AppCompatTextView mainDescription; AppCompatTextView subDescription; + private EipStatus.EipLevel previousEipLevel = EipStatus.EipLevel.UNKNOWN; private EipStatus eipStatus; private ProviderObservable providerObservable; private TorStatusObservable torStatusObservable; @@ -415,6 +416,7 @@ public class EipFragment extends Fragment implements Observer { @Override public void update(Observable observable, Object data) { if (observable instanceof EipStatus) { + previousEipLevel = eipStatus.getEipLevel(); eipStatus = (EipStatus) observable; handleNewStateOnMain(); @@ -537,7 +539,11 @@ public class EipFragment extends Fragment implements Observer { mainButton.updateState(false, false, false); mainDescription.setText(R.string.eip_status_unsecured); background.setImageResource(R.drawable.bg_disconnected); - animateState(R.drawable.state_transition_connected_disconnected); + if (previousEipLevel == EipStatus.EipLevel.CONNECTED) { + animateState(R.drawable.state_transition_connected_disconnected); + } else { + animateState(R.drawable.state_disconnected); + } setActivityBarColor(R.color.bg_disconnected_top, R.color.bg_disconnected_top_light_transparent); } else if (eipStatus.isBlocking()) { setMainButtonEnabled(true); diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java b/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java index 003e396f..c9cf6041 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java @@ -129,8 +129,7 @@ public class EipStatus extends Observable implements VpnStatus.StateListener { } } - @VisibleForTesting - EipLevel getEipLevel() { + public EipLevel getEipLevel() { return currentEipLevel; } -- cgit v1.2.3