mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 11:42:16 -05:00
update the new message list item to work better in various odd configurations
This commit is contained in:
parent
99e354bc9f
commit
7ba68dbc3c
@ -1,80 +1,98 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="center_vertical"
|
||||
>
|
||||
|
||||
<View
|
||||
android:id="@+id/chip"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignBottom="@+id/list_item_inner"
|
||||
android:adjustViewBounds="false"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="8dip"
|
||||
android:background="#ff336699"
|
||||
|
||||
android:layout_marginRight="4dp"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/selected_checkbox_wrapper"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="visible"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:baselineAligned="false"
|
||||
android:layout_centerVertical="true">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/selected_checkbox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:focusable="false"
|
||||
android:clickable="false"
|
||||
android:paddingLeft="4dp"
|
||||
android:paddingRight="0dp"
|
||||
android:visibility="visible"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<QuickContactBadge
|
||||
android:id="@+id/contact_badge"
|
||||
android:layout_marginRight="8dip"
|
||||
android:layout_marginTop="4dip"
|
||||
android:layout_marginBottom="3dip"
|
||||
android:layout_height="40dip"
|
||||
android:layout_width="40dip"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:src="@drawable/ic_contact_picture"
|
||||
style="?android:attr/quickContactBadgeStyleWindowLarge"
|
||||
android:background="@android:color/transparent"/>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/list_item_inner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="5dip"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:focusableInTouchMode="false"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:paddingBottom="6dp">
|
||||
|
||||
android:paddingBottom="6dip"
|
||||
android:paddingRight="4dip"
|
||||
android:paddingLeft="8dip"
|
||||
android:paddingTop="5dip">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/selected_checkbox_wrapper"
|
||||
android:layout_width="wrap_content"
|
||||
android:paddingRight="8dp"
|
||||
android:paddingLeft="8dp"
|
||||
|
||||
android:layout_height="match_parent"
|
||||
<TextView
|
||||
android:id="@+id/preview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:visibility="gone"
|
||||
android:textColor="?android:attr/textColorPrimary">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/selected_checkbox"
|
||||
android:layout_width="16dip"
|
||||
android:layout_height="16dip"
|
||||
android:button="?attr/messageListCheckbox"
|
||||
android:focusable="false"
|
||||
android:clickable="false"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<QuickContactBadge
|
||||
android:id="@+id/contact_badge"
|
||||
android:layout_marginRight="8dip"
|
||||
android:layout_marginTop="4dip"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginBottom="3dip"
|
||||
android:layout_height="40dip"
|
||||
android:layout_width="40dip"
|
||||
android:layout_alignWithParentIfMissing="true"
|
||||
android:layout_toRightOf="@id/selected_checkbox_wrapper"
|
||||
android:src="@drawable/ic_contact_picture"
|
||||
style="?android:attr/quickContactBadgeStyleWindowLarge"
|
||||
android:background="@android:color/transparent"/>
|
||||
android:layout_toLeftOf="@+id/flagged_bottom_right"
|
||||
android:layout_marginLeft="1dip"
|
||||
android:layout_marginRight="3dip"
|
||||
android:bufferType="spannable"
|
||||
android:layout_below="@+id/subject_wrapper"
|
||||
android:singleLine="false"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:longClickable="false"
|
||||
android:layout_alignWithParentIfMissing="false"
|
||||
android:gravity="top"
|
||||
android:layout_alignParentBottom="false"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/subject_wrapper"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@id/contact_badge"
|
||||
android:layout_toLeftOf="@+id/thread_count"
|
||||
android:layout_alignParentRight="false"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignWithParentIfMissing="true"
|
||||
>
|
||||
android:layout_alignParentBottom="false"
|
||||
android:layout_alignParentLeft="false"
|
||||
android:layout_toLeftOf="@+id/date">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sender_compact"
|
||||
@ -101,65 +119,66 @@
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/thread_count"
|
||||
android:textColor="?attr/messageListThreadCountForegroundColor"
|
||||
android:background="?attr/messageListThreadCountBackground"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="3dip"
|
||||
android:layout_marginRight="4dip"
|
||||
android:paddingRight="4dip"
|
||||
android:paddingBottom="1dip"
|
||||
android:paddingLeft="4dip"
|
||||
android:focusable="false"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/preview"
|
||||
android:layout_width="match_parent"
|
||||
<CheckBox
|
||||
android:id="@+id/flagged_center_right"
|
||||
style="?android:attr/starStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@+id/contact_badge"
|
||||
android:layout_below="@+id/subject_wrapper"
|
||||
android:layout_toLeftOf="@+id/flagged"
|
||||
android:layout_marginLeft="1dip"
|
||||
android:layout_marginBottom="3dip"
|
||||
android:layout_marginRight="3dip"
|
||||
android:bufferType="spannable"
|
||||
android:singleLine="false"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorPrimary"/>
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:paddingTop="3dip"
|
||||
android:paddingLeft="2dip"
|
||||
android:paddingRight="4dip"
|
||||
android:focusable="false"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/date"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@+id/subject_wrapper"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignWithParentIfMissing="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toLeftOf="@+id/flagged_center_right"
|
||||
android:paddingLeft="3dip"
|
||||
android:layout_marginRight="2dip"
|
||||
android:paddingRight="8dip"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorSecondary"/>
|
||||
<CheckBox
|
||||
android:id="@+id/flagged"
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/flagged_bottom_right"
|
||||
style="?android:attr/starStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_below="@+id/date"
|
||||
android:layout_alignParentRight="true"
|
||||
|
||||
android:paddingTop="3dip"
|
||||
android:paddingTop="5dip"
|
||||
android:paddingLeft="2dip"
|
||||
android:paddingRight="4dip"
|
||||
android:focusable="false"
|
||||
/>
|
||||
android:visibility="visible"
|
||||
android:gravity="center_vertical"/>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/thread_count"
|
||||
android:layout_gravity="center|center_vertical"
|
||||
android:textColor="?attr/messageListThreadCountForegroundColor"
|
||||
android:background="?attr/messageListThreadCountBackground"
|
||||
android:layout_toLeftOf="@id/date"
|
||||
android:layout_alignWithParentIfMissing="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="@+id/subject_wrapper"
|
||||
android:layout_marginLeft="3dip"
|
||||
android:layout_marginRight="4dip"
|
||||
android:paddingRight="4dip"
|
||||
android:paddingBottom="1dip"
|
||||
android:paddingLeft="4dip"
|
||||
android:focusable="false"/>
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
@ -1827,10 +1827,17 @@ public class MessageListFragment extends SherlockFragment implements OnItemClick
|
||||
if (mPreviewLines == 0 && mContactsPictureLoader == null) {
|
||||
view.findViewById(R.id.preview).setVisibility(View.GONE);
|
||||
holder.preview = (TextView) view.findViewById(R.id.sender_compact);
|
||||
holder.flagged = (CheckBox) view.findViewById(R.id.flagged_center_right);
|
||||
view.findViewById(R.id.flagged_bottom_right).setVisibility(View.GONE);
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
view.findViewById(R.id.sender_compact).setVisibility(View.GONE);
|
||||
holder.preview = (TextView) view.findViewById(R.id.preview);
|
||||
holder.flagged = (CheckBox) view.findViewById(R.id.flagged_bottom_right);
|
||||
view.findViewById(R.id.flagged_center_right).setVisibility(View.GONE);
|
||||
|
||||
}
|
||||
|
||||
QuickContactBadge contactBadge =
|
||||
@ -1861,7 +1868,6 @@ public class MessageListFragment extends SherlockFragment implements OnItemClick
|
||||
mFontSizes.setViewTextSize(holder.threadCount, mFontSizes.getMessageListSubject()); // thread count is next to subject
|
||||
view.findViewById(R.id.selected_checkbox_wrapper).setVisibility((mCheckboxes) ? View.VISIBLE : View.GONE);
|
||||
|
||||
holder.flagged = (CheckBox) view.findViewById(R.id.flagged);
|
||||
holder.flagged.setVisibility(mStars ? View.VISIBLE : View.GONE);
|
||||
holder.flagged.setOnClickListener(holder);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user