Before this change, removeMarker() would search for the correct Overlay by doing a linear
search and matching the BaseMarker's Place name with the Overlay's title.
This stopped working once the Overlay's title text was changed to be more user friendly.
This change implements a more robust solution. A map is used to directly associate
BaseMarkers with the matching Overlay. The overlay can now be removed from the
overlay list without using any of the information contained within the BaseMarker
or Overlay.
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
* 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>
* chore: migrate groovy build files to Kotlin DSL and upgrade AGP
chore: use version catalog to manage dependencies
chore: move plugins to version catalog
remove deprecated way of enabling build-config and redundant code
chore: setup triplet-play plugin configuration
refactor: move dependency block and tasks to the end of build file
refactor: move dependency block and mark redundant dependencies
* cleanup: remove redundant dependencies from build file
* cleanup: remove git utils file as the functions moved to build file
---------
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
* Fix crash when uploading a duplicate file
* Fix: app crash
* added Kdoc
* remove line b/w kdoc and function
---------
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
* ExploreMapFragment.java: add helper methods and fields to enable proper Explore map behavior
Before this commit, there was no way to tell if the user had arrived from the Nearby and
before the Nearby map center location had been searched for markers.
This commit adds a boolean flag to indicate this situation. Access, modification, and
initialization methods were added for this boolean value. Additionally, a helper
method to retrieve the Nearby map center LatLng was added as a convienience.
* ExploreMapPresenter.java: fix map update code to search for Nearby LatLng when appropriate
Before this commit, when the user selected "Show in explore" in Nearby when no pins were
on the map, Explore would only search for markers at the user's current GPS location,
rather than those at the Nearby map center.
After this commit, code was added to check if the user recently came from the Nearby map.
If so, the stored coordinates of the Nearby map is searched rather than the user's current
GPS coordinates. Additionally, the boolean that indicates that the user recently came
from the Nearby map is set to false. This ensures that the stored Nearby map center
coordinates are not used when the user taps the icon to focus the map on their
current location.
---------
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
* ImageInfo.kt: remove call to updateThumbURL()
Before this commit, the updateThumbURL() method would attempt to derive a larger resolution thumbnail URL
from the current thumbnail's width and height. This derived thumbnail URL would sometimes not match
an actual URL. Even creating this thumbnail URL would sometimes fail when doing string manipulation.
Both errors can cause issues, with the second one crashing the thread and preventing images from being
loaded.
This commit simply removes the call to updateThumbURL(). Images with their thumbnails now load correctly,
especially with panoramic images.
* MediaInterface.kt: fix MediaWiki API call to retrieve thumbnail URLs properly
Before this change, the API calls to MediaWiki would request thumbnails with atleast a specific width,
rather than height. These thumbnails would often be extremely low resolution on very wide images,
such as panoramas.
This change instead requests thumbnails with atleast a specific height. Panorama thumbnails are now
at a higher resolution than before. Additionally, the height parameter is now represented as an
integer which can be changed more easily.
* ViewPagerAdapter.java: create new constructor with behavior parameter
Before this commit, ViewPagerAdapter only had one constructor which used the default
behavior where more than the current fragment would be in the Resume state.
This commit adds a constructor where the behavior parameter can be specified.
* ExploreFragment.java: modify onCreateView to use new ViewPagerAdapter constructor
Before this change, onCreateView would use the old ViewPagerAdapter constructor, which
had a default behavior where fragments not currently visible would be in the Resume
state.
After this change, the new ViewPagerAdapter constructor is used with a non-default
behavior where only the visible fragment would be in the Resume state. This has
performance benefits for most users since the Fragments will only be active
when they want to view them.
* ExploreMapFragment.java: remove redundant method call
Before this commit, performMapReadyActions() was called in both onViewCreated and onResume.
In effect, the method is called twice before the user can even see the map, leading to
performance issues.
After this commit, the call in onViewCreated is removed. The method is now called only once
when the user switches to the ExploreMapFragment.
* ExploreMapFragment.java: remove method call that causes recursive loop
Before this commit, there was a call loop that included onScroll and animateTo
on the map. These two method calls caused performance issues in
ExploreMapFragment.
This commit breaks the call loop by removing moveCameraToPosition from getMapCenter.
Also, the removed code did not fit the purpose of getMapCenter.
* ExploreMapFragment.java: fix performMapReadyActions to center to user's last known location
Before this commit, fixing a previous bug caused performMapReadyActions to center the map
on a default location rather than the available last known location.
This commit adds code which will attempt to get the last known user location. If it cannot
be retrieved, the default location is used. The map now centers properly.
* MediaInterface.kt: adjust thumbnail height parameter
Before this commit, the thumbnail height parameter was too small, causing low resolution thumbnails to render.
This commit more than doubles the parameter, increasing the thumbnail resolution.
---------
Co-authored-by: Ritika Pahwa <83745993+RitikaPahwa4444@users.noreply.github.com>
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
* Exclude past locations (P585) from Nearby query
* "Send" button text should be white
* Custom picker: logic
* Revert back changes
* Enhancement :- Explore Map information
* Enhancement :- Explore Map information
* Style
---------
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
Before this change, the removeMarker() method would determine the correct overlay to remove
by comparing an overlay's Place coordinates with the target BaseMarker's Place coordinates.
If two different markers had the same Place coordinates, the incorrect marker would be removed,
leading to more than one green label appearing on the screen.
After this change, the removeMarker() method now compares an overlay's title with the BaseMarker's
Place name. removeMarker() will work properly as long as all BaseMarker's Place names are unique.
Also, null checks were added to removeMarker().
replace deprecated onBackPressed with onBackPressedCallback
remove unit test for deprecated onBackPressed method
remove if-check before deleting picture to prevent hiding top thumbnail card
hide the thumbnail card on fragments other than MediaDetailFragment
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
Before this change, the labels that would appear on the marker when tapped did not include
the author or username. Instead, it displayed "Unknown".
After this change, the labels now display the author name. If the author name is not
available, the username will be displayed. If both are unavailable, the default value
of "Unknown" will be displayed. To improve the readability of the text, any HTML text
is removed from the username/author.
* "moved privacy policy"
* Update PRIVACY_POLICY_URL to https://commons-app.github.io/privacy-policy as suggested
* Use BuildConfig.PRIVACY_POLICY_URL in launchPrivacyPolicy function