Refactor media overview activity to display documents

// FREEBIE
This commit is contained in:
Moxie Marlinspike
2017-09-25 08:32:45 -07:00
parent c6b2e785a5
commit 8ce914a344
19 changed files with 504 additions and 155 deletions

View File

@@ -1,24 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width="match_parent"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
android:layout_height="?android:attr/actionBarSize"
android:background="?attr/media_overview_toolbar_background"
android:titleTextColor="?attr/media_overview_toolbar_foreground"
android:foreground="?attr/media_overview_toolbar_foreground"
app:layout_scrollFlags="scroll|enterAlways"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/media_grid"
<android.support.design.widget.TabLayout
android:id="@+id/tab_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
app:tabBackground="?attr/media_overview_toolbar_background"
app:tabIndicatorColor="@color/textsecure_primary"
app:tabSelectedTextColor="@color/textsecure_primary"/>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical" />
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
<TextView android:id="@+id/no_images"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="24sp"
android:gravity="center"
android:paddingTop="30dp"
android:visibility="gone"
android:text="@string/media_overview_activity__no_media" />
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp">
<org.thoughtcrime.securesms.components.DocumentView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/document_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
app:documentForegroundTintColor="?attr/media_overview_document_foreground"
app:documentBackgroundTintColor="?attr/media_overview_document_background"
android:visibility="visible"
tools:visibility="visible"/>
<TextView android:id="@+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textSize="12sp"
android:textColor="?attr/media_overview_document_foreground"
android:paddingTop="20dp"
tools:text="Jun 1"/>
</LinearLayout>

View File

@@ -3,14 +3,14 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:background="?attr/media_overview_toolbar_background"
android:padding="16dp">
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:textColor="@color/gray50"
android:textColor="?attr/media_overview_header_foreground"
android:textSize="14sp"
android:textStyle="bold"
android:textAllCaps="true"

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/media_overview_toolbar_background">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical" />
<TextView android:id="@+id/no_documents"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="24sp"
android:gravity="center"
android:visibility="gone"
android:text="@string/media_overview_documents_fragment__no_documents_found" />
</RelativeLayout>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/media_overview_toolbar_background">
<android.support.v7.widget.RecyclerView
android:id="@+id/media_grid"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical" />
<TextView android:id="@+id/no_images"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="24sp"
android:gravity="center"
android:paddingTop="30dp"
android:visibility="gone"
android:text="@string/media_overview_activity__no_media" />
</RelativeLayout>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/media_overview_toolbar_background"
android:padding="16dp">
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:textColor="?attr/media_overview_header_foreground"
android:textSize="14sp"
android:textStyle="bold"
android:textAllCaps="true"
tools:text="March 1, 2015" />
</FrameLayout>