From 2d967556666981d83542f6047db9ab696cb4360d Mon Sep 17 00:00:00 2001 From: Amanpal Singh <87360222+aman-alfresco@users.noreply.github.com> Date: Mon, 14 Mar 2022 10:44:19 +0530 Subject: [PATCH] Mobileapps 1083 (#95) * fixed trash and count issue * fixed sync issue * fixed percentage issue and spacing * codacy correction * removed unused code --- .../content/actions/ActionCaptureMedia.kt | 25 ++++++++----- .../content/actions/ActionPermission.kt | 2 -- .../actions/ActionUploadExtensionFiles.kt | 3 +- .../content/actions/ActionUploadFiles.kt | 2 +- .../content/actions/ActionUploadMedia.kt | 2 +- .../app/activity/MainActivityViewModel.kt | 2 ++ .../alfresco/content/browse/BrowseFragment.kt | 30 +++++++--------- .../content/browse/BrowseViewModel.kt | 12 ++++++- .../browse/transfer/TransferFilesFragment.kt | 8 +++-- .../browse/transfer/TransferFilesViewModel.kt | 17 ++++++++- .../alfresco/capture/CaptureHelperFragment.kt | 6 ++-- .../capture/CapturePhotoResultContract.kt | 6 ++-- .../content/data/OfflineRepository.kt | 35 +++++++++---------- .../com/alfresco/content/data/SyncService.kt | 17 +++++++++ .../com/alfresco/content/data/UploadWorker.kt | 2 -- listview/src/main/res/drawable/ic_upload.xml | 2 +- .../src/main/res/drawable/ic_upload_done.xml | 9 +++++ .../src/main/res/layout/fragment_list.xml | 2 +- .../src/main/res/layout/view_list_message.xml | 11 +++--- listview/src/main/res/values-de/strings.xml | 6 ++-- listview/src/main/res/values-es/strings.xml | 8 ++--- listview/src/main/res/values-fr/strings.xml | 8 ++--- listview/src/main/res/values-it/strings.xml | 8 ++--- listview/src/main/res/values-nl/strings.xml | 8 ++--- listview/src/main/res/values/strings.xml | 8 ++--- .../viewer/media/MediaViewerFragment.kt | 1 - 26 files changed, 141 insertions(+), 99 deletions(-) create mode 100644 listview/src/main/res/drawable/ic_upload_done.xml diff --git a/actions/src/main/kotlin/com/alfresco/content/actions/ActionCaptureMedia.kt b/actions/src/main/kotlin/com/alfresco/content/actions/ActionCaptureMedia.kt index 75c2e9794..1bc2df4ce 100644 --- a/actions/src/main/kotlin/com/alfresco/content/actions/ActionCaptureMedia.kt +++ b/actions/src/main/kotlin/com/alfresco/content/actions/ActionCaptureMedia.kt @@ -7,6 +7,8 @@ import com.alfresco.content.PermissionFragment import com.alfresco.content.data.Entry import com.alfresco.content.data.OfflineRepository import kotlin.coroutines.cancellation.CancellationException +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext data class ActionCaptureMedia( override var entry: Entry, @@ -24,15 +26,20 @@ data class ActionCaptureMedia( ) ) { PermissionFragment.requestOptionalPermissions(context, CaptureHelperFragment.optionalPermissions()) - val item = CaptureHelperFragment.capturePhoto(context) - if (item != null) { - repository.scheduleForUpload( - item.uri.toString(), - entry.id, - item.filename, - item.description, - item.mimeType - ) + val result = CaptureHelperFragment.capturePhoto(context) + if (!result.isNullOrEmpty()) { + withContext(Dispatchers.IO) { + result.map { item -> + repository.scheduleForUpload( + item.uri.toString(), + entry.id, + item.filename, + item.description, + item.mimeType + ) + } + repository.setTotalTransferSize(result.size) + } } else { throw CancellationException("User Cancellation") } diff --git a/actions/src/main/kotlin/com/alfresco/content/actions/ActionPermission.kt b/actions/src/main/kotlin/com/alfresco/content/actions/ActionPermission.kt index 2df922b63..3986c6687 100644 --- a/actions/src/main/kotlin/com/alfresco/content/actions/ActionPermission.kt +++ b/actions/src/main/kotlin/com/alfresco/content/actions/ActionPermission.kt @@ -37,10 +37,8 @@ interface ActionPermission { if (checkReadPermission(context)) executeIntentData(context) } catch (ex: CancellationException) { - println("ExtensionActivity.CancellationException") (context as AppCompatActivity).finish() } catch (ex: Exception) { - println("ExtensionActivity.Exception") bus.send(Error(ex.message ?: "")) delay(1000) (context as AppCompatActivity).finish() diff --git a/actions/src/main/kotlin/com/alfresco/content/actions/ActionUploadExtensionFiles.kt b/actions/src/main/kotlin/com/alfresco/content/actions/ActionUploadExtensionFiles.kt index 69c6b76be..986cb7475 100644 --- a/actions/src/main/kotlin/com/alfresco/content/actions/ActionUploadExtensionFiles.kt +++ b/actions/src/main/kotlin/com/alfresco/content/actions/ActionUploadExtensionFiles.kt @@ -29,7 +29,7 @@ data class ActionUploadExtensionFiles( repository.scheduleContentForUpload(context, it, entry.id, true) } } - repository.setTotalTransferSize(entry.parentId) + repository.setTotalTransferSize(list.size) } else { throw CancellationException("User Cancellation") } @@ -39,7 +39,6 @@ data class ActionUploadExtensionFiles( override fun copy(_entry: Entry): ActionExtension = copy(entry = _entry) override fun showToast(view: View, anchorView: View?) { - println("Upload Extension Files List Size === " + repository.buildTransferList().size) MaterialAlertDialogBuilder(view.context) .setTitle(view.resources.getString(R.string.action_upload_queue_title)) .setCancelable(false) diff --git a/actions/src/main/kotlin/com/alfresco/content/actions/ActionUploadFiles.kt b/actions/src/main/kotlin/com/alfresco/content/actions/ActionUploadFiles.kt index 01768a13c..dfe9a1a86 100644 --- a/actions/src/main/kotlin/com/alfresco/content/actions/ActionUploadFiles.kt +++ b/actions/src/main/kotlin/com/alfresco/content/actions/ActionUploadFiles.kt @@ -27,7 +27,7 @@ data class ActionUploadFiles( result.map { repository.scheduleContentForUpload(context, it, entry.id) } - repository.setTotalTransferSize(entry.parentId) + repository.setTotalTransferSize(result.size) } } else { throw CancellationException("User Cancellation") diff --git a/actions/src/main/kotlin/com/alfresco/content/actions/ActionUploadMedia.kt b/actions/src/main/kotlin/com/alfresco/content/actions/ActionUploadMedia.kt index 2b0c5c314..f0cc64472 100644 --- a/actions/src/main/kotlin/com/alfresco/content/actions/ActionUploadMedia.kt +++ b/actions/src/main/kotlin/com/alfresco/content/actions/ActionUploadMedia.kt @@ -24,7 +24,7 @@ data class ActionUploadMedia( result.map { repository.scheduleContentForUpload(context, it, entry.id) } - repository.setTotalTransferSize(entry.parentId) + repository.setTotalTransferSize(result.size) } } else { throw CancellationException("User Cancellation") diff --git a/app/src/main/java/com/alfresco/content/app/activity/MainActivityViewModel.kt b/app/src/main/java/com/alfresco/content/app/activity/MainActivityViewModel.kt index 37fe2bd7b..c600c9df7 100644 --- a/app/src/main/java/com/alfresco/content/app/activity/MainActivityViewModel.kt +++ b/app/src/main/java/com/alfresco/content/app/activity/MainActivityViewModel.kt @@ -15,6 +15,7 @@ import com.alfresco.content.actions.ActionCaptureMedia import com.alfresco.content.actions.ActionRemoveOffline import com.alfresco.content.actions.ActionSyncNow import com.alfresco.content.actions.ActionUploadMedia +import com.alfresco.content.browse.transfer.TransferSyncNow import com.alfresco.content.data.AuthenticationRepository import com.alfresco.content.data.OfflineRepository import com.alfresco.content.data.PeopleRepository @@ -86,6 +87,7 @@ class MainActivityViewModel( coroutineScope.on { service.upload() } coroutineScope.on { service.upload() } coroutineScope.on { service.syncNow(it.overrideNetwork) } + coroutineScope.on { service.upload() } } val requiresLogin: Boolean diff --git a/browse/src/main/kotlin/com/alfresco/content/browse/BrowseFragment.kt b/browse/src/main/kotlin/com/alfresco/content/browse/BrowseFragment.kt index 8d8ccbd43..f88516600 100644 --- a/browse/src/main/kotlin/com/alfresco/content/browse/BrowseFragment.kt +++ b/browse/src/main/kotlin/com/alfresco/content/browse/BrowseFragment.kt @@ -87,6 +87,8 @@ class BrowseFragment : ListFragment() { withState(viewModel) { state -> if (state.path == getString(R.string.nav_path_recents)) { updateBanner(state.totalTransfersSize, state.uploadTransferList.size) + if (state.uploadTransferList.isEmpty()) + viewModel.resetTransferData() } if (viewModel.canAddItems(state)) { @@ -97,33 +99,27 @@ class BrowseFragment : ListFragment() { private fun updateBanner(totalSize: Int, pendingFilesCount: Int) { - println("BrowseFragment.updateBanner $totalSize $pendingFilesCount") - - if (pendingFilesCount == 0) { - hideBanner(0) - return - } - bannerTransferData?.visibility = View.VISIBLE + if (totalSize != 0 && pendingFilesCount != 0) + bannerTransferData?.visibility = View.VISIBLE val uploadFileCount = totalSize - pendingFilesCount val percentage = (uploadFileCount.toFloat().div(totalSize.toFloat())).times(100) - if (totalSize > 1) { - if (pendingFilesCount != 0) - tvUploadingFiles?.text = String.format(getString(com.alfresco.content.listview.R.string.upload_file_text_multiple), pendingFilesCount) - else tvUploadingFiles?.text = String.format(getString(com.alfresco.content.listview.R.string.upload_complete_text_multiple), totalSize) + if (pendingFilesCount != 0) { + tvUploadingFiles?.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_upload, 0, 0, 0) + tvUploadingFiles?.text = String.format(getString(com.alfresco.content.listview.R.string.upload_file_text_multiple), pendingFilesCount) } else { - if (pendingFilesCount != 0) - tvUploadingFiles?.text = String.format(getString(com.alfresco.content.listview.R.string.upload_file_text_single), pendingFilesCount) - else tvUploadingFiles?.text = String.format(getString(com.alfresco.content.listview.R.string.upload_complete_text_single), totalSize) + tvUploadingFiles?.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_upload_done, 0, 0, 0) + tvUploadingFiles?.text = String.format(getString(com.alfresco.content.listview.R.string.upload_complete_text_multiple), totalSize) } - tvPercentage?.text = String.format(getString(com.alfresco.content.listview.R.string.upload_percentage_text), percentage.toInt()) + tvPercentage?.text = String.format(getString(com.alfresco.content.listview.R.string.upload_percentage_text), percentage) percentageFiles?.progress = percentage.toInt() - if (pendingFilesCount == 0) - hideBanner(1000) + if (totalSize != 0 && pendingFilesCount == 0) { + hideBanner(3000) + } } private fun hideBanner(millis: Long) { diff --git a/browse/src/main/kotlin/com/alfresco/content/browse/BrowseViewModel.kt b/browse/src/main/kotlin/com/alfresco/content/browse/BrowseViewModel.kt index dcd1dbe74..19bc782ed 100644 --- a/browse/src/main/kotlin/com/alfresco/content/browse/BrowseViewModel.kt +++ b/browse/src/main/kotlin/com/alfresco/content/browse/BrowseViewModel.kt @@ -51,7 +51,9 @@ class BrowseViewModel( } } if (state.path == context.getString(R.string.nav_path_recents)) { - offlineRepository.updateTransferSize(offlineRepository.buildTransferList().size) + val list = offlineRepository.buildTransferList() + if (list.isEmpty()) + offlineRepository.updateTransferSize(0) setState { copy(totalTransfersSize = offlineRepository.getTotalTransfersSize()) } } @@ -226,6 +228,14 @@ class BrowseViewModel( } } + /** + * reset local files after uploading to server + */ + fun resetTransferData() { + offlineRepository.removeCompletedUploads() + offlineRepository.updateTransferSize(0) + } + override fun emptyMessageArgs(state: ListViewState) = when ((state as BrowseViewState).path) { context.getString(R.string.nav_path_recents) -> diff --git a/browse/src/main/kotlin/com/alfresco/content/browse/transfer/TransferFilesFragment.kt b/browse/src/main/kotlin/com/alfresco/content/browse/transfer/TransferFilesFragment.kt index 2c34a80a0..2338265e4 100644 --- a/browse/src/main/kotlin/com/alfresco/content/browse/transfer/TransferFilesFragment.kt +++ b/browse/src/main/kotlin/com/alfresco/content/browse/transfer/TransferFilesFragment.kt @@ -14,7 +14,6 @@ import androidx.lifecycle.lifecycleScope import com.airbnb.epoxy.AsyncEpoxyController import com.airbnb.mvrx.MavericksView import com.airbnb.mvrx.withState -import com.alfresco.content.actions.ActionSyncNow import com.alfresco.content.browse.R import com.alfresco.content.data.Entry import com.alfresco.content.fragmentViewModelWithArgs @@ -157,5 +156,10 @@ class TransferFilesFragment : Fragment(), MavericksView { } private fun startSync(overrideNetwork: Boolean) = - lifecycleScope.emit(ActionSyncNow(overrideNetwork)) + lifecycleScope.emit(TransferSyncNow(overrideNetwork)) } + +/** + * Not a typical action - used as an event. + */ +data class TransferSyncNow(val overrideNetwork: Boolean) diff --git a/browse/src/main/kotlin/com/alfresco/content/browse/transfer/TransferFilesViewModel.kt b/browse/src/main/kotlin/com/alfresco/content/browse/transfer/TransferFilesViewModel.kt index 3d2d263aa..f28c06c63 100644 --- a/browse/src/main/kotlin/com/alfresco/content/browse/transfer/TransferFilesViewModel.kt +++ b/browse/src/main/kotlin/com/alfresco/content/browse/transfer/TransferFilesViewModel.kt @@ -10,8 +10,12 @@ import com.alfresco.content.browse.R import com.alfresco.content.data.Entry import com.alfresco.content.data.OfflineRepository import com.alfresco.content.data.Settings +import com.alfresco.content.data.SyncService import com.alfresco.content.network.ConnectivityTracker import kotlinx.coroutines.Job +import kotlinx.coroutines.flow.combine +import kotlinx.coroutines.flow.map +import kotlinx.coroutines.launch /** * Mark as UploadFilesViewState @@ -42,9 +46,20 @@ class TransferFilesViewModel( private var observeExtensionUploadsJob: Job? = null init { + viewModelScope.launch { + SyncService + .observeTransfer(context) + .map { it == SyncService.SyncState.Running } + .combine(ConnectivityTracker.networkAvailable) { running, connected -> + !running && connected + } + .execute { + copy(syncNowEnabled = it() ?: false) + } + } + observeExtensionUploads() val list = OfflineRepository().buildTransferList() - println("transfer files list size ${list.size}") setState { copy(entries = list) } } diff --git a/capture/src/main/kotlin/com/alfresco/capture/CaptureHelperFragment.kt b/capture/src/main/kotlin/com/alfresco/capture/CaptureHelperFragment.kt index 0c1e81c13..df13b7d99 100644 --- a/capture/src/main/kotlin/com/alfresco/capture/CaptureHelperFragment.kt +++ b/capture/src/main/kotlin/com/alfresco/capture/CaptureHelperFragment.kt @@ -11,7 +11,7 @@ import kotlinx.coroutines.suspendCancellableCoroutine class CaptureHelperFragment : Fragment() { private lateinit var requestLauncher: ActivityResultLauncher - private var onResult: CancellableContinuation? = null + private var onResult: CancellableContinuation?>? = null override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -21,7 +21,7 @@ class CaptureHelperFragment : Fragment() { } } - private suspend fun capturePhoto(): CaptureItem? = + private suspend fun capturePhoto(): List? = suspendCancellableCoroutine { continuation -> onResult = continuation requestLauncher.launch(Unit) @@ -32,7 +32,7 @@ class CaptureHelperFragment : Fragment() { suspend fun capturePhoto( context: Context - ): CaptureItem? = + ): List? = withFragment( context, TAG, diff --git a/capture/src/main/kotlin/com/alfresco/capture/CapturePhotoResultContract.kt b/capture/src/main/kotlin/com/alfresco/capture/CapturePhotoResultContract.kt index c8ea11718..845f754ef 100644 --- a/capture/src/main/kotlin/com/alfresco/capture/CapturePhotoResultContract.kt +++ b/capture/src/main/kotlin/com/alfresco/capture/CapturePhotoResultContract.kt @@ -9,15 +9,15 @@ import androidx.annotation.CallSuper /** * An [ActivityResultContract] to [take a picture] and returns a-[CaptureItem]. */ -class CapturePhotoResultContract : ActivityResultContract() { +class CapturePhotoResultContract : ActivityResultContract?>() { @CallSuper override fun createIntent(context: Context, input: Unit): Intent { return Intent(context, CaptureActivity::class.java) } - override fun parseResult(resultCode: Int, intent: Intent?): CaptureItem? { + override fun parseResult(resultCode: Int, intent: Intent?): List? { return if (intent == null || resultCode != Activity.RESULT_OK) null - else intent.extras?.getParcelable(OUTPUT_KEY) + else intent.extras?.getParcelableArrayList(OUTPUT_KEY) } internal companion object { diff --git a/data/src/main/kotlin/com/alfresco/content/data/OfflineRepository.kt b/data/src/main/kotlin/com/alfresco/content/data/OfflineRepository.kt index 9a5889868..d28be7cc1 100644 --- a/data/src/main/kotlin/com/alfresco/content/data/OfflineRepository.kt +++ b/data/src/main/kotlin/com/alfresco/content/data/OfflineRepository.kt @@ -137,18 +137,6 @@ class OfflineRepository(val session: Session = SessionManager.requireSession) { .build() .find() - private fun fetchAllTransferEntries(parentId: String?) = - box.query() - .apply { - if (parentId != null) { - equal(Entry_.parentId, parentId) - notEqual(Entry_.offlineStatus, OfflineStatus.UNDEFINED.value()) - equal(Entry_.isUpload, true) - } - } - .build() - .find() - internal fun fetchOfflineEntry(target: Entry) = entry(target.id) /** @@ -160,13 +148,13 @@ class OfflineRepository(val session: Session = SessionManager.requireSession) { /** * update transfer size count using the parent ID */ - fun setTotalTransferSize(parentId: String?) { - removeCompletedUploads() + fun setTotalTransferSize(size: Int) { + val count = getTotalTransfersSize() val list = fetchAllTransferEntries() - val listById = fetchAllTransferEntries(parentId) + if (list.isEmpty()) - updateTransferSize(listById.size) - else updateTransferSize(list.size + listById.size) + updateTransferSize(size) + else updateTransferSize(count + size) } fun scheduleContentForUpload( @@ -195,9 +183,11 @@ class OfflineRepository(val session: Session = SessionManager.requireSession) { type = Entry.Type.FILE, mimeType = mimeType, isUpload = true, - isExtension = isExtension, offlineStatus = OfflineStatus.PENDING ) + + clearData() + update(entry) val dest = File(session.uploadDir, entry.boxId.toString()) @@ -211,6 +201,12 @@ class OfflineRepository(val session: Session = SessionManager.requireSession) { } } + private fun clearData() { + removeCompletedUploads() + if (buildTransferList().isEmpty()) + updateTransferSize(0) + } + fun scheduleForUpload( path: String, parentId: String, @@ -228,6 +224,9 @@ class OfflineRepository(val session: Session = SessionManager.requireSession) { isUpload = true, offlineStatus = OfflineStatus.PENDING ) + + clearData() + update(entry) val srcPath = path.removePrefix("file://") File(srcPath).renameTo(File(session.uploadDir, entry.boxId.toString())) diff --git a/data/src/main/kotlin/com/alfresco/content/data/SyncService.kt b/data/src/main/kotlin/com/alfresco/content/data/SyncService.kt index 2ae381370..e91d5e1e7 100644 --- a/data/src/main/kotlin/com/alfresco/content/data/SyncService.kt +++ b/data/src/main/kotlin/com/alfresco/content/data/SyncService.kt @@ -207,6 +207,23 @@ class SyncService( it?.let { SyncState.from(it.state) } } + /** + * observer for uploading the files + */ + fun observeTransfer(context: Context): Flow = + WorkManager + .getInstance(context) + .getWorkInfosForUniqueWorkLiveData(UNIQUE_UPLOAD_WORK_NAME) + .asFlow() + .map { list -> + list?.find { it.state == WorkInfo.State.RUNNING } + ?: list?.find { !it.state.isFinished } + ?: list?.firstOrNull() + } + .map { + it?.let { SyncState.from(it.state) } + } + // TODO: race condition work is cancelled but sync service may still trigger it fun cancel(context: Context) { WorkManager diff --git a/data/src/main/kotlin/com/alfresco/content/data/UploadWorker.kt b/data/src/main/kotlin/com/alfresco/content/data/UploadWorker.kt index a03abf1e4..32237ab19 100644 --- a/data/src/main/kotlin/com/alfresco/content/data/UploadWorker.kt +++ b/data/src/main/kotlin/com/alfresco/content/data/UploadWorker.kt @@ -5,7 +5,6 @@ import androidx.work.CoroutineWorker import androidx.work.WorkerParameters import com.alfresco.Logger import com.alfresco.coroutines.asyncMap -import java.lang.Exception class UploadWorker( appContext: Context, @@ -38,7 +37,6 @@ class UploadWorker( ) true } catch (ex: Exception) { - repository.update(entry.copy(offlineStatus = OfflineStatus.ERROR)) Logger.e(ex) false } diff --git a/listview/src/main/res/drawable/ic_upload.xml b/listview/src/main/res/drawable/ic_upload.xml index 29c3674ef..1ca541606 100644 --- a/listview/src/main/res/drawable/ic_upload.xml +++ b/listview/src/main/res/drawable/ic_upload.xml @@ -5,7 +5,7 @@ android:viewportHeight="16"> diff --git a/listview/src/main/res/drawable/ic_upload_done.xml b/listview/src/main/res/drawable/ic_upload_done.xml new file mode 100644 index 000000000..f4c8193b9 --- /dev/null +++ b/listview/src/main/res/drawable/ic_upload_done.xml @@ -0,0 +1,9 @@ + + + diff --git a/listview/src/main/res/layout/fragment_list.xml b/listview/src/main/res/layout/fragment_list.xml index 665772e19..c46ab5bbe 100644 --- a/listview/src/main/res/layout/fragment_list.xml +++ b/listview/src/main/res/layout/fragment_list.xml @@ -53,7 +53,7 @@ android:layout_marginStart="16dp" android:layout_toStartOf="@id/tv_percentage" android:drawablePadding="8dp" - android:textColor="?attr/colorOnSurface" + android:textColor="?attr/colorPrimary" app:drawableStartCompat="@drawable/ic_upload" /> diff --git a/listview/src/main/res/layout/view_list_message.xml b/listview/src/main/res/layout/view_list_message.xml index 625c876d5..9e659d81b 100644 --- a/listview/src/main/res/layout/view_list_message.xml +++ b/listview/src/main/res/layout/view_list_message.xml @@ -1,12 +1,13 @@ - + + + android:orientation="vertical" + android:padding="8dp"> + android:textAppearance="?attr/textAppearanceBody2" + android:textColor="@color/color_on_surface_60" /> diff --git a/listview/src/main/res/values-de/strings.xml b/listview/src/main/res/values-de/strings.xml index 93d60205c..08befd20e 100644 --- a/listview/src/main/res/values-de/strings.xml +++ b/listview/src/main/res/values-de/strings.xml @@ -5,9 +5,7 @@ Synchronisierung wird ausgeführt… Fehler bei der Synchronisierung Hochladen - Es wird %d Datei hochgeladen… - Hochladen von %d Datei abgeschlossen - Hochladen von %d Dateien wird ausgeführt… + Hochladen von %d Dateien wird ausgeführt Hochladen von %d Dateien abgeschlossen - %d%% + %.1f%% diff --git a/listview/src/main/res/values-es/strings.xml b/listview/src/main/res/values-es/strings.xml index 9299ebdc1..13ea1daf0 100644 --- a/listview/src/main/res/values-es/strings.xml +++ b/listview/src/main/res/values-es/strings.xml @@ -5,9 +5,7 @@ Sincronizando… Error al sincronizar Cargar - Cargando %d ficheros… - Cargas finalizadas %d - Cargando %d ficheros… - %d cargas finalizadas - %d%% + Cargando %d fichero(s) + Finalizada la carga de %d fichero(s) + %.1f%% diff --git a/listview/src/main/res/values-fr/strings.xml b/listview/src/main/res/values-fr/strings.xml index cdbe441ab..3ff652635 100644 --- a/listview/src/main/res/values-fr/strings.xml +++ b/listview/src/main/res/values-fr/strings.xml @@ -5,9 +5,7 @@ Synchronisation... La synchronisation a échoué Importer - Importation du fichier %d... - %d importation complète - Importer %d fichiers... - %d importations complètes - %d%% + Importer %d fichier(s) + %d fichier(s) a terminé l\'importation + %.1f%% diff --git a/listview/src/main/res/values-it/strings.xml b/listview/src/main/res/values-it/strings.xml index c5fd5e438..ec1a489c7 100644 --- a/listview/src/main/res/values-it/strings.xml +++ b/listview/src/main/res/values-it/strings.xml @@ -5,9 +5,7 @@ Sincronizzazione in corso… Sincronizzazione non riuscita Carica - Caricamento in corso di %d file… - %d caricamento completato - Caricamento di %d file… - %d caricamenti completati - %d%% + Caricamento di %d file + Caricamento di %d file terminato + %.1f%% diff --git a/listview/src/main/res/values-nl/strings.xml b/listview/src/main/res/values-nl/strings.xml index 864731967..995ff6e75 100644 --- a/listview/src/main/res/values-nl/strings.xml +++ b/listview/src/main/res/values-nl/strings.xml @@ -5,9 +5,7 @@ Synchroniseren… Synchroniseren mislukt Uploaden - %d bestand uploaden… - %d upload voltooid - %d bestanden uploaden… - %d uploads voltooid - %d%% + %d bestanden uploaden + Uploaden van %d bestanden is voltooid + %.1f%% diff --git a/listview/src/main/res/values/strings.xml b/listview/src/main/res/values/strings.xml index 2444d202d..0bc7a06cb 100644 --- a/listview/src/main/res/values/strings.xml +++ b/listview/src/main/res/values/strings.xml @@ -5,9 +5,7 @@ Syncing… Sync failed Upload - Uploading %d file… - %d upload complete - Uploading %d files… - %d uploads complete - %d%% + Uploading %d file(s) + %d file(s) finished uploading + %.1f%% diff --git a/viewer-media/src/main/kotlin/com/alfresco/content/viewer/media/MediaViewerFragment.kt b/viewer-media/src/main/kotlin/com/alfresco/content/viewer/media/MediaViewerFragment.kt index e4cb02fc6..7b018e784 100644 --- a/viewer-media/src/main/kotlin/com/alfresco/content/viewer/media/MediaViewerFragment.kt +++ b/viewer-media/src/main/kotlin/com/alfresco/content/viewer/media/MediaViewerFragment.kt @@ -247,7 +247,6 @@ class MediaViewerFragment : ChildViewerFragment(), MavericksView { private inner class PlayerEventListener : Player.EventListener { override fun onPlaybackStateChanged(state: Int) { - println("PlayerEventListener.onPlaybackStateChanged $state") if (state == PlaybackState.STATE_PLAYING || state == PlaybackState.STATE_STOPPED ) {