Skip to content

Commit 53decc6

Browse files
committed
fix: replace personal label by folder name for kitework servers
1 parent 747e9e0 commit 53decc6

File tree

7 files changed

+38
-14
lines changed

7 files changed

+38
-14
lines changed

owncloudApp/src/main/java/com/owncloud/android/presentation/files/details/FileDetailsFragment.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
* @author Abel García de Prada
55
* @author Juan Carlos Garrote Gascón
66
* @author Aitor Ballesteros Pavón
7+
* @author Jorge Aguado Recio
78
*
8-
* Copyright (C) 2024 ownCloud GmbH.
9+
* Copyright (C) 2025 ownCloud GmbH.
910
*
1011
* This program is free software: you can redistribute it and/or modify
1112
* it under the terms of the GNU General Public License version 2,
@@ -107,6 +108,8 @@ class FileDetailsFragment : FileFragment() {
107108

108109
private var openInWebProviders: Map<String, Int> = hashMapOf()
109110

111+
private val isMultiPersonal = requireArguments().getBoolean(ARG_IS_MULTIPERSONAL)
112+
110113
override fun onCreateView(
111114
inflater: LayoutInflater, container: ViewGroup?,
112115
savedInstanceState: Bundle?
@@ -382,7 +385,7 @@ class FileDetailsFragment : FileFragment() {
382385
binding.fdSpace.visibility = View.VISIBLE
383386
binding.fdSpaceLabel.visibility = View.VISIBLE
384387
binding.fdIconSpace.visibility = View.VISIBLE
385-
if (space.isPersonal) {
388+
if (space.isPersonal && !isMultiPersonal) {
386389
binding.fdSpace.text = getString(R.string.bottom_nav_personal)
387390
} else {
388391
binding.fdSpace.text = space.name
@@ -622,6 +625,7 @@ class FileDetailsFragment : FileFragment() {
622625
private const val ARG_FILE = "FILE"
623626
private const val ARG_ACCOUNT = "ACCOUNT"
624627
private const val ARG_SYNC_FILE_AT_OPEN = "SYNC_FILE_AT_OPEN"
628+
private const val ARG_IS_MULTIPERSONAL = "IS_MULTIPERSONAL"
625629
private const val ZERO_MILLISECOND_TIME = 0
626630

627631
/**
@@ -632,12 +636,13 @@ class FileDetailsFragment : FileFragment() {
632636
* @param account An ownCloud account; needed to start downloads
633637
* @return New fragment with arguments set
634638
*/
635-
fun newInstance(fileToDetail: OCFile, account: Account, syncFileAtOpen: Boolean = true): FileDetailsFragment =
639+
fun newInstance(fileToDetail: OCFile, account: Account, syncFileAtOpen: Boolean = true, isMultipersonal: Boolean): FileDetailsFragment =
636640
FileDetailsFragment().apply {
637641
arguments = Bundle().apply {
638642
putParcelable(ARG_FILE, fileToDetail)
639643
putParcelable(ARG_ACCOUNT, account)
640644
putBoolean(ARG_SYNC_FILE_AT_OPEN, syncFileAtOpen)
645+
putBoolean(ARG_IS_MULTIPERSONAL, isMultipersonal)
641646
}
642647
}
643648
}

owncloudApp/src/main/java/com/owncloud/android/presentation/files/filelist/FileListAdapter.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
* @author Juan Carlos Garrote Gascón
66
* @author Manuel Plazas Palacio
77
* @author Aitor Ballesteros Pavón
8+
* @author Jorge Aguado Recio
89
*
9-
* Copyright (C) 2024 ownCloud GmbH.
10+
* Copyright (C) 2025 ownCloud GmbH.
1011
*
1112
* This program is free software: you can redistribute it and/or modify
1213
* it under the terms of the GNU General Public License version 2,
@@ -55,6 +56,7 @@ class FileListAdapter(
5556
private val isPickerMode: Boolean,
5657
private val layoutManager: StaggeredGridLayoutManager,
5758
private val listener: FileListAdapterListener,
59+
private val isMultiPersonal: Boolean,
5860
) : SelectableAdapter<RecyclerView.ViewHolder>() {
5961

6062
var files = mutableListOf<Any>()
@@ -291,7 +293,7 @@ class FileListAdapter(
291293
fileWithSyncInfo.space?.let { space ->
292294
it.spacePathLine.spaceIcon.isVisible = true
293295
it.spacePathLine.spaceName.isVisible = true
294-
if (space.isPersonal) {
296+
if (space.isPersonal && !isMultiPersonal) {
295297
it.spacePathLine.spaceIcon.setImageResource(R.drawable.ic_folder)
296298
it.spacePathLine.spaceName.setText(R.string.bottom_nav_personal)
297299
} else {

owncloudApp/src/main/java/com/owncloud/android/presentation/files/filelist/MainFileListFragment.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @author Jorge Aguado Recio
99
* @author Aitor Ballesteros Pavón
1010
*
11-
* Copyright (C) 2024 ownCloud GmbH.
11+
* Copyright (C) 2025 ownCloud GmbH.
1212
*
1313
* This program is free software: you can redistribute it and/or modify
1414
* it under the terms of the GNU General Public License version 2,
@@ -385,6 +385,7 @@ class MainFileListFragment : Fragment(),
385385
layoutManager = layoutManager,
386386
isPickerMode = isPickingAFolder(),
387387
listener = this@MainFileListFragment,
388+
isMultiPersonal = isMultiPersonal
388389
)
389390

390391
binding.recyclerViewMainFileList.adapter = fileListAdapter

owncloudApp/src/main/java/com/owncloud/android/presentation/transfers/TransferListFragment.kt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
* ownCloud Android client application
33
*
44
* @author Juan Carlos Garrote Gascón
5+
* @author Jorge Aguado Recio
56
*
6-
* Copyright (C) 2023 ownCloud GmbH.
7+
* Copyright (C) 2025 ownCloud GmbH.
78
*
89
* This program is free software: you can redistribute it and/or modify
910
* it under the terms of the GNU General Public License version 2,
@@ -20,6 +21,7 @@
2021

2122
package com.owncloud.android.presentation.transfers
2223

24+
import android.accounts.Account
2325
import android.net.Uri
2426
import android.os.Bundle
2527
import android.view.LayoutInflater
@@ -39,13 +41,22 @@ import com.owncloud.android.domain.transfers.model.OCTransfer
3941
import com.owncloud.android.domain.transfers.model.TransferResult
4042
import com.owncloud.android.extensions.collectLatestLifecycleFlow
4143
import com.owncloud.android.presentation.authentication.AccountUtils
44+
import com.owncloud.android.presentation.capabilities.CapabilityViewModel
4245
import com.owncloud.android.ui.activity.FileActivity
4346
import org.koin.androidx.viewmodel.ext.android.viewModel
47+
import org.koin.core.parameter.parametersOf
4448
import java.io.File
4549

46-
class TransferListFragment : Fragment() {
50+
class TransferListFragment(
51+
private val account: Account
52+
) : Fragment() {
4753

4854
private val transfersViewModel by viewModel<TransfersViewModel>()
55+
private val capabilityViewModel: CapabilityViewModel by viewModel {
56+
parametersOf(
57+
account.name,
58+
)
59+
}
4960

5061
private var _binding: FragmentTransferListBinding? = null
5162
val binding get() = _binding!!
@@ -92,6 +103,7 @@ class TransferListFragment : Fragment() {
92103
clearSuccessful = {
93104
transfersViewModel.clearSuccessfulTransfers()
94105
},
106+
isMultipersonal = capabilityViewModel.checkMultiPersonal()
95107
)
96108
binding.transfersRecyclerView.apply {
97109
layoutManager = LinearLayoutManager(context)

owncloudApp/src/main/java/com/owncloud/android/presentation/transfers/TransfersAdapter.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
* ownCloud Android client application
33
*
44
* @author Juan Carlos Garrote Gascón
5+
* @author Jorge Aguado Recio
56
*
6-
* Copyright (C) 2023 ownCloud GmbH.
7+
* Copyright (C) 2025 ownCloud GmbH.
78
*
89
* This program is free software: you can redistribute it and/or modify
910
* it under the terms of the GNU General Public License version 2,
@@ -55,6 +56,7 @@ class TransfersAdapter(
5556
val clearFailed: () -> Unit,
5657
val retryFailed: () -> Unit,
5758
val clearSuccessful: () -> Unit,
59+
private val isMultipersonal: Boolean,
5860
) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
5961

6062
private val transferItemsList = mutableListOf<TransferRecyclerItem>()
@@ -113,7 +115,7 @@ class TransfersAdapter(
113115
transferItem.space?.let {
114116
spacePathLine.spaceName.isVisible = true
115117
spacePathLine.spaceIcon.isVisible = true
116-
if (it.isPersonal) {
118+
if (it.isPersonal && !isMultipersonal) {
117119
spacePathLine.spaceIcon.setImageResource(R.drawable.ic_folder)
118120
spacePathLine.spaceName.setText(R.string.bottom_nav_personal)
119121
} else {

owncloudApp/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ class FileDisplayActivity : FileActivity(),
493493
}
494494

495495
else -> {
496-
FileDetailsFragment.newInstance(file, account, false)
496+
FileDetailsFragment.newInstance(file, account, false, isMultiPersonal)
497497
}
498498
}
499499
}
@@ -1752,7 +1752,8 @@ class FileDisplayActivity : FileActivity(),
17521752
val detailsFragment = FileDetailsFragment.newInstance(
17531753
fileToDetail = ocFile,
17541754
account = account,
1755-
syncFileAtOpen = syncFileAtOpen
1755+
syncFileAtOpen = syncFileAtOpen,
1756+
isMultipersonal = isMultiPersonal
17561757
)
17571758
setSecondFragment(detailsFragment)
17581759
}

owncloudApp/src/main/java/com/owncloud/android/ui/activity/UploadListActivity.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
* @author Christian Schabesberger
88
* @author Juan Carlos Garrote Gascón
99
* @author Aitor Ballesteros Pavón
10+
* @author Jorge Aguado Recio
1011
*
11-
* Copyright (C) 2024 ownCloud GmbH.
12+
* Copyright (C) 2025 ownCloud GmbH.
1213
* <p>
1314
* This program is free software: you can redistribute it and/or modify
1415
* it under the terms of the GNU General Public License version 2,
@@ -93,7 +94,7 @@ protected void onCreate(Bundle savedInstanceState) {
9394

9495
private void createUploadListFragment() {
9596
//UploadListFragment uploadList = new UploadListFragment();
96-
TransferListFragment uploadList = new TransferListFragment();
97+
TransferListFragment uploadList = new TransferListFragment(getAccount());
9798
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
9899
transaction.add(R.id.left_fragment_container, uploadList, TAG_UPLOAD_LIST_FRAGMENT);
99100
transaction.commit();

0 commit comments

Comments
 (0)