Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c640e4a6 authored by Vincent Breitmoser's avatar Vincent Breitmoser
Browse files

messageview: display unsigned text in additional textview

parent 61232cb6
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ import android.content.Intent;
import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
@@ -26,6 +27,7 @@ import android.webkit.WebView;
import android.webkit.WebView.HitTestResult;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.fsck.k9.R;
@@ -63,10 +65,13 @@ public class MessageContainerView extends LinearLayout implements OnClickListene
    private LinearLayout mAttachments;
    private Button mShowHiddenAttachments;
    private LinearLayout mHiddenAttachments;
    private View unsignedTextContainer;
    private TextView unsignedText;
    private View mAttachmentsContainer;

    private boolean showingPictures;
    private LayoutInflater mInflater;
    private AttachmentViewCallback attachmentCallback;
    private View mAttachmentsContainer;
    private SavedState mSavedState;
    private ClipboardManager mClipboardManager;
    private Map<AttachmentViewInfo, AttachmentView> attachments = new HashMap<>();
@@ -94,6 +99,9 @@ public class MessageContainerView extends LinearLayout implements OnClickListene
        mShowHiddenAttachments.setVisibility(View.GONE);
        mShowHiddenAttachments.setOnClickListener(this);

        unsignedTextContainer = findViewById(R.id.message_unsigned_container);
        unsignedText = (TextView) findViewById(R.id.message_unsigned_text);

        showingPictures = false;

        Context context = getContext();
@@ -434,6 +442,11 @@ public class MessageContainerView extends LinearLayout implements OnClickListene
        }

        displayHtmlContentWithInlineAttachments(textToDisplay, messageViewInfo.attachmentResolver);

        if (!TextUtils.isEmpty(messageViewInfo.extraText)) {
            unsignedTextContainer.setVisibility(View.VISIBLE);
            unsignedText.setText(messageViewInfo.extraText);
        }
    }

    public String wrapStatusMessage(String status) {
+53 −2
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<com.fsck.k9.ui.messageview.MessageContainerView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
@@ -10,6 +11,56 @@
        android:layout_height="wrap_content"
        android:layout_width="fill_parent" />

    <!-- Content area -->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:id="@+id/message_unsigned_container">

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="4dp"
            >

            <View
                android:layout_width="16dp"
                android:layout_height="4dp"
                android:layout_marginTop="1dp"
                android:layout_gravity="center_vertical"
                android:background="#d55"
                />

            <TextView
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:layout_marginLeft="8dp"
                android:layout_marginRight="8dp"
                android:textAppearance="?android:textAppearanceSmall"
                android:text="Unsigned Text"
                android:textColor="#d55"
                />

            <View
                android:layout_width="wrap_content"
                android:layout_height="4dp"
                android:layout_marginTop="1dp"
                android:layout_gravity="center_vertical"
                android:background="#d55" />

        </LinearLayout>

        <TextView
            android:id="@+id/message_unsigned_text"
            android:layout_height="wrap_content"
            android:layout_width="fill_parent"
            android:padding="8dp"
            tools:text="Unsigned text content"
            />

    </LinearLayout>

    <!-- Attachments area -->
    <LinearLayout
        android:id="@+id/attachments_container"
@@ -22,7 +73,7 @@
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="4dip" />
            />

        <Button
            android:id="@+id/show_hidden_attachments"
@@ -35,7 +86,7 @@
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:padding="4dip" />
            />

    </LinearLayout>