Merge lp:~trb143/openlp/Android_Search into lp:openlp/android2
- Android_Search
- Merge into android2
Proposed by
Tim Bentley
Status: | Merged |
---|---|
Merged at revision: | 33 |
Proposed branch: | lp:~trb143/openlp/Android_Search |
Merge into: | lp:openlp/android2 |
Diff against target: |
1034 lines (+841/-15) 15 files modified
app/app.iml (+208/-10) app/src/main/java/org/openlp/android2/OpenLP.java (+19/-0) app/src/main/java/org/openlp/android2/common/NavigationOptions.java (+1/-0) app/src/main/java/org/openlp/android2/common/OpenLPDialog.java (+2/-1) app/src/main/java/org/openlp/android2/common/OpenLPHttpClient.java (+1/-1) app/src/main/java/org/openlp/android2/dialogs/SearchSelectionDialog.java (+135/-0) app/src/main/java/org/openlp/android2/fragments/NavigationDrawerFragment.java (+5/-1) app/src/main/java/org/openlp/android2/fragments/SearchFragment.java (+283/-0) app/src/main/res/layout/fragment_search.xml (+90/-0) app/src/main/res/layout/search_action_dialog.xml (+40/-0) app/src/main/res/layout/search_result.xml (+11/-0) app/src/main/res/layout/search_result_row.xml (+18/-0) app/src/main/res/layout/spinner_dropdown_item.xml (+11/-0) app/src/main/res/layout/spinner_list_item.xml (+11/-0) app/src/main/res/values/strings.xml (+6/-2) |
To merge this branch: | bzr merge lp:~trb143/openlp/Android_Search |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Raoul Snyman | Approve | ||
Review via email: mp+282125@code.launchpad.net |
This proposal supersedes a proposal from 2016-01-10.
Commit message
Description of the change
Lets get search out the door then start to polish the UI,
To post a comment you must log in.
Revision history for this message
Raoul Snyman (raoul-snyman) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'app/app.iml' |
2 | --- app/app.iml 2015-11-15 10:17:08 +0000 |
3 | +++ app/app.iml 2016-01-10 19:34:28 +0000 |
4 | @@ -1,5 +1,5 @@ |
5 | <?xml version="1.0" encoding="UTF-8"?> |
6 | -<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="OpenLP2" external.system.module.version="unspecified" type="JAVA_MODULE" version="4"> |
7 | +<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="OpenLP2_search" external.system.module.version="unspecified" type="JAVA_MODULE" version="4"> |
8 | <component name="FacetManager"> |
9 | <facet type="android-gradle" name="Android-Gradle"> |
10 | <configuration> |
11 | @@ -65,27 +65,20 @@ |
12 | <sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" /> |
13 | <sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" /> |
14 | <excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" /> |
15 | - <excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" /> |
16 | <excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" /> |
17 | - <excludeFolder url="file://$MODULE_DIR$/build/intermediates/coverage-instrumented-classes" /> |
18 | <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" /> |
19 | <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" /> |
20 | - <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" /> |
21 | <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.1/jars" /> |
22 | <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/design/22.2.1/jars" /> |
23 | <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/22.2.1/jars" /> |
24 | <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" /> |
25 | - <excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" /> |
26 | - <excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" /> |
27 | - <excludeFolder url="file://$MODULE_DIR$/build/intermediates/libs" /> |
28 | - <excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" /> |
29 | <excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" /> |
30 | - <excludeFolder url="file://$MODULE_DIR$/build/intermediates/ndk" /> |
31 | <excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" /> |
32 | - <excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard" /> |
33 | <excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" /> |
34 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/resources" /> |
35 | <excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" /> |
36 | <excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" /> |
37 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/tmp" /> |
38 | <excludeFolder url="file://$MODULE_DIR$/build/outputs" /> |
39 | <excludeFolder url="file://$MODULE_DIR$/build/tmp" /> |
40 | </content> |
41 | @@ -97,4 +90,209 @@ |
42 | <orderEntry type="library" exported="" name="design-22.2.1" level="project" /> |
43 | <orderEntry type="library" exported="" name="appcompat-v7-22.2.1" level="project" /> |
44 | </component> |
45 | + <component name="org.twodividedbyzero.idea.findbugs"> |
46 | + <option name="_basePreferences"> |
47 | + <map> |
48 | + <entry key="property.analysisEffortLevel" value="default" /> |
49 | + <entry key="property.analyzeAfterAutoMake" value="false" /> |
50 | + <entry key="property.analyzeAfterCompile" value="false" /> |
51 | + <entry key="property.annotationGutterIconEnabled" value="true" /> |
52 | + <entry key="property.annotationSuppressWarningsClass" value="edu.umd.cs.findbugs.annotations.SuppressFBWarnings" /> |
53 | + <entry key="property.annotationTextRangeMarkupEnabled" value="true" /> |
54 | + <entry key="property.exportAsHtml" value="true" /> |
55 | + <entry key="property.exportAsXml" value="true" /> |
56 | + <entry key="property.exportBaseDir" value="" /> |
57 | + <entry key="property.exportCreateArchiveDir" value="false" /> |
58 | + <entry key="property.exportOpenBrowser" value="true" /> |
59 | + <entry key="property.minPriorityToReport" value="Medium" /> |
60 | + <entry key="property.runAnalysisInBackground" value="false" /> |
61 | + <entry key="property.showHiddenDetectors" value="false" /> |
62 | + <entry key="property.toolWindowToFront" value="true" /> |
63 | + </map> |
64 | + </option> |
65 | + <option name="_detectors"> |
66 | + <map> |
67 | + <entry key="AppendingToAnObjectOutputStream" value="true" /> |
68 | + <entry key="AtomicityProblem" value="true" /> |
69 | + <entry key="BadAppletConstructor" value="false" /> |
70 | + <entry key="BadResultSetAccess" value="true" /> |
71 | + <entry key="BadSyntaxForRegularExpression" value="true" /> |
72 | + <entry key="BadUseOfReturnValue" value="true" /> |
73 | + <entry key="BadlyOverriddenAdapter" value="true" /> |
74 | + <entry key="BooleanReturnNull" value="true" /> |
75 | + <entry key="BuildInterproceduralCallGraph" value="false" /> |
76 | + <entry key="BuildObligationPolicyDatabase" value="true" /> |
77 | + <entry key="BuildStringPassthruGraph" value="true" /> |
78 | + <entry key="CallToUnsupportedMethod" value="false" /> |
79 | + <entry key="CalledMethods" value="true" /> |
80 | + <entry key="CheckCalls" value="false" /> |
81 | + <entry key="CheckExpectedWarnings" value="false" /> |
82 | + <entry key="CheckImmutableAnnotation" value="true" /> |
83 | + <entry key="CheckRelaxingNullnessAnnotation" value="true" /> |
84 | + <entry key="CheckTypeQualifiers" value="true" /> |
85 | + <entry key="CloneIdiom" value="true" /> |
86 | + <entry key="ComparatorIdiom" value="true" /> |
87 | + <entry key="ConfusedInheritance" value="true" /> |
88 | + <entry key="ConfusionBetweenInheritedAndOuterMethod" value="true" /> |
89 | + <entry key="CovariantArrayAssignment" value="false" /> |
90 | + <entry key="CrossSiteScripting" value="true" /> |
91 | + <entry key="DefaultEncodingDetector" value="true" /> |
92 | + <entry key="DoInsideDoPrivileged" value="true" /> |
93 | + <entry key="DontCatchIllegalMonitorStateException" value="true" /> |
94 | + <entry key="DontIgnoreResultOfPutIfAbsent" value="true" /> |
95 | + <entry key="DontUseEnum" value="true" /> |
96 | + <entry key="DroppedException" value="true" /> |
97 | + <entry key="DumbMethodInvocations" value="true" /> |
98 | + <entry key="DumbMethods" value="true" /> |
99 | + <entry key="DuplicateBranches" value="true" /> |
100 | + <entry key="EmptyZipFileEntry" value="false" /> |
101 | + <entry key="EqualsOperandShouldHaveClassCompatibleWithThis" value="true" /> |
102 | + <entry key="ExplicitSerialization" value="true" /> |
103 | + <entry key="FieldItemSummary" value="true" /> |
104 | + <entry key="FinalizerNullsFields" value="true" /> |
105 | + <entry key="FindBadCast2" value="true" /> |
106 | + <entry key="FindBadForLoop" value="true" /> |
107 | + <entry key="FindBugsSummaryStats" value="true" /> |
108 | + <entry key="FindCircularDependencies" value="false" /> |
109 | + <entry key="FindComparatorProblems" value="true" /> |
110 | + <entry key="FindDeadLocalStores" value="true" /> |
111 | + <entry key="FindDoubleCheck" value="true" /> |
112 | + <entry key="FindEmptySynchronizedBlock" value="true" /> |
113 | + <entry key="FindFieldSelfAssignment" value="true" /> |
114 | + <entry key="FindFinalizeInvocations" value="true" /> |
115 | + <entry key="FindFloatEquality" value="true" /> |
116 | + <entry key="FindFloatMath" value="false" /> |
117 | + <entry key="FindHEmismatch" value="true" /> |
118 | + <entry key="FindInconsistentSync2" value="true" /> |
119 | + <entry key="FindJSR166LockMonitorenter" value="true" /> |
120 | + <entry key="FindLocalSelfAssignment2" value="true" /> |
121 | + <entry key="FindMaskedFields" value="true" /> |
122 | + <entry key="FindMismatchedWaitOrNotify" value="true" /> |
123 | + <entry key="FindNakedNotify" value="true" /> |
124 | + <entry key="FindNoSideEffectMethods" value="true" /> |
125 | + <entry key="FindNonSerializableStoreIntoSession" value="false" /> |
126 | + <entry key="FindNonSerializableValuePassedToWriteObject" value="false" /> |
127 | + <entry key="FindNonShortCircuit" value="true" /> |
128 | + <entry key="FindNullDeref" value="true" /> |
129 | + <entry key="FindNullDerefsInvolvingNonShortCircuitEvaluation" value="true" /> |
130 | + <entry key="FindOpenStream" value="true" /> |
131 | + <entry key="FindPuzzlers" value="true" /> |
132 | + <entry key="FindRefComparison" value="true" /> |
133 | + <entry key="FindReturnRef" value="true" /> |
134 | + <entry key="FindRoughConstants" value="true" /> |
135 | + <entry key="FindRunInvocations" value="true" /> |
136 | + <entry key="FindSelfComparison" value="true" /> |
137 | + <entry key="FindSelfComparison2" value="true" /> |
138 | + <entry key="FindSleepWithLockHeld" value="true" /> |
139 | + <entry key="FindSpinLoop" value="true" /> |
140 | + <entry key="FindSqlInjection" value="true" /> |
141 | + <entry key="FindTwoLockWait" value="true" /> |
142 | + <entry key="FindUncalledPrivateMethods" value="true" /> |
143 | + <entry key="FindUnconditionalWait" value="true" /> |
144 | + <entry key="FindUninitializedGet" value="true" /> |
145 | + <entry key="FindUnrelatedTypesInGenericContainer" value="true" /> |
146 | + <entry key="FindUnreleasedLock" value="true" /> |
147 | + <entry key="FindUnsatisfiedObligation" value="true" /> |
148 | + <entry key="FindUnsyncGet" value="true" /> |
149 | + <entry key="FindUseOfNonSerializableValue" value="true" /> |
150 | + <entry key="FindUselessControlFlow" value="true" /> |
151 | + <entry key="FindUselessObjects" value="true" /> |
152 | + <entry key="FormatStringChecker" value="true" /> |
153 | + <entry key="FunctionsThatMightBeMistakenForProcedures" value="true" /> |
154 | + <entry key="HugeSharedStringConstants" value="true" /> |
155 | + <entry key="IDivResultCastToDouble" value="true" /> |
156 | + <entry key="IncompatMask" value="true" /> |
157 | + <entry key="InconsistentAnnotations" value="true" /> |
158 | + <entry key="InefficientIndexOf" value="false" /> |
159 | + <entry key="InefficientInitializationInsideLoop" value="false" /> |
160 | + <entry key="InefficientMemberAccess" value="false" /> |
161 | + <entry key="InefficientToArray" value="false" /> |
162 | + <entry key="InfiniteLoop" value="true" /> |
163 | + <entry key="InfiniteRecursiveLoop" value="true" /> |
164 | + <entry key="InheritanceUnsafeGetResource" value="true" /> |
165 | + <entry key="InitializationChain" value="true" /> |
166 | + <entry key="InitializeNonnullFieldsInConstructor" value="true" /> |
167 | + <entry key="InstantiateStaticClass" value="true" /> |
168 | + <entry key="IntCast2LongAsInstant" value="true" /> |
169 | + <entry key="InvalidJUnitTest" value="true" /> |
170 | + <entry key="IteratorIdioms" value="true" /> |
171 | + <entry key="LazyInit" value="true" /> |
172 | + <entry key="LoadOfKnownNullValue" value="true" /> |
173 | + <entry key="LostLoggerDueToWeakReference" value="true" /> |
174 | + <entry key="MethodReturnCheck" value="true" /> |
175 | + <entry key="Methods" value="true" /> |
176 | + <entry key="MultithreadedInstanceAccess" value="true" /> |
177 | + <entry key="MutableEnum" value="true" /> |
178 | + <entry key="MutableLock" value="true" /> |
179 | + <entry key="MutableStaticFields" value="true" /> |
180 | + <entry key="Naming" value="true" /> |
181 | + <entry key="Noise" value="false" /> |
182 | + <entry key="NoiseNullDeref" value="false" /> |
183 | + <entry key="NoteAnnotationRetention" value="true" /> |
184 | + <entry key="NoteCheckReturnValueAnnotations" value="true" /> |
185 | + <entry key="NoteDirectlyRelevantTypeQualifiers" value="true" /> |
186 | + <entry key="NoteJCIPAnnotation" value="true" /> |
187 | + <entry key="NoteNonNullAnnotations" value="false" /> |
188 | + <entry key="NoteNonnullReturnValues" value="false" /> |
189 | + <entry key="NoteSuppressedWarnings" value="true" /> |
190 | + <entry key="NoteUnconditionalParamDerefs" value="true" /> |
191 | + <entry key="NumberConstructor" value="true" /> |
192 | + <entry key="OptionalReturnNull" value="true" /> |
193 | + <entry key="OverridingEqualsNotSymmetrical" value="true" /> |
194 | + <entry key="PreferZeroLengthArrays" value="true" /> |
195 | + <entry key="PublicSemaphores" value="false" /> |
196 | + <entry key="QuestionableBooleanAssignment" value="true" /> |
197 | + <entry key="ReadOfInstanceFieldInMethodInvokedByConstructorInSuperclass" value="true" /> |
198 | + <entry key="ReadReturnShouldBeChecked" value="true" /> |
199 | + <entry key="RedundantConditions" value="true" /> |
200 | + <entry key="RedundantInterfaces" value="true" /> |
201 | + <entry key="ReflectiveClasses" value="true" /> |
202 | + <entry key="RepeatedConditionals" value="true" /> |
203 | + <entry key="ResolveAllReferences" value="false" /> |
204 | + <entry key="RuntimeExceptionCapture" value="true" /> |
205 | + <entry key="SerializableIdiom" value="true" /> |
206 | + <entry key="StartInConstructor" value="true" /> |
207 | + <entry key="StaticCalendarDetector" value="true" /> |
208 | + <entry key="StringConcatenation" value="true" /> |
209 | + <entry key="SuperfluousInstanceOf" value="true" /> |
210 | + <entry key="SuspiciousThreadInterrupted" value="true" /> |
211 | + <entry key="SwitchFallthrough" value="true" /> |
212 | + <entry key="SynchronizationOnSharedBuiltinConstant" value="true" /> |
213 | + <entry key="SynchronizeAndNullCheckField" value="true" /> |
214 | + <entry key="SynchronizeOnClassLiteralNotGetClass" value="true" /> |
215 | + <entry key="SynchronizingOnContentsOfFieldToProtectField" value="true" /> |
216 | + <entry key="TestASM" value="false" /> |
217 | + <entry key="TestDataflowAnalysis" value="false" /> |
218 | + <entry key="TestingGround" value="false" /> |
219 | + <entry key="TestingGround2" value="false" /> |
220 | + <entry key="TrainFieldStoreTypes" value="true" /> |
221 | + <entry key="TrainLongInstantfParams" value="true" /> |
222 | + <entry key="TrainNonNullAnnotations" value="true" /> |
223 | + <entry key="TrainUnconditionalDerefParams" value="true" /> |
224 | + <entry key="URLProblems" value="true" /> |
225 | + <entry key="UncallableMethodOfAnonymousClass" value="true" /> |
226 | + <entry key="UnnecessaryMath" value="true" /> |
227 | + <entry key="UnreadFields" value="true" /> |
228 | + <entry key="UselessSubclassMethod" value="false" /> |
229 | + <entry key="VarArgsProblems" value="true" /> |
230 | + <entry key="VolatileUsage" value="true" /> |
231 | + <entry key="WaitInLoop" value="true" /> |
232 | + <entry key="WrongMapIterator" value="true" /> |
233 | + <entry key="XMLFactoryBypass" value="true" /> |
234 | + </map> |
235 | + </option> |
236 | + <option name="_reportCategories"> |
237 | + <map> |
238 | + <entry key="BAD_PRACTICE" value="true" /> |
239 | + <entry key="CORRECTNESS" value="true" /> |
240 | + <entry key="EXPERIMENTAL" value="true" /> |
241 | + <entry key="I18N" value="true" /> |
242 | + <entry key="MALICIOUS_CODE" value="true" /> |
243 | + <entry key="MT_CORRECTNESS" value="true" /> |
244 | + <entry key="PERFORMANCE" value="true" /> |
245 | + <entry key="SECURITY" value="true" /> |
246 | + <entry key="STYLE" value="true" /> |
247 | + </map> |
248 | + </option> |
249 | + </component> |
250 | </module> |
251 | \ No newline at end of file |
252 | |
253 | === modified file 'app/src/main/java/org/openlp/android2/OpenLP.java' |
254 | --- app/src/main/java/org/openlp/android2/OpenLP.java 2015-10-06 22:40:40 +0000 |
255 | +++ app/src/main/java/org/openlp/android2/OpenLP.java 2016-01-10 19:34:28 +0000 |
256 | @@ -42,6 +42,7 @@ |
257 | import org.openlp.android2.fragments.LiveListFragment; |
258 | import org.openlp.android2.fragments.LiveWebFragment; |
259 | import org.openlp.android2.fragments.NavigationDrawerFragment; |
260 | +import org.openlp.android2.fragments.SearchFragment; |
261 | import org.openlp.android2.fragments.ServiceListFragment; |
262 | import org.openlp.android2.fragments.StageWebFragment; |
263 | |
264 | @@ -163,6 +164,24 @@ |
265 | toggerContainer(R.id.next_button, View.GONE); |
266 | toggerContainer(R.id.prev_button, View.GONE); |
267 | break; |
268 | + case NavigationOptions.Search: |
269 | + singleTab(); |
270 | + fragmentManager.beginTransaction() |
271 | + .replace(R.id.container, SearchFragment.newInstance()) |
272 | + .commit(); |
273 | + mTitle = getString(R.string.action_search); |
274 | + toggerContainer(R.id.next_button, View.GONE); |
275 | + toggerContainer(R.id.prev_button, View.GONE); |
276 | + break; |
277 | + default: |
278 | + singleTab(); |
279 | + fragmentManager.beginTransaction() |
280 | + .replace(R.id.container, HomeFragment.newInstance()) |
281 | + .commit(); |
282 | + mTitle = getString(R.string.home); |
283 | + toggerContainer(R.id.next_button, View.GONE); |
284 | + toggerContainer(R.id.prev_button, View.GONE); |
285 | + break; |
286 | } |
287 | } |
288 | |
289 | |
290 | === modified file 'app/src/main/java/org/openlp/android2/common/NavigationOptions.java' |
291 | --- app/src/main/java/org/openlp/android2/common/NavigationOptions.java 2015-01-19 21:09:12 +0000 |
292 | +++ app/src/main/java/org/openlp/android2/common/NavigationOptions.java 2016-01-10 19:34:28 +0000 |
293 | @@ -24,4 +24,5 @@ |
294 | public final static int LiveList = 2; |
295 | public final static int StageView = 3; |
296 | public final static int LiveView = 4; |
297 | + public final static int Search = 5; |
298 | } |
299 | |
300 | === modified file 'app/src/main/java/org/openlp/android2/common/OpenLPDialog.java' |
301 | --- app/src/main/java/org/openlp/android2/common/OpenLPDialog.java 2015-01-19 21:09:12 +0000 |
302 | +++ app/src/main/java/org/openlp/android2/common/OpenLPDialog.java 2016-01-10 19:34:28 +0000 |
303 | @@ -45,7 +45,8 @@ |
304 | protected void triggerTextRequest(String url) { |
305 | calledURL = url; |
306 | Log.d(LOG_TAG, "Trigger Request for url " + url); |
307 | - String callurl = String.format("%s%s", httpClient.getAbsoluteUrl(client), url ); |
308 | + String callurl = String.format("%s%s", httpClient.getAbsoluteUrl(client), url); |
309 | + |
310 | client.get(callurl, null, new TextHttpResponseHandler() { |
311 | @Override |
312 | public void onSuccess(int statusCode, Header[] headers, String responseString) { |
313 | |
314 | === modified file 'app/src/main/java/org/openlp/android2/common/OpenLPHttpClient.java' |
315 | --- app/src/main/java/org/openlp/android2/common/OpenLPHttpClient.java 2015-10-04 21:02:13 +0000 |
316 | +++ app/src/main/java/org/openlp/android2/common/OpenLPHttpClient.java 2016-01-10 19:34:28 +0000 |
317 | @@ -76,7 +76,7 @@ |
318 | client.setSSLSocketFactory(sf); |
319 | } |
320 | catch (Exception e){ |
321 | - // |
322 | + Log.d(LOG_TAG, "Unable to support SSL"); |
323 | } |
324 | } |
325 | return urlBase; |
326 | |
327 | === added file 'app/src/main/java/org/openlp/android2/dialogs/SearchSelectionDialog.java' |
328 | --- app/src/main/java/org/openlp/android2/dialogs/SearchSelectionDialog.java 1970-01-01 00:00:00 +0000 |
329 | +++ app/src/main/java/org/openlp/android2/dialogs/SearchSelectionDialog.java 2016-01-10 19:34:28 +0000 |
330 | @@ -0,0 +1,135 @@ |
331 | +/****************************************************************************** |
332 | + * OpenLP - Open Source Lyrics Projection * |
333 | + * --------------------------------------------------------------------------- * |
334 | + * Copyright (c) 2011-2015 OpenLP Android Developers * |
335 | + * --------------------------------------------------------------------------- * |
336 | + * This program is free software; you can redistribute it and/or modify it * |
337 | + * under the terms of the GNU General Public License as published by the Free * |
338 | + * Software Foundation; version 2 of the License. * |
339 | + * * |
340 | + * This program is distributed in the hope that it will be useful, but WITHOUT * |
341 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * |
342 | + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * |
343 | + * more details. * |
344 | + * * |
345 | + * You should have received a copy of the GNU General Public License along * |
346 | + * with this program; if not, write to the Free Software Foundation, Inc., 59 * |
347 | + * Temple Place, Suite 330, Boston, MA 02111-1307 USA * |
348 | + *******************************************************************************/ |
349 | +package org.openlp.android2.dialogs; |
350 | + |
351 | +import android.app.AlertDialog; |
352 | +import android.app.Dialog; |
353 | +import android.content.DialogInterface; |
354 | +import android.os.Bundle; |
355 | +import android.util.Log; |
356 | +import android.view.LayoutInflater; |
357 | +import android.view.View; |
358 | +import android.widget.Button; |
359 | +import android.widget.RadioButton; |
360 | +import android.widget.Toast; |
361 | +import org.openlp.android2.R; |
362 | +import org.openlp.android2.api.Api; |
363 | +import org.openlp.android2.common.JsonHelpers; |
364 | +import org.openlp.android2.common.OpenLPDialog; |
365 | +import org.openlp.android2.common.OpenLPHttpClient; |
366 | + |
367 | +public class SearchSelectionDialog extends OpenLPDialog { |
368 | + private final String LOG_TAG = SearchSelectionDialog.class.getName(); |
369 | + public AlertDialog dialog; |
370 | + private String key; |
371 | + private String plugin; |
372 | + private String text; |
373 | + private RadioButton sendLive; |
374 | + private RadioButton addToService; |
375 | + |
376 | + /** |
377 | + * The system calls this only when creating the layout in a dialog. |
378 | + */ |
379 | + @Override |
380 | + public Dialog onCreateDialog(Bundle savedInstanceState) { |
381 | + // The only reason you might override this method when using onCreateView() is |
382 | + // to modify any dialog characteristics. For example, the dialog includes a |
383 | + // title by default, but your custom layout might not need it. So here you can |
384 | + // remove the dialog title, but you must call the superclass to get the Dialog. |
385 | + |
386 | + key = getArguments().getString("key"); |
387 | + plugin = getArguments().getString("plugin"); |
388 | + text = getArguments().getString("text"); |
389 | + |
390 | + context = getActivity(); |
391 | + httpClient = new OpenLPHttpClient(context); |
392 | + |
393 | + AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); |
394 | + // Get the layout inflater |
395 | + LayoutInflater inflater = getActivity().getLayoutInflater(); |
396 | + |
397 | + // Inflate and set the layout for the dialog |
398 | + // Pass null as the parent view because its going in the dialog layout |
399 | + View view = inflater.inflate(R.layout.search_action_dialog, null); |
400 | + builder.setView(view); |
401 | + |
402 | + sendLive = (RadioButton) view.findViewById(R.id.buttonLive); |
403 | + sendLive.setOnClickListener(new View.OnClickListener() { |
404 | + @Override |
405 | + public void onClick(View v) { |
406 | + createLive(); |
407 | + SearchSelectionDialog.this.getDialog().cancel(); |
408 | + } |
409 | + }); |
410 | + |
411 | + addToService = (RadioButton) view.findViewById(R.id.buttonService); |
412 | + addToService.setOnClickListener(new View.OnClickListener() { |
413 | + @Override |
414 | + public void onClick(View v) { |
415 | + createService(); |
416 | + SearchSelectionDialog.this.getDialog().cancel(); |
417 | + } |
418 | + }); |
419 | + |
420 | + builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { |
421 | + public void onClick(DialogInterface dialog, int id) { |
422 | + SearchSelectionDialog.this.getDialog().cancel(); |
423 | + } |
424 | + }); |
425 | + dialog = builder.create(); |
426 | + dialog.setOnShowListener(new DialogInterface.OnShowListener() { |
427 | + @Override |
428 | + public void onShow(DialogInterface dialogI) { |
429 | + Button btnNegative = dialog.getButton(Dialog.BUTTON_NEGATIVE); |
430 | + btnNegative.setTextSize(20); |
431 | + } |
432 | + }); |
433 | + return dialog; |
434 | + } |
435 | + |
436 | + @Override |
437 | + public void onResume() { |
438 | + super.onResume(); |
439 | + Log.d(LOG_TAG, "Resuming..."); |
440 | + } |
441 | + |
442 | + public void createLive() { |
443 | + try { |
444 | + String request = JsonHelpers.createRequestJSON("id", key); |
445 | + String url = String.format(Api.SEARCH_PLUGIN_LIVE, plugin.toLowerCase()); |
446 | + triggerTextRequest(String.format("%s%s", url, request)); |
447 | + Log.d(LOG_TAG, String.format("Setting list data. apiBase(%s), text(%s)", Api.SEARCH_PLUGIN_LIVE, text)); |
448 | + } catch (JsonHelpers.JSONHandlerException e) { |
449 | + e.printStackTrace(); |
450 | + Toast.makeText(context, "Request Failed", Toast.LENGTH_SHORT).show(); |
451 | + } |
452 | + } |
453 | + |
454 | + public void createService() { |
455 | + try { |
456 | + String request = JsonHelpers.createRequestJSON("id", key); |
457 | + String url = String.format(Api.SEARCH_PLUGIN_ADD, plugin.toLowerCase()); |
458 | + triggerTextRequest(String.format("%s%s", url, request)); |
459 | + Log.d(LOG_TAG, String.format("Setting list data. apiBase(%s), text(%s)", Api.SEARCH_PLUGIN_ADD, text)); |
460 | + } catch (JsonHelpers.JSONHandlerException e) { |
461 | + e.printStackTrace(); |
462 | + Toast.makeText(context, "Request Failed", Toast.LENGTH_SHORT).show(); |
463 | + } |
464 | + } |
465 | +} |
466 | |
467 | === modified file 'app/src/main/java/org/openlp/android2/fragments/NavigationDrawerFragment.java' |
468 | --- app/src/main/java/org/openlp/android2/fragments/NavigationDrawerFragment.java 2015-05-30 08:07:36 +0000 |
469 | +++ app/src/main/java/org/openlp/android2/fragments/NavigationDrawerFragment.java 2016-01-10 19:34:28 +0000 |
470 | @@ -42,7 +42,6 @@ |
471 | import android.widget.ListAdapter; |
472 | import android.widget.ListView; |
473 | import android.widget.SimpleAdapter; |
474 | -import android.widget.Toast; |
475 | |
476 | import org.openlp.android2.R; |
477 | |
478 | @@ -152,6 +151,11 @@ |
479 | hm4.put("icon", Integer.toString(R.drawable.ic_ondemand_video_black)); |
480 | aList.add(hm4); |
481 | |
482 | + HashMap<String, String> hm5 = new HashMap<String, String>(); |
483 | + hm5.put("title", getString(R.string.action_search)); |
484 | + hm5.put("icon", Integer.toString(R.drawable.ic_search_black)); |
485 | + aList.add(hm5); |
486 | + |
487 | // Keys used in Hashmap |
488 | String[] from = {"icon", "title"}; |
489 | |
490 | |
491 | === added file 'app/src/main/java/org/openlp/android2/fragments/SearchFragment.java' |
492 | --- app/src/main/java/org/openlp/android2/fragments/SearchFragment.java 1970-01-01 00:00:00 +0000 |
493 | +++ app/src/main/java/org/openlp/android2/fragments/SearchFragment.java 2016-01-10 19:34:28 +0000 |
494 | @@ -0,0 +1,283 @@ |
495 | +package org.openlp.android2.fragments; |
496 | + |
497 | +import android.app.DialogFragment; |
498 | +import android.app.Fragment; |
499 | +import android.content.Context; |
500 | +import android.os.Bundle; |
501 | +import android.util.Log; |
502 | +import android.view.KeyEvent; |
503 | +import android.view.LayoutInflater; |
504 | +import android.view.View; |
505 | +import android.view.ViewGroup; |
506 | +import android.view.inputmethod.EditorInfo; |
507 | +import android.view.inputmethod.InputMethodManager; |
508 | +import android.widget.AdapterView; |
509 | +import android.widget.ArrayAdapter; |
510 | +import android.widget.EditText; |
511 | +import android.widget.ListView; |
512 | +import android.widget.Spinner; |
513 | +import android.widget.TextView; |
514 | +import android.widget.Toast; |
515 | + |
516 | +import com.loopj.android.http.AsyncHttpClient; |
517 | +import com.loopj.android.http.TextHttpResponseHandler; |
518 | + |
519 | +import org.apache.http.Header; |
520 | +import org.json.JSONArray; |
521 | +import org.json.JSONException; |
522 | +import org.json.JSONObject; |
523 | +import org.openlp.android2.R; |
524 | +import org.openlp.android2.api.Api; |
525 | +import org.openlp.android2.common.JsonHelpers; |
526 | + |
527 | +import org.openlp.android2.common.OpenLPHttpClient; |
528 | +import org.openlp.android2.dialogs.SearchSelectionDialog; |
529 | + |
530 | +import java.util.ArrayList; |
531 | +import java.util.HashMap; |
532 | +import java.util.List; |
533 | +import java.util.Map; |
534 | + |
535 | +/** |
536 | + |
537 | + */ |
538 | +public class SearchFragment extends Fragment { |
539 | + |
540 | + private final String LOG_TAG = SearchFragment.class.getName(); |
541 | + private Spinner spinner; |
542 | + private static AsyncHttpClient client = new AsyncHttpClient(); |
543 | + public Context context; |
544 | + protected String calledURL; |
545 | + protected OpenLPHttpClient httpClient; |
546 | + protected String updateUrl; |
547 | + protected String searchedPlugin; |
548 | + protected Map<String, String> pluginMap = new HashMap<String, String>(); |
549 | + |
550 | + public SearchFragment() { |
551 | + Log.d(LOG_TAG, "Constructor"); |
552 | + } |
553 | + |
554 | + public static SearchFragment newInstance() { |
555 | + SearchFragment fragment = new SearchFragment(); |
556 | + return fragment; |
557 | + } |
558 | + |
559 | + @Override |
560 | + public void onCreate(Bundle savedInstanceState) { |
561 | + super.onCreate(savedInstanceState); |
562 | + } |
563 | + |
564 | + @Override |
565 | + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { |
566 | + context = getActivity(); |
567 | + updateUrl = Api.SEARCHABLE_PLUGINS; |
568 | + httpClient = new OpenLPHttpClient(context); |
569 | + View view = inflater.inflate(R.layout.fragment_search, container, false); |
570 | + spinner = (Spinner)view.findViewById(R.id.search_spinner); |
571 | + triggerTextRequest(Api.SEARCHABLE_PLUGINS); |
572 | + |
573 | + // Add search listener to text field |
574 | + EditText editText = (EditText)view.findViewById(R.id.search_text); |
575 | + editText.setOnEditorActionListener(new TextView.OnEditorActionListener() { |
576 | + @Override |
577 | + public boolean onEditorAction(TextView tv, int actionId, KeyEvent event) { |
578 | + if (actionId == EditorInfo.IME_ACTION_SEARCH) { |
579 | + // Now close the keyboard as finished with |
580 | + View view = getActivity().getCurrentFocus(); |
581 | + if (view != null) { |
582 | + InputMethodManager imm = |
583 | + (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); |
584 | + imm.hideSoftInputFromWindow(view.getWindowToken(), 0); |
585 | + } |
586 | + searchedPlugin = pluginMap.get(spinner.getSelectedItem().toString()); |
587 | + requestSearch(tv.getText().toString()); |
588 | + return true; |
589 | + } |
590 | + return false; |
591 | + } |
592 | + }); |
593 | + return view; |
594 | + } |
595 | + |
596 | + @Override |
597 | + public void onDetach() { |
598 | + super.onDetach(); |
599 | + } |
600 | + |
601 | + public void manageResponse(String response, boolean notInError) { |
602 | + if (calledURL.equals(updateUrl)) { |
603 | + populatePluginList(response, notInError); |
604 | + } else { |
605 | + populateListDisplay(response, notInError); |
606 | + } |
607 | + } |
608 | + |
609 | + private void populatePluginList(String response, Boolean notInError) { |
610 | + Log.i(LOG_TAG, "populatePluginList - entry"); |
611 | + List<String> categories = new ArrayList<String>(); |
612 | + pluginMap.clear(); |
613 | + |
614 | + if (notInError) { |
615 | + try { |
616 | + JSONArray items = new JSONObject(response).getJSONObject("results").getJSONArray("items"); |
617 | + for (int i = 0; i < items.length(); ++i) { |
618 | + JSONArray item = items.getJSONArray(i); |
619 | + categories.add(item.get(1).toString()); |
620 | + pluginMap.put(item.get(1).toString(),item.get(0).toString()); |
621 | + } |
622 | + } catch (JSONException e) { |
623 | + Log.e(LOG_TAG, response); |
624 | + e.printStackTrace(); |
625 | + } |
626 | + ArrayAdapter<String> LTRadapter = new ArrayAdapter<String>(getActivity(), |
627 | + R.layout.spinner_list_item, categories); |
628 | + LTRadapter.setDropDownViewResource(R.layout.spinner_dropdown_item); |
629 | + spinner.setAdapter(LTRadapter); |
630 | + Log.i(LOG_TAG, "populatePluginList - exit"); |
631 | + } |
632 | + } |
633 | + |
634 | + protected void triggerTextRequest(String url) { |
635 | + calledURL = url; |
636 | + Log.d(LOG_TAG, "Trigger Request for url " + url); |
637 | + String callurl = String.format("%s%s", httpClient.getAbsoluteUrl(client), url ); |
638 | + client.get(callurl, null, new TextHttpResponseHandler() { |
639 | + @Override |
640 | + public void onSuccess(int statusCode, Header[] headers, String responseString) { |
641 | + // called when response HTTP status is "200 OK" |
642 | + manageResponse(responseString, true); |
643 | + } |
644 | + |
645 | + @Override |
646 | + public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) { |
647 | + // called when response HTTP status is "4XX" (eg. 401, 403, 404) |
648 | + if (statusCode == 401) { |
649 | + Toast.makeText(context, R.string.httpreturn_unauthorised, Toast.LENGTH_LONG).show(); |
650 | + } else { |
651 | + Toast.makeText(context, R.string.unable, Toast.LENGTH_LONG).show(); |
652 | + } |
653 | + manageResponse(responseString, false); |
654 | + } |
655 | + }); |
656 | + } |
657 | + |
658 | + public void requestSearch(String text) { |
659 | + updateUrl = Api.SEARCH_PLUGIN_FORMATTED; |
660 | + try { |
661 | + String request = JsonHelpers.createRequestJSON("text", text); |
662 | + String url = String.format(Api.SEARCH_PLUGIN_FORMATTED, searchedPlugin); |
663 | + triggerTextRequest(String.format("%s%s", url, request)); |
664 | + Log.d(LOG_TAG, String.format("Search request. apiBase(%s), text(%s)", searchedPlugin, text)); |
665 | + } catch (JsonHelpers.JSONHandlerException e) { |
666 | + e.printStackTrace(); |
667 | + Toast.makeText(context, "Search Request Failed", Toast.LENGTH_SHORT).show(); |
668 | + } |
669 | + } |
670 | + |
671 | + public void populateListDisplay(String json, boolean notInError) { |
672 | + Log.i(LOG_TAG, "populateListDisplay - entry"); |
673 | + ListView list = (ListView)getActivity().findViewById(R.id.searchlistView); |
674 | + final ArrayList<JSONArray> listitems = new ArrayList<JSONArray>(); |
675 | + if (notInError) { |
676 | + try { |
677 | + JSONArray items = new JSONObject(json).getJSONObject("results").getJSONArray("items"); |
678 | + for (int i = 0; i < items.length(); ++i) { |
679 | + JSONArray item = items.getJSONArray(i); |
680 | + listitems.add(item); |
681 | + } |
682 | + } catch (JSONException e) { |
683 | + Log.e(LOG_TAG,json); |
684 | + e.printStackTrace(); |
685 | + } |
686 | + } |
687 | + |
688 | + final StableArrayAdapter adapter = new StableArrayAdapter(context, |
689 | + android.R.layout.simple_list_item_1, listitems); |
690 | + |
691 | + list.setAdapter(adapter); |
692 | + list.setOnItemClickListener(new AdapterView.OnItemClickListener() { |
693 | + |
694 | + @Override |
695 | + public void onItemClick(AdapterView<?> parent, final View view, |
696 | + int position, long id) { |
697 | + final JSONArray item = (JSONArray) parent.getItemAtPosition(position); |
698 | + //Toast.makeText(context, "Item Pressed " + String.valueOf(position) + item, |
699 | + // Toast.LENGTH_SHORT).show(); |
700 | + String it = ""; |
701 | + try { |
702 | + it = (String)item.get(1); |
703 | + } catch (JSONException e) { |
704 | + e.printStackTrace(); |
705 | + } |
706 | + Bundle args = new Bundle(); |
707 | + args.putString("plugin", searchedPlugin); |
708 | + args.putString("text", it); |
709 | + args.putString("key", Long.toString(id)); |
710 | + DialogFragment newFragment = new SearchSelectionDialog(); |
711 | + newFragment.setArguments(args); |
712 | + newFragment.show(getFragmentManager(), "TAG"); |
713 | + |
714 | + } |
715 | + }); |
716 | + Log.i(LOG_TAG, "populateListDisplay - exit"); |
717 | + } |
718 | + |
719 | + private class StableArrayAdapter extends ArrayAdapter<JSONArray> { |
720 | + |
721 | + HashMap<String, Integer> mIdMap = new HashMap<String, Integer>(); |
722 | + |
723 | + public StableArrayAdapter(Context context, int textViewResourceId, |
724 | + List<JSONArray> objects) { |
725 | + super(context, textViewResourceId, objects); |
726 | + for (int i = 0; i < objects.size(); ++i) { |
727 | + JSONArray item = objects.get(i); |
728 | + try { |
729 | + mIdMap.put(item.get(1).toString(), Integer.valueOf(item.get(0).toString())); |
730 | + } catch (JSONException e) { |
731 | + e.printStackTrace(); |
732 | + } |
733 | + } |
734 | + } |
735 | + |
736 | + @Override |
737 | + public View getView(int position, View convertView, ViewGroup parent) { |
738 | + // Get the data item for this position |
739 | + //User user = getItem(position); |
740 | + String item = null; |
741 | + try { |
742 | + item = getItem(position).get(1).toString(); |
743 | + } catch (JSONException e) { |
744 | + e.printStackTrace(); |
745 | + } |
746 | + // Check if an existing view is being reused, otherwise inflate the view |
747 | + if (convertView == null) { |
748 | + convertView = LayoutInflater.from(getContext()).inflate(R.layout.search_result_row, |
749 | + parent, false); |
750 | + } |
751 | + // Lookup view for data population |
752 | + TextView tvItem = (TextView) convertView.findViewById(R.id.searchListRow); |
753 | + // Populate the data into the template view using the data object |
754 | + tvItem.setText(item); |
755 | + // Return the completed view to render on screen |
756 | + return convertView; |
757 | + } |
758 | + |
759 | + @Override |
760 | + public long getItemId(int position) { |
761 | + String item = null; |
762 | + try { |
763 | + item = getItem(position).get(1).toString(); |
764 | + } catch (JSONException e) { |
765 | + e.printStackTrace(); |
766 | + } |
767 | + return mIdMap.get(item); |
768 | + } |
769 | + |
770 | + @Override |
771 | + public boolean hasStableIds() { |
772 | + return true; |
773 | + } |
774 | + |
775 | + } |
776 | + |
777 | +} |
778 | |
779 | === added file 'app/src/main/res/drawable-hdpi/ic_search_black.png' |
780 | Binary files app/src/main/res/drawable-hdpi/ic_search_black.png 1970-01-01 00:00:00 +0000 and app/src/main/res/drawable-hdpi/ic_search_black.png 2016-01-10 19:34:28 +0000 differ |
781 | === added file 'app/src/main/res/drawable-mdpi/ic_search_black.png' |
782 | Binary files app/src/main/res/drawable-mdpi/ic_search_black.png 1970-01-01 00:00:00 +0000 and app/src/main/res/drawable-mdpi/ic_search_black.png 2016-01-10 19:34:28 +0000 differ |
783 | === added file 'app/src/main/res/drawable-xhdpi/ic_search_black.png' |
784 | Binary files app/src/main/res/drawable-xhdpi/ic_search_black.png 1970-01-01 00:00:00 +0000 and app/src/main/res/drawable-xhdpi/ic_search_black.png 2016-01-10 19:34:28 +0000 differ |
785 | === added file 'app/src/main/res/drawable-xxhdpi/ic_search_black.png' |
786 | Binary files app/src/main/res/drawable-xxhdpi/ic_search_black.png 1970-01-01 00:00:00 +0000 and app/src/main/res/drawable-xxhdpi/ic_search_black.png 2016-01-10 19:34:28 +0000 differ |
787 | === added file 'app/src/main/res/layout/fragment_search.xml' |
788 | --- app/src/main/res/layout/fragment_search.xml 1970-01-01 00:00:00 +0000 |
789 | +++ app/src/main/res/layout/fragment_search.xml 2016-01-10 19:34:28 +0000 |
790 | @@ -0,0 +1,90 @@ |
791 | +<?xml version="1.0" encoding="utf-8"?> |
792 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
793 | + android:orientation="vertical" android:layout_width="match_parent" |
794 | + android:layout_height="match_parent" |
795 | + android:paddingLeft="15dp" |
796 | + android:paddingTop="15dp" |
797 | + android:paddingRight="15dp" |
798 | + > |
799 | + |
800 | + <LinearLayout |
801 | + android:orientation="vertical" |
802 | + android:layout_width="match_parent" |
803 | + android:layout_height="wrap_content"> |
804 | + |
805 | + <LinearLayout |
806 | + android:orientation="horizontal" |
807 | + android:layout_width="match_parent" |
808 | + android:layout_height="match_parent"> |
809 | + |
810 | + <TextView |
811 | + android:layout_width="wrap_content" |
812 | + android:layout_height="wrap_content" |
813 | + android:text="Select Plugin" |
814 | + android:id="@+id/search_title" |
815 | + android:textAppearance="?android:attr/textAppearanceLarge" |
816 | + android:textSize="40px" |
817 | + android:height="70px" |
818 | + android:paddingLeft="30dp" |
819 | + android:paddingRight="30dp"/> |
820 | + |
821 | + <Spinner |
822 | + android:layout_width="0dp" |
823 | + android:layout_height="wrap_content" |
824 | + android:id="@+id/search_spinner" |
825 | + android:layout_weight="0.4" |
826 | + android:textAppearance="?android:attr/textAppearanceLarge"/> |
827 | + |
828 | + </LinearLayout> |
829 | + |
830 | + <LinearLayout |
831 | + android:orientation="horizontal" |
832 | + android:layout_width="match_parent" |
833 | + android:layout_height="match_parent"> |
834 | + |
835 | + <TextView |
836 | + android:layout_width="wrap_content" |
837 | + android:layout_height="wrap_content" |
838 | + android:textAppearance="?android:attr/textAppearanceLarge" |
839 | + android:text="Search Text" |
840 | + android:textSize="40px" |
841 | + android:height="70px" |
842 | + android:id="@+id/search_value_desc" |
843 | + android:paddingLeft="30dp" |
844 | + android:paddingRight="30dp"/> |
845 | + |
846 | + <EditText |
847 | + android:imeOptions="actionSearch" |
848 | + android:layout_width="wrap_content" |
849 | + android:layout_height="wrap_content" |
850 | + android:id="@+id/search_text" |
851 | + style="@android:style/Animation.InputMethod" |
852 | + android:layout_weight="0.87" |
853 | + android:inputType="text" |
854 | + android:textSize="40px" |
855 | + android:height="70px" |
856 | + /> |
857 | + </LinearLayout> |
858 | + |
859 | + <LinearLayout |
860 | + android:orientation="horizontal" |
861 | + android:layout_width="match_parent" |
862 | + android:layout_height="match_parent" |
863 | + android:weightSum="1"> |
864 | + |
865 | + <ListView |
866 | + android:layout_width="match_parent" |
867 | + android:layout_height="fill_parent" |
868 | + android:id="@+id/searchlistView" |
869 | + android:textAppearance="?android:attr/textAppearanceLarge" |
870 | + android:paddingLeft="30dp" |
871 | + android:paddingRight="30dp" |
872 | + android:layout_marginTop="20dp" |
873 | + android:layout_marginBottom="20dp" |
874 | + android:textSize="40px" |
875 | + android:height="70px" |
876 | + android:layout_weight="1"/> |
877 | + </LinearLayout> |
878 | + </LinearLayout> |
879 | + |
880 | +</LinearLayout> |
881 | \ No newline at end of file |
882 | |
883 | === added file 'app/src/main/res/layout/search_action_dialog.xml' |
884 | --- app/src/main/res/layout/search_action_dialog.xml 1970-01-01 00:00:00 +0000 |
885 | +++ app/src/main/res/layout/search_action_dialog.xml 2016-01-10 19:34:28 +0000 |
886 | @@ -0,0 +1,40 @@ |
887 | +<?xml version="1.0" encoding="utf-8"?> |
888 | + |
889 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
890 | + |
891 | + android:orientation="vertical" |
892 | + android:layout_width="fill_parent" |
893 | + android:layout_height="fill_parent" |
894 | + android:weightSum="1"> |
895 | + <TextView |
896 | + android:layout_width="315dp" |
897 | + android:layout_height="wrap_content" |
898 | + android:textAppearance="?android:attr/textAppearanceMedium" |
899 | + android:text="@string/searchResults" |
900 | + android:id="@+id/textView" |
901 | + android:textStyle="bold|italic" |
902 | + android:textSize="40px" |
903 | + android:height="70px" |
904 | + android:layout_marginTop="10dp" |
905 | + android:layout_marginBottom="10dp"/> |
906 | + <RadioButton |
907 | + android:layout_width="match_parent" |
908 | + android:layout_height="wrap_content" |
909 | + android:text="@string/searchSendLive" |
910 | + android:id="@+id/buttonLive" |
911 | + android:textSize="20sp" |
912 | + android:height="30dp" |
913 | + android:clickable="true" |
914 | + android:layout_marginTop="20dp" |
915 | + android:layout_marginBottom="20dp"/> |
916 | + <RadioButton |
917 | + android:layout_width="match_parent" |
918 | + android:layout_height="wrap_content" |
919 | + android:text="@string/searchAddToService" |
920 | + android:id="@+id/buttonService" |
921 | + android:textSize="20sp" |
922 | + android:height="40dp" |
923 | + android:clickable="true" |
924 | + android:layout_marginTop="20dp" |
925 | + android:layout_marginBottom="20dp"/> |
926 | +</LinearLayout> |
927 | \ No newline at end of file |
928 | |
929 | === added file 'app/src/main/res/layout/search_result.xml' |
930 | --- app/src/main/res/layout/search_result.xml 1970-01-01 00:00:00 +0000 |
931 | +++ app/src/main/res/layout/search_result.xml 2016-01-10 19:34:28 +0000 |
932 | @@ -0,0 +1,11 @@ |
933 | +<?xml version="1.0" encoding="utf-8"?> |
934 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
935 | + android:orientation="vertical" android:layout_width="match_parent" |
936 | + android:layout_height="match_parent"> |
937 | + <TextView |
938 | + android:id="@+id/serachitem" |
939 | + android:layout_width="wrap_content" |
940 | + android:layout_height="wrap_content" |
941 | + android:text="Name" /> |
942 | + |
943 | +</LinearLayout> |
944 | \ No newline at end of file |
945 | |
946 | === added file 'app/src/main/res/layout/search_result_row.xml' |
947 | --- app/src/main/res/layout/search_result_row.xml 1970-01-01 00:00:00 +0000 |
948 | +++ app/src/main/res/layout/search_result_row.xml 2016-01-10 19:34:28 +0000 |
949 | @@ -0,0 +1,18 @@ |
950 | +<?xml version="1.0" encoding="utf-8"?> |
951 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
952 | + android:layout_width="match_parent" |
953 | + android:layout_height="match_parent" |
954 | + android:orientation="vertical" > |
955 | + |
956 | + <TextView android:layout_width="wrap_content" |
957 | + android:layout_height="wrap_content" |
958 | + android:textStyle="bold" |
959 | + android:textColor="#000000" |
960 | + android:textSize="40sp" |
961 | + android:paddingTop="10dp" |
962 | + android:paddingRight="5dp" |
963 | + android:paddingLeft="5dp" |
964 | + android:paddingEnd="5dp" |
965 | + android:paddingBottom="10dp" |
966 | + android:id="@+id/searchListRow"/> |
967 | +</LinearLayout> |
968 | \ No newline at end of file |
969 | |
970 | === added file 'app/src/main/res/layout/spinner_dropdown_item.xml' |
971 | --- app/src/main/res/layout/spinner_dropdown_item.xml 1970-01-01 00:00:00 +0000 |
972 | +++ app/src/main/res/layout/spinner_dropdown_item.xml 2016-01-10 19:34:28 +0000 |
973 | @@ -0,0 +1,11 @@ |
974 | +<?xml version="1.0" encoding="utf-8"?> |
975 | +<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android" |
976 | + android:id="@android:id/text1" |
977 | + style="?android:attr/spinnerDropDownItemStyle" |
978 | + android:singleLine="true" |
979 | + android:layout_width="match_parent" |
980 | + android:layout_height="?android:attr/listPreferredItemHeight" |
981 | + android:ellipsize="marquee" |
982 | + android:textColor="#000" |
983 | + android:textStyle="bold|italic" |
984 | + android:textAppearance="?android:attr/textAppearanceLarge"/> |
985 | \ No newline at end of file |
986 | |
987 | === added file 'app/src/main/res/layout/spinner_list_item.xml' |
988 | --- app/src/main/res/layout/spinner_list_item.xml 1970-01-01 00:00:00 +0000 |
989 | +++ app/src/main/res/layout/spinner_list_item.xml 2016-01-10 19:34:28 +0000 |
990 | @@ -0,0 +1,11 @@ |
991 | +<?xml version="1.0" encoding="utf-8"?> |
992 | +<TextView xmlns:android="http://schemas.android.com/apk/res/android" |
993 | + android:id="@android:id/text1" |
994 | + style="?android:attr/spinnerItemStyle" |
995 | + android:singleLine="true" |
996 | + android:layout_width="match_parent" |
997 | + android:layout_height="wrap_content" |
998 | + android:textColor="#000" |
999 | + android:textAppearance="?android:attr/textAppearanceLarge" |
1000 | + android:ellipsize="marquee" |
1001 | + android:textStyle="bold|italic" /> |
1002 | \ No newline at end of file |
1003 | |
1004 | === modified file 'app/src/main/res/values/strings.xml' |
1005 | --- app/src/main/res/values/strings.xml 2015-10-08 15:30:54 +0000 |
1006 | +++ app/src/main/res/values/strings.xml 2016-01-10 19:34:28 +0000 |
1007 | @@ -29,14 +29,14 @@ |
1008 | <string name="display_blank_summary">Select the required display</string> |
1009 | <string name="display_desktop">Display Desktop background</string> |
1010 | <string name="display_list_autoscroll">Allow the selected item to scroll to the centre of the list</string> |
1011 | - <string name="display_reset">Show Live display</string> |
1012 | + <string name="display_reset">Live display</string> |
1013 | <string name="display_settings">Display Setting</string> |
1014 | <string name="display_screen">Display Black only</string> |
1015 | <string name="display_theme">Display Theme only</string> |
1016 | <string name="enable_custom_timeouts">Enable Custom Timeouts</string> |
1017 | <string name="enter_alert_text">Enter Alert Text</string> |
1018 | <string name="enable_autoscroll">Allow displays to auto center</string> |
1019 | - <string name="home">Home</string> |
1020 | + <string name="home">Home</string> |
1021 | <string name="httpreturn_unauthorised">Unauthorised Access, please enter valid username and password</string> |
1022 | <string name="live_list">Live List</string> |
1023 | <string name="live_view">Live View</string> |
1024 | @@ -48,6 +48,10 @@ |
1025 | <string name="previous">Previous</string> |
1026 | <string name="process">Process</string> |
1027 | <string name="service_list">Service List</string> |
1028 | + <string name="searchResults">Search Results</string> |
1029 | + <string name="searchSendLive">Send Live</string> |
1030 | + <string name="searchAddToService">Add to Service</string> |
1031 | + <string name="showingResults">Showing Results for \'%s\'</string> |
1032 | <string name="stage_view">Stage View</string> |
1033 | <string name="text_size">Select display text size</string> |
1034 | <string name="text_size_summary">Change the Service text size</string> |