diff --git a/app/src/main/java/com/nextcloud/talk/remotefilebrowser/activities/RemoteFileBrowserActivity.kt b/app/src/main/java/com/nextcloud/talk/remotefilebrowser/activities/RemoteFileBrowserActivity.kt index bd9f74b9d..7c09d9e88 100644 --- a/app/src/main/java/com/nextcloud/talk/remotefilebrowser/activities/RemoteFileBrowserActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/remotefilebrowser/activities/RemoteFileBrowserActivity.kt @@ -46,6 +46,7 @@ import com.nextcloud.talk.remotefilebrowser.adapters.RemoteFileBrowserItemsAdapt import com.nextcloud.talk.remotefilebrowser.viewmodels.RemoteFileBrowserItemsViewModel import com.nextcloud.talk.ui.dialog.SortingOrderDialogFragment import com.nextcloud.talk.ui.theme.ViewThemeUtils +import com.nextcloud.talk.utils.DateUtils import com.nextcloud.talk.utils.DisplayUtils import com.nextcloud.talk.utils.FileSortOrder import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_MIME_TYPE_FILTER @@ -64,6 +65,9 @@ class RemoteFileBrowserActivity : AppCompatActivity(), SelectionInterface, Swipe @Inject lateinit var viewThemeUtils: ViewThemeUtils + @Inject + lateinit var dateUtils: DateUtils + private lateinit var binding: ActivityRemoteFileBrowserBinding private lateinit var viewModel: RemoteFileBrowserItemsViewModel @@ -169,6 +173,7 @@ class RemoteFileBrowserActivity : AppCompatActivity(), SelectionInterface, Swipe user = currentUserProvider.currentUser.blockingGet(), selectionInterface = this, viewThemeUtils = viewThemeUtils, + dateUtils = dateUtils, onItemClicked = viewModel::onItemClicked ) adapter.items = remoteFileBrowserItems diff --git a/app/src/main/java/com/nextcloud/talk/remotefilebrowser/adapters/RemoteFileBrowserItemsAdapter.kt b/app/src/main/java/com/nextcloud/talk/remotefilebrowser/adapters/RemoteFileBrowserItemsAdapter.kt index d63da5449..a667156e7 100644 --- a/app/src/main/java/com/nextcloud/talk/remotefilebrowser/adapters/RemoteFileBrowserItemsAdapter.kt +++ b/app/src/main/java/com/nextcloud/talk/remotefilebrowser/adapters/RemoteFileBrowserItemsAdapter.kt @@ -29,6 +29,7 @@ import com.nextcloud.talk.databinding.RvItemBrowserFileBinding import com.nextcloud.talk.remotefilebrowser.SelectionInterface import com.nextcloud.talk.remotefilebrowser.model.RemoteFileBrowserItem import com.nextcloud.talk.ui.theme.ViewThemeUtils +import com.nextcloud.talk.utils.DateUtils class RemoteFileBrowserItemsAdapter( private val showGrid: Boolean = false, @@ -36,6 +37,7 @@ class RemoteFileBrowserItemsAdapter( private val user: User, private val selectionInterface: SelectionInterface, private val viewThemeUtils: ViewThemeUtils, + private val dateUtils: DateUtils, private val onItemClicked: (RemoteFileBrowserItem) -> Unit ) : RecyclerView.Adapter() { @@ -52,7 +54,8 @@ class RemoteFileBrowserItemsAdapter( mimeTypeSelectionFilter, user, selectionInterface, - viewThemeUtils + viewThemeUtils, + dateUtils ) { onItemClicked(items[it]) } @@ -66,7 +69,8 @@ class RemoteFileBrowserItemsAdapter( mimeTypeSelectionFilter, user, selectionInterface, - viewThemeUtils + viewThemeUtils, + dateUtils ) { onItemClicked(items[it]) } diff --git a/app/src/main/java/com/nextcloud/talk/remotefilebrowser/adapters/RemoteFileBrowserItemsListViewHolder.kt b/app/src/main/java/com/nextcloud/talk/remotefilebrowser/adapters/RemoteFileBrowserItemsListViewHolder.kt index cb8330096..b8090ed9d 100644 --- a/app/src/main/java/com/nextcloud/talk/remotefilebrowser/adapters/RemoteFileBrowserItemsListViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/remotefilebrowser/adapters/RemoteFileBrowserItemsListViewHolder.kt @@ -23,9 +23,7 @@ package com.nextcloud.talk.remotefilebrowser.adapters import android.text.format.Formatter import android.view.View import android.widget.ImageView -import autodagger.AutoInjector import com.nextcloud.talk.R -import com.nextcloud.talk.application.NextcloudTalkApplication import com.nextcloud.talk.data.user.model.User import com.nextcloud.talk.databinding.RvItemBrowserFileBinding import com.nextcloud.talk.extensions.loadImage @@ -35,21 +33,17 @@ import com.nextcloud.talk.ui.theme.ViewThemeUtils import com.nextcloud.talk.utils.ApiUtils import com.nextcloud.talk.utils.DateUtils import com.nextcloud.talk.utils.Mimetype.FOLDER -import javax.inject.Inject -@AutoInjector(NextcloudTalkApplication::class) class RemoteFileBrowserItemsListViewHolder( override val binding: RvItemBrowserFileBinding, mimeTypeSelectionFilter: String?, currentUser: User, selectionInterface: SelectionInterface, private val viewThemeUtils: ViewThemeUtils, + private val dateUtils: DateUtils, onItemClicked: (Int) -> Unit ) : RemoteFileBrowserItemsViewHolder(binding, mimeTypeSelectionFilter, currentUser, selectionInterface) { - @Inject - lateinit var dateUtils: DateUtils - override val fileIcon: ImageView get() = binding.fileIcon