diff options
author | cyberta <cyberta@riseup.net> | 2022-11-30 01:37:33 +0100 |
---|---|---|
committer | cyberta <cyberta@riseup.net> | 2022-11-30 14:24:47 +0100 |
commit | da824fa125a5583d07e8ac2f6585459956d87ac1 (patch) | |
tree | 14a07baeb8abfdb9f46a54559bd0e4730c3b4989 /app/src/normal | |
parent | acdee8421bcdc39151457dea72686c4a31b5cdbb (diff) |
rename drawables and colors according to the state they're representing
Diffstat (limited to 'app/src/normal')
-rw-r--r-- | app/src/normal/java/se.leap.bitmaskclient.base.fragments/EipFragment.java | 32 | ||||
-rw-r--r-- | app/src/normal/res/drawable/cust_button_primary_rect.xml | 79 | ||||
-rw-r--r-- | app/src/normal/res/layout-port/f_eip.xml | 2 | ||||
-rw-r--r-- | app/src/normal/res/layout-xlarge-port/f_eip.xml | 2 | ||||
-rw-r--r-- | app/src/normal/res/layout-xlarge/f_eip.xml | 2 | ||||
-rw-r--r-- | app/src/normal/res/layout/f_eip.xml | 2 | ||||
-rw-r--r-- | app/src/normal/res/layout/v_location_button.xml | 2 |
7 files changed, 21 insertions, 100 deletions
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 index 2e291aad..0210077c 100644 --- a/app/src/normal/java/se.leap.bitmaskclient.base.fragments/EipFragment.java +++ b/app/src/normal/java/se.leap.bitmaskclient.base.fragments/EipFragment.java @@ -468,10 +468,10 @@ public class EipFragment extends Fragment implements Observer { } else { subDescription.setText(getString(R.string.updating_certificate_message)); } - background.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.bg_yellow)); + 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_yellow_top, R.color.bg_yellow_top_light_transparent); + setActivityBarColor(R.color.bg_connecting_top, R.color.bg_connecting_top_light_transparent); } else if (eipStatus.isConnecting()) { setMainButtonEnabled(true); String city = getPreferredCity(getContext()); @@ -484,10 +484,10 @@ 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_yellow)); + 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_yellow_top, R.color.bg_yellow_top_light_transparent); + setActivityBarColor(R.color.bg_connecting_top, R.color.bg_connecting_top_light_transparent); } else if (eipStatus.isConnected()) { setMainButtonEnabled(true); mainButton.updateState(true, false, false); @@ -498,9 +498,9 @@ 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_green)); + background.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.bg_connected)); stateView.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.green_mask)); - setActivityBarColor(R.color.bg_green_top, R.color.bg_green_top_light_transparent); + 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); @@ -511,9 +511,9 @@ 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_yellow)); + background.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.bg_connecting)); stateView.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.yellow_mask)); - setActivityBarColor(R.color.bg_yellow_top, R.color.bg_yellow_top_light_transparent); + 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); @@ -521,17 +521,17 @@ 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_yellow)); + background.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.bg_connecting)); stateView.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.yellow_mask)); - setActivityBarColor(R.color.bg_yellow_top, R.color.bg_yellow_top_light_transparent); + 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_red)); + 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_red_top, R.color.bg_red_top_light_transparent); + setActivityBarColor(R.color.bg_disconnected_top, R.color.bg_disconnected_top_light_transparent); } else if (eipStatus.isBlocking()) { setMainButtonEnabled(true); mainButton.updateState(true, false, true); @@ -541,9 +541,9 @@ 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_red)); + background.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.bg_disconnected)); stateView.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.red_mask)); - setActivityBarColor(R.color.bg_red_top, R.color.bg_red_top_light_transparent); + 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); @@ -555,9 +555,9 @@ 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_red)); + background.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.bg_disconnected)); stateView.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.red_mask)); - setActivityBarColor(R.color.bg_red_top, R.color.bg_red_top_light_transparent); + setActivityBarColor(R.color.bg_disconnected_top, R.color.bg_disconnected_top_light_transparent); } } diff --git a/app/src/normal/res/drawable/cust_button_primary_rect.xml b/app/src/normal/res/drawable/cust_button_primary_rect.xml deleted file mode 100644 index 74ddccb0..00000000 --- a/app/src/normal/res/drawable/cust_button_primary_rect.xml +++ /dev/null @@ -1,79 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<selector xmlns:android="http://schemas.android.com/apk/res/android" > - <item android:state_pressed="true" > - <layer-list - android:paddingLeft="@dimen/button_bevel" - android:paddingRight="@dimen/button_bevel"> - <item> - <shape android:shape="rectangle"> - <solid android:color="@color/black_transparent"/> - <corners android:radius="@dimen/stdpadding"/> - </shape> - </item> - <item> - <shape android:shape="rectangle"> - <solid android:color="@color/btn_white_transparent_dark"/> - <corners android:radius="@dimen/stdpadding"/> - </shape> - </item> - </layer-list> - </item> - <item android:state_focused="true"> - <layer-list - android:paddingLeft="@dimen/button_bevel" - android:paddingRight="@dimen/button_bevel"> - <item> - <shape android:shape="rectangle" > - <solid android:color="@color/black_transparent"/> - <corners android:radius="@dimen/stdpadding"/> - </shape> - </item> - <item> - <shape android:shape="rectangle"> - <solid android:color="@color/btn_white_transparent_dark"/> - <corners android:radius="@dimen/stdpadding"/> - </shape> - </item> - - </layer-list> - </item> - <item > - <layer-list - android:paddingLeft="@dimen/button_bevel" - android:paddingRight="@dimen/button_bevel"> - <!-- shadow --> - <item - android:top="@dimen/button_bevel" - android:left="1dp" - > - <shape android:shape="rectangle" > - <corners android:radius="@dimen/stdpadding" /> - <solid android:color="@color/black_transparent"/> - </shape> - </item> - <!-- fill --> - <item - android:bottom="@dimen/button_bevel" - android:right="1dp" - > - <shape android:shape="rectangle" > - <solid android:color="@color/btn_white_transparent"/> - <corners android:radius="@dimen/stdpadding"/> - </shape> - </item> - <!-- gradient --> - <item - android:bottom="@dimen/button_bevel" - android:right="1dp" - > - <shape android:shape="rectangle"> - <gradient android:startColor="@color/btn_white_transparent_dark" - android:endColor="@color/white_transparent" - android:angle="90" - /> - <corners android:radius="@dimen/stdpadding"/> - </shape> - </item> - </layer-list> - </item> -</selector>
\ No newline at end of file diff --git a/app/src/normal/res/layout-port/f_eip.xml b/app/src/normal/res/layout-port/f_eip.xml index b17e300c..eed5fde6 100644 --- a/app/src/normal/res/layout-port/f_eip.xml +++ b/app/src/normal/res/layout-port/f_eip.xml @@ -61,7 +61,7 @@ android:id="@+id/background" android:layout_width="match_parent" android:layout_height="match_parent" - app:srcCompat="@drawable/bg_red" + app:srcCompat="@drawable/bg_disconnected" android:scaleType="fitXY" android:layout_marginTop="-300dp" android:layout_marginBottom="-300dp" diff --git a/app/src/normal/res/layout-xlarge-port/f_eip.xml b/app/src/normal/res/layout-xlarge-port/f_eip.xml index 26a90403..ae548c82 100644 --- a/app/src/normal/res/layout-xlarge-port/f_eip.xml +++ b/app/src/normal/res/layout-xlarge-port/f_eip.xml @@ -69,7 +69,7 @@ android:id="@+id/background" android:layout_width="match_parent" android:layout_height="match_parent" - app:srcCompat="@drawable/bg_red" + app:srcCompat="@drawable/bg_disconnected" android:scaleType="fitXY" android:layout_marginTop="-300dp" android:layout_marginBottom="-300dp" diff --git a/app/src/normal/res/layout-xlarge/f_eip.xml b/app/src/normal/res/layout-xlarge/f_eip.xml index e1ecf321..a4d94394 100644 --- a/app/src/normal/res/layout-xlarge/f_eip.xml +++ b/app/src/normal/res/layout-xlarge/f_eip.xml @@ -69,7 +69,7 @@ android:layout_marginRight="-300dp" android:layout_marginTop="-300dp" android:layout_marginBottom="-300dp" - app:srcCompat="@drawable/bg_red" /> + app:srcCompat="@drawable/bg_disconnected" /> <androidx.appcompat.widget.AppCompatTextView diff --git a/app/src/normal/res/layout/f_eip.xml b/app/src/normal/res/layout/f_eip.xml index cd636b25..9c921721 100644 --- a/app/src/normal/res/layout/f_eip.xml +++ b/app/src/normal/res/layout/f_eip.xml @@ -75,7 +75,7 @@ android:layout_marginRight="-300dp" android:layout_marginTop="-300dp" android:layout_marginBottom="-300dp" - app:srcCompat="@drawable/bg_red" /> + app:srcCompat="@drawable/bg_disconnected" /> <androidx.appcompat.widget.AppCompatTextView diff --git a/app/src/normal/res/layout/v_location_button.xml b/app/src/normal/res/layout/v_location_button.xml index e7d8a319..8aaf4978 100644 --- a/app/src/normal/res/layout/v_location_button.xml +++ b/app/src/normal/res/layout/v_location_button.xml @@ -7,7 +7,7 @@ android:layout_gravity="center_vertical" android:layout_height="match_parent" android:padding="@dimen/stdpadding" - android:background="@drawable/cust_button_primary_rect" + android:background="@drawable/cust_button_light_rect" > <androidx.appcompat.widget.AppCompatImageView |