diff --git a/android/sdremote/res/layout/fragment_slides_pager.xml b/android/sdremote/res/layout/fragment_slides_pager.xml index 18308a22b894..d572db07d0cf 100644 --- a/android/sdremote/res/layout/fragment_slides_pager.xml +++ b/android/sdremote/res/layout/fragment_slides_pager.xml @@ -13,59 +13,46 @@ android:layout_width="match_parent" android:layout_height="0dp"/> - - + - + - - - - + android:layout_height="wrap_content"/> - - + - + - + - - - + diff --git a/android/sdremote/res/values/strings.xml b/android/sdremote/res/values/strings.xml index 9fd81f9cd67b..0eefa954e179 100644 --- a/android/sdremote/res/values/strings.xml +++ b/android/sdremote/res/values/strings.xml @@ -43,6 +43,7 @@ Make sure LibreOffice is running on a computer on the same WiFi network. Make sure LibreOffice is running on a computer with Bluetooth enabled. Paused + Nothing here. IP address Name (optional) diff --git a/android/sdremote/src/org/libreoffice/impressremote/fragment/SlidesPagerFragment.java b/android/sdremote/src/org/libreoffice/impressremote/fragment/SlidesPagerFragment.java index e3c921076d39..f8769f32ae38 100644 --- a/android/sdremote/src/org/libreoffice/impressremote/fragment/SlidesPagerFragment.java +++ b/android/sdremote/src/org/libreoffice/impressremote/fragment/SlidesPagerFragment.java @@ -21,12 +21,10 @@ import android.support.v4.view.PagerAdapter; import android.support.v4.view.ViewPager; import android.text.Html; import android.text.TextUtils; -import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextSwitcher; -import android.widget.ViewAnimator; import com.actionbarsherlock.app.SherlockFragment; import org.libreoffice.impressremote.communication.SlideShow; @@ -84,6 +82,7 @@ public class SlidesPagerFragment extends SherlockFragment implements ServiceConn aSlidesPager.setOnPageChangeListener(this); setUpCurrentSlide(); + setUpCurrentSlideNotes(); } private ViewPager getSlidesPager() { @@ -106,6 +105,12 @@ public class SlidesPagerFragment extends SherlockFragment implements ServiceConn getSlidesPager().setCurrentItem(aSlideShow.getCurrentSlideIndex()); } + private void setUpCurrentSlideNotes() { + SlideShow aSlideShow = mCommunicationService.getSlideShow(); + + setUpSlideNotes(aSlideShow.getCurrentSlideIndex()); + } + @Override public void onPageSelected(int aPosition) { mCommunicationService.getTransmitter().setCurrentSlide(aPosition); @@ -129,28 +134,20 @@ public class SlidesPagerFragment extends SherlockFragment implements ServiceConn } private void showSlideNotes(int aSlideIndex) { - ViewAnimator aViewAnimator = (ViewAnimator) getView().findViewById(R.id.view_animator); - ViewGroup aNotesLayout = (ViewGroup) getView().findViewById(R.id.layout_notes); - - if (aViewAnimator.getDisplayedChild() != aViewAnimator.indexOfChild(aNotesLayout)) { - aViewAnimator.setDisplayedChild(aViewAnimator.indexOfChild(aNotesLayout)); - } - - setSlideNotes(aSlideIndex); - } - - private void setSlideNotes(int aSlideIndex) { - TextSwitcher aSlideNotesTextSwitcher = (TextSwitcher) getView().findViewById(R.id.text_switcher_notes); + TextSwitcher aSlideNotesSwitcher = getSlideNotesSwitcher(); String aSlideNotes = mCommunicationService.getSlideShow().getSlideNotes(aSlideIndex); - aSlideNotesTextSwitcher.setText(Html.fromHtml(aSlideNotes)); + aSlideNotesSwitcher.setText(Html.fromHtml(aSlideNotes)); + } + + private TextSwitcher getSlideNotesSwitcher() { + return (TextSwitcher) getView().findViewById(R.id.text_switcher_notes); } private void hideSlideNotes() { - ViewAnimator aViewAnimator = (ViewAnimator) getView().findViewById(R.id.view_animator); - View aEmptyView = getView().findViewById(R.id.view_empty); + TextSwitcher aSlideNotesSwitcher = getSlideNotesSwitcher(); - aViewAnimator.setDisplayedChild(aViewAnimator.indexOfChild(aEmptyView)); + aSlideNotesSwitcher.setText(getString(R.string.message_notes_empty)); } @Override