diff options
author | Parménides GV <parmegv@sdf.org> | 2015-04-16 13:16:04 +0200 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2015-04-22 12:36:39 +0200 |
commit | 90c28f492b800b706c1d6f14482baf3e75c4be7e (patch) | |
tree | 27e433acfdd514a347c19e20e05facb4c3ab4ce1 /app/src/main/java | |
parent | cdeaf6c2ae2fa96a2ef1e0ae6c931c6d50b27271 (diff) |
Remove eip switch.
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/EipFragment.java | 31 |
1 files changed, 2 insertions, 29 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/EipFragment.java b/app/src/main/java/se/leap/bitmaskclient/EipFragment.java index 454530be..a9ceec52 100644 --- a/app/src/main/java/se/leap/bitmaskclient/EipFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/EipFragment.java @@ -40,8 +40,6 @@ public class EipFragment extends Fragment implements Observer { protected static final String STATUS_MESSAGE = TAG + ".status_message"; public static final String START_ON_BOOT = "start on boot"; - @InjectView(R.id.eipSwitch) - Switch eip_switch; @InjectView(R.id.status_message) TextView status_message; @InjectView(R.id.eipProgress) @@ -74,9 +72,6 @@ public class EipFragment extends Fragment implements Observer { View view = inflater.inflate(R.layout.eip_service_fragment, container, false); ButterKnife.inject(this, view); - if (eip_status.isConnecting()) - eip_switch.setVisibility(View.VISIBLE); - Bundle arguments = getArguments(); if (arguments != null && arguments.containsKey(START_ON_BOOT) && arguments.getBoolean(START_ON_BOOT)) startEipFromScratch(); @@ -110,7 +105,7 @@ public class EipFragment extends Fragment implements Observer { } protected void saveStatus() { - boolean is_on = eip_switch.isChecked(); + boolean is_on = eip_status.isConnected() || eip_status.isConnecting(); Dashboard.preferences.edit().putBoolean(Dashboard.START_ON_BOOT, is_on).commit(); } @@ -125,17 +120,7 @@ public class EipFragment extends Fragment implements Observer { } void handleNewVpnCertificate() { - handleSwitch(!eip_switch.isEnabled()); - } - - @OnCheckedChanged(R.id.eipSwitch) - void handleSwitch(boolean isChecked) { - if (isChecked) - handleSwitchOn(); - else - handleSwitchOff(); - - saveStatus(); + handleIcon(); } private void handleSwitchOn() { @@ -183,7 +168,6 @@ public class EipFragment extends Fragment implements Observer { .setNegativeButton(dashboard.getString(R.string.no), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - eip_switch.setChecked(true); } }) .show(); @@ -193,13 +177,9 @@ public class EipFragment extends Fragment implements Observer { wants_to_connect = false; eip_status.setConnecting(); progress_bar.setVisibility(View.VISIBLE); - eip_switch.setVisibility(View.VISIBLE); String status = dashboard.getString(R.string.eip_status_start_pending); status_message.setText(status); - if (!eip_switch.isChecked()) { - eip_switch.setChecked(true); - } saveStatus(); eipCommand(Constants.ACTION_START_EIP); } @@ -239,7 +219,6 @@ public class EipFragment extends Fragment implements Observer { .setNegativeButton(dashboard.getString(R.string.no), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - eip_switch.setChecked(true); } }) .show(); @@ -307,9 +286,6 @@ public class EipFragment extends Fragment implements Observer { private void adjustSwitch() { if (eip_status.isConnected() || eip_status.isConnecting()) { - if (!eip_switch.isChecked()) { - eip_switch.setChecked(true); - } if(eip_status.isConnecting()) { vpn_status_image.showProgress(true); vpn_status_image.setIcon(R.drawable.ic_stat_vpn_empty_halo, R.drawable.ic_stat_vpn_empty_halo); @@ -318,9 +294,6 @@ public class EipFragment extends Fragment implements Observer { vpn_status_image.setIcon(R.drawable.ic_stat_vpn, R.drawable.ic_stat_vpn); } } else { - if (eip_switch.isChecked()) { - eip_switch.setChecked(false); - } vpn_status_image.setIcon(R.drawable.ic_stat_vpn_offline, R.drawable.ic_stat_vpn_offline); vpn_status_image.showProgress(false); } |