From 94c6b998bbed898154e18631f0e52c2ab8532d51 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 15 May 2016 17:51:14 +0100 Subject: [PATCH] fix year --- .../main/java/org/openlp/android2/OpenLP.java | 2 +- .../java/org/openlp/android2/api/Api.java | 2 +- .../openlp/android2/common/JsonHelpers.java | 2 +- .../android2/common/NavigationOptions.java | 2 +- .../openlp/android2/common/NukeSSLCerts.java | 2 +- .../openlp/android2/common/OpenLPDialog.java | 2 +- .../android2/common/OpenLPFragment.java | 2 +- .../android2/common/OpenLPURLBuilder.java | 78 +++++++++++++++++++ .../android2/common/RequestQueueService.java | 2 +- .../android2/dialogs/AlertDisplayDialog.java | 2 +- .../android2/dialogs/BlankDisplayDialog.java | 2 +- .../android2/fragments/AboutFragment.java | 2 +- .../android2/fragments/HomeFragment.java | 2 +- .../android2/fragments/LiveListFragment.java | 2 +- .../android2/fragments/LiveWebFragment.java | 2 +- .../fragments/NavigationDrawerFragment.java | 2 +- .../fragments/ServiceListFragment.java | 2 +- .../android2/fragments/StageWebFragment.java | 2 +- .../android2/fragments/WebFragment.java | 2 +- 19 files changed, 96 insertions(+), 18 deletions(-) create mode 100644 app/src/main/java/org/openlp/android2/common/OpenLPURLBuilder.java diff --git a/app/src/main/java/org/openlp/android2/OpenLP.java b/app/src/main/java/org/openlp/android2/OpenLP.java index baf65b0..51ac9da 100644 --- a/app/src/main/java/org/openlp/android2/OpenLP.java +++ b/app/src/main/java/org/openlp/android2/OpenLP.java @@ -1,7 +1,7 @@ /****************************************************************************** * OpenLP - Open Source Lyrics Projection * * --------------------------------------------------------------------------- * - * Copyright (c) 2011-2015 OpenLP Android Developers * + * Copyright (c) 2011-2016 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 * diff --git a/app/src/main/java/org/openlp/android2/api/Api.java b/app/src/main/java/org/openlp/android2/api/Api.java index ca81188..1dc9fd1 100644 --- a/app/src/main/java/org/openlp/android2/api/Api.java +++ b/app/src/main/java/org/openlp/android2/api/Api.java @@ -1,7 +1,7 @@ /****************************************************************************** * OpenLP - Open Source Lyrics Projection * * --------------------------------------------------------------------------- * - * Copyright (c) 2011-2015 OpenLP Android Developers * + * Copyright (c) 2011-2016 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 * diff --git a/app/src/main/java/org/openlp/android2/common/JsonHelpers.java b/app/src/main/java/org/openlp/android2/common/JsonHelpers.java index a46ac09..d06ffc7 100644 --- a/app/src/main/java/org/openlp/android2/common/JsonHelpers.java +++ b/app/src/main/java/org/openlp/android2/common/JsonHelpers.java @@ -1,7 +1,7 @@ /****************************************************************************** * OpenLP - Open Source Lyrics Projection * * --------------------------------------------------------------------------- * - * Copyright (c) 2011-2015 OpenLP Android Developers * + * Copyright (c) 2011-2016 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 * diff --git a/app/src/main/java/org/openlp/android2/common/NavigationOptions.java b/app/src/main/java/org/openlp/android2/common/NavigationOptions.java index b231c3c..80f8dbf 100644 --- a/app/src/main/java/org/openlp/android2/common/NavigationOptions.java +++ b/app/src/main/java/org/openlp/android2/common/NavigationOptions.java @@ -1,7 +1,7 @@ /****************************************************************************** * OpenLP - Open Source Lyrics Projection * * --------------------------------------------------------------------------- * - * Copyright (c) 2011-2015 OpenLP Android Developers * + * Copyright (c) 2011-2016 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 * diff --git a/app/src/main/java/org/openlp/android2/common/NukeSSLCerts.java b/app/src/main/java/org/openlp/android2/common/NukeSSLCerts.java index 511ddb8..bd11174 100644 --- a/app/src/main/java/org/openlp/android2/common/NukeSSLCerts.java +++ b/app/src/main/java/org/openlp/android2/common/NukeSSLCerts.java @@ -1,7 +1,7 @@ /****************************************************************************** * OpenLP - Open Source Lyrics Projection * * --------------------------------------------------------------------------- * - * Copyright (c) 2011-2015 OpenLP Android Developers * + * Copyright (c) 2011-2016 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 * diff --git a/app/src/main/java/org/openlp/android2/common/OpenLPDialog.java b/app/src/main/java/org/openlp/android2/common/OpenLPDialog.java index 8f4d592..a19b8cd 100644 --- a/app/src/main/java/org/openlp/android2/common/OpenLPDialog.java +++ b/app/src/main/java/org/openlp/android2/common/OpenLPDialog.java @@ -1,7 +1,7 @@ /****************************************************************************** * OpenLP - Open Source Lyrics Projection * * --------------------------------------------------------------------------- * - * Copyright (c) 2011-2015 OpenLP Android Developers * + * Copyright (c) 2011-2016 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 * diff --git a/app/src/main/java/org/openlp/android2/common/OpenLPFragment.java b/app/src/main/java/org/openlp/android2/common/OpenLPFragment.java index 7da5ae3..9fd3578 100644 --- a/app/src/main/java/org/openlp/android2/common/OpenLPFragment.java +++ b/app/src/main/java/org/openlp/android2/common/OpenLPFragment.java @@ -1,7 +1,7 @@ /****************************************************************************** * OpenLP - Open Source Lyrics Projection * * --------------------------------------------------------------------------- * - * Copyright (c) 2011-2015 OpenLP Android Developers * + * Copyright (c) 2011-2016 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 * diff --git a/app/src/main/java/org/openlp/android2/common/OpenLPURLBuilder.java b/app/src/main/java/org/openlp/android2/common/OpenLPURLBuilder.java new file mode 100644 index 0000000..a9c1084 --- /dev/null +++ b/app/src/main/java/org/openlp/android2/common/OpenLPURLBuilder.java @@ -0,0 +1,78 @@ +/****************************************************************************** + * OpenLP - Open Source Lyrics Projection * + * --------------------------------------------------------------------------- * + * Copyright (c) 2011-2016 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 android.content.SharedPreferences; +import android.preference.PreferenceManager; +import android.util.Base64; +import android.util.Log; + +import org.openlp.android2.R; + +public class OpenLPURLBuilder { + private final String LOG_TAG = OpenLPURLBuilder.class.getName(); + private Context context; + + public OpenLPURLBuilder(Context context) { + this.context = context; + } + + public int getConnectionTimeout() { + + SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context); + + 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)) + )); + } + return connectionTimeout; + } + + public String getBasicAuth(){ + + SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context); + 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); + + String credentials = userid + ":" + password; + return "Basic " + Base64.encodeToString(credentials.getBytes(), Base64.DEFAULT); + } + + public String getBaseUrl(){ + + SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context); + + Boolean 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/RequestQueueService.java b/app/src/main/java/org/openlp/android2/common/RequestQueueService.java index 0412928..bdff433 100644 --- a/app/src/main/java/org/openlp/android2/common/RequestQueueService.java +++ b/app/src/main/java/org/openlp/android2/common/RequestQueueService.java @@ -1,7 +1,7 @@ /****************************************************************************** * OpenLP - Open Source Lyrics Projection * * --------------------------------------------------------------------------- * - * Copyright (c) 2011-2015 OpenLP Android Developers * + * Copyright (c) 2011-2016 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 * diff --git a/app/src/main/java/org/openlp/android2/dialogs/AlertDisplayDialog.java b/app/src/main/java/org/openlp/android2/dialogs/AlertDisplayDialog.java index 0c23eee..52f824e 100644 --- a/app/src/main/java/org/openlp/android2/dialogs/AlertDisplayDialog.java +++ b/app/src/main/java/org/openlp/android2/dialogs/AlertDisplayDialog.java @@ -1,7 +1,7 @@ /****************************************************************************** * OpenLP - Open Source Lyrics Projection * * --------------------------------------------------------------------------- * - * Copyright (c) 2011-2015 OpenLP Android Developers * + * Copyright (c) 2011-2016 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 * diff --git a/app/src/main/java/org/openlp/android2/dialogs/BlankDisplayDialog.java b/app/src/main/java/org/openlp/android2/dialogs/BlankDisplayDialog.java index 8a6fd7d..93fca1b 100644 --- a/app/src/main/java/org/openlp/android2/dialogs/BlankDisplayDialog.java +++ b/app/src/main/java/org/openlp/android2/dialogs/BlankDisplayDialog.java @@ -1,7 +1,7 @@ /****************************************************************************** * OpenLP - Open Source Lyrics Projection * * --------------------------------------------------------------------------- * - * Copyright (c) 2011-2015 OpenLP Android Developers * + * Copyright (c) 2011-2016 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 * diff --git a/app/src/main/java/org/openlp/android2/fragments/AboutFragment.java b/app/src/main/java/org/openlp/android2/fragments/AboutFragment.java index cbf551c..06c674a 100644 --- a/app/src/main/java/org/openlp/android2/fragments/AboutFragment.java +++ b/app/src/main/java/org/openlp/android2/fragments/AboutFragment.java @@ -1,7 +1,7 @@ /****************************************************************************** * OpenLP - Open Source Lyrics Projection * * --------------------------------------------------------------------------- * - * Copyright (c) 2011-2015 OpenLP Android Developers * + * Copyright (c) 2011-2016 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 * diff --git a/app/src/main/java/org/openlp/android2/fragments/HomeFragment.java b/app/src/main/java/org/openlp/android2/fragments/HomeFragment.java index ffd41b2..cc51a62 100644 --- a/app/src/main/java/org/openlp/android2/fragments/HomeFragment.java +++ b/app/src/main/java/org/openlp/android2/fragments/HomeFragment.java @@ -1,7 +1,7 @@ /****************************************************************************** * OpenLP - Open Source Lyrics Projection * * --------------------------------------------------------------------------- * - * Copyright (c) 2011-2015 OpenLP Android Developers * + * Copyright (c) 2011-2016 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 * diff --git a/app/src/main/java/org/openlp/android2/fragments/LiveListFragment.java b/app/src/main/java/org/openlp/android2/fragments/LiveListFragment.java index 8793b5c..82bd5e1 100644 --- a/app/src/main/java/org/openlp/android2/fragments/LiveListFragment.java +++ b/app/src/main/java/org/openlp/android2/fragments/LiveListFragment.java @@ -1,7 +1,7 @@ /****************************************************************************** * OpenLP - Open Source Lyrics Projection * * --------------------------------------------------------------------------- * - * Copyright (c) 2011-2015 OpenLP Android Developers * + * Copyright (c) 2011-2016 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 * diff --git a/app/src/main/java/org/openlp/android2/fragments/LiveWebFragment.java b/app/src/main/java/org/openlp/android2/fragments/LiveWebFragment.java index 7ff94dc..53ced25 100644 --- a/app/src/main/java/org/openlp/android2/fragments/LiveWebFragment.java +++ b/app/src/main/java/org/openlp/android2/fragments/LiveWebFragment.java @@ -1,7 +1,7 @@ /****************************************************************************** * OpenLP - Open Source Lyrics Projection * * --------------------------------------------------------------------------- * - * Copyright (c) 2011-2015 OpenLP Android Developers * + * Copyright (c) 2011-2016 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 * diff --git a/app/src/main/java/org/openlp/android2/fragments/NavigationDrawerFragment.java b/app/src/main/java/org/openlp/android2/fragments/NavigationDrawerFragment.java index 6024cf6..98b6aaf 100644 --- a/app/src/main/java/org/openlp/android2/fragments/NavigationDrawerFragment.java +++ b/app/src/main/java/org/openlp/android2/fragments/NavigationDrawerFragment.java @@ -1,7 +1,7 @@ /****************************************************************************** * OpenLP - Open Source Lyrics Projection * * --------------------------------------------------------------------------- * - * Copyright (c) 2011-2015 OpenLP Android Developers * + * Copyright (c) 2011-2016 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 * diff --git a/app/src/main/java/org/openlp/android2/fragments/ServiceListFragment.java b/app/src/main/java/org/openlp/android2/fragments/ServiceListFragment.java index 91152cb..aecc7d3 100644 --- a/app/src/main/java/org/openlp/android2/fragments/ServiceListFragment.java +++ b/app/src/main/java/org/openlp/android2/fragments/ServiceListFragment.java @@ -1,7 +1,7 @@ /****************************************************************************** * OpenLP - Open Source Lyrics Projection * * --------------------------------------------------------------------------- * - * Copyright (c) 2011-2015 OpenLP Android Developers * + * Copyright (c) 2011-2016 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 * diff --git a/app/src/main/java/org/openlp/android2/fragments/StageWebFragment.java b/app/src/main/java/org/openlp/android2/fragments/StageWebFragment.java index ede970e..64a0ef9 100644 --- a/app/src/main/java/org/openlp/android2/fragments/StageWebFragment.java +++ b/app/src/main/java/org/openlp/android2/fragments/StageWebFragment.java @@ -1,7 +1,7 @@ /****************************************************************************** * OpenLP - Open Source Lyrics Projection * * --------------------------------------------------------------------------- * - * Copyright (c) 2011-2015 OpenLP Android Developers * + * Copyright (c) 2011-2016 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 * diff --git a/app/src/main/java/org/openlp/android2/fragments/WebFragment.java b/app/src/main/java/org/openlp/android2/fragments/WebFragment.java index b441836..ac8b892 100644 --- a/app/src/main/java/org/openlp/android2/fragments/WebFragment.java +++ b/app/src/main/java/org/openlp/android2/fragments/WebFragment.java @@ -1,7 +1,7 @@ /****************************************************************************** * OpenLP - Open Source Lyrics Projection * * --------------------------------------------------------------------------- * - * Copyright (c) 2011-2015 OpenLP Android Developers * + * Copyright (c) 2011-2016 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 *