mirror of
https://gitlab.com/openlp/android.git
synced 2024-12-22 03:42:48 +00:00
more fixups
This commit is contained in:
parent
3a9139596f
commit
b3c0947e09
219
app/app.iml
219
app/app.iml
@ -85,6 +85,8 @@
|
|||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/25.0.0/jars" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/25.0.0/jars" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/25.0.0/jars" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/25.0.0/jars" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/design/25.0.0/jars" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/design/25.0.0/jars" />
|
||||||
@ -98,16 +100,22 @@
|
|||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/25.0.0/jars" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/25.0.0/jars" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/transition/25.0.0/jars" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/transition/25.0.0/jars" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-classes" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-runtime-classes" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-verifier" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-resources" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-support" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/reload-dex" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/restart-dex" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/restart-dex" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/resources" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/tmp" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
|
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
|
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
|
||||||
</content>
|
</content>
|
||||||
@ -128,209 +136,4 @@
|
|||||||
<orderEntry type="library" exported="" name="support-core-utils-25.0.0" level="project" />
|
<orderEntry type="library" exported="" name="support-core-utils-25.0.0" level="project" />
|
||||||
<orderEntry type="library" exported="" name="recyclerview-v7-25.0.0" level="project" />
|
<orderEntry type="library" exported="" name="recyclerview-v7-25.0.0" level="project" />
|
||||||
</component>
|
</component>
|
||||||
<component name="org.twodividedbyzero.idea.findbugs">
|
</module>
|
||||||
<option name="_basePreferences">
|
|
||||||
<map>
|
|
||||||
<entry key="property.analysisEffortLevel" value="default" />
|
|
||||||
<entry key="property.analyzeAfterAutoMake" value="false" />
|
|
||||||
<entry key="property.analyzeAfterCompile" value="false" />
|
|
||||||
<entry key="property.annotationGutterIconEnabled" value="true" />
|
|
||||||
<entry key="property.annotationSuppressWarningsClass" value="edu.umd.cs.findbugs.annotations.SuppressFBWarnings" />
|
|
||||||
<entry key="property.annotationTextRangeMarkupEnabled" value="true" />
|
|
||||||
<entry key="property.exportAsHtml" value="true" />
|
|
||||||
<entry key="property.exportAsXml" value="true" />
|
|
||||||
<entry key="property.exportBaseDir" value="" />
|
|
||||||
<entry key="property.exportCreateArchiveDir" value="false" />
|
|
||||||
<entry key="property.exportOpenBrowser" value="true" />
|
|
||||||
<entry key="property.minPriorityToReport" value="Medium" />
|
|
||||||
<entry key="property.runAnalysisInBackground" value="false" />
|
|
||||||
<entry key="property.showHiddenDetectors" value="false" />
|
|
||||||
<entry key="property.toolWindowToFront" value="true" />
|
|
||||||
</map>
|
|
||||||
</option>
|
|
||||||
<option name="_detectors">
|
|
||||||
<map>
|
|
||||||
<entry key="AppendingToAnObjectOutputStream" value="true" />
|
|
||||||
<entry key="AtomicityProblem" value="true" />
|
|
||||||
<entry key="BadAppletConstructor" value="false" />
|
|
||||||
<entry key="BadResultSetAccess" value="true" />
|
|
||||||
<entry key="BadSyntaxForRegularExpression" value="true" />
|
|
||||||
<entry key="BadUseOfReturnValue" value="true" />
|
|
||||||
<entry key="BadlyOverriddenAdapter" value="true" />
|
|
||||||
<entry key="BooleanReturnNull" value="true" />
|
|
||||||
<entry key="BuildInterproceduralCallGraph" value="false" />
|
|
||||||
<entry key="BuildObligationPolicyDatabase" value="true" />
|
|
||||||
<entry key="BuildStringPassthruGraph" value="true" />
|
|
||||||
<entry key="CallToUnsupportedMethod" value="false" />
|
|
||||||
<entry key="CalledMethods" value="true" />
|
|
||||||
<entry key="CheckCalls" value="false" />
|
|
||||||
<entry key="CheckExpectedWarnings" value="false" />
|
|
||||||
<entry key="CheckImmutableAnnotation" value="true" />
|
|
||||||
<entry key="CheckRelaxingNullnessAnnotation" value="true" />
|
|
||||||
<entry key="CheckTypeQualifiers" value="true" />
|
|
||||||
<entry key="CloneIdiom" value="true" />
|
|
||||||
<entry key="ComparatorIdiom" value="true" />
|
|
||||||
<entry key="ConfusedInheritance" value="true" />
|
|
||||||
<entry key="ConfusionBetweenInheritedAndOuterMethod" value="true" />
|
|
||||||
<entry key="CovariantArrayAssignment" value="false" />
|
|
||||||
<entry key="CrossSiteScripting" value="true" />
|
|
||||||
<entry key="DefaultEncodingDetector" value="true" />
|
|
||||||
<entry key="DoInsideDoPrivileged" value="true" />
|
|
||||||
<entry key="DontCatchIllegalMonitorStateException" value="true" />
|
|
||||||
<entry key="DontIgnoreResultOfPutIfAbsent" value="true" />
|
|
||||||
<entry key="DontUseEnum" value="true" />
|
|
||||||
<entry key="DroppedException" value="true" />
|
|
||||||
<entry key="DumbMethodInvocations" value="true" />
|
|
||||||
<entry key="DumbMethods" value="true" />
|
|
||||||
<entry key="DuplicateBranches" value="true" />
|
|
||||||
<entry key="EmptyZipFileEntry" value="false" />
|
|
||||||
<entry key="EqualsOperandShouldHaveClassCompatibleWithThis" value="true" />
|
|
||||||
<entry key="ExplicitSerialization" value="true" />
|
|
||||||
<entry key="FieldItemSummary" value="true" />
|
|
||||||
<entry key="FinalizerNullsFields" value="true" />
|
|
||||||
<entry key="FindBadCast2" value="true" />
|
|
||||||
<entry key="FindBadForLoop" value="true" />
|
|
||||||
<entry key="FindBugsSummaryStats" value="true" />
|
|
||||||
<entry key="FindCircularDependencies" value="false" />
|
|
||||||
<entry key="FindComparatorProblems" value="true" />
|
|
||||||
<entry key="FindDeadLocalStores" value="true" />
|
|
||||||
<entry key="FindDoubleCheck" value="true" />
|
|
||||||
<entry key="FindEmptySynchronizedBlock" value="true" />
|
|
||||||
<entry key="FindFieldSelfAssignment" value="true" />
|
|
||||||
<entry key="FindFinalizeInvocations" value="true" />
|
|
||||||
<entry key="FindFloatEquality" value="true" />
|
|
||||||
<entry key="FindFloatMath" value="false" />
|
|
||||||
<entry key="FindHEmismatch" value="true" />
|
|
||||||
<entry key="FindInconsistentSync2" value="true" />
|
|
||||||
<entry key="FindJSR166LockMonitorenter" value="true" />
|
|
||||||
<entry key="FindLocalSelfAssignment2" value="true" />
|
|
||||||
<entry key="FindMaskedFields" value="true" />
|
|
||||||
<entry key="FindMismatchedWaitOrNotify" value="true" />
|
|
||||||
<entry key="FindNakedNotify" value="true" />
|
|
||||||
<entry key="FindNoSideEffectMethods" value="true" />
|
|
||||||
<entry key="FindNonSerializableStoreIntoSession" value="false" />
|
|
||||||
<entry key="FindNonSerializableValuePassedToWriteObject" value="false" />
|
|
||||||
<entry key="FindNonShortCircuit" value="true" />
|
|
||||||
<entry key="FindNullDeref" value="true" />
|
|
||||||
<entry key="FindNullDerefsInvolvingNonShortCircuitEvaluation" value="true" />
|
|
||||||
<entry key="FindOpenStream" value="true" />
|
|
||||||
<entry key="FindPuzzlers" value="true" />
|
|
||||||
<entry key="FindRefComparison" value="true" />
|
|
||||||
<entry key="FindReturnRef" value="true" />
|
|
||||||
<entry key="FindRoughConstants" value="true" />
|
|
||||||
<entry key="FindRunInvocations" value="true" />
|
|
||||||
<entry key="FindSelfComparison" value="true" />
|
|
||||||
<entry key="FindSelfComparison2" value="true" />
|
|
||||||
<entry key="FindSleepWithLockHeld" value="true" />
|
|
||||||
<entry key="FindSpinLoop" value="true" />
|
|
||||||
<entry key="FindSqlInjection" value="true" />
|
|
||||||
<entry key="FindTwoLockWait" value="true" />
|
|
||||||
<entry key="FindUncalledPrivateMethods" value="true" />
|
|
||||||
<entry key="FindUnconditionalWait" value="true" />
|
|
||||||
<entry key="FindUninitializedGet" value="true" />
|
|
||||||
<entry key="FindUnrelatedTypesInGenericContainer" value="true" />
|
|
||||||
<entry key="FindUnreleasedLock" value="true" />
|
|
||||||
<entry key="FindUnsatisfiedObligation" value="true" />
|
|
||||||
<entry key="FindUnsyncGet" value="true" />
|
|
||||||
<entry key="FindUseOfNonSerializableValue" value="true" />
|
|
||||||
<entry key="FindUselessControlFlow" value="true" />
|
|
||||||
<entry key="FindUselessObjects" value="true" />
|
|
||||||
<entry key="FormatStringChecker" value="true" />
|
|
||||||
<entry key="FunctionsThatMightBeMistakenForProcedures" value="true" />
|
|
||||||
<entry key="HugeSharedStringConstants" value="true" />
|
|
||||||
<entry key="IDivResultCastToDouble" value="true" />
|
|
||||||
<entry key="IncompatMask" value="true" />
|
|
||||||
<entry key="InconsistentAnnotations" value="true" />
|
|
||||||
<entry key="InefficientIndexOf" value="false" />
|
|
||||||
<entry key="InefficientInitializationInsideLoop" value="false" />
|
|
||||||
<entry key="InefficientMemberAccess" value="false" />
|
|
||||||
<entry key="InefficientToArray" value="false" />
|
|
||||||
<entry key="InfiniteLoop" value="true" />
|
|
||||||
<entry key="InfiniteRecursiveLoop" value="true" />
|
|
||||||
<entry key="InheritanceUnsafeGetResource" value="true" />
|
|
||||||
<entry key="InitializationChain" value="true" />
|
|
||||||
<entry key="InitializeNonnullFieldsInConstructor" value="true" />
|
|
||||||
<entry key="InstantiateStaticClass" value="true" />
|
|
||||||
<entry key="IntCast2LongAsInstant" value="true" />
|
|
||||||
<entry key="InvalidJUnitTest" value="true" />
|
|
||||||
<entry key="IteratorIdioms" value="true" />
|
|
||||||
<entry key="LazyInit" value="true" />
|
|
||||||
<entry key="LoadOfKnownNullValue" value="true" />
|
|
||||||
<entry key="LostLoggerDueToWeakReference" value="true" />
|
|
||||||
<entry key="MethodReturnCheck" value="true" />
|
|
||||||
<entry key="Methods" value="true" />
|
|
||||||
<entry key="MultithreadedInstanceAccess" value="true" />
|
|
||||||
<entry key="MutableEnum" value="true" />
|
|
||||||
<entry key="MutableLock" value="true" />
|
|
||||||
<entry key="MutableStaticFields" value="true" />
|
|
||||||
<entry key="Naming" value="true" />
|
|
||||||
<entry key="Noise" value="false" />
|
|
||||||
<entry key="NoiseNullDeref" value="false" />
|
|
||||||
<entry key="NoteAnnotationRetention" value="true" />
|
|
||||||
<entry key="NoteCheckReturnValueAnnotations" value="true" />
|
|
||||||
<entry key="NoteDirectlyRelevantTypeQualifiers" value="true" />
|
|
||||||
<entry key="NoteJCIPAnnotation" value="true" />
|
|
||||||
<entry key="NoteNonNullAnnotations" value="false" />
|
|
||||||
<entry key="NoteNonnullReturnValues" value="false" />
|
|
||||||
<entry key="NoteSuppressedWarnings" value="true" />
|
|
||||||
<entry key="NoteUnconditionalParamDerefs" value="true" />
|
|
||||||
<entry key="NumberConstructor" value="true" />
|
|
||||||
<entry key="OptionalReturnNull" value="true" />
|
|
||||||
<entry key="OverridingEqualsNotSymmetrical" value="true" />
|
|
||||||
<entry key="PreferZeroLengthArrays" value="true" />
|
|
||||||
<entry key="PublicSemaphores" value="false" />
|
|
||||||
<entry key="QuestionableBooleanAssignment" value="true" />
|
|
||||||
<entry key="ReadOfInstanceFieldInMethodInvokedByConstructorInSuperclass" value="true" />
|
|
||||||
<entry key="ReadReturnShouldBeChecked" value="true" />
|
|
||||||
<entry key="RedundantConditions" value="true" />
|
|
||||||
<entry key="RedundantInterfaces" value="true" />
|
|
||||||
<entry key="ReflectiveClasses" value="true" />
|
|
||||||
<entry key="RepeatedConditionals" value="true" />
|
|
||||||
<entry key="ResolveAllReferences" value="false" />
|
|
||||||
<entry key="RuntimeExceptionCapture" value="true" />
|
|
||||||
<entry key="SerializableIdiom" value="true" />
|
|
||||||
<entry key="StartInConstructor" value="true" />
|
|
||||||
<entry key="StaticCalendarDetector" value="true" />
|
|
||||||
<entry key="StringConcatenation" value="true" />
|
|
||||||
<entry key="SuperfluousInstanceOf" value="true" />
|
|
||||||
<entry key="SuspiciousThreadInterrupted" value="true" />
|
|
||||||
<entry key="SwitchFallthrough" value="true" />
|
|
||||||
<entry key="SynchronizationOnSharedBuiltinConstant" value="true" />
|
|
||||||
<entry key="SynchronizeAndNullCheckField" value="true" />
|
|
||||||
<entry key="SynchronizeOnClassLiteralNotGetClass" value="true" />
|
|
||||||
<entry key="SynchronizingOnContentsOfFieldToProtectField" value="true" />
|
|
||||||
<entry key="TestASM" value="false" />
|
|
||||||
<entry key="TestDataflowAnalysis" value="false" />
|
|
||||||
<entry key="TestingGround" value="false" />
|
|
||||||
<entry key="TestingGround2" value="false" />
|
|
||||||
<entry key="TrainFieldStoreTypes" value="true" />
|
|
||||||
<entry key="TrainLongInstantfParams" value="true" />
|
|
||||||
<entry key="TrainNonNullAnnotations" value="true" />
|
|
||||||
<entry key="TrainUnconditionalDerefParams" value="true" />
|
|
||||||
<entry key="URLProblems" value="true" />
|
|
||||||
<entry key="UncallableMethodOfAnonymousClass" value="true" />
|
|
||||||
<entry key="UnnecessaryMath" value="true" />
|
|
||||||
<entry key="UnreadFields" value="true" />
|
|
||||||
<entry key="UselessSubclassMethod" value="false" />
|
|
||||||
<entry key="VarArgsProblems" value="true" />
|
|
||||||
<entry key="VolatileUsage" value="true" />
|
|
||||||
<entry key="WaitInLoop" value="true" />
|
|
||||||
<entry key="WrongMapIterator" value="true" />
|
|
||||||
<entry key="XMLFactoryBypass" value="true" />
|
|
||||||
</map>
|
|
||||||
</option>
|
|
||||||
<option name="_reportCategories">
|
|
||||||
<map>
|
|
||||||
<entry key="BAD_PRACTICE" value="true" />
|
|
||||||
<entry key="CORRECTNESS" value="true" />
|
|
||||||
<entry key="EXPERIMENTAL" value="true" />
|
|
||||||
<entry key="I18N" value="true" />
|
|
||||||
<entry key="MALICIOUS_CODE" value="true" />
|
|
||||||
<entry key="MT_CORRECTNESS" value="true" />
|
|
||||||
<entry key="PERFORMANCE" value="true" />
|
|
||||||
<entry key="SECURITY" value="true" />
|
|
||||||
<entry key="STYLE" value="true" />
|
|
||||||
</map>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</module>
|
|
@ -1,97 +0,0 @@
|
|||||||
/******************************************************************************
|
|
||||||
* OpenLP - Open Source Lyrics Projection *
|
|
||||||
* --------------------------------------------------------------------------- *
|
|
||||||
* Copyright (c) 2011-2015 OpenLP Android Developers *
|
|
||||||
* --------------------------------------------------------------------------- *
|
|
||||||
* This program is free software; you can redistribute it and/or modify it *
|
|
||||||
* under the terms of the GNU General Public License as published by the Free *
|
|
||||||
* Software Foundation; version 2 of the License. *
|
|
||||||
* *
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT *
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for *
|
|
||||||
* more details. *
|
|
||||||
* *
|
|
||||||
* You should have received a copy of the GNU General Public License along *
|
|
||||||
* with this program; if not, write to the Free Software Foundation, Inc., 59 *
|
|
||||||
* Temple Place, Suite 330, Boston, MA 02111-1307 USA *
|
|
||||||
*******************************************************************************/
|
|
||||||
package org.openlp.android2.common;
|
|
||||||
|
|
||||||
|
|
||||||
import java.security.KeyStore;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.preference.PreferenceManager;
|
|
||||||
import android.util.Log;
|
|
||||||
import com.loopj.android.http.AsyncHttpClient;
|
|
||||||
import org.openlp.android2.R;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Personalised HttpClient to be used throughout OpenLP with customisable
|
|
||||||
* parameters.
|
|
||||||
*/
|
|
||||||
public class OpenLPHttpClient {
|
|
||||||
|
|
||||||
private final String LOG_TAG = OpenLPHttpClient.class.getName();
|
|
||||||
private Context context;
|
|
||||||
private Boolean useSSL = Boolean.FALSE;
|
|
||||||
|
|
||||||
public OpenLPHttpClient(Context context) {
|
|
||||||
this.context = context;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAbsoluteUrl(AsyncHttpClient client) {
|
|
||||||
|
|
||||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
|
|
||||||
|
|
||||||
String urlBase = getBaseUrl();
|
|
||||||
|
|
||||||
Log.d(LOG_TAG, "Base Url set to " + urlBase);
|
|
||||||
|
|
||||||
String userid = sharedPrefs.getString(context.getString(R.string.key_userid), "openlp");
|
|
||||||
|
|
||||||
String password = sharedPrefs.getString(context.getString(R.string.key_password), "password");
|
|
||||||
|
|
||||||
Log.d(LOG_TAG, "Credentials set to " + userid + " : " + password);
|
|
||||||
client.setBasicAuth(userid,password);
|
|
||||||
|
|
||||||
int connectionTimeout = context.getResources().getInteger(
|
|
||||||
R.integer.connectionTimeoutDefaultValue);
|
|
||||||
|
|
||||||
if (sharedPrefs.getBoolean(context.getString(R.string.key_enable_custom_timeout), false)) {
|
|
||||||
Log.d(LOG_TAG, "Overriding Connection and Socket timeouts");
|
|
||||||
|
|
||||||
connectionTimeout = Integer.parseInt(sharedPrefs.getString(context.getString(R.string.key_connection_timeout),
|
|
||||||
String.valueOf(context.getResources().getInteger(R.integer.connectionTimeoutDefaultValue))
|
|
||||||
));
|
|
||||||
}
|
|
||||||
client.setTimeout(connectionTimeout);
|
|
||||||
if (useSSL){
|
|
||||||
try {
|
|
||||||
KeyStore trustStore = KeyStore.getInstance((KeyStore.getDefaultType()));
|
|
||||||
trustStore.load(null, null);
|
|
||||||
OpenLPSSLSocketFactory sf = new OpenLPSSLSocketFactory(trustStore);
|
|
||||||
sf.setHostnameVerifier((OpenLPSSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER));
|
|
||||||
client.setSSLSocketFactory(sf);
|
|
||||||
}
|
|
||||||
catch (Exception e){
|
|
||||||
Log.d(LOG_TAG, "Unable to support SSL");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return urlBase;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getBaseUrl(){
|
|
||||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
|
|
||||||
|
|
||||||
useSSL = sharedPrefs.getBoolean(context.getString(R.string.key_ssl_use), false);
|
|
||||||
String host = sharedPrefs.getString(context.getString(R.string.key_host),
|
|
||||||
context.getString(R.string.host_default_value));
|
|
||||||
String port = sharedPrefs.getString(context.getString(R.string.key_port), "4316");
|
|
||||||
|
|
||||||
return String.format("http%s://%s:%s", useSSL ? "s" : "", host, port);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,61 +0,0 @@
|
|||||||
/******************************************************************************
|
|
||||||
* OpenLP - Open Source Lyrics Projection *
|
|
||||||
* --------------------------------------------------------------------------- *
|
|
||||||
* Copyright (c) 2011-2015 OpenLP Android Developers *
|
|
||||||
* --------------------------------------------------------------------------- *
|
|
||||||
* This program is free software; you can redistribute it and/or modify it *
|
|
||||||
* under the terms of the GNU General Public License as published by the Free *
|
|
||||||
* Software Foundation; version 2 of the License. *
|
|
||||||
* *
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT *
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for *
|
|
||||||
* more details. *
|
|
||||||
* *
|
|
||||||
* You should have received a copy of the GNU General Public License along *
|
|
||||||
* with this program; if not, write to the Free Software Foundation, Inc., 59 *
|
|
||||||
* Temple Place, Suite 330, Boston, MA 02111-1307 USA *
|
|
||||||
*******************************************************************************/
|
|
||||||
package org.openlp.android2.common;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import org.openlp.android2.R;
|
|
||||||
|
|
||||||
public class OpenLPHttpReturn {
|
|
||||||
private int return_code = 0;
|
|
||||||
private String data = null;
|
|
||||||
private Context context;
|
|
||||||
|
|
||||||
public OpenLPHttpReturn() {
|
|
||||||
this.return_code = -1;
|
|
||||||
this.data = "";
|
|
||||||
this.context = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OpenLPHttpReturn(int return_code, String data, Context context) {
|
|
||||||
this.return_code = return_code;
|
|
||||||
this.data = data;
|
|
||||||
this.context = context;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getData() {
|
|
||||||
return this.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isError() {
|
|
||||||
return return_code != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isSecurityError() {
|
|
||||||
return return_code == 401;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getErrorMessage(String message) {
|
|
||||||
return return_code == 401 ? this.context.getString(R.string.httpreturn_unauthorised) : message;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "HttpReturn{" + "data='" + data + '\'' + ", return code=" + return_code + '}';
|
|
||||||
}
|
|
||||||
}
|
|
Binary file not shown.
Before Width: | Height: | Size: 684 B |
Binary file not shown.
Before Width: | Height: | Size: 464 B |
Binary file not shown.
Before Width: | Height: | Size: 868 B |
Binary file not shown.
Before Width: | Height: | Size: 1.3 KiB |
@ -1,90 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:orientation="vertical" android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:paddingLeft="15dp"
|
|
||||||
android:paddingTop="15dp"
|
|
||||||
android:paddingRight="15dp"
|
|
||||||
>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="Select Plugin"
|
|
||||||
android:id="@+id/search_title"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
|
||||||
android:textSize="40px"
|
|
||||||
android:height="70px"
|
|
||||||
android:paddingLeft="30dp"
|
|
||||||
android:paddingRight="30dp"/>
|
|
||||||
|
|
||||||
<Spinner
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/search_spinner"
|
|
||||||
android:layout_weight="0.4"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
|
||||||
android:text="Search Text"
|
|
||||||
android:textSize="40px"
|
|
||||||
android:height="70px"
|
|
||||||
android:id="@+id/search_value_desc"
|
|
||||||
android:paddingLeft="30dp"
|
|
||||||
android:paddingRight="30dp"/>
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:imeOptions="actionSearch"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/search_text"
|
|
||||||
style="@android:style/Animation.InputMethod"
|
|
||||||
android:layout_weight="0.87"
|
|
||||||
android:inputType="text"
|
|
||||||
android:textSize="40px"
|
|
||||||
android:height="70px"
|
|
||||||
/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:weightSum="1">
|
|
||||||
|
|
||||||
<ListView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="fill_parent"
|
|
||||||
android:id="@+id/searchlistView"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
|
||||||
android:paddingLeft="30dp"
|
|
||||||
android:paddingRight="30dp"
|
|
||||||
android:layout_marginTop="20dp"
|
|
||||||
android:layout_marginBottom="20dp"
|
|
||||||
android:textSize="40px"
|
|
||||||
android:height="70px"
|
|
||||||
android:layout_weight="1"/>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
@ -1,40 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="fill_parent"
|
|
||||||
android:weightSum="1">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="315dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
|
||||||
android:text="@string/searchResults"
|
|
||||||
android:id="@+id/textView"
|
|
||||||
android:textStyle="bold|italic"
|
|
||||||
android:textSize="40px"
|
|
||||||
android:height="70px"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_marginBottom="10dp"/>
|
|
||||||
<RadioButton
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/searchSendLive"
|
|
||||||
android:id="@+id/buttonLive"
|
|
||||||
android:textSize="20sp"
|
|
||||||
android:height="30dp"
|
|
||||||
android:clickable="true"
|
|
||||||
android:layout_marginTop="20dp"
|
|
||||||
android:layout_marginBottom="20dp"/>
|
|
||||||
<RadioButton
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/searchAddToService"
|
|
||||||
android:id="@+id/buttonService"
|
|
||||||
android:textSize="20sp"
|
|
||||||
android:height="40dp"
|
|
||||||
android:clickable="true"
|
|
||||||
android:layout_marginTop="20dp"
|
|
||||||
android:layout_marginBottom="20dp"/>
|
|
||||||
</LinearLayout>
|
|
@ -1,18 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="vertical" >
|
|
||||||
|
|
||||||
<TextView android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:textColor="#000000"
|
|
||||||
android:textSize="40sp"
|
|
||||||
android:paddingTop="10dp"
|
|
||||||
android:paddingRight="5dp"
|
|
||||||
android:paddingLeft="5dp"
|
|
||||||
android:paddingEnd="5dp"
|
|
||||||
android:paddingBottom="10dp"
|
|
||||||
android:id="@+id/searchListRow"/>
|
|
||||||
</LinearLayout>
|
|
@ -1,11 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:id="@android:id/text1"
|
|
||||||
style="?android:attr/spinnerDropDownItemStyle"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="?android:attr/listPreferredItemHeight"
|
|
||||||
android:ellipsize="marquee"
|
|
||||||
android:textColor="#000"
|
|
||||||
android:textStyle="bold|italic"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
|
@ -1,11 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:id="@android:id/text1"
|
|
||||||
style="?android:attr/spinnerItemStyle"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textColor="#000"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
|
||||||
android:ellipsize="marquee"
|
|
||||||
android:textStyle="bold|italic" />
|
|
Loading…
Reference in New Issue
Block a user