1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-30 13:12:25 -05:00

When flipping messages, be sure we jump to the top as we display

This commit is contained in:
Jesse Vincent 2009-11-22 21:23:00 +00:00
parent 3f98e3204b
commit 7a46a584c6
3 changed files with 13 additions and 1 deletions

View File

@ -4,8 +4,10 @@
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/white">
android:background="@android:color/white"
>
<ScrollView
android:id="@+id/top_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"

View File

@ -6,6 +6,7 @@
android:layout_height="fill_parent"
>
<ScrollView
android:id="@+id/top_view"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"

View File

@ -49,6 +49,7 @@ import android.widget.Button;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;
@ -97,6 +98,7 @@ public class MessageView extends K9Activity
private TextView mSubjectView;
private CheckBox mFlagged;
private int defaultSubjectColor;
private ScrollView mTopView;
private WebView mMessageContentView;
private LinearLayout mAttachments;
private View mAttachmentIcon;
@ -461,6 +463,7 @@ public class MessageView extends K9Activity
mDateView = (TextView)findViewById(R.id.date);
mTimeView = (TextView)findViewById(R.id.time);
mTopView = (ScrollView)findViewById(R.id.top_view);
mMessageContentView = (WebView)findViewById(R.id.message_content);
mAttachments = (LinearLayout)findViewById(R.id.attachments);
@ -609,10 +612,13 @@ public class MessageView extends K9Activity
private void displayMessage(String uid) {
mMessageUid = uid;
mMessageContentView.getSettings().setBlockNetworkImage(true);
mAttachments.removeAllViews();
findSurroundingMessagesUid();
next.setEnabled(mNextMessageUid != null );
previous.setEnabled(mPreviousMessageUid != null);
if (next_scrolling != null)
next_scrolling.setEnabled(mNextMessageUid != null );
if (previous_scrolling != null)
@ -623,6 +629,9 @@ public class MessageView extends K9Activity
mFolder,
mMessageUid,
mListener);
mTopView.scrollTo(0, 0);
mMessageContentView.scrollTo(0, 0);
}