diff options
| author | Joel Klinghed <the_jk@spawned.biz> | 2025-02-20 22:59:50 +0100 |
|---|---|---|
| committer | Joel Klinghed <the_jk@spawned.biz> | 2025-02-20 22:59:50 +0100 |
| commit | ab3d085e9e883b0a146e55aa9f80aaf0b326c4aa (patch) | |
| tree | 6cca0cba1ed7b5138b8f519656e73deb9442f963 | |
| parent | d18325aa04d0c1053aae3aec47c5dca495d65e78 (diff) | |
WIPWIP
| -rw-r--r-- | app/src/main/java/org/the_jk/cleversync/AddSyncFragment.kt | 32 | ||||
| -rw-r--r-- | app/src/main/java/org/the_jk/cleversync/EditSyncFragment.kt | 32 | ||||
| -rw-r--r-- | app/src/main/java/org/the_jk/cleversync/SyncListFragment.kt | 32 | ||||
| -rw-r--r-- | app/src/main/res/drawable/baseline_arrow_back_48.xml | 5 | ||||
| -rw-r--r-- | app/src/main/res/drawable/baseline_arrow_forward_48.xml | 5 | ||||
| -rw-r--r-- | app/src/main/res/layout/activity_main.xml | 5 | ||||
| -rw-r--r-- | app/src/main/res/layout/content_main.xml | 2 | ||||
| -rw-r--r-- | app/src/main/res/layout/fragment_add_sync.xml | 13 | ||||
| -rw-r--r-- | app/src/main/res/layout/fragment_edit_sync.xml | 13 | ||||
| -rw-r--r-- | app/src/main/res/layout/fragment_sync_list.xml | 20 | ||||
| -rw-r--r-- | app/src/main/res/layout/fragment_sync_list_empty.xml | 32 | ||||
| -rw-r--r-- | app/src/main/res/layout/fragment_sync_list_list.xml | 8 | ||||
| -rw-r--r-- | app/src/main/res/layout/sync_list_item.xml | 64 | ||||
| -rw-r--r-- | app/src/main/res/navigation/nav_graph.xml | 32 | ||||
| -rw-r--r-- | app/src/main/res/values/strings.xml | 6 |
15 files changed, 297 insertions, 4 deletions
diff --git a/app/src/main/java/org/the_jk/cleversync/AddSyncFragment.kt b/app/src/main/java/org/the_jk/cleversync/AddSyncFragment.kt new file mode 100644 index 0000000..5ee4124 --- /dev/null +++ b/app/src/main/java/org/the_jk/cleversync/AddSyncFragment.kt @@ -0,0 +1,32 @@ +package org.the_jk.cleversync + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.fragment.app.Fragment +import org.the_jk.cleversync.databinding.FragmentAddSyncBinding + +class AddSyncFragment : Fragment() { + private var _binding: FragmentAddSyncBinding? = null + private val binding get() = _binding!! + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + _binding = FragmentAddSyncBinding.inflate(inflater, container, false) + return binding.root + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + + + } + + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } +} diff --git a/app/src/main/java/org/the_jk/cleversync/EditSyncFragment.kt b/app/src/main/java/org/the_jk/cleversync/EditSyncFragment.kt new file mode 100644 index 0000000..9bd6ff1 --- /dev/null +++ b/app/src/main/java/org/the_jk/cleversync/EditSyncFragment.kt @@ -0,0 +1,32 @@ +package org.the_jk.cleversync + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.fragment.app.Fragment +import org.the_jk.cleversync.databinding.FragmentEditSyncBinding + +class EditSyncFragment : Fragment() { + private var _binding: FragmentEditSyncBinding? = null + private val binding get() = _binding!! + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + _binding = FragmentEditSyncBinding.inflate(inflater, container, false) + return binding.root + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + + + } + + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } +} diff --git a/app/src/main/java/org/the_jk/cleversync/SyncListFragment.kt b/app/src/main/java/org/the_jk/cleversync/SyncListFragment.kt new file mode 100644 index 0000000..1b6b6be --- /dev/null +++ b/app/src/main/java/org/the_jk/cleversync/SyncListFragment.kt @@ -0,0 +1,32 @@ +package org.the_jk.cleversync + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.fragment.app.Fragment +import org.the_jk.cleversync.databinding.FragmentSyncListBinding + +class SyncListFragment : Fragment() { + private var _binding: FragmentSyncListBinding? = null + private val binding get() = _binding!! + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + _binding = FragmentSyncListBinding.inflate(inflater, container, false) + return binding.root + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + + + } + + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } +} diff --git a/app/src/main/res/drawable/baseline_arrow_back_48.xml b/app/src/main/res/drawable/baseline_arrow_back_48.xml new file mode 100644 index 0000000..9971b26 --- /dev/null +++ b/app/src/main/res/drawable/baseline_arrow_back_48.xml @@ -0,0 +1,5 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" android:autoMirrored="true" android:height="48dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="48dp"> + + <path android:fillColor="@android:color/white" android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/> + +</vector> diff --git a/app/src/main/res/drawable/baseline_arrow_forward_48.xml b/app/src/main/res/drawable/baseline_arrow_forward_48.xml new file mode 100644 index 0000000..b193150 --- /dev/null +++ b/app/src/main/res/drawable/baseline_arrow_forward_48.xml @@ -0,0 +1,5 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" android:autoMirrored="true" android:height="48dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="48dp"> + + <path android:fillColor="@android:color/white" android:pathData="M12,4l-1.41,1.41L16.17,11H4v2h12.17l-5.58,5.59L12,20l8,-8z"/> + +</vector> diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index b214f0f..48aea59 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -20,13 +20,14 @@ </com.google.android.material.appbar.AppBarLayout> <com.google.android.material.floatingactionbutton.FloatingActionButton - android:id="@+id/fab" + android:id="@+id/add" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|end" android:layout_marginBottom="16dp" android:layout_marginEnd="@dimen/fab_margin" - app:srcCompat="@android:drawable/ic_dialog_email" /> + android:contentDescription="@string/add_fab_label" + app:srcCompat="@android:drawable/ic_menu_add" /> <include layout="@layout/content_main" /> diff --git a/app/src/main/res/layout/content_main.xml b/app/src/main/res/layout/content_main.xml index 041049e..f377027 100644 --- a/app/src/main/res/layout/content_main.xml +++ b/app/src/main/res/layout/content_main.xml @@ -5,7 +5,7 @@ android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior"> - <fragment + <androidx.fragment.app.FragmentContainerView android:id="@+id/nav_host_fragment_content_main" android:name="androidx.navigation.fragment.NavHostFragment" android:layout_width="0dp" diff --git a/app/src/main/res/layout/fragment_add_sync.xml b/app/src/main/res/layout/fragment_add_sync.xml new file mode 100644 index 0000000..ef85b76 --- /dev/null +++ b/app/src/main/res/layout/fragment_add_sync.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".AddSyncFragment"> + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:padding="16dp"> + +</androidx.constraintlayout.widget.ConstraintLayout> +</androidx.core.widget.NestedScrollView> diff --git a/app/src/main/res/layout/fragment_edit_sync.xml b/app/src/main/res/layout/fragment_edit_sync.xml new file mode 100644 index 0000000..1f399a9 --- /dev/null +++ b/app/src/main/res/layout/fragment_edit_sync.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".EditSyncFragment"> + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:padding="16dp"> + + </androidx.constraintlayout.widget.ConstraintLayout> +</androidx.core.widget.NestedScrollView> diff --git a/app/src/main/res/layout/fragment_sync_list.xml b/app/src/main/res/layout/fragment_sync_list.xml new file mode 100644 index 0000000..c14b302 --- /dev/null +++ b/app/src/main/res/layout/fragment_sync_list.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<ViewSwitcher xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".SyncListFragment"> + + <include + android:id="@+id/list" + layout="@layout/fragment_sync_list_list" + android:layout_width="match_parent" + android:layout_height="match_parent" /> + + <include + android:id="@+id/empty_view" + layout="@layout/fragment_sync_list_empty" + android:layout_width="match_parent" + android:layout_height="match_parent"/> + +</ViewSwitcher> diff --git a/app/src/main/res/layout/fragment_sync_list_empty.xml b/app/src/main/res/layout/fragment_sync_list_empty.xml new file mode 100644 index 0000000..3272e6b --- /dev/null +++ b/app/src/main/res/layout/fragment_sync_list_empty.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.constraintlayout.widget.ConstraintLayout 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"> + + <TextView + android:id="@+id/title" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:text="@string/sync_list_title" + android:textAlignment="center" + android:textAppearance="@style/TextAppearance.AppCompat.Display1" + app:layout_constraintBottom_toTopOf="@+id/text" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <TextView + android:id="@+id/text" + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_margin="16dp" + android:text="@string/sync_list_text" + android:textAppearance="@style/TextAppearance.AppCompat.Body1" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/title" /> + +</androidx.constraintlayout.widget.ConstraintLayout> diff --git a/app/src/main/res/layout/fragment_sync_list_list.xml b/app/src/main/res/layout/fragment_sync_list_list.xml new file mode 100644 index 0000000..6b095a7 --- /dev/null +++ b/app/src/main/res/layout/fragment_sync_list_list.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + xmlns:tools="http://schemas.android.com/tools" + tools:context=".SyncListFragment" + tools:itemCount="3" + tools:listitem="@layout/sync_list_item" /> diff --git a/app/src/main/res/layout/sync_list_item.xml b/app/src/main/res/layout/sync_list_item.xml new file mode 100644 index 0000000..68d1783 --- /dev/null +++ b/app/src/main/res/layout/sync_list_item.xml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.constraintlayout.widget.ConstraintLayout 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:layout_width="match_parent" + android:layout_height="wrap_content"> + + <ImageView + android:id="@+id/icon" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="16dp" + app:layout_constraintEnd_toStartOf="@id/right_title" + app:layout_constraintStart_toEndOf="@id/left_title" + app:layout_constraintTop_toTopOf="parent" + tools:contentDescription="Syncing left to right, status good" + tools:src="@drawable/baseline_arrow_forward_48" + tools:ignore="ContentDescription" /> + + <TextView + android:id="@+id/left_title" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginHorizontal="16dp" + android:textAppearance="@style/TextAppearance.AppCompat.Medium" + app:layout_constraintBottom_toBottomOf="@id/icon" + app:layout_constraintEnd_toStartOf="@+id/icon" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="@id/icon" + tools:text="Source Title" /> + + <TextView + android:id="@+id/right_title" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginHorizontal="16dp" + android:textAlignment="viewEnd" + android:textAppearance="@style/TextAppearance.AppCompat.Medium" + app:layout_constraintBottom_toBottomOf="@id/left_title" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@+id/icon" + app:layout_constraintTop_toTopOf="@id/left_title" + tools:text="Target Title" /> + + <TextView + android:id="@+id/status" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:textAppearance="@style/TextAppearance.AppCompat.Small" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/title_barrier" + tools:text="Doing nothing" /> + + <androidx.constraintlayout.widget.Barrier + android:id="@+id/title_barrier" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + app:barrierDirection="bottom" + app:constraint_referenced_ids="left_title, right_title, icon" /> + +</androidx.constraintlayout.widget.ConstraintLayout> diff --git a/app/src/main/res/navigation/nav_graph.xml b/app/src/main/res/navigation/nav_graph.xml index 9c92ead..bc57ed6 100644 --- a/app/src/main/res/navigation/nav_graph.xml +++ b/app/src/main/res/navigation/nav_graph.xml @@ -3,7 +3,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/nav_graph" - app:startDestination="@id/FirstFragment"> + app:startDestination="@id/SyncList"> <fragment android:id="@+id/FirstFragment" @@ -25,4 +25,34 @@ android:id="@+id/action_SecondFragment_to_FirstFragment" app:destination="@id/FirstFragment" /> </fragment> + + <fragment android:id="@+id/SyncList" + android:name="org.the_jk.cleversync.SyncListFragment" + android:label="@string/sync_list_fragment_label" + tools:layout="@layout/fragment_sync_list"> + <action + android:id="@+id/action_SyncListFragment_AddSyncFragment" + app:destination="@id/AddSyncFragment" /> + + <action + android:id="@+id/action_SyncListFragment_EditSyncFragment" + app:destination="@id/EditSyncFragment" /> + </fragment> + + <fragment android:id="@+id/AddSyncFragment" + android:name="org.the_jk.cleversync.AddSyncFragment" + android:label="@string/add_sync_fragment_label" + tools:layout="@layout/fragment_add_sync"> + + <action + android:id="@+id/action_AddSyncFragment_EditSyncFragment" + app:destination="@id/EditSyncFragment" /> + </fragment> + + <fragment android:id="@+id/EditSyncFragment" + android:name="org.the_jk.cleversync.EditSyncFragment" + android:label="@string/edit_sync_fragment_label" + tools:layout="@layout/fragment_edit_sync"> + <argument android:name="sync_id" app:argType="long" /> + </fragment> </navigation> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 723c6e1..4283232 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -52,4 +52,10 @@ vitae volutpat diam dignissim. </string> <string name="local_directory">Local directory</string> + <string name="sync_list_fragment_label">Syncs</string> + <string name="add_sync_fragment_label">Add sync</string> + <string name="edit_sync_fragment_label">Edit sync</string> + <string name="add_fab_label">Add sync</string> + <string name="sync_list_title">Welcome!</string> + <string name="sync_list_text">Here is where your different syncs should be.\nA \"sync\" is an automation that will, at opportune times, copy and synchronize data between two different locations.\nMaybe you want to backup your photos to a samba drive at home?\nPerhaps you can save time and effort by always syncing your current projects at the office?\n\nWhatever it might be, you start by tapping the plus in the bottom right corner!</string> </resources> |
