From b065fa48e802487198ad73915dd017c4464e8c62 Mon Sep 17 00:00:00 2001 From: Fup Duck Date: Fri, 19 Jan 2018 17:34:45 +0100 Subject: improve layout * improve layout * gracefully handle orientation changes * respect small devices * set correct colors for buttons, error messages... --- .../se/leap/bitmaskclient/ConfigurationWizard.java | 27 +++++++++++----------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'app/src/production/java') diff --git a/app/src/production/java/se/leap/bitmaskclient/ConfigurationWizard.java b/app/src/production/java/se/leap/bitmaskclient/ConfigurationWizard.java index b1deae67..f7102508 100644 --- a/app/src/production/java/se/leap/bitmaskclient/ConfigurationWizard.java +++ b/app/src/production/java/se/leap/bitmaskclient/ConfigurationWizard.java @@ -40,18 +40,17 @@ public class ConfigurationWizard extends BaseConfigurationWizard { public void showAndSelectProvider(String provider_main_url) { try { - selectedProvider = new Provider(new URL((provider_main_url))); - adapter.add(selectedProvider); + provider = new Provider(new URL((provider_main_url))); + adapter.add(provider); adapter.saveProviders(); - autoSelectProvider(selectedProvider); + autoSelectProvider(provider); } catch (MalformedURLException e) { e.printStackTrace(); } } private void autoSelectProvider(Provider provider) { - selectedProvider = provider; - onItemSelectedUi(); + this.provider = provider; onItemSelectedLogic(); } @@ -63,15 +62,15 @@ public class ConfigurationWizard extends BaseConfigurationWizard { mConfigState.setAction(SETTING_UP_PROVIDER); Intent providerApiCommand = new Intent(this, ProviderAPI.class); Bundle parameters = new Bundle(); - parameters.putString(Provider.MAIN_URL, selectedProvider.getMainUrl().toString()); - if (selectedProvider.hasCertificatePin()){ - parameters.putString(Provider.CA_CERT_FINGERPRINT, selectedProvider.certificatePin()); + parameters.putString(Provider.MAIN_URL, provider.getMainUrl().toString()); + if (provider.hasCertificatePin()){ + parameters.putString(Provider.CA_CERT_FINGERPRINT, provider.certificatePin()); } - if (selectedProvider.hasCaCert()) { - parameters.putString(Provider.CA_CERT, selectedProvider.getCaCert()); + if (provider.hasCaCert()) { + parameters.putString(Provider.CA_CERT, provider.getCaCert()); } - if (selectedProvider.hasDefinition()) { - parameters.putString(Provider.KEY, selectedProvider.getDefinition().toString()); + if (provider.hasDefinition()) { + parameters.putString(Provider.KEY, provider.getDefinition().toString()); } providerApiCommand.setAction(ProviderAPI.SET_UP_PROVIDER); @@ -87,14 +86,14 @@ public class ConfigurationWizard extends BaseConfigurationWizard { addAndSelectNewProvider(ProviderAPI.lastProviderMainUrl()); } else { showProgressBar(); - adapter.hideAllBut(adapter.indexOf(selectedProvider)); + adapter.hideAllBut(adapter.indexOf(provider)); Intent providerApiCommand = new Intent(this, ProviderAPI.class); providerApiCommand.setAction(ProviderAPI.SET_UP_PROVIDER); providerApiCommand.putExtra(ProviderAPI.RECEIVER_KEY, providerAPIResultReceiver); Bundle parameters = new Bundle(); - parameters.putString(Provider.MAIN_URL, selectedProvider.getMainUrl().toString()); + parameters.putString(Provider.MAIN_URL, provider.getMainUrl().toString()); providerApiCommand.putExtra(ProviderAPI.PARAMETERS, parameters); startService(providerApiCommand); -- cgit v1.2.3