|
@@ -7,6 +7,7 @@
|
|
|
|
|
|
package com.owncloud.android.ui.adapter
|
|
|
|
|
|
+import android.annotation.SuppressLint
|
|
|
import android.content.Context
|
|
|
import android.view.LayoutInflater
|
|
|
import android.view.ViewGroup
|
|
@@ -17,8 +18,8 @@ import com.owncloud.android.datamodel.FileDataStorageManager
|
|
|
import com.owncloud.android.datamodel.OCFile
|
|
|
|
|
|
class InternalTwoWaySyncAdapter(
|
|
|
- dataStorageManager: FileDataStorageManager,
|
|
|
- user: User,
|
|
|
+ private val dataStorageManager: FileDataStorageManager,
|
|
|
+ private val user: User,
|
|
|
val context: Context
|
|
|
) : RecyclerView.Adapter<InternalTwoWaySyncViewHolder>() {
|
|
|
var folders: List<OCFile> = dataStorageManager.getInternalTwoWaySyncFolders(user)
|
|
@@ -38,6 +39,12 @@ class InternalTwoWaySyncAdapter(
|
|
|
}
|
|
|
|
|
|
override fun onBindViewHolder(holder: InternalTwoWaySyncViewHolder, position: Int) {
|
|
|
- holder.bind(folders[position], context)
|
|
|
+ holder.bind(folders[position], context, dataStorageManager, this)
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressLint("NotifyDataSetChanged")
|
|
|
+ fun update() {
|
|
|
+ folders = dataStorageManager.getInternalTwoWaySyncFolders(user)
|
|
|
+ notifyDataSetChanged()
|
|
|
}
|
|
|
}
|