From 56a998deef38a635e2a2e61dd1f516b78d24c9c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Tue, 9 Dec 2014 21:30:25 +0100 Subject: SessionDialog restores eip switch if necessary. --- app/src/main/java/se/leap/bitmaskclient/Dashboard.java | 2 +- app/src/main/java/se/leap/bitmaskclient/EipServiceFragment.java | 4 +++- app/src/main/java/se/leap/bitmaskclient/SessionDialog.java | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'app/src') diff --git a/app/src/main/java/se/leap/bitmaskclient/Dashboard.java b/app/src/main/java/se/leap/bitmaskclient/Dashboard.java index c7691ed4..3ecf5e52 100644 --- a/app/src/main/java/se/leap/bitmaskclient/Dashboard.java +++ b/app/src/main/java/se/leap/bitmaskclient/Dashboard.java @@ -54,7 +54,7 @@ import se.leap.bitmaskclient.eip.EipStatus; * @author Sean Leonard * @author parmegv */ -public class Dashboard extends Activity implements SessionDialog.LogInDialogInterface, ProviderAPIResultReceiver.Receiver { +public class Dashboard extends Activity implements SessionDialog.SessionDialogInterface, ProviderAPIResultReceiver.Receiver { protected static final int CONFIGURE_LEAP = 0; protected static final int SWITCH_PROVIDER = 1; diff --git a/app/src/main/java/se/leap/bitmaskclient/EipServiceFragment.java b/app/src/main/java/se/leap/bitmaskclient/EipServiceFragment.java index a8ffda72..507cfe74 100644 --- a/app/src/main/java/se/leap/bitmaskclient/EipServiceFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/EipServiceFragment.java @@ -129,7 +129,9 @@ public class EipServiceFragment extends Fragment implements Observer { else if(canLogInToStartEIP()) { Log.d(TAG, "Can Log In to start EIP"); Dashboard dashboard = (Dashboard) parent_activity; - dashboard.logInDialog(Bundle.EMPTY); + Bundle bundle = new Bundle(); + bundle.putBoolean(IS_PENDING, true); + dashboard.logInDialog(bundle); } } diff --git a/app/src/main/java/se/leap/bitmaskclient/SessionDialog.java b/app/src/main/java/se/leap/bitmaskclient/SessionDialog.java index 9676faa8..60382cf0 100644 --- a/app/src/main/java/se/leap/bitmaskclient/SessionDialog.java +++ b/app/src/main/java/se/leap/bitmaskclient/SessionDialog.java @@ -121,13 +121,13 @@ public class SessionDialog extends DialogFragment{ * @author parmegv * */ - public interface LogInDialogInterface { + public interface SessionDialogInterface { public void logIn(String username, String password); public void signUp(String username, String password); public void cancelLoginOrSignup(); } - LogInDialogInterface interface_with_Dashboard; + SessionDialogInterface interface_with_Dashboard; /** * @return a new instance of this DialogFragment. @@ -143,7 +143,7 @@ public class SessionDialog extends DialogFragment{ public void onAttach(Activity activity) { super.onAttach(activity); try { - interface_with_Dashboard = (LogInDialogInterface) activity; + interface_with_Dashboard = (SessionDialogInterface) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement LogInDialogListener"); -- cgit v1.2.3