Skip to content

Commit 3bf48a8

Browse files
Merge branch 'main' into hide-voice-input-when-not-available
2 parents 22d8f54 + 522f1fe commit 3bf48a8

File tree

144 files changed

+645
-606
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+645
-606
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@
9999
android:exported="true"
100100
android:hardwareAccelerated="false"
101101
android:icon="@mipmap/ic_launcher"
102-
android:label="@string/app_name"
103102
android:windowSoftInputMode="adjustResize">
104103
<intent-filter android:label="@string/intent_share_upload_label">
105104
<action android:name="android.intent.action.SEND" />
@@ -122,7 +121,7 @@
122121
android:name=".contributions.MainActivity"
123122
android:configChanges="screenSize|keyboard|orientation"
124123
android:icon="@mipmap/ic_launcher"
125-
android:label="@string/app_name" />
124+
/>
126125
<activity
127126
android:name=".settings.SettingsActivity"
128127
android:label="@string/title_activity_settings" />

app/src/main/java/fr/free/nrw/commons/BaseMarker.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class BaseMarker {
4646
val drawable: Drawable = context.resources.getDrawable(drawableResId)
4747
icon =
4848
if (drawable is BitmapDrawable) {
49-
(drawable as BitmapDrawable).bitmap
49+
drawable.bitmap
5050
} else {
5151
val bitmap =
5252
Bitmap.createBitmap(

app/src/main/java/fr/free/nrw/commons/LocationPicker/LocationPickerActivity.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
import io.reactivex.android.schedulers.AndroidSchedulers;
5454
import io.reactivex.schedulers.Schedulers;
5555
import java.util.List;
56+
import java.util.Locale;
5657
import javax.inject.Inject;
5758
import javax.inject.Named;
5859
import org.osmdroid.tileprovider.tilesource.TileSourceFactory;
@@ -301,7 +302,8 @@ private void bindViews() {
301302
modifyLocationButton = findViewById(R.id.modify_location);
302303
removeLocationButton = findViewById(R.id.remove_location);
303304
showInMapButton = findViewById(R.id.show_in_map);
304-
showInMapButton.setText(getResources().getString(R.string.show_in_map_app).toUpperCase());
305+
showInMapButton.setText(getResources().getString(R.string.show_in_map_app).toUpperCase(
306+
Locale.ROOT));
305307
shadow = findViewById(R.id.location_picker_image_view_shadow);
306308
}
307309

app/src/main/java/fr/free/nrw/commons/Media.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package fr.free.nrw.commons
33
import android.os.Parcelable
44
import fr.free.nrw.commons.location.LatLng
55
import fr.free.nrw.commons.wikidata.model.page.PageTitle
6+
import kotlinx.parcelize.IgnoredOnParcel
67
import kotlinx.parcelize.Parcelize
78
import java.util.Date
89
import java.util.Locale
@@ -124,6 +125,7 @@ class Media constructor(
124125
* Gets the categories the file falls under.
125126
* @return file categories as an ArrayList of Strings
126127
*/
128+
@IgnoredOnParcel
127129
var addedCategories: List<String>? = null
128130
// TODO added categories should be removed. It is added for a short fix. On category update,
129131
// categories should be re-fetched instead

app/src/main/java/fr/free/nrw/commons/bookmarks/items/BookmarkItemsDao.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package fr.free.nrw.commons.bookmarks.items;
22

3+
import android.annotation.SuppressLint;
34
import android.content.ContentProviderClient;
45
import android.content.ContentValues;
56
import android.database.Cursor;
@@ -134,6 +135,7 @@ public boolean findBookmarkItem(final String depictedItemID) {
134135
* @param cursor : Object for storing database data
135136
* @return DepictedItem
136137
*/
138+
@SuppressLint("Range")
137139
DepictedItem fromCursor(final Cursor cursor) {
138140
final String fileName = cursor.getString(cursor.getColumnIndex(Table.COLUMN_NAME));
139141
final String description

app/src/main/java/fr/free/nrw/commons/bookmarks/locations/BookmarkLocationsDao.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package fr.free.nrw.commons.bookmarks.locations;
22

3+
import android.annotation.SuppressLint;
34
import android.content.ContentProviderClient;
45
import android.content.ContentValues;
56
import android.database.Cursor;
@@ -146,6 +147,7 @@ public boolean findBookmarkLocation(Place bookmarkLocation) {
146147
return false;
147148
}
148149

150+
@SuppressLint("Range")
149151
@NonNull
150152
Place fromCursor(final Cursor cursor) {
151153
final LatLng location = new LatLng(cursor.getDouble(cursor.getColumnIndex(Table.COLUMN_LAT)),

app/src/main/java/fr/free/nrw/commons/bookmarks/pictures/BookmarkPicturesDao.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package fr.free.nrw.commons.bookmarks.pictures;
22

3+
import android.annotation.SuppressLint;
34
import android.content.ContentProviderClient;
45
import android.content.ContentValues;
56
import android.database.Cursor;
@@ -150,6 +151,7 @@ public boolean findBookmark(Bookmark bookmark) {
150151
return false;
151152
}
152153

154+
@SuppressLint("Range")
153155
@NonNull
154156
Bookmark fromCursor(Cursor cursor) {
155157
String fileName = cursor.getString(cursor.getColumnIndex(Table.COLUMN_MEDIA_NAME));

app/src/main/java/fr/free/nrw/commons/category/CategoryClient.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class CategoryClient
124124
}.map {
125125
it
126126
.filter { page ->
127-
page.categoryInfo() == null || !page.categoryInfo().isHidden
127+
!page.categoryInfo().isHidden
128128
}.map {
129129
CategoryItem(
130130
it.title().replace(CATEGORY_PREFIX, ""),

app/src/main/java/fr/free/nrw/commons/category/CategoryDao.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package fr.free.nrw.commons.category;
22

3+
import android.annotation.SuppressLint;
34
import android.content.ContentProviderClient;
45
import android.content.ContentValues;
56
import android.database.Cursor;
@@ -111,6 +112,7 @@ List<CategoryItem> recentCategories(int limit) {
111112
}
112113

113114
@NonNull
115+
@SuppressLint("Range")
114116
Category fromCursor(Cursor cursor) {
115117
// Hardcoding column positions!
116118
return new Category(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class WikipediaInstructionsDialogFragment : DialogFragment() {
2222
) = DialogAddToWikipediaInstructionsBinding
2323
.inflate(inflater, container, false)
2424
.apply {
25-
val contribution: Contribution? = arguments!!.getParcelable(ARG_CONTRIBUTION)
25+
val contribution: Contribution? = requireArguments().getParcelable(ARG_CONTRIBUTION)
2626
tvWikicode.setText(contribution?.media?.wikiCode)
2727
instructionsCancel.setOnClickListener { dismiss() }
2828
instructionsConfirm.setOnClickListener {

0 commit comments

Comments
 (0)