Commit graph

6375 commits

Author SHA1 Message Date
Sujal-Gupta-SG
b7185073a2 Merge remote-tracking branch 'origin/Nearby-upload-not-being-linked-from-Wikidata' into Nearby-upload-not-being-linked-from-Wikidata 2025-02-03 23:09:21 +05:30
Sujal-Gupta-SG
cf2e36723a added logging statement 2025-02-03 23:08:13 +05:30
Sujal-Gupta-SG
ab7eafcfaf added logging statement 2025-02-03 23:07:37 +05:30
Sujal
22fbf4c668
Merge branch 'commons-app:main' into Nearby-upload-not-being-linked-from-Wikidata 2025-02-03 22:44:08 +05:30
translatewiki.net
0293b865b4
Localisation updates from https://translatewiki.net. 2025-02-03 13:01:34 +01:00
Nicolas Raoul
939105c8e2
Merge branch 'main' into Nearby-upload-not-being-linked-from-Wikidata 2025-02-01 23:08:51 +09:00
Sujal-Gupta-SG
6deb5fac19 correct 2025-02-01 18:13:21 +05:30
Sujal-Gupta-SG
2d5dd7283a correct 2025-02-01 18:12:28 +05:30
Sujal-Gupta-SG
9a66a74a49 correct 2025-02-01 18:01:07 +05:30
Sujal-Gupta-SG
bb14edfe70 correct identation 2025-02-01 13:49:47 +05:30
Sujal-Gupta-SG
31e9d716e1 correct identation 2025-02-01 13:38:05 +05:30
Parneet Singh
7566ddf529
enhance spammy category filter (#6167)
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
2025-02-01 09:13:17 +09:00
translatewiki.net
e653857437
Localisation updates from https://translatewiki.net. 2025-01-31 09:49:38 +01:00
Ifeoluwa Andrew Omole
7b291535e0
Feat: Make it smoother to switch between nearby and explore maps (#6164)
* Nearby: Add 'Show in Explore' 3-dots menu item

* MainActivity: Add methods to pass extras between Nearby and Explore

* MainActivity: Extend loadFragment() to support passing fragment arguments

* Nearby: Add ability to navigate to Explore fragment on 'Show in Explore' click

* Explore: Read fragment arguments for Nearby map data and update Explore map if present

* Explore: Add 'Show in Nearby' 3-dots menu item. Only visible when Map tab is selected

* Explore: On 'Show in Nearby' click, navigate to Nearby fragment, passing map data as fragment args

* Nearby: Read fragment arguments for Explore map data and update Nearby map if present

* MainActivity: Fix memory leaks when navigating between bottom nav destinations

* Explore: Fix crashes caused by unattached map fragment

* Refactor code to pass unit tests

* Explore: Format javadocs

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-01-30 21:58:00 +09:00
translatewiki.net
9dc9a3b8ab
Localisation updates from https://translatewiki.net. 2025-01-30 13:01:33 +01:00
Sujal-Gupta-SG
e60037300a Some correction in the code 2025-01-30 13:36:38 +05:30
Akshay Komar
5d4474ead6
Migrated AboutActivity from Java to Kotlin (#6158)
* Rename Constants to Follow Kotlin Naming Conventions

>This PR refactors constant names in the project to adhere to Kotlin's UPPERCASE_SNAKE_CASE naming convention, improving code readability and maintaining consistency across the codebase.

>Renamed the following constants in LoginActivity:
>saveProgressDialog → SAVE_PROGRESS_DIALOG
>saveErrorMessage → SAVE_ERROR_MESSAGE
>saveUsername → SAVE_USERNAME
>savePassword → SAVE_PASSWORD

>Updated all references to these constants throughout the project.

* Update Project_Default.xml

* Refactor variable names to adhere to naming conventions

Renamed variables to use camel case:
-UPLOAD_COUNT_THRESHOLD → uploadCountThreshold
-REVERT_PERCENTAGE_FOR_MESSAGE → revertPercentageForMessage
-REVERT_SHARED_PREFERENCE → revertSharedPreference
-UPLOAD_SHARED_PREFERENCE → uploadSharedPreference

Renamed variables with uppercase initials to lowercase for alignment with Kotlin conventions:
-Latitude → latitude
-Longitude → longitude
-Accuracy → accuracy

Refactored the following variable names:
-NUMBER_OF_QUESTIONS → numberOfQuestions
-MULTIPLIER_TO_GET_PERCENTAGE → multiplierToGetPercentage

* Refactor Dialog View Initialization with Null-Safe Calls

This PR refactors the dialog setup code in CustomSelectorActivity to improve safety and readability by replacing explicit casts with null-safe generic calls for findViewById.

>Replaced explicit casting (as Button and as TextView) with the generic findViewById<T>() method for improved type safety.
>Added null-safety (?.) to avoid potential crashes if a view is not found in the dialog layout.

why changed:-
>Prevents runtime crashes caused by NullPointerException when a view is missing in the layout.

* Refactor Unit Test: Replace Unsafe Casting with Type-Safe Mocking for findViewById

>PR refactors the unit test for NearbyParentFragment by replacing unsafe casting in the findViewById mocking statements with type-safe

>Ensured all findViewById mocks now use a consistent, type-safe format (findViewById<View>(...)) to reduce verbosity and potential casting errors.

>Verified the functionality of prepareViewsForSheetPosition remains unchanged, ensuring no regression in test behavior.

* Update NearbyParentFragmentUnitTest.kt

* Refactor: Rename Constants to Follow CamelCase Naming Convention

>Updated all constant variable names to follow the camelCase naming convention, removing underscores in the middle or end.

>Ensured variable names remain descriptive and align with code readability best practices.

* Replace private val with const val for URL constants in QuizController

* Renaming the constant to use UPPER_SNAKE_CASE

* Renaming the constant to use UPPER_SNAKE_CASE

* Update Done

* **Refactor: Convert `minimumThresholdForSwipe` to a compile-time constant**

* Convert AboutActivity from Java to Kotlin

This PR converts the AboutActivity class from Java to Kotlin

>Testing:
>Verified all functionalities of the AboutActivity, including toolbar setup, intent launches, and dialog interactions, to ensure behavior remains consistent post-conversion.
>Successfully ran unit tests for AboutActivity to confirm the correctness of methods and logic.

* Thank you for the suggestion! Since these methods all take a single View parameter, replacing them with method references is a great way to simplify the code and improve readability. I'll updated the code accordingly. Added a TODO in the code as a reminder to refactor this in the future.

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-01-30 16:41:27 +09:00
Sujal-Gupta-SG
058c0482da Some correction in the code 2025-01-30 09:47:44 +05:30
Sujal
36f844a709
Show placeholder and display depiction section when no depictions are available (#6163) (#6165)
* corrected

* corrected

* Update MediaDetailFragment.kt

Spelling correction
2025-01-29 22:50:29 +09:00
Tanmay Gupta
e01ecb20fa
maps intent: preserve zoom and show red pin (#6160)
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-01-28 11:36:35 +09:00
yuvraj-coder1
41170d81d9
fix: logout user after account deletion by navigating to login screen (#6159) 2025-01-27 22:39:32 +10:00
translatewiki.net
7400872f87
Localisation updates from https://translatewiki.net. 2025-01-27 13:01:31 +01:00
Sujal-Gupta-SG
b2092fa751 updated 2025-01-25 22:03:44 +05:30
Tanmay Gupta
aedcd7f9b9
Review: Load thumbnail instead of original image (#6153)
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-01-24 16:02:33 +09:00
Tanmay Gupta
bb974f8935
Android CI: Update upload-artifact version (#6157) 2025-01-24 09:52:09 +09:00
translatewiki.net
77bad3380c
Localisation updates from https://translatewiki.net. 2025-01-23 13:01:40 +01:00
translatewiki.net
3570377678
Localisation updates from https://translatewiki.net. 2025-01-20 13:01:41 +01:00
Sujal-Gupta-SG
c0a93b6fc2 fix/handle-shared-files-and-error-handling 2025-01-19 20:05:19 +05:30
Sujal-Gupta-SG
b69a4260e3 fix/handle-shared-files-and-error-handling 2025-01-19 19:33:15 +05:30
Sujal-Gupta-SG
ccc5903b0c fix/handle-shared-files-and-error-handling 2025-01-19 13:02:36 +05:30
Sujal-Gupta-SG
41f71d8369 fix/handle-shared-files-and-error-handling 2025-01-19 03:51:34 +05:30
Sujal-Gupta-SG
aa6d1091e1 fix/handle-shared-files-and-error-handling 2025-01-19 03:38:53 +05:30
Akshay Komar
d4ababc0a5
Refactor: Rename Constants to Follow CamelCase Naming Convention (#6126)
* Rename Constants to Follow Kotlin Naming Conventions

>This PR refactors constant names in the project to adhere to Kotlin's UPPERCASE_SNAKE_CASE naming convention, improving code readability and maintaining consistency across the codebase.

>Renamed the following constants in LoginActivity:
>saveProgressDialog → SAVE_PROGRESS_DIALOG
>saveErrorMessage → SAVE_ERROR_MESSAGE
>saveUsername → SAVE_USERNAME
>savePassword → SAVE_PASSWORD

>Updated all references to these constants throughout the project.

* Update Project_Default.xml

* Refactor variable names to adhere to naming conventions

Renamed variables to use camel case:
-UPLOAD_COUNT_THRESHOLD → uploadCountThreshold
-REVERT_PERCENTAGE_FOR_MESSAGE → revertPercentageForMessage
-REVERT_SHARED_PREFERENCE → revertSharedPreference
-UPLOAD_SHARED_PREFERENCE → uploadSharedPreference

Renamed variables with uppercase initials to lowercase for alignment with Kotlin conventions:
-Latitude → latitude
-Longitude → longitude
-Accuracy → accuracy

Refactored the following variable names:
-NUMBER_OF_QUESTIONS → numberOfQuestions
-MULTIPLIER_TO_GET_PERCENTAGE → multiplierToGetPercentage

* Refactor Dialog View Initialization with Null-Safe Calls

This PR refactors the dialog setup code in CustomSelectorActivity to improve safety and readability by replacing explicit casts with null-safe generic calls for findViewById.

>Replaced explicit casting (as Button and as TextView) with the generic findViewById<T>() method for improved type safety.
>Added null-safety (?.) to avoid potential crashes if a view is not found in the dialog layout.

why changed:-
>Prevents runtime crashes caused by NullPointerException when a view is missing in the layout.

* Refactor Unit Test: Replace Unsafe Casting with Type-Safe Mocking for findViewById

>PR refactors the unit test for NearbyParentFragment by replacing unsafe casting in the findViewById mocking statements with type-safe

>Ensured all findViewById mocks now use a consistent, type-safe format (findViewById<View>(...)) to reduce verbosity and potential casting errors.

>Verified the functionality of prepareViewsForSheetPosition remains unchanged, ensuring no regression in test behavior.

* Update NearbyParentFragmentUnitTest.kt

* Refactor: Rename Constants to Follow CamelCase Naming Convention

>Updated all constant variable names to follow the camelCase naming convention, removing underscores in the middle or end.

>Ensured variable names remain descriptive and align with code readability best practices.

* Replace private val with const val for URL constants in QuizController

* Renaming the constant to use UPPER_SNAKE_CASE

* Renaming the constant to use UPPER_SNAKE_CASE

* Update Done

* **Refactor: Convert `minimumThresholdForSwipe` to a compile-time constant**

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-01-18 23:06:52 +09:00
yuvraj-coder1
1c6ebafb29
feat: show the proper message in the custom picker when all images are either uploaded or marked. (#6095)
* feat: show the message "Congratulations, all pictures in this album have been either uploaded or marked as not for upload." in the custom picker when all images are either uploaded or marked.

* refactor: fix indentation in the code

* refactor: replace LiveData with StateFlow

* fix: fixed the bug that was causing one ImageFragment testcase to fail.

* fix: fixed the Congratulation message being shown for a brief moment while switching off the switch

* refactor: move hardcoded string to strings.xml.

* docs: add comment to clarify visibility logic in ImageFragment

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-01-18 23:04:28 +09:00
Sujal
23e1f01783
fix/handle-shared-files-and-error-handling (#6141) 2025-01-18 03:19:16 +10:00
Tanmay Gupta
ef032b0f93
Disable vanishing option when logged out (#6135) 2025-01-18 03:19:00 +10:00
Sujal-Gupta-SG
f84f524207 fix/handle-shared-files-and-error-handling 2025-01-17 17:53:04 +05:30
Sujal-Gupta-SG
c4147a8e87 fix/handle-shared-files-and-error-handling 2025-01-17 17:38:45 +05:30
Yusuke Matsubara
35a2fe87db
Use variant-dependent variable to make URLs for vanishing (#6117) 2025-01-17 17:33:50 +09:00
Rohit Verma
9f1fe8737f
Fix crash when opening in-app Camera for the very first time (#6139)
* fix: correctly handle permission callbacks on Main thread

The PermissionUtils was incorrectly executing permission callbacks on a background thread, leading to a Handler error. Now, it is using Main dispatcher.

* fix crash when opening camera while having partial storage access
2025-01-17 15:37:07 +09:00
translatewiki.net
2d6583fea6
Localisation updates from https://translatewiki.net. 2025-01-16 13:01:53 +01:00
Tanmay Gupta
1e64acdf1d
If depicted Wikidata item has no associated Commons category property, then suggest categories from its P18 (#6130)
* Fix NPE with UploadMediaDetails.captionText

* Store P18 instead of processed image url in DepictedItem

* Add routes for fetching category info from titles

* Consider depict's P18 when suggesting categories

* Add tests

* Corrected DepictedItem constructor arguments

* Add test for DepictedItem::primaryImage
2025-01-16 18:04:04 +09:00
Tanmay Gupta
1f33926ed5
Share login state with SingleWebViewActivity (#6136) 2025-01-16 17:49:09 +09:00
Ifeoluwa Andrew Omole
16ac08fe21
change status bar color to grey in dark mode (#6120)
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-01-16 17:41:37 +09:00
Sujal
70291a0cb2
Migrated Java profile package to kotlin (#6119)
* Rename .java to .kt

* Migrate Profile Package to Kotlin #6118 #5928

* Migrate Profile Package to Kotlin #6118 #5928

* Migrate Profile Package to Kotlin #6118 #5928
2025-01-16 16:36:02 +09:00
Tanmay Gupta
62136b5b09
Fix NPE with UploadMediaDetails.captionText (#6128)
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-01-15 22:52:35 +09:00
Kaartic Sivaraam
76078cf3b5 Merge remote-tracking branch 'origin/v5.1.0' 2025-01-15 12:52:36 +05:30
Kaartic Sivaraam
be0b1db193 Version v5.1.2 2025-01-15 12:50:53 +05:30
Kaartic Sivaraam
a796a8adcf category: fix category search in explore
This is a change that replicates the fix done via PR #6093.
This is based over v5.1.1 as the fix seems necessary for
the category search to work properly on the explore screen.
2025-01-15 12:32:50 +05:30
Kaartic Sivaraam
efc9ae8fb6 Merge remote-tracking branch 'origin/v5.1.0' 2025-01-15 11:53:59 +05:30