From f39f3ccd590c76d80ff9e02e5cb26fd5119d3de5 Mon Sep 17 00:00:00 2001 From: Artur Dryomov Date: Wed, 17 Jul 2013 01:16:02 +0300 Subject: [PATCH] Add a basic slide show activity. Slides grid and pager could be switched now. Change-Id: I2c29f36b16c247f1d895773d90766828f571a375 --- android/sdremote/AndroidManifest.xml | 7 +- .../res/drawable-hdpi/ic_action_grid.png | Bin 0 -> 1262 bytes .../res/drawable-hdpi/ic_action_pager.png | Bin 0 -> 1388 bytes .../res/drawable-mdpi/ic_action_grid.png | Bin 0 -> 1155 bytes .../res/drawable-mdpi/ic_action_pager.png | Bin 0 -> 1241 bytes .../res/drawable-xhdpi/ic_action_grid.png | Bin 0 -> 1317 bytes .../res/drawable-xhdpi/ic_action_pager.png | Bin 0 -> 1552 bytes .../menu/menu_action_bar_slide_show_grid.xml | 10 ++ .../menu/menu_action_bar_slide_show_pager.xml | 10 ++ android/sdremote/res/values/strings.xml | 4 + .../ComputerConnectionFragment.java | 3 + .../libreoffice/impressremote/Intents.java | 4 + .../impressremote/SlideShowActivity.java | 104 ++++++++++++++++++ 13 files changed, 141 insertions(+), 1 deletion(-) create mode 100755 android/sdremote/res/drawable-hdpi/ic_action_grid.png create mode 100755 android/sdremote/res/drawable-hdpi/ic_action_pager.png create mode 100755 android/sdremote/res/drawable-mdpi/ic_action_grid.png create mode 100755 android/sdremote/res/drawable-mdpi/ic_action_pager.png create mode 100755 android/sdremote/res/drawable-xhdpi/ic_action_grid.png create mode 100755 android/sdremote/res/drawable-xhdpi/ic_action_pager.png create mode 100644 android/sdremote/res/menu/menu_action_bar_slide_show_grid.xml create mode 100644 android/sdremote/res/menu/menu_action_bar_slide_show_pager.xml create mode 100644 android/sdremote/src/org/libreoffice/impressremote/SlideShowActivity.java diff --git a/android/sdremote/AndroidManifest.xml b/android/sdremote/AndroidManifest.xml index 72d692b0eb6d..c2f9ed4aec1e 100644 --- a/android/sdremote/AndroidManifest.xml +++ b/android/sdremote/AndroidManifest.xml @@ -38,10 +38,15 @@ + + + l3^w)^1&PVosU-?Y zsp*+{wo31J?^jaDOtDo8H}y5}EpSfF$n>ZxN)4{^3rViZPPR-@vbR&PsjvbXkegbP zs8ErclUHn2VXFi-*9yo63F|8hm3bwJ6}oxF$}kgLQj3#|G7CyF^YauyCMG83 zmzLNn0bL65LT&-v*t}wBFaZNhzap_f-%!s00+w{G(#^lGsVi)!qL>y+|1n6$-vFf(ACh=#L&{!#L3yw z&D7A`#K{n**Cju>G&eP`1g19yq1OVZUQlAlEdbi=l3J8mmYU*Ll%J~r_Ow+dZnv1? zG!Lpb1-DzwaO%|uIz}H9wMbD769T3m5EGtofgE_!Pt60S_ab1zj&#|xg@J)F!PCVt zq~g|_8P-{c9R%7`?I$LC$Qms173A1a@K#CvBqLK^al@8I8HM!1xk?Eh6R#z3=<(Ji zNJjn?_unXx>E5;Wz^wWQ%!Y3k{1wYAzhU5e`M`4yO$SD@{R{ZF^%?pa zu%1sye>(5L)~Tnv%ziMecU8Zlp;^QJ?qJl+Bg-RYsuvz$xTEz+cEXgI0g;TxA6ai$ z9NTihNO}L1TQ>rC2a7!qzru9B8D!$~i$9tRVo!8eojW8GTy4}CagO1-<%B0PVbLqQ zx%VvI6!wTKh9NvqWAfa{$3E-Smv0H%&2&HK*}2dIzx`jZ@^G6J$3HmuOVRfo?;Q>M zOqOE_Ay@UTOq!mNe9JPoY)Q`IiC4n6^}b7;?K35}r2bLVHX)G(46Nst%r(0%H~rwl zdB;oFUOIcCd}-M3u$Lj41{0fCoH#nI_Q>q# literal 0 HcmV?d00001 diff --git a/android/sdremote/res/drawable-hdpi/ic_action_pager.png b/android/sdremote/res/drawable-hdpi/ic_action_pager.png new file mode 100755 index 0000000000000000000000000000000000000000..3f93d3327150cec21d5ed5d85a3af65d39f47461 GIT binary patch literal 1388 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTC$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWuD@%qp275hW46K32*3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L$CnhAJWM(_s&h6O7RiM?6MfRK*$toXvG5Sd5F z6ll6wEKHTdIjvLkEtclrst_MB+%l zq@bCrvbw!eCR{MOB$+fzF-}S~peX)7RMS?`HcG><@qSm>&WxInPD9%$STb(hz*fhV zDMT$OA;ZcT#)(=LQ+Wd!cHS^SwBJv$K$K)vcPz^cQ52H8jU-)$$ykWQ8kDLkLVQ=) z&j&gq{s_~H@SU%20qTwDt8{i^rjT*7R|gj#R!1M|c-}2M*c-#%TliAE zO~%5R($n1gPoKK}?sjcE+u)hl@Izs)vb%DoGQF<(qw#)aAO^lm~7p_C#xocr8 zzi>3grypNOW1I_D7+>$5GJ zb|0BJ-@B#l=M9q$)ghDPC~}Ej__ZkC?PxE|-E@2Ixe3>LVsfVI(!nR;8_sVb8Sjhz I6*>OLXV1HQAOHXW literal 0 HcmV?d00001 diff --git a/android/sdremote/res/drawable-mdpi/ic_action_pager.png b/android/sdremote/res/drawable-mdpi/ic_action_pager.png new file mode 100755 index 0000000000000000000000000000000000000000..9b542d201f95f048f006d76bfda33b1eb9bf7dd1 GIT binary patch literal 1241 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWuD@%qp275hW46K32*3xq68pHF_1f1wh>l3^w)^1&PVosU-?Y zsp*+{wo31J?^jaDOtDo8H}y5}EpSfF$n>ZxN)4{^3rViZPPR-@vbR&PsjvbXkegbP zs8ErclUHn2VXFi-*9yo63F|8hm3bwJ6}oxF$}kgLQj3#|G7CyF^YauyCMG83 zmzLNn0bL65LT&-v*t}wBFaZNhzap_f-%!s00+w{G(#^lGsVilz}d*j(%jY5$G&eP`1g19yq1O$kUQlAlEdbi=l3J8mmYU*Ll%J~r_Ow+dZnrq& zG!Lpb1-DyVaO%|uIz}H9wMbD769T3m5EGtofgE_!Pt60S_ab1z-tbf?oq>VT+tbA{ zq~cc6pa1{u4?8fawK1|S=94I3-|#@-KEshmAtev&73w&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JIIZFav`WU7(glC1wo+2O!}wTT{lP_x0-IP6;d zp~rgvdG>2eGk5%>T8N@eZ2BbCvqi14F=!o$ED+ZN_B literal 0 HcmV?d00001 diff --git a/android/sdremote/res/drawable-xhdpi/ic_action_pager.png b/android/sdremote/res/drawable-xhdpi/ic_action_pager.png new file mode 100755 index 0000000000000000000000000000000000000000..6d2bfb689430752de4647d2de1a437b675e644c1 GIT binary patch literal 1552 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*9U+m{l@EB1$5BeXNr6bM+EIYV;~{3xK*A7;Nk-3KEmEQ%e+* zQqwc@Y?a>c-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*-(AUCxn zQK2F?C$HG5!d3}vt`(3C64qBz04piUwpD^SD#ABF!8yMuRl!uxKsVXI%uvD1M9IxIyg#@@$ndN=gc>^!3Zj z%k|2Q_413-^$jg8E%gnI^o@*kfhu&1EAvVcD|GXUm0>2hq!uR^WfqiV=I1GZOiWD5 zFD$Tv3bSNU;+l1ennz|zM-B0$V)JVzP|XC=H|jx7ncO3BHWAB;NpiyW)Z+ZoqGVvir744~DzI`cN=+=uFAB-e&w+(vKt_H^esM;Afr4|esh**NZ(?$0 z9!LbN!`Ii!Gq1QLF)umQ)5TT^Xog;9W{Q=8fwPg5rMa1@lc9m3p{t>#iJ_&diIcOV zo2j9>iIX8ruSMv>2~2MaLa#Yay`aR9TL84#CABECEH%ZgC_h&L>}jh^tZp%O zF*kI?Z5~u_3Rbs(^;+O`i$2gX`k<&qifWh;F#Uj-@PrHGz>|Jz9x%NZ0TZ^ohg*BWE7h0;UxVS`9GjL;i2BD2LD=vuXlZ4j0zRsQh?5t%HGAW!{F?%YI=I4L7E_ zG-S1S*UeDR_{cl)Ye+6f!VksN4{S1ApBwT%a6QSbYS7ho0E<=T`Pyvp?iM9b@AM7EE+SblYZp} z0E09rGV(!G(B9xn3KHiY*qD7fma^;YS)SlOY%WcXCv}UB)g{dIRQpc0Hcx6Uf6G|+ z + + + + + \ No newline at end of file diff --git a/android/sdremote/res/menu/menu_action_bar_slide_show_pager.xml b/android/sdremote/res/menu/menu_action_bar_slide_show_pager.xml new file mode 100644 index 000000000000..023dcd5e3301 --- /dev/null +++ b/android/sdremote/res/menu/menu_action_bar_slide_show_pager.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/android/sdremote/res/values/strings.xml b/android/sdremote/res/values/strings.xml index 4e7502dfd3a2..42209c123ae8 100644 --- a/android/sdremote/res/values/strings.xml +++ b/android/sdremote/res/values/strings.xml @@ -70,11 +70,15 @@ WiFi Open source licenses Connection + Creation + Slide Show Open source licenses Reconnect Add computer Remove + Slides grid + Slides pager Cancel Save diff --git a/android/sdremote/src/org/libreoffice/impressremote/ComputerConnectionFragment.java b/android/sdremote/src/org/libreoffice/impressremote/ComputerConnectionFragment.java index e1cc44970754..a9a52a1ab5d4 100644 --- a/android/sdremote/src/org/libreoffice/impressremote/ComputerConnectionFragment.java +++ b/android/sdremote/src/org/libreoffice/impressremote/ComputerConnectionFragment.java @@ -184,6 +184,9 @@ public class ComputerConnectionFragment extends SherlockFragment implements Serv } public void setUpPresentation() { + Intent aIntent = Intents.buildSlideShowIntent(getActivity()); + startActivity(aIntent); + getActivity().finish(); } diff --git a/android/sdremote/src/org/libreoffice/impressremote/Intents.java b/android/sdremote/src/org/libreoffice/impressremote/Intents.java index 344175d08752..e517c2dd634a 100644 --- a/android/sdremote/src/org/libreoffice/impressremote/Intents.java +++ b/android/sdremote/src/org/libreoffice/impressremote/Intents.java @@ -124,6 +124,10 @@ public final class Intents { return aIntent; } + public static Intent buildSlideShowIntent(Context aContext) { + return new Intent(aContext, SlideShowActivity.class); + } + public static Intent buildLicensesIntent(Context aContext) { return new Intent(aContext, LicensesActivity.class); } diff --git a/android/sdremote/src/org/libreoffice/impressremote/SlideShowActivity.java b/android/sdremote/src/org/libreoffice/impressremote/SlideShowActivity.java new file mode 100644 index 000000000000..77cf70325a36 --- /dev/null +++ b/android/sdremote/src/org/libreoffice/impressremote/SlideShowActivity.java @@ -0,0 +1,104 @@ +package org.libreoffice.impressremote; + +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.support.v4.app.FragmentTransaction; + +import com.actionbarsherlock.app.SherlockFragmentActivity; +import com.actionbarsherlock.view.Menu; +import com.actionbarsherlock.view.MenuItem; + +public class SlideShowActivity extends SherlockFragmentActivity { + private static enum Mode { + PAGER, GRID + } + + private Mode mMode; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + mMode = Mode.PAGER; + + setUpHomeButton(); + + setUpFragment(); + } + + private void setUpHomeButton() { + getSupportActionBar().setHomeButtonEnabled(true); + } + + private void setUpFragment() { + switch (mMode) { + case PAGER: + setUpFragment(SlidesPagerFragment.newInstance()); + break; + + case GRID: + setUpFragment(SlidesGridFragment.newInstance()); + break; + + default: + setUpFragment(SlidesPagerFragment.newInstance()); + break; + } + } + + private void setUpFragment(Fragment aFragment) { + FragmentTransaction aTransaction = getSupportFragmentManager().beginTransaction(); + + aTransaction.replace(android.R.id.content, aFragment); + + aTransaction.commit(); + } + + @Override + public boolean onCreateOptionsMenu(Menu aMenu) { + getSupportMenuInflater().inflate(getActionBarMenuResourceId(), aMenu); + + return true; + } + + private int getActionBarMenuResourceId() { + switch (mMode) { + case PAGER: + return R.menu.menu_action_bar_slide_show_pager; + + case GRID: + return R.menu.menu_action_bar_slide_show_grid; + + default: + return R.menu.menu_action_bar_slide_show_pager; + } + } + + @Override + public boolean onOptionsItemSelected(MenuItem aMenuItem) { + switch (aMenuItem.getItemId()) { + case R.id.menu_slides_grid: + mMode = Mode.GRID; + + setUpFragment(); + refreshActionBarMenu(); + + return true; + + case R.id.menu_slides_pager: + mMode = Mode.PAGER; + + setUpFragment(); + refreshActionBarMenu(); + + return true; + + default: + return super.onOptionsItemSelected(aMenuItem); + } + } + + private void refreshActionBarMenu() { + supportInvalidateOptionsMenu(); + } +}