mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
2cbda3a5fb
5 changed files with 48 additions and 41 deletions
10
CHANGELOG.md
10
CHANGELOG.md
|
|
@ -1,5 +1,15 @@
|
|||
# Wikimedia Commons for Android
|
||||
|
||||
## v5.3.0
|
||||
|
||||
### What's changed
|
||||
* Enable EmailAuth support
|
||||
* Explore map images no longer show "Unknown"
|
||||
* Fix crash when removing last two images of multiupload
|
||||
* Mark ❌ for closed locations (P3999) in Nearby
|
||||
* Fix two pin labels staying visible at the same time in Explore map
|
||||
* Refactoring and minor UI improvements
|
||||
|
||||
## v5.2.0
|
||||
|
||||
v5.2.0 boasts several new functionalities like:
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import kotlinx.coroutines.MainScope
|
|||
import kotlinx.coroutines.cancel
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import java.util.TreeMap
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
|
|
@ -342,46 +343,37 @@ class ImageAdapter(
|
|||
numberOfSelectedImagesMarkedAsNotForUpload--
|
||||
}
|
||||
notifyItemChanged(position, ImageUnselected())
|
||||
|
||||
// Getting index from all images index when switch is on
|
||||
val indexes =
|
||||
if (showAlreadyActionedImages) {
|
||||
ImageHelper.getIndexList(selectedImages, images)
|
||||
|
||||
// Getting index from actionable images when switch is off
|
||||
} else {
|
||||
ImageHelper.getIndexList(selectedImages, ArrayList(actionableImagesMap.values))
|
||||
}
|
||||
for (index in indexes) {
|
||||
notifyItemChanged(index, ImageSelectedOrUpdated())
|
||||
}
|
||||
} else {
|
||||
val image = images[position]
|
||||
scope.launch(ioDispatcher) {
|
||||
val imageSHA1 = imageLoader.getSHA1(image, defaultDispatcher)
|
||||
withContext(Dispatchers.Main) {
|
||||
if (holder.isItemUploaded()) {
|
||||
Toast.makeText(context, R.string.custom_selector_already_uploaded_image_text, Toast.LENGTH_SHORT).show()
|
||||
} else {
|
||||
return@withContext
|
||||
}
|
||||
|
||||
if (imageSHA1.isNotEmpty() && imageLoader.getFromUploaded(imageSHA1) != null) {
|
||||
holder.itemUploaded()
|
||||
Toast.makeText(context, R.string.custom_selector_already_uploaded_image_text, Toast.LENGTH_SHORT).show()
|
||||
return@withContext
|
||||
}
|
||||
|
||||
if (!holder.isItemUploaded() && imageSHA1.isNotEmpty() && imageLoader.getFromUploaded(imageSHA1) != null) {
|
||||
Toast.makeText(context, R.string.custom_selector_already_uploaded_image_text, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
|
||||
if (holder.isItemNotForUpload()) {
|
||||
numberOfSelectedImagesMarkedAsNotForUpload++
|
||||
}
|
||||
selectedImages.add(image)
|
||||
notifyItemChanged(position, ImageSelectedOrUpdated())
|
||||
|
||||
// Getting index from all images index when switch is on
|
||||
val indexes: ArrayList<Int> =
|
||||
if (showAlreadyActionedImages) {
|
||||
selectedImages.add(images[position])
|
||||
ImageHelper.getIndexList(selectedImages, images)
|
||||
|
||||
// Getting index from actionable images when switch is off
|
||||
} else {
|
||||
selectedImages.add(ArrayList(actionableImagesMap.values)[position])
|
||||
ImageHelper.getIndexList(selectedImages, ArrayList(actionableImagesMap.values))
|
||||
}
|
||||
|
||||
for (index in indexes) {
|
||||
notifyItemChanged(index, ImageSelectedOrUpdated())
|
||||
}
|
||||
}
|
||||
}
|
||||
imageSelectListener.onSelectedImagesChanged(selectedImages, numberOfSelectedImagesMarkedAsNotForUpload)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the data set.
|
||||
|
|
|
|||
|
|
@ -638,17 +638,20 @@ class CustomSelectorActivity :
|
|||
finishPickImages(arrayListOf())
|
||||
return
|
||||
}
|
||||
var i = 0
|
||||
while (i < selectedImages.size) {
|
||||
val path = selectedImages[i].path
|
||||
val file = File(path)
|
||||
if (!file.exists()) {
|
||||
selectedImages.removeAt(i)
|
||||
i--
|
||||
scope.launch(ioDispatcher) {
|
||||
val uniqueImages = selectedImages.distinctBy { image ->
|
||||
CustomSelectorUtils.getImageSHA1(
|
||||
image.uri,
|
||||
ioDispatcher,
|
||||
fileUtilsWrapper,
|
||||
contentResolver
|
||||
)
|
||||
}
|
||||
|
||||
withContext(Dispatchers.Main) {
|
||||
finishPickImages(ArrayList(uniqueImages))
|
||||
}
|
||||
i++
|
||||
}
|
||||
finishPickImages(selectedImages)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -170,6 +170,7 @@
|
|||
<string name="login_failed_throttled">Слишком много неудачных попыток. Пожалуйста, попробуйте ещё раз через несколько минут.</string>
|
||||
<string name="login_failed_blocked">Извините, но участник с таким именем был заблокирован на Викискладе</string>
|
||||
<string name="login_failed_2fa_needed">Вы должны ввести код двухфакторной аутентификации.</string>
|
||||
<string name="login_failed_email_auth_needed">Код подтверждения был отправлен на адрес вашей электронной почты. Пожалуйста, введите его для входа.</string>
|
||||
<string name="login_failed_generic">Ошибка входа в систему</string>
|
||||
<string name="share_upload_button">Загрузка</string>
|
||||
<string name="multiple_share_base_title">Введите название для этой группы файлов</string>
|
||||
|
|
@ -275,6 +276,7 @@
|
|||
<string name="become_a_tester_title">Стать бета-тестером</string>
|
||||
<string name="become_a_tester_description">Подпишитесь на наш канал бета-версии на Google Play и получите ранний доступ к новым функциям и исправлениям ошибок</string>
|
||||
<string name="_2fa_code">Код 2ФА</string>
|
||||
<string name="email_auth_code">Код подтверждения электронной почты</string>
|
||||
<string name="logout_verification">Вы действительно хотите выйти?</string>
|
||||
<string name="mediaimage_failed">Ошибка медиафайла</string>
|
||||
<string name="no_subcategory_found">Подкатегории не найдены.</string>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue