From b3c0947e0991601c3992df31cbaa6a146b19041d Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 2 Nov 2016 18:44:26 +0000 Subject: [PATCH] more fixups --- app/app.iml | 219 +----------------- .../android2/common/OpenLPHttpClient.java | 97 -------- .../android2/common/OpenLPHttpReturn.java | 61 ----- .../res/drawable-hdpi/ic_search_black.png | Bin 684 -> 0 bytes .../res/drawable-mdpi/ic_search_black.png | Bin 464 -> 0 bytes .../res/drawable-xhdpi/ic_search_black.png | Bin 868 -> 0 bytes .../res/drawable-xxhdpi/ic_search_black.png | Bin 1307 -> 0 bytes app/src/main/res/layout/fragment_search.xml | 90 ------- .../main/res/layout/search_action_dialog.xml | 40 ---- app/src/main/res/layout/search_result_row.xml | 18 -- .../main/res/layout/spinner_dropdown_item.xml | 11 - app/src/main/res/layout/spinner_list_item.xml | 11 - 12 files changed, 11 insertions(+), 536 deletions(-) delete mode 100644 app/src/main/java/org/openlp/android2/common/OpenLPHttpClient.java delete mode 100644 app/src/main/java/org/openlp/android2/common/OpenLPHttpReturn.java delete mode 100644 app/src/main/res/drawable-hdpi/ic_search_black.png delete mode 100644 app/src/main/res/drawable-mdpi/ic_search_black.png delete mode 100644 app/src/main/res/drawable-xhdpi/ic_search_black.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_search_black.png delete mode 100644 app/src/main/res/layout/fragment_search.xml delete mode 100644 app/src/main/res/layout/search_action_dialog.xml delete mode 100644 app/src/main/res/layout/search_result_row.xml delete mode 100644 app/src/main/res/layout/spinner_dropdown_item.xml delete mode 100644 app/src/main/res/layout/spinner_list_item.xml diff --git a/app/app.iml b/app/app.iml index 459c3cb..2d7a8c7 100644 --- a/app/app.iml +++ b/app/app.iml @@ -85,6 +85,8 @@ + + @@ -98,16 +100,22 @@ + + + + + + + + - - @@ -128,209 +136,4 @@ - - - - - - + \ No newline at end of file diff --git a/app/src/main/java/org/openlp/android2/common/OpenLPHttpClient.java b/app/src/main/java/org/openlp/android2/common/OpenLPHttpClient.java deleted file mode 100644 index 1927cbc..0000000 --- a/app/src/main/java/org/openlp/android2/common/OpenLPHttpClient.java +++ /dev/null @@ -1,97 +0,0 @@ -/****************************************************************************** - * OpenLP - Open Source Lyrics Projection * - * --------------------------------------------------------------------------- * - * Copyright (c) 2011-2015 OpenLP Android Developers * - * --------------------------------------------------------------------------- * - * 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.android2.common; - - -import java.security.KeyStore; -import android.content.Context; -import android.content.SharedPreferences; -import android.preference.PreferenceManager; -import android.util.Log; -import com.loopj.android.http.AsyncHttpClient; -import org.openlp.android2.R; - -/** - * Personalised HttpClient to be used throughout OpenLP with customisable - * parameters. - */ -public class OpenLPHttpClient { - - private final String LOG_TAG = OpenLPHttpClient.class.getName(); - private Context context; - private Boolean useSSL = Boolean.FALSE; - - public OpenLPHttpClient(Context context) { - this.context = context; - } - - public String getAbsoluteUrl(AsyncHttpClient client) { - - SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context); - - String urlBase = getBaseUrl(); - - Log.d(LOG_TAG, "Base Url set to " + urlBase); - - String userid = sharedPrefs.getString(context.getString(R.string.key_userid), "openlp"); - - String password = sharedPrefs.getString(context.getString(R.string.key_password), "password"); - - Log.d(LOG_TAG, "Credentials set to " + userid + " : " + password); - client.setBasicAuth(userid,password); - - int connectionTimeout = context.getResources().getInteger( - R.integer.connectionTimeoutDefaultValue); - - if (sharedPrefs.getBoolean(context.getString(R.string.key_enable_custom_timeout), false)) { - Log.d(LOG_TAG, "Overriding Connection and Socket timeouts"); - - connectionTimeout = Integer.parseInt(sharedPrefs.getString(context.getString(R.string.key_connection_timeout), - String.valueOf(context.getResources().getInteger(R.integer.connectionTimeoutDefaultValue)) - )); - } - client.setTimeout(connectionTimeout); - if (useSSL){ - try { - KeyStore trustStore = KeyStore.getInstance((KeyStore.getDefaultType())); - trustStore.load(null, null); - OpenLPSSLSocketFactory sf = new OpenLPSSLSocketFactory(trustStore); - sf.setHostnameVerifier((OpenLPSSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER)); - client.setSSLSocketFactory(sf); - } - catch (Exception e){ - Log.d(LOG_TAG, "Unable to support SSL"); - } - } - return urlBase; - } - - public String getBaseUrl(){ - SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context); - - useSSL = sharedPrefs.getBoolean(context.getString(R.string.key_ssl_use), false); - String host = sharedPrefs.getString(context.getString(R.string.key_host), - context.getString(R.string.host_default_value)); - String port = sharedPrefs.getString(context.getString(R.string.key_port), "4316"); - - return String.format("http%s://%s:%s", useSSL ? "s" : "", host, port); - - } - -} diff --git a/app/src/main/java/org/openlp/android2/common/OpenLPHttpReturn.java b/app/src/main/java/org/openlp/android2/common/OpenLPHttpReturn.java deleted file mode 100644 index 0f96c14..0000000 --- a/app/src/main/java/org/openlp/android2/common/OpenLPHttpReturn.java +++ /dev/null @@ -1,61 +0,0 @@ -/****************************************************************************** - * OpenLP - Open Source Lyrics Projection * - * --------------------------------------------------------------------------- * - * Copyright (c) 2011-2015 OpenLP Android Developers * - * --------------------------------------------------------------------------- * - * 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.android2.common; - -import android.content.Context; -import org.openlp.android2.R; - -public class OpenLPHttpReturn { - private int return_code = 0; - private String data = null; - private Context context; - - public OpenLPHttpReturn() { - this.return_code = -1; - this.data = ""; - this.context = null; - } - - public OpenLPHttpReturn(int return_code, String data, Context context) { - this.return_code = return_code; - this.data = data; - this.context = context; - } - - public String getData() { - return this.data; - } - - public boolean isError() { - return return_code != 0; - } - - public boolean isSecurityError() { - return return_code == 401; - } - - public String getErrorMessage(String message) { - return return_code == 401 ? this.context.getString(R.string.httpreturn_unauthorised) : message; - } - - @Override - public String toString() { - return "HttpReturn{" + "data='" + data + '\'' + ", return code=" + return_code + '}'; - } -} diff --git a/app/src/main/res/drawable-hdpi/ic_search_black.png b/app/src/main/res/drawable-hdpi/ic_search_black.png deleted file mode 100644 index 3ae490ef9be0c727cdea0ff907723362d0ccf021..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 684 zcmV;d0#p5oP)u)P;0e zzc7B_qFO`{h4JmKoWoR{mmZD6{LcD0JY?p5NBJL#L?V%BqRbR)9C1a+6;;-lq(mb% z(8UV3xPQ(q%XIRDKJXp);C!W>C-902F6P`ZO~9in@B`;H+vIsP?>NSJPn9B%qCm9H zFDjHMQcsF{ij|zSrmYXUK0U)c zY=k?NX~U4dcZP{)M5Q({(}jLm@#zQGfsqyUDrboA4W}Zzh>0fk&FaU`pvd0PfPu2Q zchdL?xDfen3`~iI75vSL`~(Kp#KIE(dPRN}14m+E5r3^Be~5uAv9KP08IixlKqwZb z@Rt(#@HzZKS&_fSK-K;ovO8sE{Pl_aItC`i!WsO{iTpSQN@C%;|4q$rk?+AkqxzN& z;AcpE%W{}l7E4da5?_upkzK+_Cr->4;#*M3kC^$U7LO3ms7h^Ms9pbk9IMi(%7nbf z)F+&pd9vIu#{y2x7{&s&acWK(Bp@nah%=m;Ez+3FQ^o1wf?0ZLB}0lVt@JS`?j8Ai z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nkYvE@ChdvKx3?*|Ffv917y&G=Zy00000@CEqi^@gs^ RLQVhx002ovPDHLkV1k|`TW0_O diff --git a/app/src/main/res/layout/fragment_search.xml b/app/src/main/res/layout/fragment_search.xml deleted file mode 100644 index 591aed8..0000000 --- a/app/src/main/res/layout/fragment_search.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/search_action_dialog.xml b/app/src/main/res/layout/search_action_dialog.xml deleted file mode 100644 index b210efb..0000000 --- a/app/src/main/res/layout/search_action_dialog.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/search_result_row.xml b/app/src/main/res/layout/search_result_row.xml deleted file mode 100644 index 105f166..0000000 --- a/app/src/main/res/layout/search_result_row.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/spinner_dropdown_item.xml b/app/src/main/res/layout/spinner_dropdown_item.xml deleted file mode 100644 index 42fcee9..0000000 --- a/app/src/main/res/layout/spinner_dropdown_item.xml +++ /dev/null @@ -1,11 +0,0 @@ - - \ No newline at end of file diff --git a/app/src/main/res/layout/spinner_list_item.xml b/app/src/main/res/layout/spinner_list_item.xml deleted file mode 100644 index d76b839..0000000 --- a/app/src/main/res/layout/spinner_list_item.xml +++ /dev/null @@ -1,11 +0,0 @@ - - \ No newline at end of file