From c033cfda47cd67521f9316cdb439136cd7fa47a9 Mon Sep 17 00:00:00 2001 From: gee12 Date: Sun, 5 Dec 2021 22:29:09 +0300 Subject: [PATCH 01/11] Refactoring --- .../fileloader/DefaultImageFileLoader.kt | 52 +++++++++---------- .../esafirm/imagepicker/view/SnackBarView.kt | 4 +- ...ackbar.xml => ef_imagepicker_snackbar.xml} | 0 imagepicker/src/main/res/values/strings.xml | 1 + 4 files changed, 28 insertions(+), 29 deletions(-) rename imagepicker/src/main/res/layout/{ef_imagepikcer_snackbar.xml => ef_imagepicker_snackbar.xml} (100%) diff --git a/imagepicker/src/main/java/com/esafirm/imagepicker/features/fileloader/DefaultImageFileLoader.kt b/imagepicker/src/main/java/com/esafirm/imagepicker/features/fileloader/DefaultImageFileLoader.kt index bd5ea4d0..3bd995a7 100644 --- a/imagepicker/src/main/java/com/esafirm/imagepicker/features/fileloader/DefaultImageFileLoader.kt +++ b/imagepicker/src/main/java/com/esafirm/imagepicker/features/fileloader/DefaultImageFileLoader.kt @@ -27,21 +27,16 @@ class DefaultImageFileLoader(private val context: Context) : ImageFileLoader { config: ImagePickerConfig, listener: ImageLoaderListener ) { - val isFolderMode = config.isFolderMode - val includeVideo = config.isIncludeVideo - val onlyVideo = config.isOnlyVideo - val includeAnimation = config.isIncludeAnimation - val excludedImages = config.excludedImages getExecutorService().execute( ImageLoadRunnable( - context.applicationContext, - isFolderMode, - onlyVideo, - includeVideo, - includeAnimation, - excludedImages, - listener + context = context.applicationContext, + isFolderMode = config.isFolderMode, + onlyVideo = config.isOnlyVideo, + includeVideo = config.isIncludeVideo, + includeAnimation = config.isIncludeAnimation, + excludedImages = config.excludedImages, + listener = listener ) ) } @@ -75,12 +70,16 @@ class DefaultImageFileLoader(private val context: Context) : ImageFileLoader { private const val QUERY_LIMIT = "limit" } - private val projection = arrayOf( - MediaStore.Images.Media._ID, - MediaStore.Images.Media.DISPLAY_NAME, - MediaStore.Images.Media.DATA, - MediaStore.Images.Media.BUCKET_DISPLAY_NAME - ) + enum class Projection(val column: String) { + ID(MediaStore.Images.Media._ID), + DISPLAY_NAME(MediaStore.Images.Media.DISPLAY_NAME), + DATA(MediaStore.Images.Media.DATA), + BUCKET_DISPLAY_NAME(MediaStore.Images.Media.BUCKET_DISPLAY_NAME); + + companion object { + fun columns() = values().map { it.column }.toTypedArray() + } + } @SuppressLint("InlinedApi") private fun queryData(limit: Int? = null): Cursor? { @@ -124,7 +123,7 @@ class DefaultImageFileLoader(private val context: Context) : ImageFileLoader { } } - return context.contentResolver.query(sourceUri, projection, args, null) + return context.contentResolver.query(sourceUri, Projection.columns(), args, null) } val sortOrder = "${MediaStore.Images.Media.DATE_MODIFIED} DESC".let { @@ -132,7 +131,7 @@ class DefaultImageFileLoader(private val context: Context) : ImageFileLoader { } return context.contentResolver.query( - sourceUri, projection, + sourceUri, Projection.columns(), selection, null, sortOrder ) } @@ -144,7 +143,7 @@ class DefaultImageFileLoader(private val context: Context) : ImageFileLoader { } private fun cursorToImage(cursor: Cursor): Image? { - val path = cursor.getString(cursor.getColumnIndex(projection[2])) + val path = cursor.getString(cursor.getColumnIndex(Projection.DATA.column)) val file = makeSafeFile(path) ?: return null if (excludedImages != null && excludedImages.contains(file)) return null @@ -153,13 +152,12 @@ class DefaultImageFileLoader(private val context: Context) : ImageFileLoader { if (ImagePickerUtils.isGifFormat(path)) return null } - val id = cursor.getLong(cursor.getColumnIndex(projection[0])) - val name = cursor.getString(cursor.getColumnIndex(projection[1])) + val id = cursor.getLong(cursor.getColumnIndex(Projection.ID.column)) + val name = cursor.getString(cursor.getColumnIndex(Projection.DISPLAY_NAME.column)) - if (name != null) { + return if (name != null) { return Image(id, name, path) - } - return null + } else null } private fun processData(cursor: Cursor?) { @@ -180,7 +178,7 @@ class DefaultImageFileLoader(private val context: Context) : ImageFileLoader { // Load folders if (!isFolderMode) continue - var bucket = cursor.getString(cursor.getColumnIndex(projection[3])) + var bucket = cursor.getString(cursor.getColumnIndex(Projection.BUCKET_DISPLAY_NAME.column)) if (bucket == null) { val parent = File(image.path).parentFile bucket = if (parent != null) parent.name else DEFAULT_FOLDER_NAME diff --git a/imagepicker/src/main/java/com/esafirm/imagepicker/view/SnackBarView.kt b/imagepicker/src/main/java/com/esafirm/imagepicker/view/SnackBarView.kt index 553b0a58..c2bfa561 100644 --- a/imagepicker/src/main/java/com/esafirm/imagepicker/view/SnackBarView.kt +++ b/imagepicker/src/main/java/com/esafirm/imagepicker/view/SnackBarView.kt @@ -7,7 +7,7 @@ import android.widget.RelativeLayout import androidx.annotation.StringRes import androidx.interpolator.view.animation.FastOutLinearInInterpolator import com.esafirm.imagepicker.R -import kotlinx.android.synthetic.main.ef_imagepikcer_snackbar.view.* +import kotlinx.android.synthetic.main.ef_imagepicker_snackbar.view.* class SnackBarView @JvmOverloads constructor( context: Context, @@ -19,7 +19,7 @@ class SnackBarView @JvmOverloads constructor( private val btnAction get() = ef_snackbar_btn_action init { - inflate(context, R.layout.ef_imagepikcer_snackbar, this) + inflate(context, R.layout.ef_imagepicker_snackbar, this) if (!isInEditMode) { val height = context.resources.getDimensionPixelSize(R.dimen.ef_height_snackbar) translationY = height.toFloat() diff --git a/imagepicker/src/main/res/layout/ef_imagepikcer_snackbar.xml b/imagepicker/src/main/res/layout/ef_imagepicker_snackbar.xml similarity index 100% rename from imagepicker/src/main/res/layout/ef_imagepikcer_snackbar.xml rename to imagepicker/src/main/res/layout/ef_imagepicker_snackbar.xml diff --git a/imagepicker/src/main/res/values/strings.xml b/imagepicker/src/main/res/values/strings.xml index 74c80b92..1e71b4ca 100644 --- a/imagepicker/src/main/res/values/strings.xml +++ b/imagepicker/src/main/res/values/strings.xml @@ -19,6 +19,7 @@ No images found Please grant storage permission to select images + Please grant camera permission to take a photo Image selection limit From dc3e8b08ad174cf78cea249e5e4ac725652771cd Mon Sep 17 00:00:00 2001 From: gee12 Date: Sun, 5 Dec 2021 22:40:09 +0300 Subject: [PATCH 02/11] Added searching by catalog/image file names --- imagepicker/build.gradle | 1 + .../adapter/FolderPickerAdapter.kt | 2 +- .../imagepicker/adapter/ImagePickerAdapter.kt | 40 ++++++---- .../imagepicker/features/ImagePickerAction.kt | 5 +- .../features/ImagePickerActivity.kt | 53 ++++++++++++- .../imagepicker/features/ImagePickerConfig.kt | 5 +- .../features/ImagePickerFragment.kt | 47 +++++++++-- .../ImagePickerInteractionListener.kt | 5 ++ .../features/ImagePickerPresenter.kt | 9 ++- .../features/recyclers/RecyclerViewManager.kt | 8 +- .../com/esafirm/imagepicker/model/BaseItem.kt | 5 ++ .../com/esafirm/imagepicker/model/Folder.kt | 8 +- .../com/esafirm/imagepicker/model/Image.kt | 4 +- .../drawable-anydpi/ef_ic_search_white.xml | 11 +++ .../res/drawable-hdpi/ef_ic_search_white.png | Bin 0 -> 425 bytes .../res/drawable-mdpi/ef_ic_search_white.png | Bin 0 -> 247 bytes .../res/drawable-xhdpi/ef_ic_search_white.png | Bin 0 -> 462 bytes .../drawable-xxhdpi/ef_ic_search_white.png | Bin 0 -> 810 bytes .../res/layout/ef_fragment_image_picker.xml | 19 ++++- .../res/layout/ef_imagepicker_item_folder.xml | 29 ++++--- .../res/layout/ef_imagepicker_item_image.xml | 73 ++++++++++++++---- .../res/menu/ef_image_picker_menu_main.xml | 7 ++ .../src/main/res/values-ar/strings.xml | 2 + .../src/main/res/values-da/strings.xml | 2 + .../src/main/res/values-de/strings.xml | 2 + .../src/main/res/values-fr/strings.xml | 2 + .../src/main/res/values-in/strings.xml | 2 + .../src/main/res/values-it/strings.xml | 2 + .../src/main/res/values-ja/strings.xml | 2 + .../src/main/res/values-ko/strings.xml | 2 + .../src/main/res/values-pt-rBR/strings.xml | 2 + .../src/main/res/values-ro/strings.xml | 2 + .../src/main/res/values-ru/strings.xml | 2 + .../src/main/res/values-tr/strings.xml | 2 + .../src/main/res/values-uk/strings.xml | 2 + .../src/main/res/values-zh-rCN/strings.xml | 2 + .../src/main/res/values-zh-rTW/strings.xml | 2 + imagepicker/src/main/res/values/colors.xml | 1 + imagepicker/src/main/res/values/strings.xml | 2 + 39 files changed, 307 insertions(+), 57 deletions(-) create mode 100644 imagepicker/src/main/java/com/esafirm/imagepicker/model/BaseItem.kt create mode 100644 imagepicker/src/main/res/drawable-anydpi/ef_ic_search_white.xml create mode 100644 imagepicker/src/main/res/drawable-hdpi/ef_ic_search_white.png create mode 100644 imagepicker/src/main/res/drawable-mdpi/ef_ic_search_white.png create mode 100644 imagepicker/src/main/res/drawable-xhdpi/ef_ic_search_white.png create mode 100644 imagepicker/src/main/res/drawable-xxhdpi/ef_ic_search_white.png diff --git a/imagepicker/build.gradle b/imagepicker/build.gradle index 8b6713da..df21aeee 100644 --- a/imagepicker/build.gradle +++ b/imagepicker/build.gradle @@ -51,6 +51,7 @@ dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation "com.github.bumptech.glide:glide:4.11.0" implementation 'androidx.recyclerview:recyclerview:1.2.1' + implementation 'androidx.constraintlayout:constraintlayout:2.1.2' implementation 'androidx.appcompat:appcompat:1.3.0' diff --git a/imagepicker/src/main/java/com/esafirm/imagepicker/adapter/FolderPickerAdapter.kt b/imagepicker/src/main/java/com/esafirm/imagepicker/adapter/FolderPickerAdapter.kt index 835f38da..7ce1734b 100644 --- a/imagepicker/src/main/java/com/esafirm/imagepicker/adapter/FolderPickerAdapter.kt +++ b/imagepicker/src/main/java/com/esafirm/imagepicker/adapter/FolderPickerAdapter.kt @@ -55,7 +55,7 @@ class FolderPickerAdapter( override fun getItemCount() = folders.size class FolderViewHolder(itemView: View) : ViewHolder(itemView) { - val image: ImageView = itemView.image + val image: ImageView = itemView.image_view val name: TextView = itemView.tv_name val number: TextView = itemView.tv_number } diff --git a/imagepicker/src/main/java/com/esafirm/imagepicker/adapter/ImagePickerAdapter.kt b/imagepicker/src/main/java/com/esafirm/imagepicker/adapter/ImagePickerAdapter.kt index 99f625ac..c2ab9202 100644 --- a/imagepicker/src/main/java/com/esafirm/imagepicker/adapter/ImagePickerAdapter.kt +++ b/imagepicker/src/main/java/com/esafirm/imagepicker/adapter/ImagePickerAdapter.kt @@ -5,10 +5,9 @@ import android.net.Uri import android.provider.MediaStore import android.view.View import android.view.ViewGroup -import android.widget.FrameLayout import android.widget.ImageView +import android.widget.LinearLayout import android.widget.TextView -import androidx.core.content.ContextCompat import androidx.recyclerview.widget.AsyncListDiffer import androidx.recyclerview.widget.RecyclerView.ViewHolder import com.esafirm.imagepicker.R @@ -27,6 +26,7 @@ class ImagePickerAdapter( context: Context, imageLoader: ImageLoader, selectedImages: List, + private val isShowImageNames: Boolean, private val itemClickListener: OnImageClickListener ) : BaseListAdapter(context, imageLoader) { @@ -70,10 +70,9 @@ class ImagePickerAdapter( if (ImagePickerUtils.isVideoFormat(image)) { if (!videoDurationHolder.containsKey(image.id)) { - val uri = - Uri.withAppendedPath(MediaStore.Files.getContentUri("external"), "" + image.id) videoDurationHolder[image.id] = ImagePickerUtils.getVideoDurationLabel( - context, uri + context = context, + uri = Uri.withAppendedPath(MediaStore.Files.getContentUri("external"), "" + image.id) ) } @@ -82,9 +81,15 @@ class ImagePickerAdapter( } viewHolder.apply { + if (isShowImageNames) { + nameView.text = image.name + bottomView.visibility = View.VISIBLE + } else { + bottomView.visibility = View.GONE + } fileTypeIndicator.text = fileTypeLabel fileTypeIndicator.visibility = if (showFileTypeIndicator) View.VISIBLE else View.GONE - alphaView.alpha = if (isSelected) 0.5f else 0f + selectedView.visibility = if (isSelected) View.VISIBLE else View.GONE itemView.setOnClickListener { val shouldSelect = itemClickListener(isSelected) @@ -94,23 +99,27 @@ class ImagePickerAdapter( addSelected(image, position) } } - container?.foreground = if (isSelected) ContextCompat.getDrawable( - context, - R.drawable.ef_ic_done_white - ) else null } } - private fun isSelected(image: Image): Boolean { - return selectedImages.any { it.path == image.path } + override fun getItemCount() = listDiffer.currentList.size + + override fun getItemViewType(position: Int): Int { + return position } - override fun getItemCount() = listDiffer.currentList.size + override fun getItemId(position: Int): Long { + return position.toLong() + } fun setData(images: List) { listDiffer.submitList(images) } + private fun isSelected(image: Image): Boolean { + return selectedImages.any { it.path == image.path } + } + private fun addSelected(image: Image, position: Int) { mutateSelection { selectedImages.add(image) @@ -145,8 +154,9 @@ class ImagePickerAdapter( class ImageViewHolder(itemView: View) : ViewHolder(itemView) { val imageView: ImageView = itemView.image_view - val alphaView: View = itemView.view_alpha + val nameView: TextView = itemView.tv_image_name + val bottomView: LinearLayout = itemView.ef_bottom_view + val selectedView: View = itemView.view_selected val fileTypeIndicator: TextView = itemView.ef_item_file_type_indicator - val container: FrameLayout? = itemView as? FrameLayout } } \ No newline at end of file diff --git a/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerAction.kt b/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerAction.kt index 074a9b40..c5161795 100644 --- a/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerAction.kt +++ b/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerAction.kt @@ -2,15 +2,14 @@ package com.esafirm.imagepicker.features import com.esafirm.imagepicker.helper.state.ObservableState import com.esafirm.imagepicker.helper.state.SingleEvent -import com.esafirm.imagepicker.helper.state.asSingleEvent import com.esafirm.imagepicker.model.Folder import com.esafirm.imagepicker.model.Image data class ImagePickerState( val images: List = emptyList(), val folders: List = emptyList(), - // TODO: handle the transitions between folder and images in the view state as well - val isFolder: SingleEvent? = null, + val isFoldersMode: SingleEvent? = null, + val currentFolder: Folder? = null, val isLoading: Boolean = false, val error: SingleEvent? = null, val finishPickImage: SingleEvent>? = null, diff --git a/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerActivity.kt b/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerActivity.kt index 37b45b01..cbd6567c 100644 --- a/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerActivity.kt +++ b/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerActivity.kt @@ -7,8 +7,10 @@ import android.graphics.PorterDuff import android.os.Bundle import android.view.Menu import android.view.MenuItem +import android.view.View import androidx.appcompat.app.ActionBar import androidx.appcompat.app.AppCompatActivity +import androidx.appcompat.widget.SearchView import androidx.appcompat.widget.Toolbar import com.esafirm.imagepicker.R import com.esafirm.imagepicker.features.cameraonly.CameraOnlyConfig @@ -28,6 +30,9 @@ class ImagePickerActivity : AppCompatActivity(), ImagePickerInteractionListener private val cameraModule = ImagePickerComponentsHolder.cameraModule private var actionBar: ActionBar? = null + private var optionsMenu: Menu? = null + private var searchView: SearchView? = null + private var isNeedSearch = true private lateinit var imagePickerFragment: ImagePickerFragment private val config: ImagePickerConfig? by lazy { @@ -82,6 +87,8 @@ class ImagePickerActivity : AppCompatActivity(), ImagePickerInteractionListener */ override fun onCreateOptionsMenu(menu: Menu): Boolean { menuInflater.inflate(R.menu.ef_image_picker_menu_main, menu) + this.optionsMenu = menu + initSearchView(menu) return true } @@ -154,13 +161,53 @@ class ImagePickerActivity : AppCompatActivity(), ImagePickerInteractionListener } } + private fun initSearchView(menu: Menu) { + searchView = menu.findItem(R.id.action_search).actionView as? SearchView + if (config?.isShowSearch == true) { + searchView?.setIconifiedByDefault(true) + searchView?.setOnQueryTextListener(object : SearchView.OnQueryTextListener { + override fun onQueryTextSubmit(query: String): Boolean { + search(query) + return true + } + + override fun onQueryTextChange(newText: String): Boolean { + search(newText) + return true + } + }) + searchView?.setOnCloseListener { + search(null) + false + } + } else { + searchView?.visibility = View.GONE + } + } + + private fun search(query: String?) { + if (isNeedSearch) { + imagePickerFragment.search(query) + } + } + + private fun closeSearchView() { + // at the same time the onClose event is triggered, so isNeedSearch must be avoided reloading + isNeedSearch = false + searchView?.setQuery(null, false) + searchView?.isIconified = true + isNeedSearch = true + } + /* --------------------------------------------------- */ /* > ImagePickerInteractionListener Methods */ /* --------------------------------------------------- */ override fun setTitle(title: String?) { actionBar?.title = title - invalidateOptionsMenu() + if (optionsMenu != null) { + onPrepareOptionsMenu(optionsMenu!!) + } } override fun cancel() { @@ -175,4 +222,8 @@ class ImagePickerActivity : AppCompatActivity(), ImagePickerInteractionListener setResult(RESULT_OK, result) finish() } + + override fun isFolderModeChanged() { + closeSearchView() + } } \ No newline at end of file diff --git a/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerConfig.kt b/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerConfig.kt index d8f41764..496dcb95 100644 --- a/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerConfig.kt +++ b/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerConfig.kt @@ -27,7 +27,10 @@ class ImagePickerConfig( override var savePath: ImagePickerSavePath = ImagePickerSavePath.DEFAULT, override var returnMode: ReturnMode = ReturnMode.NONE, override var isSaveImage: Boolean = true, - var showDoneButtonAlways: Boolean = false + var showDoneButtonAlways: Boolean = false, + var isShowSearch: Boolean = false, + var searchQuery: String? = null, + var isShowImageNames: Boolean = false ) : BaseConfig(), Parcelable { @Transient diff --git a/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerFragment.kt b/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerFragment.kt index 23563fba..14d42268 100644 --- a/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerFragment.kt +++ b/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerFragment.kt @@ -29,9 +29,11 @@ import com.esafirm.imagepicker.helper.ImagePickerPreferences import com.esafirm.imagepicker.helper.ImagePickerUtils import com.esafirm.imagepicker.helper.IpLogger import com.esafirm.imagepicker.helper.state.fetch +import com.esafirm.imagepicker.model.BaseItem import com.esafirm.imagepicker.model.Folder import com.esafirm.imagepicker.model.Image import java.util.ArrayList +import java.util.regex.Pattern class ImagePickerFragment : Fragment() { @@ -139,13 +141,15 @@ class ImagePickerFragment : Fragment() { return@observe } - state.isFolder.fetch { + state.isFoldersMode.fetch { + config.searchQuery = null val isFolderMode = this if (isFolderMode) { - setFolderAdapter(state.folders) + setFolderAdapter(filter(state.folders)) } else { - setImageAdapter(state.images) + setImageAdapter(filter(state.currentFolder?.images ?: emptyList())) } + interactionListener.isFolderModeChanged() } state.finishPickImage.fetch { @@ -160,6 +164,17 @@ class ImagePickerFragment : Fragment() { } } + private fun filter(list: List): List { + val regex = config.searchQuery?.let { + if (it.isNotBlank()) buildRegex(it) else null + } + return if (regex != null) { + list.filter { it.getItemName().matches(regex) } + } else { + list + } + } + override fun onDestroyView() { super.onDestroyView() binding = null @@ -176,7 +191,9 @@ class ImagePickerFragment : Fragment() { resources.configuration.orientation ).apply { val selectListener = { isSelected: Boolean -> selectImage(isSelected) } - val folderClick = { bucket: Folder -> setImageAdapter(bucket.images) } + val folderClick = { bucket: Folder -> + presenter.setFolder(bucket) + } setupAdapters(passedSelectedImages, selectListener, folderClick) setImageSelectedListener { selectedImages -> @@ -210,14 +227,20 @@ class ImagePickerFragment : Fragment() { */ private fun setImageAdapter(images: List) { recyclerViewManager.setImageAdapter(images) + checkDataIsEmpty(images) updateTitle() } private fun setFolderAdapter(folders: List) { recyclerViewManager.setFolderAdapter(folders) + checkDataIsEmpty(folders) updateTitle() } + private fun checkDataIsEmpty(data: List<*>) { + binding?.textViewEmpty?.visibility = if (data.isEmpty()) View.VISIBLE else View.GONE + } + private fun updateTitle() { interactionListener.setTitle(recyclerViewManager.title) } @@ -257,6 +280,16 @@ class ImagePickerFragment : Fragment() { private fun loadData() = presenter.loadData(config) + fun search(searchQuery: String?) { + config.searchQuery = searchQuery + val state = presenter.getUiState().get() + if (state.currentFolder == null) { + setFolderAdapter(filter(state.folders)) + } else { + setImageAdapter(filter(state.currentFolder.images)) + } + } + /** * Request for permission * If permission denied or app is first launched, request for permission @@ -330,8 +363,8 @@ class ImagePickerFragment : Fragment() { */ fun handleBack(): Boolean { if (recyclerViewManager.handleBack()) { + presenter.setFolder(null) // Handled. - updateTitle() return true } return false @@ -390,5 +423,9 @@ class ImagePickerFragment : Fragment() { arguments = args } } + + private fun buildRegex(query: String): Regex { + return Regex("(?is)" + ".*" + Pattern.quote(query) + ".*") + } } } \ No newline at end of file diff --git a/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerInteractionListener.kt b/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerInteractionListener.kt index a3e427ac..ba9214e5 100644 --- a/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerInteractionListener.kt +++ b/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerInteractionListener.kt @@ -16,4 +16,9 @@ interface ImagePickerInteractionListener { * May include Images whose files no longer exist. */ fun selectionChanged(imageList: List?) + + /** + * Called when the user select the bucket or move back to list of buckets. + */ + fun isFolderModeChanged() } \ No newline at end of file diff --git a/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerPresenter.kt b/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerPresenter.kt index f62e005e..cb394002 100644 --- a/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerPresenter.kt +++ b/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerPresenter.kt @@ -32,6 +32,13 @@ internal class ImagePickerPresenter( stateObs.set(newState(stateObs.get())) } + fun setFolder(folder: Folder?) { + setState { copy( + isFoldersMode = (folder == null).asSingleEvent(), + currentFolder = folder + ) } + } + fun abortLoad() { imageLoader.abortLoadImages() } @@ -47,7 +54,7 @@ internal class ImagePickerPresenter( images = images, folders = folders, isLoading = false, - isFolder = config.isFolderMode.asSingleEvent() + isFoldersMode = config.isFolderMode.asSingleEvent() ) } } diff --git a/imagepicker/src/main/java/com/esafirm/imagepicker/features/recyclers/RecyclerViewManager.kt b/imagepicker/src/main/java/com/esafirm/imagepicker/features/recyclers/RecyclerViewManager.kt index 94122a74..5f34526b 100644 --- a/imagepicker/src/main/java/com/esafirm/imagepicker/features/recyclers/RecyclerViewManager.kt +++ b/imagepicker/src/main/java/com/esafirm/imagepicker/features/recyclers/RecyclerViewManager.kt @@ -82,8 +82,11 @@ class RecyclerViewManager( /* Init folder and image adapter */ val imageLoader = ImagePickerComponentsHolder.imageLoader imageAdapter = ImagePickerAdapter( - context, imageLoader, selectedImages - ?: emptyList(), onImageClick + context = context, + imageLoader = imageLoader, + selectedImages = selectedImages ?: emptyList(), + isShowImageNames = config.isShowImageNames, + itemClickListener = onImageClick ) folderAdapter = FolderPickerAdapter(context, imageLoader) { foldersState = recyclerView.layoutManager?.onSaveInstanceState() @@ -111,7 +114,6 @@ class RecyclerViewManager( // Returns true if a back action was handled by going back a folder; false otherwise. fun handleBack(): Boolean { if (config.isFolderMode && !isDisplayingFolderView) { - setFolderAdapter(null) imageAdapter.setData(emptyList()) return true } diff --git a/imagepicker/src/main/java/com/esafirm/imagepicker/model/BaseItem.kt b/imagepicker/src/main/java/com/esafirm/imagepicker/model/BaseItem.kt new file mode 100644 index 00000000..a420642f --- /dev/null +++ b/imagepicker/src/main/java/com/esafirm/imagepicker/model/BaseItem.kt @@ -0,0 +1,5 @@ +package com.esafirm.imagepicker.model + +interface BaseItem { + fun getItemName(): String +} \ No newline at end of file diff --git a/imagepicker/src/main/java/com/esafirm/imagepicker/model/Folder.kt b/imagepicker/src/main/java/com/esafirm/imagepicker/model/Folder.kt index 640e8067..0c146d0c 100644 --- a/imagepicker/src/main/java/com/esafirm/imagepicker/model/Folder.kt +++ b/imagepicker/src/main/java/com/esafirm/imagepicker/model/Folder.kt @@ -1,5 +1,11 @@ package com.esafirm.imagepicker.model -class Folder(var folderName: String) { +class Folder( + var folderName: String +) : BaseItem { + var images: MutableList = mutableListOf() + + override fun getItemName() = folderName + } \ No newline at end of file diff --git a/imagepicker/src/main/java/com/esafirm/imagepicker/model/Image.kt b/imagepicker/src/main/java/com/esafirm/imagepicker/model/Image.kt index 23d401c7..36fc0861 100644 --- a/imagepicker/src/main/java/com/esafirm/imagepicker/model/Image.kt +++ b/imagepicker/src/main/java/com/esafirm/imagepicker/model/Image.kt @@ -13,7 +13,7 @@ class Image( val id: Long, val name: String, val path: String, -) : Parcelable { +) : Parcelable, BaseItem { @IgnoredOnParcel private var uriHolder: Uri? = null @@ -33,6 +33,8 @@ class Image( } } + override fun getItemName() = name + override fun equals(other: Any?): Boolean { return when { this === other -> true diff --git a/imagepicker/src/main/res/drawable-anydpi/ef_ic_search_white.xml b/imagepicker/src/main/res/drawable-anydpi/ef_ic_search_white.xml new file mode 100644 index 00000000..44dcb4af --- /dev/null +++ b/imagepicker/src/main/res/drawable-anydpi/ef_ic_search_white.xml @@ -0,0 +1,11 @@ + + + diff --git a/imagepicker/src/main/res/drawable-hdpi/ef_ic_search_white.png b/imagepicker/src/main/res/drawable-hdpi/ef_ic_search_white.png new file mode 100644 index 0000000000000000000000000000000000000000..98c47378edcb203a83684e4f602335dcab90d364 GIT binary patch literal 425 zcmV;a0apHrP)=kFgZIhO#YR9#k`{+UE#K1!~PU-+t%iv z*k267O*yhZh2*SFe)fhwMW4(RU9tZel)GksFA&br8JVjuaa)sj!B{U_E#wQ{t`3Pm zITABocUn{ciBj9ayg1R% T_HplA00000NkvXXu0mjf#aXy( literal 0 HcmV?d00001 diff --git a/imagepicker/src/main/res/drawable-mdpi/ef_ic_search_white.png b/imagepicker/src/main/res/drawable-mdpi/ef_ic_search_white.png new file mode 100644 index 0000000000000000000000000000000000000000..25e1bf8cdeb86f29806b32938188c332e0aa3654 GIT binary patch literal 247 zcmVkWf241`&rb94Z9VhyrPy9Nxvs$FHgVQ}(2<*j*ldp&@? zTV*MTA!6R8PcuZKr+i*Yuec7q67`DfKyKUXv4tMery2ACU*hT8=!k=?dRzVrxhsa& zT6&d`ZMpi5Mj`*IWfc(+4=a9~S&;ua4M9->@Ck??bDg%3yOpeA{EOTlG#CrbfhE7e zCLm!%P^ne7<}Ap+ol*^Ru@G{6co9{9t9YJ|F9Oi(oWNlRfy-+LK4T2eoIVe+o&we> zq7*G+D`*j0L5tW5fgx2Ce}Lpn%%~pp7d43Lpg>1yBIAku89pbpF`B@qFaOo3mqQPjBWAY$8jt zuB;HMX?FTdgx9!^`>?xZA6JQ+=)Kc#Dn_X=?w);K z1(=xl6~U9=>e;qlYh1^D*zs7_9LEn$nA}=hVZy(7>=LjK5`Wrok`Ol5O?%E7@EiPdOz4&EyAcxQ1f#0976boE%%~=Rn2T|V zoRs9CGuyTRag^B5iEX~l!)(%aiY+1e z=b&94_Yp^l4Gr@gbW)Oonjf>`_n%pb4eiq6tAr#uxu|aM#n`qhl3(VtG&;@TH~8n6 z(8Ts#k^D&ly|8@^;8%$iHAZ`-Nd7c~s^C@2!{{l5hQ3q`WxM3f>~ahRk? oR-7E6NLC!fFbu;m48z!!Kk@wrxBvhE literal 0 HcmV?d00001 diff --git a/imagepicker/src/main/res/layout/ef_fragment_image_picker.xml b/imagepicker/src/main/res/layout/ef_fragment_image_picker.xml index 980b26d7..2d60508f 100644 --- a/imagepicker/src/main/res/layout/ef_fragment_image_picker.xml +++ b/imagepicker/src/main/res/layout/ef_fragment_image_picker.xml @@ -1,5 +1,7 @@ - @@ -18,13 +20,26 @@ android:layout_width="100dp" android:layout_height="100dp" android:layout_centerInParent="true" - android:visibility="gone" /> + android:visibility="gone" + tools:visibility="visible" /> + + - + android:scaleType="centerCrop" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + tools:src="@tools:sample/avatars" /> + android:padding="@dimen/ef_padding_small" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent"> + android:textSize="@dimen/ef_font_small" + tools:text="@tools:sample/full_names" /> + android:textSize="@dimen/ef_font_small" + tools:text="@tools:sample/us_zipcodes" /> - + diff --git a/imagepicker/src/main/res/layout/ef_imagepicker_item_image.xml b/imagepicker/src/main/res/layout/ef_imagepicker_item_image.xml index 73458b80..1b51128a 100644 --- a/imagepicker/src/main/res/layout/ef_imagepicker_item_image.xml +++ b/imagepicker/src/main/res/layout/ef_imagepicker_item_image.xml @@ -1,38 +1,83 @@ - + android:layout_height="wrap_content"> + android:scaleType="centerCrop" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + tools:src="@tools:sample/avatars" /> - + + + + + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@id/ef_bottom_view" + tools:visibility="visible" /> + + - + diff --git a/imagepicker/src/main/res/menu/ef_image_picker_menu_main.xml b/imagepicker/src/main/res/menu/ef_image_picker_menu_main.xml index a0535829..ccfdeebd 100644 --- a/imagepicker/src/main/res/menu/ef_image_picker_menu_main.xml +++ b/imagepicker/src/main/res/menu/ef_image_picker_menu_main.xml @@ -2,6 +2,13 @@ + + دليل أنقر لإختيار الصور طلب الاذن مرفوض + بحث + لم يتم العثور على شيء إخترت %d إخترت %1$d/%2$d diff --git a/imagepicker/src/main/res/values-da/strings.xml b/imagepicker/src/main/res/values-da/strings.xml index 1955e0fd..596ed18b 100644 --- a/imagepicker/src/main/res/values-da/strings.xml +++ b/imagepicker/src/main/res/values-da/strings.xml @@ -9,6 +9,8 @@ Mappe Tryk for at vælge billeder Adgang nægtet + Søg + Intet fundet %d valgt %1$d/%2$d valgt diff --git a/imagepicker/src/main/res/values-de/strings.xml b/imagepicker/src/main/res/values-de/strings.xml index f3d51ffc..06ac708b 100644 --- a/imagepicker/src/main/res/values-de/strings.xml +++ b/imagepicker/src/main/res/values-de/strings.xml @@ -9,6 +9,8 @@ Verzeichnis Tippen um Bilder auszuwählen Erlaubnis verweigert + Suche + Nichts gefunden %d ausgewählt %1$d/%2$d ausgewählt diff --git a/imagepicker/src/main/res/values-fr/strings.xml b/imagepicker/src/main/res/values-fr/strings.xml index 90a7407a..3d5a60f7 100644 --- a/imagepicker/src/main/res/values-fr/strings.xml +++ b/imagepicker/src/main/res/values-fr/strings.xml @@ -9,6 +9,8 @@ Dossier Toucher pour sélectionner des images Permission refusée + Chercher + Rien n'a été trouvé %d sélectionnées %1$d/%2$d sélectionnées diff --git a/imagepicker/src/main/res/values-in/strings.xml b/imagepicker/src/main/res/values-in/strings.xml index 5a4806fe..41e12948 100644 --- a/imagepicker/src/main/res/values-in/strings.xml +++ b/imagepicker/src/main/res/values-in/strings.xml @@ -9,6 +9,8 @@ Folder Ketuk untuk memilih gambar Izin ditolak + Cari + Tidak ada yang ditemukan %d terpilih %1$d/%2$d terpilih diff --git a/imagepicker/src/main/res/values-it/strings.xml b/imagepicker/src/main/res/values-it/strings.xml index 6db39f2a..1a2b11bf 100644 --- a/imagepicker/src/main/res/values-it/strings.xml +++ b/imagepicker/src/main/res/values-it/strings.xml @@ -8,6 +8,8 @@ Cartella Premi per selezionare l\'immagine + Ricerca + Non abbiamo trovato nulla %d selezionate %1$d/%2$d selezionate diff --git a/imagepicker/src/main/res/values-ja/strings.xml b/imagepicker/src/main/res/values-ja/strings.xml index c4a31679..f3aa0707 100644 --- a/imagepicker/src/main/res/values-ja/strings.xml +++ b/imagepicker/src/main/res/values-ja/strings.xml @@ -7,6 +7,8 @@ フォルダ 画像を選択 + 検索 + 何も見つかりません %d 枚を選択済 %1$d/%2$d 枚を選択済 diff --git a/imagepicker/src/main/res/values-ko/strings.xml b/imagepicker/src/main/res/values-ko/strings.xml index db37f48b..8996e782 100644 --- a/imagepicker/src/main/res/values-ko/strings.xml +++ b/imagepicker/src/main/res/values-ko/strings.xml @@ -9,6 +9,8 @@ 사진첩 이미지를 선택하세요 권한이 없음 + 찾다 + 아무것도 찾을 수 없음何も見つかりません %d 선택됨 %1$d/%2$d 선택됨 diff --git a/imagepicker/src/main/res/values-pt-rBR/strings.xml b/imagepicker/src/main/res/values-pt-rBR/strings.xml index 02860b5c..fcecce0d 100644 --- a/imagepicker/src/main/res/values-pt-rBR/strings.xml +++ b/imagepicker/src/main/res/values-pt-rBR/strings.xml @@ -9,6 +9,8 @@ Pasta Toque para selecionar as imagens Permissão negada + Procurar + Nada encontrado %d selecionadas %1$d/%2$d selecionadas diff --git a/imagepicker/src/main/res/values-ro/strings.xml b/imagepicker/src/main/res/values-ro/strings.xml index 65a4e439..ca311d0d 100644 --- a/imagepicker/src/main/res/values-ro/strings.xml +++ b/imagepicker/src/main/res/values-ro/strings.xml @@ -8,6 +8,8 @@ Fișier Atingeți pentru a selecta imagini + Căutare + Nimic gasit %d selectate %1$d/%2$d selectate diff --git a/imagepicker/src/main/res/values-ru/strings.xml b/imagepicker/src/main/res/values-ru/strings.xml index c8039f46..89449a03 100644 --- a/imagepicker/src/main/res/values-ru/strings.xml +++ b/imagepicker/src/main/res/values-ru/strings.xml @@ -7,6 +7,8 @@ Папка Коснитесь, чтобы выбрать Доступ запрещён + Поиск + Ничего не найдено %d выбрано %1$d/%2$d выбрано Не удалось создать файл diff --git a/imagepicker/src/main/res/values-tr/strings.xml b/imagepicker/src/main/res/values-tr/strings.xml index ae9aa89c..d9012eba 100644 --- a/imagepicker/src/main/res/values-tr/strings.xml +++ b/imagepicker/src/main/res/values-tr/strings.xml @@ -8,6 +8,8 @@ Klasör Resimleri seçmek için hafifçe dokunun İzin reddedildi + Arama + Hiçbirşey Bulunamadı %d seçili %1$d/%2$d seçili diff --git a/imagepicker/src/main/res/values-uk/strings.xml b/imagepicker/src/main/res/values-uk/strings.xml index a2a84e6c..03ab0f81 100644 --- a/imagepicker/src/main/res/values-uk/strings.xml +++ b/imagepicker/src/main/res/values-uk/strings.xml @@ -7,6 +7,8 @@ Папка Торкніться, щоб обрати Доступ заборонено + Пошук + Нічого не знайдено %d обрано %1$d/%2$d обрано Не вдалося створити файл diff --git a/imagepicker/src/main/res/values-zh-rCN/strings.xml b/imagepicker/src/main/res/values-zh-rCN/strings.xml index 950a7999..904a4766 100644 --- a/imagepicker/src/main/res/values-zh-rCN/strings.xml +++ b/imagepicker/src/main/res/values-zh-rCN/strings.xml @@ -7,6 +7,8 @@ 文件夹 选择照片 + 搜索 + 沒有發現 已选择 %d 已选择 %1$d/%2$d diff --git a/imagepicker/src/main/res/values-zh-rTW/strings.xml b/imagepicker/src/main/res/values-zh-rTW/strings.xml index 2392a5ef..c514df55 100644 --- a/imagepicker/src/main/res/values-zh-rTW/strings.xml +++ b/imagepicker/src/main/res/values-zh-rTW/strings.xml @@ -7,6 +7,8 @@ 檔案夹 選擇相片 + 搜索 + 没有发现 已選擇 %d 已選擇 %1$d/%2$d diff --git a/imagepicker/src/main/res/values/colors.xml b/imagepicker/src/main/res/values/colors.xml index e8919c4f..a3c0c962 100644 --- a/imagepicker/src/main/res/values/colors.xml +++ b/imagepicker/src/main/res/values/colors.xml @@ -6,6 +6,7 @@ #FFFFFF #FFFFFF + #80FFFFFF #9E9E9E #80000000 #AA000000 diff --git a/imagepicker/src/main/res/values/strings.xml b/imagepicker/src/main/res/values/strings.xml index 1e71b4ca..cc5d0af8 100644 --- a/imagepicker/src/main/res/values/strings.xml +++ b/imagepicker/src/main/res/values/strings.xml @@ -9,6 +9,8 @@ Folder Tap to select images Permission denied + Search + Nothing found %d selected %1$d/%2$d selected From 4f14f27c9ca509fd977e07dec6a64315a21fdf09 Mon Sep 17 00:00:00 2001 From: gee12 Date: Sun, 5 Dec 2021 22:44:15 +0300 Subject: [PATCH 03/11] Display "Done" button in buckets list after selecting at least 1 image (regardless of showDoneButtonAlways) --- .../imagepicker/features/recyclers/RecyclerViewManager.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/imagepicker/src/main/java/com/esafirm/imagepicker/features/recyclers/RecyclerViewManager.kt b/imagepicker/src/main/java/com/esafirm/imagepicker/features/recyclers/RecyclerViewManager.kt index 5f34526b..0782f830 100644 --- a/imagepicker/src/main/java/com/esafirm/imagepicker/features/recyclers/RecyclerViewManager.kt +++ b/imagepicker/src/main/java/com/esafirm/imagepicker/features/recyclers/RecyclerViewManager.kt @@ -199,8 +199,7 @@ class RecyclerViewManager( } val isShowDoneButton: Boolean - get() = (!isDisplayingFolderView - && (imageAdapter.selectedImages.isNotEmpty() || config.showDoneButtonAlways) + get() = ((imageAdapter.selectedImages.isNotEmpty() || config.showDoneButtonAlways) && config.returnMode !== ReturnMode.ALL && config.returnMode !== ReturnMode.GALLERY_ONLY) } \ No newline at end of file From 046e6d73dd7f8d37e01a144ce1d6762bd2a09782 Mon Sep 17 00:00:00 2001 From: gee12 Date: Wed, 8 Dec 2021 22:03:42 +0300 Subject: [PATCH 04/11] Added catalog name to the title when showed images --- .../features/ImagePickerFragment.kt | 3 +- .../features/recyclers/RecyclerViewManager.kt | 36 +++++++++---------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerFragment.kt b/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerFragment.kt index 14d42268..29b498dd 100644 --- a/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerFragment.kt +++ b/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerFragment.kt @@ -242,7 +242,8 @@ class ImagePickerFragment : Fragment() { } private fun updateTitle() { - interactionListener.setTitle(recyclerViewManager.title) + val state = presenter.getUiState().get() + interactionListener.setTitle(recyclerViewManager.getTitle(state.currentFolder?.folderName)) } /** diff --git a/imagepicker/src/main/java/com/esafirm/imagepicker/features/recyclers/RecyclerViewManager.kt b/imagepicker/src/main/java/com/esafirm/imagepicker/features/recyclers/RecyclerViewManager.kt index 0782f830..8e589bf6 100644 --- a/imagepicker/src/main/java/com/esafirm/imagepicker/features/recyclers/RecyclerViewManager.kt +++ b/imagepicker/src/main/java/com/esafirm/imagepicker/features/recyclers/RecyclerViewManager.kt @@ -123,29 +123,29 @@ class RecyclerViewManager( private val isDisplayingFolderView: Boolean get() = recyclerView.adapter == null || recyclerView.adapter is FolderPickerAdapter - val title: String - get() { - if (isDisplayingFolderView) { - return ConfigUtils.getFolderTitle(context, config) + fun getTitle(currentFolderName: String?): String { + val selectedNum = imageAdapter.selectedImages.size + return when { + isDisplayingFolderView -> { + ConfigUtils.getFolderTitle(context, config) + } + config.mode == ImagePickerMode.SINGLE -> { + ConfigUtils.getImageTitle(context, config) } - if (config.mode == ImagePickerMode.SINGLE) { - return ConfigUtils.getImageTitle(context, config) + selectedNum == 0 && config.imageTitle?.isNotBlank() == true -> { + ConfigUtils.getImageTitle(context, config) } - val imageSize = imageAdapter.selectedImages.size - val useDefaultTitle = config.imageTitle.isNullOrBlank().not() && imageSize == 0 - if (useDefaultTitle) { - return ConfigUtils.getImageTitle(context, config) + selectedNum == 0 && currentFolderName != null -> { + currentFolderName } - return if (config.limit == IpCons.MAX_LIMIT) { - String.format(context.getString(R.string.ef_selected), imageSize) - } else { - String.format( - context.getString(R.string.ef_selected_with_limit), - imageSize, - config.limit - ) + config.limit == IpCons.MAX_LIMIT -> { + context.getString(R.string.ef_selected).format(selectedNum) + } + else -> { + context.getString(R.string.ef_selected_with_limit).format(selectedNum, config.limit) } } + } fun setImageAdapter(images: List = emptyList()) { imageAdapter.setData(images) From a89a2db5ff12d5bccadc62a889f67b08080c2080 Mon Sep 17 00:00:00 2001 From: gee12 Date: Wed, 8 Dec 2021 22:32:57 +0300 Subject: [PATCH 05/11] Added sorting --- .../features/ImagePickerActivity.kt | 10 +- .../imagepicker/features/ImagePickerConfig.kt | 4 +- .../features/ImagePickerFragment.kt | 184 ++++++++++++++++-- .../esafirm/imagepicker/features/SortMode.kt | 21 ++ .../fileloader/DefaultImageFileLoader.kt | 76 +++++--- .../com/esafirm/imagepicker/model/Image.kt | 7 + .../drawable-anydpi/ef_ic_arrow_down_gray.xml | 11 ++ .../drawable-anydpi/ef_ic_arrow_up_gray.xml | 11 ++ .../res/drawable-anydpi/ef_ic_sort_white.xml | 11 ++ .../drawable-hdpi/ef_ic_arrow_down_gray.png | Bin 0 -> 237 bytes .../res/drawable-hdpi/ef_ic_arrow_up_gray.png | Bin 0 -> 246 bytes .../res/drawable-hdpi/ef_ic_sort_white.png | Bin 0 -> 159 bytes .../drawable-mdpi/ef_ic_arrow_down_gray.png | Bin 0 -> 182 bytes .../res/drawable-mdpi/ef_ic_arrow_up_gray.png | Bin 0 -> 182 bytes .../res/drawable-mdpi/ef_ic_sort_white.png | Bin 0 -> 122 bytes .../drawable-xhdpi/ef_ic_arrow_down_gray.png | Bin 0 -> 294 bytes .../drawable-xhdpi/ef_ic_arrow_up_gray.png | Bin 0 -> 279 bytes .../res/drawable-xhdpi/ef_ic_sort_white.png | Bin 0 -> 167 bytes .../drawable-xxhdpi/ef_ic_arrow_down_gray.png | Bin 0 -> 526 bytes .../drawable-xxhdpi/ef_ic_arrow_up_gray.png | Bin 0 -> 475 bytes .../res/drawable-xxhdpi/ef_ic_sort_white.png | Bin 0 -> 210 bytes .../res/layout/ef_fragment_image_picker.xml | 19 +- .../res/menu/ef_image_picker_menu_main.xml | 8 +- .../src/main/res/menu/ef_sort_folders.xml | 32 +++ .../src/main/res/menu/ef_sort_images.xml | 60 ++++++ .../src/main/res/values-ar/strings.xml | 7 + .../src/main/res/values-da/strings.xml | 7 + .../src/main/res/values-de/strings.xml | 7 + .../src/main/res/values-fr/strings.xml | 9 +- .../src/main/res/values-in/strings.xml | 7 + .../src/main/res/values-it/strings.xml | 7 + .../src/main/res/values-ja/strings.xml | 7 + .../src/main/res/values-ko/strings.xml | 7 + .../src/main/res/values-pt-rBR/strings.xml | 7 + .../src/main/res/values-ro/strings.xml | 7 + .../src/main/res/values-ru/strings.xml | 12 ++ .../src/main/res/values-tr/strings.xml | 7 + .../src/main/res/values-uk/strings.xml | 11 ++ .../src/main/res/values-zh-rCN/strings.xml | 7 + .../src/main/res/values-zh-rTW/strings.xml | 7 + imagepicker/src/main/res/values/strings.xml | 9 +- 41 files changed, 523 insertions(+), 56 deletions(-) create mode 100644 imagepicker/src/main/java/com/esafirm/imagepicker/features/SortMode.kt create mode 100644 imagepicker/src/main/res/drawable-anydpi/ef_ic_arrow_down_gray.xml create mode 100644 imagepicker/src/main/res/drawable-anydpi/ef_ic_arrow_up_gray.xml create mode 100644 imagepicker/src/main/res/drawable-anydpi/ef_ic_sort_white.xml create mode 100644 imagepicker/src/main/res/drawable-hdpi/ef_ic_arrow_down_gray.png create mode 100644 imagepicker/src/main/res/drawable-hdpi/ef_ic_arrow_up_gray.png create mode 100644 imagepicker/src/main/res/drawable-hdpi/ef_ic_sort_white.png create mode 100644 imagepicker/src/main/res/drawable-mdpi/ef_ic_arrow_down_gray.png create mode 100644 imagepicker/src/main/res/drawable-mdpi/ef_ic_arrow_up_gray.png create mode 100644 imagepicker/src/main/res/drawable-mdpi/ef_ic_sort_white.png create mode 100644 imagepicker/src/main/res/drawable-xhdpi/ef_ic_arrow_down_gray.png create mode 100644 imagepicker/src/main/res/drawable-xhdpi/ef_ic_arrow_up_gray.png create mode 100644 imagepicker/src/main/res/drawable-xhdpi/ef_ic_sort_white.png create mode 100644 imagepicker/src/main/res/drawable-xxhdpi/ef_ic_arrow_down_gray.png create mode 100644 imagepicker/src/main/res/drawable-xxhdpi/ef_ic_arrow_up_gray.png create mode 100644 imagepicker/src/main/res/drawable-xxhdpi/ef_ic_sort_white.png create mode 100644 imagepicker/src/main/res/menu/ef_sort_folders.xml create mode 100644 imagepicker/src/main/res/menu/ef_sort_images.xml diff --git a/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerActivity.kt b/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerActivity.kt index cbd6567c..f24139fc 100644 --- a/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerActivity.kt +++ b/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerActivity.kt @@ -120,6 +120,10 @@ class ImagePickerActivity : AppCompatActivity(), ImagePickerInteractionListener imagePickerFragment.captureImage() return true } + if (id == R.id.menu_sort) { + imagePickerFragment.showSortPopupMenu(item) + return true + } return super.onOptionsItemSelected(item) } @@ -161,8 +165,10 @@ class ImagePickerActivity : AppCompatActivity(), ImagePickerInteractionListener } } + //region Search + private fun initSearchView(menu: Menu) { - searchView = menu.findItem(R.id.action_search).actionView as? SearchView + searchView = menu.findItem(R.id.menu_search).actionView as? SearchView if (config?.isShowSearch == true) { searchView?.setIconifiedByDefault(true) searchView?.setOnQueryTextListener(object : SearchView.OnQueryTextListener { @@ -199,6 +205,8 @@ class ImagePickerActivity : AppCompatActivity(), ImagePickerInteractionListener isNeedSearch = true } + //endregion Search + /* --------------------------------------------------- */ /* > ImagePickerInteractionListener Methods */ /* --------------------------------------------------- */ diff --git a/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerConfig.kt b/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerConfig.kt index 496dcb95..c9da6db4 100644 --- a/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerConfig.kt +++ b/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerConfig.kt @@ -30,7 +30,9 @@ class ImagePickerConfig( var showDoneButtonAlways: Boolean = false, var isShowSearch: Boolean = false, var searchQuery: String? = null, - var isShowImageNames: Boolean = false + var isShowImageNames: Boolean = false, + var foldersSortMode: FolderSortMode = FolderSortMode.NONE, + var imagesSortMode: ImageSortMode = ImageSortMode.NONE ) : BaseConfig(), Parcelable { @Transient diff --git a/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerFragment.kt b/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerFragment.kt index 29b498dd..4607c88c 100644 --- a/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerFragment.kt +++ b/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerFragment.kt @@ -1,6 +1,7 @@ package com.esafirm.imagepicker.features import android.Manifest +import android.annotation.SuppressLint import android.app.Activity import android.content.Context import android.content.Intent @@ -11,11 +12,15 @@ import android.os.Bundle import android.os.Parcelable import android.provider.Settings import android.view.LayoutInflater +import android.view.MenuItem import android.view.View import android.view.ViewGroup import android.widget.Toast import androidx.activity.result.contract.ActivityResultContracts.RequestPermission import androidx.appcompat.view.ContextThemeWrapper +import androidx.appcompat.view.menu.MenuBuilder +import androidx.appcompat.view.menu.MenuPopupHelper +import androidx.appcompat.widget.PopupMenu import androidx.core.app.ActivityCompat import androidx.fragment.app.Fragment import androidx.recyclerview.widget.RecyclerView @@ -145,9 +150,9 @@ class ImagePickerFragment : Fragment() { config.searchQuery = null val isFolderMode = this if (isFolderMode) { - setFolderAdapter(filter(state.folders)) + setFolderAdapter(state.folders) } else { - setImageAdapter(filter(state.currentFolder?.images ?: emptyList())) + setImageAdapter(state.currentFolder?.images ?: emptyList()) } interactionListener.isFolderModeChanged() } @@ -175,6 +180,30 @@ class ImagePickerFragment : Fragment() { } } + private fun sortFolders(list: List): List { + return when (config.foldersSortMode) { + FolderSortMode.NAME_ASC -> list.sortedBy { it.folderName } + FolderSortMode.NAME_DESC -> list.sortedByDescending { it.folderName } + FolderSortMode.NUMBER_ASC -> list.sortedBy { it.images.size } + FolderSortMode.NUMBER_DESC -> list.sortedByDescending { it.images.size } + else -> list + } + } + + private fun sortImages(list: List): List { + return when (config.imagesSortMode) { + ImageSortMode.NAME_ASC -> list.sortedBy { it.name } + ImageSortMode.NAME_DESC -> list.sortedByDescending { it.name } + ImageSortMode.TYPE_ASC -> list.sortedBy { it.type } + ImageSortMode.TYPE_DESC -> list.sortedByDescending { it.type } + ImageSortMode.DATE_MODIFIED_ASC -> list.sortedBy { it.dateModified } + ImageSortMode.DATE_MODIFIED_DESC -> list.sortedByDescending { it.dateModified } + ImageSortMode.SIZE_ASC -> list.sortedBy { it.size } + ImageSortMode.SIZE_DESC -> list.sortedByDescending { it.size } + else -> list + } + } + override fun onDestroyView() { super.onDestroyView() binding = null @@ -226,19 +255,27 @@ class ImagePickerFragment : Fragment() { * 3. Update title */ private fun setImageAdapter(images: List) { - recyclerViewManager.setImageAdapter(images) - checkDataIsEmpty(images) - updateTitle() + filter(images) + .let { sortImages(it) } + .let { + recyclerViewManager.setImageAdapter(it) + checkDataIsEmpty(it) + updateTitle() + } } private fun setFolderAdapter(folders: List) { - recyclerViewManager.setFolderAdapter(folders) - checkDataIsEmpty(folders) - updateTitle() + filter(folders) + .let { sortFolders(it) } + .let { + recyclerViewManager.setFolderAdapter(it) + checkDataIsEmpty(it) + updateTitle() + } } private fun checkDataIsEmpty(data: List<*>) { - binding?.textViewEmpty?.visibility = if (data.isEmpty()) View.VISIBLE else View.GONE + binding?.tvEmptyImages?.visibility = if (data.isEmpty()) View.VISIBLE else View.GONE } private fun updateTitle() { @@ -285,12 +322,134 @@ class ImagePickerFragment : Fragment() { config.searchQuery = searchQuery val state = presenter.getUiState().get() if (state.currentFolder == null) { - setFolderAdapter(filter(state.folders)) + setFolderAdapter(state.folders) } else { - setImageAdapter(filter(state.currentFolder.images)) + setImageAdapter(state.currentFolder.images) } } + fun sortFolders(sortMode: FolderSortMode) { + config.foldersSortMode = sortMode + val state = presenter.getUiState().get() + setFolderAdapter(state.folders) + } + + fun sortImages(sortMode: ImageSortMode) { + config.imagesSortMode = sortMode + val state = presenter.getUiState().get() + setImageAdapter(state.currentFolder?.images ?: emptyList()) + } + + //region Sort + + @android.annotation.SuppressLint("NonConstantResourceId") + fun showSortPopupMenu(menuItem: MenuItem) { + val view: View = requireActivity().findViewById(menuItem.itemId) + val popupMenu = PopupMenu(requireContext(), view) + val isFoldersMode = isFoldersMode + popupMenu.inflate(if (isFoldersMode) R.menu.ef_sort_folders else R.menu.ef_sort_images) + + // select the current sort mode + val selectedMenuItemId = if (isFoldersMode) { + when (config.foldersSortMode) { + FolderSortMode.NAME_ASC -> R.id.action_sort_folder_name_asc + FolderSortMode.NAME_DESC -> R.id.action_sort_folder_name_desc + FolderSortMode.NUMBER_ASC -> R.id.action_sort_num_asc + FolderSortMode.NUMBER_DESC -> R.id.action_sort_num_desc + else -> R.id.action_sort_num_desc + } + } else { + when (config.imagesSortMode) { + ImageSortMode.NAME_ASC -> R.id.action_sort_name_asc + ImageSortMode.NAME_DESC -> R.id.action_sort_name_desc + ImageSortMode.TYPE_ASC -> R.id.action_sort_type_asc + ImageSortMode.TYPE_DESC -> R.id.action_sort_type_desc + ImageSortMode.DATE_MODIFIED_ASC -> R.id.action_sort_date_asc + ImageSortMode.DATE_MODIFIED_DESC -> R.id.action_sort_date_desc + ImageSortMode.SIZE_ASC -> R.id.action_sort_size_asc + ImageSortMode.SIZE_DESC -> R.id.action_sort_size_desc + else -> R.id.action_sort_date_desc + } + } + + val selectedItem = popupMenu.menu.findItem(selectedMenuItemId) + selectedItem.isChecked = true + + popupMenu.setOnMenuItemClickListener { item: MenuItem -> + val result = when (item.itemId) { + // folders + R.id.action_sort_folder_name_asc -> { + sortFolders(FolderSortMode.NAME_ASC) + true + } + R.id.action_sort_folder_name_desc -> { + sortFolders(FolderSortMode.NAME_DESC) + true + } + R.id.action_sort_num_asc -> { + sortFolders(FolderSortMode.NUMBER_ASC) + true + } + R.id.action_sort_num_desc -> { + sortFolders(FolderSortMode.NUMBER_DESC) + true + } + // images + R.id.action_sort_name_asc -> { + sortImages(ImageSortMode.NAME_ASC) + true + } + R.id.action_sort_name_desc -> { + sortImages(ImageSortMode.NAME_DESC) + true + } + R.id.action_sort_type_asc -> { + sortImages(ImageSortMode.TYPE_ASC) + true + } + R.id.action_sort_type_desc -> { + sortImages(ImageSortMode.TYPE_DESC) + true + } + R.id.action_sort_date_asc -> { + sortImages(ImageSortMode.DATE_MODIFIED_ASC) + true + } + R.id.action_sort_date_desc -> { + sortImages(ImageSortMode.DATE_MODIFIED_DESC) + true + } + R.id.action_sort_size_asc -> { + sortImages(ImageSortMode.SIZE_ASC) + true + } + R.id.action_sort_size_desc -> { + sortImages(ImageSortMode.SIZE_DESC) + true + } + else -> false + } + if (result) { + selectedItem.isChecked = false + item.isChecked = true + } + return@setOnMenuItemClickListener result + } + + (popupMenu.menu as? MenuBuilder)?.let { + setForceShowMenuIcons(view, it) + } + } + + @SuppressLint("RestrictedApi") + private fun setForceShowMenuIcons(v: View, menu: MenuBuilder) { + val menuHelper = MenuPopupHelper(requireContext(), menu, v) + menuHelper.setForceShowIcon(true) + menuHelper.show() + } + + //endregion Sort + /** * Request for permission * If permission denied or app is first launched, request for permission @@ -374,6 +533,9 @@ class ImagePickerFragment : Fragment() { val isShowDoneButton: Boolean get() = recyclerViewManager.isShowDoneButton + val isFoldersMode: Boolean + get() = presenter.getUiState().get().currentFolder == null + override fun onAttach(context: Context) { super.onAttach(context) if (context is ImagePickerInteractionListener) { diff --git a/imagepicker/src/main/java/com/esafirm/imagepicker/features/SortMode.kt b/imagepicker/src/main/java/com/esafirm/imagepicker/features/SortMode.kt new file mode 100644 index 00000000..78a81bf3 --- /dev/null +++ b/imagepicker/src/main/java/com/esafirm/imagepicker/features/SortMode.kt @@ -0,0 +1,21 @@ +package com.esafirm.imagepicker.features + +enum class FolderSortMode { + NONE, + NAME_ASC, + NAME_DESC, + NUMBER_ASC, + NUMBER_DESC +} + +enum class ImageSortMode { + NONE, + NAME_ASC, + NAME_DESC, + TYPE_ASC, + TYPE_DESC, + DATE_MODIFIED_ASC, + DATE_MODIFIED_DESC, + SIZE_ASC, + SIZE_DESC +} \ No newline at end of file diff --git a/imagepicker/src/main/java/com/esafirm/imagepicker/features/fileloader/DefaultImageFileLoader.kt b/imagepicker/src/main/java/com/esafirm/imagepicker/features/fileloader/DefaultImageFileLoader.kt index 3bd995a7..1866442a 100644 --- a/imagepicker/src/main/java/com/esafirm/imagepicker/features/fileloader/DefaultImageFileLoader.kt +++ b/imagepicker/src/main/java/com/esafirm/imagepicker/features/fileloader/DefaultImageFileLoader.kt @@ -9,12 +9,13 @@ import android.os.Build import android.os.Bundle import android.provider.MediaStore import com.esafirm.imagepicker.features.ImagePickerConfig +import com.esafirm.imagepicker.features.ImageSortMode import com.esafirm.imagepicker.features.common.ImageLoaderListener import com.esafirm.imagepicker.helper.ImagePickerUtils import com.esafirm.imagepicker.model.Folder import com.esafirm.imagepicker.model.Image import java.io.File -import java.util.ArrayList +import java.util.* import java.util.concurrent.ExecutorService import java.util.concurrent.Executors @@ -36,6 +37,7 @@ class DefaultImageFileLoader(private val context: Context) : ImageFileLoader { includeVideo = config.isIncludeVideo, includeAnimation = config.isIncludeAnimation, excludedImages = config.excludedImages, + sortMode = config.imagesSortMode, listener = listener ) ) @@ -60,6 +62,7 @@ class DefaultImageFileLoader(private val context: Context) : ImageFileLoader { private val includeVideo: Boolean, private val includeAnimation: Boolean, private val excludedImages: List?, + private val sortMode: ImageSortMode, private val listener: ImageLoaderListener ) : Runnable { @@ -74,7 +77,10 @@ class DefaultImageFileLoader(private val context: Context) : ImageFileLoader { ID(MediaStore.Images.Media._ID), DISPLAY_NAME(MediaStore.Images.Media.DISPLAY_NAME), DATA(MediaStore.Images.Media.DATA), - BUCKET_DISPLAY_NAME(MediaStore.Images.Media.BUCKET_DISPLAY_NAME); + BUCKET_DISPLAY_NAME(MediaStore.Images.Media.BUCKET_DISPLAY_NAME), + MIME_TYPE(MediaStore.Images.Media.MIME_TYPE), + DATE_MODIFIED(MediaStore.Images.Media.DATE_MODIFIED), + SIZE(MediaStore.Images.Media.SIZE); companion object { fun columns() = values().map { it.column }.toTypedArray() @@ -101,39 +107,55 @@ class DefaultImageFileLoader(private val context: Context) : ImageFileLoader { else -> "" } - if (useNewApi) { + val sortColumn = when (sortMode) { + ImageSortMode.NAME_ASC, + ImageSortMode.NAME_DESC -> MediaStore.Files.FileColumns.DISPLAY_NAME + ImageSortMode.TYPE_ASC, + ImageSortMode.TYPE_DESC -> MediaStore.Files.FileColumns.MIME_TYPE + ImageSortMode.DATE_MODIFIED_ASC, + ImageSortMode.DATE_MODIFIED_DESC -> MediaStore.Files.FileColumns.DATE_MODIFIED + ImageSortMode.SIZE_ASC, + ImageSortMode.SIZE_DESC -> MediaStore.Files.FileColumns.SIZE + else -> MediaStore.Files.FileColumns.DATE_MODIFIED + } + val sortDirection = when (sortMode) { + ImageSortMode.NAME_ASC, + ImageSortMode.TYPE_ASC, + ImageSortMode.DATE_MODIFIED_ASC, + ImageSortMode.SIZE_ASC -> ContentResolver.QUERY_SORT_DIRECTION_ASCENDING + ImageSortMode.NAME_DESC, + ImageSortMode.TYPE_DESC, + ImageSortMode.DATE_MODIFIED_DESC, + ImageSortMode.SIZE_DESC -> ContentResolver.QUERY_SORT_DIRECTION_DESCENDING + else -> ContentResolver.QUERY_SORT_DIRECTION_DESCENDING + } + + return if (useNewApi) { val args = Bundle().apply { // Sort function - putStringArray( - ContentResolver.QUERY_ARG_SORT_COLUMNS, - arrayOf(MediaStore.Files.FileColumns.DATE_MODIFIED) - ) - putInt( - ContentResolver.QUERY_ARG_SORT_DIRECTION, - ContentResolver.QUERY_SORT_DIRECTION_DESCENDING - ) + putStringArray(ContentResolver.QUERY_ARG_SORT_COLUMNS, arrayOf(sortColumn)) + putInt(ContentResolver.QUERY_ARG_SORT_DIRECTION, sortDirection) // Selection - putString( - ContentResolver.QUERY_ARG_SQL_SELECTION, - selection - ) + putString(ContentResolver.QUERY_ARG_SQL_SELECTION, selection) // Limit if (limit != null) { putInt(ContentResolver.QUERY_ARG_LIMIT, limit) } } - return context.contentResolver.query(sourceUri, Projection.columns(), args, null) - } + context.contentResolver.query(sourceUri, Projection.columns(), args, null) + } else { + val oldSortDirection = if (sortDirection == ContentResolver.QUERY_SORT_DIRECTION_ASCENDING) "ASC" else "DESC" - val sortOrder = "${MediaStore.Images.Media.DATE_MODIFIED} DESC".let { - if (limit != null) "$it LIMIT $limit" else it - } + val sortOrder = "$sortColumn $oldSortDirection".let { + if (limit != null) "$it LIMIT $limit" else it + } - return context.contentResolver.query( - sourceUri, Projection.columns(), - selection, null, sortOrder - ) + context.contentResolver.query( + sourceUri, Projection.columns(), + selection, null, sortOrder + ) + } } private fun getSourceUri(): Uri { @@ -154,9 +176,13 @@ class DefaultImageFileLoader(private val context: Context) : ImageFileLoader { val id = cursor.getLong(cursor.getColumnIndex(Projection.ID.column)) val name = cursor.getString(cursor.getColumnIndex(Projection.DISPLAY_NAME.column)) + val type = cursor.getString(cursor.getColumnIndex(Projection.MIME_TYPE.column)) + val dateString = cursor.getString(cursor.getColumnIndex(Projection.DATE_MODIFIED.column)) + val date = Date(dateString.toLong()) + val size = cursor.getLong(cursor.getColumnIndex(Projection.SIZE.column)) return if (name != null) { - return Image(id, name, path) + return Image(id, name, path, type, date, size) } else null } diff --git a/imagepicker/src/main/java/com/esafirm/imagepicker/model/Image.kt b/imagepicker/src/main/java/com/esafirm/imagepicker/model/Image.kt index 36fc0861..3390966c 100644 --- a/imagepicker/src/main/java/com/esafirm/imagepicker/model/Image.kt +++ b/imagepicker/src/main/java/com/esafirm/imagepicker/model/Image.kt @@ -7,12 +7,16 @@ import android.provider.MediaStore import com.esafirm.imagepicker.helper.ImagePickerUtils import kotlinx.android.parcel.IgnoredOnParcel import kotlinx.android.parcel.Parcelize +import java.util.* @Parcelize class Image( val id: Long, val name: String, val path: String, + val type: String? = null, + val dateModified: Date? = null, + val size: Long? = null ) : Parcelable, BaseItem { @IgnoredOnParcel @@ -51,6 +55,9 @@ class Image( result = 31 * result + name.hashCode() result = 31 * result + path.hashCode() result = 31 * result + (uriHolder?.hashCode() ?: 0) + result = 31 * result + (type?.hashCode() ?: 0) + result = 31 * result + (dateModified?.hashCode() ?: 0) + result = 31 * result + (size?.hashCode() ?: 0) return result } } \ No newline at end of file diff --git a/imagepicker/src/main/res/drawable-anydpi/ef_ic_arrow_down_gray.xml b/imagepicker/src/main/res/drawable-anydpi/ef_ic_arrow_down_gray.xml new file mode 100644 index 00000000..856e1d1e --- /dev/null +++ b/imagepicker/src/main/res/drawable-anydpi/ef_ic_arrow_down_gray.xml @@ -0,0 +1,11 @@ + + + diff --git a/imagepicker/src/main/res/drawable-anydpi/ef_ic_arrow_up_gray.xml b/imagepicker/src/main/res/drawable-anydpi/ef_ic_arrow_up_gray.xml new file mode 100644 index 00000000..5703c0c9 --- /dev/null +++ b/imagepicker/src/main/res/drawable-anydpi/ef_ic_arrow_up_gray.xml @@ -0,0 +1,11 @@ + + + diff --git a/imagepicker/src/main/res/drawable-anydpi/ef_ic_sort_white.xml b/imagepicker/src/main/res/drawable-anydpi/ef_ic_sort_white.xml new file mode 100644 index 00000000..76f52184 --- /dev/null +++ b/imagepicker/src/main/res/drawable-anydpi/ef_ic_sort_white.xml @@ -0,0 +1,11 @@ + + + diff --git a/imagepicker/src/main/res/drawable-hdpi/ef_ic_arrow_down_gray.png b/imagepicker/src/main/res/drawable-hdpi/ef_ic_arrow_down_gray.png new file mode 100644 index 0000000000000000000000000000000000000000..3eee817058dd94b14755c8aa9dc3611f14bdcb32 GIT binary patch literal 237 zcmVu+&pye3ULupVL25D5C_uzXy26a$B6NW(+Djb7) nsM9d0MV*d8g1QWbG3N9IYPZg!9Y$Dy00000NkvXXu0mjfO~qrO literal 0 HcmV?d00001 diff --git a/imagepicker/src/main/res/drawable-hdpi/ef_ic_arrow_up_gray.png b/imagepicker/src/main/res/drawable-hdpi/ef_ic_arrow_up_gray.png new file mode 100644 index 0000000000000000000000000000000000000000..a7f677ab3c342c9f032f5b7613dd7861eb5dda2d GIT binary patch literal 246 zcmVZK zz{D8u7}HTTW;#m4OhZ|i;V6j-A>6d*At;H#2lH5~_Z4$;kG!W#8m7#@fH0T;)TZt2 z))A(xX`oXc*P}BZWns$t4urmf@-StO3PN2`Ef{2hP&ZT!vM%sINTP7J+|v{eS{T#< wLQmA&nATcB!y?FwATNTv2=e+l5M#{g0i-a_=zIy7BLDyZ07*qoM6N<$g4VWa7XSbN literal 0 HcmV?d00001 diff --git a/imagepicker/src/main/res/drawable-hdpi/ef_ic_sort_white.png b/imagepicker/src/main/res/drawable-hdpi/ef_ic_sort_white.png new file mode 100644 index 0000000000000000000000000000000000000000..2b60141d851511323252c731e39cf13d97c705dd GIT binary patch literal 159 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k1|%Oc%$NbB(mY)pLn`9lUUuX8NwEg@@V zjk;c%xlG#Z7?%-bGigiPzOShV))`LNWjJdN@2=)H28L|)@60>?s`jR80BvOOboFyt I=akR{0L{8Nm;e9( literal 0 HcmV?d00001 diff --git a/imagepicker/src/main/res/drawable-mdpi/ef_ic_arrow_down_gray.png b/imagepicker/src/main/res/drawable-mdpi/ef_ic_arrow_down_gray.png new file mode 100644 index 0000000000000000000000000000000000000000..16535149d0e4f3c4f6d278722781fc929f313b53 GIT binary patch literal 182 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjwVp1HAr*0NC*0;dpuppLcNzDQ z`F@kP?pn(x#c_Sf(olOA{*Fng7BhVoXp00i_>zopr0A<`o(*OVf literal 0 HcmV?d00001 diff --git a/imagepicker/src/main/res/drawable-mdpi/ef_ic_arrow_up_gray.png b/imagepicker/src/main/res/drawable-mdpi/ef_ic_arrow_up_gray.png new file mode 100644 index 0000000000000000000000000000000000000000..9b95c85b1fb943e0ada15be03651babc2c0ab7bd GIT binary patch literal 182 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjwVp1HAr*0NCpdB)P~c&yb*WF< z^TqUMSpDsHjvKreiC$`c(6Hd*UB=*BIj&VVTl>qE%Ec^YmfWu*w-N`;Ok$ zer|WLb;i}rh3nUU;8-oQh3WC!Yn9^bWi~MQcxN@7Zd7I1+v9oe=L5+PEC){eToi8E h!0LQWJg4p940oneEP)|nZe~}-2Ek)j?5-kGuw*6uI_9y2}xbm1H ziCO_)9&?C9e&o(&N+kFW=bp9lhY1)h61>kjIK4cmmEc{@jmye|8VTOx{POakRDySW z7FHgVNO11%#+C=aBsg2{^idw{N$`1h<-wLj$ys=LupzNK-IND465W*tB@*412YV9T smj`PS!;}YJVz~0aB!(?7gb-o~zK|qYN5qOj!2kdN07*qoM6N<$f_m|PmH+?% literal 0 HcmV?d00001 diff --git a/imagepicker/src/main/res/drawable-xhdpi/ef_ic_arrow_up_gray.png b/imagepicker/src/main/res/drawable-xhdpi/ef_ic_arrow_up_gray.png new file mode 100644 index 0000000000000000000000000000000000000000..277b1e6f62e6cc9a22fbf1d2dca888a5ae7bbb95 GIT binary patch literal 279 zcmV+y0qFjTP)V#QhvFJn*1^mXY$iWSmdXTXpx^Tq9z|g*ez%75x?Y*^9P^fY^sPedCYnCy)#F| zKY76O;;wImMIP`@IdhA!$^+ix`Rx%c@_=`F4sMHRl?S}f^UUyw9(llbcwRCzf&(n_ zfMs~j)FSXU?{$$Qtn#2W0F)7z$!G9Gt32ol0C?ka`5t-$ra=MTD8L&9c%uMs6yS{l dgb+dq10UB8SW1hJ06_o%002ovPDHLkV1gD&c>VwY literal 0 HcmV?d00001 diff --git a/imagepicker/src/main/res/drawable-xhdpi/ef_ic_sort_white.png b/imagepicker/src/main/res/drawable-xhdpi/ef_ic_sort_white.png new file mode 100644 index 0000000000000000000000000000000000000000..0df02af81d1cbdca914432900237b337a6efd3ea GIT binary patch literal 167 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpUtJWm(LkczmsR}A?MC{epD vEcb0BV!p~>p8b18?)5)DfJ}G;joBlWA1&7xXv+| zd&Rof)pENt8JF|vZ{oL)uUO~Za*}b&?YDA=p8twle_h_DeDa~@`%(Iv`S;rwKflCb zEaG9Y>-^b?hn($y8aYo8`u>X7MaK6}bJ2IL(9AiG9-Y6xFj=)Nj$9kIevex9L&f(s z2Fr|t9?6|8cpvh-;L(xu=U%T1%3E^eD^MU}@u5J=i9*-S4(|uo_Z=wPUHhc;ZAEWe^;@;Z#cfK3@rP|qHDyd$I(JLGJ8Cxj?Byo~A@M5jGIxj< z9{MQ%Zfp7$i&gwWo@zH~xQ^DU2KmO(9secFVdQ&MBb@0QRWp%m4rY literal 0 HcmV?d00001 diff --git a/imagepicker/src/main/res/drawable-xxhdpi/ef_ic_arrow_up_gray.png b/imagepicker/src/main/res/drawable-xxhdpi/ef_ic_arrow_up_gray.png new file mode 100644 index 0000000000000000000000000000000000000000..dd4a46c6f9d84b29710979574757c75dedf751be GIT binary patch literal 475 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY1|&n@Zgyv2U|i(s;uum9_x6If*AWMi)`vYu z8y8rgOrF!p$HKl>vyl7UHJL9?KRRF9tePG2^iM(Nid~-N^`TGa6rZzvKBxHIm94qI z7e3s%x~_26vY*!^IC~3wT9y^`e7P=j?&ZX359Wwv@}7G+VcUZ_Y?=IiA3Zb+lDeF| zI)#IIE}72Rwa&hB+Y`UZwwHwF?0Y}ILhf?u-OnF>9{v0=rF)Br`|ds67h@-SWEY6M zPkyvdW64&FE^EWbbCrOmX}mjHpr5^Dtwq;v!#lx|N^cJa-syiBH%0VPoXpYmq#fpZ z+)G3(y3QXh=$Dn!6zzMo+3?QnR}(xm3q|JlKfG5j%cW`B_sANk@Ot8eXAM9D_o=s4 zUyo||axOjZ(g$a~Kc9eRzwdf@Z&KQXxSiFPk9kxVTsboTCeISJ3GcdvIWzV9l+MH{ znEqKOuE;w-f6wl0=5xyDuer?-amYGQ`5^|MUxB`#oL#T-G@y GGywnu>Ra#t literal 0 HcmV?d00001 diff --git a/imagepicker/src/main/res/layout/ef_fragment_image_picker.xml b/imagepicker/src/main/res/layout/ef_fragment_image_picker.xml index 2d60508f..f8edc1bd 100644 --- a/imagepicker/src/main/res/layout/ef_fragment_image_picker.xml +++ b/imagepicker/src/main/res/layout/ef_fragment_image_picker.xml @@ -13,13 +13,6 @@ android:padding="@dimen/ef_spacing_double" android:text="@string/ef_msg_empty_images" android:textSize="@dimen/ef_font_medium" - android:visibility="gone" /> - - @@ -28,15 +21,11 @@ android:layout_width="match_parent" android:layout_height="match_parent" /> - diff --git a/imagepicker/src/main/res/menu/ef_image_picker_menu_main.xml b/imagepicker/src/main/res/menu/ef_image_picker_menu_main.xml index ccfdeebd..d1f4d7b6 100644 --- a/imagepicker/src/main/res/menu/ef_image_picker_menu_main.xml +++ b/imagepicker/src/main/res/menu/ef_image_picker_menu_main.xml @@ -3,12 +3,18 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"> + + + + + + + + diff --git a/imagepicker/src/main/res/menu/ef_sort_images.xml b/imagepicker/src/main/res/menu/ef_sort_images.xml new file mode 100644 index 00000000..d2c68fb9 --- /dev/null +++ b/imagepicker/src/main/res/menu/ef_sort_images.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + diff --git a/imagepicker/src/main/res/values-ar/strings.xml b/imagepicker/src/main/res/values-ar/strings.xml index 38f8fac7..a58cd873 100644 --- a/imagepicker/src/main/res/values-ar/strings.xml +++ b/imagepicker/src/main/res/values-ar/strings.xml @@ -12,6 +12,13 @@ بحث لم يتم العثور على شيء + نوع + مقاس + تاريخ + نوع + عدد + اسم + إخترت %d إخترت %1$d/%2$d diff --git a/imagepicker/src/main/res/values-da/strings.xml b/imagepicker/src/main/res/values-da/strings.xml index 596ed18b..51d83ab5 100644 --- a/imagepicker/src/main/res/values-da/strings.xml +++ b/imagepicker/src/main/res/values-da/strings.xml @@ -12,6 +12,13 @@ Søg Intet fundet + Sortere + Navn + Nummer + Type + Dato + Størrelse + %d valgt %1$d/%2$d valgt diff --git a/imagepicker/src/main/res/values-de/strings.xml b/imagepicker/src/main/res/values-de/strings.xml index 06ac708b..aa27d184 100644 --- a/imagepicker/src/main/res/values-de/strings.xml +++ b/imagepicker/src/main/res/values-de/strings.xml @@ -12,6 +12,13 @@ Suche Nichts gefunden + Sortieren + Name + Nummer + Typ + Datum + Größe + %d ausgewählt %1$d/%2$d ausgewählt diff --git a/imagepicker/src/main/res/values-fr/strings.xml b/imagepicker/src/main/res/values-fr/strings.xml index 3d5a60f7..94b73400 100644 --- a/imagepicker/src/main/res/values-fr/strings.xml +++ b/imagepicker/src/main/res/values-fr/strings.xml @@ -10,7 +10,14 @@ Toucher pour sélectionner des images Permission refusée Chercher - Rien n'a été trouvé + Rien n\'a été trouvé + + Sorte + Taille + Date + Taper + Nombre + Nom %d sélectionnées %1$d/%2$d sélectionnées diff --git a/imagepicker/src/main/res/values-in/strings.xml b/imagepicker/src/main/res/values-in/strings.xml index 41e12948..49bfba91 100644 --- a/imagepicker/src/main/res/values-in/strings.xml +++ b/imagepicker/src/main/res/values-in/strings.xml @@ -12,6 +12,13 @@ Cari Tidak ada yang ditemukan + Menyortir + Ukuran + Tanggal + Jenis + Nomor + Nama + %d terpilih %1$d/%2$d terpilih diff --git a/imagepicker/src/main/res/values-it/strings.xml b/imagepicker/src/main/res/values-it/strings.xml index 1a2b11bf..ca1daae9 100644 --- a/imagepicker/src/main/res/values-it/strings.xml +++ b/imagepicker/src/main/res/values-it/strings.xml @@ -11,6 +11,13 @@ Ricerca Non abbiamo trovato nulla + Ordinare + Nome + Numero + Tipo + Data + Taglia + %d selezionate %1$d/%2$d selezionate diff --git a/imagepicker/src/main/res/values-ja/strings.xml b/imagepicker/src/main/res/values-ja/strings.xml index f3aa0707..c8431ee8 100644 --- a/imagepicker/src/main/res/values-ja/strings.xml +++ b/imagepicker/src/main/res/values-ja/strings.xml @@ -10,6 +10,13 @@ 検索 何も見つかりません + 選別 + サイズ + 日にち + タイプ + 番号 + 名前 + %d 枚を選択済 %1$d/%2$d 枚を選択済 diff --git a/imagepicker/src/main/res/values-ko/strings.xml b/imagepicker/src/main/res/values-ko/strings.xml index 8996e782..fe254401 100644 --- a/imagepicker/src/main/res/values-ko/strings.xml +++ b/imagepicker/src/main/res/values-ko/strings.xml @@ -12,6 +12,13 @@ 찾다 아무것도 찾을 수 없음何も見つかりません + 종류 + 이름 + 숫자 + 유형 + 날짜 + 크기 + %d 선택됨 %1$d/%2$d 선택됨 diff --git a/imagepicker/src/main/res/values-pt-rBR/strings.xml b/imagepicker/src/main/res/values-pt-rBR/strings.xml index fcecce0d..12c78924 100644 --- a/imagepicker/src/main/res/values-pt-rBR/strings.xml +++ b/imagepicker/src/main/res/values-pt-rBR/strings.xml @@ -12,6 +12,13 @@ Procurar Nada encontrado + Ordenação + O tamanho + Data + Tipo de + Cantitar + Nume + %d selecionadas %1$d/%2$d selecionadas diff --git a/imagepicker/src/main/res/values-ro/strings.xml b/imagepicker/src/main/res/values-ro/strings.xml index ca311d0d..ac13a4db 100644 --- a/imagepicker/src/main/res/values-ro/strings.xml +++ b/imagepicker/src/main/res/values-ro/strings.xml @@ -11,6 +11,13 @@ Căutare Nimic gasit + Triere + Nume + Cantitate + Tip de + Data + Marimea + %d selectate %1$d/%2$d selectate diff --git a/imagepicker/src/main/res/values-ru/strings.xml b/imagepicker/src/main/res/values-ru/strings.xml index 89449a03..7ecdfc39 100644 --- a/imagepicker/src/main/res/values-ru/strings.xml +++ b/imagepicker/src/main/res/values-ru/strings.xml @@ -1,19 +1,31 @@ Разрешите доступ к хранилищу, чтобы выбрать изображения + ОК ГОТОВО КАМЕРА + Папка Коснитесь, чтобы выбрать Доступ запрещён Поиск Ничего не найдено + + Сортировка + Имя + Количество + Тип + Дата + Размер + %d выбрано %1$d/%2$d выбрано + Не удалось создать файл Камера недоступна Ой! Что-то пошло не так! + Изображений не найдено Пожалуйста, разрешите доступ к хранилищу, чтобы выбрать изображения Пожалуйста, разрешите доступ к камере, чтобы сделать снимок diff --git a/imagepicker/src/main/res/values-tr/strings.xml b/imagepicker/src/main/res/values-tr/strings.xml index d9012eba..bffdd684 100644 --- a/imagepicker/src/main/res/values-tr/strings.xml +++ b/imagepicker/src/main/res/values-tr/strings.xml @@ -11,6 +11,13 @@ Arama Hiçbirşey Bulunamadı + Sıralama + Boyut + Tarih + Bir çeşit + Miktar + İsim + %d seçili %1$d/%2$d seçili diff --git a/imagepicker/src/main/res/values-uk/strings.xml b/imagepicker/src/main/res/values-uk/strings.xml index 03ab0f81..be7647cc 100644 --- a/imagepicker/src/main/res/values-uk/strings.xml +++ b/imagepicker/src/main/res/values-uk/strings.xml @@ -4,16 +4,27 @@ ОК ГОТОВО КАМЕРА + Папка Торкніться, щоб обрати Доступ заборонено Пошук Нічого не знайдено + + Сортування + Ім\'я + Кількість + Тип + Дата + Розмір + %d обрано %1$d/%2$d обрано + Не вдалося створити файл Камера недоступна Ой! Щось пішло не так! + Зображень не знайдено Будь ласка, дозвольте доступ до сховища, щоб обрати зображення Будь ласка, дозвольте доступ до камери, щоб зробити знімок diff --git a/imagepicker/src/main/res/values-zh-rCN/strings.xml b/imagepicker/src/main/res/values-zh-rCN/strings.xml index 904a4766..679f2c1b 100644 --- a/imagepicker/src/main/res/values-zh-rCN/strings.xml +++ b/imagepicker/src/main/res/values-zh-rCN/strings.xml @@ -10,6 +10,13 @@ 搜索 沒有發現 + 種類 + 姓名 + 數字 + 類型 + 日期 + 尺寸 + 已选择 %d 已选择 %1$d/%2$d diff --git a/imagepicker/src/main/res/values-zh-rTW/strings.xml b/imagepicker/src/main/res/values-zh-rTW/strings.xml index c514df55..94c8a042 100644 --- a/imagepicker/src/main/res/values-zh-rTW/strings.xml +++ b/imagepicker/src/main/res/values-zh-rTW/strings.xml @@ -10,6 +10,13 @@ 搜索 没有发现 + 种类 + 尺寸 + 日期 + 类型 + 数字 + 姓名 + 已選擇 %d 已選擇 %1$d/%2$d diff --git a/imagepicker/src/main/res/values/strings.xml b/imagepicker/src/main/res/values/strings.xml index cc5d0af8..f20f9777 100644 --- a/imagepicker/src/main/res/values/strings.xml +++ b/imagepicker/src/main/res/values/strings.xml @@ -12,6 +12,13 @@ Search Nothing found + Sort + Name + Number + Type + Date + Size + %d selected %1$d/%2$d selected @@ -25,7 +32,7 @@ Image selection limit - GIF + GIF Folder Image From c25ce70c0de87c3195bd0b464eac1c08b991ebbe Mon Sep 17 00:00:00 2001 From: gee12 Date: Wed, 8 Dec 2021 22:35:30 +0300 Subject: [PATCH 06/11] Removed RecyclerView scrolling and added ProgressBar when sorting changed --- .../imagepicker/adapter/ImagePickerAdapter.kt | 6 ++++-- .../features/ImagePickerFragment.kt | 18 +++++++++++++----- .../features/recyclers/RecyclerViewManager.kt | 18 +++++++++++++----- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/imagepicker/src/main/java/com/esafirm/imagepicker/adapter/ImagePickerAdapter.kt b/imagepicker/src/main/java/com/esafirm/imagepicker/adapter/ImagePickerAdapter.kt index c2ab9202..a04a1175 100644 --- a/imagepicker/src/main/java/com/esafirm/imagepicker/adapter/ImagePickerAdapter.kt +++ b/imagepicker/src/main/java/com/esafirm/imagepicker/adapter/ImagePickerAdapter.kt @@ -112,8 +112,10 @@ class ImagePickerAdapter( return position.toLong() } - fun setData(images: List) { - listDiffer.submitList(images) + fun setData(images: List, commitCallback: (() -> Unit)? = null) { + listDiffer.submitList(images) { + commitCallback?.invoke() + } } private fun isSelected(image: Image): Boolean { diff --git a/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerFragment.kt b/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerFragment.kt index 4607c88c..732214e7 100644 --- a/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerFragment.kt +++ b/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerFragment.kt @@ -134,7 +134,7 @@ class ImagePickerFragment : Fragment() { } private fun subscribeToUiState() = presenter.getUiState().observe(this) { state -> - showLoading(state.isLoading) + showLoading(state.isLoading, true) state.error.fetch { showError(this) @@ -258,7 +258,10 @@ class ImagePickerFragment : Fragment() { filter(images) .let { sortImages(it) } .let { - recyclerViewManager.setImageAdapter(it) + showLoading(true) + recyclerViewManager.setImageAdapter(it) { + showLoading(false) + } checkDataIsEmpty(it) updateTitle() } @@ -268,7 +271,10 @@ class ImagePickerFragment : Fragment() { filter(folders) .let { sortFolders(it) } .let { - recyclerViewManager.setFolderAdapter(it) + showLoading(true) + recyclerViewManager.setFolderAdapter(it) { + showLoading(false) + } checkDataIsEmpty(it) updateTitle() } @@ -555,10 +561,12 @@ class ImagePickerFragment : Fragment() { Toast.makeText(activity, message, Toast.LENGTH_SHORT).show() } - private fun showLoading(isLoading: Boolean) { + private fun showLoading(isLoading: Boolean, hideRecyclerView: Boolean = false) { binding?.run { progressBar.visibility = if (isLoading) View.VISIBLE else View.GONE - recyclerView.visibility = if (isLoading) View.GONE else View.VISIBLE + if (hideRecyclerView) { + recyclerView.visibility = if (isLoading) View.GONE else View.VISIBLE + } tvEmptyImages.visibility = View.GONE } } diff --git a/imagepicker/src/main/java/com/esafirm/imagepicker/features/recyclers/RecyclerViewManager.kt b/imagepicker/src/main/java/com/esafirm/imagepicker/features/recyclers/RecyclerViewManager.kt index 8e589bf6..0ca78cf7 100644 --- a/imagepicker/src/main/java/com/esafirm/imagepicker/features/recyclers/RecyclerViewManager.kt +++ b/imagepicker/src/main/java/com/esafirm/imagepicker/features/recyclers/RecyclerViewManager.kt @@ -37,6 +37,7 @@ class RecyclerViewManager( private lateinit var folderAdapter: FolderPickerAdapter private var foldersState: Parcelable? = null + private var imagesState: Parcelable? = null private var imageColumns = 0 private var folderColumns = 0 @@ -147,20 +148,27 @@ class RecyclerViewManager( } } - fun setImageAdapter(images: List = emptyList()) { - imageAdapter.setData(images) + fun setImageAdapter(images: List = emptyList(), commitCallback: (() -> Unit)? = null) { + imagesState = recyclerView.layoutManager?.onSaveInstanceState() + imageAdapter.setData(images) { + imagesState?.let { + recyclerView.layoutManager!!.onRestoreInstanceState(it) + } + commitCallback?.invoke() + } setItemDecoration(imageColumns) recyclerView.adapter = imageAdapter } - fun setFolderAdapter(folders: List?) { + fun setFolderAdapter(folders: List?, commitCallback: (() -> Unit)? = null) { folderAdapter.setData(folders) setItemDecoration(folderColumns) recyclerView.adapter = folderAdapter - if (foldersState != null) { + foldersState?.let { layoutManager!!.spanCount = folderColumns - recyclerView.layoutManager!!.onRestoreInstanceState(foldersState) + recyclerView.layoutManager!!.onRestoreInstanceState(it) } + commitCallback?.invoke() } /* --------------------------------------------------- */ From dc5c8ce3b0942c3dbcebd2d80130b524df303b1f Mon Sep 17 00:00:00 2001 From: gee12 Date: Sun, 30 Jan 2022 12:05:29 +0300 Subject: [PATCH 07/11] Deleted translates other then en and ru --- .../src/main/res/values-ar/strings.xml | 33 ---------------- .../src/main/res/values-da/strings.xml | 39 ------------------- .../src/main/res/values-de/strings.xml | 39 ------------------- .../src/main/res/values-fr/strings.xml | 37 ------------------ .../src/main/res/values-in/strings.xml | 33 ---------------- .../src/main/res/values-it/strings.xml | 34 ---------------- .../src/main/res/values-ja/strings.xml | 33 ---------------- .../src/main/res/values-ko/strings.xml | 34 ---------------- .../src/main/res/values-pt-rBR/strings.xml | 34 ---------------- .../src/main/res/values-ro/strings.xml | 34 ---------------- .../src/main/res/values-tr/strings.xml | 32 --------------- .../src/main/res/values-uk/strings.xml | 32 --------------- .../src/main/res/values-zh-rCN/strings.xml | 33 ---------------- .../src/main/res/values-zh-rTW/strings.xml | 33 ---------------- 14 files changed, 480 deletions(-) delete mode 100644 imagepicker/src/main/res/values-ar/strings.xml delete mode 100644 imagepicker/src/main/res/values-da/strings.xml delete mode 100644 imagepicker/src/main/res/values-de/strings.xml delete mode 100644 imagepicker/src/main/res/values-fr/strings.xml delete mode 100644 imagepicker/src/main/res/values-in/strings.xml delete mode 100644 imagepicker/src/main/res/values-it/strings.xml delete mode 100644 imagepicker/src/main/res/values-ja/strings.xml delete mode 100644 imagepicker/src/main/res/values-ko/strings.xml delete mode 100644 imagepicker/src/main/res/values-pt-rBR/strings.xml delete mode 100644 imagepicker/src/main/res/values-ro/strings.xml delete mode 100644 imagepicker/src/main/res/values-tr/strings.xml delete mode 100644 imagepicker/src/main/res/values-uk/strings.xml delete mode 100644 imagepicker/src/main/res/values-zh-rCN/strings.xml delete mode 100644 imagepicker/src/main/res/values-zh-rTW/strings.xml diff --git a/imagepicker/src/main/res/values-ar/strings.xml b/imagepicker/src/main/res/values-ar/strings.xml deleted file mode 100644 index a58cd873..00000000 --- a/imagepicker/src/main/res/values-ar/strings.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - عليك إعطاء التطبيق الصلاحية لاستخدام الصور - - وافق - انهي - كاميرا - - دليل - أنقر لإختيار الصور - طلب الاذن مرفوض - بحث - لم يتم العثور على شيء - - نوع - مقاس - تاريخ - نوع - عدد - اسم - - إخترت %d - إخترت %1$d/%2$d - - حدث خطأ في تسجيل الصوره - لا يوجد كاميرا - عذراً، هناك خطأ ما! - - لم يتم العثور على صور - عليك إعطاء التطبيق الصلاحية لاستخدام الصور - عليك إعطاء التطبيق الصلاحية لاستخدام الكاميرا لتتمكن من التصوير - تحديد إختيار الصور - diff --git a/imagepicker/src/main/res/values-da/strings.xml b/imagepicker/src/main/res/values-da/strings.xml deleted file mode 100644 index 51d83ab5..00000000 --- a/imagepicker/src/main/res/values-da/strings.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - Giv adgang til ekstern hukommelse, for at vælge billeder - - Ok - Færdig - Kamera - - Mappe - Tryk for at vælge billeder - Adgang nægtet - Søg - Intet fundet - - Sortere - Navn - Nummer - Type - Dato - Størrelse - - %d valgt - %1$d/%2$d valgt - - Fejl, kunne ikke oprette billedfilen - Kamera blev ikke fundet - Beklager, der er sket en fejl! - - Ingen billeder fundet - Giv tilladelse til at vælge billeder fra telefon hukkommelsen - Giv tilladelse til kamera til at tage billeder - Der kan ikke vælges flere billeder - - - GIF - Folder - Image - - \ No newline at end of file diff --git a/imagepicker/src/main/res/values-de/strings.xml b/imagepicker/src/main/res/values-de/strings.xml deleted file mode 100644 index aa27d184..00000000 --- a/imagepicker/src/main/res/values-de/strings.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - Erlaube den Zugriff auf den Speicher um Bilder auszuwählen - - OK - FERTIG - KAMERA - - Verzeichnis - Tippen um Bilder auszuwählen - Erlaubnis verweigert - Suche - Nichts gefunden - - Sortieren - Name - Nummer - Typ - Datum - Größe - - %d ausgewählt - %1$d/%2$d ausgewählt - - Fehler beim Erstellen der Bilddatei - Keine Kamera gefunden - Ups, da ist was schiefgegangen! - - Keine Bilder gefunden - Bitte erlaube Zugriff auf den Speicher um Bilder auszuwählen - Bitte erlaube Zugriff auf die Kamera um Bilder aufzunehmen - Maximale Anzahl Bilder erreicht - - - GIF - Folder - Image - - diff --git a/imagepicker/src/main/res/values-fr/strings.xml b/imagepicker/src/main/res/values-fr/strings.xml deleted file mode 100644 index 94b73400..00000000 --- a/imagepicker/src/main/res/values-fr/strings.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - Autoriser l\'application à accéder au stockage externe pour afficher les images - - OK - TERMINER - CAMERA - - Dossier - Toucher pour sélectionner des images - Permission refusée - Chercher - Rien n\'a été trouvé - - Sorte - Taille - Date - Taper - Nombre - Nom - - %d sélectionnées - %1$d/%2$d sélectionnées - - Impossible de créer le fichier photo - Aucune caméra détectée - Oups, quelque chose s\'est mal déroulé! - - Aucune image trouvée - L\'application nécessite l\'autorisation de stockage pour afficher les images - L\'application nécessite l\'autorisation de la caméra - Limite du nombre d\'images - - - GIF - - diff --git a/imagepicker/src/main/res/values-in/strings.xml b/imagepicker/src/main/res/values-in/strings.xml deleted file mode 100644 index 49bfba91..00000000 --- a/imagepicker/src/main/res/values-in/strings.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - Izinkan akses penyimpanan eksternal untuk memilih gambar - - OK - SELESAI - KAMERA - - Folder - Ketuk untuk memilih gambar - Izin ditolak - Cari - Tidak ada yang ditemukan - - Menyortir - Ukuran - Tanggal - Jenis - Nomor - Nama - - %d terpilih - %1$d/%2$d terpilih - - Gagal membuat berkas gambar - Kamera tidak ditemukan - Ups, ada yang tidak beres! - - Gambar tidak ditemukan - Mohon berikan izin terhadap penyimpanan untuk memilih gambar - Mohon berikan izin terhadap kamera untuk mengambil gambar - Gambar yang terpilih sudah mencapai batas maksimal - diff --git a/imagepicker/src/main/res/values-it/strings.xml b/imagepicker/src/main/res/values-it/strings.xml deleted file mode 100644 index ca1daae9..00000000 --- a/imagepicker/src/main/res/values-it/strings.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - Permetti l\'accesso allo storage locale per poter selezionare le immagini - - OK - FATTO - CAMERA - - Cartella - Premi per selezionare l\'immagine - Ricerca - Non abbiamo trovato nulla - - Ordinare - Nome - Numero - Tipo - Data - Taglia - - %d selezionate - %1$d/%2$d selezionate - - Si è verificato un problema nella creazione dell\'immagine - Nessuna fotocamera trovata - Oops, qualcosa è andato storto! - - Nessuna immagine trovata - Dai il permesso per poter selezionare le immagini - Dai il permesso per poter scattare una foto - Hai raggiunto il limite massimo di selezione - Permesso negato - - diff --git a/imagepicker/src/main/res/values-ja/strings.xml b/imagepicker/src/main/res/values-ja/strings.xml deleted file mode 100644 index c8431ee8..00000000 --- a/imagepicker/src/main/res/values-ja/strings.xml +++ /dev/null @@ -1,33 +0,0 @@ - - 端末のファイルへのアクセスを許可します - - OK - 完了 - カメラ - - フォルダ - 画像を選択 - 検索 - 何も見つかりません - - 選別 - サイズ - 日にち - タイプ - 番号 - 名前 - - %d 枚を選択済 - %1$d/%2$d 枚を選択済 - - 写真の保存に失敗しました - カメラがありません - エラーが発生しました - - 画像が見つかりません - 端末のファイルへのアクセスを許可してください - 端末のカメラへのアクセスを許可してください - 選択できる画像の上限です - 権限がありません - - diff --git a/imagepicker/src/main/res/values-ko/strings.xml b/imagepicker/src/main/res/values-ko/strings.xml deleted file mode 100644 index fe254401..00000000 --- a/imagepicker/src/main/res/values-ko/strings.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - 이미지를 불러오기 위해 외부 저장공간 권한을 허용해주세요 - - 확인 - 완료 - 카메라 - - 사진첩 - 이미지를 선택하세요 - 권한이 없음 - 찾다 - 아무것도 찾을 수 없음何も見つかりません - - 종류 - 이름 - 숫자 - 유형 - 날짜 - 크기 - - %d 선택됨 - %1$d/%2$d 선택됨 - - 이미지 생성에 실패하였습니다. - 카메라를 찾을 수 없습니다. - 알 수 없는 오류가 발생하였습니다. - - 이미지가 비어있음 - 이미지를 불러오기 위해 저장공간 권한을 허용해주세요 - 사진을 찍기위해 카메라 권한을 허용해주세요 - 이미지 선택 제한 초과 - - diff --git a/imagepicker/src/main/res/values-pt-rBR/strings.xml b/imagepicker/src/main/res/values-pt-rBR/strings.xml deleted file mode 100644 index 12c78924..00000000 --- a/imagepicker/src/main/res/values-pt-rBR/strings.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - Dê permissão ao armazenamento para selecionar as imagens - - OK - FEITO - CAMERA - - Pasta - Toque para selecionar as imagens - Permissão negada - Procurar - Nada encontrado - - Ordenação - O tamanho - Data - Tipo de - Cantitar - Nume - - %d selecionadas - %1$d/%2$d selecionadas - - Erro ao criar arquivo de imagem - Câmera não encontrada - Ops, algo deu errado! - - Nenhuma imagem encontrada - Por favor dê permissão ao armazenamento para selecionar as imagens - Por favor dê permissão à câmera para tirar fotos - Limite de imagens atingido - - diff --git a/imagepicker/src/main/res/values-ro/strings.xml b/imagepicker/src/main/res/values-ro/strings.xml deleted file mode 100644 index ac13a4db..00000000 --- a/imagepicker/src/main/res/values-ro/strings.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - Permite accesul de stocare extern pentru a selecta imagini - - OK - TERMINAT - CAMERA - - Fișier - Atingeți pentru a selecta imagini - Căutare - Nimic gasit - - Triere - Nume - Cantitate - Tip de - Data - Marimea - - %d selectate - %1$d/%2$d selectate - - Nu am putut crea imaginea - Camera foto nu a fost găsită - Hopa, ceva a mers prost! - - Nu am găsit imaginea - Vă rugăm să acordați permisiunea de stocare pentru a selecta imagini - Vă rugăm să acordați permisiunea fotocamerei pentru a captura imagini - Limita de selecție a imaginii depăşită - Acces refuzat - - diff --git a/imagepicker/src/main/res/values-tr/strings.xml b/imagepicker/src/main/res/values-tr/strings.xml deleted file mode 100644 index bffdd684..00000000 --- a/imagepicker/src/main/res/values-tr/strings.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - TAMAM - BİTTİ - KAMERA - Görüntüleri seçmek için harici depolama alanına erişime izin ver - - Klasör - Resimleri seçmek için hafifçe dokunun - İzin reddedildi - Arama - Hiçbirşey Bulunamadı - - Sıralama - Boyut - Tarih - Bir çeşit - Miktar - İsim - - %d seçili - %1$d/%2$d seçili - - Resim dosyası oluşturulamadı - Kamera bulunamadı - Hoop! Birşeyler yanlış gitti! - - Resimler bulunamadı - Lütfen resim seçmek için depolama iznini verin - Resim çekmek için lütfen kamera iznini verin - Resim seçimi sınırı - diff --git a/imagepicker/src/main/res/values-uk/strings.xml b/imagepicker/src/main/res/values-uk/strings.xml deleted file mode 100644 index be7647cc..00000000 --- a/imagepicker/src/main/res/values-uk/strings.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - Дозвольте доступ до сховища, щоб обрати зображення - ОК - ГОТОВО - КАМЕРА - - Папка - Торкніться, щоб обрати - Доступ заборонено - Пошук - Нічого не знайдено - - Сортування - Ім\'я - Кількість - Тип - Дата - Розмір - - %d обрано - %1$d/%2$d обрано - - Не вдалося створити файл - Камера недоступна - Ой! Щось пішло не так! - - Зображень не знайдено - Будь ласка, дозвольте доступ до сховища, щоб обрати зображення - Будь ласка, дозвольте доступ до камери, щоб зробити знімок - Ліміт вибору зображень - diff --git a/imagepicker/src/main/res/values-zh-rCN/strings.xml b/imagepicker/src/main/res/values-zh-rCN/strings.xml deleted file mode 100644 index 679f2c1b..00000000 --- a/imagepicker/src/main/res/values-zh-rCN/strings.xml +++ /dev/null @@ -1,33 +0,0 @@ - - 请给予存取外部存储权限以选择照片 - - - 完成 - 相机 - - 文件夹 - 选择照片 - 搜索 - 沒有發現 - - 種類 - 姓名 - 數字 - 類型 - 日期 - 尺寸 - - 已选择 %d - 已选择 %1$d/%2$d - - 建立照片文件失败 - 找不到相机 - 啊哦,发生错误! - - 找不到照片 - 请给予存取外部存储权限以选择照片 - 请给予获取相机权限以拍摄照片 - 已达到最多选择照片数量 - 没有权限 - - diff --git a/imagepicker/src/main/res/values-zh-rTW/strings.xml b/imagepicker/src/main/res/values-zh-rTW/strings.xml deleted file mode 100644 index 94c8a042..00000000 --- a/imagepicker/src/main/res/values-zh-rTW/strings.xml +++ /dev/null @@ -1,33 +0,0 @@ - - 請允許存取外部存儲以選擇相片 - - - 完成 - 相機 - - 檔案夹 - 選擇相片 - 搜索 - 没有发现 - - 种类 - 尺寸 - 日期 - 类型 - 数字 - 姓名 - - 已選擇 %d - 已選擇 %1$d/%2$d - - 建立相片檔案失敗 - 找不到相機 - 噢,發生問題 - - 找不到相片 - 請允許存取外部存儲以選擇相片 - 請允許存取相機以拍攝相片 - 已達到最多選擇相片數量 - 沒有權限 - - From 14cd208a944a6a4b7809ea621777488451fc62db Mon Sep 17 00:00:00 2001 From: gee12 Date: Thu, 24 Nov 2022 22:10:23 +0300 Subject: [PATCH 08/11] Fixes --- .../imagepicker/features/recyclers/RecyclerViewManager.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imagepicker/src/main/java/com/esafirm/imagepicker/features/recyclers/RecyclerViewManager.kt b/imagepicker/src/main/java/com/esafirm/imagepicker/features/recyclers/RecyclerViewManager.kt index 0ca78cf7..35bfead8 100644 --- a/imagepicker/src/main/java/com/esafirm/imagepicker/features/recyclers/RecyclerViewManager.kt +++ b/imagepicker/src/main/java/com/esafirm/imagepicker/features/recyclers/RecyclerViewManager.kt @@ -140,10 +140,10 @@ class RecyclerViewManager( currentFolderName } config.limit == IpCons.MAX_LIMIT -> { - context.getString(R.string.ef_selected).format(selectedNum) + context.getString(R.string.ef_selected, selectedNum) } else -> { - context.getString(R.string.ef_selected_with_limit).format(selectedNum, config.limit) + context.getString(R.string.ef_selected_with_limit, selectedNum, config.limit) } } } From 68f8dfbd0f6abff968b676583b8f2c45dbc7880c Mon Sep 17 00:00:00 2001 From: gee12 Date: Sat, 18 Feb 2023 19:47:55 +0300 Subject: [PATCH 09/11] Up versions for libs and sdk --- imagepicker/build.gradle | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/imagepicker/build.gradle b/imagepicker/build.gradle index df21aeee..0b5a2a7b 100644 --- a/imagepicker/build.gradle +++ b/imagepicker/build.gradle @@ -1,7 +1,6 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' -apply plugin: 'com.github.dcendents.android-maven' android { final sdk = rootProject.ext.sdk @@ -51,9 +50,9 @@ dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation "com.github.bumptech.glide:glide:4.11.0" implementation 'androidx.recyclerview:recyclerview:1.2.1' - implementation 'androidx.constraintlayout:constraintlayout:2.1.2' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - implementation 'androidx.appcompat:appcompat:1.3.0' + implementation 'androidx.appcompat:appcompat:1.6.1' implementation "androidx.core:core-ktx:$core_ktx_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" From 062f38536f4ba1eaf403496fd23d656fce63e362 Mon Sep 17 00:00:00 2001 From: gee12 Date: Sat, 18 Feb 2023 19:51:50 +0300 Subject: [PATCH 10/11] Fixes --- .../com/esafirm/imagepicker/features/ImagePickerActivity.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerActivity.kt b/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerActivity.kt index f24139fc..45dee40a 100644 --- a/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerActivity.kt +++ b/imagepicker/src/main/java/com/esafirm/imagepicker/features/ImagePickerActivity.kt @@ -60,8 +60,9 @@ class ImagePickerActivity : AppCompatActivity(), ImagePickerInteractionListener } if (isCameraOnly) { - val cameraIntent = cameraModule.getCameraIntent(this, cameraOnlyConfig!!) - startActivityForResult(cameraIntent, RC_CAMERA) + cameraModule.getCameraIntent(this, cameraOnlyConfig!!)?.let { cameraIntent -> + startActivityForResult(cameraIntent, RC_CAMERA) + } return } From ad0b2d40886382efad2785a0379f007aa3b6ba30 Mon Sep 17 00:00:00 2001 From: gee12 Date: Sun, 21 May 2023 22:21:39 +0300 Subject: [PATCH 11/11] Revert "Deleted translates other then en and ru" This reverts commit dc5c8ce3b0942c3dbcebd2d80130b524df303b1f. --- .../src/main/res/values-ar/strings.xml | 33 ++++++++++++++++ .../src/main/res/values-da/strings.xml | 39 +++++++++++++++++++ .../src/main/res/values-de/strings.xml | 39 +++++++++++++++++++ .../src/main/res/values-fr/strings.xml | 37 ++++++++++++++++++ .../src/main/res/values-in/strings.xml | 33 ++++++++++++++++ .../src/main/res/values-it/strings.xml | 34 ++++++++++++++++ .../src/main/res/values-ja/strings.xml | 33 ++++++++++++++++ .../src/main/res/values-ko/strings.xml | 34 ++++++++++++++++ .../src/main/res/values-pt-rBR/strings.xml | 34 ++++++++++++++++ .../src/main/res/values-ro/strings.xml | 34 ++++++++++++++++ .../src/main/res/values-tr/strings.xml | 32 +++++++++++++++ .../src/main/res/values-uk/strings.xml | 32 +++++++++++++++ .../src/main/res/values-zh-rCN/strings.xml | 33 ++++++++++++++++ .../src/main/res/values-zh-rTW/strings.xml | 33 ++++++++++++++++ 14 files changed, 480 insertions(+) create mode 100644 imagepicker/src/main/res/values-ar/strings.xml create mode 100644 imagepicker/src/main/res/values-da/strings.xml create mode 100644 imagepicker/src/main/res/values-de/strings.xml create mode 100644 imagepicker/src/main/res/values-fr/strings.xml create mode 100644 imagepicker/src/main/res/values-in/strings.xml create mode 100644 imagepicker/src/main/res/values-it/strings.xml create mode 100644 imagepicker/src/main/res/values-ja/strings.xml create mode 100644 imagepicker/src/main/res/values-ko/strings.xml create mode 100644 imagepicker/src/main/res/values-pt-rBR/strings.xml create mode 100644 imagepicker/src/main/res/values-ro/strings.xml create mode 100644 imagepicker/src/main/res/values-tr/strings.xml create mode 100644 imagepicker/src/main/res/values-uk/strings.xml create mode 100644 imagepicker/src/main/res/values-zh-rCN/strings.xml create mode 100644 imagepicker/src/main/res/values-zh-rTW/strings.xml diff --git a/imagepicker/src/main/res/values-ar/strings.xml b/imagepicker/src/main/res/values-ar/strings.xml new file mode 100644 index 00000000..a58cd873 --- /dev/null +++ b/imagepicker/src/main/res/values-ar/strings.xml @@ -0,0 +1,33 @@ + + + عليك إعطاء التطبيق الصلاحية لاستخدام الصور + + وافق + انهي + كاميرا + + دليل + أنقر لإختيار الصور + طلب الاذن مرفوض + بحث + لم يتم العثور على شيء + + نوع + مقاس + تاريخ + نوع + عدد + اسم + + إخترت %d + إخترت %1$d/%2$d + + حدث خطأ في تسجيل الصوره + لا يوجد كاميرا + عذراً، هناك خطأ ما! + + لم يتم العثور على صور + عليك إعطاء التطبيق الصلاحية لاستخدام الصور + عليك إعطاء التطبيق الصلاحية لاستخدام الكاميرا لتتمكن من التصوير + تحديد إختيار الصور + diff --git a/imagepicker/src/main/res/values-da/strings.xml b/imagepicker/src/main/res/values-da/strings.xml new file mode 100644 index 00000000..51d83ab5 --- /dev/null +++ b/imagepicker/src/main/res/values-da/strings.xml @@ -0,0 +1,39 @@ + + + Giv adgang til ekstern hukommelse, for at vælge billeder + + Ok + Færdig + Kamera + + Mappe + Tryk for at vælge billeder + Adgang nægtet + Søg + Intet fundet + + Sortere + Navn + Nummer + Type + Dato + Størrelse + + %d valgt + %1$d/%2$d valgt + + Fejl, kunne ikke oprette billedfilen + Kamera blev ikke fundet + Beklager, der er sket en fejl! + + Ingen billeder fundet + Giv tilladelse til at vælge billeder fra telefon hukkommelsen + Giv tilladelse til kamera til at tage billeder + Der kan ikke vælges flere billeder + + + GIF + Folder + Image + + \ No newline at end of file diff --git a/imagepicker/src/main/res/values-de/strings.xml b/imagepicker/src/main/res/values-de/strings.xml new file mode 100644 index 00000000..aa27d184 --- /dev/null +++ b/imagepicker/src/main/res/values-de/strings.xml @@ -0,0 +1,39 @@ + + + Erlaube den Zugriff auf den Speicher um Bilder auszuwählen + + OK + FERTIG + KAMERA + + Verzeichnis + Tippen um Bilder auszuwählen + Erlaubnis verweigert + Suche + Nichts gefunden + + Sortieren + Name + Nummer + Typ + Datum + Größe + + %d ausgewählt + %1$d/%2$d ausgewählt + + Fehler beim Erstellen der Bilddatei + Keine Kamera gefunden + Ups, da ist was schiefgegangen! + + Keine Bilder gefunden + Bitte erlaube Zugriff auf den Speicher um Bilder auszuwählen + Bitte erlaube Zugriff auf die Kamera um Bilder aufzunehmen + Maximale Anzahl Bilder erreicht + + + GIF + Folder + Image + + diff --git a/imagepicker/src/main/res/values-fr/strings.xml b/imagepicker/src/main/res/values-fr/strings.xml new file mode 100644 index 00000000..94b73400 --- /dev/null +++ b/imagepicker/src/main/res/values-fr/strings.xml @@ -0,0 +1,37 @@ + + + Autoriser l\'application à accéder au stockage externe pour afficher les images + + OK + TERMINER + CAMERA + + Dossier + Toucher pour sélectionner des images + Permission refusée + Chercher + Rien n\'a été trouvé + + Sorte + Taille + Date + Taper + Nombre + Nom + + %d sélectionnées + %1$d/%2$d sélectionnées + + Impossible de créer le fichier photo + Aucune caméra détectée + Oups, quelque chose s\'est mal déroulé! + + Aucune image trouvée + L\'application nécessite l\'autorisation de stockage pour afficher les images + L\'application nécessite l\'autorisation de la caméra + Limite du nombre d\'images + + + GIF + + diff --git a/imagepicker/src/main/res/values-in/strings.xml b/imagepicker/src/main/res/values-in/strings.xml new file mode 100644 index 00000000..49bfba91 --- /dev/null +++ b/imagepicker/src/main/res/values-in/strings.xml @@ -0,0 +1,33 @@ + + + Izinkan akses penyimpanan eksternal untuk memilih gambar + + OK + SELESAI + KAMERA + + Folder + Ketuk untuk memilih gambar + Izin ditolak + Cari + Tidak ada yang ditemukan + + Menyortir + Ukuran + Tanggal + Jenis + Nomor + Nama + + %d terpilih + %1$d/%2$d terpilih + + Gagal membuat berkas gambar + Kamera tidak ditemukan + Ups, ada yang tidak beres! + + Gambar tidak ditemukan + Mohon berikan izin terhadap penyimpanan untuk memilih gambar + Mohon berikan izin terhadap kamera untuk mengambil gambar + Gambar yang terpilih sudah mencapai batas maksimal + diff --git a/imagepicker/src/main/res/values-it/strings.xml b/imagepicker/src/main/res/values-it/strings.xml new file mode 100644 index 00000000..ca1daae9 --- /dev/null +++ b/imagepicker/src/main/res/values-it/strings.xml @@ -0,0 +1,34 @@ + + + Permetti l\'accesso allo storage locale per poter selezionare le immagini + + OK + FATTO + CAMERA + + Cartella + Premi per selezionare l\'immagine + Ricerca + Non abbiamo trovato nulla + + Ordinare + Nome + Numero + Tipo + Data + Taglia + + %d selezionate + %1$d/%2$d selezionate + + Si è verificato un problema nella creazione dell\'immagine + Nessuna fotocamera trovata + Oops, qualcosa è andato storto! + + Nessuna immagine trovata + Dai il permesso per poter selezionare le immagini + Dai il permesso per poter scattare una foto + Hai raggiunto il limite massimo di selezione + Permesso negato + + diff --git a/imagepicker/src/main/res/values-ja/strings.xml b/imagepicker/src/main/res/values-ja/strings.xml new file mode 100644 index 00000000..c8431ee8 --- /dev/null +++ b/imagepicker/src/main/res/values-ja/strings.xml @@ -0,0 +1,33 @@ + + 端末のファイルへのアクセスを許可します + + OK + 完了 + カメラ + + フォルダ + 画像を選択 + 検索 + 何も見つかりません + + 選別 + サイズ + 日にち + タイプ + 番号 + 名前 + + %d 枚を選択済 + %1$d/%2$d 枚を選択済 + + 写真の保存に失敗しました + カメラがありません + エラーが発生しました + + 画像が見つかりません + 端末のファイルへのアクセスを許可してください + 端末のカメラへのアクセスを許可してください + 選択できる画像の上限です + 権限がありません + + diff --git a/imagepicker/src/main/res/values-ko/strings.xml b/imagepicker/src/main/res/values-ko/strings.xml new file mode 100644 index 00000000..fe254401 --- /dev/null +++ b/imagepicker/src/main/res/values-ko/strings.xml @@ -0,0 +1,34 @@ + + + 이미지를 불러오기 위해 외부 저장공간 권한을 허용해주세요 + + 확인 + 완료 + 카메라 + + 사진첩 + 이미지를 선택하세요 + 권한이 없음 + 찾다 + 아무것도 찾을 수 없음何も見つかりません + + 종류 + 이름 + 숫자 + 유형 + 날짜 + 크기 + + %d 선택됨 + %1$d/%2$d 선택됨 + + 이미지 생성에 실패하였습니다. + 카메라를 찾을 수 없습니다. + 알 수 없는 오류가 발생하였습니다. + + 이미지가 비어있음 + 이미지를 불러오기 위해 저장공간 권한을 허용해주세요 + 사진을 찍기위해 카메라 권한을 허용해주세요 + 이미지 선택 제한 초과 + + diff --git a/imagepicker/src/main/res/values-pt-rBR/strings.xml b/imagepicker/src/main/res/values-pt-rBR/strings.xml new file mode 100644 index 00000000..12c78924 --- /dev/null +++ b/imagepicker/src/main/res/values-pt-rBR/strings.xml @@ -0,0 +1,34 @@ + + + Dê permissão ao armazenamento para selecionar as imagens + + OK + FEITO + CAMERA + + Pasta + Toque para selecionar as imagens + Permissão negada + Procurar + Nada encontrado + + Ordenação + O tamanho + Data + Tipo de + Cantitar + Nume + + %d selecionadas + %1$d/%2$d selecionadas + + Erro ao criar arquivo de imagem + Câmera não encontrada + Ops, algo deu errado! + + Nenhuma imagem encontrada + Por favor dê permissão ao armazenamento para selecionar as imagens + Por favor dê permissão à câmera para tirar fotos + Limite de imagens atingido + + diff --git a/imagepicker/src/main/res/values-ro/strings.xml b/imagepicker/src/main/res/values-ro/strings.xml new file mode 100644 index 00000000..ac13a4db --- /dev/null +++ b/imagepicker/src/main/res/values-ro/strings.xml @@ -0,0 +1,34 @@ + + + Permite accesul de stocare extern pentru a selecta imagini + + OK + TERMINAT + CAMERA + + Fișier + Atingeți pentru a selecta imagini + Căutare + Nimic gasit + + Triere + Nume + Cantitate + Tip de + Data + Marimea + + %d selectate + %1$d/%2$d selectate + + Nu am putut crea imaginea + Camera foto nu a fost găsită + Hopa, ceva a mers prost! + + Nu am găsit imaginea + Vă rugăm să acordați permisiunea de stocare pentru a selecta imagini + Vă rugăm să acordați permisiunea fotocamerei pentru a captura imagini + Limita de selecție a imaginii depăşită + Acces refuzat + + diff --git a/imagepicker/src/main/res/values-tr/strings.xml b/imagepicker/src/main/res/values-tr/strings.xml new file mode 100644 index 00000000..bffdd684 --- /dev/null +++ b/imagepicker/src/main/res/values-tr/strings.xml @@ -0,0 +1,32 @@ + + + TAMAM + BİTTİ + KAMERA + Görüntüleri seçmek için harici depolama alanına erişime izin ver + + Klasör + Resimleri seçmek için hafifçe dokunun + İzin reddedildi + Arama + Hiçbirşey Bulunamadı + + Sıralama + Boyut + Tarih + Bir çeşit + Miktar + İsim + + %d seçili + %1$d/%2$d seçili + + Resim dosyası oluşturulamadı + Kamera bulunamadı + Hoop! Birşeyler yanlış gitti! + + Resimler bulunamadı + Lütfen resim seçmek için depolama iznini verin + Resim çekmek için lütfen kamera iznini verin + Resim seçimi sınırı + diff --git a/imagepicker/src/main/res/values-uk/strings.xml b/imagepicker/src/main/res/values-uk/strings.xml new file mode 100644 index 00000000..be7647cc --- /dev/null +++ b/imagepicker/src/main/res/values-uk/strings.xml @@ -0,0 +1,32 @@ + + + Дозвольте доступ до сховища, щоб обрати зображення + ОК + ГОТОВО + КАМЕРА + + Папка + Торкніться, щоб обрати + Доступ заборонено + Пошук + Нічого не знайдено + + Сортування + Ім\'я + Кількість + Тип + Дата + Розмір + + %d обрано + %1$d/%2$d обрано + + Не вдалося створити файл + Камера недоступна + Ой! Щось пішло не так! + + Зображень не знайдено + Будь ласка, дозвольте доступ до сховища, щоб обрати зображення + Будь ласка, дозвольте доступ до камери, щоб зробити знімок + Ліміт вибору зображень + diff --git a/imagepicker/src/main/res/values-zh-rCN/strings.xml b/imagepicker/src/main/res/values-zh-rCN/strings.xml new file mode 100644 index 00000000..679f2c1b --- /dev/null +++ b/imagepicker/src/main/res/values-zh-rCN/strings.xml @@ -0,0 +1,33 @@ + + 请给予存取外部存储权限以选择照片 + + + 完成 + 相机 + + 文件夹 + 选择照片 + 搜索 + 沒有發現 + + 種類 + 姓名 + 數字 + 類型 + 日期 + 尺寸 + + 已选择 %d + 已选择 %1$d/%2$d + + 建立照片文件失败 + 找不到相机 + 啊哦,发生错误! + + 找不到照片 + 请给予存取外部存储权限以选择照片 + 请给予获取相机权限以拍摄照片 + 已达到最多选择照片数量 + 没有权限 + + diff --git a/imagepicker/src/main/res/values-zh-rTW/strings.xml b/imagepicker/src/main/res/values-zh-rTW/strings.xml new file mode 100644 index 00000000..94c8a042 --- /dev/null +++ b/imagepicker/src/main/res/values-zh-rTW/strings.xml @@ -0,0 +1,33 @@ + + 請允許存取外部存儲以選擇相片 + + + 完成 + 相機 + + 檔案夹 + 選擇相片 + 搜索 + 没有发现 + + 种类 + 尺寸 + 日期 + 类型 + 数字 + 姓名 + + 已選擇 %d + 已選擇 %1$d/%2$d + + 建立相片檔案失敗 + 找不到相機 + 噢,發生問題 + + 找不到相片 + 請允許存取外部存儲以選擇相片 + 請允許存取相機以拍攝相片 + 已達到最多選擇相片數量 + 沒有權限 + +