Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
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
Expand All @@ -13,10 +12,9 @@
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 {

Check warning

Code scanning / detekt

Reports multiple space usages Warning

Unnecessary long whitespace

companion object {
const val EXTRA_SHOW_ARCHIVED = "show_archived"
Expand All @@ -27,7 +25,7 @@
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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ class SettingsFragment : PreferenceFragmentCompat() {
}

getPrefByKey<Preference>(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
}

Expand Down
44 changes: 24 additions & 20 deletions app/src/main/res/layout/activity_edit_folder.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -65,48 +66,51 @@
</RelativeLayout>

<LinearLayout
android:layout_marginTop="48dp"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_marginHorizontal="16dp"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/activity_vertical_margin"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/folder_name_container"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">

<LinearLayout
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="50"
android:gravity="center">

<TextView
android:id="@+id/bt_remove"
<com.google.android.material.button.MaterialButton
android:id="@+id/bt_archive"
style="@style/Widget.Material3.Button.TextButton"
android:padding="16dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/remove_from_app"
android:textColor="@color/colorDanger"
android:textStyle="bold" />
android:text="@string/action_archive_project"
android:textColor="@color/colorOnPrimaryContainer"/>
</LinearLayout>


<LinearLayout
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:layout_weight="50">
android:gravity="center">

<com.google.android.material.button.MaterialButton
android:id="@+id/bt_archive"
style="@style/Widget.Material3.Button.TextButton"
android:padding="16dp"
<TextView
android:id="@+id/bt_remove"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/action_archive_project"
android:textColor="@color/colorOnPrimaryContainer"/>
android:text="@string/remove_from_app"
android:textColor="@color/colorDanger"
android:textStyle="bold" />
</LinearLayout>





</LinearLayout>

</androidx.constraintlayout.widget.ConstraintLayout>
8 changes: 4 additions & 4 deletions app/src/main/res/layout/custom_bottom_nav.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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" />

<TextView
Expand All @@ -43,7 +43,7 @@
android:padding="0dp"
android:soundEffectsEnabled="false"
android:text="@string/my_media"
android:textColor="@color/black"
android:textColor="@color/white"
android:textSize="12sp"
tools:ignore="KeyboardInaccessibleWidget" />

Expand Down Expand Up @@ -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" />

<TextView
Expand All @@ -103,7 +103,7 @@
android:focusable="false"
android:padding="0dp"
android:soundEffectsEnabled="false"
android:textColor="@color/black"
android:textColor="@color/white"
android:text="@string/action_settings"
android:textSize="12sp"
tools:ignore="KeyboardInaccessibleWidget" />
Expand Down
19 changes: 16 additions & 3 deletions app/src/main/res/layout/popup_folder_options.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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" />


Expand All @@ -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" />



<TextView
android:id="@+id/menu_folder_bar_archive_folder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackground"
android:padding="4dp"
android:text="@string/popup_archive_folder"
android:textSize="16sp" />


Expand All @@ -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" />


Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/menu/menu_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<item
android:id="@+id/menu_folders"
android:icon="@drawable/ic_menu"
app:iconTint="@color/black"
android:iconTint="@color/colorOnBackground"
app:iconTint="@color/white"
android:iconTint="@color/white"
android:orderInCategory="300"
android:title="@string/folders"
android:visible="true"
Expand Down
12 changes: 9 additions & 3 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,16 @@
<string name="lbl_select_media">Select Media</string>
<string name="lbl_remove_folder">Remove Folder</string>

<string name="popup_rename_folder">Rename folder</string>
<string name="popup_select_media">Select media</string>
<string name="popup_archive_folder">Archive folder</string>
<string name="popup_remove_folder">Remove folder from app</string>

<string name="folder_empty_warning">Folder name cannot be empty</string>
<string name="folder_rename_success">Folder renamed</string>
<string name="folder_not_found">Folder not found</string>
<string name="folder_removed">Folder removed</string>
<string name="folder_archived">Folder archived</string>

<!-- MainFragment -->

Expand Down Expand Up @@ -115,7 +121,7 @@
<!-- </string>-->


<string name="proof_mode_warning_text">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 <b>Save</b> nor <b>OpenArchive</b> 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.</string>
<string name="proof_mode_warning_text">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. <b>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.</b> Android requires location access to collect this information.</string>

<string name="prefs_share_proofmode_title">ProofMode Identity</string>
<string name="prefs_share_proofmode_summary">Share ProofMode Public Key</string>
Expand Down Expand Up @@ -416,9 +422,9 @@
<string name="pref_title_archive">Archive</string>
<string name="pref_title_privacy_policy">Read our Terms &amp; Privacy Policy</string>
<string name="pref_title_media_servers">Media Servers</string>
<string name="pref_title_media_folders">Media Folders</string>
<string name="pref_title_media_folders">Archived Folders</string>
<string name="pref_summary_media_servers">Manage your servers</string>
<string name="pref_summary_media_folders">Manage your folders</string>
<string name="pref_summary_media_folders">Manage your archived folders</string>
<string name="pref_summary_privacy_policy">Read our Terms &amp; Privacy Policy</string>

<string name="pref_app_passcode" translatable="false">passcode_enabled</string>
Expand Down
12 changes: 6 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down