mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
* no image found * old removed * new way * minor changes * reqeusted changes done
This commit is contained in:
parent
824a82ad2a
commit
c02d569468
3 changed files with 13 additions and 4 deletions
|
|
@ -19,6 +19,7 @@ import fr.free.nrw.commons.customselector.ui.adapter.FolderAdapter
|
|||
import fr.free.nrw.commons.di.CommonsDaggerSupportFragment
|
||||
import fr.free.nrw.commons.media.MediaClient
|
||||
import fr.free.nrw.commons.upload.FileProcessor
|
||||
import kotlinx.android.synthetic.main.fragment_custom_selector.*
|
||||
import kotlinx.android.synthetic.main.fragment_custom_selector.view.*
|
||||
import javax.inject.Inject
|
||||
|
||||
|
|
@ -111,6 +112,11 @@ class FolderFragment : CommonsDaggerSupportFragment() {
|
|||
*/
|
||||
private fun handleResult(result: Result) {
|
||||
if(result.status is CallbackStatus.SUCCESS){
|
||||
val images = result.images
|
||||
if(images.isNullOrEmpty())
|
||||
{
|
||||
empty_text.visibility = View.VISIBLE
|
||||
}
|
||||
folders = ImageHelper.folderListFromImages(result.images)
|
||||
folderAdapter.init(folders)
|
||||
folderAdapter.notifyDataSetChanged()
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import fr.free.nrw.commons.customselector.model.Result
|
|||
import fr.free.nrw.commons.customselector.ui.adapter.ImageAdapter
|
||||
import fr.free.nrw.commons.di.CommonsDaggerSupportFragment
|
||||
import fr.free.nrw.commons.theme.BaseActivity
|
||||
import kotlinx.android.synthetic.main.fragment_custom_selector.*
|
||||
import kotlinx.android.synthetic.main.fragment_custom_selector.view.*
|
||||
import java.io.File
|
||||
import java.io.FileInputStream
|
||||
|
|
@ -141,6 +142,7 @@ class ImageFragment: CommonsDaggerSupportFragment() {
|
|||
if(result.status is CallbackStatus.SUCCESS){
|
||||
val images = result.images
|
||||
if(images.isNotEmpty()) {
|
||||
empty_text.visibility = View.GONE
|
||||
filteredImages = ImageHelper.filterImages(images, bucketId)
|
||||
imageAdapter.init(filteredImages)
|
||||
selectorRV?.let {
|
||||
|
|
@ -152,6 +154,7 @@ class ImageFragment: CommonsDaggerSupportFragment() {
|
|||
}
|
||||
}
|
||||
else{
|
||||
empty_text.visibility = View.VISIBLE
|
||||
selectorRV?.let{
|
||||
it.visibility = View.GONE
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,14 +16,14 @@
|
|||
android:id="@+id/empty_text"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:textSize="@dimen/normal_text"
|
||||
android:textSize="20sp"
|
||||
android:padding="@dimen/standard_gap"
|
||||
android:text="@string/custom_selector_empty_text"
|
||||
android:text="@string/no_images_found"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<ProgressBar
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue