Fix Kotlin warnings (related to issue #5996) (#6320)

* refactor: replace unused exception variable with underscore

* refactor: code style fix

* fix: remove unnecessary latLng variable and return null directly

* fix: use explicit true/false instead of isFABsExpanded

* refactor: simplify marker update logic by reducing redundant conditions

* refactor: use data object instead of object

* fix: check placeBindings for null instead of checking each destructured value

* fix: check placeBindings for null instead of checking each destructured value

* docs: fix KDoc for contentUri property by removing incorrect @param tag

* docs: correct @see link in KDoc for showBadgesWithCount

* docs: fix KDoc tag from @property to @param for context in BottomSheetAdapter

* docs: comment out KDoc for disabled method to avoid unresolved @param warning

* docs: fix KDoc for onLongPress by removing invalid @param imageUri

* docs: clean up invalid KDoc tags on property and add docs to isEmpty

* docs: remove invalid @param originalImageCoordinates from findOtherImages KDoc

* docs: fix incorrect @param tag in checkDuplicateImage KDoc

* docs: fix incorrect @param in onLongPress KDoc

* docs: fix invalid @param and @return tags on author property

* docs: fix incorrect @param in provideWikidataMediaInterface KDoc

* docs: fix incorrect @param name in getWikiText KDoc

* docs: escape wikilinks with [[ ]] to avoid KDoc resolution warnings

* docs: fix KDoc by adding missing param descriptions to startActivityWithFlags

* docs: fix KDoc by replacing @param with @property for contentUri

* docs: fix malformed KDoc in startYourself, remove invalid @param line

* docs: remove invalid @param tag in createDialogsAndHandleLocationPermissions

* docs: remove invalid @param tags to @property

* @docs: remove invalid @property tags

* docs: clean up KDoc by removing invalid @param and @return tags

* docs: fix incorrect @param name in removeBlocklisted KDoc

* docs: fix incorrect @param name in checkDuplicateImage KDoc

* docs: fix incorrect @param tag

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
This commit is contained in:
rayane 2025-05-29 13:25:00 +02:00 committed by GitHub
parent ed1485ca22
commit cfc2cfcca1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 153 additions and 150 deletions

View file

@ -16,7 +16,7 @@ import fr.free.nrw.commons.nearby.model.BottomSheetItem
/**
* RecyclerView Adapter for displaying items in a bottom sheet.
*
* @property context The context used for inflating layout resources.
* @param context The context used for inflating layout resources.
* @property itemList The list of BottomSheetItem objects to display.
* @constructor Creates an instance of BottomSheetAdapter.
*/

View file

@ -63,6 +63,7 @@ import fr.free.nrw.commons.bookmarks.locations.BookmarkLocationsDao
import fr.free.nrw.commons.contributions.ContributionController
import fr.free.nrw.commons.contributions.MainActivity
import fr.free.nrw.commons.contributions.MainActivity.ActiveFragment
import fr.free.nrw.commons.customselector.ui.selector.ImageLoader
import fr.free.nrw.commons.databinding.FragmentNearbyParentBinding
import fr.free.nrw.commons.di.CommonsDaggerSupportFragment
import fr.free.nrw.commons.filepicker.FilePicker
@ -1756,9 +1757,9 @@ class NearbyParentFragment : CommonsDaggerSupportFragment(),
override fun animateFABs() {
if (binding!!.fabPlus.isShown) {
if (isFABsExpanded) {
collapseFABs(isFABsExpanded)
collapseFABs(true)
} else {
expandFABs(isFABsExpanded)
expandFABs(false)
}
}
}
@ -2013,17 +2014,17 @@ class NearbyParentFragment : CommonsDaggerSupportFragment(),
if (place.exists && place.pic.trim { it <= ' ' }.isEmpty()) {
shouldUpdateMarker = true
}
} else if (displayExists && !displayNeedsPhoto) {
} else if (displayExists) {
// Exists and all included needs and doesn't needs photo
if (place.exists) {
shouldUpdateMarker = true
}
} else if (!displayExists && displayNeedsPhoto) {
} else if (displayNeedsPhoto) {
// All and only needs photo
if (place.pic.trim { it <= ' ' }.isEmpty()) {
shouldUpdateMarker = true
}
} else if (!displayExists && !displayNeedsPhoto) {
} else {
// all
shouldUpdateMarker = true
}