From 0b73725c22c0611bb37263954d80c66374f4f003 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Tue, 9 Jul 2019 22:51:03 +0200 Subject: add shadow and pressed state for vpn icon button --- app/src/main/res/drawable/black_circle.xml | 8 ++------ app/src/main/res/drawable/black_circle_pressed.xml | 10 ++++++++++ app/src/main/res/drawable/black_circle_released.xml | 18 ++++++++++++++++++ app/src/main/res/values/colors.xml | 2 ++ 4 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 app/src/main/res/drawable/black_circle_pressed.xml create mode 100644 app/src/main/res/drawable/black_circle_released.xml (limited to 'app/src') diff --git a/app/src/main/res/drawable/black_circle.xml b/app/src/main/res/drawable/black_circle.xml index 533652d6..f64c034d 100644 --- a/app/src/main/res/drawable/black_circle.xml +++ b/app/src/main/res/drawable/black_circle.xml @@ -1,9 +1,5 @@ - - - - - - + + \ No newline at end of file diff --git a/app/src/main/res/drawable/black_circle_pressed.xml b/app/src/main/res/drawable/black_circle_pressed.xml new file mode 100644 index 00000000..d7d646a0 --- /dev/null +++ b/app/src/main/res/drawable/black_circle_pressed.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/black_circle_released.xml b/app/src/main/res/drawable/black_circle_released.xml new file mode 100644 index 00000000..b1ef3827 --- /dev/null +++ b/app/src/main/res/drawable/black_circle_released.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 40ab06c5..02a3a437 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -7,6 +7,8 @@ #a5d6a7 #424242 + #3b3b3b + #AA424242 #ef9a9a #f48fb1 -- cgit v1.2.3 From ea7479f66048135292562abc324d8f9b3f20275b Mon Sep 17 00:00:00 2001 From: cyBerta Date: Tue, 9 Jul 2019 23:00:24 +0200 Subject: use AppCompatButton in EipFragment --- app/src/main/java/se/leap/bitmaskclient/EipFragment.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/src') diff --git a/app/src/main/java/se/leap/bitmaskclient/EipFragment.java b/app/src/main/java/se/leap/bitmaskclient/EipFragment.java index 69d81ccf..0a58bdc2 100644 --- a/app/src/main/java/se/leap/bitmaskclient/EipFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/EipFragment.java @@ -32,6 +32,7 @@ import android.support.v4.app.DialogFragment; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentTransaction; import android.support.v7.app.AlertDialog; +import android.support.v7.widget.AppCompatButton; import android.support.v7.widget.AppCompatImageView; import android.support.v7.widget.AppCompatTextView; import android.util.Log; @@ -39,7 +40,6 @@ import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.Button; import android.widget.TextView; import android.widget.Toast; @@ -61,12 +61,12 @@ import se.leap.bitmaskclient.views.VpnStateImage; import static android.view.View.GONE; import static android.view.View.VISIBLE; import static de.blinkt.openvpn.core.ConnectionStatus.LEVEL_NONETWORK; +import static se.leap.bitmaskclient.Constants.ASK_TO_CANCEL_VPN; import static se.leap.bitmaskclient.Constants.EIP_RESTART_ON_BOOT; import static se.leap.bitmaskclient.Constants.PROVIDER_KEY; import static se.leap.bitmaskclient.Constants.REQUEST_CODE_CONFIGURE_LEAP; import static se.leap.bitmaskclient.Constants.REQUEST_CODE_LOG_IN; import static se.leap.bitmaskclient.Constants.REQUEST_CODE_SWITCH_PROVIDER; -import static se.leap.bitmaskclient.Constants.ASK_TO_CANCEL_VPN; import static se.leap.bitmaskclient.Constants.SHARED_PREFERENCES; import static se.leap.bitmaskclient.EipSetupObserver.connectionRetry; import static se.leap.bitmaskclient.EipSetupObserver.gatewayOrder; @@ -92,7 +92,7 @@ public class EipFragment extends Fragment implements Observer { VpnStateImage vpnStateImage; @InjectView(R.id.vpn_main_button) - Button mainButton; + AppCompatButton mainButton; @InjectView(R.id.routed_text) AppCompatTextView routedText; -- cgit v1.2.3 From 40266121f8f62bcbeca79d648fd673e5ee09c849 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Tue, 9 Jul 2019 23:01:43 +0200 Subject: fix primaryDark colors in themes --- app/src/main/res/values/themes.xml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'app/src') diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index f3c55f41..b287b1f8 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -2,7 +2,7 @@ - - -- cgit v1.2.3 From 9bb5d109ddd73b8e31e5f5d862372758290227aa Mon Sep 17 00:00:00 2001 From: cyBerta Date: Tue, 9 Jul 2019 23:30:32 +0200 Subject: tweak buttons - fix pressed states, tweak vpn button --- .../main/res/drawable/cust_button_primary_black.xml | 18 ++++++++++++++++++ app/src/main/res/layout/f_eip.xml | 4 ++-- app/src/main/res/values-v21/styles.xml | 10 ---------- app/src/main/res/values-v21/themes.xml | 2 +- app/src/main/res/values/styles.xml | 3 ++- 5 files changed, 23 insertions(+), 14 deletions(-) create mode 100644 app/src/main/res/drawable/cust_button_primary_black.xml (limited to 'app/src') diff --git a/app/src/main/res/drawable/cust_button_primary_black.xml b/app/src/main/res/drawable/cust_button_primary_black.xml new file mode 100644 index 00000000..fc42dbc5 --- /dev/null +++ b/app/src/main/res/drawable/cust_button_primary_black.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/f_eip.xml b/app/src/main/res/layout/f_eip.xml index ed4ec9c4..dda4ad78 100644 --- a/app/src/main/res/layout/f_eip.xml +++ b/app/src/main/res/layout/f_eip.xml @@ -83,8 +83,8 @@ @color/accent - - - diff --git a/app/src/main/res/values-v21/themes.xml b/app/src/main/res/values-v21/themes.xml index d6145217..0a426ced 100644 --- a/app/src/main/res/values-v21/themes.xml +++ b/app/src/main/res/values-v21/themes.xml @@ -17,7 +17,7 @@ diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 4e845384..97f001a4 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -69,8 +69,9 @@ \ No newline at end of file -- cgit v1.2.3 From ef3a05a11724f0a8e33895e1ea8bd792063bd1fc Mon Sep 17 00:00:00 2001 From: cyBerta Date: Wed, 10 Jul 2019 03:24:43 +0200 Subject: add material design icons to the navigation drawer --- .../leap/bitmaskclient/DrawerSettingsAdapter.java | 44 +++++++++++---- .../drawer/NavigationDrawerFragment.java | 21 ++++---- app/src/main/res/drawable-hdpi/ic_about_36.png | Bin 0 -> 1230 bytes app/src/main/res/drawable-hdpi/ic_always_on_36.png | Bin 0 -> 1329 bytes app/src/main/res/drawable-hdpi/ic_battery_36.png | Bin 0 -> 573 bytes app/src/main/res/drawable-hdpi/ic_donate_36.png | Bin 0 -> 1322 bytes app/src/main/res/drawable-hdpi/ic_log_36.png | Bin 0 -> 835 bytes .../res/drawable-hdpi/ic_switch_provider_36.png | Bin 0 -> 627 bytes app/src/main/res/drawable-mdpi/ic_about_36.png | Bin 0 -> 1009 bytes app/src/main/res/drawable-mdpi/ic_always_on_36.png | Bin 0 -> 1104 bytes app/src/main/res/drawable-mdpi/ic_battery_36.png | Bin 0 -> 609 bytes app/src/main/res/drawable-mdpi/ic_donate_36.png | Bin 0 -> 944 bytes app/src/main/res/drawable-mdpi/ic_log_36.png | Bin 0 -> 780 bytes .../res/drawable-mdpi/ic_switch_provider_36.png | Bin 0 -> 609 bytes app/src/main/res/drawable-xhdpi/ic_about_36.png | Bin 0 -> 1638 bytes .../main/res/drawable-xhdpi/ic_always_on_36.png | Bin 0 -> 1740 bytes app/src/main/res/drawable-xhdpi/ic_battery_36.png | Bin 0 -> 798 bytes app/src/main/res/drawable-xhdpi/ic_donate_36.png | Bin 0 -> 1607 bytes app/src/main/res/drawable-xhdpi/ic_log_36.png | Bin 0 -> 1124 bytes .../res/drawable-xhdpi/ic_switch_provider_36.png | Bin 0 -> 763 bytes app/src/main/res/drawable-xxhdpi/ic_about_36.png | Bin 0 -> 2213 bytes .../main/res/drawable-xxhdpi/ic_always_on_36.png | Bin 0 -> 2446 bytes app/src/main/res/drawable-xxhdpi/ic_battery_36.png | Bin 0 -> 845 bytes app/src/main/res/drawable-xxhdpi/ic_donate_36.png | Bin 0 -> 2341 bytes app/src/main/res/drawable-xxhdpi/ic_log_36.png | Bin 0 -> 1384 bytes .../res/drawable-xxhdpi/ic_switch_provider_36.png | Bin 0 -> 878 bytes app/src/main/res/drawable-xxxhdpi/ic_about_36.png | Bin 0 -> 3043 bytes .../main/res/drawable-xxxhdpi/ic_always_on_36.png | Bin 0 -> 3353 bytes .../main/res/drawable-xxxhdpi/ic_battery_36.png | Bin 0 -> 1159 bytes app/src/main/res/drawable-xxxhdpi/ic_donate_36.png | Bin 0 -> 3063 bytes app/src/main/res/drawable-xxxhdpi/ic_log_36.png | Bin 0 -> 1945 bytes .../res/drawable-xxxhdpi/ic_switch_provider_36.png | Bin 0 -> 1070 bytes .../res/layout-xlarge/v_icon_text_list_item.xml | 31 +++++++++++ app/src/main/res/layout/v_icon_text_list_item.xml | 31 +++++++++++ app/src/main/res/layout/v_switch_list_item.xml | 59 ++++++++++++++++----- 35 files changed, 151 insertions(+), 35 deletions(-) create mode 100644 app/src/main/res/drawable-hdpi/ic_about_36.png create mode 100644 app/src/main/res/drawable-hdpi/ic_always_on_36.png create mode 100644 app/src/main/res/drawable-hdpi/ic_battery_36.png create mode 100644 app/src/main/res/drawable-hdpi/ic_donate_36.png create mode 100644 app/src/main/res/drawable-hdpi/ic_log_36.png create mode 100644 app/src/main/res/drawable-hdpi/ic_switch_provider_36.png create mode 100644 app/src/main/res/drawable-mdpi/ic_about_36.png create mode 100644 app/src/main/res/drawable-mdpi/ic_always_on_36.png create mode 100644 app/src/main/res/drawable-mdpi/ic_battery_36.png create mode 100644 app/src/main/res/drawable-mdpi/ic_donate_36.png create mode 100644 app/src/main/res/drawable-mdpi/ic_log_36.png create mode 100644 app/src/main/res/drawable-mdpi/ic_switch_provider_36.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_about_36.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_always_on_36.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_battery_36.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_donate_36.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_log_36.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_switch_provider_36.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_about_36.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_always_on_36.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_battery_36.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_donate_36.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_log_36.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_switch_provider_36.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_about_36.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_always_on_36.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_battery_36.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_donate_36.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_log_36.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_switch_provider_36.png create mode 100644 app/src/main/res/layout-xlarge/v_icon_text_list_item.xml create mode 100644 app/src/main/res/layout/v_icon_text_list_item.xml (limited to 'app/src') diff --git a/app/src/main/java/se/leap/bitmaskclient/DrawerSettingsAdapter.java b/app/src/main/java/se/leap/bitmaskclient/DrawerSettingsAdapter.java index 01b10575..89aeb4be 100644 --- a/app/src/main/java/se/leap/bitmaskclient/DrawerSettingsAdapter.java +++ b/app/src/main/java/se/leap/bitmaskclient/DrawerSettingsAdapter.java @@ -16,6 +16,9 @@ */ package se.leap.bitmaskclient; +import android.content.Context; +import android.graphics.drawable.Drawable; +import android.support.annotation.DrawableRes; import android.support.annotation.NonNull; import android.support.v7.widget.SwitchCompat; import android.view.LayoutInflater; @@ -23,6 +26,7 @@ import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.CompoundButton; +import android.widget.ImageView; import android.widget.TextView; import java.util.ArrayList; @@ -52,21 +56,27 @@ public class DrawerSettingsAdapter extends BaseAdapter { private boolean isChecked = false; private int itemType = NONE; private CompoundButton.OnCheckedChangeListener callback; + private Drawable iconResource; - private DrawerSettingsItem(String description, int viewType, boolean isChecked, int itemType, CompoundButton.OnCheckedChangeListener callback) { + private DrawerSettingsItem(Context context, String description, @DrawableRes int iconResource, int viewType, boolean isChecked, int itemType, CompoundButton.OnCheckedChangeListener callback) { this.description = description; this.viewType = viewType; this.isChecked = isChecked; this.itemType = itemType; this.callback = callback; + try { + this.iconResource = context.getResources().getDrawable(iconResource); + } catch (RuntimeException e) { + e.printStackTrace(); + } } - public static DrawerSettingsItem getSimpleTextInstance(String description, int itemType) { - return new DrawerSettingsItem(description, VIEW_SIMPLE_TEXT, false, itemType, null); + public static DrawerSettingsItem getSimpleTextInstance(Context context, String description, @DrawableRes int iconResource, int itemType) { + return new DrawerSettingsItem(context, description, iconResource, VIEW_SIMPLE_TEXT, false, itemType, null); } - public static DrawerSettingsItem getSwitchInstance(String description, boolean isChecked, int itemType, CompoundButton.OnCheckedChangeListener callback) { - return new DrawerSettingsItem(description, VIEW_SWITCH, isChecked, itemType, callback); + public static DrawerSettingsItem getSwitchInstance(Context context, String description, @DrawableRes int iconResource, boolean isChecked, int itemType, CompoundButton.OnCheckedChangeListener callback) { + return new DrawerSettingsItem(context, description, iconResource, VIEW_SWITCH, isChecked, itemType, callback); } public int getItemType() { @@ -138,7 +148,7 @@ public class DrawerSettingsAdapter extends BaseAdapter { switch(type) { case VIEW_SIMPLE_TEXT: convertView = initTextViewBinding(holder); - holder.textView.setText(drawerSettingsItem.description); + bindSimpleText(drawerSettingsItem, holder); break; case VIEW_SWITCH: convertView = initSwitchBinding(holder); @@ -154,7 +164,7 @@ public class DrawerSettingsAdapter extends BaseAdapter { holder.resetSwitchView(); convertView = initTextViewBinding(holder); } - holder.textView.setText(drawerSettingsItem.description); + bindSimpleText(drawerSettingsItem, holder); break; case VIEW_SWITCH: if (!holder.isSwitchViewHolder()) { @@ -169,23 +179,36 @@ public class DrawerSettingsAdapter extends BaseAdapter { return convertView; } + private void bindSimpleText(DrawerSettingsItem drawerSettingsItem, ViewHolder holder) { + holder.textView.setText(drawerSettingsItem.description); + if (drawerSettingsItem.iconResource != null) { + holder.iconView.setImageDrawable(drawerSettingsItem.iconResource); + } + } + private void bindSwitch(DrawerSettingsItem drawerSettingsItem, ViewHolder holder) { holder.switchView.setChecked(drawerSettingsItem.isChecked); - holder.switchView.setText(drawerSettingsItem.description); + holder.textView.setText(drawerSettingsItem.description); holder.switchView.setOnCheckedChangeListener(drawerSettingsItem.callback); + if (drawerSettingsItem.iconResource != null) { + holder.iconView.setImageDrawable(drawerSettingsItem.iconResource); + } } @NonNull private View initSwitchBinding(ViewHolder holder) { View convertView = mInflater.inflate(R.layout.v_switch_list_item, null); - holder.switchView = convertView.findViewById(android.R.id.text1); + holder.switchView = convertView.findViewById(R.id.option_switch); + holder.textView = convertView.findViewById(android.R.id.text1); + holder.iconView = convertView.findViewById(R.id.material_icon); return convertView; } @NonNull private View initTextViewBinding(ViewHolder holder) { - View convertView = mInflater.inflate(R.layout.v_single_list_item, null); + View convertView = mInflater.inflate(R.layout.v_icon_text_list_item, null); holder.textView = convertView.findViewById(android.R.id.text1); + holder.iconView = convertView.findViewById(R.id.material_icon); return convertView; } @@ -200,6 +223,7 @@ public class DrawerSettingsAdapter extends BaseAdapter { static class ViewHolder { TextView textView; + ImageView iconView; SwitchCompat switchView; boolean isSwitchViewHolder() { diff --git a/app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java b/app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java index 21d061d1..635238f2 100644 --- a/app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java @@ -244,12 +244,7 @@ public class NavigationDrawerFragment extends Fragment { private void setupAccountsListView() { drawerAccountsListView = drawerView.findViewById(R.id.accountList); drawerAccountsListView.setAdapter(accountListAdapter); - drawerAccountsListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { - @Override - public void onItemClick(AdapterView parent, View view, int position, long id) { - selectItem(parent, position); - } - }); + drawerAccountsListView.setOnItemClickListener((parent, view, position, id) -> selectItem(parent, position)); } private void setupSettingsListView() { @@ -261,22 +256,24 @@ public class NavigationDrawerFragment extends Fragment { private void setupSettingsListAdapter() { settingsListAdapter = new DrawerSettingsAdapter(getLayoutInflater()); if (getContext() != null) { - settingsListAdapter.addItem(getSwitchInstance(getString(R.string.save_battery), + settingsListAdapter.addItem(getSwitchInstance(getContext(), + getString(R.string.save_battery), + R.drawable.ic_battery_36, getSaveBattery(getContext()), BATTERY_SAVER, (buttonView, newStateIsChecked) -> onSwitchItemSelected(BATTERY_SAVER, newStateIsChecked))); } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - settingsListAdapter.addItem(getSimpleTextInstance(getString(R.string.always_on_vpn), ALWAYS_ON)); + settingsListAdapter.addItem(getSimpleTextInstance(getContext(), getString(R.string.always_on_vpn), R.drawable.ic_always_on_36, ALWAYS_ON)); } if (isDefaultBitmask()) { - settingsListAdapter.addItem(getSimpleTextInstance(getString(switch_provider_menu_option), SWITCH_PROVIDER)); + settingsListAdapter.addItem(getSimpleTextInstance(getContext(), getString(switch_provider_menu_option), R.drawable.ic_switch_provider_36, SWITCH_PROVIDER)); } - settingsListAdapter.addItem(getSimpleTextInstance(getString(log_fragment_title), LOG)); + settingsListAdapter.addItem(getSimpleTextInstance(getContext(), getString(log_fragment_title), R.drawable.ic_log_36, LOG)); if (ENABLE_DONATION) { - settingsListAdapter.addItem(getSimpleTextInstance(getString(donate_title), DONATE)); + settingsListAdapter.addItem(getSimpleTextInstance(getContext(), getString(donate_title), R.drawable.ic_donate_36, DONATE)); } - settingsListAdapter.addItem(getSimpleTextInstance(getString(about_fragment_title), ABOUT)); + settingsListAdapter.addItem(getSimpleTextInstance(getContext(), getString(about_fragment_title), R.drawable.ic_about_36, ABOUT)); } private ActionBar setupActionBar() { diff --git a/app/src/main/res/drawable-hdpi/ic_about_36.png b/app/src/main/res/drawable-hdpi/ic_about_36.png new file mode 100644 index 00000000..52f4e395 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_about_36.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_always_on_36.png b/app/src/main/res/drawable-hdpi/ic_always_on_36.png new file mode 100644 index 00000000..8547b61d Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_always_on_36.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_battery_36.png b/app/src/main/res/drawable-hdpi/ic_battery_36.png new file mode 100644 index 00000000..7d4cd60b Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_battery_36.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_donate_36.png b/app/src/main/res/drawable-hdpi/ic_donate_36.png new file mode 100644 index 00000000..f269af8c Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_donate_36.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_log_36.png b/app/src/main/res/drawable-hdpi/ic_log_36.png new file mode 100644 index 00000000..3ed90a08 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_log_36.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_switch_provider_36.png b/app/src/main/res/drawable-hdpi/ic_switch_provider_36.png new file mode 100644 index 00000000..0bace0ce Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_switch_provider_36.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_about_36.png b/app/src/main/res/drawable-mdpi/ic_about_36.png new file mode 100644 index 00000000..110e8f2e Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_about_36.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_always_on_36.png b/app/src/main/res/drawable-mdpi/ic_always_on_36.png new file mode 100644 index 00000000..ea15a067 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_always_on_36.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_battery_36.png b/app/src/main/res/drawable-mdpi/ic_battery_36.png new file mode 100644 index 00000000..0490996a Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_battery_36.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_donate_36.png b/app/src/main/res/drawable-mdpi/ic_donate_36.png new file mode 100644 index 00000000..b47fecaf Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_donate_36.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_log_36.png b/app/src/main/res/drawable-mdpi/ic_log_36.png new file mode 100644 index 00000000..85a5210c Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_log_36.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_switch_provider_36.png b/app/src/main/res/drawable-mdpi/ic_switch_provider_36.png new file mode 100644 index 00000000..a830e782 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_switch_provider_36.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_about_36.png b/app/src/main/res/drawable-xhdpi/ic_about_36.png new file mode 100644 index 00000000..7a15dacc Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_about_36.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_always_on_36.png b/app/src/main/res/drawable-xhdpi/ic_always_on_36.png new file mode 100644 index 00000000..811d64d7 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_always_on_36.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_battery_36.png b/app/src/main/res/drawable-xhdpi/ic_battery_36.png new file mode 100644 index 00000000..4bed162d Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_battery_36.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_donate_36.png b/app/src/main/res/drawable-xhdpi/ic_donate_36.png new file mode 100644 index 00000000..fe680f0e Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_donate_36.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_log_36.png b/app/src/main/res/drawable-xhdpi/ic_log_36.png new file mode 100644 index 00000000..571e09ae Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_log_36.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_switch_provider_36.png b/app/src/main/res/drawable-xhdpi/ic_switch_provider_36.png new file mode 100644 index 00000000..be31da48 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_switch_provider_36.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_about_36.png b/app/src/main/res/drawable-xxhdpi/ic_about_36.png new file mode 100644 index 00000000..b2c8cfcc Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_about_36.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_always_on_36.png b/app/src/main/res/drawable-xxhdpi/ic_always_on_36.png new file mode 100644 index 00000000..bfb87c49 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_always_on_36.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_battery_36.png b/app/src/main/res/drawable-xxhdpi/ic_battery_36.png new file mode 100644 index 00000000..7a311741 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_battery_36.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_donate_36.png b/app/src/main/res/drawable-xxhdpi/ic_donate_36.png new file mode 100644 index 00000000..08bff222 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_donate_36.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_log_36.png b/app/src/main/res/drawable-xxhdpi/ic_log_36.png new file mode 100644 index 00000000..b0396a89 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_log_36.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_switch_provider_36.png b/app/src/main/res/drawable-xxhdpi/ic_switch_provider_36.png new file mode 100644 index 00000000..229e3147 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_switch_provider_36.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_about_36.png b/app/src/main/res/drawable-xxxhdpi/ic_about_36.png new file mode 100644 index 00000000..bbbd987f Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_about_36.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_always_on_36.png b/app/src/main/res/drawable-xxxhdpi/ic_always_on_36.png new file mode 100644 index 00000000..f8e2a790 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_always_on_36.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_battery_36.png b/app/src/main/res/drawable-xxxhdpi/ic_battery_36.png new file mode 100644 index 00000000..70087a20 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_battery_36.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_donate_36.png b/app/src/main/res/drawable-xxxhdpi/ic_donate_36.png new file mode 100644 index 00000000..cf04212d Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_donate_36.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_log_36.png b/app/src/main/res/drawable-xxxhdpi/ic_log_36.png new file mode 100644 index 00000000..30f5e866 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_log_36.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_switch_provider_36.png b/app/src/main/res/drawable-xxxhdpi/ic_switch_provider_36.png new file mode 100644 index 00000000..56a9bd29 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_switch_provider_36.png differ diff --git a/app/src/main/res/layout-xlarge/v_icon_text_list_item.xml b/app/src/main/res/layout-xlarge/v_icon_text_list_item.xml new file mode 100644 index 00000000..100016a6 --- /dev/null +++ b/app/src/main/res/layout-xlarge/v_icon_text_list_item.xml @@ -0,0 +1,31 @@ + + + + + + diff --git a/app/src/main/res/layout/v_icon_text_list_item.xml b/app/src/main/res/layout/v_icon_text_list_item.xml new file mode 100644 index 00000000..0631b2fc --- /dev/null +++ b/app/src/main/res/layout/v_icon_text_list_item.xml @@ -0,0 +1,31 @@ + + + + + + diff --git a/app/src/main/res/layout/v_switch_list_item.xml b/app/src/main/res/layout/v_switch_list_item.xml index bdb9a74c..26060a73 100644 --- a/app/src/main/res/layout/v_switch_list_item.xml +++ b/app/src/main/res/layout/v_switch_list_item.xml @@ -1,15 +1,48 @@ - \ No newline at end of file + > + + + + + + + \ No newline at end of file -- cgit v1.2.3 From 45aa68c21135006765bf4586519d637ee71e33ec Mon Sep 17 00:00:00 2001 From: cyBerta Date: Wed, 10 Jul 2019 03:25:45 +0200 Subject: replace anonymous function with lambda in AbstractProviderDetailActivity --- .../AbstractProviderDetailActivity.java | 33 ++++++++++------------ 1 file changed, 15 insertions(+), 18 deletions(-) (limited to 'app/src') diff --git a/app/src/main/java/se/leap/bitmaskclient/AbstractProviderDetailActivity.java b/app/src/main/java/se/leap/bitmaskclient/AbstractProviderDetailActivity.java index 36dd5868..28e5f5af 100644 --- a/app/src/main/java/se/leap/bitmaskclient/AbstractProviderDetailActivity.java +++ b/app/src/main/java/se/leap/bitmaskclient/AbstractProviderDetailActivity.java @@ -62,25 +62,22 @@ public abstract class AbstractProviderDetailActivity extends ConfigWizardBaseAct android.R.id.text1, optionsList.toArray(new String[optionsList.size()]) )); - options.setOnItemClickListener(new AdapterView.OnItemClickListener() { - @Override - public void onItemClick(AdapterView parent, View view, int position, long id) { - String text = ((TextView) view).getText().toString(); - Intent intent; - if (text.equals(getString(R.string.login_to_profile))) { - Log.d(TAG, "login selected"); - intent = new Intent(getApplicationContext(), LoginActivity.class); - } else if (text.equals(getString(R.string.create_profile))) { - Log.d(TAG, "signup selected"); - intent = new Intent(getApplicationContext(), SignupActivity.class); - } else { - onAnonymouslySelected(); - return; - } - intent.putExtra(PROVIDER_KEY, provider); - intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); - startActivityForResult(intent, REQUEST_CODE_CONFIGURE_LEAP); + options.setOnItemClickListener((parent, view, position, id) -> { + String text = ((TextView) view).getText().toString(); + Intent intent; + if (text.equals(getString(R.string.login_to_profile))) { + Log.d(TAG, "login selected"); + intent = new Intent(getApplicationContext(), LoginActivity.class); + } else if (text.equals(getString(R.string.create_profile))) { + Log.d(TAG, "signup selected"); + intent = new Intent(getApplicationContext(), SignupActivity.class); + } else { + onAnonymouslySelected(); + return; } + intent.putExtra(PROVIDER_KEY, provider); + intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); + startActivityForResult(intent, REQUEST_CODE_CONFIGURE_LEAP); }); } -- cgit v1.2.3 From 47eb65c817605635c0de4612b492f8f60e22789b Mon Sep 17 00:00:00 2001 From: cyBerta Date: Wed, 10 Jul 2019 11:42:35 +0200 Subject: use same layout for provider item as for settings items in navigation drawer --- .../java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/src') diff --git a/app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java b/app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java index 635238f2..cc93fc96 100644 --- a/app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java @@ -188,7 +188,7 @@ public class NavigationDrawerFragment extends Fragment { setupSettingsListAdapter(); setupSettingsListView(); accountListAdapter = new ArrayAdapter<>(actionBar.getThemedContext(), - R.layout.v_single_list_item, + R.layout.v_icon_text_list_item, android.R.id.text1); refreshAccountListAdapter(); setupAccountsListView(); -- cgit v1.2.3 From dbef6cf67f3b4b31a806564a04a18a77ab636eb1 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Thu, 11 Jul 2019 11:11:11 +0200 Subject: fix error hint color for older android versions --- app/src/main/res/layout/v_provider_credentials.xml | 8 +++++--- app/src/main/res/values/styles.xml | 5 +++++ 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'app/src') diff --git a/app/src/main/res/layout/v_provider_credentials.xml b/app/src/main/res/layout/v_provider_credentials.xml index 0bfdcc47..65f554aa 100644 --- a/app/src/main/res/layout/v_provider_credentials.xml +++ b/app/src/main/res/layout/v_provider_credentials.xml @@ -18,7 +18,7 @@ android:hint="@string/auth_username" app:errorEnabled="true" android:layout_marginTop="@dimen/standard_margin" - > + app:errorTextAppearance="@style/error_appearance"> + app:errorEnabled="true" + app:errorTextAppearance="@style/error_appearance"> + android:visibility="gone" + app:errorTextAppearance="@style/error_appearance"> bold + + \ No newline at end of file -- cgit v1.2.3 From cc024ad84e29b9dac837ef9ee2fc45125f47c463 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Thu, 11 Jul 2019 11:14:20 +0200 Subject: add little elevation to custom buttons, change general button shape to custom button shape --- app/src/main/res/drawable/cust_button_primary.xml | 26 +++++----------------- .../res/drawable/cust_button_primary_disabled.xml | 19 ++++++++++++++++ .../res/drawable/cust_button_primary_pressed.xml | 10 +++++++++ .../main/res/drawable/cust_button_primary_rect.xml | 24 ++++++++++++++++++++ .../res/drawable/cust_button_primary_released.xml | 19 ++++++++++++++++ app/src/main/res/values/colors.xml | 2 ++ app/src/main/res/values/dimens.xml | 1 + app/src/main/res/values/styles.xml | 2 ++ app/src/main/res/values/themes.xml | 1 + 9 files changed, 83 insertions(+), 21 deletions(-) create mode 100644 app/src/main/res/drawable/cust_button_primary_disabled.xml create mode 100644 app/src/main/res/drawable/cust_button_primary_pressed.xml create mode 100644 app/src/main/res/drawable/cust_button_primary_rect.xml create mode 100644 app/src/main/res/drawable/cust_button_primary_released.xml (limited to 'app/src') diff --git a/app/src/main/res/drawable/cust_button_primary.xml b/app/src/main/res/drawable/cust_button_primary.xml index 3b0f7e26..31f9fbdd 100644 --- a/app/src/main/res/drawable/cust_button_primary.xml +++ b/app/src/main/res/drawable/cust_button_primary.xml @@ -1,24 +1,8 @@ - - - - - - - - - - - - - - - - - - - - - + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/cust_button_primary_disabled.xml b/app/src/main/res/drawable/cust_button_primary_disabled.xml new file mode 100644 index 00000000..f62ecce3 --- /dev/null +++ b/app/src/main/res/drawable/cust_button_primary_disabled.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/cust_button_primary_pressed.xml b/app/src/main/res/drawable/cust_button_primary_pressed.xml new file mode 100644 index 00000000..012631e7 --- /dev/null +++ b/app/src/main/res/drawable/cust_button_primary_pressed.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/cust_button_primary_rect.xml b/app/src/main/res/drawable/cust_button_primary_rect.xml new file mode 100644 index 00000000..c83d4e62 --- /dev/null +++ b/app/src/main/res/drawable/cust_button_primary_rect.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/cust_button_primary_released.xml b/app/src/main/res/drawable/cust_button_primary_released.xml new file mode 100644 index 00000000..b9c2020f --- /dev/null +++ b/app/src/main/res/drawable/cust_button_primary_released.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 02a3a437..21c24663 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -2,9 +2,11 @@ #b39ddb #ac97d2 + #20000000 #fffafafa #ef9a9a #a5d6a7 + #AAAAAA #424242 #3b3b3b diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 338ad4d5..1595ff9b 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -41,4 +41,5 @@ 0.9 20dp + 3dp \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 485a7497..89f55b4c 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -62,6 +62,8 @@