apps-android-commons/app/src/main/java/fr/free/nrw/commons
Akshay Komar 78666ccbde
Refactor Dialog View Initialization with Null-Safe Calls (#6114)
* 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.
2025-01-11 08:46:19 +09:00
..
actions Convert dependency inject ("di") package to kotlin (#5976) 2024-11-30 10:50:42 +09:00
activity feat : Account Vanishing (#6098) 2025-01-09 23:27:08 +09:00
auth Rename Constants to Follow Kotlin Naming Conventions (#6107) 2025-01-07 03:00:02 +10:00
bookmarks Removed deneme8 Timber tag (#6065) 2024-12-22 22:05:25 +09:00
campaigns Convert mwapi/wikidata to kotlin (part 1) (#5991) 2024-12-05 23:13:38 +09:00
category Feature: Bookmark Categories (#6035) 2024-12-17 21:49:32 +09:00
concurrency Migrated concurrency module from Java to Kotiln (#6110) 2025-01-08 15:42:53 +09:00
contributions Convert upload to kotlin (part 2) (#6069) 2024-12-24 16:11:46 +09:00
coordinates Refactor variable names to adhere to naming conventions (#6111) 2025-01-09 17:22:42 +09:00
customselector Refactor Dialog View Initialization with Null-Safe Calls (#6114) 2025-01-11 08:46:19 +09:00
data Nearby: show cached pins even when internet is unavailable (fixes #6051) (#6081) 2024-12-26 23:55:21 +09:00
db Feature: Bookmark Categories (#6035) 2024-12-17 21:49:32 +09:00
delete make dialog modal (#6015) 2024-12-11 15:08:39 +09:00
description Fixed the migrations warning under Kotlin header #13282 (#6060) 2024-12-22 23:14:20 +09:00
di Feature: Bookmark Categories (#6035) 2024-12-17 21:49:32 +09:00
edit Migrated exifInterface to androidx exif.interface (#6013) 2024-12-10 03:54:11 +10:00
explore add cancel button (#6078) 2024-12-29 08:20:32 +09:00
feedback add cancel button (#6078) 2024-12-29 08:20:32 +09:00
filepicker Convert upload to kotlin (part 2) (#6069) 2024-12-24 16:11:46 +09:00
fileusages Feature: Show where file is being used on Commons & Other wikis (#6006) 2024-12-09 23:07:44 +09:00
kvstore Migrate kvstore to kotlin (#5973) 2024-11-29 14:01:29 +09:00
language Migrate location and language module from Java to Kotlin (#5988) 2024-12-03 15:27:11 +09:00
location make dialog modal (#6015) 2024-12-11 15:08:39 +09:00
locationpicker Issue #5996 - Fix Android Studio warnings in LocationPickerActivity.kt (#6026) 2024-12-13 22:49:40 +09:00
logging Replaces Log to Timber (#6062) 2024-12-22 14:44:57 +09:00
media add cancel button (#6078) 2024-12-29 08:20:32 +09:00
mwapi Nearby: No longer keeps loading until timeout when map is zoomed out (#6070) 2024-12-24 15:21:45 +09:00
navtab add cancel button (#6078) 2024-12-29 08:20:32 +09:00
nearby Nearby: Markers now show place via pin base (#6090) 2024-12-29 15:46:29 +09:00
notification Convert wikidata/mwapi to kotlin (part 3) (#6004) 2024-12-07 12:20:06 +09:00
profile make dialog modal (#6015) 2024-12-11 15:08:39 +09:00
quiz Refactor variable names to adhere to naming conventions (#6111) 2025-01-09 17:22:42 +09:00
recentlanguages Fix unit tests (#5947) 2024-11-23 08:35:34 +09:00
repository Convert upload to kotlin (part 2) (#6069) 2024-12-24 16:11:46 +09:00
review Refactor usage of Html.fromHtml to handle deprecation (#6074) 2024-12-25 00:44:25 +09:00
settings feat : Account Vanishing (#6098) 2025-01-09 23:27:08 +09:00
theme Migrated ui and theme modules from Java to Kotlin (#5942) 2024-11-20 22:55:13 +09:00
ui rm file (#6079) 2024-12-29 07:53:04 +09:00
upload feat: Long-pressing a row in "Uploads" copies the caption to clipboard, and displays a snack saying "Caption copied to clipboard" (#6105) 2025-01-07 07:12:24 +10:00
utils Fixed the migrations warning under Kotlin header #13282 (#6060) 2024-12-22 23:14:20 +09:00
widget Migrated widget module from Java to Kotlin (#5940) 2024-11-20 12:41:50 +09:00
wikidata fix null pointer exception (#6093) 2025-01-03 22:32:06 +10:00
AboutActivity.java make dialog modal (#6015) 2024-12-11 15:08:39 +09:00
BaseMarker.kt Partial fixes for errors and warnings reported by ./gradlew lint (#5885) 2024-10-27 22:59:09 +09:00
BasePresenter.java #3756 Convert SearchDepictionsFragment to use Pagination (#3758) 2020-05-28 14:10:04 +03:00
BetaConstants.kt Issue-5662-kotlinstyle (#5833) 2024-09-19 13:56:45 +09:00
CameraPosition.kt Issue-5662-kotlinstyle (#5833) 2024-09-19 13:56:45 +09:00
CommonsApplication.kt CommonsApplication migrate to kotlin & some lint fixes (#5879) 2024-10-26 23:19:34 +09:00
License.java Fix #2593: Migrate to androidX (#2594) 2019-03-16 11:22:37 +00:00
MapController.java Refactor curlatLng to currentLatLng (#5646) 2024-03-25 10:35:30 +09:00
Media.kt Partial fixes for errors and warnings reported by ./gradlew lint (#5885) 2024-10-27 22:59:09 +09:00
MediaDataExtractor.kt Issue-5662-kotlinstyle (#5833) 2024-09-19 13:56:45 +09:00
MvpView.java Show campaigns (#2113) 2018-12-15 02:55:53 +10:00
OkHttpConnectionFactory.java Fix Crash EditDescriptionActivity when switched dark/light mode (#5503) 2024-03-31 15:36:41 +09:00
Urls.kt Issue-5662-kotlinstyle (#5833) 2024-09-19 13:56:45 +09:00
Utils.java CodeCleanup : Removed Unused Import from packages. (#5609) 2024-03-08 23:21:27 +09:00
ViewHolder.java Refactored to move out nearby adapter from the activity 2017-04-02 22:21:05 +05:30
ViewPagerAdapter.java Remove duplicate ViewPagerAdapter (#4222) 2021-02-15 21:50:30 +09:00
WelcomeActivity.java make dialog modal (#6015) 2024-12-11 15:08:39 +09:00
WelcomePagerAdapter.java CodeCleanup : Removed Unused Import from packages. (#5609) 2024-03-08 23:21:27 +09:00