← Back to team overview

openlp-android team mailing list archive

[Merge] lp:~johanmynhardt/openlp/android into lp:openlp/android

 

Johan Mynhardt has proposed merging lp:~johanmynhardt/openlp/android into lp:openlp/android.

Requested reviews:
  OpenLP Android Developers (openlp-android)

For more details, see:
https://code.launchpad.net/~johanmynhardt/openlp/android/+merge/92374

Retrying merge proposal. Last time looked really bad
-- 
https://code.launchpad.net/~johanmynhardt/openlp/android/+merge/92374
Your team OpenLP Android Developers is requested to review the proposed merge of lp:~johanmynhardt/openlp/android into lp:openlp/android.
=== modified file 'src/org/openlp/android/activity/Alert.java'
--- src/org/openlp/android/activity/Alert.java	2012-01-21 12:04:21 +0000
+++ src/org/openlp/android/activity/Alert.java	2012-02-09 21:35:21 +0000
@@ -40,7 +40,7 @@
 import android.widget.EditText;
 import android.widget.Toast;
 
-public class Alert extends Activity implements Api {
+public class Alert extends DefaultActivity {
 	private final Context context = this;
 	
 	@Override
@@ -84,27 +84,5 @@
 		Log.d(LOG_TAG, "Resume");
 	}
 
-	@Override
-	public boolean onCreateOptionsMenu(Menu menu) {
-		MenuInflater inflater = getMenuInflater();
-		inflater.inflate(R.menu.menu, menu);
-		return true;
-	}
-
-	@Override
-	public boolean onOptionsItemSelected(MenuItem item) {
-		// Handle item selection
-		switch (item.getItemId()) {
-		case R.id.preferences:
-			startActivity(new Intent(this, Preferences.class));
-			return true;
-		case R.id.menuSearch:
-			onSearchRequested();
-			return true;
-		default:
-			return super.onOptionsItemSelected(item);
-		}
-	}
-
 	private final String LOG_TAG = Alert.class.getName();
 }

=== added file 'src/org/openlp/android/activity/DefaultActivity.java'
--- src/org/openlp/android/activity/DefaultActivity.java	1970-01-01 00:00:00 +0000
+++ src/org/openlp/android/activity/DefaultActivity.java	2012-02-09 21:35:21 +0000
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * OpenLP - Open Source Lyrics Projection                                      *
+ * --------------------------------------------------------------------------- *
+ * Copyright (c) 2008-2011 Raoul Snyman                                        *
+ * Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael      *
+ * Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler,        *
+ * Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout,      *
+ * Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund             *
+ * --------------------------------------------------------------------------- *
+ * This program is free software; you can redistribute it and/or modify it     *
+ * under the terms of the GNU General Public License as published by the Free  *
+ * Software Foundation; version 2 of the License.                              *
+ *                                                                             *
+ * This program is distributed in the hope that it will be useful, but WITHOUT *
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       *
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for    *
+ * more details.                                                               *
+ *                                                                             *
+ * You should have received a copy of the GNU General Public License along     *
+ * with this program; if not, write to the Free Software Foundation, Inc., 59  *
+ * Temple Place, Suite 330, Boston, MA 02111-1307 USA                          *
+ *******************************************************************************/
+package org.openlp.android.activity;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+import org.openlp.android.R;
+import org.openlp.android.api.Api;
+
+public class DefaultActivity extends Activity implements Api {
+	@Override
+	public boolean onCreateOptionsMenu(Menu menu) {
+		MenuInflater inflater = getMenuInflater();
+		inflater.inflate(R.menu.menu, menu);
+		return true;
+	}
+
+	@Override
+	public boolean onOptionsItemSelected(MenuItem item) {
+		// Handle item selection
+		switch (item.getItemId()) {
+			case R.id.preferences:
+				startActivity(new Intent(this, Preferences.class));
+				return true;
+			case R.id.menuSearch:
+				onSearchRequested();
+				return true;
+			default:
+				return super.onOptionsItemSelected(item);
+		}
+	}
+}

=== modified file 'src/org/openlp/android/activity/Misc.java'
--- src/org/openlp/android/activity/Misc.java	2012-01-21 12:04:21 +0000
+++ src/org/openlp/android/activity/Misc.java	2012-02-09 21:35:21 +0000
@@ -47,7 +47,7 @@
 import org.openlp.android.utility.OpenLPHttpClient;
 import org.openlp.android.utility.WebCallAsyncTask;
 
-public class Misc extends Activity implements Api {
+public class Misc extends DefaultActivity {
 	private final Context context = this;
 	Misc misc = this;
 	SharedPreferences prefs;
@@ -259,27 +259,5 @@
 		}
 	}
 
-	@Override
-	public boolean onCreateOptionsMenu(Menu menu) {
-		MenuInflater inflater = getMenuInflater();
-		inflater.inflate(R.menu.menu, menu);
-		return true;
-	}
-
-	@Override
-	public boolean onOptionsItemSelected(MenuItem item) {
-		// Handle item selection
-		switch (item.getItemId()) {
-		case R.id.preferences:
-			startActivity(new Intent(this, Preferences.class));
-			return true;
-		case R.id.menuSearch:
-			onSearchRequested();
-			return true;
-		default:
-			return super.onOptionsItemSelected(item);
-		}
-	}
-
 	private final String LOG_TAG = Misc.class.getName();
 }

=== modified file 'src/org/openlp/android/activity/Service.java'
--- src/org/openlp/android/activity/Service.java	2012-01-21 14:13:10 +0000
+++ src/org/openlp/android/activity/Service.java	2012-02-09 21:35:21 +0000
@@ -53,9 +53,8 @@
 /**
  * Activity for managing service objects.
  */
-public class Service extends Activity implements Api {
+public class Service extends DefaultActivity {
 	private final Activity context = this;
-
 	private ListView listView;
 
 	@Override
@@ -146,27 +145,6 @@
 		new FetchServiceItemsTask(this).execute(SERVICE_LIST);
 	}
 
-	@Override
-	public boolean onCreateOptionsMenu(Menu menu) {
-		MenuInflater inflater = getMenuInflater();
-		inflater.inflate(R.menu.menu, menu);
-		return true;
-	}
-
-	@Override
-	public boolean onOptionsItemSelected(MenuItem item) {
-		switch (item.getItemId()) {
-		case R.id.preferences:
-			startActivity(new Intent(this, Preferences.class));
-			return true;
-		case R.id.menuSearch:
-			onSearchRequested();
-			return true;
-		default:
-			return super.onOptionsItemSelected(item);
-		}
-	}
-
 	/**
 	 * Asynchronous task to fetch the service items.
 	 */
@@ -247,4 +225,4 @@
 	}
 
 	private final String LOG_TAG = Service.class.getName();
-}
\ No newline at end of file
+}

=== modified file 'src/org/openlp/android/activity/Slide.java'
--- src/org/openlp/android/activity/Slide.java	2012-01-21 09:20:06 +0000
+++ src/org/openlp/android/activity/Slide.java	2012-02-09 21:35:21 +0000
@@ -48,7 +48,7 @@
 import java.util.Arrays;
 import java.util.List;
 
-public class Slide extends Activity implements Api {
+public class Slide extends DefaultActivity {
 	private final Activity context = this;
 	private ListView slideList;
 
@@ -125,27 +125,6 @@
 		new FetchSlideItemsTask(this).execute(LIVE_TEXT);
 	}
 
-	@Override
-	public boolean onCreateOptionsMenu(Menu menu) {
-		MenuInflater inflater = getMenuInflater();
-		inflater.inflate(R.menu.menu, menu);
-		return true;
-	}
-
-	@Override
-	public boolean onOptionsItemSelected(MenuItem item) {
-		switch (item.getItemId()) {
-		case R.id.preferences:
-			startActivity(new Intent(this, Preferences.class));
-			return true;
-		case R.id.menuSearch:
-			onSearchRequested();
-			return true;
-		default:
-			return super.onOptionsItemSelected(item);
-		}
-	}
-
 	class FetchSlideItemsTask extends
 			AsyncTask<String, Void, org.openlp.android.data.SlideItem[]> {
 		Slide slideActivity;

=== modified file 'src/org/openlp/android/activity/StageView.java'
--- src/org/openlp/android/activity/StageView.java	2012-01-22 09:40:37 +0000
+++ src/org/openlp/android/activity/StageView.java	2012-02-09 21:35:21 +0000
@@ -38,10 +38,9 @@
 import android.webkit.WebView;
 
 
-public class StageView extends Activity implements Api {
+public class StageView extends DefaultActivity {
 	private final Context context = this;
-
-	SharedPreferences preferences; 
+	private SharedPreferences preferences;
 
 	public void onCreate(Bundle savedInstanceState) {
 		super.onCreate(savedInstanceState);
@@ -74,27 +73,5 @@
 		myWebView.loadUrl(urlBase);		
 	}
 
-	@Override
-	public boolean onCreateOptionsMenu(Menu menu) {
-		MenuInflater inflater = getMenuInflater();
-		inflater.inflate(R.menu.menu, menu);
-		return true;
-	}
-
-	@Override
-	public boolean onOptionsItemSelected(MenuItem item) {
-		// Handle item selection
-		switch (item.getItemId()) {
-		case R.id.preferences:
-			startActivity(new Intent(this, Preferences.class));
-			return true;
-		case R.id.menuSearch:
-			onSearchRequested();
-			return true;
-		default:
-			return super.onOptionsItemSelected(item);
-		}
-	}
-
 	private final String LOG_TAG = StageView.class.getName();
 }


Follow ups