Merge 4.0-release into master (#5028)

* Fix string for custom selector

* Fix bug #4950 back arrow still present on top-level activity (#4952)

* Fix bug #4949 by correctly setting previous db version number (#4956)

* Fix bug #4949 by correctly setting previous db version number

* Fix failing tests

* Fix bug #4959 by correctly setting previous db version number and updating the current db version (#4960)

* Fix bug #4957 (#4961)

* Update library to new version that handles older Java VMs

Fixes #4972 I believe.

* Versioning for v4.0.0

* Changelog for v4.0.0

* Fix bug #4984 Added queries for package name for Android API 30+ (#4987)

* Update mapbox sdk version (#4989)

* Versioning for v4.0.1

* Changelog for v4.0.1

* Remove network type information from NetworkUtils (#4996)

* Remove network type information from NetworkUtils

* Ignore dependent tests

* Fix #4992 invert the equals condition to be null safe (#4995)

* Fix java.lang.NullPointerException for username in ContributionBoundaryCallback (#5003)

* Fix failing tests for PR #5003 (#5004)

* Fix java.lang.NullPointerException for username in ContributionBoundaryCallback

* Fix failing tests

* Update Room DB Version (#5011)

* Fix #5001 (#5010)

* Fix DB update issue (#5016)

* [WIP] Fix both timezone problem and saved date problem (#5019)

* Fix both timezone problem and saved date problem

* Fixaccidental test code and add comments

* Add issue link to the comments

* Fix format issue and null checks

* Versioning for v4.0.2

* Changelog for v4.0.2

* Add "Report Violation" menu option (#5025)

* Add "Report Violation" menu option

* Update email template

* Update email address

* Fixed typo

Co-authored-by: Josephine Lim <josephinelim86@gmail.com>

* Versioning for v4.0.3

* Changelog for v4.0.3

Co-authored-by: Josephine Lim <josephinelim86@gmail.com>
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
This commit is contained in:
Madhur Gupta 2022-08-08 11:21:07 +05:30 committed by GitHub
parent 1de8968fa8
commit 3cdfdcffe1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 406 additions and 72 deletions

View file

@ -38,6 +38,7 @@ data class Contribution constructor(
val localUri: Uri? = null,
var dataLength: Long = 0,
var dateCreated: Date? = null,
var dateCreatedString: String? = null,
var dateModified: Date? = null,
var hasInvalidLocation : Int = 0,
var contentUri: Uri? = null,
@ -70,6 +71,7 @@ data class Contribution constructor(
depictedItems = depictedItems,
wikidataPlace = from(item.place),
contentUri = item.contentUri,
dateCreatedString = item.fileCreatedDateString,
imageSHA1 = imageSHA1
)

View file

@ -21,7 +21,7 @@ class ContributionBoundaryCallback @Inject constructor(
@param:Named(CommonsApplicationModule.IO_THREAD) private val ioThreadScheduler: Scheduler
) : BoundaryCallback<Contribution>() {
private val compositeDisposable: CompositeDisposable = CompositeDisposable()
lateinit var userName: String
var userName: String? = null
/**
@ -53,13 +53,13 @@ class ContributionBoundaryCallback @Inject constructor(
/**
* Fetches contributions using the MediaWiki API
*/
fun fetchContributions() {
private fun fetchContributions() {
if (sessionManager.userName != null) {
compositeDisposable.add(
mediaClient.getMediaListForUser(userName!!)
userName?.let { userName ->
mediaClient.getMediaListForUser(userName)
.map { mediaList ->
mediaList.map {
Contribution(media = it, state = Contribution.STATE_COMPLETED)
mediaList.map { media ->
Contribution(media = media, state = Contribution.STATE_COMPLETED)
}
}
.subscribeOn(ioThreadScheduler)
@ -69,11 +69,13 @@ class ContributionBoundaryCallback @Inject constructor(
error.message
)
}
)
}else {
if (compositeDisposable != null){
compositeDisposable.clear()
}?.let {
compositeDisposable.add(
it
)
}
}else {
compositeDisposable.clear()
}
}

View file

@ -661,7 +661,7 @@ public class ContributionsFragment
}
public boolean backButtonClicked() {
if (null != mediaDetailPagerFragment && mediaDetailPagerFragment.isVisible()) {
if (mediaDetailPagerFragment != null && mediaDetailPagerFragment.isVisible()) {
if (store.getBoolean("displayNearbyCardView", true) && !isUserProfile) {
if (nearbyNotificationCardView.cardViewVisibilityState == NearbyNotificationCardView.CardViewVisibilityState.READY) {
nearbyNotificationCardView.setVisibility(View.VISIBLE);
@ -678,9 +678,10 @@ public class ContributionsFragment
}else {
fetchCampaigns();
}
if(getActivity() instanceof MainActivity) {
if (getActivity() instanceof MainActivity) {
// Fragment is associated with MainActivity
((MainActivity)getActivity()).showTabs();
((BaseActivity) getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(false);
((MainActivity) getActivity()).showTabs();
}
return true;
}