summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2013-09-02 20:12:26 +0200
committercyBerta <richy@cyborgsociety.org>2013-11-15 23:25:16 +0100
commita9904f63729fc01c6f7c4fe767cf9540f7405360 (patch)
tree885bfb779b79fd0007d4078c3609370ceebd07bb
parente865889715b8511dd432b89958e27975592d98ea (diff)
Label for the CW progressbar.
-rw-r--r--res/layout/configuration_wizard_activity.xml11
-rwxr-xr-xres/values/strings.xml4
-rw-r--r--src/se/leap/bitmaskclient/ConfigurationWizard.java16
3 files changed, 27 insertions, 4 deletions
diff --git a/res/layout/configuration_wizard_activity.xml b/res/layout/configuration_wizard_activity.xml
index b80294ba..f3d0e48b 100644
--- a/res/layout/configuration_wizard_activity.xml
+++ b/res/layout/configuration_wizard_activity.xml
@@ -11,5 +11,16 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:max="3" />
+
+ <TextView
+ android:id="@+id/progressbar_description"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:fadingEdge="horizontal"
+ android:singleLine="true"
+ android:text="@string/configuring_provider"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:layout_centerHorizontal="true"
+ android:textColor="@android:color/holo_blue_bright" />
</RelativeLayout> \ No newline at end of file
diff --git a/res/values/strings.xml b/res/values/strings.xml
index ba05b19b..dde3ad3f 100755
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -222,8 +222,7 @@
<string name="faq_hint">Be sure to also check out the FAQ. There is a quick start guide.</string>
<string name="correcttls">Convert remote-tls format from OpenVPN 2.2 to 2.3 format</string>
<string name="faq_routing_title">Routing/Interface Configuration</string>
- <string name="faq_routing">The Routing and interface configuration is not done via traditionell ifconfig/route command but by using the VPNService API. This results in a different routing configuration than on other OSes. The configuration only consists of the IP of the tunnel interface and the networks that should be routed over this interface. Especially no peer partner address or gateway address is needed. Special routes to reach the VPN Server (for example added when using redirect-gateway) are not needed either. The application will consequently ignore these settings when importing a configuration. The app ensures with the VPNService API that the connection to the server is not routed through the VPN tunnel. Since only specifing networks to be routed via tunnel is supported extra routes not pointing to the tunnel cannot be supported either. (e.g. route x.x.x.x y.y.y.y net_gateway). The show information button in the log windows show the current configuration of the VPNService network configuration.</
-string>
+ <string name="faq_routing">The Routing and interface configuration is not done via traditionell ifconfig/route command but by using the VPNService API. This results in a different routing configuration than on other OSes. The configuration only consists of the IP of the tunnel interface and the networks that should be routed over this interface. Especially no peer partner address or gateway address is needed. Special routes to reach the VPN Server (for example added when using redirect-gateway) are not needed either. The application will consequently ignore these settings when importing a configuration. The app ensures with the VPNService API that the connection to the server is not routed through the VPN tunnel. Since only specifing networks to be routed via tunnel is supported extra routes not pointing to the tunnel cannot be supported either. (e.g. route x.x.x.x y.y.y.y net_gateway). The show information button in the log windows show the current configuration of the VPNService network configuration.</string>
<string name="persisttun_summary">Do not fallback to no VPN connection when OpenVPN is reconnecting.</string>
<string name="persistent_tun_title">Persistent tun</string>
<string name="translation">Translation</string>
@@ -308,6 +307,7 @@ string>
<string name="server_is_down_message">Server is down.</string>
<string name="malformed_url">It doesn\'t seem to be a Bitmask provider.</string>
<string name="certificate_error">This is not a trusted Bitmask provider.</string>
+ <string name="configuring_provider">Configuring provider</string>
<string name="authenticating_title">Authenticating</string>
<string name="authenticating_message">Authenticating with entered login and password.</string>
<string name="logout_title">Log out</string>
diff --git a/src/se/leap/bitmaskclient/ConfigurationWizard.java b/src/se/leap/bitmaskclient/ConfigurationWizard.java
index 94400eaa..5839816b 100644
--- a/src/se/leap/bitmaskclient/ConfigurationWizard.java
+++ b/src/se/leap/bitmaskclient/ConfigurationWizard.java
@@ -46,7 +46,9 @@ import android.view.View.MeasureSpec;
import android.view.WindowManager;
import android.widget.ListAdapter;
import android.widget.ListView;
+import android.widget.ProgressBar;
import android.widget.RelativeLayout;
+import android.widget.TextView;
/**
* Activity that builds and shows the list of known available providers.
@@ -61,6 +63,7 @@ implements ProviderListFragment.Callbacks, NewProviderDialog.NewProviderDialogIn
private ProviderItem mSelectedProvider;
private ProgressBar mProgressBar;
+ private TextView progressbar_description;
private ProviderListFragment provider_list_fragment;
private Intent mConfigState = new Intent();
@@ -80,7 +83,8 @@ implements ProviderListFragment.Callbacks, NewProviderDialog.NewProviderDialogIn
setContentView(R.layout.configuration_wizard_activity);
mProgressBar = (ProgressBar) findViewById(R.id.progressbar_configuration_wizard);
mProgressBar.setVisibility(ProgressBar.INVISIBLE);
-
+ progressbar_description = (TextView) findViewById(R.id.progressbar_description);
+ progressbar_description.setVisibility(TextView.INVISIBLE);
providerAPI_result_receiver = new ProviderAPIResultReceiver(new Handler());
providerAPI_result_receiver.setReceiver(this);
@@ -158,6 +162,7 @@ implements ProviderListFragment.Callbacks, NewProviderDialog.NewProviderDialogIn
// TODO Auto-generated catch block
e.printStackTrace();
mProgressBar.setVisibility(ProgressBar.GONE);
+ progressbar_description.setVisibility(TextView.GONE);
refreshProviderList(0);
//Toast.makeText(this, getResources().getString(R.string.config_error_parsing), Toast.LENGTH_LONG);
setResult(RESULT_CANCELED, mConfigState);
@@ -168,6 +173,7 @@ implements ProviderListFragment.Callbacks, NewProviderDialog.NewProviderDialogIn
showDownloadFailedDialog(getCurrentFocus(), reason_to_fail);
refreshProviderList(0);
mProgressBar.setVisibility(ProgressBar.GONE);
+ progressbar_description.setVisibility(TextView.GONE);
setResult(RESULT_CANCELED, mConfigState);
}
else if(resultCode == ProviderAPI.CORRECTLY_DOWNLOADED_JSON_FILES) {
@@ -178,6 +184,7 @@ implements ProviderListFragment.Callbacks, NewProviderDialog.NewProviderDialogIn
} else {
mProgressBar.incrementProgressBy(1);
mProgressBar.setVisibility(ProgressBar.GONE);
+ progressbar_description.setVisibility(TextView.GONE);
refreshProviderList(0);
//Toast.makeText(getApplicationContext(), R.string.success, Toast.LENGTH_LONG).show();
setResult(RESULT_OK);
@@ -191,17 +198,20 @@ implements ProviderListFragment.Callbacks, NewProviderDialog.NewProviderDialogIn
refreshProviderList(0);
//Toast.makeText(getApplicationContext(), R.string.incorrectly_downloaded_json_files_message,
mProgressBar.setVisibility(ProgressBar.GONE);
+ progressbar_description.setVisibility(TextView.GONE);
setResult(RESULT_CANCELED, mConfigState);
}
else if(resultCode == ProviderAPI.CORRECTLY_DOWNLOADED_CERTIFICATE) {
mProgressBar.incrementProgressBy(1);
mProgressBar.setVisibility(ProgressBar.GONE);
+ progressbar_description.setVisibility(TextView.GONE);
//refreshProviderList(0);
setResult(RESULT_OK);
showProviderDetails(getCurrentFocus());
} else if(resultCode == ProviderAPI.INCORRECTLY_DOWNLOADED_CERTIFICATE) {
- refreshProviderList(0);
+ //refreshProviderList(0);
mProgressBar.setVisibility(ProgressBar.GONE);
+ progressbar_description.setVisibility(TextView.GONE);
//Toast.makeText(getApplicationContext(), R.string.incorrectly_downloaded_certificate_message, Toast.LENGTH_LONG).show();
setResult(RESULT_CANCELED, mConfigState);
}
@@ -254,10 +264,12 @@ implements ProviderListFragment.Callbacks, NewProviderDialog.NewProviderDialogIn
private void startProgressBar(int list_item_index) {
mProgressBar.setVisibility(ProgressBar.VISIBLE);
+ progressbar_description.setVisibility(TextView.VISIBLE);
mProgressBar.setProgress(0);
mProgressBar.setMax(3);
int measured_height = listItemHeight(list_item_index);
mProgressBar.setTranslationY(measured_height);
+ progressbar_description.setTranslationY(measured_height + mProgressBar.getHeight());
}
private int getProviderIndex(String id) {