Skip to content

Commit a4109eb

Browse files
committed
Refactor: Migrate WikidataItemDetailsActivity and explore/maps package to Kotlin
The `WikidataItemDetailsActivity` has been migrated from Java to Kotlin. This includes updating the activity's structure, handling intents, setting up tabs and view pager, managing the media detail fragment, and implementing bookmark functionality. Additionally, the logic for displaying and interacting with depicted items' details, media, child classes, and parent classes has been adapted for the Kotlin implementation.
1 parent dd7973c commit a4109eb

File tree

10 files changed

+1269
-1370
lines changed

10 files changed

+1269
-1370
lines changed

app/src/main/java/fr/free/nrw/commons/contributions/ContributionsFragment.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -697,12 +697,12 @@ class ContributionsFragment
697697
}
698698
}
699699

700-
override fun onLocationChangedSignificantly(latLng: LatLng) {
700+
override fun onLocationChangedSignificantly(latLng: LatLng?) {
701701
// Will be called if location changed more than 1000 meter
702702
updateClosestNearbyCardViewInfo()
703703
}
704704

705-
override fun onLocationChangedSlightly(latLng: LatLng) {
705+
override fun onLocationChangedSlightly(latLng: LatLng?) {
706706
/* Update closest nearby notification card onLocationChangedSlightly
707707
*/
708708
try {
@@ -712,7 +712,7 @@ class ContributionsFragment
712712
}
713713
}
714714

715-
override fun onLocationChangedMedium(latLng: LatLng) {
715+
override fun onLocationChangedMedium(latLng: LatLng?) {
716716
// Update closest nearby card view if location changed more than 500 meters
717717
updateClosestNearbyCardViewInfo()
718718
}

app/src/main/java/fr/free/nrw/commons/explore/ExploreMapRootFragment.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ public void onMediaClicked(int position) {
144144
*/
145145
@Override
146146
public Media getMediaAtPosition(int i) {
147-
if (mapFragment != null && mapFragment.mediaList != null) {
148-
return mapFragment.mediaList.get(i);
147+
if (mapFragment != null && mapFragment.getMediaList() != null) {
148+
return mapFragment.getMediaList().get(i);
149149
} else {
150150
return null;
151151
}
@@ -159,8 +159,8 @@ public Media getMediaAtPosition(int i) {
159159
*/
160160
@Override
161161
public int getTotalMediaCount() {
162-
if (mapFragment != null && mapFragment.mediaList != null) {
163-
return mapFragment.mediaList.size();
162+
if (mapFragment != null && mapFragment.getMediaList() != null) {
163+
return mapFragment.getMediaList().size();
164164
} else {
165165
return 0;
166166
}

0 commit comments

Comments
 (0)