summaryrefslogtreecommitdiff
path: root/app/src/main/res
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/res')
-rw-r--r--app/src/main/res/layout/activity_main.xml34
-rw-r--r--app/src/main/res/layout/gallery_fragment.xml14
-rw-r--r--app/src/main/res/layout/image_gallery_item.xml16
-rw-r--r--app/src/main/res/menu/activity_main_drawer.xml4
-rw-r--r--app/src/main/res/navigation/nav_graph.xml26
5 files changed, 74 insertions, 20 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
diff --git a/app/src/main/res/menu/activity_main_drawer.xml b/app/src/main/res/menu/activity_main_drawer.xml
index cab4f73..5c09517 100644
--- a/app/src/main/res/menu/activity_main_drawer.xml
+++ b/app/src/main/res/menu/activity_main_drawer.xml
@@ -5,11 +5,11 @@
<group android:checkableBehavior="single">
<item
- android:id="@+id/nav_upload"
+ android:id="@+id/list_fragment"
android:icon="@drawable/ic_menu_camera"
android:title="Upload"/>
<item
- android:id="@+id/nav_gallery"
+ android:id="@+id/gallery_fragment"
android:icon="@drawable/ic_menu_gallery"
android:title="Gallery"/>
<item
diff --git a/app/src/main/res/navigation/nav_graph.xml b/app/src/main/res/navigation/nav_graph.xml
index ef2595c..77eca0e 100644
--- a/app/src/main/res/navigation/nav_graph.xml
+++ b/app/src/main/res/navigation/nav_graph.xml
@@ -3,16 +3,26 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/nav_graph"
- app:startDestination="@id/main_fragment">
+ app:startDestination="@id/list_fragment">
>
<fragment
- android:id="@+id/main_fragment"
- android:name="uk.co.blatech.blaupload3.view.ListFragment"
- android:label="First Fragment"
- tools:layout="@layout/list_fragment" />
- <fragment
android:id="@+id/list_fragment"
android:name="uk.co.blatech.blaupload3.view.ListFragment"
- android:label="First Fragment"
- tools:layout="@layout/list_fragment" />
+ android:label="List Fragment"
+ tools:layout="@layout/list_fragment">
+ <action
+ android:id="@+id/action_list_fragment_to_gallery_fragment"
+ app:destination="@id/gallery_fragment"
+ />
+ </fragment>
+ <fragment
+ android:id="@+id/gallery_fragment"
+ android:name="uk.co.blatech.blaupload3.view.GalleryFragment"
+ android:label="Gallery Fragment"
+ tools:layout="@layout/gallery_fragment">
+ <action
+ android:id="@+id/action_gallery_fragment_to_list_fragment"
+ app:destination="@id/gallery_fragment"
+ />
+ </fragment>
</navigation> \ No newline at end of file