--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingTop="32dp"
+ android:paddingLeft="17dp"
+ android:paddingRight="17dp"
+ >
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/choose_library_message"
+ android:textAppearance="?android:attr/textAppearanceLarge" />
+
+ <Spinner
+ android:id="@+id/choose_library_spinner"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="30dip"
+ android:layout_marginBottom="30dip"
+ />
+
+ <Button android:id="@+id/choose_library_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="right"
+ android:layout_marginTop="16dp"
+ android:text="@string/action_choose_library"
+ android:paddingLeft="32dp"
+ android:paddingRight="32dp"/>
+
+</LinearLayout>
+
>
<TextView
- android:id="@+id/junkTextView"
+ android:id="@+id/account_sign_in_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/ou_account_sign_in_message"
android:layout_centerHorizontal="true"
android:layout_marginTop="106dp"
android:src="@drawable/evergreen_logo_sm072"
- android:contentDescription="@string/ou_app_label" />
+ android:contentDescription="@string/ou_library_name" />
<TextView
android:id="@+id/action_in_progress"
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <string name="ou_account_label">Evergreen Library</string>
- <string name="ou_account_sign_in_message">Sign in to your\nEvergreen Library Account</string>
- <!-- Each evergreen-derived app should have its own ou_account_type. This will enable
- a user to have multiple evergreen-derived apps working simultaneously. -->
- <string name="ou_account_type">org.evergreen_ils</string>
- <string name="ou_app_label">Evergreen Library</string>
- <string name="ou_app_name">Evergreen Library</string>
+ <!-- the label shown in the android account manager -->
+ <string name="ou_account_label">Example Library</string>
+ <!-- $1 in ou_account_sign_in_message will be replaced with the value of ou_account_label -->
+ <string name="ou_account_sign_in_message">Sign in to your\n%1$s account</string>
+ <!-- android account manager internal type.
+ Each evergreen-derived app must have its own unique ou_account_type. -->
+ <string name="ou_account_type">org.evergreen_ils.example</string>
+ <!-- app name used to launch app -->
+ <string name="ou_app_label">Evergreen</string>
+ <!-- library name displayed in the app bar -->
+ <string name="ou_library_name">EXAMPLE</string>
+ <!-- OPAC URL -->
<string name="ou_library_url">https://demo.evergreencatalog.com</string>
</resources>
<string name="action_settings">Settings</string>
<string name="retry_label">Retry</string>
+ <string name="choose_library_message">Select your Library</string>
+ <string name="action_choose_library">Select</string>
</resources>
private String httpAddress = "http://ulysses.calvin.edu";
/** The TAG. */
- private final String TAG = AccountAccess.class.getName();
+ private final String TAG = AccountAccess.class.getSimpleName();
/**
* The auth token. Sent with every request that needs authentication
}
});
- // kcxxx: factor this out
+ // kenstir todo: factor this out
int homeLibrary = 0;
if (AccountAccess.getAccountAccess() != null) {
homeLibrary = AccountAccess.getAccountAccess().getHomeLibraryID();
import android.view.ContextThemeWrapper;
import android.view.View;
import android.widget.TextView;
+import org.evergreen_ils.globals.AppPrefs;
public class AuthenticatorActivity extends AccountAuthenticatorActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
- // make sure default values are set up for preferences
- PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
+ AppPrefs.init(this);
accountManager = AccountManager.get(getBaseContext());
authTokenType = Const.AUTHTOKEN_TYPE;
Log.d(TAG, "onCreate> authTokenType="+authTokenType);
+ TextView signInText = (TextView) findViewById(R.id.account_sign_in_text);
+ signInText.setText(String.format(getString(R.string.ou_account_sign_in_message),
+ AppPrefs.getString(AppPrefs.LIBRARY_NAME)));
if (accountName != null) {
((TextView) findViewById(R.id.accountName)).setText(accountName);
}
submit();
}
});
- /*
- * findViewById(R.id.signUp).setOnClickListener(new
- * View.OnClickListener() {
- *
- * @Override public void onClick(View v) { // Since there can only be
- * one AuthenticatorActivity, we call the sign up activity, get his
- * results, // and return them in setAccountAuthenticatorResult(). See
- * finishLogin(). Intent signup = new Intent(getBaseContext(),
- * SignUpActivity.class); signup.putExtras(getIntent().getExtras());
- * startActivityForResult(signup, REQ_SIGNUP); } });
- */
+
if (savedInstanceState != null) {
Log.d(TAG, "onCreate> savedInstanceState="+savedInstanceState);
if (savedInstanceState.getString(STATE_ALERT_MESSAGE) != null) {
import java.util.Map;
import android.preference.PreferenceManager;
+import org.evergreen_ils.globals.AppPrefs;
import org.opensrf.Method;
import org.opensrf.net.http.GatewayRequest;
import org.opensrf.net.http.HttpConnection;
public static String signIn(Context context, String username, String password) throws AuthenticationException {
Log.d(TAG, "signIn> "+username);
- final String library_url = context.getString(R.string.ou_library_url);
HttpConnection conn;
try {
- conn = new HttpConnection(library_url + "/osrf-gateway-v1");
+ conn = new HttpConnection(AppPrefs.getString(AppPrefs.LIBRARY_URL) + "/osrf-gateway-v1");
} catch (MalformedURLException e) {
throw new AuthenticationException(e);
}
Log.d(TAG, "authtoken: " + authtoken);
Integer authtime = ((Map<String, Integer>) payload).get("authtime");
Log.d(TAG, "authtime: " + authtime);
+ AppPrefs.setBoolean(AppPrefs.EVER_LOGGED_IN, true);
return authtoken;
} else if (textcode.equals("LOGIN_FAILED")) {
String desc = ((Map<String, String>) resp).get("desc");
private void displayFrameworkBugMessageAndExit(String info) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.setTitle(getString(R.string.ou_app_name));
+ builder.setTitle(getString(R.string.ou_library_name));
builder.setMessage("[" + info + "] "
+ getString(R.string.msg_camera_framework_bug));
builder.setPositiveButton(R.string.button_ok, new FinishListener(this));
--- /dev/null
+package org.evergreen_ils.globals;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.preference.PreferenceManager;
+import android.util.Log;
+import org.evergreen_ils.R;
+import org.evergreen_ils.accountAccess.bookbags.BookBag;
+
+/**
+ * Created by kenstir on 11/8/2015.
+ */
+public class AppPrefs {
+ public static final String EVER_LOGGED_IN = "ever_logged_in";
+ public static final String LIBRARY_URL = "library_url";
+ public static final String LIBRARY_NAME = "library_name";
+ private static final String VERSION = "version";
+ // increment PREFS_VERSION every time you make a change to the persistent pref storage
+ private static final int PREFS_VERSION = 2;
+ private static final String TAG = AppPrefs.class.getSimpleName();
+ private static Context context;
+ private static boolean initialized;
+
+ public static void init(Context app_context) {
+ if (initialized)
+ return;
+
+ context = app_context;
+ initialized = true;
+
+ // set default values unless already set
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
+ int version = prefs.getInt(VERSION, 0);
+ if (version < PREFS_VERSION) {
+ SharedPreferences.Editor editor = prefs.edit();
+ version = PREFS_VERSION;
+ editor.putInt(VERSION, PREFS_VERSION);
+ editor.putBoolean(EVER_LOGGED_IN, false);
+ editor.putString(LIBRARY_URL, context.getString(R.string.ou_library_url));
+ editor.putString(LIBRARY_NAME, context.getString(R.string.ou_library_name));
+ editor.commit();
+ }
+ Log.d(TAG, "version=" + version);
+ Log.d(TAG, "library_url=" + getString(LIBRARY_URL));
+ Log.d(TAG, "library_name=" + getString(LIBRARY_NAME));
+ }
+
+ public static String getString(String key) {
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
+ return prefs.getString(key, null);
+ }
+
+ public static boolean getBoolean(String key) {
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
+ return prefs.getBoolean(key, false);
+ }
+
+ public static void setString(String key, String value) {
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
+ SharedPreferences.Editor editor = prefs.edit();
+ editor.putString(key, value);
+ editor.commit();
+ }
+
+ public static void setBoolean(String key, boolean value) {
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
+ SharedPreferences.Editor editor = prefs.edit();
+ editor.putBoolean(key, value);
+ editor.commit();
+ }
+}
return a.name.compareTo(b.name);
}
});
- /*
- for (int i=0; i<organisations.size(); ++i) {
- Log.d(TAG, "getOrg postsort org["+i+"]= id:"+organisations.get(i).id+" parent:"+organisations.get(i).parent+" name:"+organisations.get(i).name);
- }
- */
long duration_ms = System.currentTimeMillis() - start_ms;
Log.d("init", "Loading organisations took "+duration_ms+"ms");
}
// alternate version of doRequest
- // kcxxx: not sure why this one loops calling req.recv and the other doesn't
+ // kenstir todo: not sure why this one loops calling req.recv and the other doesn't
public static Object doRequest(HttpConnection conn, String service,
String methodName, Object[] params) {
--- /dev/null
+package org.evergreen_ils.searchCatalog;
+
+import android.text.TextUtils;
+
+/** value class
+ * Created by kenstir on 11/5/2015.
+ */
+public class Library {
+ public String url; // e.g. "https://catalog.cwmars.org"
+ public String short_name; // e.g. "C/W MARS"
+ public String directory_name; // e.g. "Massachusetts, US (C/W MARS)"
+ public Library(String url, String short_name, String directory_name) {
+ this.url = url;
+ this.short_name = short_name;
+ this.directory_name = directory_name;
+ }
+}
import android.text.TextUtils;
import org.evergreen_ils.accountAccess.AccountAccess;
+import org.evergreen_ils.globals.AppPrefs;
import org.evergreen_ils.globals.GlobalConfigs;
import org.evergreen_ils.globals.Utils;
import org.opensrf.Method;
try {
// configure the connection
- conn = new HttpConnection(GlobalConfigs.httpAddress
- + "/osrf-gateway-v1");
+ conn = new HttpConnection(AppPrefs.getString(AppPrefs.LIBRARY_URL) + "/osrf-gateway-v1");
} catch (Exception e) {
- System.err.println("Exception in establishing connection "
- + e.getMessage());
+ Log.d(TAG, "error", e);
}
- // registering classes so no longer necessary to register object classes
- // manually
-
}
/**
}
});
- //kcxxx: factor this out
+ //kenstir todo: factor this out
int selectedOrgPos = 0;
int homeLibrary = 0;
if (AccountAccess.getAccountAccess() != null) {
+++ /dev/null
-/*
- * Copyright (C) 2012 Evergreen Open-ILS
- * @author Daniel-Octavian Rizea
- *
- * 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; either version 2
- * or the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be usefull,
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- *
- */
-package org.evergreen_ils.views;
-
-import java.util.Calendar;
-
-import org.evergreen_ils.R;
-import org.evergreen_ils.globals.GlobalConfigs;
-import org.evergreen_ils.services.NotificationAlert;
-import org.evergreen_ils.services.PeriodicServiceBroadcastReceiver;
-import org.evergreen_ils.services.ScheduledIntentService;
-import org.evergreen_ils.auth.Const;
-
-import android.app.AlarmManager;
-import android.app.PendingIntent;
-import android.app.ProgressDialog;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.content.SharedPreferences;
-import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
-import android.net.ConnectivityManager;
-import android.os.Bundle;
-import android.preference.PreferenceActivity;
-import android.preference.PreferenceManager;
-import android.provider.Settings;
-import android.widget.Toast;
-
-public class ApplicationPreferences extends PreferenceActivity implements
- OnSharedPreferenceChangeListener {
-
- private final String TAG = ApplicationPreferences.class.getName();
-
- private ProgressDialog progressDialog;
-
- private ApplicationPreferences reference;
-
- private Context context;
-
- private Thread coreFilesDownload = null;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
-
- super.onCreate(savedInstanceState);
-
- addPreferencesFromResource(R.xml.preferences);
-
- context = this;
- reference = this;
- SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
- prefs.registerOnSharedPreferenceChangeListener(this);
- }
-
- @Override
- protected void onResume() {
- super.onResume();
- reference = this;
- }
-
- @Override
- protected void onPause() {
- super.onPause();
- reference = null;
- }
-
- @Override
- protected void onStop() {
- super.onStop();
- reference = null;
- }
-
- @Override
- protected void onDestroy() {
- super.onDestroy();
- reference = null;
- }
-
- @Override
- public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
- String key) {
-
- boolean httpAddressChange = false;
-
- boolean checkConnection = false;
-
- if (key.equals("notifications_enabled")) {
-
- if (sharedPreferences.getBoolean("notifications_enabled", false)) {
-
- Toast.makeText(context, "Set up notification updates",
- Toast.LENGTH_SHORT).show();
- // if enabled register the update service to run once per day
- // get a Calendar object with current time
- Calendar cal = Calendar.getInstance();
-
- Intent bRecvIntent = new Intent(this,
- PeriodicServiceBroadcastReceiver.class);
- bRecvIntent.setAction(ScheduledIntentService.ACTION);
- // update the current intent if it exists
- PendingIntent sender = PendingIntent.getBroadcast(this,
- NotificationAlert.NOTIFICATION_INTENT
- + PeriodicServiceBroadcastReceiver.INTENT_ID,
- bRecvIntent, PendingIntent.FLAG_UPDATE_CURRENT);
-
- // Get the AlarmManager service
- AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);
- am.setRepeating(AlarmManager.RTC, cal.getTimeInMillis(),
- 10000 * ScheduledIntentService.SCHEDULE_TIME_INTERVAL,
- sender);
- } else {
- Toast.makeText(context, "Disable notification updates",
- Toast.LENGTH_SHORT).show();
- // cancel the service
-
- Intent bRecvIntent = new Intent(this,
- PeriodicServiceBroadcastReceiver.class);
-
- // update the current intent if it exists
- PendingIntent sender = PendingIntent.getBroadcast(this,
- NotificationAlert.NOTIFICATION_INTENT
- + PeriodicServiceBroadcastReceiver.INTENT_ID,
- bRecvIntent, PendingIntent.FLAG_UPDATE_CURRENT);
-
- // Get the AlarmManager service
- AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);
- // cancel the service
- am.cancel(sender);
- }
- }
- }
-
-}
--- /dev/null
+package org.evergreen_ils.views;
+
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.preference.PreferenceManager;
+import android.support.v7.app.ActionBar;
+import android.support.v7.app.ActionBarActivity;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.Spinner;
+import org.evergreen_ils.R;
+import org.evergreen_ils.globals.AppPrefs;
+import org.evergreen_ils.globals.GlobalConfigs;
+import org.evergreen_ils.globals.Utils;
+import org.evergreen_ils.searchCatalog.Library;
+import org.evergreen_ils.views.splashscreen.SplashActivity;
+import org.opensrf.util.JSONException;
+import org.opensrf.util.JSONReader;
+
+import java.util.*;
+
+/**
+ * Created by kenstir on 2015-11-05.
+ */
+public class ChooseLibraryActivity extends ActionBarActivity {
+
+ public final static int CHOOSE_LIBRARY_REQUEST = 0;
+ private final String TAG = ChooseLibraryActivity.class.getSimpleName();
+ public static String librariesJSONUrl = "http://evergreen-ils.org/testing/libraries.json";
+ Context context;
+ Spinner consortiumSpinner;
+ Library selected_library = null;
+ List<Library> libraries = new ArrayList<Library>();
+ private boolean restarted = false;
+
+ private class FetchConsortiumsTask extends AsyncTask<String, Integer, String> {
+ protected String doInBackground(String... params) {
+ String url = params[0];
+ String result = null;
+ try {
+ Log.d(TAG, "fetching "+url);
+ result = Utils.getNetPageContent(url);
+ } catch (Exception e) {
+ Log.d(TAG, "error fetching", e);
+ }
+ return result;
+ }
+
+ protected void onPostExecute(String result) {
+ Log.d(TAG, "results available: "+result);
+ parseLibrariesJSON(result);
+ ArrayList<String> l = new ArrayList<String>(libraries.size());
+ for (Library library : libraries) {
+ l.add(library.directory_name);
+ }
+ ArrayAdapter<String> adapter = new ArrayAdapter<String>(context, android.R.layout.simple_spinner_dropdown_item, l);
+ consortiumSpinner.setAdapter(adapter);
+ }
+ }
+
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ context = getApplicationContext();
+
+ setContentView(R.layout.activity_choose_library);
+
+ AppPrefs.init(getApplicationContext());
+
+ ActionBar actionBar = getSupportActionBar();
+
+ consortiumSpinner = (Spinner) findViewById(R.id.choose_library_spinner);
+ consortiumSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
+ selected_library = libraries.get(position);
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView<?> parent) {
+ selected_library = null;
+ }
+ });
+ ((Button)findViewById(R.id.choose_library_button)).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ selectLibrary();
+ }
+ });
+ }
+
+ private void selectLibrary() {
+ if (selected_library != null) {
+ Log.d(TAG, "selected library " + selected_library.directory_name);
+ AppPrefs.setString(AppPrefs.LIBRARY_URL, selected_library.url);
+ AppPrefs.setString(AppPrefs.LIBRARY_NAME, selected_library.short_name);
+
+ startSplashActivity();
+ }
+ }
+
+ private void startSplashActivity() {
+ // This is different from SplashActivity.restartApp(this) in that it does not clear the back stack.
+ // This is so that a user can back up and choose a different library.
+ Intent i = new Intent(this, SplashActivity.class);
+ startActivity(i);
+ }
+
+ @Override
+ protected void onStart() {
+ super.onStart();
+ GlobalConfigs.httpAddress = AppPrefs.getString(AppPrefs.LIBRARY_URL);// kenstir todo: replace all refs to GlobalConfigs.httpAddress
+ Log.d(TAG, "kcxxx: onstart: url=" + GlobalConfigs.httpAddress);
+ if (!TextUtils.isEmpty(GlobalConfigs.httpAddress) && !restarted) {
+ startSplashActivity();
+ } else {
+ startTask();
+ }
+ }
+
+ @Override
+ protected void onRestart() {
+ super.onRestart();
+ restarted = true;
+ Log.d(TAG, "kcxxx: onrestart");
+ }
+
+ private void startTask() {
+ new FetchConsortiumsTask().execute(librariesJSONUrl);
+ }
+
+ private void parseLibrariesJSON(String json) {
+ libraries.clear();
+
+ if (json != null) {
+ List<Map<String,?>> l;
+ try {
+ l = (List<Map<String,?>>) new JSONReader(json).readArray();
+ } catch (JSONException e) {
+ Log.d(TAG, "failed parsing libraries array", e);
+ return;
+ }
+ for (Map<String, ?> map : l) {
+ String url = (String) map.get("url");
+ String directory_name = (String) map.get("directory_name");
+ String short_name = (String) map.get("short_name");
+ Library library = new Library(url, short_name, directory_name);
+ libraries.add(library);
+ }
+
+ Collections.sort(libraries, new Comparator<Library>() {
+ @Override
+ public int compare(Library a, Library b) {
+ return a.directory_name.compareTo(b.directory_name);
+ }
+ });
+
+ for (int i = 0; i< libraries.size(); ++i) {
+ Log.d(TAG, "c["+i+"]: "+ libraries.get(i).directory_name);
+ }
+ }
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2012 Evergreen Open-ILS
+ * @author Daniel-Octavian Rizea
+ *
+ * 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; either version 2
+ * or the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be usefull,
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ *
+ */
+package org.evergreen_ils.views;
+
+import java.util.Calendar;
+
+import org.evergreen_ils.R;
+import org.evergreen_ils.services.NotificationAlert;
+import org.evergreen_ils.services.PeriodicServiceBroadcastReceiver;
+import org.evergreen_ils.services.ScheduledIntentService;
+
+import android.app.AlarmManager;
+import android.app.PendingIntent;
+import android.app.ProgressDialog;
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
+import android.os.Bundle;
+import android.preference.PreferenceActivity;
+import android.preference.PreferenceManager;
+import android.widget.Toast;
+
+public class UnusedPreferenceActivity extends PreferenceActivity implements
+ OnSharedPreferenceChangeListener {
+
+ private final String TAG = UnusedPreferenceActivity.class.getSimpleName();
+
+ private ProgressDialog progressDialog;
+
+ private UnusedPreferenceActivity reference;
+
+ private Context context;
+
+ private Thread coreFilesDownload = null;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+
+ super.onCreate(savedInstanceState);
+
+ addPreferencesFromResource(R.xml.preferences);
+
+ context = this;
+ reference = this;
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
+ prefs.registerOnSharedPreferenceChangeListener(this);
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+ reference = this;
+ }
+
+ @Override
+ protected void onPause() {
+ super.onPause();
+ reference = null;
+ }
+
+ @Override
+ protected void onStop() {
+ super.onStop();
+ reference = null;
+ }
+
+ @Override
+ protected void onDestroy() {
+ super.onDestroy();
+ reference = null;
+ }
+
+ @Override
+ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
+ String key) {
+
+ boolean httpAddressChange = false;
+
+ boolean checkConnection = false;
+
+ if (key.equals("notifications_enabled")) {
+
+ if (sharedPreferences.getBoolean("notifications_enabled", false)) {
+
+ Toast.makeText(context, "Set up notification updates",
+ Toast.LENGTH_SHORT).show();
+ // if enabled register the update service to run once per day
+ // get a Calendar object with current time
+ Calendar cal = Calendar.getInstance();
+
+ Intent bRecvIntent = new Intent(this,
+ PeriodicServiceBroadcastReceiver.class);
+ bRecvIntent.setAction(ScheduledIntentService.ACTION);
+ // update the current intent if it exists
+ PendingIntent sender = PendingIntent.getBroadcast(this,
+ NotificationAlert.NOTIFICATION_INTENT
+ + PeriodicServiceBroadcastReceiver.INTENT_ID,
+ bRecvIntent, PendingIntent.FLAG_UPDATE_CURRENT);
+
+ // Get the AlarmManager service
+ AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);
+ am.setRepeating(AlarmManager.RTC, cal.getTimeInMillis(),
+ 10000 * ScheduledIntentService.SCHEDULE_TIME_INTERVAL,
+ sender);
+ } else {
+ Toast.makeText(context, "Disable notification updates",
+ Toast.LENGTH_SHORT).show();
+ // cancel the service
+
+ Intent bRecvIntent = new Intent(this,
+ PeriodicServiceBroadcastReceiver.class);
+
+ // update the current intent if it exists
+ PendingIntent sender = PendingIntent.getBroadcast(this,
+ NotificationAlert.NOTIFICATION_INTENT
+ + PeriodicServiceBroadcastReceiver.INTENT_ID,
+ bRecvIntent, PendingIntent.FLAG_UPDATE_CURRENT);
+
+ // Get the AlarmManager service
+ AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);
+ // cancel the service
+ am.cancel(sender);
+ }
+ }
+ }
+
+}
*
*/
public class LoadingTask {
- private final String TAG = LoadingTask.class.getName();
+ private final String TAG = LoadingTask.class.getSimpleName();
public static final String TASK_OK = "OK";
*/
package org.evergreen_ils.views.splashscreen;
-import android.os.Build;
+import android.content.SharedPreferences;
import org.evergreen_ils.R;
import org.evergreen_ils.globals.GlobalConfigs;
-import org.evergreen_ils.searchCatalog.SearchCatalogListView;
-import org.evergreen_ils.views.ApplicationPreferences;
+import org.evergreen_ils.globals.AppPrefs;
import org.evergreen_ils.views.MainActivity;
import org.evergreen_ils.views.splashscreen.LoadingTask.LoadingTaskListener;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
-import android.preference.PreferenceManager;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
public class SplashActivity extends Activity implements LoadingTaskListener {
- private static String TAG = "SplashActivity";
+ public final static int REQUEST_SELECT_LIBRARY = 0;
+ private static String TAG = SplashActivity.class.getSimpleName();
private TextView mProgressText;
private Context mContext;
private ProgressBar mProgressBar;
private Button mRetryButton;
private LoadingTask mTask;
private static boolean mInitialized;
+ private boolean restarted = false;
- public static boolean isAppInitialized()
- {
+ public static boolean isAppInitialized() {
return mInitialized;
}
- /** android may choose to initialize the app at a non-MAIN activity if the
+ /**
+ * android may choose to initialize the app at a non-MAIN activity if the
* app crashed or for other reasons. In these cases we want to force sane
* initialization via the SplashActivity.
- *
+ * <p/>
* used in all activity class's onCreate() like so:
* <code>
* if (!SplashActivity.isInitialized) {
- * SplashActivity.restartApp(this);
- * return;
+ * SplashActivity.restartApp(this);
+ * return;
* }
* </code>
- *
+ *
* @param a
*/
- public static void restartApp(Activity a)
- {
- Log.d(TAG, "restartApp> Restarting SplashActivity");
- final Intent i = new Intent(a, SplashActivity.class);
- i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
- a.startActivity(i);
- a.finish();
- }
+ public static void restartApp(Activity a) {
+ Log.d(TAG, "restartApp> Restarting SplashActivity");
+ Intent i = new Intent(a, SplashActivity.class);
+ i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ a.startActivity(i);
+ a.finish();
+ }
@Override
public void onCreate(Bundle savedInstanceState) {
+ Log.d(TAG, "kcxxx: oncreate");
super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_splash);
this.mContext = this;
+ setContentView(R.layout.activity_splash);
- // make sure default values are set up for preferences
- PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
+ AppPrefs.init(getApplicationContext());
mProgressText = (TextView) findViewById(R.id.action_in_progress);
mProgressBar = (ProgressBar) findViewById(R.id.activity_splash_progress_bar);
mRetryButton = (Button) findViewById(R.id.activity_splash_retry_button);
- Log.d(TAG, "onCreate>");
mRetryButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
startTask();
}
});
-
- /* this didn't work, but the progress bar is weird on GB 2.2,
- and it's lopsided in landscape mode on GB 2.3.7
- int currentApiVersion = android.os.Build.VERSION.SDK_INT;
- if (currentApiVersion < Build.VERSION_CODES.HONEYCOMB)
- mProgressBar.setScrollBarStyle(android.R.attr.progressBarStyleHorizontal);
- */
-
- GlobalConfigs.httpAddress = getString(R.string.ou_library_url);
- startTask();
}
-
+
protected void startTask() {
- Log.d(TAG, "startTask> task="+mTask);
+ Log.d(TAG, "startTask> task=" + mTask);
if (mTask != null)
return;
mTask = new LoadingTask(this, this);
mTask.execute();
}
-
+
+ @Override
+ protected void onStart() {
+ super.onStart();
+ GlobalConfigs.httpAddress = AppPrefs.getString(AppPrefs.LIBRARY_URL);// kenstir todo: replace all refs to GlobalConfigs.httpAddress
+ boolean ever_logged_in = AppPrefs.getBoolean(AppPrefs.EVER_LOGGED_IN);
+ Log.d(TAG, "kcxxx: onstart: url=" + GlobalConfigs.httpAddress + " ever_logged_in=" + ever_logged_in);
+ if (!TextUtils.isEmpty(GlobalConfigs.httpAddress) && ever_logged_in && !restarted) {
+ startTask();
+ }
+ }
+
+ @Override
+ protected void onRestart() {
+ super.onRestart();
+ restarted = true;
+ Log.d(TAG, "kcxxx: onrestart");
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+ Log.d(TAG, "kcxxx: onresume");
+ }
+
@Override
protected void onStop() {
super.onStop();
- if(mAlertDialog != null) {
+ Log.d(TAG, "kcxxx: onstop");
+ if (mAlertDialog != null) {
mAlertDialog.dismiss();
}
}
-
+
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
- Log.d(TAG, "onActivityResult> "+requestCode+" "+resultCode);
+ Log.d(TAG, "kcxxx: onactivityresult: " + requestCode + " " + resultCode);
}
private void startApp() {
@Override
public void onProgressUpdate(String value) {
- Log.d(TAG, "onProgressUpdate> "+value);
+ Log.d(TAG, "onProgressUpdate> " + value);
mProgressText.setText(value);
}
@Override
public void onPostExecute(String result) {
- Log.d(TAG, "onPostExecute> "+result);
+ Log.d(TAG, "onPostExecute> " + result);
mTask = null;
Log.d(TAG, "progressbar...gone");
mProgressBar.setVisibility(View.GONE);
extra_text = "...Failed:\n" + result;
else
extra_text = "...Cancelled";
- Log.d(TAG, "progresstext += "+extra_text);
+ Log.d(TAG, "progresstext += " + extra_text);
mProgressText.setText(mProgressText.getText() + extra_text);
Log.d(TAG, "retrybutton...visible");
mRetryButton.setVisibility(View.VISIBLE);
}
}
-}
+}
\ No newline at end of file
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
+ <!-- uses-feature elements are used in Play Store device matching -->
<uses-feature android:name="android.hardware.screen.landscape" android:required="false" />
<uses-feature android:name="android.hardware.screen.portrait" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
<application
android:allowBackup="true"
android:icon="@drawable/evergreen_launcher_icon"
- android:label="@string/ou_app_label"
+ android:label="@string/ou_library_name"
android:theme="@style/Theme.AppCompat" >
<!-- Notification receiver -->
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
- <activity android:name="org.evergreen_ils.views.ApplicationPreferences" >
+ <activity android:name="org.evergreen_ils.views.UnusedPreferenceActivity" >
</activity>
<!-- Search -->
<?xml version="1.0" encoding="utf-8"?>
<!-- ou.xml - C/W MARS organizational unit -->
<resources>
+ <!-- see ../core/res/values/ou.xml for a description -->
<string name="ou_account_label">C/W MARS Library</string>
- <string name="ou_account_sign_in_message">Sign in to your\nC/W MARS Library Account</string>
+ <string name="ou_account_sign_in_message">Sign in to your\n%1$s account</string>
<string name="ou_account_type">org.cwmars</string>
<string name="ou_app_label">C/W MARS</string>
- <string name="ou_app_name">C/W MARS</string>
+ <string name="ou_library_name">C/W MARS</string>
<string name="ou_library_url">https://bark.cwmars.org</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.evergreencatalog.demo"
+ package="org.evergreen_ils.demo_app"xyzzy-think-about-this
android:installLocation="auto"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
- android:minSdkVersion="8"
- android:targetSdkVersion="18" />
+ android:minSdkVersion="10"
+ android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
- <uses-permission android:name="android.permission.CAMERA" />
- <uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
- <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
- <uses-permission android:name="android.permission.VIBRATE" />
- <uses-permission android:name="android.permission.WAKE_LOCK" />
- <uses-feature android:name="android.hardware.camera" />
- <uses-feature android:name="android.hardware.camera.autofocus" />
+ <uses-feature android:name="android.hardware.screen.landscape" android:required="false" />
+ <uses-feature android:name="android.hardware.screen.portrait" android:required="false" />
+ <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
<application
android:allowBackup="true"
android:process=":remote">
</receiver>
<!-- Receiver to reinit notifications on reboot -->
+ <!--
<receiver android:name="org.evergreen_ils.services.RebootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE"/>
</intent-filter>
</receiver>
+ -->
+ <!--
<service android:name="org.evergreen_ils.services.ScheduledIntentService">
</service>
+ -->
<activity
android:name="org.evergreen_ils.views.splashscreen.SplashActivity"
--- /dev/null
+eg_app
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="CompilerConfiguration">
+ <option name="DEFAULT_COMPILER" value="Javac" />
+ <resourceExtensions />
+ <wildcardResourcePatterns>
+ <entry name="!?*.java" />
+ <entry name="!?*.form" />
+ <entry name="!?*.class" />
+ <entry name="!?*.groovy" />
+ <entry name="!?*.scala" />
+ <entry name="!?*.flex" />
+ <entry name="!?*.kt" />
+ <entry name="!?*.clj" />
+ </wildcardResourcePatterns>
+ <annotationProcessing>
+ <profile default="true" name="Default" enabled="false">
+ <processorPath useClasspath="true" />
+ </profile>
+ </annotationProcessing>
+ </component>
+</project>
+
--- /dev/null
+<component name="CopyrightManager">
+ <settings default="" />
+</component>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false">
+ <file url="PROJECT" charset="UTF-8" />
+ </component>
+</project>
\ No newline at end of file
--- /dev/null
+<component name="libraryTable">
+ <library name="libs">
+ <CLASSES>
+ <root url="jar://$PROJECT_DIR$/../core/libs/zxing_barcode.jar!/" />
+ <root url="jar://$PROJECT_DIR$/../core/libs/androwrapee-1.1.0.jar!/" />
+ <root url="jar://$PROJECT_DIR$/../core/libs/opensrf2_android.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+</component>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="EntryPointsManager">
+ <entry_points version="2.0" />
+ </component>
+ <component name="NullableNotNullManager">
+ <option name="myDefaultNullable" value="android.support.annotation.Nullable" />
+ <option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
+ <option name="myNullables">
+ <value>
+ <list size="4">
+ <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
+ <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
+ <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
+ <item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
+ </list>
+ </value>
+ </option>
+ <option name="myNotNulls">
+ <value>
+ <list size="4">
+ <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
+ <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
+ <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
+ <item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
+ </list>
+ </value>
+ </option>
+ </component>
+ <component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="Android API 19 Platform" project-jdk-type="Android SDK">
+ <output url="file://$PROJECT_DIR$/out" />
+ </component>
+</project>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ProjectModuleManager">
+ <modules>
+ <module fileurl="file://$PROJECT_DIR$/../support/v7/appcompat/appcompat.iml" filepath="$PROJECT_DIR$/../support/v7/appcompat/appcompat.iml" />
+ <module fileurl="file://$PROJECT_DIR$/../core/core.iml" filepath="$PROJECT_DIR$/../core/core.iml" />
+ <module fileurl="file://$PROJECT_DIR$/eg_app.iml" filepath="$PROJECT_DIR$/eg_app.iml" />
+ </modules>
+ </component>
+</project>
\ No newline at end of file
--- /dev/null
+<component name="DependencyValidationManager">
+ <state>
+ <option name="SKIP_IMPORT_STATEMENTS" value="false" />
+ </state>
+</component>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="Palette2">
+ <group name="Swing">
+ <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
+ </item>
+ <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
+ </item>
+ <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
+ </item>
+ <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
+ <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
+ </item>
+ <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
+ <initial-values>
+ <property name="text" value="Button" />
+ </initial-values>
+ </item>
+ <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+ <initial-values>
+ <property name="text" value="RadioButton" />
+ </initial-values>
+ </item>
+ <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+ <initial-values>
+ <property name="text" value="CheckBox" />
+ </initial-values>
+ </item>
+ <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
+ <initial-values>
+ <property name="text" value="Label" />
+ </initial-values>
+ </item>
+ <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+ <preferred-size width="150" height="-1" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+ <preferred-size width="150" height="-1" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+ <preferred-size width="150" height="-1" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
+ </item>
+ <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+ <preferred-size width="200" height="200" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+ <preferred-size width="200" height="200" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+ </item>
+ <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+ </item>
+ <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
+ </item>
+ <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
+ </item>
+ <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
+ <preferred-size width="-1" height="20" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
+ </item>
+ <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
+ </item>
+ </group>
+ </component>
+</project>
+
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="VcsDirectoryMappings">
+ <mapping directory="$PROJECT_DIR$/../../../.." vcs="Git" />
+ </component>
+</project>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="org.evergreen_ils.eg_app"
+ android:installLocation="auto"
+ android:versionCode="1"
+ android:versionName="1.0">
+
+ <uses-sdk
+ android:minSdkVersion="10"
+ android:targetSdkVersion="19" />
+
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+ <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
+ <uses-permission android:name="android.permission.GET_ACCOUNTS" />
+ <uses-permission android:name="android.permission.INTERNET" />
+ <uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
+ <uses-permission android:name="android.permission.USE_CREDENTIALS" />
+
+ <uses-feature android:name="android.hardware.screen.landscape" android:required="false" />
+ <uses-feature android:name="android.hardware.screen.portrait" android:required="false" />
+ <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
+ <application
+ android:allowBackup="true"
+ android:icon="@drawable/evergreen_launcher_icon"
+ android:label="@string/ou_app_label"
+ android:theme="@style/Theme.AppCompat" >
+
+ <activity
+ android:name="org.evergreen_ils.views.splashscreen.SplashActivity"
+ android:theme="@android:style/Theme.NoTitleBar">
+ </activity>
+ <activity
+ android:name="org.evergreen_ils.views.ChooseLibraryActivity"
+ android:label="@string/ou_account_label">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+
+ <!-- Search -->
+
+ <activity
+ android:name="org.evergreen_ils.searchCatalog.SampleUnderlinesNoFade"
+ android:label="@string/search_details_title">
+ </activity>
+ <activity
+ android:name="org.evergreen_ils.searchCatalog.MoreCopyInformation"
+ android:label="@string/copy_information_title">
+ </activity>
+ <activity
+ android:name="org.evergreen_ils.searchCatalog.SearchCatalogListView"
+ android:label="@string/title_search"
+ android:parentActivityName="org.evergreen_ils.views.MainActivity">
+ <meta-data
+ android:name="android.support.PARENT_ACTIVITY"
+ android:value="org.evergreen_ils.views.MainActivity"/>
+ </activity>
+ <activity
+ android:name="org.evergreen_ils.searchCatalog.AdvancedSearchActivity"
+ android:label="@string/advanced_search">
+ </activity>
+ <activity
+ android:name="org.evergreen_ils.barcodescan.CaptureActivity"
+ android:screenOrientation="landscape"
+ android:theme="@android:style/Theme.NoTitleBar"
+ android:windowSoftInputMode="stateAlwaysHidden" >
+ </activity>
+
+ <!-- Checkout Activities -->
+ <activity
+ android:name="org.evergreen_ils.accountAccess.checkout.ItemsCheckOutListView"
+ android:label="@string/checkout_items_title"
+ android:parentActivityName="org.evergreen_ils.views.MainActivity">
+ <meta-data
+ android:name="android.support.PARENT_ACTIVITY"
+ android:value="org.evergreen_ils.views.MainActivity"/>
+ </activity>
+
+ <!-- Holds Activities -->
+ <activity
+ android:name="org.evergreen_ils.accountAccess.holds.HoldsListView"
+ android:label="@string/hold_items_title"
+ android:parentActivityName="org.evergreen_ils.views.MainActivity">
+ <meta-data
+ android:name="android.support.PARENT_ACTIVITY"
+ android:value="org.evergreen_ils.views.MainActivity"/>
+ </activity>
+ <activity
+ android:name="org.evergreen_ils.accountAccess.holds.PlaceHold"
+ android:label="@string/hold_place_title">
+ </activity>
+ <activity
+ android:name="org.evergreen_ils.accountAccess.holds.HoldDetails"
+ android:label="@string/hold_details_title">
+ </activity>
+
+ <!-- Fines Activities -->
+ <activity
+ android:name="org.evergreen_ils.accountAccess.fines.FinesActivity"
+ android:label="@string/title_fines"
+ android:parentActivityName="org.evergreen_ils.views.MainActivity">
+ <meta-data
+ android:name="android.support.PARENT_ACTIVITY"
+ android:value="org.evergreen_ils.views.MainActivity"/>
+ </activity>
+
+ <!-- Bookbags -->
+ <activity android:name="org.evergreen_ils.accountAccess.bookbags.BookbagsListView" >
+ </activity>
+ <activity android:name="org.evergreen_ils.accountAccess.bookbags.BookBagDetails" >
+ </activity>
+
+ <activity
+ android:name="org.evergreen_ils.auth.AuthenticatorActivity"
+ android:label="@string/ou_account_label">
+ </activity>
+
+ <activity android:name="org.evergreen_ils.views.MainActivity">
+ </activity>
+
+ <service
+ android:name="org.evergreen_ils.auth.AuthenticatorService"
+ android:exported="false" >
+ <intent-filter>
+ <action android:name="android.accounts.AccountAuthenticator" />
+ </intent-filter>
+
+ <meta-data
+ android:name="android.accounts.AccountAuthenticator"
+ android:resource="@xml/authenticator" />
+ </service>
+ </application>
+</manifest>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+ <component name="FacetManager">
+ <facet type="android" name="Android">
+ <configuration>
+ <option name="UPDATE_PROPERTY_FILES" value="true" />
+ </configuration>
+ </facet>
+ </component>
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" generated="true" />
+ </content>
+ <orderEntry type="jdk" jdkName="Android API 19 Platform" jdkType="Android SDK" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="core" />
+ </component>
+</module>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!-- ou.xml - app customization -->
+<resources>
+ <!-- see ../core/res/values/ou.xml for a description -->
+ <string name="ou_account_label">Evergreen Library</string>
+ <string name="ou_account_sign_in_message">Sign in to your\n%1$s account</string>
+ <string name="ou_account_type">org.evergreen-ils.eg_app</string>
+ <string name="ou_app_label">Evergreen</string>
+ <string name="ou_library_name"></string>
+ <string name="ou_library_url"></string>
+</resources>
my $debug = 0;
GetOptions("-d=i" => \$debug) or die;
-my $logcat = `adb logcat -d`;
+my $logcat = `adb logcat -d -v printable`;
my @lines = split(/\r\n/, $logcat);
foreach my $line (@lines) {
print "line: $line\n" if $debug;
- if ($line =~ /org.opensrf.net.http.GatewayRequest\( *\d+\): ?([^:]+):(.+)/) {
+ if ($line =~ /org.opensrf.net.http.GatewayRequest: ([^:]+):(.+)/) {
my($key,$val) = ($1,$2);
if ($key eq 'result') {
my $obj = decode_json($val);
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="gen"/>
- <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
- <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
- <classpathentry kind="output" path="bin/classes"/>
-</classpath>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>android-support-v7-gridlayout</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>com.android.ide.eclipse.adt.ApkBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>