Skip to content

Commit

Permalink
Merge branch 'main' into achievement_revamp
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-raoul authored Dec 6, 2024
2 parents 885e46d + f8d519e commit 28ba71e
Show file tree
Hide file tree
Showing 63 changed files with 2,469 additions and 2,676 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ class CampaignsPresenter @Inject constructor(
return
}

okHttpJsonApiClient.campaigns
okHttpJsonApiClient.getCampaigns()
.observeOn(mainThreadScheduler)
.subscribeOn(ioScheduler)
.doOnSubscribe { disposable = it }
.subscribe({ campaignResponseDTO ->
val campaigns = campaignResponseDTO.campaigns?.toMutableList()
val campaigns = campaignResponseDTO?.campaigns?.toMutableList()
if (campaigns.isNullOrEmpty()) {
Timber.e("The campaigns list is empty")
view!!.showCampaigns(null)
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/fr/free/nrw/commons/di/NetworkingModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,13 @@ class NetworkingModule {
@Named(NAMED_WIKI_DATA_WIKI_SITE)
fun provideWikidataWikiSite(): WikiSite = WikiSite(BuildConfig.WIKIDATA_URL)


/**
* Gson objects are very heavy. The app should ideally be using just one instance of it instead of creating new instances everywhere.
* @return returns a singleton Gson instance
*/
@Provides
@Singleton
fun provideGson(): Gson = GsonUtil.getDefaultGson()
fun provideGson(): Gson = GsonUtil.defaultGson

@Provides
@Singleton
Expand Down
23 changes: 0 additions & 23 deletions app/src/main/java/fr/free/nrw/commons/filepicker/Constants.java

This file was deleted.

29 changes: 29 additions & 0 deletions app/src/main/java/fr/free/nrw/commons/filepicker/Costants.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package fr.free.nrw.commons.filepicker

interface Constants {
companion object {
const val DEFAULT_FOLDER_NAME = "CommonsContributions"
}

/**
* Provides the request codes for permission handling
*/
interface RequestCodes {
companion object {
const val LOCATION = 1
const val STORAGE = 2
}
}

/**
* Provides locations as string for corresponding operations
*/
interface BundleKeys {
companion object {
const val FOLDER_NAME = "fr.free.nrw.commons.folder_name"
const val ALLOW_MULTIPLE = "fr.free.nrw.commons.allow_multiple"
const val COPY_TAKEN_PHOTOS = "fr.free.nrw.commons.copy_taken_photos"
const val COPY_PICKED_IMAGES = "fr.free.nrw.commons.copy_picked_images"
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package fr.free.nrw.commons.filepicker

/**
* Provides abstract methods which are overridden while handling Contribution Results
* inside the ContributionsController
*/
abstract class DefaultCallback: FilePicker.Callbacks {

override fun onImagePickerError(e: Exception, source: FilePicker.ImageSource, type: Int) {}

override fun onCanceled(source: FilePicker.ImageSource, type: Int) {}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package fr.free.nrw.commons.filepicker

import androidx.core.content.FileProvider

class ExtendedFileProvider: FileProvider() {}
Loading

0 comments on commit 28ba71e

Please sign in to comment.