Skip to content

Partial fixes for errors and warnings reported by ./gradlew lint #5885

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 108 commits into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
e85d59e
BaseMarker.kt: removed unneeded cast
baijun6 Oct 17, 2024
543d18b
TransformImageImpl.kt: removed unreachable code
baijun6 Oct 17, 2024
a1ab724
ZoomableActivity.kt: removed Unnecessary safe call on a non-null rece…
baijun6 Oct 17, 2024
7d60810
ZoomableActivity.kt: removed Unnecessary safe call on a non-null rece…
baijun6 Oct 17, 2024
4ebb00e
DescriptionEditActivity.kt: removed unnecessary non-null assertion (!…
baijun6 Oct 17, 2024
b7c9520
Media.kt: Property would not be serialized into a 'Parcel'. Added '@I…
baijun6 Oct 17, 2024
0dc379a
ZoomableActivity.kt: removed Unnecessary non-null assertion (!!) on a…
baijun6 Oct 17, 2024
6b01afe
CategoryClient.kt: removed condition 'page.categoryInfo() == null' as…
baijun6 Oct 17, 2024
32790ad
DescriptionEditActivity.kt: removed unnecessary safe call on a non-nu…
baijun6 Oct 17, 2024
2c6f057
DescriptionEditActivity.kt: removed unnecessary safe call on a non-nu…
baijun6 Oct 17, 2024
6000788
WikidataFeedback.kt: removed unneeded cast
baijun6 Oct 17, 2024
a1abc64
FailedUploadsFragment.kt: removed unneeded non-null assertion (!!)
baijun6 Oct 17, 2024
1d8509d
PendingUploadsFragment.kt: removed unneeded non-null assertion (!!)
baijun6 Oct 17, 2024
0d1b108
AchievementsFragment.java: Changed toUpperCase to toUpperCase(Locale.…
baijun6 Oct 19, 2024
9a23d48
ExploreFragment.java: Changed toUpperCase to toUpperCase(Locale.getDe…
baijun6 Oct 19, 2024
4158f79
FileUtils.java: Changed toUpperCase to toUpperCase(Locale.getDefault())
baijun6 Oct 19, 2024
306d235
Merge branch 'main' of https://github.com/baijun6/apps-android-commons
baijun6 Oct 19, 2024
e8a6d5f
AchievementsFragment.java: Changed toUpperCase to toUpperCase(Locale.…
baijun6 Oct 19, 2024
5d9e6f2
ExploreFragment.java: Changed toUpperCase to toUpperCase(Locale.ROOT)
baijun6 Oct 19, 2024
fe7d481
LocationPickerActivity.java: Changed toUpperCase to toUpperCase(Local…
baijun6 Oct 19, 2024
5caeb82
MediaDetailFragment.java: Changed toUpperCase to toUpperCase(Locale.R…
baijun6 Oct 19, 2024
34cf173
NearbyFilterSearchRecyclerViewAdapter.java: Changed toUpperCase to to…
baijun6 Oct 19, 2024
d806a9a
ProfileActivity.java: Changed toUpperCase to toUpperCase(Locale.ROOT)
baijun6 Oct 19, 2024
8675170
RecentSearchesFragment.java: Changed toUpperCase to toUpperCase(Local…
baijun6 Oct 19, 2024
cb68fd3
ReviewActivity.java: Changed toUpperCase to toUpperCase(Locale.ROOT)
baijun6 Oct 19, 2024
1c539cd
SearchActivity.java: Changed toUpperCase to toUpperCase(Locale.ROOT)
baijun6 Oct 19, 2024
be2aa30
UploadMediaPresenter.java: Changed toUpperCase to toLowerCase(Locale.…
baijun6 Oct 19, 2024
d8dada9
Merge branch 'main' of https://github.com/baijun6/apps-android-commons
baijun6 Oct 20, 2024
7f41a31
CategoriesMediaFragment.kt: Changed arguments!! to requireArguments()
baijun6 Oct 22, 2024
bf9724f
ChildDepictionsFragment.kt: Changed arguments!! to requireArguments()
baijun6 Oct 22, 2024
5faed11
DepictedImagesFragment.kt: Changed arguments!! to requireArguments()
baijun6 Oct 22, 2024
a007e9a
Merge branch 'commons-app:main' into main
baijun6 Oct 23, 2024
a2777a0
Merge branch 'main' of https://github.com/baijun6/apps-android-commons
baijun6 Oct 23, 2024
e441af9
DepictsFragment: Changed Objects.requireNonNull(getView()) to require…
baijun6 Oct 23, 2024
29c7982
ParentCategoriesFragment.kt: Changed arguments!! to requireArguments()
baijun6 Oct 23, 2024
37e4b76
ParentCategoriesFragment.kt: Changed arguments!! to requireArguments()
baijun6 Oct 23, 2024
3033c5e
SubCategoriesFragment.kt: Changed arguments!! to requireArguments()
baijun6 Oct 23, 2024
59ec85d
SubCategoriesFragment.kt: Changed Objects.requireNonNull(getView()) t…
baijun6 Oct 23, 2024
9782dfc
UploadMediaDetailFragment.java: Changed arguments!! to requireArgumen…
baijun6 Oct 23, 2024
8bc2094
WikipediaInstructionsDialogFragment.kt: Changed arguments!! to requir…
baijun6 Oct 23, 2024
68c671a
BookmarkItemsDao.java: Added @SuppressLint("Range"), as -1 is expecte…
baijun6 Oct 23, 2024
f4f831b
BookmarkLocationsDao.java: Added @SuppressLint("Range"), as -1 is exp…
baijun6 Oct 23, 2024
1552ba4
AndroidManifest.xml: Removed redundant label android:label="@string/…
baijun6 Oct 23, 2024
43f99b9
bs\strings.xml: Added missing few quantity
baijun6 Oct 23, 2024
ab429bc
hr\strings.xml: Added missing few quantity
baijun6 Oct 23, 2024
4723246
hr\strings.xml: Added missing zero, two, few, many quantities for lin…
baijun6 Oct 23, 2024
7199192
Revert "hr\strings.xml: Added missing zero, two, few, many quantities…
baijun6 Oct 23, 2024
362abe8
cy\strings.xml: Added missing zero, two, few, many quantities for lin…
baijun6 Oct 23, 2024
5172a31
sr\strings.xml: Added missing few quantities for lines 35 to 70
baijun6 Oct 23, 2024
1727fee
ro\strings.xml: Added missing few quantity and removed not needed zer…
baijun6 Oct 23, 2024
3807c49
cs\strings.xml: Added missing few many missing quantities for lines 3…
baijun6 Oct 23, 2024
d8afb71
lt\strings.xml: Added missing few, many missing quantities for lines …
baijun6 Oct 23, 2024
741cb30
lt\strings.xml: Replaced . . . with ...
baijun6 Oct 23, 2024
cb067db
ca\strings.xml: Added missing many quantities for lines 21 - 51, repl…
baijun6 Oct 23, 2024
7f4b405
ser\strings.xml: Added missing few quantities, replaced . . . with ...
baijun6 Oct 23, 2024
4a1cf5f
br\strings.xml: Added missing two, few, many quantities
baijun6 Oct 23, 2024
d5fbe07
pt\strings.xml: Added missing many quantity, changed . . . to ... and…
baijun6 Oct 23, 2024
f49da79
it\strings.xml: changed . . . to ...
baijun6 Oct 23, 2024
23483bc
pt\strings.xml: fixed many quantity
baijun6 Oct 23, 2024
fdb7c9e
ca\strings.xml: fixed many quantity
baijun6 Oct 23, 2024
03bcf0a
sr\strings.xml: fixed many quantity
baijun6 Oct 23, 2024
f34eee4
cy\strings.xml: corrected quantities for "share_license_summary
baijun6 Oct 23, 2024
1261e00
fr\strings.xml: changed . . . to ... and add many quantities using th…
baijun6 Oct 23, 2024
d08842d
fr\strings.xml: changed . . . to ... and add many quantities using th…
baijun6 Oct 23, 2024
0aa69fd
getColumnIndex(): added @SuppressLint("Range") as -1 is expected resu…
baijun6 Oct 23, 2024
95b909c
values-b+sr+Latn\strings.xml: changed . . . to ...
baijun6 Oct 23, 2024
641066b
Revert "values-b+sr+Latn\strings.xml: changed . . . to ..."
baijun6 Oct 23, 2024
b5db1a3
values-b+roa+tara\strings.xml: changed . . . to ...
baijun6 Oct 23, 2024
bb33c6f
Revert "values-b+roa+tara\strings.xml: changed . . . to ..."
baijun6 Oct 23, 2024
f164411
values-b+roa+tara\strings.xml: changed . . . to ...
baijun6 Oct 23, 2024
0cee8eb
values-b+sr+Latn\strings.xml: changed . . . to ..., add few based on …
baijun6 Oct 23, 2024
e773fa8
it\strings.xml: changed . . . to ..., add many based on other quantity.
baijun6 Oct 23, 2024
79fc68f
pt-rBR\strings.xml: changed . . . to ..., add many based on other qua…
baijun6 Oct 23, 2024
025c52c
si\strings.xml: Ignored ImpliedQuantity warning as it uses 1 not %d. …
baijun6 Oct 23, 2024
b2c6fc8
si\strings.xml: Ignored ImpliedQuantity warning as it uses 1 not %d. …
baijun6 Oct 23, 2024
c7851f0
mk\strings.xml: changed . . . to ... and ignored ImpliedQuantity as i…
baijun6 Oct 23, 2024
f8dcf7d
sl\strings.xml: changed . . . to ... and ignored ImpliedQuantity as i…
baijun6 Oct 23, 2024
f7f7dff
ru\strings.xml: changed . . . to ... and ignored ImpliedQuantity as i…
baijun6 Oct 23, 2024
2d2234b
uk\strings.xml: changed . . . to ... and ignored ImpliedQuantity as i…
baijun6 Oct 23, 2024
6f533d3
is\strings.xml: changed . . . to ... and ignored ImpliedQuantity as i…
baijun6 Oct 23, 2024
7a52122
strings.xml: changed . . . to ...
baijun6 Oct 23, 2024
03ece78
af\strings.xml: removed not needed zero quantity
baijun6 Oct 23, 2024
a9b8eb3
de\strings.xml: fixed duplicate word typo
baijun6 Oct 23, 2024
cfb2d7b
diq\strings.xml: changed - to dash (-)
baijun6 Oct 23, 2024
f3e0503
hi\strings.xml: removed not needed zero
baijun6 Oct 23, 2024
15797b5
in\strings.xml: removed not needed one quantity
baijun6 Oct 23, 2024
cc7a029
iw\strings.xml: removed not needed many quantity
baijun6 Oct 23, 2024
48f26ef
ja\strings.xml: removed not needed one quantity
baijun6 Oct 23, 2024
92488c7
ko\strings.xml: removed not needed one quantity
baijun6 Oct 23, 2024
470c5ea
ky\strings.xml: removed not needed one quantity
baijun6 Oct 23, 2024
81fb2c0
mr\strings.xml: removed not needed zero quantity
baijun6 Oct 23, 2024
10873c8
my\strings.xml: removed not needed one quantity
baijun6 Oct 23, 2024
899d149
su\strings.xml: removed not needed one quantity
baijun6 Oct 23, 2024
945d270
th\strings.xml: removed not needed one and zero quantity
baijun6 Oct 23, 2024
bdf8135
zh\strings.xml: removed not needed one quantity
baijun6 Oct 23, 2024
65458eb
Merge branch 'commons-app:main' into main
baijun6 Oct 23, 2024
2aac3b1
activity_description_edit.xml: changed android:tint to app:tint, chan…
baijun6 Oct 23, 2024
b4fe656
bottom_sheet_details_explore.xml: changed android:tint to app:tint, a…
baijun6 Oct 23, 2024
81a8023
bottom_sheet_item_layout.xml: changed android:tint to app:tint, added…
baijun6 Oct 23, 2024
9ac6475
bottom_sheet_details_explore.xml: changed android:tint to app:tint, a…
baijun6 Oct 23, 2024
0d3a5f6
item_place.xml.xml: changed android:tint to app:tint, added focusable…
baijun6 Oct 23, 2024
e7c388a
layout_campagin.xml: changed android:tint to app:tint, added focusabl…
baijun6 Oct 23, 2024
cf3ee7e
layout_contribution.xml.xml: changed android:tint to app:tint
baijun6 Oct 23, 2024
7c88765
nearby_card_view.xml: changed android:tint to app:tint, added focusab…
baijun6 Oct 23, 2024
87c1b26
nearby_row_button.xml: changed android:tint to app:tint, added focusa…
baijun6 Oct 23, 2024
cd74703
toolbar_location_picker.xml: changed android:tint to app:tint
baijun6 Oct 23, 2024
ce4548b
Merge branch 'main' of https://github.com/baijun6/apps-android-commons
baijun6 Oct 23, 2024
3b6fc2e
Merge branch 'main' into main
nicolas-raoul Oct 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
android:exported="true"
android:hardwareAccelerated="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:windowSoftInputMode="adjustResize">
<intent-filter android:label="@string/intent_share_upload_label">
<action android:name="android.intent.action.SEND" />
Expand All @@ -122,7 +121,7 @@
android:name=".contributions.MainActivity"
android:configChanges="screenSize|keyboard|orientation"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" />
/>
<activity
android:name=".settings.SettingsActivity"
android:label="@string/title_activity_settings" />
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/fr/free/nrw/commons/BaseMarker.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class BaseMarker {
val drawable: Drawable = context.resources.getDrawable(drawableResId)
icon =
if (drawable is BitmapDrawable) {
(drawable as BitmapDrawable).bitmap
drawable.bitmap
} else {
val bitmap =
Bitmap.createBitmap(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import java.util.List;
import java.util.Locale;
import javax.inject.Inject;
import javax.inject.Named;
import org.osmdroid.tileprovider.tilesource.TileSourceFactory;
Expand Down Expand Up @@ -301,7 +302,8 @@ private void bindViews() {
modifyLocationButton = findViewById(R.id.modify_location);
removeLocationButton = findViewById(R.id.remove_location);
showInMapButton = findViewById(R.id.show_in_map);
showInMapButton.setText(getResources().getString(R.string.show_in_map_app).toUpperCase());
showInMapButton.setText(getResources().getString(R.string.show_in_map_app).toUpperCase(
Locale.ROOT));
shadow = findViewById(R.id.location_picker_image_view_shadow);
}

Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/fr/free/nrw/commons/Media.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package fr.free.nrw.commons
import android.os.Parcelable
import fr.free.nrw.commons.location.LatLng
import fr.free.nrw.commons.wikidata.model.page.PageTitle
import kotlinx.parcelize.IgnoredOnParcel
import kotlinx.parcelize.Parcelize
import java.util.Date
import java.util.Locale
Expand Down Expand Up @@ -124,6 +125,7 @@ class Media constructor(
* Gets the categories the file falls under.
* @return file categories as an ArrayList of Strings
*/
@IgnoredOnParcel
var addedCategories: List<String>? = null
// TODO added categories should be removed. It is added for a short fix. On category update,
// categories should be re-fetched instead
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package fr.free.nrw.commons.bookmarks.items;

import android.annotation.SuppressLint;
import android.content.ContentProviderClient;
import android.content.ContentValues;
import android.database.Cursor;
Expand Down Expand Up @@ -134,6 +135,7 @@ public boolean findBookmarkItem(final String depictedItemID) {
* @param cursor : Object for storing database data
* @return DepictedItem
*/
@SuppressLint("Range")
DepictedItem fromCursor(final Cursor cursor) {
final String fileName = cursor.getString(cursor.getColumnIndex(Table.COLUMN_NAME));
final String description
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package fr.free.nrw.commons.bookmarks.locations;

import android.annotation.SuppressLint;
import android.content.ContentProviderClient;
import android.content.ContentValues;
import android.database.Cursor;
Expand Down Expand Up @@ -146,6 +147,7 @@ public boolean findBookmarkLocation(Place bookmarkLocation) {
return false;
}

@SuppressLint("Range")
@NonNull
Place fromCursor(final Cursor cursor) {
final LatLng location = new LatLng(cursor.getDouble(cursor.getColumnIndex(Table.COLUMN_LAT)),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package fr.free.nrw.commons.bookmarks.pictures;

import android.annotation.SuppressLint;
import android.content.ContentProviderClient;
import android.content.ContentValues;
import android.database.Cursor;
Expand Down Expand Up @@ -150,6 +151,7 @@ public boolean findBookmark(Bookmark bookmark) {
return false;
}

@SuppressLint("Range")
@NonNull
Bookmark fromCursor(Cursor cursor) {
String fileName = cursor.getString(cursor.getColumnIndex(Table.COLUMN_MEDIA_NAME));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class CategoryClient
}.map {
it
.filter { page ->
page.categoryInfo() == null || !page.categoryInfo().isHidden
!page.categoryInfo().isHidden
}.map {
CategoryItem(
it.title().replace(CATEGORY_PREFIX, ""),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package fr.free.nrw.commons.category;

import android.annotation.SuppressLint;
import android.content.ContentProviderClient;
import android.content.ContentValues;
import android.database.Cursor;
Expand Down Expand Up @@ -111,6 +112,7 @@ List<CategoryItem> recentCategories(int limit) {
}

@NonNull
@SuppressLint("Range")
Category fromCursor(Cursor cursor) {
// Hardcoding column positions!
return new Category(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class WikipediaInstructionsDialogFragment : DialogFragment() {
) = DialogAddToWikipediaInstructionsBinding
.inflate(inflater, container, false)
.apply {
val contribution: Contribution? = arguments!!.getParcelable(ARG_CONTRIBUTION)
val contribution: Contribution? = requireArguments().getParcelable(ARG_CONTRIBUTION)
tvWikicode.setText(contribution?.media?.wikiCode)
instructionsCancel.setOnClickListener { dismiss() }
instructionsConfirm.setOnClickListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class DescriptionEditActivity :
) {
try {
descriptionEditHelper
?.addDescription(
.addDescription(
applicationContext,
media,
updatedWikiText,
Expand All @@ -250,7 +250,7 @@ class DescriptionEditActivity :
)
}
} catch (e: InvalidLoginTokenException) {
val username: String? = sessionManager?.userName
val username: String? = sessionManager.userName
val logoutListener =
CommonsApplication.BaseLogoutListener(
this,
Expand All @@ -268,7 +268,7 @@ class DescriptionEditActivity :
for (mediaDetail in uploadMediaDetails) {
try {
compositeDisposable.add(
descriptionEditHelper!!
descriptionEditHelper
.addCaption(
applicationContext,
media,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ class TransformImageImpl : TransformImage {
} catch (e: LLJTranException) {
Timber.tag("Error").d(e)
return null
false
}

if (rotated) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import fr.free.nrw.commons.utils.ActivityUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import javax.inject.Inject;
import javax.inject.Named;

Expand Down Expand Up @@ -112,13 +113,13 @@ public void setTabs() {
mobileRootFragment = new ExploreListRootFragment(mobileArguments);
mapRootFragment = new ExploreMapRootFragment(mapArguments);
fragmentList.add(featuredRootFragment);
titleList.add(getString(R.string.explore_tab_title_featured).toUpperCase());
titleList.add(getString(R.string.explore_tab_title_featured).toUpperCase(Locale.ROOT));

fragmentList.add(mobileRootFragment);
titleList.add(getString(R.string.explore_tab_title_mobile).toUpperCase());
titleList.add(getString(R.string.explore_tab_title_mobile).toUpperCase(Locale.ROOT));

fragmentList.add(mapRootFragment);
titleList.add(getString(R.string.explore_tab_title_map).toUpperCase());
titleList.add(getString(R.string.explore_tab_title_map).toUpperCase(Locale.ROOT));

((MainActivity)getActivity()).showTabs();
((BaseActivity) getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.TimeUnit;
import javax.inject.Inject;
import timber.log.Timber;
Expand Down Expand Up @@ -95,11 +96,11 @@ public void setTabs() {
searchDepictionsFragment = new SearchDepictionsFragment();
searchCategoryFragment= new SearchCategoryFragment();
fragmentList.add(searchMediaFragment);
titleList.add(getResources().getString(R.string.search_tab_title_media).toUpperCase());
titleList.add(getResources().getString(R.string.search_tab_title_media).toUpperCase(Locale.ROOT));
fragmentList.add(searchCategoryFragment);
titleList.add(getResources().getString(R.string.search_tab_title_categories).toUpperCase());
titleList.add(getResources().getString(R.string.search_tab_title_categories).toUpperCase(Locale.ROOT));
fragmentList.add(searchDepictionsFragment);
titleList.add(getResources().getString(R.string.search_tab_title_depictions).toUpperCase());
titleList.add(getResources().getString(R.string.search_tab_title_depictions).toUpperCase(Locale.ROOT));

viewPagerAdapter.setTabData(fragmentList, titleList);
viewPagerAdapter.notifyDataSetChanged();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ class CategoriesMediaFragment : PageableMediaFragment() {
savedInstanceState: Bundle?,
) {
super.onViewCreated(view, savedInstanceState)
onQueryUpdated("$CATEGORY_PREFIX${arguments!!.getString("categoryName")!!}")
onQueryUpdated("$CATEGORY_PREFIX${requireArguments().getString("categoryName")!!}")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ class ParentCategoriesFragment : PageableCategoryFragment() {
savedInstanceState: Bundle?,
) {
super.onViewCreated(view, savedInstanceState)
onQueryUpdated("$CATEGORY_PREFIX${arguments!!.getString("categoryName")!!}")
onQueryUpdated("$CATEGORY_PREFIX${requireArguments().getString("categoryName")!!}")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ class SubCategoriesFragment : PageableCategoryFragment() {
savedInstanceState: Bundle?,
) {
super.onViewCreated(view, savedInstanceState)
onQueryUpdated("$CATEGORY_PREFIX${arguments!!.getString("categoryName")!!}")
onQueryUpdated("$CATEGORY_PREFIX${requireArguments().getString("categoryName")!!}")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ class ChildDepictionsFragment : PageableDepictionsFragment() {
override val injectedPresenter
get() = presenter

override fun getEmptyText(query: String) = getString(R.string.no_child_classes, arguments!!.getString("wikidataItemName")!!)
override fun getEmptyText(query: String) = getString(R.string.no_child_classes, requireArguments().getString("wikidataItemName")!!)

override fun onViewCreated(
view: View,
savedInstanceState: Bundle?,
) {
super.onViewCreated(view, savedInstanceState)
onQueryUpdated(arguments!!.getString("entityId")!!)
onQueryUpdated(requireArguments().getString("entityId")!!)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ class DepictedImagesFragment : PageableMediaFragment() {
savedInstanceState: Bundle?,
) {
super.onViewCreated(view, savedInstanceState)
onQueryUpdated(arguments!!.getString("entityId")!!)
onQueryUpdated(requireArguments().getString("entityId")!!)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ class ParentDepictionsFragment : PageableDepictionsFragment() {
override val injectedPresenter
get() = presenter

override fun getEmptyText(query: String) = getString(R.string.no_parent_classes, arguments!!.getString("wikidataItemName")!!)
override fun getEmptyText(query: String) = getString(R.string.no_parent_classes, requireArguments().getString("wikidataItemName")!!)

override fun onViewCreated(
view: View,
savedInstanceState: Bundle?,
) {
super.onViewCreated(view, savedInstanceState)
onQueryUpdated(arguments!!.getString("entityId")!!)
onQueryUpdated(requireArguments().getString("entityId")!!)
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package fr.free.nrw.commons.explore.recentsearches;

import android.annotation.SuppressLint;
import android.content.ContentProviderClient;
import android.content.ContentValues;
import android.database.Cursor;
Expand Down Expand Up @@ -178,6 +179,7 @@ public List<String> recentSearches(int limit) {
* @return RecentSearch object
*/
@NonNull
@SuppressLint("Range")
RecentSearch fromCursor(Cursor cursor) {
// Hardcoding column positions!
return new RecentSearch(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import fr.free.nrw.commons.di.CommonsDaggerSupportFragment;
import fr.free.nrw.commons.explore.SearchActivity;
import java.util.List;
import java.util.Locale;
import javax.inject.Inject;


Expand Down Expand Up @@ -90,7 +91,7 @@ private void setDeleteRecentPositiveButton(@NonNull final Context context,
private void showDeleteAlertDialog(@NonNull final Context context, final int position) {
new AlertDialog.Builder(context)
.setMessage(R.string.delete_search_dialog)
.setPositiveButton(getString(R.string.delete).toUpperCase(),
.setPositiveButton(getString(R.string.delete).toUpperCase(Locale.ROOT),
((dialog, which) -> setDeletePositiveButton(context, dialog, position)))
.setNegativeButton(android.R.string.cancel, null)
.create()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -600,8 +600,8 @@ private void updateToDoWarning() {
// Check if the presented category is about need of category
if (categoriesPresent) {
for (String category : media.getCategories()) {
if (category.toLowerCase().contains(CATEGORY_NEEDING_CATEGORIES) ||
category.toLowerCase().contains(CATEGORY_UNCATEGORISED)) {
if (category.toLowerCase(Locale.ROOT).contains(CATEGORY_NEEDING_CATEGORIES) ||
category.toLowerCase(Locale.ROOT).contains(CATEGORY_UNCATEGORISED)) {
categoriesPresent = false;
}
break;
Expand Down
Loading
Loading