From 9dd2ec74885edeb0cfd03361eedde8bd56f19188 Mon Sep 17 00:00:00 2001 From: kenstir Date: Sat, 7 Dec 2013 19:38:09 -0500 Subject: [PATCH] centralized library url setting as preferences, only the default value is specified in a string resource --- ...application_preference_screen.xml => preferences.xml} | 1 + .../evergreen/android/views/ApplicationPreferences.java | 16 +++++++--------- .../android/views/splashscreen/SplashActivity.java | 11 ++++++----- .../org/evergreen_ils/auth/AuthenticatorActivity.java | 6 ++++++ .../src/Android/src/org/evergreen_ils/auth/Const.java | 1 + .../org/evergreen_ils/auth/EvergreenAuthenticator.java | 4 +++- 6 files changed, 24 insertions(+), 15 deletions(-) rename Open-ILS/src/Android/res/xml/{application_preference_screen.xml => preferences.xml} (95%) diff --git a/Open-ILS/src/Android/res/xml/application_preference_screen.xml b/Open-ILS/src/Android/res/xml/preferences.xml similarity index 95% rename from Open-ILS/src/Android/res/xml/application_preference_screen.xml rename to Open-ILS/src/Android/res/xml/preferences.xml index da3f473deb..07f1785914 100644 --- a/Open-ILS/src/Android/res/xml/application_preference_screen.xml +++ b/Open-ILS/src/Android/res/xml/preferences.xml @@ -18,6 +18,7 @@ android:key="notifications_enabled" android:summaryOn="@string/preference_enable_notifications_summary_on" android:summaryOff="@string/preference_enable_notifications_summary_off" + android:defaultValue="false" /> "+username); + final String library_url = PreferenceManager.getDefaultSharedPreferences(context).getString(Const.KEY_LIBRARY_URL,""); HttpConnection conn; try { - conn = new HttpConnection(context.getString(R.string.ou_library_url) + "/osrf-gateway-v1"); + conn = new HttpConnection(library_url + "/osrf-gateway-v1"); } catch (MalformedURLException e) { throw new AuthenticationException(e); } -- 2.11.0