diff options
author | cyBerta <cyberta@riseup.net> | 2021-07-31 19:30:54 +0200 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2021-11-15 16:13:41 +0100 |
commit | edb4b900ab1d1113492e98c28f12133c97721818 (patch) | |
tree | 2268e01053b56f7de5acc137065bce27009135e8 | |
parent | 7b9a2f0a807fb6e5782888f444efb1142da1f20b (diff) |
Add BuildConfig to disable color filtering of the main screen background, if VPN is turned off. Make EipFragment's text colors customizable
-rw-r--r-- | app/build.gradle | 4 | ||||
-rw-r--r-- | app/src/custom/res/values/custom-theme.xml | 7 | ||||
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java | 25 | ||||
-rw-r--r-- | app/src/main/res/layout-port/f_eip.xml | 2 | ||||
-rw-r--r-- | app/src/main/res/layout-xlarge-port/f_eip.xml | 2 | ||||
-rw-r--r-- | app/src/main/res/layout-xlarge/f_eip.xml | 2 | ||||
-rw-r--r-- | app/src/main/res/layout/f_eip.xml | 3 | ||||
-rw-r--r-- | app/src/main/res/values/colors.xml | 1 |
8 files changed, 34 insertions, 12 deletions
diff --git a/app/build.gradle b/app/build.gradle index 6db23476..8fcd9e90 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -37,6 +37,8 @@ android { buildConfigField 'boolean', 'priotize_anonymous_usage', 'false' //allow manual gateway selection buildConfigField 'boolean', 'allow_manual_gateway_selection', 'true' + // grey out background in EipFragment (main screen) if VPN is not running + buildConfigField 'boolean', 'use_color_filter', 'true' // static update url pointing to the latest stable release apk buildConfigField "String", "update_apk_url", '"https://dl.bitmask.net/client/android/Bitmask-Android-latest.apk"' @@ -118,6 +120,8 @@ android { buildConfigField 'boolean', 'priotize_anonymous_usage', 'true' //allow manual gateway selection buildConfigField 'boolean', 'allow_manual_gateway_selection', 'true' + // grey out background in EipFragment (main screen) if VPN is not running + buildConfigField 'boolean', 'use_color_filter', 'false' //Build Config Fields for automatic apk update checks diff --git a/app/src/custom/res/values/custom-theme.xml b/app/src/custom/res/values/custom-theme.xml index 1c8f1ab2..71d22ac6 100644 --- a/app/src/custom/res/values/custom-theme.xml +++ b/app/src/custom/res/values/custom-theme.xml @@ -2,11 +2,14 @@ <resources> <!--Colors--> <!--Color of the action bar--> - <color name="colorPrimary">#5e9ee3</color> + <color name="colorPrimary">#2E639C</color> <!--Color of the status bar--> - <color name="colorPrimaryDark">#5c7ce1</color> + <color name="colorPrimaryDark">#021122</color> <!--Font color of the action bar title--> <color name="colorActionBarTitleFont">#ffffff</color> <!--Font color of the action bar subtitle--> <color name="colorActionBarSubtitleFont">#cccccc</color> + <!-- Font color of labels in EipFragment (main screen)--> + <color name="colorEipFragmentFont">#ffffff</color> + </resources> 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 ef16d085..d8be1cc5 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 @@ -54,6 +54,7 @@ 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 se.leap.bitmaskclient.BuildConfig; import se.leap.bitmaskclient.R; import se.leap.bitmaskclient.base.FragmentManagerEnhanced; import se.leap.bitmaskclient.base.MainActivity; @@ -552,21 +553,27 @@ public class EipFragment extends Fragment implements Observer { } private void greyscaleBackground() { - ColorMatrix matrix = new ColorMatrix(); - matrix.setSaturation(0); - ColorMatrixColorFilter cf = new ColorMatrixColorFilter(matrix); - background.setColorFilter(cf); - background.setImageAlpha(255); + 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() { - background.setColorFilter(null); - background.setImageAlpha(144); + if (BuildConfig.use_color_filter) { + background.setColorFilter(null); + background.setImageAlpha(144); + } } private void colorBackground() { - background.setColorFilter(null); - background.setImageAlpha(210); + if (BuildConfig.use_color_filter) { + background.setColorFilter(null); + background.setImageAlpha(210); + } } private void updateInvalidVpnCertificate() { diff --git a/app/src/main/res/layout-port/f_eip.xml b/app/src/main/res/layout-port/f_eip.xml index 4dae126c..03401d16 100644 --- a/app/src/main/res/layout-port/f_eip.xml +++ b/app/src/main/res/layout-port/f_eip.xml @@ -65,6 +65,7 @@ android:padding="@dimen/activity_margin" android:textAppearance="@android:style/TextAppearance.Large" android:textStyle="bold" + android:textColor="@color/colorEipFragmentFont" app:layout_constraintDimensionRatio="1:1" tools:text="CONNETION" android:gravity="center" @@ -82,6 +83,7 @@ android:padding="@dimen/activity_margin" android:textAppearance="@android:style/TextAppearance.DeviceDefault.Medium" android:textStyle="bold" + android:textColor="@color/colorEipFragmentFont" app:layout_constraintDimensionRatio="1:1" tools:text="A LONG TEXT WITH SEVERAL THINGS BLABLkk \n kdjfkj \n kjdfkjdf" android:gravity="center" 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 5325d6a6..6a115a8b 100644 --- a/app/src/main/res/layout-xlarge-port/f_eip.xml +++ b/app/src/main/res/layout-xlarge-port/f_eip.xml @@ -76,6 +76,7 @@ android:padding="@dimen/activity_margin" android:textAppearance="@android:style/TextAppearance.Large" android:textStyle="bold" + android:textColor="@color/colorEipFragmentFont" app:layout_constraintDimensionRatio="1:1" tools:text="CONNETION" android:gravity="center" @@ -93,6 +94,7 @@ android:padding="@dimen/activity_margin" android:textAppearance="@android:style/TextAppearance.DeviceDefault.Medium" android:textStyle="bold" + android:textColor="@color/colorEipFragmentFont" app:layout_constraintDimensionRatio="1:1" tools:text="A LONG TEXT WITH SEVERAL THINGS BLABLkk" android:gravity="center" diff --git a/app/src/main/res/layout-xlarge/f_eip.xml b/app/src/main/res/layout-xlarge/f_eip.xml index 8ed9a57c..1ea7ba4b 100644 --- a/app/src/main/res/layout-xlarge/f_eip.xml +++ b/app/src/main/res/layout-xlarge/f_eip.xml @@ -80,6 +80,7 @@ android:padding="@dimen/stdpadding" android:textAppearance="@android:style/TextAppearance.DeviceDefault.Large" android:textStyle="bold" + android:textColor="@color/colorEipFragmentFont" app:layout_constraintDimensionRatio="1:1" tools:text="CONNETION SECURE" android:maxLines="1" @@ -96,6 +97,7 @@ android:padding="@dimen/stdpadding" android:textAppearance="@android:style/TextAppearance.DeviceDefault.Medium" android:textStyle="bold" + android:textColor="@color/colorEipFragmentFont" app:layout_constraintDimensionRatio="1:1" android:maxLines="5" android:ellipsize="end" diff --git a/app/src/main/res/layout/f_eip.xml b/app/src/main/res/layout/f_eip.xml index 0cefcd6c..e3e8fe0a 100644 --- a/app/src/main/res/layout/f_eip.xml +++ b/app/src/main/res/layout/f_eip.xml @@ -97,6 +97,7 @@ android:paddingEnd="@dimen/stdpadding" android:textAppearance="@android:style/TextAppearance.DeviceDefault.Large" android:textStyle="bold" + android:textColor="@color/colorEipFragmentFont" app:layout_constraintDimensionRatio="1:1" tools:text="CONNETION SECURE" /> @@ -111,12 +112,12 @@ app:layout_constraintBottom_toTopOf="@+id/gateway_location_button" android:textAppearance="@android:style/TextAppearance.DeviceDefault.Medium" android:textStyle="bold" + android:textColor="@color/colorEipFragmentFont" android:paddingLeft="@dimen/stdpadding" android:paddingStart="@dimen/stdpadding" android:paddingRight="@dimen/stdpadding" android:paddingEnd="@dimen/stdpadding" android:paddingBottom="@dimen/stdpadding" - app:layout_constraintDimensionRatio="1:1" tools:text="Your traffic is securly routed through \n another" android:maxLines="2" diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index a8cdb28e..e911a6d1 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -34,6 +34,7 @@ <color name="colorActionBarTitleFont">@color/white</color> <color name="colorActionBarSubtitleFont">@color/black800</color> + <color name="colorEipFragmentFont">@color/black800</color> <color name="colorWarning">#B33A3A</color> |