dividers
This commit is contained in:
@@ -34,7 +34,6 @@ public class NotificationListFragment extends Fragment implements LoaderManager.
|
|||||||
private NotificationListAdapter mAdapter;
|
private NotificationListAdapter mAdapter;
|
||||||
|
|
||||||
// TODO reload list if new notification arrives
|
// TODO reload list if new notification arrives
|
||||||
// TODO notification list divider
|
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,77 +1,89 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content">
|
||||||
android:orientation="horizontal"
|
|
||||||
android:padding="8dp"
|
|
||||||
android:foreground="?attr/selectableItemBackground">
|
|
||||||
|
|
||||||
<ImageView
|
<LinearLayout
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
android:id="@+id/notification_item_appIcon"
|
|
||||||
android:layout_width="64dp"
|
|
||||||
android:layout_height="64dp"
|
|
||||||
tools:src="@mipmap/ic_launcher" />
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="center_horizontal"
|
android:foreground="?attr/selectableItemBackground"
|
||||||
android:orientation="vertical">
|
android:orientation="horizontal"
|
||||||
|
android:padding="8dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:contentDescription="@string/notification_small_icon_cd"
|
android:id="@+id/notification_item_appIcon"
|
||||||
android:id="@+id/notification_item_smallIcon"
|
android:layout_width="64dp"
|
||||||
android:layout_width="24dp"
|
android:layout_height="64dp"
|
||||||
android:layout_height="24dp"
|
android:layout_marginEnd="16dp"
|
||||||
tools:src="@drawable/ic_sd_card" />
|
tools:src="@mipmap/ic_launcher" />
|
||||||
|
|
||||||
<TextView
|
<RelativeLayout
|
||||||
android:id="@+id/notification_item_appName"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
|
||||||
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_gravity="center_horizontal"
|
||||||
android:lines="1"
|
android:orientation="vertical">
|
||||||
tools:text="A really long app name thats ellipsed"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:layout_toEndOf="@+id/notification_item_smallIcon"
|
|
||||||
android:layout_toStartOf="@+id/notification_item_date"/>
|
|
||||||
|
|
||||||
<TextView
|
<ImageView
|
||||||
android:lines="1"
|
android:id="@+id/notification_item_smallIcon"
|
||||||
android:ellipsize="end"
|
android:layout_width="24dp"
|
||||||
android:layout_marginTop="4dp"
|
android:layout_height="24dp"
|
||||||
android:id="@+id/notification_item_title"
|
android:contentDescription="@string/notification_small_icon_cd"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
|
tools:src="@drawable/ic_sd_card" />
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_below="@+id/notification_item_appName"
|
|
||||||
tools:text="Notification title" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_marginStart="4dp"
|
android:id="@+id/notification_item_appName"
|
||||||
android:id="@+id/notification_item_date"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_alignParentTop="true"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_toEndOf="@+id/notification_item_smallIcon"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_toStartOf="@+id/notification_item_date"
|
||||||
tools:text="16 hours ago"
|
android:ellipsize="end"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Caption" />
|
android:lines="1"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||||
|
tools:text="A really long app name thats ellipsed" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:lines="3"
|
android:id="@+id/notification_item_title"
|
||||||
android:ellipsize="end"
|
android:layout_width="wrap_content"
|
||||||
android:id="@+id/notification_item_message"
|
android:layout_height="wrap_content"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
android:layout_alignParentStart="true"
|
||||||
android:layout_width="wrap_content"
|
android:layout_below="@+id/notification_item_appName"
|
||||||
android:layout_height="wrap_content"
|
android:layout_marginTop="4dp"
|
||||||
android:layout_alignParentStart="true"
|
android:ellipsize="end"
|
||||||
android:layout_below="@+id/notification_item_title"
|
android:lines="1"
|
||||||
tools:text="Some messages wit lots of text and \nTwo lines" />
|
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
|
||||||
</RelativeLayout>
|
tools:text="Notification title" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/notification_item_date"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
|
||||||
|
tools:text="16 hours ago" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/notification_item_message"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_below="@+id/notification_item_title"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="3"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
||||||
|
tools:text="Some messages wit lots of text and \nTwo lines" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_gravity="bottom"
|
||||||
|
android:background="?attr/colorControlHighlight"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
/>
|
||||||
|
</FrameLayout>
|
||||||
Reference in New Issue
Block a user