diff options
author | Joe Robinson <joe@lc8n.com> | 2019-04-20 17:45:19 +0200 |
---|---|---|
committer | Joe Robinson <joe@lc8n.com> | 2019-04-20 17:45:19 +0200 |
commit | 3075e6acb5c29434b2d7be0c6ad7747a6358f045 (patch) | |
tree | 214d37dfb9c7d2f4aa0dc07cb109f66e4165cf74 /app/src/main/res/layout | |
parent | 9d430209d39d0e68f6311adfff9d476c8856f662 (diff) |
Added Gallery View
Diffstat (limited to 'app/src/main/res/layout')
-rw-r--r-- | app/src/main/res/layout/activity_main.xml | 34 | ||||
-rw-r--r-- | app/src/main/res/layout/gallery_fragment.xml | 14 | ||||
-rw-r--r-- | app/src/main/res/layout/image_gallery_item.xml | 16 |
3 files changed, 54 insertions, 10 deletions
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 4cc95a2..3e1b702 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -9,18 +9,32 @@ android:fitsSystemWindows="true" tools:openDrawer="start"> - <!--<include--> - <!--layout="@layout/app_bar_main"--> - <!--android:layout_width="match_parent"--> - <!--android:layout_height="match_parent"/>--> - <fragment - android:name="androidx.navigation.fragment.NavHostFragment" - android:id="@+id/nav_host_fragment" + <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" - app:defaultNavHost="true" - app:navGraph="@navigation/nav_graph" - /> + android:orientation="vertical"> + + <com.google.android.material.appbar.AppBarLayout + android:id="@+id/appbar" + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <androidx.appcompat.widget.Toolbar + android:id="@+id/toolbar" + android:layout_width="match_parent" + android:layout_height="?attr/actionBarSize"/> + + </com.google.android.material.appbar.AppBarLayout> + <fragment + android:name="androidx.navigation.fragment.NavHostFragment" + android:id="@+id/nav_host_fragment" + android:layout_width="match_parent" + android:layout_height="match_parent" + app:defaultNavHost="true" + app:navGraph="@navigation/nav_graph" + /> + + </LinearLayout> <com.google.android.material.navigation.NavigationView diff --git a/app/src/main/res/layout/gallery_fragment.xml b/app/src/main/res/layout/gallery_fragment.xml new file mode 100644 index 0000000..b05559c --- /dev/null +++ b/app/src/main/res/layout/gallery_fragment.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:id="@+id/gallery_fragment"> + <androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/gallery_view" + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:listitem="@layout/image_gallery_item"/> +</RelativeLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/image_gallery_item.xml b/app/src/main/res/layout/image_gallery_item.xml new file mode 100644 index 0000000..bd2fc7a --- /dev/null +++ b/app/src/main/res/layout/image_gallery_item.xml @@ -0,0 +1,16 @@ +<?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"> +<com.android.volley.toolbox.NetworkImageView + xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/gallery_thumbnail" + android:layout_width="wrap_content" + android:layout_height="wrap_content"/> + <TextView + android:id="@+id/gallery_title" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@id/gallery_thumbnail" + android:textSize="10dp"/> +</RelativeLayout>
\ No newline at end of file |