diff options
author | Artur Dryomov <artur.dryomov@gmail.com> | 2013-09-11 01:17:51 +0300 |
---|---|---|
committer | Artur Dryomov <artur.dryomov@gmail.com> | 2013-09-11 01:43:54 +0300 |
commit | 06b632f0d367178b7266e50c6f140ef36984733f (patch) | |
tree | 7b6cc83b0ca55644d08a85a50940a87690c2e9eb /android | |
parent | 5dd70c5c9b3e8cc7313285c2eae31b8d4f7a8d60 (diff) |
Fix notes jumps.
* Remove empty spaces not reset while changing text via TextSwitcher.
* Scroll notes to the top on changes because outer ScrollView remembers
current position not respecting TextSwitcher state of course.
Change-Id: I3e9ba458e4ce6b13e5b02675ca28d6c7c5829f00
Diffstat (limited to 'android')
-rw-r--r-- | android/sdremote/res/layout/fragment_slides_pager.xml | 2 | ||||
-rw-r--r-- | android/sdremote/src/org/libreoffice/impressremote/fragment/SlidesPagerFragment.java | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/android/sdremote/res/layout/fragment_slides_pager.xml b/android/sdremote/res/layout/fragment_slides_pager.xml index d572db07d0cf..04a6294e8a0b 100644 --- a/android/sdremote/res/layout/fragment_slides_pager.xml +++ b/android/sdremote/res/layout/fragment_slides_pager.xml @@ -28,6 +28,7 @@ android:paddingTop="@dimen/padding_header"/> <ScrollView + android:id="@+id/scroll_notes" android:layout_width="wrap_content" android:layout_height="wrap_content"> @@ -35,6 +36,7 @@ android:id="@+id/text_switcher_notes" android:inAnimation="@android:anim/fade_in" android:outAnimation="@android:anim/fade_out" + android:measureAllChildren="false" android:paddingTop="@dimen/padding_slide_notes" android:paddingLeft="@dimen/padding_slide_notes" android:paddingRight="@dimen/padding_slide_notes" diff --git a/android/sdremote/src/org/libreoffice/impressremote/fragment/SlidesPagerFragment.java b/android/sdremote/src/org/libreoffice/impressremote/fragment/SlidesPagerFragment.java index aa86de07e5e4..29de2940ed1b 100644 --- a/android/sdremote/src/org/libreoffice/impressremote/fragment/SlidesPagerFragment.java +++ b/android/sdremote/src/org/libreoffice/impressremote/fragment/SlidesPagerFragment.java @@ -24,6 +24,7 @@ import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.ScrollView; import android.widget.TextSwitcher; import com.actionbarsherlock.app.SherlockFragment; @@ -143,6 +144,7 @@ public class SlidesPagerFragment extends SherlockFragment implements ServiceConn if (areSlideNotesAvailable(aSlideIndex)) { showSlideNotes(aSlideIndex); + scrollSlideNotes(); } else { hideSlideNotes(); @@ -172,6 +174,12 @@ public class SlidesPagerFragment extends SherlockFragment implements ServiceConn return (TextSwitcher) getView().findViewById(R.id.text_switcher_notes); } + private void scrollSlideNotes() { + ScrollView aSlideNotesScroll = (ScrollView) getView().findViewById(R.id.scroll_notes); + + aSlideNotesScroll.scrollTo(0, 0); + } + private void hideSlideNotes() { TextSwitcher aSlideNotesSwitcher = getSlideNotesSwitcher(); |