diff --git a/app/build.gradle b/app/build.gradle index 830724a..9618dc9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,17 +1,16 @@ apply plugin: 'com.android.application' - project.archivesBaseName = 'OpenLP' - android { - compileSdkVersion 22 - buildToolsVersion "21.1.2" + compileSdkVersion 25 + buildToolsVersion "25" defaultConfig { applicationId "org.openlp.android2" - minSdkVersion 15 - targetSdkVersion 22 - versionCode 5 + minSdkVersion 16 + targetSdkVersion 25 + versionCode 6 versionName "2.0" + vectorDrawables.useSupportLibrary = true } android { lintOptions { @@ -19,6 +18,9 @@ android { } } buildTypes { + debug { + debuggable true + } release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' @@ -26,20 +28,15 @@ android { } testOptions { unitTests.returnDefaultValues = true -} + } -dependencies { - compile fileTree(include: ['*.jar'], dir: 'libs') - compile 'com.android.support:appcompat-v7:22.2.1' - compile 'com.android.support:support-v4:22.2.1' - compile 'com.android.support:design:22.2.1' - compile 'com.loopj.android:android-async-http:1.4.6' - testCompile 'junit:junit:4.12' - testCompile 'org.easytesting:fest:1.0.16' - testCompile 'com.squareup:fest-android:1.0.8' - testCompile('org.robolectric:robolectric:3.0-rc2') { - exclude group: 'commons-logging', module: 'commons-logging' - exclude group: 'org.apache.httpcomponents', module: 'httpclient' + dependencies { + compile fileTree(include: ['*.jar'], dir: 'libs') + compile 'com.android.support:appcompat-v7:25.0.0' + compile 'com.android.support:support-v4:25.0.0' + compile 'com.android.support:design:25.0.0' } } +dependencies { + compile files('libs/classes.jar') } \ No newline at end of file diff --git a/app/libs/classes.jar b/app/libs/classes.jar new file mode 100644 index 0000000..791fe0b Binary files /dev/null and b/app/libs/classes.jar differ diff --git a/app/src/main/java/org/openlp/android2/OpenLP.java b/app/src/main/java/org/openlp/android2/OpenLP.java index 5a4e2f1..e09a0cb 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 * @@ -35,6 +35,8 @@ import android.view.WindowManager; import org.openlp.android2.activities.SettingsActivity; import org.openlp.android2.common.NavigationOptions; +import org.openlp.android2.common.OpenLPURLBuilder; +import org.openlp.android2.common.StateHolder; import org.openlp.android2.dialogs.AlertDisplayDialog; import org.openlp.android2.dialogs.BlankDisplayDialog; import org.openlp.android2.fragments.AboutFragment; @@ -65,6 +67,8 @@ public class OpenLP extends ActionBarActivity protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); + OpenLPURLBuilder.getInstance().setContext(this); + StateHolder.getInstance().setContext(this); doPreferenceCheck(); @@ -140,7 +144,7 @@ public class OpenLP extends ActionBarActivity .replace(R.id.container_left, ServiceListFragment.newInstance(), "servicelist") .commit(); fragmentManager.beginTransaction() - .replace(R.id.container_right, LiveListFragment.newInstance()) + .replace(R.id.container_right, LiveListFragment.newInstance(), "livelist") .commit(); mTitle = getString(R.string.live_list); toggerContainer(R.id.next_button, View.VISIBLE); 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..bcc6a2f 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 * @@ -18,6 +18,8 @@ *******************************************************************************/ package org.openlp.android2.common; +import android.util.Log; + import org.json.JSONException; import org.json.JSONObject; import org.json.JSONStringer; @@ -37,6 +39,7 @@ public class JsonHelpers { responseJSON = new JSONStringer().object().key("request").value(jo) .endObject().toString(); responseJSON = URLEncoder.encode(responseJSON, "UTF-8"); + Log.d(LOG_TAG, String.format("createRequestJSON: %s : %s : %s", key, value, responseJSON)); return responseJSON; } catch (JSONException e) { throw new JSONHandlerException(e); 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 e2726b4..cd8b159 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/OpenLPFragment.java b/app/src/main/java/org/openlp/android2/common/OpenLPFragment.java index 6a6d769..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 * @@ -26,18 +26,30 @@ import android.view.View; import android.widget.ListView; import android.widget.Toast; -import com.loopj.android.http.AsyncHttpClient; -import com.loopj.android.http.TextHttpResponseHandler; -import org.apache.http.Header; + +import com.android.volley.AuthFailureError; +import com.android.volley.ClientError; +import com.android.volley.DefaultRetryPolicy; +import com.android.volley.NetworkError; +import com.android.volley.NoConnectionError; +import com.android.volley.ParseError; +import com.android.volley.Request; +import com.android.volley.Response; +import com.android.volley.ServerError; +import com.android.volley.TimeoutError; +import com.android.volley.VolleyError; +import com.android.volley.toolbox.StringRequest; import org.openlp.android2.R; import org.openlp.android2.api.Api; +import java.util.HashMap; +import java.util.Map; + abstract public class OpenLPFragment extends ListFragment{ private String LOG_TAG = OpenLPFragment.class.getName(); public Context context; - protected String calledURL; - protected OpenLPHttpClient httpClient; + protected String urlcalled; protected String updateUrl; abstract public void itemClicked(int position); @@ -48,43 +60,72 @@ abstract public class OpenLPFragment extends ListFragment{ itemClicked(position); } - private static AsyncHttpClient client = new AsyncHttpClient(); - protected void refreshDisplay(){} protected void populateDisplay(String responseString, boolean inError) {} protected void processUpdate(String responseString, boolean inError) {} - protected void triggerTextRequest(String url) { - calledURL = url; - Log.d(LOG_TAG, "Trigger Request for url " + url); - String callurl = String.format("%s%s", httpClient.getAbsoluteUrl(client), url ); - client.get(callurl, null, new TextHttpResponseHandler() { + protected void triggerTextRequest(final String urlbase) { + String url = RequestQueueService.getInstance(this.context).getUrl(urlbase); + updateUrl = urlbase; + + StringRequest request = new StringRequest( + Request.Method.GET, + url, + listener, + errorListener) { + @Override - public void onSuccess(int statusCode, Header[] headers, String responseString) { - // called when response HTTP status is "200 OK" - manageResponse(responseString, true); + public Map getHeaders() throws AuthFailureError { + return createBasicAuthHeader("user", "passwd"); } - @Override - public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) { - // called when response HTTP status is "4XX" (eg. 401, 403, 404) - if (statusCode == 401) { - Toast.makeText(context, R.string.httpreturn_unauthorised, Toast.LENGTH_LONG).show(); - } else { - Toast.makeText(context, R.string.unable, Toast.LENGTH_LONG).show(); - } - manageResponse(responseString, false); - } - }); + }; + //Set a retry policy in case of SocketTimeout & ConnectionTimeout Exceptions. + // Volley does retry for you if you have specified the policy. + request.setRetryPolicy(new DefaultRetryPolicy( + RequestQueueService.getInstance(this.context).getConnectionTimeout(), + DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT)); + request.setTag("OpenLP"); + RequestQueueService.getInstance(this.context).addToRequestQueue(request); } - public void manageResponse(String response, boolean notInError) { - if (calledURL.equals(updateUrl)) { - populateDisplay(response, notInError); - }else { - processUpdate(response, notInError); - } + Map createBasicAuthHeader(String username, String password) { + Map headers = new HashMap(); + headers.put("Authorization", RequestQueueService.getInstance(context).getBasicAuth()); + + return headers; } + Response.Listener listener = new Response.Listener() { + @Override + public void onResponse(String response) { + if (urlcalled.equals(updateUrl)) { + populateDisplay(response, true); + } else { + processUpdate(response, true); + } + } + }; + + Response.ErrorListener errorListener = new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + Log.d(LOG_TAG, String.format("Call response error = %s", error.toString())); + if (error instanceof NetworkError) { + } else if (error instanceof ClientError) { + } else if (error instanceof ServerError) { + } else if (error instanceof AuthFailureError) { + Toast.makeText(context, R.string.httpreturn_unauthorised, + Toast.LENGTH_LONG).show(); + } else if (error instanceof ParseError) { + } else if (error instanceof NoConnectionError) { + } else if (error instanceof TimeoutError) { + } + Toast.makeText(context, R.string.unable, + Toast.LENGTH_LONG).show(); + + } + }; + public void next() { Log.d(LOG_TAG, "Going to next slide"); triggerTextRequest(Api.LIVE_NEXT); diff --git a/app/src/main/java/org/openlp/android2/common/OpenLPSSLSocketFactory.java b/app/src/main/java/org/openlp/android2/common/OpenLPSSLSocketFactory.java deleted file mode 100644 index a4f3ea3..0000000 --- a/app/src/main/java/org/openlp/android2/common/OpenLPSSLSocketFactory.java +++ /dev/null @@ -1,66 +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 org.apache.http.conn.ssl.SSLSocketFactory; - -import javax.net.ssl.SSLContext; -import javax.net.ssl.TrustManager; -import javax.net.ssl.X509TrustManager; -import java.io.IOException; -import java.net.Socket; -import java.net.UnknownHostException; -import java.security.*; -import java.security.cert.CertificateException; -import java.security.cert.X509Certificate; - -/** - * Created by tim on 14/11/14. - */ -public class OpenLPSSLSocketFactory extends SSLSocketFactory { - SSLContext sslContext = SSLContext.getInstance("TLS"); - - public OpenLPSSLSocketFactory(KeyStore truststore) throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException { - super(truststore); - - TrustManager tm = new X509TrustManager() { - public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { - } - - public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { - } - - public X509Certificate[] getAcceptedIssuers() { - return null; - } - }; - - sslContext.init(null, new TrustManager[] { tm }, null); - } - - @Override - public Socket createSocket(Socket socket, String host, int port, boolean autoClose) throws IOException, UnknownHostException { - return sslContext.getSocketFactory().createSocket(socket, host, port, autoClose); - } - - @Override - public Socket createSocket() throws IOException { - return sslContext.getSocketFactory().createSocket(); - } -} 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..8e9867e --- /dev/null +++ b/app/src/main/java/org/openlp/android2/common/OpenLPURLBuilder.java @@ -0,0 +1,86 @@ +/****************************************************************************** + * 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; + + private static OpenLPURLBuilder ourInstance = new OpenLPURLBuilder(); + + public static OpenLPURLBuilder getInstance() { + return ourInstance; + } + + private OpenLPURLBuilder() { + } + + public void setContext(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); + + 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", 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 new file mode 100644 index 0000000..8285389 --- /dev/null +++ b/app/src/main/java/org/openlp/android2/common/RequestQueueService.java @@ -0,0 +1,99 @@ +/****************************************************************************** + * 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.graphics.Bitmap; +import android.util.Base64; +import android.util.LruCache; + +import com.android.volley.AuthFailureError; +import com.android.volley.Request; +import com.android.volley.RequestQueue; +import com.android.volley.toolbox.HurlStack; +import com.android.volley.toolbox.ImageLoader; +import com.android.volley.toolbox.Volley; + +import java.util.HashMap; +import java.util.Map; + +public class RequestQueueService { + + private static RequestQueueService mInstance; + private RequestQueue mRequestQueue; + private ImageLoader mImageLoader; + private static Context mCtx; + + private RequestQueueService(Context context) { + mCtx = context; + mRequestQueue = getRequestQueue(); + + mImageLoader = new ImageLoader(mRequestQueue, + new ImageLoader.ImageCache() { + private final LruCache cache = new LruCache(20); + + @Override + public Bitmap getBitmap(String url) { + return cache.get(url); + } + + @Override + public void putBitmap(String url, Bitmap bitmap) { + cache.put(url, bitmap); + } + }); + } + + public static synchronized RequestQueueService getInstance(Context context) { + if (mInstance == null) { + mInstance = new RequestQueueService(context); + } + return mInstance; + } + + public RequestQueue getRequestQueue() { + if (mRequestQueue == null) { + // getApplicationContext() is key, it keeps you from leaking the + // Activity or BroadcastReceiver if someone passes one in. + mRequestQueue = Volley.newRequestQueue(mCtx.getApplicationContext()); + } + return mRequestQueue; + } + + public String getUrl(String url){ + return String.format("%s%s", OpenLPURLBuilder.getInstance().getBaseUrl(), url ); + } + + public String getBasicAuth(){ + return OpenLPURLBuilder.getInstance().getBasicAuth(); + } + + public int getConnectionTimeout(){ + return OpenLPURLBuilder.getInstance().getConnectionTimeout(); + } + + public void addToRequestQueue(Request req) { + getRequestQueue().add(req); + } + + public ImageLoader getImageLoader() { + return mImageLoader; + } +} + diff --git a/app/src/main/java/org/openlp/android2/common/StateHolder.java b/app/src/main/java/org/openlp/android2/common/StateHolder.java new file mode 100644 index 0000000..ab26175 --- /dev/null +++ b/app/src/main/java/org/openlp/android2/common/StateHolder.java @@ -0,0 +1,22 @@ +package org.openlp.android2.common; + +import android.content.Context; + +/** + * Created by tim on 14/08/16. + */ +public class StateHolder { + private static StateHolder ourInstance = new StateHolder(); + private static Context context; + + public static StateHolder getInstance() { + return ourInstance; + } + + private StateHolder() { + } + + public void setContext(Context context) { + this.context = context; + } +} 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 0a68677..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 * @@ -32,7 +32,6 @@ import org.openlp.android2.R; import org.openlp.android2.api.Api; import org.openlp.android2.common.JsonHelpers; import org.openlp.android2.common.OpenLPDialog; -import org.openlp.android2.common.OpenLPHttpClient; public class AlertDisplayDialog extends OpenLPDialog { private final String LOG_TAG = AlertDisplayDialog.class.getName(); @@ -49,7 +48,6 @@ public class AlertDisplayDialog extends OpenLPDialog { // remove the dialog title, but you must call the superclass to get the Dialog. context = getActivity(); - httpClient = new OpenLPHttpClient(context); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); // Get the layout inflater 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 833e264..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 * @@ -35,10 +35,10 @@ import org.openlp.android2.R; import org.openlp.android2.api.Api; import org.openlp.android2.common.OpenLPDialog; -import org.openlp.android2.common.OpenLPHttpClient; public class BlankDisplayDialog extends OpenLPDialog { private final String LOG_TAG = BlankDisplayDialog.class.getName(); + public AlertDialog dialog; RadioButton desktop; RadioButton screen; @@ -56,8 +56,6 @@ public class BlankDisplayDialog extends OpenLPDialog { // remove the dialog title, but you must call the superclass to get the Dialog. context = getActivity(); - httpClient = new OpenLPHttpClient(context); - AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); // Get the layout inflater LayoutInflater inflater = getActivity().getLayoutInflater(); @@ -147,8 +145,8 @@ public class BlankDisplayDialog extends OpenLPDialog { } } - public void errorDisplay(int statusCode, String responseString) { - Log.d(LOG_TAG, String.format("URL Error status code %d text %s", statusCode, responseString)); + public void errorDisplay(String responseString) { + Log.d(LOG_TAG, String.format("URL Error text %s", responseString)); reset_display(); } diff --git a/app/src/main/java/org/openlp/android2/dialogs/SearchSelectionDialog.java b/app/src/main/java/org/openlp/android2/dialogs/SearchSelectionDialog.java new file mode 100644 index 0000000..35d71fe --- /dev/null +++ b/app/src/main/java/org/openlp/android2/dialogs/SearchSelectionDialog.java @@ -0,0 +1,135 @@ +/****************************************************************************** + * 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.dialogs; + +import android.app.AlertDialog; +import android.app.Dialog; +import android.content.DialogInterface; +import android.os.Bundle; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.Button; +import android.widget.RadioButton; +import android.widget.Toast; +import org.openlp.android2.R; +import org.openlp.android2.api.Api; +import org.openlp.android2.common.JsonHelpers; +import org.openlp.android2.common.OpenLPDialog; + +public class SearchSelectionDialog extends OpenLPDialog { + private final String LOG_TAG = SearchSelectionDialog.class.getName(); + public AlertDialog dialog; + private String key; + private String plugin; + private String text; + private RadioButton sendLive; + private RadioButton addToService; + + /** + * The system calls this only when creating the layout in a dialog. + */ + @Override + public Dialog onCreateDialog(Bundle savedInstanceState) { + // The only reason you might override this method when using onCreateView() is + // to modify any dialog characteristics. For example, the dialog includes a + // title by default, but your custom layout might not need it. So here you can + // remove the dialog title, but you must call the superclass to get the Dialog. + + key = getArguments().getString("key"); + plugin = getArguments().getString("plugin"); + text = getArguments().getString("text"); + + Log.d(LOG_TAG, String.format("onCreateDialog %s : %s : %s", key, plugin, text)); + + context = getActivity(); + + AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); + // Get the layout inflater + LayoutInflater inflater = getActivity().getLayoutInflater(); + + // Inflate and set the layout for the dialog + // Pass null as the parent view because its going in the dialog layout + View view = inflater.inflate(R.layout.search_action_dialog, null); + builder.setView(view); + + sendLive = (RadioButton) view.findViewById(R.id.buttonLive); + sendLive.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + createLive(); + SearchSelectionDialog.this.getDialog().cancel(); + } + }); + + addToService = (RadioButton) view.findViewById(R.id.buttonService); + addToService.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + createService(); + SearchSelectionDialog.this.getDialog().cancel(); + } + }); + + builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int id) { + SearchSelectionDialog.this.getDialog().cancel(); + } + }); + dialog = builder.create(); + dialog.setOnShowListener(new DialogInterface.OnShowListener() { + @Override + public void onShow(DialogInterface dialogI) { + Button btnNegative = dialog.getButton(Dialog.BUTTON_NEGATIVE); + btnNegative.setTextSize(20); + } + }); + return dialog; + } + + @Override + public void onResume() { + super.onResume(); + Log.d(LOG_TAG, "Resuming..."); + } + + public void createLive() { + try { + String request = JsonHelpers.createRequestJSON("id", text); + String url = String.format(Api.SEARCH_PLUGIN_LIVE, plugin.toLowerCase()); + triggerTextRequest(String.format("%s%s", url, request)); + Log.d(LOG_TAG, String.format("Setting list data. apiBase(%s), text(%s)", Api.SEARCH_PLUGIN_LIVE, request)); + } catch (JsonHelpers.JSONHandlerException e) { + e.printStackTrace(); + Toast.makeText(context, "Request Failed", Toast.LENGTH_SHORT).show(); + } + } + + public void createService() { + try { + String request = JsonHelpers.createRequestJSON("id", text); + String url = String.format(Api.SEARCH_PLUGIN_ADD, plugin.toLowerCase()); + triggerTextRequest(String.format("%s%s", url, request)); + Log.d(LOG_TAG, String.format("Setting list data. apiBase(%s), text(%s)", Api.SEARCH_PLUGIN_ADD, text)); + } catch (JsonHelpers.JSONHandlerException e) { + e.printStackTrace(); + Toast.makeText(context, "Request Failed", Toast.LENGTH_SHORT).show(); + } + } +} 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 3717a68..48403c8 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 * @@ -42,7 +42,6 @@ import org.openlp.android2.R; import org.openlp.android2.api.Api; import org.openlp.android2.common.JsonHelpers; import org.openlp.android2.common.OpenLPFragment; -import org.openlp.android2.common.OpenLPHttpClient; import java.util.ArrayList; import java.util.HashMap; @@ -73,8 +72,7 @@ public class LiveListFragment extends OpenLPFragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { context = getActivity(); - updateUrl = Api.LIVE_TEXT; - httpClient = new OpenLPHttpClient(context); + urlcalled = Api.LIVE_TEXT; return super.onCreateView(inflater, container, savedInstanceState); } @@ -106,10 +104,10 @@ public class LiveListFragment extends OpenLPFragment { } // Keys used in Hashmap - String[] from = {"tag", "liveListNormal", "liveListSelected"}; + String[] from = {"line", "tag", "liveListNormal", "liveListSelected"}; // Ids of views in live_list_fragment - int[] to = {R.id.tag, R.id.liveListNormal, R.id.liveListSelected}; + int[] to = {R.id.line, R.id.tag, R.id.liveListNormal, R.id.liveListSelected}; SharedPreferences prefs = context.getSharedPreferences( context.getString(R.string.key_shared_preferences), @@ -125,15 +123,21 @@ public class LiveListFragment extends OpenLPFragment { R.layout.fragment_livelist, from, to) { public View getView(int position, View convertView, ViewGroup parent) { View view = super.getView(position, convertView, parent); + // TextView line = (TextView) view.findViewById(R.id.line); TextView text1 = (TextView) view.findViewById(R.id.tag); - text1.setTextSize(TypedValue.COMPLEX_UNIT_SP, size); + if (text1 != null) { + text1.setTextSize(TypedValue.COMPLEX_UNIT_SP, size); + } TextView text2 = (TextView) view.findViewById(R.id.liveListNormal); - text2.setTextSize(TypedValue.COMPLEX_UNIT_SP, size); - if (selected == position) { - text2.setTextColor(Color.parseColor("#000000")); - text2.setTypeface(null, Typeface.BOLD_ITALIC); - } else{ - text2.setTypeface(null, Typeface.NORMAL); + if (text2 != null) { + text2.setTextSize(TypedValue.COMPLEX_UNIT_SP, size); + if (selected == position) { + text2.setTypeface(null, Typeface.BOLD_ITALIC); + // line.setBackgroundColor(0xffffff); + } else { + text2.setTypeface(null, Typeface.NORMAL); + // line.setBackgroundColor(0xffffff); + } } return view; 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 7f920b2..f6039bc 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/SearchFragment.java b/app/src/main/java/org/openlp/android2/fragments/SearchFragment.java new file mode 100644 index 0000000..f652d57 --- /dev/null +++ b/app/src/main/java/org/openlp/android2/fragments/SearchFragment.java @@ -0,0 +1,357 @@ +/****************************************************************************** + * 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.fragments; + +import android.app.DialogFragment; +import android.app.Fragment; +import android.content.Context; +import android.os.Bundle; +import android.util.Log; +import android.view.KeyEvent; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.view.inputmethod.EditorInfo; +import android.view.inputmethod.InputMethodManager; +import android.widget.AdapterView; +import android.widget.ArrayAdapter; +import android.widget.EditText; +import android.widget.ListView; +import android.widget.Spinner; +import android.widget.TextView; +import android.widget.Toast; + +import com.android.volley.AuthFailureError; +import com.android.volley.ClientError; +import com.android.volley.DefaultRetryPolicy; +import com.android.volley.NetworkError; +import com.android.volley.NoConnectionError; +import com.android.volley.ParseError; +import com.android.volley.Request; +import com.android.volley.Response; +import com.android.volley.ServerError; +import com.android.volley.TimeoutError; +import com.android.volley.VolleyError; +import com.android.volley.toolbox.StringRequest; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.openlp.android2.R; +import org.openlp.android2.api.Api; +import org.openlp.android2.common.JsonHelpers; + +import org.openlp.android2.common.RequestQueueService; +import org.openlp.android2.dialogs.SearchSelectionDialog; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + + */ +public class SearchFragment extends Fragment { + + private final String LOG_TAG = SearchFragment.class.getName(); + private Spinner spinner; + public Context context; + protected String calledURL; + protected String updateUrl; + protected String searchedPlugin; + protected Map pluginMap = new HashMap(); + + public SearchFragment() { + Log.d(LOG_TAG, "Constructor"); + } + + public static SearchFragment newInstance() { + SearchFragment fragment = new SearchFragment(); + return fragment; + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + context = getActivity(); + updateUrl = Api.SEARCHABLE_PLUGINS; + View view = inflater.inflate(R.layout.fragment_search, container, false); + spinner = (Spinner) view.findViewById(R.id.search_spinner); + triggerTextRequest(Api.SEARCHABLE_PLUGINS); + + // Add search listener to text field + final EditText editText = (EditText) view.findViewById(R.id.search_text); + editText.setOnEditorActionListener(new TextView.OnEditorActionListener() { + @Override + public boolean onEditorAction(TextView tv, int actionId, KeyEvent event) { + if (actionId == EditorInfo.IME_ACTION_SEARCH) { + // Now close the keyboard as finished with + View view = getActivity().getCurrentFocus(); + if (view != null) { + InputMethodManager imm = + (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(view.getWindowToken(), 0); + } + searchedPlugin = pluginMap.get(spinner.getSelectedItem().toString()); + requestSearch(tv.getText().toString()); + return true; + } + return false; + } + }); + spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { + /** + * Called when a new item is selected (in the Spinner) + */ + public void onItemSelected(AdapterView parent, View view, + int pos, long id) { + editText.setText(""); + } + public void onNothingSelected(AdapterView parent) { + // Do nothing, just another required interface callback + } + + }); + return view; + } + + @Override + public void onDetach() { + super.onDetach(); + } + + private void populatePluginList(String response, Boolean notInError) { + Log.i(LOG_TAG, "populatePluginList - entry"); + List categories = new ArrayList(); + pluginMap.clear(); + + if (notInError) { + try { + JSONArray items = new JSONObject(response).getJSONObject("results").getJSONArray("items"); + for (int i = 0; i < items.length(); ++i) { + JSONArray item = items.getJSONArray(i); + categories.add(item.get(1).toString()); + pluginMap.put(item.get(1).toString(), item.get(0).toString()); + } + } catch (JSONException e) { + Log.e(LOG_TAG, response); + e.printStackTrace(); + } + ArrayAdapter LTRadapter = new ArrayAdapter(getActivity(), + R.layout.spinner_list_item, categories); + LTRadapter.setDropDownViewResource(R.layout.spinner_dropdown_item); + spinner.setAdapter(LTRadapter); + Log.i(LOG_TAG, "populatePluginList - exit"); + } + } + + protected void triggerTextRequest(String urlbase) { + Log.d(LOG_TAG, "Trigger Request for url " + urlbase); + String url = RequestQueueService.getInstance(this.context).getUrl(urlbase); + calledURL = urlbase; + + StringRequest request = new StringRequest( + Request.Method.GET, + url, + listener, + errorListener) { + + @Override + public Map getHeaders() throws AuthFailureError { + return createBasicAuthHeader("user", "passwd"); + } + }; + //Set a retry policy in case of SocketTimeout & ConnectionTimeout Exceptions. + // Volley does retry for you if you have specified the policy. + request.setRetryPolicy(new DefaultRetryPolicy( + RequestQueueService.getInstance(this.context).getConnectionTimeout(), + DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT)); + request.setTag("OpenLP"); + RequestQueueService.getInstance(this.context).addToRequestQueue(request); + } + + Map createBasicAuthHeader(String username, String password) { + Map headers = new HashMap(); + headers.put("Authorization", RequestQueueService.getInstance(context).getBasicAuth()); + + return headers; + } + + Response.Listener listener = new Response.Listener() { + @Override + public void onResponse(String response) { + if (calledURL.equals(updateUrl)) { + populatePluginList(response, true); + } else { + populateListDisplay(response, true); + } + } + }; + + Response.ErrorListener errorListener = new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + Log.d(LOG_TAG, String.format("Call response error = %s", error.toString())); + if (error instanceof NetworkError) { + } else if (error instanceof ClientError) { + } else if (error instanceof ServerError) { + } else if (error instanceof AuthFailureError) { + Toast.makeText(context, R.string.httpreturn_unauthorised, + Toast.LENGTH_LONG).show(); + } else if (error instanceof ParseError) { + } else if (error instanceof NoConnectionError) { + } else if (error instanceof TimeoutError) { + } + Toast.makeText(context, R.string.unable, + Toast.LENGTH_LONG).show(); + + } + }; + + public void requestSearch(String text) { + updateUrl = Api.SEARCH_PLUGIN_FORMATTED; + try { + String request = JsonHelpers.createRequestJSON("text", text); + String url = String.format(Api.SEARCH_PLUGIN_FORMATTED, searchedPlugin); + triggerTextRequest(String.format("%s%s", url, request)); + Log.d(LOG_TAG, String.format("Search request. apiBase(%s), text(%s)", searchedPlugin, text)); + } catch (JsonHelpers.JSONHandlerException e) { + e.printStackTrace(); + Toast.makeText(context, "Search Request Failed", Toast.LENGTH_SHORT).show(); + } + } + + public void populateListDisplay(String json, boolean notInError) { + Log.i(LOG_TAG, "populateListDisplay - entry"); + ListView list = (ListView) getActivity().findViewById(R.id.searchListView); + final ArrayList listitems = new ArrayList(); + if (notInError) { + try { + JSONArray items = new JSONObject(json).getJSONObject("results").getJSONArray("items"); + Log.d(LOG_TAG,items.toString()); + for (int i = 0; i < items.length(); ++i) { + JSONArray item = items.getJSONArray(i); + listitems.add(item); + } + } catch (JSONException e) { + Log.e(LOG_TAG, json); + e.printStackTrace(); + } + } + + final StableArrayAdapter adapter = new StableArrayAdapter(context, + android.R.layout.simple_list_item_1, + listitems); + + + list.setAdapter(adapter); + list.setOnItemClickListener(new AdapterView.OnItemClickListener() { + + @Override + public void onItemClick(AdapterView parent, final View view, + int position, long id) { + final JSONArray item = (JSONArray) parent.getItemAtPosition(position); + //Toast.makeText(context, "Item Pressed " + String.valueOf(position) + item, + // Toast.LENGTH_SHORT).show(); + String it = ""; + try { + Log.i(LOG_TAG, "list.setOnItemClickListener" + item); + it = item.get(0).toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + Bundle args = new Bundle(); + args.putString("plugin", searchedPlugin); + args.putString("text", it); + args.putString("key", Long.toString(id)); + DialogFragment SSDFragment = new SearchSelectionDialog(); + SSDFragment.setArguments(args); + SSDFragment.show(getFragmentManager(), "TAG"); + + } + }); + Log.i(LOG_TAG, "populateListDisplay - exit"); + } + + public class StableArrayAdapter extends ArrayAdapter { + + HashMap mIdMap = new HashMap(); + + public StableArrayAdapter(Context context, + int textViewResourceId, + List objects) { + super(context, textViewResourceId, objects); + + for (int i = 0; i < objects.size(); ++i) { + JSONArray item = objects.get(i); + try { + mIdMap.put(item.get(1).toString(), i); + } catch (JSONException e) { + e.printStackTrace(); + } + } + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + // Get the data item for this position + //User user = getItem(position); + String item = null; + try { + item = getItem(position).get(1).toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + // Check if an existing view is being reused, otherwise inflate the view + if (convertView == null) { + convertView = LayoutInflater.from(getContext()).inflate(R.layout.search_result_row, + parent, false); + } + // Lookup view for data population + TextView tvItem = (TextView) convertView.findViewById(R.id.searchListRow); + // Populate the data into the template view using the data object + tvItem.setText(item); + // Return the completed view to render on screen + return convertView; + } + + @Override + public long getItemId(int position) { + String item = null; + try { + item = getItem(position).get(1).toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + return mIdMap.get(item); + } + + @Override + public boolean hasStableIds() { + return true; + } + + } + +} 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 c72ed7a..1be47b0 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 * @@ -40,12 +40,10 @@ import org.openlp.android2.R; import org.openlp.android2.api.Api; import org.openlp.android2.common.JsonHelpers; import org.openlp.android2.common.OpenLPFragment; -import org.openlp.android2.common.OpenLPHttpClient; import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import java.util.Map; public class ServiceListFragment extends OpenLPFragment { @@ -64,8 +62,7 @@ public class ServiceListFragment extends OpenLPFragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { context = getActivity(); - updateUrl = Api.SERVICE_LIST; - httpClient = new OpenLPHttpClient(context); + urlcalled = Api.SERVICE_LIST; return super.onCreateView(inflater, container, savedInstanceState); } @@ -141,10 +138,10 @@ public class ServiceListFragment extends OpenLPFragment { } // Keys used in Hashmap - String[] from = {"icon", "title"}; + String[] from = {"line","icon", "title"}; // Ids of views in service_list_fragment - int[] to = {R.id.icon, R.id.serviceListText}; + int[] to = {R.id.servicelistLine, R.id.icon, R.id.serviceListText}; SharedPreferences prefs = context.getSharedPreferences( context.getString(R.string.key_shared_preferences), @@ -158,19 +155,26 @@ public class ServiceListFragment extends OpenLPFragment { // Instantiating an adapter to store each items ListAdapter adapter = new SimpleAdapter(getActivity().getBaseContext(), aList, R.layout.fragment_service_list, from, to) { + public View getView(int position, View convertView, ViewGroup parent) { + View view = super.getView(position, convertView, parent); + + TextView line = (TextView) view.findViewById(R.id.servicelistLine); TextView text1 = (TextView) view.findViewById(R.id.serviceListText); text1.setTextSize(TypedValue.COMPLEX_UNIT_SP, size); if (selected == position) { text1.setTextColor(Color.parseColor("#000000")); text1.setTypeface(null, Typeface.BOLD_ITALIC); + line.setBackgroundColor(0xffffff); } else{ text1.setTypeface(null, Typeface.NORMAL); + line.setBackgroundColor(0xffffff); } return view; } }; + setListAdapter(adapter); SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context); 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 fdffb41..20400d9 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 * @@ -19,21 +19,18 @@ package org.openlp.android2.fragments; import android.app.Fragment; -import android.net.http.SslError; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.webkit.SslErrorHandler; import android.webkit.WebView; import android.webkit.WebViewClient; import org.openlp.android2.R; -import org.openlp.android2.common.OpenLPHttpClient; +import org.openlp.android2.common.OpenLPURLBuilder; public class WebFragment extends Fragment { protected String curURL; - private OpenLPHttpClient httpClient; private WebView webview; public WebFragment(){ @@ -47,7 +44,7 @@ public class WebFragment extends Fragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) { - httpClient = new OpenLPHttpClient(getActivity()); + View view = inflater.inflate(R.layout.fragment_web, container, false); if (curURL != null) { @@ -59,7 +56,7 @@ public class WebFragment extends Fragment { webview.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); webview.setScrollbarFadingEnabled(true); webview.setWebViewClient(new webClient()); - webview.loadUrl(String.format("%s%s", httpClient.getBaseUrl(), curURL)); + webview.loadUrl(String.format("%s%s", OpenLPURLBuilder.getInstance().getBaseUrl(), curURL)); } return view; } @@ -72,14 +69,10 @@ public class WebFragment extends Fragment { super.onDestroyView(); } - private class webClient extends WebViewClient { + public class webClient extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { return false; } - @Override - public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) { - handler.proceed(); // Ignore SSL certificate errors - } } } diff --git a/app/src/main/res/drawable-hdpi/ic_search_black.png b/app/src/main/res/drawable-hdpi/ic_search_black.png new file mode 100644 index 0000000..3ae490e Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_search_black.png differ diff --git a/app/src/main/res/drawable-hdpi/openlp_splash_screen.png b/app/src/main/res/drawable-hdpi/openlp_splash_screen.png index 618e47c..d413fdd 100644 Binary files a/app/src/main/res/drawable-hdpi/openlp_splash_screen.png and b/app/src/main/res/drawable-hdpi/openlp_splash_screen.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_search_black.png b/app/src/main/res/drawable-mdpi/ic_search_black.png new file mode 100644 index 0000000..6381902 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_search_black.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_search_black.png b/app/src/main/res/drawable-xhdpi/ic_search_black.png new file mode 100644 index 0000000..21be572 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_search_black.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_search_black.png b/app/src/main/res/drawable-xxhdpi/ic_search_black.png new file mode 100644 index 0000000..a5e7a9c Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_search_black.png differ diff --git a/app/src/main/res/drawable/customborder.xml b/app/src/main/res/drawable/custom_border.xml similarity index 87% rename from app/src/main/res/drawable/customborder.xml rename to app/src/main/res/drawable/custom_border.xml index e657938..f613773 100644 --- a/app/src/main/res/drawable/customborder.xml +++ b/app/src/main/res/drawable/custom_border.xml @@ -6,6 +6,6 @@ android:right="10dp" android:top="10dp" android:bottom="10dp"/> - + \ No newline at end of file diff --git a/app/src/main/res/drawable/search_list.xml b/app/src/main/res/drawable/search_list.xml new file mode 100644 index 0000000..c75b725 --- /dev/null +++ b/app/src/main/res/drawable/search_list.xml @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout-xlarge/fragment_livelist_list.xml b/app/src/main/res/layout-xlarge/fragment_livelist_list.xml index 115d451..7ffcd85 100644 --- a/app/src/main/res/layout-xlarge/fragment_livelist_list.xml +++ b/app/src/main/res/layout-xlarge/fragment_livelist_list.xml @@ -9,7 +9,16 @@ android:smoothScrollbar="true" android:clickable="false" android:longClickable="false" - android:background="@drawable/customborder"> + android:background="@drawable/custom_border"> + + tools:context=".OpenLP"> diff --git a/app/src/main/res/layout/fragment_item_grid.xml b/app/src/main/res/layout/fragment_item_grid.xml deleted file mode 100644 index 9452736..0000000 --- a/app/src/main/res/layout/fragment_item_grid.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/app/src/main/res/layout/fragment_livelist_grid.xml b/app/src/main/res/layout/fragment_livelist_grid.xml deleted file mode 100644 index 313ec0e..0000000 --- a/app/src/main/res/layout/fragment_livelist_grid.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - diff --git a/app/src/main/res/layout/fragment_livelist_list.xml b/app/src/main/res/layout/fragment_livelist_list.xml index b7f119d..9f13d27 100644 --- a/app/src/main/res/layout/fragment_livelist_list.xml +++ b/app/src/main/res/layout/fragment_livelist_list.xml @@ -9,10 +9,19 @@ android:smoothScrollbar="true" android:clickable="false" android:longClickable="false" - android:background="@drawable/customborder"> - + android:background="@drawable/custom_border"> + - diff --git a/app/src/main/res/layout/fragment_search.xml b/app/src/main/res/layout/fragment_search.xml new file mode 100644 index 0000000..fe7c04e --- /dev/null +++ b/app/src/main/res/layout/fragment_search.xml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_service_list.xml b/app/src/main/res/layout/fragment_service_list.xml index ad4e6fb..56d6025 100644 --- a/app/src/main/res/layout/fragment_service_list.xml +++ b/app/src/main/res/layout/fragment_service_list.xml @@ -9,11 +9,23 @@ android:smoothScrollbar="true" android:clickable="false" android:longClickable="false" - android:background="@drawable/customborder"> + android:background="@drawable/custom_border"> + + + - - - - - - - diff --git a/app/src/main/res/layout/search_action_dialog.xml b/app/src/main/res/layout/search_action_dialog.xml new file mode 100644 index 0000000..b210efb --- /dev/null +++ b/app/src/main/res/layout/search_action_dialog.xml @@ -0,0 +1,40 @@ + + + + + + + \ 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 new file mode 100644 index 0000000..e378e2a --- /dev/null +++ b/app/src/main/res/layout/search_result_row.xml @@ -0,0 +1,18 @@ + + + + + \ 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 new file mode 100644 index 0000000..42fcee9 --- /dev/null +++ b/app/src/main/res/layout/spinner_dropdown_item.xml @@ -0,0 +1,11 @@ + + \ 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 new file mode 100644 index 0000000..d76b839 --- /dev/null +++ b/app/src/main/res/layout/spinner_list_item.xml @@ -0,0 +1,11 @@ + + \ No newline at end of file diff --git a/app/src/main/res/menu/open_l.xml b/app/src/main/res/menu/open_l.xml index b9513c2..5314e4a 100644 --- a/app/src/main/res/menu/open_l.xml +++ b/app/src/main/res/menu/open_l.xml @@ -16,10 +16,6 @@ android:icon="@drawable/ic_refresh_white" android:title="@string/action_refresh" app:showAsAction="ifRoom" /> - + OpenLP is \'n gratis kerk skyfievertoning sagteware + Besoek die OpenLP webwerf vir meer inligting Kopiereg Gedeeltelike kopiereg Lisensie + Hierdie program is gratis; jy kan dit herversprei of verander volgens die GNU Algemene Publieke Lisensie se voorwaardes, wat gepubliseer is deur die Free Software Foundation; weergawe 2 van die lisensie. + Hierdie program word versprei met die hoop dat dit nuttig sal wees, maar SONDER ENIGE WAARBORG; selfs sonder \'n geimpliseerde waarborg dat dit TOEPASLIK IS VIR \'N SPESIFIEKE DOEL Instellings Aangaande Waarskuwing @@ -12,14 +16,39 @@ Soek OpenLP Kanselleer + Konfigureer Netwerk + Wagwoord + Bediener Inligting Konneksie Tyd-uitloop Kies \'n waarde (millisekondes) - Kies die gevraagde blanko tipe + Gebruikernaame + Stel pasgemaakte tyd afsnypunt + Kies die verlangde skerm + Vertoon Werkvlak agtergrond + Laat die gekose item toe om na die middel van die lys te beweeg + Vertoon lewendige skerm + Vertoon Verstelling + Vertoon slegs Swart skerm + Vertoon slegs Tema Bekragtig Aangepasde Tyd-uitlope + Voer Afkondiging teks in + Laat skerms toe op outomatiese te sentreer Tuis + Ongemagtigde Toegang, voer asb \'n geldige gebruikernaam en wagwoord in. + Lewendige Vertoonlys + Lewendige Kykskerm + Maak navigeer vouer oop + Sluit navigeer vouer + Volgende Geen Poort + Vorige + Voer uit + Orde van diens + Verhoog skerm + Kies die grootte van die vertoning-teks Verander die Diens teks grootte Instellings Gasheer naam of IP + Kan nie die versoek uitvoer nie - gaan jou netwerk verstellings na diff --git a/app/src/main/res/values-bg/strings.xml b/app/src/main/res/values-bg/strings.xml index 8a4b415..b7eb7e6 100644 --- a/app/src/main/res/values-bg/strings.xml +++ b/app/src/main/res/values-bg/strings.xml @@ -13,11 +13,12 @@ Откажи Времето за изчакване на свързването Избери стойност (в милисекунди) - Избери изисквания тип на празнота Активирай клиентски срокове Начало + След. Нищо Порт + назад Промени размера на текста за Службата Настройки Hostname или IP diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index b1cc0be..5a23b84 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -20,8 +20,6 @@ Nastavení sítě Heslo Podrobnosti serveru - Použít HTTPS - Upřesnit jestli použít HTTPS Časový limit spojení Vybrat hodnotu (milisekundy) Uživatelské jméno diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index b6ba55a..ab1e067 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -20,22 +20,24 @@ Konfigurér netværk Adgangskode Serverdetaljer - Benyt HTTPS - Angiv om HTTPS skal benyttes Timeout for forbindelse Vælg en værdi (millisekunder) Brugernavn Sæt brugerdefineret timeout Vælg den ønskede skærm Vis skrivebordsbaggrund + Tillad centrering af det valgte element Vis fremvisningsskærm + Visningsindstillinger Vis kun sort Vis kun temabaggrund Aktiver brugerdefinerede timeouts Indtast meddelelsestekst + Tiilad autocentrering Hjem Adgang ikke godkendt. Indtast gyldigt brugernavn og adgangskode Fremvisningsliste + Præsentationsvisning Åbn navigationsskuffe Luk navigationsskuffe Næste diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 2f8f99f..81177c1 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -1,8 +1,8 @@ - OpenLP ist eine freie Präsentationssoftware für Kirchen und Gemeinden. Erfahre mehr über OpenLP. + OpenLP ist eine freie Präsentationssoftware für Kirchen und Gemeinden. Weitere Informationen sind auf der OpenLP Webseite zu finden. - Copyright + Urheberrecht Anteiliges Urheberrecht Lizenz Dieses Programm ist freie Software. Sie können es unter den Bedingungen der GNU General Public License Version 2, herausgegeben von der Free Software Foundation, weitergeben und/oder modifizieren. @@ -12,7 +12,7 @@ Hinweis Zurück Anzeige umschalten - Voreinstellungen + Einstellungen Aktualisieren Suche OpenLP @@ -20,20 +20,20 @@ Netzwerk einrichten Passwort Server-Einstellungen - HTTPS benutzen - Festlegen, ob HTTPS verwendet werden soll Verbindungzeit überschritten Wähle einen Wert (in Millisekunden) Benutzername - Setze eigenes Zeitlimit + Setze benutzerdefiniertes Zeitlimit Wähle die erforderlichen Ansicht Bildschirmhintergrund anzeigen + Ausgewähltes Item mittig in Liste Live-Ansicht anzeigen Anzeigeeinstellung Abdunkeln Nur Design anzeigen Aktiviere eigene Time-outs Hinweis eingeben + Anzeigen automatisch zentrieren Start Zugriff nicht erlaubt, bitte einen gültigen Benutzernamen und das korrekte Passwort eingeben Live Liste diff --git a/app/src/main/res/values-en-rGB/strings.xml b/app/src/main/res/values-en-rGB/strings.xml index 8dfdec9..4781d34 100644 --- a/app/src/main/res/values-en-rGB/strings.xml +++ b/app/src/main/res/values-en-rGB/strings.xml @@ -20,8 +20,6 @@ Configure Network Password Server Details - Use HTTPS - Specify whether HTTPS should be used Connection Timeout Select a value (milliseconds) Username diff --git a/app/src/main/res/values-en-rZA/strings.xml b/app/src/main/res/values-en-rZA/strings.xml index 89e296f..aec71ad 100644 --- a/app/src/main/res/values-en-rZA/strings.xml +++ b/app/src/main/res/values-en-rZA/strings.xml @@ -20,8 +20,6 @@ Configure Network Password Server Details - Use HTTPS - Specify whether HTTPS should be used Connection Timeout Select a value (milliseconds) Username diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index a60ee24..375bb89 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -20,23 +20,24 @@ Configurar Red Clave Detalles de Servidor - Usar HTTPS - Especificar si se debe usar HTTPS Tiempo de espera de conexión Seleccione un valor (en milisegundos) Usuario Tiempo de espera personalizado Seleccionar la pantalla requerida Mostrar Fondo del Escritorio + Permitir que el elemento actual se desplace hacia el centro de la lista Mostrar pantalla En Vivo Preferencias de pantalla Mostrar Negro solamente Mostrar Tema solamente Permitir tiempos de espera personalizados Ingrese Texto de Alerta + Permitir auto centrado de pantalla Inicio Acceso No Autorizado, ingrese usuario y clave válidos Lista En Vivo + Vista En Vivo Abrir cajón de navegación Cerrar cajón de navegación Siguiente diff --git a/app/src/main/res/values-et/strings.xml b/app/src/main/res/values-et/strings.xml index c4a9db1..f884ac0 100644 --- a/app/src/main/res/values-et/strings.xml +++ b/app/src/main/res/values-et/strings.xml @@ -18,8 +18,6 @@ Seadista võrk Parool Serveri andmed - HTTPSi kasutamine - Määra, kas kasutada tuleks HTTPSi kaudu ühendust Ühenduse aegumine Vali kestus (millisekundid) Kasutajanimi @@ -36,6 +34,7 @@ Kodu Lubamatu ligipääs, palun sisesta õiged kasutajanimi ja parool. Ekraanil + Ekraan Ava navisahtel Sulge navisahtel Järgmine diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index a81f5c3..8f049ce 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -20,8 +20,6 @@ Verkon asetukset Salasana Palvelimen asetukset - Käytä HTTPS - Määrittele tahdotaanko HTTPS ottaa käyttöön Yhteyden aikakatkaisu Valitse arvo (millisekuntia) Käyttäjätunnus diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 91de48f..9fcc28b 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -1,25 +1,55 @@ + OpenLP est un logiciel de projection libre + Pour en savoir plus visitez le site web d\'OpenLP Copyright Copyright partiel Licence + Ce programme est un logiciel libre; vous pouvez le redistribuer et/ou le modifier au titre des clauses de la Licence Publique Générale GNU, telle que publiée par la Free Software Foundation; version 2 de la Licence. + Ce programme est distribué dans l\'espoir qu\'il sera utile, mais SANS AUCUNE GARANTIE ; sans même une garantie implicite de COMMERCIABILITÉ ou DE CONFORMITÉ À UNE UTILISATION PARTICULIÈRE. Paramètres A propos de Alerte Arrière + Afficher/Masquer Préférences Rafraîchir Recherche OpenLP Annuler + Configuration du réseau + Mot de passe + Détails du serveur Délai de connexion Sélectionnez une valeur (millisecondes) - Sélectionnez le type vide requis + Nom d\'utilisateur + Définir un délai personnalisé + Sélectionner l\'affichage souhaité + Afficher le fond du bureau + Permettre à l\'élément sélectionné de défiler au centre de la liste + Afficher le direct + Paramètres d\'affichage + Afficher un écran noir + Afficher uniquement le thème Activer le délai personnalisé + Entrer le message d\'alerte + Permettre les affichages au centre Accueil + Accès refusé, veuillez entrer un nom d\'utilisateur et un mot de passe valide + Liste du direct + Vue du direct + Ouvrir le tiroir de navigation + Fermer le tiroir de navigation + Suivant Rien Port + Précédent + Processus + Liste du service + Prompteur + Sélectionner la taille du texte Modifier la taille du texte du service Paramètres Nom d\'hôte ou IP + Impossible d\'effectuer la demande - vérifiez les paramètres réseau diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 7ee1903..eeeb58c 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -20,13 +20,11 @@ Hálózat beállítása Jelszó Szerver részletek - HTTPS alkalmazása - HTTPS alkalmazásának meghatározása Kapcsolódási időtúllépés - Válassz egy értéket (milliszekundum) + Érték választása (milliszekundum) Felhasználói név Egyéni időtúllépés beállítása - Válaszd ki a kívánt megjelenést + Kívánt megjelenés kiválasztása Asztal hátterének megjelenítése Görgetés a lista közepére a kijelölt elemhez Élő adás megjelenítése @@ -37,7 +35,7 @@ Riasztási üzenet megadása Megjelenés automatikus középre igazítása Kezdőlap - Engedély nélküli hozzáférés, adjon meg érvényes felhasználói nevet és jelszót + Engedély nélküli hozzáférés, érvényes a felhasználói név és a jelszó? Élő lista Élő nézet Menü megnyitása @@ -53,5 +51,5 @@ Sorrend betűméretének módosítása Beállítások Gépnév vagy IP-cím - A kérés feldolgozhatatlan - ellenőrizzük a hálózati beállításokat + A kérés feldolgozhatatlan ‒ a hálózati beállítások ellenőrzése javasolt diff --git a/app/src/main/res/values-id/strings.xml b/app/src/main/res/values-id/strings.xml index 0148473..bc17607 100644 --- a/app/src/main/res/values-id/strings.xml +++ b/app/src/main/res/values-id/strings.xml @@ -20,22 +20,24 @@ Mengkonfigurasi Jaringan Kata sandi Rincian Server - Gunakan HTTPS - Tentukan apakah HTTPS seharusnya digunakan Batas-Waktu Sambungan Pilih sebuah nilai (milidetik) Nama Pengguna Setel Batas-waktu Kustom Pilih tampilan yang dibutuhkan Tampilkan latar Desktop + Izinkan butir terpilih untuk digulir ke tengah daftar Tampilkan tampilan Tayang + Setelan Tampilan Tampilkan Layar Hitam saja Tampilkan Tema saja Aktifkan Batas-Waktu Kustom Masukkan Teks Peringatan + Izinkan semua tampilan diposisikan ke tengah secara otomatis Beranda Akses Tidak sah, silakan masukkan nama pengguna dan kata sandi yang valid Daftar Tayang + Tinjauan Tayang Buka penarik navigasi Tutup penarik navigasi Selanjutnya diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 7f809d7..6322f06 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -1,6 +1,55 @@ - Licensa - Allerta + OpenLP è un software libero di presentazione per le Chiese + Per saperne di più visita il sito Web OpenLP + Copyright + Porzioni di copyright + Licenza + Questo è un software libero; può essere redistribuito e/o modificato nei termini della GNU General Public License come pubblicato dalla Free Software Foundation; vesione 2 della licenza + Questo programma è distribuito nella speranza che sia utile, ma SENZA ALCUNA GARANZIA, senza neppure l\'implicita garanzia della COMMERCIABILITA\' o IDONEITA\' PER UN PARTICOLARE SCOPO + Impostazioni + Informazioni + Avviso + Indietro + Attiva/disattiva visualizzazione + Preferenze + Aggiorna Ricerca + OpenLP + Annulla + Configura Rete + Password + Dettagli Server + Timeout Connessione + Seleziona un valore (millisecondi) + Nome Utente + Imposta Timeout personalizzato + Selezionare il monitor desiderato + Visualizza sfondo Desktop + Consentire l\'elemento selezionato di scorrere al centro dell\'elenco + Visualizzazione Live Show + Impostazione Visualizzazione + Solo Schermo Nero + Visualizza solo il Tema + Abilitare i timeout personalizzati + Inserisci il testo Avviso + Consenti la visualizzazione al centro automaticamente + Inizio + Accesso non consentito, prego inserire un nome utente e password valida + Elenco LIVE + Visualizza LIVE + Apri sezione navigazione + Chiudi sezione navigazione + Successivo + Nessuno + Porta + Precedente + Elabora + Elenco Servizio + Visualizza Palco + Selezionare la dimensione testo di visualizzazione + Modificare le dimensioni del testo di servizio + Impostazioni + Hostname o IP + Impossibile elaborare la richiesta - controllare le impostazioni di rete diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index ecf5824..0492d4e 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -1,8 +1,12 @@ + OpenLPは無償の教会プレゼンテーション用ソフトです。 + 詳しくはOpenLPウェブサイトをご覧ください。 著作権 追加の著作権 ライセンス + このプログラムはフリーソフトウェアです。あなたはこれを、フリーソフトウェア財団によって発行された GNU 一般公衆利用許諾契約書バージョン2の定める条件の下で再頒布または改変することができます。 + このプログラムは有用であることを願って頒布されますが、*全くの無保証* です。商業可能性の保証や特定の目的への適合性は、言外に示されたものも含め全く存在しません。 設定 情報 警告 @@ -12,13 +16,23 @@ 検索 OpenLP キャンセル + ネットワーク設定 + パスワード + サーバの詳細 接続タイムアウト 値を選択 (ミリ秒) - ブランクの種類を選択してください + ユーザ名 + 任意のタイムアウト時間を設定する 任意のタイムアウトを有効にする + 警告文を入力 ホーム + 認証が必要です。ユーザ名とパスワードを入力してください。 + ライブ一覧 + 無し ポート + + 文字の大きさを選択 礼拝テキストの大きさを変更します 設定 ホスト名またはIPアドレス diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index 3098870..75b4d4f 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -2,9 +2,14 @@ 라이선스 설정 + 정보 알림 + 뒤로 + 새로 고침 검색 취소 + 처음 + 다음 포트 설정 diff --git a/app/src/main/res/values-large/refs.xml b/app/src/main/res/values-large/refs.xml index d6935a5..04ab57e 100644 --- a/app/src/main/res/values-large/refs.xml +++ b/app/src/main/res/values-large/refs.xml @@ -7,6 +7,5 @@ For more on layout aliases, see: http://developer.android.com/training/multiscreen/screensizes.html#TaskUseAliasFilters --> - @layout/fragment_item_grid \ No newline at end of file diff --git a/app/src/main/res/values-lt/strings.xml b/app/src/main/res/values-lt/strings.xml index 9280283..6ec47d6 100644 --- a/app/src/main/res/values-lt/strings.xml +++ b/app/src/main/res/values-lt/strings.xml @@ -20,8 +20,6 @@ Konfigūruoti Tinklą Slaptažodis Išsamiau apie Serverį - Naudoti HTTPS - Nurodykite ar turėtų būti naudojamas HTTPS Sujungimo Laiko Limitas Pasirinkite reikšmę (milisekundėmis) Vartotojo vardas diff --git a/app/src/main/res/values-lv/strings.xml b/app/src/main/res/values-lv/strings.xml index fbfb312..5c2f28e 100644 --- a/app/src/main/res/values-lv/strings.xml +++ b/app/src/main/res/values-lv/strings.xml @@ -1,8 +1,55 @@ + OpenLP ir bezmaksas prezentāciju programma baznīcām + Lai uzzinātu vairāk, apmeklējiet mājaslapu + Autortiesības + Daļu autortiesības + Licence + Šī ir bezmaksas programma. Jūs varat to izplatīt vai mainīt pēc GNU publiskās licences noteikumiem, kas publicēti Free Software Foundation, 2. versijas licencē. + Šī programma ir izplatīta ar cerību, ka tā būs noderīga, bet be jebkādām garantijām par tās noderīgumu mērķim vai ienesīgumu. Iestatījumi + Par + Ziņojums + Atgriezties + Pārslēgt displeju + Iestatījumi + Atsvaidzināt + Meklēt OpenLP - Savienojuma laika beigas + Atcelt + Tīkla konfigurācija + Parole + Servera iestatījumi + Savienojuma noildze Izvēlieties vērtību (milisekundes) + Lietotājvārds + Izvēlieties vēlamo noildzi + Izvēlieties nepieciešamo displeju + Parādīt fona attēlu + Atļaut šim elementa pārvietoties uz saraksta centru + Parādīt displeju + Ekrāna iestatījumi + Attēlot melnu ekrānu + Attēlot tēmas attēlu + Iespējot pielāgotās noildzes + Ievadiet ziņojuma tekstu + Atļaut ekrānam iecentrēties automatiski. + Sākums + Pieeja liegta! Lūdzu ievadiet pareizu lietotājvārdu un paroli. + Saraksts demonstrēšanai + Attēls ekrānā + Atvērt navigācijas slaidni + Aizvērt navigācijas slaidni + Nākamais + Nekas + Ports + Iepriekšējais + Process + Saraksts + Skatuves ekrāns + Izvēlieties teksta lielumu + Izvēlieties dievkalpojuma teksta lielumu Iestatījumi + Vārds vai IP adrese + Nav iespējams apstrādāt pieprasījumu - pārbaudiet tīkla iestatījumus. diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml index 2bcadcd..bc8c43c 100644 --- a/app/src/main/res/values-nb/strings.xml +++ b/app/src/main/res/values-nb/strings.xml @@ -20,8 +20,6 @@ Konfigurer nettverk Passord Serverditaljer - Bruk HTTPS - Angi om HTTPS skal brukes Tidsavbrudd for tilkobling Velg en verdi (millisekund) Brukernavn diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 5150eb6..af5c18d 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -20,22 +20,24 @@ Netwerk instellen Wachtwoord Serverdetails - Gebruik HTTPS - Geef aan of HTTPS gebruikt moet worden Verbindingstimeout Selecteer een waarde (milliseconden) Gebruikersnaam Aangepaste timeout instellen Selecteer het verplichte scherm Toon Desktop achtergrond + Toegang geven aan geselecteerde items om naar het midden van de lijst te scrollen Toon live scherm + Beeldscherminstellingen Toon alleen zwart Toon alleen thema Aangepaste timeouts toestaan Voer waarschuwingstekst in + Schermen toegang geven tot auto center Startpagina Geen toegang, voer juiste gebruikersnaam en wachtwoord in Live lijst + Live kijken Open navigatiemenu Sluit navigatiemenu Volgende diff --git a/app/src/main/res/values-nn/strings.xml b/app/src/main/res/values-nn/strings.xml index ea67036..cadb6f2 100644 --- a/app/src/main/res/values-nn/strings.xml +++ b/app/src/main/res/values-nn/strings.xml @@ -5,6 +5,8 @@ OpenLP Tidsavbrot for tilkopling Oppgje ein verdi i millisekund + Neste Port + Førre Innstillingar. diff --git a/app/src/main/res/values-pap/strings.xml b/app/src/main/res/values-pap/strings.xml index dc270ef..48880b4 100644 --- a/app/src/main/res/values-pap/strings.xml +++ b/app/src/main/res/values-pap/strings.xml @@ -8,10 +8,11 @@ Preferensia Buska OpenLP - Selekta e tipo blanko nesesario Permití Timeout adaptá + Sigiente Niun Port + Bai bèk Konfigurashon Hostname òf IP diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 3b54fc1..c240f96 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -11,6 +11,7 @@ O programie Komunikat Wróć + Przełącz Ekran Preferencje Odśwież Szukaj @@ -19,23 +20,26 @@ Konfiguruj sieć Hasło Szczegóły serwera - Używaj HTTPS - Sprecyzuj czy HTTPS powinno być używane Limit czasowy połączenia Wybierz wartość (milisekundy) Nazwa użytkownika Ustaw inny limit czasowy Wybierz wyświetlacz Wyświetl tło ekranu + Pozwól wybranemu elementowi przewinąć do środka listy Pokaż Ekran + Ustawienia wyświetlania Wyświetl czarny ekran Wyświetl tylko motyw Niestandardowy limit czasu Wpisz tekst komunikatu + Pozwól na autowyśrodkowanie Home Nieuprawniony dostęp, proszę wprowadź nazwę użytkownika oraz hasło. Plan nabożeństwa Ekran + Otwórz zakładkę nawigacji + Zamknij zakładkę nawigacji Następny Nic Port diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index cb03168..ce397dc 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -11,7 +11,7 @@ Sobre Alertar Voltar - Altenar Monitor + Alternar Monitor Preferências Atualizar Busca @@ -20,30 +20,33 @@ Configurar Rede Senha Detalhes do Servidor - Usar HTTPS - Especifique se o HTTPS deve ser usado Tempo limite de conexão Selecione um valor (em milissegundos) Usuário Ativar Timeout Personalizado Selecione o monitor requerido Exibir Plano de Fundo da Área de Trabalho + Permitir ao item selecionado se deslocar ao centro da lista Mostrar Visualização Ao Vivo Configurações de Exibição Exibir Tela Preta Exibir Tema Habilitar Timeouts personalizados Digitar Texto de Alerta + Auto-centralizar slides na tela Home Acesso não autorizado, por favor, digite usuário e senha válidos Lista Ao Vivo + Ao vivo + Abrir painel de navegação + Fechar painel de navegação Próximo Nenhum Porta Anterior Processo Lista de Serviço - Visualização de Palvo + Visualização de Palco Selecionar tamanho do monitor de exibição Alterar o tamanho do texto de culto Configurações diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml index e073cf8..fdb4389 100644 --- a/app/src/main/res/values-ro/strings.xml +++ b/app/src/main/res/values-ro/strings.xml @@ -20,8 +20,6 @@ Configurează Rețeaua Parola Detalii Server - Folosește HTTPS - Specificați dacă ar trebui folosit HTTPS Conexiunea a expirat Selectați o valoare (milisecunde) Nume utilizator diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 60ed117..44c5123 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -20,25 +20,20 @@ Настроить сеть Пароль Параметры сервера - Использовать HTTPS - Укажите, следует ли использовать HTTPS Время ожидания соединения Выберите значение (в миллисекундах) Установить пользовательский тайм-аут - Выберите нужный тип блокировки - Показать рабочий стол - Сбросить дисплей - Очистить дисплей (черный) - Очистить контент дисплея Включить пользовательские тайм-ауты Введите текст оповещения Домой + Вид прямого эфира + Следующий Ничего Порт + Предыдущий Выполнение Список служения Вид сцены - Выберите размер текста Изменить размер текста Служения Параметры diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 585dbb9..ebf8106 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -20,8 +20,6 @@ Nastavenie sieťe Heslo Podrobnosti servera - Použiť HTTPS - Upresniť či by malo byť použité HTTPS Časový limit spojenia Vybrať hodnotu (milisekundy) Používateľské meno diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index eff1afd..fb4afca 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -20,8 +20,6 @@ Konfigurera nätverk Lösenord Serverinställningar - Använd HTTPS - Ange om HTTPS ska användas Anslutningstimeout Välj ett värde (millisekunder) Användarnamn diff --git a/app/src/main/res/values-sw600dp/refs.xml b/app/src/main/res/values-sw600dp/refs.xml index d6935a5..2ec568f 100644 --- a/app/src/main/res/values-sw600dp/refs.xml +++ b/app/src/main/res/values-sw600dp/refs.xml @@ -7,6 +7,4 @@ For more on layout aliases, see: http://developer.android.com/training/multiscreen/screensizes.html#TaskUseAliasFilters --> - @layout/fragment_item_grid - \ No newline at end of file diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index ab8ea31..d67b03a 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -20,26 +20,30 @@ Налаштування Мережі Пароль Деталі Сервера - Використовувати HTTPS - Вкажіть, чи варто використовувати протокол HTTPS Час очікування з\'єднання Виберіть значення (в мілісекундах) Ім\'я користувача: Втановити інший Час Очікування Виберіть потрібний дисплей Обрати фон для робочого столу дисплея + Дозволити вибраний елемент, щоб перейти до центру списку Показати основний дисплей + Налаштування Дисплею Тільки Чорний дисплей Тільки Тема дисплею Обрати інший Час Очікування Введіть Текст Сповіщення + Дозволити дисплей в центрі Дім Несанкціонований доступ будь ласка, введіть правильне ім\'я користувача та пароль Список Перегляду + Режим Живого Перегляду Відкрити вікно навігації Закрити вікно навігації + Наступний Ні Порт + Попередній Процес Список Служб Поставити Прегляд diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index dd2e7ce..fe6df6a 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -20,8 +20,6 @@ 設定網路 密碼 聚會細節 - 使用 HTTPS - 指定是否應使用HTTPS 連接逾時 選擇數值(毫秒) 帳號 diff --git a/app/src/main/res/values/keyStrings.xml b/app/src/main/res/values/keyStrings.xml index 578fe53..9afc890 100644 --- a/app/src/main/res/values/keyStrings.xml +++ b/app/src/main/res/values/keyStrings.xml @@ -8,6 +8,4 @@ key_userid key_password key_shared_preferences - key_ssl_use - diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0d6bc72..b17bd88 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -20,8 +20,6 @@ Configure Network Password Server Details - Use HTTPS - Specify whether HTTPS should be used Connection Timeout Select a value (milliseconds) Username @@ -47,6 +45,8 @@ Port Previous Process + Search Text + Select Plugin Service List Search Results Send Live diff --git a/app/src/main/res/xml/pref_general.xml b/app/src/main/res/xml/pref_general.xml index 5ffe891..5c84e5e 100644 --- a/app/src/main/res/xml/pref_general.xml +++ b/app/src/main/res/xml/pref_general.xml @@ -10,7 +10,7 @@ diff --git a/app/src/main/res/xml/pref_notification.xml b/app/src/main/res/xml/pref_notification.xml index aac55fa..33606e5 100644 --- a/app/src/main/res/xml/pref_notification.xml +++ b/app/src/main/res/xml/pref_notification.xml @@ -33,12 +33,6 @@ android:defaultValue="@string/port_default_value" android:inputType="number" /> - - + + + + + + + + + + + + + + + + \ No newline at end of file