Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed bug in dropbox wizard. Cleanups.

  • Loading branch information...
commit 20d33ff6d424d31fc7efc1889cd3ace6efd2478f 1 parent 68910ec
@hdweiss hdweiss authored
View
8 src/com/matburt/mobileorg/Gui/Wizard/WizardActivity.java
@@ -26,8 +26,6 @@ public void onCreate(Bundle savedInstanceState) {
// when wizard first starts can't go to next page
wizardView.setNavButtonStateOnPage(0, false, WizardView.FIRST_PAGE);
- // setup page 1
- // get ids and pointers to sync radio buttons
RadioGroup syncGroup = (RadioGroup) findViewById(R.id.sync_group);
syncGroup.clearCheck();
syncGroup.setOnCheckedChangeListener(this);
@@ -51,13 +49,15 @@ protected void onPause() {
@Override
protected void onResume() {
super.onResume();
- //dropboxWizard.handleDropboxResume(wizardView);
+
+ if(activeWizard != null)
+ activeWizard.refresh();
}
@Override
public void onCheckedChanged(RadioGroup arg, int checkedId) {
this.activeWizard = Wizard.getWizard(getWizardType(checkedId), wizardView,
- getApplicationContext());
+ this);
// allow scrolling to next page
wizardView.enablePage(0);
}
View
7 src/com/matburt/mobileorg/Gui/Wizard/Wizards/DropboxWizard.java
@@ -93,7 +93,7 @@ public View createDropboxList() {
folderList.setAdapter(directoryAdapter);
directoryAdapter.notifyDataSetChanged();
-
+ setupDoneButton(view);
wizardView.addPage(view);
wizardView.enablePage(1);
// enable nav buttons on that page
@@ -102,6 +102,11 @@ public View createDropboxList() {
return view;
}
+ @Override
+ public void refresh() {
+ handleDropboxResume();
+ }
+
public void handleDropboxResume() {
if (dropboxLoginAttempted
&& dropboxApi.getSession().authenticationSuccessful()) {
View
9 src/com/matburt/mobileorg/Gui/Wizard/Wizards/NullWizard.java
@@ -4,6 +4,8 @@
import com.matburt.mobileorg.Gui.Wizard.WizardView;
import android.content.Context;
+import android.content.SharedPreferences;
+import android.preference.PreferenceManager;
import android.view.LayoutInflater;
import android.view.View;
@@ -23,6 +25,7 @@ public void createNullConfig() {
View view = LayoutInflater.from(context).inflate(
R.layout.wizard_null, null);
+ setupDoneButton(view);
wizardView.addPage(view);
wizardView.setNavButtonStateOnPage(1, true, WizardView.LAST_PAGE);
wizardView.enablePage(1);
@@ -30,5 +33,11 @@ public void createNullConfig() {
@Override
public void saveSettings() {
+ SharedPreferences appSettings = PreferenceManager
+ .getDefaultSharedPreferences(context);
+ SharedPreferences.Editor editor = appSettings.edit();
+
+ editor.putString("syncSource", "null");
+ editor.commit();
}
}
View
1  src/com/matburt/mobileorg/Gui/Wizard/Wizards/SDCardWizard.java
@@ -42,6 +42,7 @@ public View createSDcardFolderSelector() {
folderList.setAdapter(directoryAdapter);
directoryAdapter.notifyDataSetChanged();
+ setupDoneButton(view);
wizardView.addPage(view);
wizardView.setNavButtonStateOnPage(1, true, WizardView.LAST_PAGE);
return view;
View
1  src/com/matburt/mobileorg/Gui/Wizard/Wizards/SSHWizard.java
@@ -51,6 +51,7 @@ public void onClick(View v) {
}
});
+ setupDoneButton(view);
wizardView.addPage(view);
wizardView.setNavButtonStateOnPage(1, true, WizardView.LAST_PAGE);
wizardView.enablePage(1);
View
1  src/com/matburt/mobileorg/Gui/Wizard/Wizards/UbuntuOneWizard.java
@@ -109,6 +109,7 @@ private View createUbuntuOneList() {
// when list of root items is very long and network connection
// is slow
+ setupDoneButton(view);
wizardView.addPage(view);
wizardView.enablePage(1);
wizardView.setNavButtonStateOnPage(2, true, WizardView.LAST_PAGE);
View
1  src/com/matburt/mobileorg/Gui/Wizard/Wizards/WebDAVWizard.java
@@ -50,6 +50,7 @@ public void onClick(View v) {
}
});
+ setupDoneButton(view);
wizardView.addPage(view);
wizardView.setNavButtonStateOnPage(1, true, WizardView.LAST_PAGE);
wizardView.enablePage(1);
View
18 src/com/matburt/mobileorg/Gui/Wizard/Wizards/Wizard.java
@@ -3,11 +3,15 @@
import com.matburt.mobileorg.R;
import com.matburt.mobileorg.Gui.Wizard.WizardView;
+import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
import android.widget.Toast;
public abstract class Wizard {
@@ -29,8 +33,22 @@ public Wizard(WizardView wizardView, Context context) {
wizardView.removePagesAfter(1);
setupFirstPage();
}
+
+ public void setupDoneButton(View view) {
+ Button doneButton = (Button) view.findViewById(R.id.wizard_done_button);
+ doneButton.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ saveSettings();
+ ((Activity) context).finish();
+ }
+ });
+ }
public abstract void setupFirstPage();
+
+ public void refresh() {
+ }
public final class UIHandler extends Handler {
public static final int DISPLAY_UI_TOAST = 0;
Please sign in to comment.
Something went wrong with that request. Please try again.