Commons app mirror
Find a file
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
.github Android CI: Update upload-artifact version (#6157) 2025-01-24 09:52:09 +09:00
.idea Fixes #5806 Implemented "Refresh" button to clear the cache and reload the Nearby map (#5891) 2024-10-25 14:19:07 +09:00
app Migrated AboutActivity from Java to Kotlin (#6158) 2025-01-30 16:41:27 +09:00
design Update app icon (Fixes #868) (#2022) 2018-12-17 11:13:46 +05:30
fastlane/metadata/android/en-US/images added icon.png file (#5447) 2024-01-17 10:03:11 +09:00
gradle/wrapper Fixes #5806 Implemented "Refresh" button to clear the cache and reload the Nearby map (#5891) 2024-10-25 14:19:07 +09:00
update-license-info Merge "commons" into the project root directory 2016-07-02 16:48:57 +09:00
.gitignore Removed butterknife from contributions list fragment (#5396) 2023-12-23 15:31:10 +09:00
.mailmap Add a .mailmap file to update bvibber's name/email (#5684) 2024-04-09 07:14:11 +09:00
build.gradle Fixes #5806 Implemented "Refresh" button to clear the cache and reload the Nearby map (#5891) 2024-10-25 14:19:07 +09:00
CHANGELOG.md Version v5.1.2 2025-01-15 12:50:53 +05:30
CONTRIBUTING.md Update CONTRIBUTING.md (#4113) 2020-12-31 00:11:09 +09:00
COPYING Relicense to Apache License 2013-04-23 21:16:43 +05:30
CREDITS #5611 removed MapBox from CREDIS because it has already been replaced (#5617) 2024-03-18 22:41:51 +09:00
dependency-injection.md Use JSON SPARQL query for fetching nearby places (#2398) 2019-02-06 10:40:30 +05:30
find-broken-strings-variables.sh Updated path 2016-10-26 19:56:49 +09:00
gitutils.gradle Fix for issue #1157 Added try-catch block in getBuildVersion function in gitutils.gradle … (#1158) 2019-01-03 20:18:42 +05:30
gradle.properties feat : Account Vanishing (#6098) 2025-01-09 23:27:08 +09:00
gradlew Update gradle from 4.0-rc-1 to 4.0.1 2017-07-19 17:14:37 +09:00
gradlew.bat Update gradle from 4.0-rc-1 to 4.0.1 2017-07-19 17:14:37 +09:00
jacoco.gradle fixes unit tests (#5354) 2023-10-20 11:50:51 +09:00
nr-commons.keystore.enc Automate releases (part 1) (#2111) 2018-12-14 21:07:03 +05:30
play.p12.enc Integrate gradle play publisher for automatic alpha releases (#2116) 2018-12-14 23:53:05 +05:30
README.md Updated contributors gallery 2024-04-02 22:51:47 +09:00
RELEASE-CHECKLIST.md Update RELEASE-CHECKLIST 2013-04-27 00:58:19 +05:30
settings.gradle Data client simplification / removal (#5507) 2024-02-03 10:26:06 +09:00
sign.sh Fix Codacy Issues + remove unused patch 2017-03-23 17:51:13 +00:00

Wikimedia Commons Android app

GitHub issue custom search Build status Preview the app codecov

The Wikimedia Commons Android app allows users to upload pictures from their Android phone/tablet to Wikimedia Commons. Download the app here, or view our website.

Initially started by the Wikimedia Foundation, this app is now maintained by grantees and volunteers of the Wikimedia community. Anyone is welcome to improve it, just choose among the open issues and send us a pull request! :-)

Get it on F-Droid Get it on Google Play

Documentation

Our documentation repository contains extensive documentation for users, contributors, and developers alike:

Contributors

Thank you all for your work!


misaochan

translatewiki

neslihanturan

yuvipanda

nicolas-raoul

domdomegg

maskaravivek

psh

madhurgupta10

ashishkumar468

bvibber

whym

akaita

veyndan

ujjwalagrawal17

macgills

dbrant

vanshikaarora

sivaraam

Ayan-10

shashankiitbhu

Pratham2305

sandarumk

tanvidadu

cypherop

Prince-kushwaha

tobias47n9e

4D17Y4

hismaeel

tshradheya

.. and many more.

License

This software is open source, licensed under the Apache License 2.0.