From 443a5fac80964c2bbad77cf21f05d79704691355 Mon Sep 17 00:00:00 2001 From: Elelan's Macbook Pro Date: Wed, 16 Apr 2025 14:34:26 +0530 Subject: [PATCH 1/2] archive folder popup item added settings fragment directly move to ArchivedFolders --- .../openarchive/features/main/MainActivity.kt | 17 +++++++++++++++++ .../features/settings/FoldersActivity.kt | 6 ++---- .../features/settings/SettingsFragment.kt | 4 +++- .../main/res/layout/popup_folder_options.xml | 19 ++++++++++++++++--- app/src/main/res/values/strings.xml | 12 +++++++++--- gradle/libs.versions.toml | 12 ++++++------ 6 files changed, 53 insertions(+), 17 deletions(-) diff --git a/app/src/main/java/net/opendasharchive/openarchive/features/main/MainActivity.kt b/app/src/main/java/net/opendasharchive/openarchive/features/main/MainActivity.kt index 24bc83d8..5c2ff5ef 100644 --- a/app/src/main/java/net/opendasharchive/openarchive/features/main/MainActivity.kt +++ b/app/src/main/java/net/opendasharchive/openarchive/features/main/MainActivity.kt @@ -432,12 +432,29 @@ class MainActivity : BaseActivity(), SpaceDrawerAdapterListener, FolderDrawerAda popup.dismiss() setFolderBarMode(FolderBarMode.SELECTION) } + // Rename folder popupBinding.menuFolderBarRenameFolder.setOnClickListener { popup.dismiss() setFolderBarMode(FolderBarMode.EDIT) } + // Archive folder + popupBinding.menuFolderBarArchiveFolder.setOnClickListener { + popup.dismiss() + val selectedProject = getSelectedProject() + if (selectedProject != null) { + selectedProject.isArchived = !selectedProject.isArchived + selectedProject.save() + refreshProjects() + updateCurrentFolderVisibility() + refreshCurrentProject() + Snackbar.make(binding.root, getString(R.string.folder_archived), Snackbar.LENGTH_SHORT).show() + } else { + Snackbar.make(binding.root, getString(R.string.folder_not_found), Snackbar.LENGTH_LONG).show() + } + } + // Remove folder popupBinding.menuFolderBarRemove.setOnClickListener { popup.dismiss() diff --git a/app/src/main/java/net/opendasharchive/openarchive/features/settings/FoldersActivity.kt b/app/src/main/java/net/opendasharchive/openarchive/features/settings/FoldersActivity.kt index b1d2c2f4..bef5d895 100644 --- a/app/src/main/java/net/opendasharchive/openarchive/features/settings/FoldersActivity.kt +++ b/app/src/main/java/net/opendasharchive/openarchive/features/settings/FoldersActivity.kt @@ -4,7 +4,6 @@ import android.content.Intent import android.os.Bundle import android.view.Menu import android.view.MenuItem -import android.view.View import androidx.recyclerview.widget.LinearLayoutManager import net.opendasharchive.openarchive.FolderAdapter import net.opendasharchive.openarchive.FolderAdapterListener @@ -13,10 +12,9 @@ import net.opendasharchive.openarchive.databinding.ActivityFoldersBinding import net.opendasharchive.openarchive.db.Project import net.opendasharchive.openarchive.db.Space import net.opendasharchive.openarchive.features.core.BaseActivity -import net.opendasharchive.openarchive.features.folders.AddFolderActivity import net.opendasharchive.openarchive.util.extensions.toggle -class FoldersActivity : BaseActivity(), FolderAdapterListener { +class FoldersActivity : BaseActivity(), FolderAdapterListener { companion object { const val EXTRA_SHOW_ARCHIVED = "show_archived" @@ -27,7 +25,7 @@ class FoldersActivity : BaseActivity(), FolderAdapterListener { private lateinit var mBinding: ActivityFoldersBinding private lateinit var mAdapter: FolderAdapter - private var mArchived = false + private var mArchived = true private var mSelectedSpaceId = -1L private var mSelectedProjectId: Long = -1L diff --git a/app/src/main/java/net/opendasharchive/openarchive/features/settings/SettingsFragment.kt b/app/src/main/java/net/opendasharchive/openarchive/features/settings/SettingsFragment.kt index 43439cce..59f7d419 100644 --- a/app/src/main/java/net/opendasharchive/openarchive/features/settings/SettingsFragment.kt +++ b/app/src/main/java/net/opendasharchive/openarchive/features/settings/SettingsFragment.kt @@ -121,7 +121,9 @@ class SettingsFragment : PreferenceFragmentCompat() { } getPrefByKey(R.string.pref_media_folders)?.setOnPreferenceClickListener { - startActivity(Intent(context, FoldersActivity::class.java)) + val intent = Intent(context, FoldersActivity::class.java) + intent.putExtra(FoldersActivity.EXTRA_SHOW_ARCHIVED, true) + startActivity(intent) true } diff --git a/app/src/main/res/layout/popup_folder_options.xml b/app/src/main/res/layout/popup_folder_options.xml index 0e53ef94..b066d29b 100644 --- a/app/src/main/res/layout/popup_folder_options.xml +++ b/app/src/main/res/layout/popup_folder_options.xml @@ -24,7 +24,7 @@ android:layout_weight="1" android:background="?android:attr/selectableItemBackground" android:padding="4dp" - android:text="Rename folder" + android:text="@string/popup_rename_folder" android:textSize="16sp" /> @@ -36,7 +36,20 @@ android:layout_weight="1" android:background="?android:attr/selectableItemBackground" android:padding="4dp" - android:text="Select media" + android:text="@string/popup_select_media" + android:textSize="16sp" /> + + + + @@ -49,7 +62,7 @@ android:layout_weight="1" android:background="?android:attr/selectableItemBackground" android:padding="4dp" - android:text="Remove folder from app" + android:text="@string/popup_remove_folder" android:textSize="16sp" /> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e9a7d8ac..9b200ba8 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -43,10 +43,16 @@ Select Media Remove Folder + Rename folder + Select media + Archive folder + Remove folder from app + Folder name cannot be empty Folder renamed Folder not found Folder removed + Folder archived @@ -115,7 +121,7 @@ - To help verify where your media was captured, ProofMode gathers data from nearby cell towers to corroborate your location. To add credibility and context, it then includes a separate metadata file with your media. Neither Save nor OpenArchive will be able to access or store this location data, it will only be accessible to those with access to the server files. Android requires location access to collect this information. + To help verify where your media was captured, ProofMode gathers data from nearby cell towers to corroborate your location. To add credibility and context, it then includes a separate metadata file with your media. Neither Save nor OpenArchive will be able to access or store this location data, it will only be accessible to those with access to the server files. Android requires location access to collect this information. ProofMode Identity Share ProofMode Public Key @@ -416,9 +422,9 @@ Archive Read our Terms & Privacy Policy Media Servers - Media Folders + Archived Folders Manage your servers - Manage your folders + Manage your archived folders Read our Terms & Privacy Policy passcode_enabled diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 87c02634..da32b815 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -10,7 +10,7 @@ constraintlayout = "2.2.1" constraintlayout-compos = "1.1.1" coordinatorlayout = "1.2.0" core-splashscreen = "1.0.1" -coroutines = "1.10.1" +coroutines = "1.10.2" detekt = "1.23.8" detekt-compose = "0.4.22" detekt-rules-compose = "1.4.0" @@ -21,23 +21,23 @@ gson = "2.11.0" junit = "4.13.2" koin = "4.1.0-Beta5" kotlin = "2.1.20" -ksp = "2.1.20-1.0.32" +ksp = "2.1.20-2.0.0" lifecycle = "2.8.7" orhanobut-logger = "2.2.0" material = "1.12.0" -material3 = "1.3.1" +material3 = "1.3.2" mixpanel = "8.0.2" navigation = "2.8.9" okhttp = "4.12.0" -picasso = "2.5.2" +picasso = "2.71828" preference = "1.2.1" recyclerview = "1.3.2" recyclerview-selection = "1.1.0" -androidx-security-crypto = "1.1.0-alpha06" +androidx-security-crypto = "1.1.0-alpha07" swiperefreshlayout = "1.1.0" retrofit = "2.11.0" robolectric = "4.14.1" -serialization = "1.8.0" +serialization = "1.8.1" timber = "5.0.1" viewpager2 = "1.1.0" work = "2.9.1" From 40ccaed240dc949c252f35c58acb6057b0e57277 Mon Sep 17 00:00:00 2001 From: Elelan's Macbook Pro Date: Thu, 17 Apr 2025 18:32:47 +0530 Subject: [PATCH 2/2] main media bottom bar icons color changed EditFolderActivity buttons positon changed --- .../main/res/layout/activity_edit_folder.xml | 44 ++++++++++--------- app/src/main/res/layout/custom_bottom_nav.xml | 8 ++-- app/src/main/res/menu/menu_main.xml | 4 +- 3 files changed, 30 insertions(+), 26 deletions(-) diff --git a/app/src/main/res/layout/activity_edit_folder.xml b/app/src/main/res/layout/activity_edit_folder.xml index 36ff7d2a..125ab7ce 100644 --- a/app/src/main/res/layout/activity_edit_folder.xml +++ b/app/src/main/res/layout/activity_edit_folder.xml @@ -19,7 +19,7 @@ android:id="@+id/label" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginHorizontal="@dimen/activity_horizontal_margin" + android:layout_marginHorizontal="16dp" android:layout_marginTop="@dimen/activity_vertical_margin" android:text="@string/folder_name" android:textSize="14sp" @@ -32,7 +32,7 @@ style="@style/ThemeOverlay.Material3.TextInputEditText.OutlinedBox" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginHorizontal="@dimen/activity_horizontal_margin" + android:layout_marginHorizontal="16dp" android:layout_marginVertical="@dimen/activity_vertical_margin" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -53,6 +53,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginVertical="@dimen/activity_vertical_margin" + android:layout_marginHorizontal="16dp" android:visibility="gone" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -65,48 +66,51 @@ - + android:text="@string/action_archive_project" + android:textColor="@color/colorOnPrimaryContainer"/> + android:gravity="center"> - + android:text="@string/remove_from_app" + android:textColor="@color/colorDanger" + android:textStyle="bold" /> + + + \ No newline at end of file diff --git a/app/src/main/res/layout/custom_bottom_nav.xml b/app/src/main/res/layout/custom_bottom_nav.xml index 53869c5b..b2978a6e 100644 --- a/app/src/main/res/layout/custom_bottom_nav.xml +++ b/app/src/main/res/layout/custom_bottom_nav.xml @@ -29,7 +29,7 @@ app:iconGravity="textStart" app:iconPadding="0dp" app:iconSize="24dp" - app:iconTint="@color/black" + app:iconTint="@color/white" app:rippleColor="@color/c23_light_grey" /> @@ -90,7 +90,7 @@ app:iconGravity="textStart" app:iconPadding="0dp" app:iconSize="24dp" - app:iconTint="@color/black" + app:iconTint="@color/white" app:rippleColor="@color/c23_light_grey" /> diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml index b87f2acd..8f6929ee 100644 --- a/app/src/main/res/menu/menu_main.xml +++ b/app/src/main/res/menu/menu_main.xml @@ -16,8 +16,8 @@