summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2013-07-09 17:35:59 +0200
committercyBerta <richy@cyborgsociety.org>2013-11-15 23:14:47 +0100
commitea05c4bc15c8b1e96782706340412160364ebdc9 (patch)
treed5cadfd0a2c5ee413c3465ba98d84abfabfe963f
parent60e56246f95adca94e9dce02e193e5217e372d5a (diff)
Dashboard progressbar lives below the status line.
I've renamed configuration wizard progressbar, because both had the same name and that provoked a conflict.
-rw-r--r--res/layout/client_dashboard.xml14
-rw-r--r--res/layout/configuration_wizard_activity.xml11
-rw-r--r--src/se/leap/bitmaskclient/ConfigurationWizard.java2
-rw-r--r--src/se/leap/bitmaskclient/Dashboard.java24
-rw-r--r--src/se/leap/bitmaskclient/ProviderAPI.java1
5 files changed, 38 insertions, 14 deletions
diff --git a/res/layout/client_dashboard.xml b/res/layout/client_dashboard.xml
index 9f05cfbc..21008b45 100644
--- a/res/layout/client_dashboard.xml
+++ b/res/layout/client_dashboard.xml
@@ -11,7 +11,7 @@
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="?android:attr/selectableItemBackground" >
-
+
<LinearLayout
android:id="@+id/providerLabelWrapper"
android:layout_width="wrap_content"
@@ -65,6 +65,16 @@
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.11"
- android:orientation="vertical" />
+ android:orientation="vertical" >
+
+ <ProgressBar
+ android:id="@+id/progressbar_dashboard"
+ style="?android:attr/progressBarStyleHorizontal"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:visibility="gone" />
+
+ </LinearLayout>
</LinearLayout> \ No newline at end of file
diff --git a/res/layout/configuration_wizard_activity.xml b/res/layout/configuration_wizard_activity.xml
index 4bc4a8e1..ac994c59 100644
--- a/res/layout/configuration_wizard_activity.xml
+++ b/res/layout/configuration_wizard_activity.xml
@@ -6,14 +6,15 @@
tools:context=".ConfigurationWizard" >
<ProgressBar
- android:id="@+id/progressbar"
+ android:id="@+id/progressbar_configuration_wizard"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
+ android:background="@android:color/transparent"
android:max="3"
- android:maxHeight="20dip"
- android:minHeight="20dip"
- android:progress="0"
- android:background="@android:color/transparent"/>
+ android:maxHeight="10dip"
+ android:minHeight="10dip"
+ android:progress="0"
+ android:progressDrawable="@android:drawable/progress_horizontal" />
</RelativeLayout> \ No newline at end of file
diff --git a/src/se/leap/bitmaskclient/ConfigurationWizard.java b/src/se/leap/bitmaskclient/ConfigurationWizard.java
index ea85361d..fa944645 100644
--- a/src/se/leap/bitmaskclient/ConfigurationWizard.java
+++ b/src/se/leap/bitmaskclient/ConfigurationWizard.java
@@ -70,7 +70,7 @@ implements ProviderListFragment.Callbacks, NewProviderDialog.NewProviderDialogIn
super.onCreate(savedInstanceState);
setContentView(R.layout.configuration_wizard_activity);
- mProgressBar = (ProgressBar) findViewById(R.id.progressbar);
+ mProgressBar = (ProgressBar) findViewById(R.id.progressbar_configuration_wizard);
mProgressBar.setVisibility(ProgressBar.INVISIBLE);
providerAPI_result_receiver = new ProviderAPIResultReceiver(new Handler());
diff --git a/src/se/leap/bitmaskclient/Dashboard.java b/src/se/leap/bitmaskclient/Dashboard.java
index ec1d32c9..7b47c667 100644
--- a/src/se/leap/bitmaskclient/Dashboard.java
+++ b/src/se/leap/bitmaskclient/Dashboard.java
@@ -41,6 +41,11 @@ import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
+import android.view.ViewStub;
+import android.widget.CompoundButton;
+import android.widget.ProgressBar;
+import android.widget.RelativeLayout;
+import android.widget.Switch;
import android.widget.TextView;
import android.widget.Toast;
@@ -49,6 +54,7 @@ import android.widget.Toast;
* and access to preferences.
*
* @author Sean Leonard <meanderingcode@aetherislands.net>
+ * @author parmegv
*/
public class Dashboard extends Activity implements LogInDialog.LogInDialogInterface,Receiver {
@@ -59,7 +65,7 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf
final public static String ACTION_QUIT = "quit";
private ProgressDialog mProgressDialog;
-
+ private ProgressBar mProgressBar;
private static Context app;
private static SharedPreferences preferences;
private static Provider provider;
@@ -77,6 +83,8 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf
app = this;
PRNGFixes.apply();
+ mProgressBar = (ProgressBar) findViewById(R.id.progressbar_dashboard);
+
ConfigHelper.setSharedPreferences(getSharedPreferences(SHARED_PREFERENCES, MODE_PRIVATE));
preferences = ConfigHelper.shared_preferences;
@@ -236,8 +244,9 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf
provider_API_command.putExtra(ProviderAPI.PARAMETERS, parameters);
provider_API_command.putExtra(ProviderAPI.RECEIVER_KEY, providerAPI_result_receiver);
- if(mProgressDialog != null) mProgressDialog.dismiss();
- mProgressDialog = ProgressDialog.show(this, getResources().getString(R.string.authenticating_title), getResources().getString(R.string.authenticating_message), true);
+ //if(mProgressDialog != null) mProgressDialog.dismiss();
+ mProgressBar.setVisibility(ProgressBar.VISIBLE);
+ //mProgressDialog = ProgressDialog.show(this, getResources().getString(R.string.authenticating_title), getResources().getString(R.string.authenticating_message), true);
startService(provider_API_command);
}
@@ -316,6 +325,7 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf
String session_id_cookie_key = resultData.getString(ProviderAPI.SESSION_ID_COOKIE_KEY);
String session_id_string = resultData.getString(ProviderAPI.SESSION_ID_KEY);
setResult(RESULT_OK);
+
authed_eip = true;
<<<<<<< HEAD:src/se/leap/bitmaskclient/Dashboard.java
ConfigHelper.saveSharedPref(EIP.AUTHED_EIP, authed_eip);
@@ -324,11 +334,13 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf
>>>>>>> 53c2704... Authenticated status remembered after exit.:src/se/leap/leapclient/Dashboard.java
invalidateOptionsMenu();
- //Cookie session_id = new BasicClientCookie(session_id_cookie_key, session_id_string);
- downloadAuthedUserCertificate(/*session_id*/);
+ mProgressBar.setVisibility(ProgressBar.GONE);
+
+ //Cookie session_id = new BasicClientCookie(session_id_cookie_key, session_id_string);
+ downloadAuthedUserCertificate(/*session_id*/);
} else if(resultCode == ProviderAPI.SRP_AUTHENTICATION_FAILED) {
- mProgressDialog.dismiss();
logInDialog(getCurrentFocus(), resultData);
+ mProgressBar.setVisibility(ProgressBar.GONE);
} else if(resultCode == ProviderAPI.LOGOUT_SUCCESSFUL) {
authed_eip = false;
<<<<<<< HEAD:src/se/leap/bitmaskclient/Dashboard.java
diff --git a/src/se/leap/bitmaskclient/ProviderAPI.java b/src/se/leap/bitmaskclient/ProviderAPI.java
index 6ed3a294..e56c6ca9 100644
--- a/src/se/leap/bitmaskclient/ProviderAPI.java
+++ b/src/se/leap/bitmaskclient/ProviderAPI.java
@@ -68,6 +68,7 @@ import android.os.Handler;
import android.os.ResultReceiver;
import android.util.Base64;
import android.util.Log;
+import android.widget.ProgressBar;
import android.widget.Toast;
/**