mirror of https://github.com/moparisthebest/k-9
restore super-dense layout when the user has selected 0 lines of message preview
This commit is contained in:
parent
8de3387528
commit
f5eb2708b4
|
@ -44,27 +44,46 @@
|
||||||
android:src="@drawable/ic_contact_picture"
|
android:src="@drawable/ic_contact_picture"
|
||||||
style="?android:attr/quickContactBadgeStyleWindowLarge"
|
style="?android:attr/quickContactBadgeStyleWindowLarge"
|
||||||
android:background="@android:color/transparent" />
|
android:background="@android:color/transparent" />
|
||||||
|
<LinearLayout
|
||||||
<TextView
|
android:id="@+id/subject_wrapper"
|
||||||
android:id="@+id/subject"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
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:layout_toRightOf="@id/contact_badge"
|
||||||
android:ellipsize="marquee"
|
android:layout_toLeftOf="@+id/date"
|
||||||
android:singleLine="true"
|
android:layout_alignParentTop="true"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
>
|
||||||
android:textColor="?android:attr/textColorPrimary" />
|
<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="0dp"
|
||||||
|
android:layout_weight="0.7"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_marginBottom="1dip"
|
||||||
|
android:layout_marginLeft="1dip"
|
||||||
|
android:ellipsize="marquee"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
|
android:textColor="?android:attr/textColorPrimary"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/preview"
|
android:id="@+id/preview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_toRightOf="@+id/contact_badge"
|
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_toLeftOf="@+id/thread_count"
|
||||||
android:layout_marginLeft="1dip"
|
android:layout_marginLeft="1dip"
|
||||||
android:layout_marginBottom="3dip"
|
android:layout_marginBottom="3dip"
|
||||||
|
|
|
@ -155,6 +155,7 @@ public class MessageListFragment extends SherlockFragment implements OnItemClick
|
||||||
THREAD_COUNT_COLUMN);
|
THREAD_COUNT_COLUMN);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static MessageListFragment newInstance(LocalSearch search, boolean isThreadDisplay, boolean threadedList) {
|
public static MessageListFragment newInstance(LocalSearch search, boolean isThreadDisplay, boolean threadedList) {
|
||||||
MessageListFragment fragment = new MessageListFragment();
|
MessageListFragment fragment = new MessageListFragment();
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
|
@ -454,6 +455,7 @@ public class MessageListFragment extends SherlockFragment implements OnItemClick
|
||||||
private boolean mInitialized = false;
|
private boolean mInitialized = false;
|
||||||
|
|
||||||
private ContactPictureLoader mContactsPictureLoader;
|
private ContactPictureLoader mContactsPictureLoader;
|
||||||
|
private float mScreenDensity;
|
||||||
|
|
||||||
private LocalBroadcastManager mLocalBroadcastManager;
|
private LocalBroadcastManager mLocalBroadcastManager;
|
||||||
private BroadcastReceiver mCacheBroadcastReceiver;
|
private BroadcastReceiver mCacheBroadcastReceiver;
|
||||||
|
@ -778,6 +780,7 @@ public class MessageListFragment extends SherlockFragment implements OnItemClick
|
||||||
|
|
||||||
Context appContext = getActivity().getApplicationContext();
|
Context appContext = getActivity().getApplicationContext();
|
||||||
|
|
||||||
|
mScreenDensity = appContext.getResources().getDisplayMetrics().density;
|
||||||
mPreferences = Preferences.getPreferences(appContext);
|
mPreferences = Preferences.getPreferences(appContext);
|
||||||
mController = MessagingController.getInstance(getActivity().getApplication());
|
mController = MessagingController.getInstance(getActivity().getApplication());
|
||||||
|
|
||||||
|
@ -1806,7 +1809,17 @@ public class MessageListFragment extends SherlockFragment implements OnItemClick
|
||||||
MessageViewHolder holder = new MessageViewHolder();
|
MessageViewHolder holder = new MessageViewHolder();
|
||||||
holder.date = (TextView) view.findViewById(R.id.date);
|
holder.date = (TextView) view.findViewById(R.id.date);
|
||||||
holder.chip = view.findViewById(R.id.chip);
|
holder.chip = view.findViewById(R.id.chip);
|
||||||
holder.preview = (TextView) view.findViewById(R.id.preview);
|
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 contactBadge =
|
||||||
(QuickContactBadge) view.findViewById(R.id.contact_badge);
|
(QuickContactBadge) view.findViewById(R.id.contact_badge);
|
||||||
|
|
Loading…
Reference in New Issue