mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
* #3468 Switch from RvRenderer to AdapterDelegates - replace SearchDepictionsRenderer * #3468 Switch from RvRenderer to AdapterDelegates - replace UploadCategoryDepictionsRenderer * #3468 Switch from RvRenderer to AdapterDelegates - update BaseAdapter to be easier to use * #3468 Switch from RvRenderer to AdapterDelegates - replace SearchImagesRenderer * #3468 Switch from RvRenderer to AdapterDelegates - replace SearchCategoriesRenderer * #3468 Switch from RvRenderer to AdapterDelegates - replace NotificationRenderer * #3468 Switch from RvRenderer to AdapterDelegates - replace UploadDepictsRenderer * #3468 Switch from RvRenderer to AdapterDelegates - replace PlaceRenderer * #3756 Convert SearchDepictionsFragment to use Pagination - convert SearchDepictionsFragment * #3756 Convert SearchDepictionsFragment to use Pagination - fix presenter unit tests now that view is not nullable - fix Category prefix imports * #3756 Convert SearchDepictionsFragment to use Pagination - test DataSource related classes * #3756 Convert SearchDepictionsFragment to use Pagination - reset rx scheduler - ignore failing test * #3760 Convert SearchCategoriesFragment to use Pagination - extract functionality of pagination to base classes - add category pagination * #3772 Convert SearchImagesFragment to use Pagination - convert SearchImagesFragment - tidy up showing the empty view - make search fragments show snackbar with appropriate text * #3772 Convert SearchImagesFragment to use Pagination - allow viewpager to load more data * #3760 remove test that got re-added by merge * #3760 remove duplicate dependency * #3772 fix compilation * #3780 Create media using a combination of Entities & MwQueryResult - construct media with an entity - move fields from media down to contribution - move dynamic fields outside of media - remove unused constructors - remove all unnecessary fetching of captions/descriptions - bump database version * #3808 Construct media objects that depict an item id correctly - use generator to construct media for DepictedImages * #3780 Create media using a combination of Entities & MwQueryResult - update wikicode to align with expected behaviour * #3780 Create media using a combination of Entities & MwQueryResult - replace old site of thumbnail title with most relevant caption
This commit is contained in:
parent
bf4b7e2efc
commit
4b22583b60
46 changed files with 803 additions and 1532 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import com.nhaarman.mockitokotlin2.mock
|
||||
import com.nhaarman.mockitokotlin2.whenever
|
||||
import fr.free.nrw.commons.Media
|
||||
import fr.free.nrw.commons.category.CategoryItem
|
||||
import fr.free.nrw.commons.location.LatLng
|
||||
import fr.free.nrw.commons.nearby.Label
|
||||
|
|
@ -7,6 +8,7 @@ import fr.free.nrw.commons.nearby.Place
|
|||
import fr.free.nrw.commons.nearby.Sitelinks
|
||||
import fr.free.nrw.commons.upload.structure.depictions.DepictedItem
|
||||
import org.wikipedia.wikidata.*
|
||||
import java.util.*
|
||||
|
||||
fun depictedItem(
|
||||
name: String = "label",
|
||||
|
|
@ -29,6 +31,38 @@ fun depictedItem(
|
|||
fun categoryItem(name: String = "name", selected: Boolean = false) =
|
||||
CategoryItem(name, selected)
|
||||
|
||||
fun media(
|
||||
thumbUrl: String? = "thumbUrl",
|
||||
imageUrl: String? = "imageUrl",
|
||||
filename: String? = "filename",
|
||||
fallbackDescription: String? = "fallbackDescription",
|
||||
dateUploaded: Date? = Date(),
|
||||
license: String? = "license",
|
||||
licenseUrl: String? = "licenseUrl",
|
||||
creator: String? = "creator",
|
||||
pageId: String = "pageId",
|
||||
categories: List<String>? = listOf("categories"),
|
||||
coordinates: LatLng? = LatLng(0.0, 0.0, 0.0f),
|
||||
captions: Map<String?, String?> = mapOf("en" to "caption"),
|
||||
descriptions: Map<String?, String?> = mapOf("en" to "description"),
|
||||
depictionIds: List<String> = listOf("depictionId")
|
||||
) = Media(
|
||||
thumbUrl,
|
||||
imageUrl,
|
||||
filename,
|
||||
fallbackDescription,
|
||||
dateUploaded,
|
||||
license,
|
||||
licenseUrl,
|
||||
creator,
|
||||
pageId,
|
||||
categories,
|
||||
coordinates,
|
||||
captions,
|
||||
descriptions,
|
||||
depictionIds
|
||||
)
|
||||
|
||||
fun place(
|
||||
name: String = "name",
|
||||
label: Label? = null,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue