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

Commit 86ec4b32 authored by Jesse Vincent's avatar Jesse Vincent
Browse files

restore super-dense layout when the user has selected 0 lines of message preview

parent 1fa6d5f9
Loading
Loading
Loading
Loading
+32 −13
Original line number Diff line number Diff line
@@ -44,27 +44,46 @@
        android:src="@drawable/ic_contact_picture"
        style="?android:attr/quickContactBadgeStyleWindowLarge"
        android:background="@android:color/transparent" />

    <LinearLayout
        android:id="@+id/subject_wrapper"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/contact_badge"
        android:layout_toLeftOf="@+id/date"
        android:layout_alignParentTop="true"
        >
	    <TextView
	        android:id="@+id/sender_compact"
	        android:layout_height="wrap_content"
	        android:layout_width="0dp"
	        android:layout_weight="0.3"
	        android:ellipsize="end"
	        android:singleLine="true"
	        android:layout_marginBottom="1dip"
	        android:layout_marginLeft="1dip"
	        android:textAppearance="?android:attr/textAppearanceSmall"
            android:textColor="?android:attr/textColorPrimary" 
	        android:layout_alignParentTop="true"/>
	    <TextView
	        android:id="@+id/subject"
        android:layout_width="match_parent"
	        android:layout_width="0dp"
	        android:layout_weight="0.7"
	        android:layout_height="wrap_content"
	        android:layout_alignParentTop="true"
	        android:layout_marginBottom="1dip"
	        android:layout_marginLeft="1dip"
        android:layout_toLeftOf="@+id/date"
        android:layout_toRightOf="@id/contact_badge"
	        android:ellipsize="marquee"
	        android:singleLine="true"
	        android:textAppearance="?android:attr/textAppearanceSmall"
        android:textColor="?android:attr/textColorPrimary" />

            android:textColor="?android:attr/textColorPrimary" 
            />
    </LinearLayout>
    <TextView
        android:id="@+id/preview"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@+id/contact_badge"
        android:layout_below="@+id/subject"
        android:layout_below="@+id/subject_wrapper"
        android:layout_toLeftOf="@+id/thread_count"
        android:layout_marginLeft="1dip"
        android:layout_marginBottom="3dip"
+14 −1
Original line number Diff line number Diff line
@@ -155,6 +155,7 @@ public class MessageListFragment extends SherlockFragment implements OnItemClick
            THREAD_COUNT_COLUMN);



    public static MessageListFragment newInstance(LocalSearch search, boolean isThreadDisplay, boolean threadedList) {
        MessageListFragment fragment = new MessageListFragment();
        Bundle args = new Bundle();
@@ -454,6 +455,7 @@ public class MessageListFragment extends SherlockFragment implements OnItemClick
    private boolean mInitialized = false;

    private ContactPictureLoader mContactsPictureLoader;
    private float mScreenDensity;

    private LocalBroadcastManager mLocalBroadcastManager;
    private BroadcastReceiver mCacheBroadcastReceiver;
@@ -778,6 +780,7 @@ public class MessageListFragment extends SherlockFragment implements OnItemClick

        Context appContext = getActivity().getApplicationContext();

        mScreenDensity = appContext.getResources().getDisplayMetrics().density;
        mPreferences = Preferences.getPreferences(appContext);
        mController = MessagingController.getInstance(getActivity().getApplication());

@@ -1806,7 +1809,17 @@ public class MessageListFragment extends SherlockFragment implements OnItemClick
            MessageViewHolder holder = new MessageViewHolder();
            holder.date = (TextView) view.findViewById(R.id.date);
            holder.chip = view.findViewById(R.id.chip);
            if (mPreviewLines == 0) {
                view.findViewById(R.id.preview).setVisibility(View.GONE);
                holder.preview = (TextView) view.findViewById(R.id.sender_compact);
                ViewGroup.LayoutParams params = holder.chip.getLayoutParams();
                params.height=(int) (16.0f * mScreenDensity);
                params.width=(int) (16.0f * mScreenDensity);

            } else {
                view.findViewById(R.id.sender_compact).setVisibility(View.GONE);
                holder.preview = (TextView) view.findViewById(R.id.preview);
            }

            QuickContactBadge contactBadge =
                    (QuickContactBadge) view.findViewById(R.id.contact_badge);