Skip to content

Commit

Permalink
Add file upload progress in root files
Browse files Browse the repository at this point in the history
  • Loading branch information
LunarX committed Mar 5, 2024
1 parent 77fab53 commit 03b5869
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import com.infomaniak.drive.data.cache.DriveInfosController
import com.infomaniak.drive.data.cache.FolderFilesProvider.SourceRestrictionType.ONLY_FROM_LOCAL
import com.infomaniak.drive.data.cache.FolderFilesProvider.SourceRestrictionType.ONLY_FROM_REMOTE
import com.infomaniak.drive.data.models.File
import com.infomaniak.drive.data.models.UploadFile
import com.infomaniak.drive.databinding.FragmentRootFilesBinding
import com.infomaniak.drive.ui.MainViewModel
import com.infomaniak.drive.ui.fileList.FileListViewModel
Expand Down Expand Up @@ -81,6 +82,12 @@ class RootFilesFragment : Fragment() {
noNetworkBinding = noNetworkInclude,
noNetworkBindingDirectParent = contentLinearLayout,
)
rootFilesUploadFileInProgressView.setUploadFileInProgress(this@RootFilesFragment, Utils.OTHER_ROOT_ID)
}

override fun onResume() {
super.onResume()
showPendingFiles()
}

private fun setupDriveToolbar() = with(binding) {
Expand Down Expand Up @@ -184,5 +191,9 @@ class RootFilesFragment : Fragment() {
}
}

private fun showPendingFiles() {
binding.rootFilesUploadFileInProgressView.updateUploadFileInProgress(UploadFile.getCurrentUserPendingUploadsCount())
}

data class FolderToOpen(val id: Int, val name: String)
}
11 changes: 11 additions & 0 deletions app/src/main/res/layout/fragment_root_files.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@
android:id="@+id/noNetworkInclude"
layout="@layout/layout_no_network_small" />


<com.infomaniak.drive.views.PendingFilesView
android:id="@+id/rootFilesUploadFileInProgressView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/marginStandardMedium"
android:layout_marginTop="@dimen/marginStandardMedium"
android:visibility="gone"
app:title="@string/uploadInProgressTitle"
tools:visibility="visible" />

<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
Expand Down

0 comments on commit 03b5869

Please sign in to comment.