Commit graph

4758 commits

Author SHA1 Message Date
Ifeoluwa Andrew Omole
4d2170257a
Nearby List: Only show place cards with loaded names (#6301)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-05-04 15:38:18 +05:30
translatewiki.net
0024e72a2e
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-05-01 14:01:50 +02:00
translatewiki.net
60aca9a5e3
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-04-28 14:01:51 +02:00
translatewiki.net
d0f6c16878
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-04-24 14:02:11 +02:00
Yusuke Matsubara
8fded5ef6e
Change back some variable names that were accidentally changed (#6297) 2025-04-24 20:16:03 +09:00
Yusuke Matsubara
329a68216e
Improve credit line in image list (#6295)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
- When author is not uploader, show both.
- When failing to parse author from HTML, use structured data.
2025-04-23 23:23:09 +09:00
translatewiki.net
30762971db
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-04-21 14:01:47 +02:00
Khushbu Khemchandani
7479d96675
Code Enhancement (Explore Map) (#6293)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
* 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>
2025-04-21 14:49:15 +09:00
translatewiki.net
ed42d85f67
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-04-17 14:01:53 +02:00
Sonal Yadav
78d29bcf20
FIX : Custom picker detect images that is already in commons (#6288)
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
* Fix: Exclude specific text from being posted in WikidataFeedback

* Add detection logic for images already on Commons in custom picker
2025-04-15 13:53:26 +10:00
Khushbu Khemchandani
9289dcc42c
UI enhancement Issue(#6285) (#6287)
* Exclude past locations (P585) from Nearby query

* "Send" button text should be white
2025-04-14 22:58:28 +09:00
translatewiki.net
efdc9c5548
Localisation updates from https://translatewiki.net.
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-04-14 14:01:44 +02:00
Khushbu Khemchandani
69b3544107
Exclude past locations (P585) from Nearby query (#6284)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-04-14 10:54:29 +09:00
Ritika Pahwa
5b5aeead88
Bump up version code to 1050
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-04-13 13:09:19 +05:30
Prinuel
4bacac1f8b
BookmarkLocationsFragment.kt:fix android studio warnings for this file, : Eliminated three unused imports, and changed calls to object: FilePicker.HandleActivityResult to use lamda (#6283)
Co-authored-by: bethel-m <bethelcletus87@gmail.com>
2025-04-13 14:39:14 +09:00
samimshoaib01
6aeb3c07cc
ui: make recenter FAB theme-aware using Material attributes (#6281)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-04-12 21:05:42 +05:30
Sonal Yadav
2c41176a6e
Mark for closed locations (P3999) in Nearby (#6273)
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
* Exclude closed locations (P3999) from Nearby query

* feat: Show  for P3999 items (official closure)

* revert changes

* Add P3999 (date of closure) support for non-existent places

* Typo fixing

* fix-typo

* .

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-04-11 18:00:47 +09:00
translatewiki.net
e3dd00bcfa
Localisation updates from https://translatewiki.net.
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-04-10 14:01:48 +02:00
Jason-Whitmore
262efe4d8c
ExploreMapFragment.java: fix removeMarker() to remove the correct marker (#6279)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
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().
2025-04-10 14:19:31 +09:00
Dmitry Brant
2eed441462
Enable EmailAuth support. (#6277)
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-04-08 20:59:28 +09:00
translatewiki.net
56fa8ceb5a
Localisation updates from https://translatewiki.net.
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-04-07 14:01:50 +02:00
Rohit Verma
7bf9276d1a
fix: resolve IndexOutOfBounds error when removing images from top card (#6124)
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
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>
2025-04-05 22:47:27 +09:00
Prinuel
51da9e4dd6
FooterAdapter.kt: changed enum access of FooterItem, from FooterItem.values to FooterItem.entries, this is the more efficient way of accessing Enum values as introduced in kotlin 1.9 (#6271)
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
Co-authored-by: bethel-m <bethelcletus87@gmail.com>
2025-04-03 21:10:41 +09:00
translatewiki.net
731ff62faf
Localisation updates from https://translatewiki.net. 2025-04-03 14:01:45 +02:00
translatewiki.net
fdfd7781e9
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-03-31 14:01:52 +02:00
Jason-Whitmore
6e090c8d7a
ExploreMapFragment.java: fix marker labels in Explore map fragment to display the username (#6260)
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.
2025-03-31 17:49:06 +09:00
translatewiki.net
669f3043ae
Localisation updates from https://translatewiki.net. 2025-03-27 13:01:54 +01:00
translatewiki.net
5a5e660a43
Localisation updates from https://translatewiki.net. 2025-03-24 13:01:43 +01:00
Ritika Pahwa
2e05a58e8b
Bump up version code to 1049 2025-03-22 14:07:51 +05:30
translatewiki.net
f1f4e8baff
Localisation updates from https://translatewiki.net. 2025-03-20 13:01:41 +01:00
Sonal Yadav
828f69fc46
Update Privacy Policy Link to GitHub.io (#6255)
* "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
2025-03-20 07:21:33 +09:00
Ritika Pahwa
954a7aee91
Bump up version code and name (#6250)
* Bump up version code and name

* Remove unintended change
2025-03-18 23:28:19 +09:00
translatewiki.net
fa0bdf5747
Localisation updates from https://translatewiki.net. 2025-03-17 13:01:37 +01:00
Sonal Yadav
67ac92ff57
Fix NullPointerException in onBackPressed() (#6249) 2025-03-17 07:53:58 +09:00
Sonal Yadav
e1466c866b
Fix NullPointerException in UploadCategoriesFragment (#6246) 2025-03-14 16:16:14 +10:00
translatewiki.net
ba89894dc4
Localisation updates from https://translatewiki.net. 2025-03-13 13:01:53 +01:00
translatewiki.net
c46c1d2353
Localisation updates from https://translatewiki.net. 2025-03-10 13:01:11 +01:00
Saifuddin Adenwala
30322707fc
Migrated media/zoomControllers package to kotlin (#6204)
* Rename .java to .kt

* Migrated media/zoomControllers package to kotlin

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-03-08 22:47:23 +09:00
Parneet Singh
972bf785f1
Fix empty username (#6209)
* revert changes from #5860

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* read author prop instead

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* Use user prop if author is empty or null

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* fix test

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

---------

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
2025-03-08 22:26:41 +09:00
Rohit Verma
32d485cc51
fix: null context issue by removing context getter override (#6218)
Refactored related code to resolve build issues
2025-03-08 22:02:28 +09:00
Parneet Singh
d11439f85d
add cancel button listener (#6216)
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
2025-03-07 09:52:52 +09:00
Rohit Verma
681881f4f6
fix: crash when opening leader board tab (#6220) 2025-03-07 08:21:31 +09:00
Nicolas Raoul
939d01b267 Bumped to 5.1.3 to reflect feature parity but the real 5.1.3 release was performed in the google_play_safe branch 2025-03-06 23:00:45 +09:00
translatewiki.net
d233de6103
Localisation updates from https://translatewiki.net. 2025-03-06 13:01:40 +01:00
translatewiki.net
6b56075df8
Localisation updates from https://translatewiki.net. 2025-03-03 13:01:29 +01:00
Rohit Verma
218476acbc
fix: rename isDarkTheme property to prevent recursion (#6231) 2025-03-02 06:19:43 +10:00
translatewiki.net
fa24b93830
Localisation updates from https://translatewiki.net. 2025-02-27 13:01:51 +01:00
Nicolas Raoul
88eedc3506 Revert previous commit, wrong branch
This reverts commit aa84dedd64.
2025-02-26 18:03:24 +09:00
Nicolas Raoul
aa84dedd64 Removed Explore, Peer review, because we are at risk of being removed from Google Play tomorrow 2025-02-26 18:00:48 +09:00
Saifuddin Adenwala
1c7dce9e12
Migrated bookmarks locations to Kotlin and adapt room database (#6148)
* Rename .java to .kt

* Refactor: Migrate bookmark location logic to Kotlin

This commit migrates the bookmark location logic to Kotlin, enhancing code maintainability and readability.

-   Removes the `BookmarkLocationsContentProvider`, `BookmarkLocationsController`, and `BookmarkLocationsDao` Java classes.
-   Creates `BookmarkLocationsDao.kt` and `BookmarkLocationsContentProvider.kt` in Kotlin.
-   Migrates the logic from `BookmarkLocationsFragment.java` to `BookmarkLocationsFragment.kt`.
-   Updates test files to reflect these changes.
-   Addresses associated code review comments.

* Refactor: Migrate to Room Database for Bookmark Locations

This commit migrates the bookmark locations functionality from a custom content provider to Room database.

Key changes:

*   **Removal of `BookmarkLocationsContentProvider`:** This class, which previously handled data storage, has been removed.
*   **Introduction of `BookmarksLocations`:** This data class now represents a bookmarked location, serving as the Room entity.
*   **Creation of `BookmarkLocationsDao`:** This Room DAO handles database interactions for bookmark locations, including:
    *   Adding, deleting, and querying bookmarked locations.
    *   Checking if a location is already bookmarked.
    *   Updating the bookmark status of a location.
    *   Retrieving all bookmarked locations as `Place` objects.
*   **`BookmarkLocationsViewModel`:** Added to manage the data layer for bookmark locations
*   **`NearbyUtil`:** Created a Util class for Nearby to manage the bookmark locations.
*   **Updates in `PlaceAdapter` and `PlaceAdapterDelegate`:** These classes have been modified to work with the new Room-based data layer.
*   **Updates in `AppDatabase`:** The database now includes `BookmarksLocations` as an entity and exposes the `bookmarkLocationsDao`.
*   **Updates in `FragmentBuilderModule` and `CommonsApplicationModule`**: for DI
*   **Removal of `DBOpenHelper` upgrade for locations**: as it is no longer needed
* **Updates in `NearbyParentFragmentPresenter`**: refactored the logic to use the dao functions
* **Updates in `NearbyParentFragment`**: refactored the logic to use the util and dao functions
* **Update in `BookmarkLocationsController`**: removed as its no longer needed
* **Add `toPlace` and `toBookmarksLocations`**: extension functions to map between data class and entities
* **Update in `CommonsApplication`**: to remove old db table.

* Refactor: Improve bookmark location handling and update database version

This commit includes the following changes:

-   Updates the database version to 20.
-   Refactors bookmark location handling within `NearbyParentFragment` to improve logic and efficiency.
-   Introduces `getBookmarkLocationExists` in `NearbyUtil` to directly update bookmark icons in the bottom sheet adapter.
-   Removes unused provider.
-   Adjusts `BookmarkLocationsFragment`'s `PlaceAdapter` to use `lifecycleScope` for better coroutine management.
-   Refactors `updateBookmarkLocation` in `NearbyParentFragmentPresenter`.

* Toggle bookmark icon in BottomSheetAdapter instead of finding the location each time in the bookmark

* Update bookmark button image in `BottomSheetAdapter`
* Add new toggle function to `BottomSheetAdapter`
* Call the toggle function in `NearbyParentFragment`

* Refactor: Load bookmarked locations using Flow

*   `BookmarkLocationsController`: Changed to use `Flow` to load bookmarked locations.
*   `BookmarkLocationsDao`: Changed to return `Flow` of bookmark location instead of a list.
*   `BookmarkLocationsFragment`: Used `LifecycleScope` to collect data from flow and display it.
*   Removed unused `getAllBookmarkLocations()` from `BookmarkLocationsViewModel`.
*   Used `map` in `BookmarkLocationsDao` to convert from `BookmarksLocations` to `Place` list.

* Loading locations data in fragment

*   BookmarkLocationsController: Changed `loadFavoritesLocations` to be a suspend function.
*   BookmarkLocationsFragment: Updated the `initList` function to call the controller's suspend function.
*   BookmarkLocationsDao: Changed `getAllBookmarksLocations` and `getAllBookmarksLocationsPlace` to be suspend functions.

* Refactor BookmarkLocationControllerTest and related files to use coroutines

*  Migrated `bookmarkDao!!.getAllBookmarksLocations()` to `bookmarkDao!!.getAllBookmarksLocationsPlace()` and added `runBlocking`
*  Added `runBlocking` for `loadBookmarkedLocations()` and `testInitNonEmpty()`
*  Added `runBlocking` for `getAllBookmarksLocations()` and update `updateMapMarkers`

These changes improve the test structure by ensuring the database functions are executed within a coroutine context.

* Refactor BookmarkLocationsFragment and add tests for BookmarkLocationsDao

*   Moved `initList` to `BookmarkLocationsFragment` for better lifecycle handling.
*   Added test case for `BookmarkLocationsFragment`'s onResume.
*   Added test cases for `BookmarkLocationsDao` operations like adding, retrieving, finding, deleting and updating bookmarks.

* Refactor BookmarkLocationsFragment to load favorites only when view is not null

* BookmarkLocationsFragment: load favorites locations only when view is not null.
* BookmarkLocationsFragmentTest: added spy and verify to test onResume() call initList() method.

* Refactor database and add migration

*   `AppDatabase`: Updated to use room migration.
*   `CommonsApplicationModule`: added migration from version 19 to 20 to `appDatabase`

* Rename .java to .kt

* Refactor: Migrate bookmark location logic to Kotlin

This commit migrates the bookmark location logic to Kotlin, enhancing code maintainability and readability.

-   Removes the `BookmarkLocationsContentProvider`, `BookmarkLocationsController`, and `BookmarkLocationsDao` Java classes.
-   Creates `BookmarkLocationsDao.kt` and `BookmarkLocationsContentProvider.kt` in Kotlin.
-   Migrates the logic from `BookmarkLocationsFragment.java` to `BookmarkLocationsFragment.kt`.
-   Updates test files to reflect these changes.
-   Addresses associated code review comments.

* Refactor: Migrate to Room Database for Bookmark Locations

This commit migrates the bookmark locations functionality from a custom content provider to Room database.

Key changes:

*   **Removal of `BookmarkLocationsContentProvider`:** This class, which previously handled data storage, has been removed.
*   **Introduction of `BookmarksLocations`:** This data class now represents a bookmarked location, serving as the Room entity.
*   **Creation of `BookmarkLocationsDao`:** This Room DAO handles database interactions for bookmark locations, including:
    *   Adding, deleting, and querying bookmarked locations.
    *   Checking if a location is already bookmarked.
    *   Updating the bookmark status of a location.
    *   Retrieving all bookmarked locations as `Place` objects.
*   **`BookmarkLocationsViewModel`:** Added to manage the data layer for bookmark locations
*   **`NearbyUtil`:** Created a Util class for Nearby to manage the bookmark locations.
*   **Updates in `PlaceAdapter` and `PlaceAdapterDelegate`:** These classes have been modified to work with the new Room-based data layer.
*   **Updates in `AppDatabase`:** The database now includes `BookmarksLocations` as an entity and exposes the `bookmarkLocationsDao`.
*   **Updates in `FragmentBuilderModule` and `CommonsApplicationModule`**: for DI
*   **Removal of `DBOpenHelper` upgrade for locations**: as it is no longer needed
* **Updates in `NearbyParentFragmentPresenter`**: refactored the logic to use the dao functions
* **Updates in `NearbyParentFragment`**: refactored the logic to use the util and dao functions
* **Update in `BookmarkLocationsController`**: removed as its no longer needed
* **Add `toPlace` and `toBookmarksLocations`**: extension functions to map between data class and entities
* **Update in `CommonsApplication`**: to remove old db table.

* Refactor: Improve bookmark location handling and update database version

This commit includes the following changes:

-   Updates the database version to 20.
-   Refactors bookmark location handling within `NearbyParentFragment` to improve logic and efficiency.
-   Introduces `getBookmarkLocationExists` in `NearbyUtil` to directly update bookmark icons in the bottom sheet adapter.
-   Removes unused provider.
-   Adjusts `BookmarkLocationsFragment`'s `PlaceAdapter` to use `lifecycleScope` for better coroutine management.
-   Refactors `updateBookmarkLocation` in `NearbyParentFragmentPresenter`.

* Toggle bookmark icon in BottomSheetAdapter instead of finding the location each time in the bookmark

* Update bookmark button image in `BottomSheetAdapter`
* Add new toggle function to `BottomSheetAdapter`
* Call the toggle function in `NearbyParentFragment`

* Refactor: Load bookmarked locations using Flow

*   `BookmarkLocationsController`: Changed to use `Flow` to load bookmarked locations.
*   `BookmarkLocationsDao`: Changed to return `Flow` of bookmark location instead of a list.
*   `BookmarkLocationsFragment`: Used `LifecycleScope` to collect data from flow and display it.
*   Removed unused `getAllBookmarkLocations()` from `BookmarkLocationsViewModel`.
*   Used `map` in `BookmarkLocationsDao` to convert from `BookmarksLocations` to `Place` list.

* Loading locations data in fragment

*   BookmarkLocationsController: Changed `loadFavoritesLocations` to be a suspend function.
*   BookmarkLocationsFragment: Updated the `initList` function to call the controller's suspend function.
*   BookmarkLocationsDao: Changed `getAllBookmarksLocations` and `getAllBookmarksLocationsPlace` to be suspend functions.

* Refactor BookmarkLocationControllerTest and related files to use coroutines

*  Migrated `bookmarkDao!!.getAllBookmarksLocations()` to `bookmarkDao!!.getAllBookmarksLocationsPlace()` and added `runBlocking`
*  Added `runBlocking` for `loadBookmarkedLocations()` and `testInitNonEmpty()`
*  Added `runBlocking` for `getAllBookmarksLocations()` and update `updateMapMarkers`

These changes improve the test structure by ensuring the database functions are executed within a coroutine context.

* Refactor BookmarkLocationsFragment and add tests for BookmarkLocationsDao

*   Moved `initList` to `BookmarkLocationsFragment` for better lifecycle handling.
*   Added test case for `BookmarkLocationsFragment`'s onResume.
*   Added test cases for `BookmarkLocationsDao` operations like adding, retrieving, finding, deleting and updating bookmarks.

* Refactor BookmarkLocationsFragment to load favorites only when view is not null

* BookmarkLocationsFragment: load favorites locations only when view is not null.
* BookmarkLocationsFragmentTest: added spy and verify to test onResume() call initList() method.

* Refactor database and add migration

*   `AppDatabase`: Updated to use room migration.
*   `CommonsApplicationModule`: added migration from version 19 to 20 to `appDatabase`

* Resolve conflicts and attach the `commons.db` with `common_room.db` during the migration to persist the data

* Refactor database migration to handle null values and use direct insertion

*   Modify the database migration from version 19 to 20 to properly handle null values and use direct data insertion.
*   Create a new table `bookmarks_locations` with `NOT NULL` constraints.
*   Directly insert data into the new table from old database, safely handling `NULL` values by using `DEFAULT` empty string value.
*   Close old database cursor and the database connection.
* Drop the old `bookmarksLocations` table.

* Refactor database schema to delete `bookmarksLocations` table and migrate data

*   Delete `bookmarksLocations` table from the database during schema upgrade
*   Migrate data from `bookmarksLocations` to `bookmarks_locations` in new schema
*   Add `INSERT OR REPLACE` to prevent duplication during migration
*   Delete `CONTRIBUTIONS_TABLE` and `BOOKMARKS_LOCATIONS` in the application start-up to have a fresh DB for first start-up after update

* Update sqlite-based database version to 22.

* Update sqlite-based database version to 22.

* Refactor CommonsApplicationModule to utilize application context

* Initialize and use application context directly

* Utilize lateinit for application context

* Added line breaks for improved readability.

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-02-24 22:58:26 +09:00