Skip to content

Commit 1fc92a0

Browse files
committed
wip
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
1 parent 441c285 commit 1fc92a0

4 files changed

Lines changed: 40 additions & 14 deletions

File tree

app/src/main/java/com/nextcloud/ui/albumItemActions/AlbumItemAction.kt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,13 @@ enum class AlbumItemAction(val id: Int, val titleId: Int, val iconId: Int) {
1919
R.id.action_select_images_from_account,
2020
R.string.album_upload_from_account,
2121
R.drawable.file_image
22-
),
23-
RENAME_ALBUM(R.id.action_rename_file, R.string.album_rename, R.drawable.ic_edit),
24-
SHARE_ALBUM(R.id.action_share_album, R.string.album_share, R.drawable.ic_share),
25-
DELETE_ALBUM(R.id.action_delete, R.string.album_delete, R.drawable.ic_delete);
22+
);
2623

2724
companion object {
2825
@JvmField
2926
val SORTED_VALUES = listOf(
3027
UPLOAD_FROM_CAMERA_ROLL,
31-
SELECT_IMAGES_FROM_ACCOUNT,
32-
RENAME_ALBUM,
33-
SHARE_ALBUM,
34-
DELETE_ALBUM
28+
SELECT_IMAGES_FROM_ACCOUNT
3529
)
3630
}
3731
}

app/src/main/java/com/owncloud/android/ui/fragment/albums/AlbumItemsFragment.kt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ class AlbumItemsFragment :
230230
viewThemeUtils.material.themeFAB(this)
231231

232232
setOnClickListener {
233-
openAlbumActionsMenu()
233+
openAddMediaMenu()
234234
}
235235
}
236236

@@ -284,17 +284,18 @@ class AlbumItemsFragment :
284284
object : MenuProvider {
285285
override fun onCreateMenu(menu: Menu, menuInflater: MenuInflater) {
286286
menu.clear()
287+
menuInflater.inflate(R.menu.fragment_album_items, menu)
287288
}
288289

289-
override fun onMenuItemSelected(menuItem: MenuItem): Boolean = true
290+
override fun onMenuItemSelected(menuItem: MenuItem): Boolean = onAlbumActionChosen(menuItem.itemId)
290291
},
291292
viewLifecycleOwner,
292293
Lifecycle.State.RESUMED
293294
)
294295
}
295296

296-
private fun openAlbumActionsMenu() {
297-
throttler.run("overflowClick") {
297+
private fun openAddMediaMenu() {
298+
throttler.run("addMediaClick") {
298299
val supportFragmentManager = requireActivity().supportFragmentManager
299300

300301
AlbumItemActionsBottomSheet.newInstance()
@@ -336,7 +337,7 @@ class AlbumItemsFragment :
336337
true
337338
}
338339

339-
R.id.action_rename_file -> {
340+
R.id.action_rename_album -> {
340341
CreateAlbumDialogFragment.newInstance(albumName)
341342
.show(
342343
requireActivity().supportFragmentManager,
@@ -350,7 +351,7 @@ class AlbumItemsFragment :
350351
true
351352
}
352353

353-
R.id.action_delete -> {
354+
R.id.action_delete_album -> {
354355
showConfirmationDialog(true, null)
355356
true
356357
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ Nextcloud - Android Client
4+
~
5+
~ SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
6+
~ SPDX-License-Identifier: AGPL-3.0-or-later
7+
-->
8+
<menu xmlns:android="http://schemas.android.com/apk/res/android"
9+
xmlns:app="http://schemas.android.com/apk/res-auto">
10+
11+
<item
12+
android:id="@id/action_rename_album"
13+
android:orderInCategory="1"
14+
android:title="@string/album_rename"
15+
app:showAsAction="never" />
16+
17+
<item
18+
android:id="@id/action_share_album"
19+
android:orderInCategory="2"
20+
android:title="@string/album_share"
21+
app:showAsAction="never" />
22+
23+
<item
24+
android:id="@id/action_delete_album"
25+
android:orderInCategory="3"
26+
android:title="@string/album_delete"
27+
app:showAsAction="never" />
28+
29+
</menu>

app/src/main/res/values/ids.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,6 @@
4040
<item name="action_select_images_from_account" type="id"/>
4141
<item name="action_add_to_album" type="id"/>
4242
<item name="action_share_album" type="id"/>
43+
<item name="action_rename_album" type="id"/>
44+
<item name="action_delete_album" type="id"/>
4345
</resources>

0 commit comments

Comments
 (0)