mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-31 23:03:54 +01:00
Updated kdoc
This commit is contained in:
parent
810d86cdd3
commit
cdac03cb7e
3 changed files with 23 additions and 2 deletions
|
|
@ -17,7 +17,14 @@ import fr.free.nrw.commons.R
|
||||||
import fr.free.nrw.commons.contributions.Contribution
|
import fr.free.nrw.commons.contributions.Contribution
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adapter for displaying failed uploads in a paginated list in FailedUploadsFragment. This adapter
|
||||||
|
* binds the data from [Contribution] objects to the item views in the RecyclerView, allowing users to view
|
||||||
|
* details of failed uploads, retry them, or delete them.
|
||||||
|
*
|
||||||
|
* @param callback The callback to handle user actions such as Delete Uploads and Restart Uploads
|
||||||
|
* on failed uploads.
|
||||||
|
*/
|
||||||
class FailedUploadsAdapter(callback: Callback) :
|
class FailedUploadsAdapter(callback: Callback) :
|
||||||
PagedListAdapter<Contribution, FailedUploadsAdapter.ViewHolder>(ContributionDiffCallback()) {
|
PagedListAdapter<Contribution, FailedUploadsAdapter.ViewHolder>(ContributionDiffCallback()) {
|
||||||
private var callback: Callback = callback
|
private var callback: Callback = callback
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,13 @@ import fr.free.nrw.commons.contributions.Contribution
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adapter for displaying pending uploads in a paginated list in PendingUploadsFragment. This adapter
|
||||||
|
* binds data from [Contribution] objects to the item views in the RecyclerView, allowing users to
|
||||||
|
* view details of pending uploads and perform actions such as deleting them.
|
||||||
|
*
|
||||||
|
* @param callback The callback to handle user actions such as Delete Uploads on pending uploads.
|
||||||
|
*/
|
||||||
class PendingUploadsAdapter(private val callback: Callback) :
|
class PendingUploadsAdapter(private val callback: Callback) :
|
||||||
PagedListAdapter<Contribution, PendingUploadsAdapter.ViewHolder>(ContributionDiffCallback()) {
|
PagedListAdapter<Contribution, PendingUploadsAdapter.ViewHolder>(ContributionDiffCallback()) {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,14 @@ class UploadProgressActivity : BaseActivity() {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the menu items based on the current position in the view pager and the visibility
|
||||||
|
* of icons related to pending or failed uploads. This function dynamically modifies the menu
|
||||||
|
* to display pause, resume, retry, and cancel options depending on the state of the uploads.
|
||||||
|
*
|
||||||
|
* @param currentPosition The current position in the view pager. A value of `0` indicates
|
||||||
|
* pending uploads, while `1` indicates failed uploads.
|
||||||
|
*/
|
||||||
fun updateMenuItems(currentPosition: Int) {
|
fun updateMenuItems(currentPosition: Int) {
|
||||||
if (menu != null) {
|
if (menu != null) {
|
||||||
menu!!.clear()
|
menu!!.clear()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue