openlp-android team mailing list archive
-
openlp-android team
-
Mailing list archive
-
Message #00101
[Merge] lp:~johanmynhardt/openlp/android into lp:openlp/android
Johan Mynhardt has proposed merging lp:~johanmynhardt/openlp/android into lp:openlp/android.
Requested reviews:
OpenLP Android Developers (openlp-android)
For more details, see:
https://code.launchpad.net/~johanmynhardt/openlp/android/+merge/95729
Rafactored code and cleanup.
- Service and Live use the same layout
- Use styles to apply improved theming
- Icon resources"
--
https://code.launchpad.net/~johanmynhardt/openlp/android/+merge/95729
Your team OpenLP Android Developers is requested to review the proposed merge of lp:~johanmynhardt/openlp/android into lp:openlp/android.
=== modified file 'AndroidManifest.xml'
--- AndroidManifest.xml 2012-02-06 19:24:57 +0000
+++ AndroidManifest.xml 2012-03-03 11:26:17 +0000
@@ -11,7 +11,7 @@
<application
android:icon="@drawable/openlp_logo"
- android:label="@string/app_name">
+ android:label="@string/app_name" android:theme="@style/OpenLPStyle">
<activity
android:name=".OpenLP"
android:label="@string/app_name">
@@ -41,4 +41,4 @@
android:name="android.app.default_searchable"
android:value=".activity.SearchableActivity"/>
</application>
-</manifest>
\ No newline at end of file
+</manifest>
=== added file 'res/drawable-hdpi/general_zoom_in.png'
Binary files res/drawable-hdpi/general_zoom_in.png 1970-01-01 00:00:00 +0000 and res/drawable-hdpi/general_zoom_in.png 2012-03-03 11:26:17 +0000 differ
=== added file 'res/drawable-hdpi/openlp_logo_android.png'
Binary files res/drawable-hdpi/openlp_logo_android.png 1970-01-01 00:00:00 +0000 and res/drawable-hdpi/openlp_logo_android.png 2012-03-03 11:26:17 +0000 differ
=== added file 'res/drawable-hdpi/openlp_logo_android_source.svg'
--- res/drawable-hdpi/openlp_logo_android_source.svg 1970-01-01 00:00:00 +0000
+++ res/drawable-hdpi/openlp_logo_android_source.svg 2012-03-03 11:26:17 +0000
@@ -0,0 +1,368 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="467.39001"
+ height="700"
+ id="svg5740"
+ sodipodi:version="0.32"
+ inkscape:version="0.48.2 r9819"
+ version="1.0"
+ sodipodi:docname="openlp_logo_android_source.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape"
+ inkscape:export-filename="/home/johan/workspace/openlp-android-working/res/drawable-hdpi/openlp_logo_android.png"
+ inkscape:export-xdpi="91.860847"
+ inkscape:export-ydpi="91.860847"
+ style="display:inline">
+ <defs
+ id="defs5742">
+ <linearGradient
+ id="linearGradient3208">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.25098041;"
+ offset="0"
+ id="stop3210" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0;"
+ offset="1"
+ id="stop3212" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient3195">
+ <stop
+ style="stop-color:#cdcdff;stop-opacity:1;"
+ offset="0"
+ id="stop3197" />
+ <stop
+ style="stop-color:#ebebff;stop-opacity:1;"
+ offset="1"
+ id="stop3199" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient6359">
+ <stop
+ style="stop-color:#000d26;stop-opacity:1;"
+ offset="0"
+ id="stop6361" />
+ <stop
+ style="stop-color:#507fda;stop-opacity:1;"
+ offset="1"
+ id="stop6363" />
+ </linearGradient>
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective5748" />
+ <filter
+ inkscape:collect="always"
+ id="filter6926"
+ color-interpolation-filters="sRGB">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="3.5771872"
+ id="feGaussianBlur6928" />
+ </filter>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3208"
+ id="linearGradient3214"
+ x1="470.25891"
+ y1="276.68851"
+ x2="463.2301"
+ y2="14.822601"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3208"
+ id="linearGradient3229"
+ gradientUnits="userSpaceOnUse"
+ x1="470.25891"
+ y1="276.68851"
+ x2="463.2301"
+ y2="14.822601" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3208"
+ id="linearGradient3279"
+ gradientUnits="userSpaceOnUse"
+ x1="470.25891"
+ y1="276.68851"
+ x2="463.2301"
+ y2="14.822601" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3208"
+ id="linearGradient3287"
+ gradientUnits="userSpaceOnUse"
+ x1="470.25891"
+ y1="276.68851"
+ x2="463.2301"
+ y2="14.822601"
+ gradientTransform="matrix(1.1122448,0,0,1.2037738,-57.29825,4.8849318)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3195"
+ id="linearGradient3196"
+ gradientUnits="userSpaceOnUse"
+ x1="117.59262"
+ y1="384.05795"
+ x2="418.20981"
+ y2="436.03787" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient6359"
+ id="linearGradient3198"
+ gradientUnits="userSpaceOnUse"
+ x1="815.75"
+ y1="480.55844"
+ x2="201.10622"
+ y2="371.85938" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3208"
+ id="linearGradient3200"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.1122448,0,0,1.2037738,-57.29825,4.8849318)"
+ x1="470.25891"
+ y1="276.68851"
+ x2="469.44925"
+ y2="104.30029" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3195"
+ id="linearGradient3215"
+ gradientUnits="userSpaceOnUse"
+ x1="117.59262"
+ y1="384.05795"
+ x2="418.20981"
+ y2="436.03787" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient6359"
+ id="linearGradient3217"
+ gradientUnits="userSpaceOnUse"
+ x1="815.75"
+ y1="480.55844"
+ x2="201.10622"
+ y2="371.85938" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3208"
+ id="linearGradient3219"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.1122448,0,0,1.2037738,-57.29825,4.8849318)"
+ x1="470.25891"
+ y1="276.68851"
+ x2="469.44925"
+ y2="104.30029" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3208"
+ id="linearGradient4010"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.7247086,0,0,0.7843464,-109.42065,-2.1325924)"
+ x1="470.25891"
+ y1="276.68851"
+ x2="469.44925"
+ y2="104.30029" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient6359"
+ id="linearGradient4013"
+ gradientUnits="userSpaceOnUse"
+ x1="815.75"
+ y1="480.55844"
+ x2="201.10622"
+ y2="371.85938"
+ gradientTransform="matrix(0.6515729,0,0,0.6515729,-72.086668,-5.3154816)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3195"
+ id="linearGradient4047"
+ gradientUnits="userSpaceOnUse"
+ x1="117.59262"
+ y1="384.05795"
+ x2="418.20981"
+ y2="436.03787" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient6359"
+ id="linearGradient4049"
+ gradientUnits="userSpaceOnUse"
+ x1="815.75"
+ y1="480.55844"
+ x2="201.10622"
+ y2="371.85938" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3208"
+ id="linearGradient4051"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.1122448,0,0,1.2037738,-57.29825,4.8849318)"
+ x1="470.25891"
+ y1="276.68851"
+ x2="469.44925"
+ y2="104.30029" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3195"
+ id="linearGradient4053"
+ gradientUnits="userSpaceOnUse"
+ x1="117.59262"
+ y1="384.05795"
+ x2="418.20981"
+ y2="436.03787" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient6359"
+ id="linearGradient4055"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.6515729,0,0,0.6515729,-72.086668,-5.3154816)"
+ x1="815.75"
+ y1="480.55844"
+ x2="201.10622"
+ y2="371.85938" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3208"
+ id="linearGradient4057"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.7247086,0,0,0.7843464,-109.42065,-2.1325924)"
+ x1="470.25891"
+ y1="276.68851"
+ x2="469.44925"
+ y2="104.30029" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.35778482"
+ inkscape:cx="-323.52954"
+ inkscape:cy="632.67267"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer6"
+ showgrid="false"
+ inkscape:window-width="1600"
+ inkscape:window-height="846"
+ inkscape:window-x="0"
+ inkscape:window-y="26"
+ inkscape:window-maximized="1" />
+ <metadata
+ id="metadata5745">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Shadow"
+ inkscape:groupmode="layer"
+ id="layer1"
+ style="display:inline"
+ transform="translate(-11.872025,219.43636)" />
+ <g
+ inkscape:groupmode="layer"
+ id="layer5"
+ inkscape:label="Border"
+ style="display:inline"
+ transform="translate(-11.872025,219.43636)" />
+ <g
+ inkscape:groupmode="layer"
+ id="layer3"
+ inkscape:label="Rays Background"
+ style="display:inline"
+ transform="translate(-11.872025,219.43636)" />
+ <g
+ inkscape:groupmode="layer"
+ id="layer2"
+ inkscape:label="Rays Foreground"
+ style="display:inline"
+ transform="translate(-11.872025,219.43636)" />
+ <g
+ inkscape:groupmode="layer"
+ id="layer6"
+ inkscape:label="Reflection"
+ style="display:inline"
+ transform="translate(-11.872025,219.43636)">
+ <g
+ id="g4018"
+ transform="matrix(2.0943295,0,0,2.0943295,-464.64725,-273.21634)"
+ style="opacity:0.7">
+ <path
+ inkscape:export-ydpi="90"
+ inkscape:export-xdpi="90"
+ inkscape:export-filename="/home/raoul/openlp-logo-0.2.png"
+ transform="matrix(0.6379835,0,0,0.6379835,-67.554612,-15.189295)"
+ d="m 833.03006,395.26932 c 0,197.56259 -160.15613,357.71872 -357.71872,357.71872 -197.56259,0 -357.71872,-160.15613 -357.71872,-357.71872 0,-197.5626 160.15613,-357.718722 357.71872,-357.718722 197.56259,0 357.71872,160.156122 357.71872,357.718722 z"
+ sodipodi:ry="357.71872"
+ sodipodi:rx="357.71872"
+ sodipodi:cy="395.26932"
+ sodipodi:cx="475.31134"
+ id="path6903"
+ style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline;filter:url(#filter6926)"
+ sodipodi:type="arc" />
+ <path
+ inkscape:export-ydpi="90"
+ inkscape:export-xdpi="90"
+ inkscape:export-filename="/home/raoul/openlp-logo-0.2.png"
+ sodipodi:type="arc"
+ style="fill:#051e52;fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
+ id="path6900"
+ sodipodi:cx="475.31134"
+ sodipodi:cy="395.26932"
+ sodipodi:rx="357.71872"
+ sodipodi:ry="357.71872"
+ d="m 833.03006,395.26932 c 0,197.56259 -160.15613,357.71872 -357.71872,357.71872 -197.56259,0 -357.71872,-160.15613 -357.71872,-357.71872 0,-197.5626 160.15613,-357.718722 357.71872,-357.718722 197.56259,0 357.71872,160.156122 357.71872,357.718722 z"
+ transform="matrix(0.6379835,0,0,0.6379835,-67.554612,-15.189295)" />
+ <path
+ inkscape:export-ydpi="90"
+ inkscape:export-xdpi="90"
+ inkscape:export-filename="/home/raoul/openlp-logo-0.2.png"
+ transform="matrix(0.6317287,0,0,0.6317287,-64.581662,-12.716988)"
+ d="m 833.03006,395.26932 c 0,197.56259 -160.15613,357.71872 -357.71872,357.71872 -197.56259,0 -357.71872,-160.15613 -357.71872,-357.71872 0,-197.5626 160.15613,-357.718722 357.71872,-357.718722 197.56259,0 357.71872,160.156122 357.71872,357.718722 z"
+ sodipodi:ry="357.71872"
+ sodipodi:rx="357.71872"
+ sodipodi:cy="395.26932"
+ sodipodi:cx="475.31134"
+ id="path6317"
+ style="fill:url(#linearGradient4053);fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
+ sodipodi:type="arc" />
+ <path
+ inkscape:export-ydpi="90"
+ inkscape:export-xdpi="90"
+ inkscape:export-filename="/home/raoul/openlp-logo-0.2.png"
+ id="path6327"
+ d="m 235.67972,13.233984 c -35.92776,0 -69.88078,8.488655 -99.97572,23.558433 L 296.72396,165.96674 452.81639,291.19091 c 4.32451,-17.35817 6.61754,-35.51197 6.61754,-54.20272 0,-123.50655 -100.24766,-223.754205 -223.75421,-223.754206 z M 79.118968,77.210299 C 71.146114,85.023824 63.764822,93.431949 57.026574,102.35694 L 274.63156,209.66285 434.20584,288.36064 275.3035,193.86221 79.118968,77.210299 z M 24.488653,162.95322 c -3.62786,10.33827 -6.504275,21.02069 -8.592618,31.98816 L 260.17479,255.29332 422.98657,295.52794 260.21551,241.36595 24.488653,162.95322 z M 13.513722,263.49906 c 1.305042,11.03747 3.397359,21.8274 6.251027,32.31395 l 228.539191,6.51573 173.46093,4.96824 L 253.55725,289.23619 13.513722,263.49906 z M 428.50457,317.76287 249.79034,336.84174 47.782384,358.40473 c 5.959201,9.19899 12.564704,17.94104 19.771165,26.14436 L 244.45559,351.80755 428.50457,317.76287 z m 13.78484,5.21258 -188.36565,62.18449 -133.00232,43.89972 c 33.5632,20.10936 72.81152,31.66237 114.75828,31.66238 93.04288,0 172.8858,-56.87905 206.60969,-137.74659 z"
+ style="fill:url(#linearGradient4055);fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
+ inkscape:connector-curvature="0" />
+ <path
+ id="path3203"
+ d="m 235.67972,13.233984 c -35.92776,0 -69.88078,8.488655 -99.97572,23.558433 l 161.01996,129.174323 52.55342,42.16899 c 39.1477,-4.87501 74.57645,-12.22557 104.45528,-21.44082 C 430.89209,87.375898 341.89666,13.233985 235.67972,13.233984 z M 79.118968,77.210299 c -7.972854,7.813525 -15.354146,16.22165 -22.092394,25.146641 l 217.604986,107.30591 8.32792,4.11306 c 7.91353,-0.38016 15.72478,-0.85776 23.43626,-1.42532 L 275.3035,193.86221 79.118968,77.210299 z M 24.488653,162.95322 c -2.661786,7.58527 -4.921793,15.36128 -6.760069,23.29373 42.624133,13.3171 96.712956,22.78306 156.947626,26.67377 L 24.488653,162.95322 z"
+ style="fill:url(#linearGradient4057);fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
+ inkscape:connector-curvature="0" />
+ </g>
+ </g>
+</svg>
=== added file 'res/drawable-hdpi/openlp_splash_screen.png'
Binary files res/drawable-hdpi/openlp_splash_screen.png 1970-01-01 00:00:00 +0000 and res/drawable-hdpi/openlp_splash_screen.png 2012-03-03 11:26:17 +0000 differ
=== added file 'res/drawable-hdpi/plugin_alerts.png'
Binary files res/drawable-hdpi/plugin_alerts.png 1970-01-01 00:00:00 +0000 and res/drawable-hdpi/plugin_alerts.png 2012-03-03 11:26:17 +0000 differ
=== added file 'res/drawable-hdpi/plugin_bibles.png'
Binary files res/drawable-hdpi/plugin_bibles.png 1970-01-01 00:00:00 +0000 and res/drawable-hdpi/plugin_bibles.png 2012-03-03 11:26:17 +0000 differ
=== added file 'res/drawable-hdpi/slide_blank.png'
Binary files res/drawable-hdpi/slide_blank.png 1970-01-01 00:00:00 +0000 and res/drawable-hdpi/slide_blank.png 2012-03-03 11:26:17 +0000 differ
=== added file 'res/drawable-hdpi/slide_next.png'
Binary files res/drawable-hdpi/slide_next.png 1970-01-01 00:00:00 +0000 and res/drawable-hdpi/slide_next.png 2012-03-03 11:26:17 +0000 differ
=== added file 'res/drawable-hdpi/slide_previous.png'
Binary files res/drawable-hdpi/slide_previous.png 1970-01-01 00:00:00 +0000 and res/drawable-hdpi/slide_previous.png 2012-03-03 11:26:17 +0000 differ
=== added file 'res/drawable-hdpi/song_author_edit.png'
Binary files res/drawable-hdpi/song_author_edit.png 1970-01-01 00:00:00 +0000 and res/drawable-hdpi/song_author_edit.png 2012-03-03 11:26:17 +0000 differ
=== added file 'res/drawable-hdpi/system_live.png'
Binary files res/drawable-hdpi/system_live.png 1970-01-01 00:00:00 +0000 and res/drawable-hdpi/system_live.png 2012-03-03 11:26:17 +0000 differ
=== added file 'res/drawable-hdpi/tab_background.png'
Binary files res/drawable-hdpi/tab_background.png 1970-01-01 00:00:00 +0000 and res/drawable-hdpi/tab_background.png 2012-03-03 11:26:17 +0000 differ
=== added file 'res/drawable-hdpi/tab_bottom.png'
Binary files res/drawable-hdpi/tab_bottom.png 1970-01-01 00:00:00 +0000 and res/drawable-hdpi/tab_bottom.png 2012-03-03 11:26:17 +0000 differ
=== added file 'res/drawable-hdpi/tab_top.png'
Binary files res/drawable-hdpi/tab_top.png 1970-01-01 00:00:00 +0000 and res/drawable-hdpi/tab_top.png 2012-03-03 11:26:17 +0000 differ
=== modified file 'res/layout/alert.xml'
--- res/layout/alert.xml 2012-01-09 18:30:00 +0000
+++ res/layout/alert.xml 2012-03-03 11:26:17 +0000
@@ -7,7 +7,16 @@
<TextView
android:text="@string/alert"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"/>
+ android:layout_height="wrap_content"
+ android:textStyle="bold"
+ android:textSize="10pt"
+ />
+ <View style="@style/SlideServiceViewHorizontalRule"
+ />
+ <View style="@style/SlideServiceViewHorizontalRule"
+ android:background="@android:color/transparent"
+ android:layout_height="5dip"
+ />
<EditText
android:id="@+id/alert"
android:layout_height="wrap_content"
@@ -15,8 +24,9 @@
android:inputType="textShortMessage"
android:layout_width="fill_parent"
android:hint="@string/alertHint"/>
- <Button android:text="@string/send"
+ <Button
android:id="@+id/send"
+ android:text="@string/send"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
=== modified file 'res/layout/main.xml'
--- res/layout/main.xml 2012-02-06 19:24:57 +0000
+++ res/layout/main.xml 2012-03-03 11:26:17 +0000
@@ -1,27 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
-<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@android:id/tabhost"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
- <LinearLayout
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:padding="0dp">
-
- <TabWidget
- android:id="@android:id/tabs"
- android:layout_width="fill_parent"
- android:layout_height="45dp"
- android:textColor="#000000"
- android:textSize="18dp"
- android:textStyle="bold"/>
-
- <FrameLayout
- android:id="@android:id/tabcontent"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:padding="0dp"/>
- </LinearLayout>
-</TabHost>
-
+<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:gravity="fill"
+ android:orientation="horizontal"
+ android:layout_weight="0"
+ >
+ <TableRow
+ android:layout_weight="1"
+ android:layout_gravity="fill">
+ <ImageView
+ android:padding="20pt"
+ android:layout_span="2"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="fill"
+ android:layout_weight="1"
+ android:src="@drawable/openlp_splash_screen"
+ android:contentDescription="@string/contentDescription"
+ />
+
+ </TableRow>
+ <TableRow
+ android:layout_weight="0"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content">
+ <Button
+ android:id="@+id/buttonService"
+ android:text="@string/tabService"
+ style="@style/ButtonStyle"
+ android:drawableLeft="@drawable/plugin_bibles"
+ />
+ <Button
+ android:id="@+id/buttonLive"
+ android:text="@string/tabLive"
+ style="@style/ButtonStyle"
+ android:drawableLeft="@drawable/system_live"
+ />
+ </TableRow>
+ <TableRow
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content">
+ <Button
+ android:id="@+id/buttonDisplay"
+ android:text="@string/tabDisplay"
+ style="@style/ButtonStyle"
+ android:drawableLeft="@drawable/slide_blank"
+ />
+ <Button
+ android:id="@+id/buttonStage"
+ android:text="@string/tabStage"
+ style="@style/ButtonStyle"
+ android:drawableLeft="@drawable/song_author_edit"
+ />
+ </TableRow>
+ <TableRow
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content">
+ <Button
+ android:id="@+id/buttonAlert"
+ android:text="@string/tabAlert"
+ style="@style/ButtonStyle"
+ android:drawableLeft="@drawable/plugin_alerts"
+ />
+ <Button
+ android:id="@+id/buttonSearch"
+ android:text="@string/buttonSearchText"
+ style="@style/ButtonStyle"
+ android:drawableLeft="@drawable/general_zoom_in"
+ />
+ </TableRow>
+</TableLayout>
=== modified file 'res/layout/misc.xml'
--- res/layout/misc.xml 2012-01-18 21:09:51 +0000
+++ res/layout/misc.xml 2012-03-03 11:26:17 +0000
@@ -4,6 +4,19 @@
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
+ <TextView
+ android:text="@string/tabDisplay"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textStyle="bold"
+ android:textSize="10pt"
+ />
+ <View style="@style/SlideServiceViewHorizontalRule"
+ />
+ <View style="@style/SlideServiceViewHorizontalRule"
+ android:background="@android:color/transparent"
+ android:layout_height="5dip"
+ />
<ToggleButton
android:id="@+id/toggleDisplayButton"
android:layout_width="fill_parent"
=== modified file 'res/layout/search.xml'
--- res/layout/search.xml 2011-05-24 19:17:02 +0000
+++ res/layout/search.xml 2012-03-03 11:26:17 +0000
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout
+<!--<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
- android:orientation="vertical">
+ android:orientation="vertical">-->
<TableLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tableLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
@@ -15,4 +16,4 @@
android:layout_width="wrap_content"
/>
</TableLayout>
-</LinearLayout>
+<!--</LinearLayout>-->
=== removed file 'res/layout/service.xml'
--- res/layout/service.xml 2012-01-21 14:13:10 +0000
+++ res/layout/service.xml 1970-01-01 00:00:00 +0000
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:baselineAligned="false"
- android:orientation="vertical"
- android:layout_height="fill_parent">
- <TableLayout
- android:id="@+id/tableLayout1"
- android:layout_width="fill_parent"
- android:layout_gravity="fill"
- android:layout_height="fill_parent">
- <ListView
- android:layout_gravity="top"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:id="@+id/serviceList"
- android:layout_width="fill_parent"/>
- <LinearLayout
- android:baselineAligned="false"
- android:id="@+id/linearLayout1"
- android:layout_width="fill_parent"
- android:layout_gravity="fill"
- android:layout_height="wrap_content"
- android:layout_weight="0">
- <Button
- android:text="@string/prev"
- android:layout_weight="1"
- android:id="@+id/prev"
- android:layout_height="wrap_content"
- android:layout_width="fill_parent"/>
- <Button
- android:text="@string/next"
- android:layout_weight="1"
- android:id="@+id/next"
- android:layout_height="wrap_content"
- android:layout_width="fill_parent"/>
- </LinearLayout>
- </TableLayout>
-</LinearLayout>
=== removed file 'res/layout/slide.xml'
--- res/layout/slide.xml 2011-05-17 21:49:44 +0000
+++ res/layout/slide.xml 1970-01-01 00:00:00 +0000
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical">
- <TableLayout
- android:id="@+id/tableLayout1"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
- <ListView
- android:layout_weight="1"
- android:layout_height="wrap_content"
- android:id="@+id/list"
- android:layout_width="wrap_content"/>
- <LinearLayout
- android:layout_height="wrap_content"
- android:id="@+id/linearLayout1"
- android:layout_width="fill_parent">
- <Button
- android:text="@string/prev"
- android:layout_weight="1"
- android:id="@+id/prev"
- android:layout_height="wrap_content"
- android:layout_width="fill_parent"
- android:layout_gravity="center_vertical"/>
- <Button
- android:text="@string/next"
- android:layout_weight="1"
- android:id="@+id/next"
- android:layout_height="wrap_content"
- android:layout_width="fill_parent"
- android:layout_gravity="center"/>
- </LinearLayout>
- </TableLayout>
-
-</LinearLayout>
=== added file 'res/layout/slide_service.xml'
--- res/layout/slide_service.xml 1970-01-01 00:00:00 +0000
+++ res/layout/slide_service.xml 2012-03-03 11:26:17 +0000
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<TableLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ style="@style/SlideServiceTableLayout"
+ >
+ <TextView
+ android:id="@+id/slide_service_title"
+ style="@style/SlideServiceTextViewTitle"
+ />
+ <View
+ style="@style/SlideServiceViewHorizontalRule"
+ />
+ <ListView
+ android:id="@+id/list"
+ style="@style/SlideServiceListView"
+ />
+ <LinearLayout
+ style="@style/LinearLayoutBottomButtons"
+ >
+ <Button
+ android:id="@+id/prev"
+ android:text="@string/prev"
+ style="@style/ButtonStylePrevious"
+ />
+ <Button
+ android:id="@+id/next"
+ android:text="@string/next"
+ style="@style/ButtonStyleNext"
+ />
+ </LinearLayout>
+</TableLayout>
=== modified file 'res/values/strings.xml'
--- res/values/strings.xml 2012-02-17 09:18:18 +0000
+++ res/values/strings.xml 2012-03-03 11:26:17 +0000
@@ -11,6 +11,7 @@
<string name="alert">Alert:</string>
<string name="alertHint">Enter alert message</string>
<string name="alertTextNull">Please enter a message to send.</string>
+ <string name="send">Send</string>
<string name="tabLive">Live</string>
<string name="tabStage">Stage</string>
<string name="tabDisplay">Display</string>
@@ -40,13 +41,15 @@
<string name="unable">Unable to load page -</string>
<string name="connectionFailed">Connection failed</string>
<string name="jsonfail">Message format error </string>
- <string name="loading">Connecting...</string>
- <string name="searching">Searching...</string>
+ <string name="loading">Connecting…</string>
+ <string name="searching">Searching…</string>
<string name="loadingFailed">Error - Load Failed</string>
- <string name="loadingServiceItems">Loading Service Items...</string>
- <string name="loadingSlideItems">Loading Slide Items...</string>
- <string name="loadingStatusInfo">Loading Status Info...</string>
+ <string name="loadingServiceItems">Loading Service Items…</string>
+ <string name="loadingSlideItems">Loading Slide Items…</string>
+ <string name="loadingStatusInfo">Loading Status Info…</string>
<string name="searchHint">Search OpenLP</string>
<string name="searchResults">Search Results</string>
<string name="showingResults">Showing Results for \'%s\'</string>
+ <string name="contentDescription">Splash Screen</string>
+ <string name="buttonSearchText">Search</string>
</resources>
=== added file 'res/values/styles.xml'
--- res/values/styles.xml 1970-01-01 00:00:00 +0000
+++ res/values/styles.xml 2012-03-03 11:26:17 +0000
@@ -0,0 +1,52 @@
+<resources>
+ <style name="OpenLPStyle" parent="android:Theme.Black.NoTitleBar.Fullscreen">
+ <item name="android:windowBackground">@drawable/openlp_logo_android</item>
+ <item name="android:tabWidgetStyle">@style/TabStyle</item>
+ <item name="android:backgroundDimEnabled">false</item>
+ </style>
+
+ <style name="TabStyle" parent="android:TextAppearance.Widget.TabWidget">
+ <item name="android:background">@drawable/tab_background</item>
+ <item name="android:textColor">@android:color/white</item>
+ </style>
+ <style name="ButtonStyle" parent="android:TextAppearance.Widget.Button">
+ <item name="android:layout_width">fill_parent</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:gravity">center</item>
+ <item name="android:layout_weight">1</item>
+ </style>
+ <style name="ButtonStylePrevious" parent="ButtonStyle">
+ <item name="android:drawableLeft">@drawable/slide_previous</item>
+ </style>
+ <style name="ButtonStyleNext" parent="ButtonStyle">
+ <item name="android:drawableRight">@drawable/slide_next</item>
+ </style>
+ <style name="SlideServiceListView" parent="android:Widget.ListView">
+ <item name="android:layout_gravity">top</item>
+ <item name="android:layout_weight">1</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:layout_width">fill_parent</item>
+ </style>
+ <style name="SlideServiceTableLayout">
+ <item name="android:layout_gravity">fill</item>
+ <item name="android:layout_width">fill_parent</item>
+ <item name="android:layout_height">fill_parent</item>
+ </style>
+ <style name="SlideServiceTextViewTitle">
+ <item name="android:textStyle">bold</item>
+ <item name="android:textSize">10pt</item>
+ <item name="android:paddingBottom">5dip</item>
+ </style>
+ <style name="LinearLayoutBottomButtons">
+ <item name="android:baselineAligned">false</item>
+ <item name="android:layout_gravity">fill</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:layout_width">fill_parent</item>
+ <item name="android:layout_weight">0</item>
+ </style>
+ <style name="SlideServiceViewHorizontalRule" parent="android:TextAppearance.Widget.TextView">
+ <item name="android:background">@android:color/background_light</item>
+ <item name="android:layout_height">2dip</item>
+ <item name="android:layout_width">fill_parent</item>
+ </style>
+</resources>
=== modified file 'src/org/openlp/android/OpenLP.java'
--- src/org/openlp/android/OpenLP.java 2012-02-16 21:11:46 +0000
+++ src/org/openlp/android/OpenLP.java 2012-03-03 11:26:17 +0000
@@ -20,15 +20,14 @@
*******************************************************************************/
package org.openlp.android;
-import android.app.TabActivity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
-import android.view.Window;
-import android.widget.TabHost;
+import android.view.View;
import org.openlp.android.activity.Alert;
+import org.openlp.android.activity.DefaultActivity;
import org.openlp.android.activity.Misc;
import org.openlp.android.activity.Preferences;
import org.openlp.android.activity.Service;
@@ -38,57 +37,77 @@
/**
* OpenLP-Android initialisation point.
*/
-public class OpenLP extends TabActivity {
- final int tabHeight = 45;
+public class OpenLP extends DefaultActivity {
+
/**
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.main);
-
+
if (getSharedPreferences(getString(R.string.keySharedPreferences),
Context.MODE_PRIVATE).getString(getString(R.string.keyHost),
"NONE").equals("NONE")
|| getSharedPreferences(
- getString(R.string.keySharedPreferences),
- Context.MODE_PRIVATE).getString(
- getString(R.string.keyHost), null).equals(null)) {
- Log.d(LOG_TAG,
- "URL preference not set. Starting preference activity...");
+ getString(R.string.keySharedPreferences),
+ Context.MODE_PRIVATE).getString(
+ getString(R.string.keyHost), null).equals(null)) {
+ Log.d(LOG_TAG, "URL preference not set. Starting preference activity...");
Intent preferenceIntent = new Intent(this, Preferences.class);
startActivity(preferenceIntent);
}
- TabHost tabHost = getTabHost();
-
- tabHost.addTab(tabHost.newTabSpec("service")
- .setIndicator(getString(R.string.tabService))
- .setContent(new Intent(this, Service.class)));
-
- tabHost.addTab(tabHost.newTabSpec("slide")
- .setIndicator(getString(R.string.tabLive))
- .setContent(new Intent(this, Slide.class)));
-
- tabHost.addTab(tabHost.newTabSpec("display")
- .setIndicator(getString(R.string.tabDisplay))
- .setContent(new Intent(this, Misc.class)));
-
- tabHost.addTab(tabHost.newTabSpec("alerts")
- .setIndicator(getString(R.string.tabAlert))
- .setContent(new Intent(this, Alert.class)));
-
- tabHost.addTab(tabHost.newTabSpec("stage")
- .setIndicator(getString(R.string.tabStage))
- .setContent(new Intent(this, StageView.class)));
- /*
- * Set the overall tab height for all tabs
- */
- for(int i=0; i<tabHost.getTabWidget().getTabCount(); i++){
- tabHost.getTabWidget().getChildAt(i).getLayoutParams().height = tabHeight;
- }
+
+ findViewById(R.id.buttonService).setOnClickListener(onClickListenerService);
+ findViewById(R.id.buttonLive).setOnClickListener(onClickListenerLive);
+ findViewById(R.id.buttonDisplay).setOnClickListener(onClickListenerDisplay);
+ findViewById(R.id.buttonAlert).setOnClickListener(onClickListenerAlert);
+ findViewById(R.id.buttonStage).setOnClickListener(onClickListenerStage);
+ findViewById(R.id.buttonSearch).setOnClickListener(onClickListenerSearch);
}
+ private View.OnClickListener onClickListenerService = new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ startActivity(new Intent(OpenLP.this, Service.class));
+ }
+ };
+
+ private View.OnClickListener onClickListenerLive = new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ startActivity(new Intent(OpenLP.this, Slide.class));
+ }
+ };
+
+ private View.OnClickListener onClickListenerDisplay = new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ startActivity(new Intent(OpenLP.this, Misc.class));
+ }
+ };
+
+ private View.OnClickListener onClickListenerAlert = new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ startActivity(new Intent(OpenLP.this, Alert.class));
+ }
+ };
+
+ private View.OnClickListener onClickListenerStage = new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ startActivity(new Intent(OpenLP.this, StageView.class));
+ }
+ };
+
+ private View.OnClickListener onClickListenerSearch = new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ onSearchRequested();
+ }
+ };
+
private final String LOG_TAG = OpenLP.class.getName();
-}
\ No newline at end of file
+}
=== modified file 'src/org/openlp/android/activity/DefaultActivity.java'
--- src/org/openlp/android/activity/DefaultActivity.java 2012-02-16 21:11:46 +0000
+++ src/org/openlp/android/activity/DefaultActivity.java 2012-03-03 11:26:17 +0000
@@ -28,7 +28,7 @@
import org.openlp.android.R;
import org.openlp.android.api.Api;
-public class DefaultActivity extends Activity implements Api {
+public abstract class DefaultActivity extends Activity implements Api {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
=== added file 'src/org/openlp/android/activity/OpenLPNavigate.java'
--- src/org/openlp/android/activity/OpenLPNavigate.java 1970-01-01 00:00:00 +0000
+++ src/org/openlp/android/activity/OpenLPNavigate.java 2012-03-03 11:26:17 +0000
@@ -0,0 +1,43 @@
+/******************************************************************************
+ * OpenLP - Open Source Lyrics Projection *
+ * --------------------------------------------------------------------------- *
+ * Copyright (c) 2011-2012 Raoul Snyman *
+ * Portions copyright (c) 2011-2012 Tim Bentley, Johan Mynhardt, Samuel *
+ * Sjöbergsson *
+ * --------------------------------------------------------------------------- *
+ * 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.android.activity;
+
+/**
+ * Interface shared by {@link Service} and {@link Slide} to navigate and set data.
+ */
+public interface OpenLPNavigate {
+ /**
+ * Call to the service changing service/slides.
+ * @param direction A direction constant from {@link org.openlp.android.api.Api}.
+ * Eg.: {@link org.openlp.android.api.Api#LIVE_NEXT}
+ * or {@link org.openlp.android.api.Api#SERVICE_NEXT}.
+ */
+ void navigate(String direction);
+
+ /**
+ * Call to the service changing data for Service or Live
+ * @param apiPart An {@link org.openlp.android.api.Api} part for which to set data.
+ * Eg.: {@link org.openlp.android.api.Api#LIVE_SET}
+ * or {@link org.openlp.android.api.Api#SERVICE_SET}
+ * @param id Id of the item selected.
+ */
+ void setData(String apiPart, int id);
+}
=== modified file 'src/org/openlp/android/activity/Service.java'
--- src/org/openlp/android/activity/Service.java 2012-02-16 21:11:46 +0000
+++ src/org/openlp/android/activity/Service.java 2012-03-03 11:26:17 +0000
@@ -23,6 +23,7 @@
import java.util.Arrays;
import java.util.List;
+import android.widget.TextView;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.openlp.android.R;
@@ -47,7 +48,7 @@
/**
* Activity for managing service objects.
*/
-public class Service extends DefaultActivity {
+public class Service extends DefaultActivity implements OpenLPNavigate {
private final Activity context = this;
private ListView listView;
@@ -56,81 +57,68 @@
super.onCreate(savedInstanceState);
Log.i(LOG_TAG, "onCreate");
- setContentView(R.layout.service);
- listView = (ListView) findViewById(R.id.serviceList);
- findViewById(R.id.prev).setOnClickListener(
- new Button.OnClickListener() {
- @Override
- public void onClick(View v) {
- try {
- new WebCallAsyncTask(context)
- .execute(SERVICE_PREVIOUS);
- }
- catch (Exception e) {
- Toast.makeText(
- getApplicationContext(),
- String.format("%s: %s", e.getClass()
- .getSimpleName(), e.getMessage()),
- Toast.LENGTH_SHORT).show();
- }
- }
- });
-
- findViewById(R.id.next).setOnClickListener(
- new Button.OnClickListener() {
- @Override
- public void onClick(View v) {
- try {
- new WebCallAsyncTask(context).execute(SERVICE_NEXT);
- }
- catch (Exception e) {
- Toast.makeText(
- getApplicationContext(),
- String.format("%s: %s", e.getClass()
- .getSimpleName(), e.getMessage()),
- Toast.LENGTH_SHORT).show();
- }
- }
- });
-
- listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
- @Override
- public void onItemClick(AdapterView<?> adapterView, View view,
- int i, long l) {
- try {
- String service = JSONHandler.createRequestJSON("id",
- Integer.toString(i));
- new WebCallAsyncTask(context, SERVICE_SET).execute(service);
- }
- catch (JSONHandler.JSONHandlerException e) {
- Toast.makeText(getApplicationContext(),
- String.format("%s: %s", e.getClass()
- .getSimpleName(), e.getMessage()),
- Toast.LENGTH_LONG).show();
- }
- }
- });
-
- listView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
- @Override
- public boolean onItemLongClick(AdapterView<?> adapterView, View view,
- int i, long l) {
- try {
- String service = JSONHandler.createRequestJSON("id",
- Integer.toString(i));
- new WebCallAsyncTask(context, SERVICE_SET).execute(service);
- }
- catch (JSONHandler.JSONHandlerException e) {
- Toast.makeText(getApplicationContext(),
- String.format("%s: %s", e.getClass()
- .getSimpleName(), e.getMessage()),
- Toast.LENGTH_LONG).show();
- }
- startActivity(new Intent(context, Slide.class));
- return true;
- }
- });
- }
+ setContentView(R.layout.slide_service);
+ listView = (ListView) findViewById(R.id.list);
+ findViewById(R.id.prev).setOnClickListener(onClickListenerNavigate);
+ findViewById(R.id.next).setOnClickListener(onClickListenerNavigate);
+ listView.setOnItemClickListener(onItemClickListenerService);
+ listView.setOnItemLongClickListener(adapterViewOnItemLongClickListener);
+ ((TextView) findViewById(R.id.slide_service_title)).setText(R.string.tabService);
+ }
+
+ private Button.OnClickListener onClickListenerNavigate = new Button.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (v.getId() == R.id.prev) {
+ navigate(SERVICE_PREVIOUS);
+ } else if (v.getId() == R.id.next) {
+ navigate(SERVICE_NEXT);
+ }
+ }
+ };
+
+ private ListView.OnItemClickListener onItemClickListenerService = new AdapterView.OnItemClickListener() {
+ @Override
+ public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
+ setData(SERVICE_SET, i);
+ }
+ };
+
+ private AdapterView.OnItemLongClickListener adapterViewOnItemLongClickListener = new AdapterView.OnItemLongClickListener() {
+ @Override
+ public boolean onItemLongClick(AdapterView<?> adapterView, View view, int i, long l) {
+ setData(SERVICE_SET, i);
+ startActivity(new Intent(context, Slide.class));
+ return true;
+ }
+ };
+
+ public void navigate(String direction) {
+ try {
+ new WebCallAsyncTask(context)
+ .execute(direction);
+ } catch (Exception e) {
+ Toast.makeText(
+ getApplicationContext(),
+ String.format("%s: %s", e.getClass()
+ .getSimpleName(), e.getMessage()),
+ Toast.LENGTH_SHORT).show();
+ }
+ }
+
+ public void setData(String apiPart, int id) {
+ try {
+ String response = JSONHandler.createRequestJSON("id",
+ Integer.toString(id));
+ new WebCallAsyncTask(context, apiPart).execute(response);
+ } catch (JSONHandler.JSONHandlerException e) {
+ Toast.makeText(getApplicationContext(),
+ String.format("%s: %s", e.getClass()
+ .getSimpleName(), e.getMessage()),
+ Toast.LENGTH_LONG).show();
+ }
+ }
+
@Override
protected void onResume() {
=== modified file 'src/org/openlp/android/activity/Slide.java'
--- src/org/openlp/android/activity/Slide.java 2012-02-16 21:11:46 +0000
+++ src/org/openlp/android/activity/Slide.java 2012-03-03 11:26:17 +0000
@@ -23,6 +23,7 @@
import java.util.Arrays;
import java.util.List;
+import android.widget.TextView;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.openlp.android.R;
@@ -43,76 +44,70 @@
import android.widget.ListView;
import android.widget.Toast;
-public class Slide extends DefaultActivity {
+public class Slide extends DefaultActivity implements OpenLPNavigate {
private final Activity context = this;
private ListView slideList;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.d(LOG_TAG, "onCreate");
- setContentView(R.layout.slide);
+ setContentView(R.layout.slide_service);
slideList = (ListView) findViewById(R.id.list);
-
- findViewById(R.id.prev).setOnClickListener(
- new Button.OnClickListener() {
- public void onClick(View v) {
- try {
- new WebCallAsyncTask(context)
- .execute(LIVE_PREVIOUS);
- }
- catch (Exception e) {
- Toast.makeText(
- getApplicationContext(),
- String.format("%s: %s", e.getClass()
- .getSimpleName(), e.getMessage()),
- Toast.LENGTH_SHORT).show();
- Log.e(LOG_TAG, e.toString(), e);
- }
- }
- });
-
- findViewById(R.id.next).setOnClickListener(
- new Button.OnClickListener() {
- public void onClick(View v) {
- try {
- new WebCallAsyncTask(context).execute(LIVE_NEXT);
- }
- catch (Exception e) {
- Toast.makeText(context,R.string.loadingFailed,
- Toast.LENGTH_LONG).show();
- Log.e(LOG_TAG, String.format("%s: %s", e.getClass()
- .getSimpleName(), e.getMessage()), e);
- }
- }
- });
-
- slideList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
- @Override
- public void onItemClick(AdapterView<?> adapterView, View view,
- int i, long l) {
- try {
- String alert = JSONHandler.createRequestJSON("id",
- Integer.toString(i));
- new WebCallAsyncTask(context, LIVE_SET).execute(alert);
- }
- catch (Exception e) {
- try {
- throw new JSONHandler.JSONHandlerException(e);
- }
- catch (JSONHandler.JSONHandlerException e1) {
- Toast.makeText(getApplicationContext(),
- String.format("%s: %s", e1.getClass()
+ findViewById(R.id.prev).setOnClickListener(onClickListenerNavigate);
+ findViewById(R.id.next).setOnClickListener(onClickListenerNavigate);
+ slideList.setOnItemClickListener(onItemClickListenerSetLive);
+ ((TextView) findViewById(R.id.slide_service_title)).setText(R.string.tabLive);
+ }
+
+ private AdapterView.OnItemClickListener onItemClickListenerSetLive = new AdapterView.OnItemClickListener() {
+ @Override
+ public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
+ setData(LIVE_SET, i);
+ }
+ };
+
+ private Button.OnClickListener onClickListenerNavigate = new Button.OnClickListener() {
+ public void onClick(View v) {
+ if (v.getId() == R.id.next) {
+ navigate(LIVE_NEXT);
+ } else if (v.getId() == R.id.prev) {
+ navigate(LIVE_PREVIOUS);
+ }
+ }
+ };
+
+ @Override
+ public void navigate(String direction) {
+ try {
+ new WebCallAsyncTask(context).execute(direction);
+ } catch (Exception e) {
+ Toast.makeText(context, R.string.loadingFailed,
+ Toast.LENGTH_LONG).show();
+ Log.e(LOG_TAG, String.format("%s: %s", e.getClass()
+ .getSimpleName(), e.getMessage()), e);
+ }
+ }
+
+ @Override
+ public void setData(String apiPart, int id) {
+ try {
+ String response = JSONHandler.createRequestJSON("id",
+ Integer.toString(id));
+ new WebCallAsyncTask(context, apiPart).execute(response);
+ } catch (Exception e) {
+ try {
+ throw new JSONHandler.JSONHandlerException(e);
+ } catch (JSONHandler.JSONHandlerException e1) {
+ Toast.makeText(getApplicationContext(),
+ String.format("%s: %s", e1.getClass()
.getSimpleName(), e1.getMessage()),
- Toast.LENGTH_LONG).show();
- }
- }
+ Toast.LENGTH_LONG).show();
}
- });
-
+ }
}
- @Override
+ @Override
protected void onResume() {
super.onResume();
Log.d(LOG_TAG, "Resume");
@@ -194,9 +189,9 @@
progressDialog.dismiss();
if (error != null && error.trim().length() > 0) {
- Toast.makeText(context,R.string.loadingFailed,
+ Toast.makeText(context,R.string.loadingFailed,
Toast.LENGTH_LONG).show();
- Log.e(LOG_TAG, error);
+ Log.e(LOG_TAG, error);
}
}
}
=== modified file 'src/org/openlp/android/data/Poll.java'
--- src/org/openlp/android/data/Poll.java 2012-02-16 21:11:46 +0000
+++ src/org/openlp/android/data/Poll.java 2012-03-03 11:26:17 +0000
@@ -25,9 +25,9 @@
private int slide;
private String item;
- private boolean twelveHourDisplay = false;;
- private boolean blankedDisplayed = false;;
- private boolean themeDisplayed = false;;
+ private boolean twelveHourDisplay = false;
+ private boolean blankedDisplayed = false;
+ private boolean themeDisplayed = false;
private boolean desktopDisplayed = false;
private boolean displayHidden = false;
=== modified file 'src/org/openlp/android/service/PingService.java'
--- src/org/openlp/android/service/PingService.java 2012-02-16 21:11:46 +0000
+++ src/org/openlp/android/service/PingService.java 2012-03-03 11:26:17 +0000
@@ -23,6 +23,10 @@
import android.os.Bundle;
import org.openlp.android.activity.Service;
+/**
+ * TODO: The target is to have a ping service to know when something on the server changed,
+ * TODO: and update accordingly
+ */
public class PingService extends Service {
@Override
public void onCreate(Bundle savedInstanceState) {
Follow ups