From 9b00c9417ff23b4b68928158848d0845796fe948 Mon Sep 17 00:00:00 2001 From: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com> Date: Mon, 26 Jul 2021 16:31:45 +0530 Subject: [PATCH] [GSoC] Improvement and bug Fixes (#4522) * Improvement and bug Fixes * fixed ellipsize --- .../ui/selector/CustomSelectorActivity.kt | 5 +- .../res/layout/activity_custom_selector.xml | 14 +-- .../res/layout/custom_selector_toolbar.xml | 85 ++++++++++--------- .../res/layout/item_custom_selector_image.xml | 1 + app/src/main/res/values/strings.xml | 2 + 5 files changed, 58 insertions(+), 49 deletions(-) diff --git a/app/src/main/java/fr/free/nrw/commons/customselector/ui/selector/CustomSelectorActivity.kt b/app/src/main/java/fr/free/nrw/commons/customselector/ui/selector/CustomSelectorActivity.kt index 099c89a86..ec7855cb4 100644 --- a/app/src/main/java/fr/free/nrw/commons/customselector/ui/selector/CustomSelectorActivity.kt +++ b/app/src/main/java/fr/free/nrw/commons/customselector/ui/selector/CustomSelectorActivity.kt @@ -3,6 +3,7 @@ package fr.free.nrw.commons.customselector.ui.selector import android.app.Activity import android.content.Intent import android.os.Bundle +import android.view.View import android.widget.ImageButton import android.widget.TextView import androidx.lifecycle.ViewModelProvider @@ -96,7 +97,9 @@ class CustomSelectorActivity : BaseActivity(), FolderClickListener, ImageSelectL */ override fun onSelectedImagesChanged(selectedImages: ArrayList) { viewModel.selectedImages.value = selectedImages - // todo update selected images in view model. + + val done : ImageButton = findViewById(R.id.done) + done.visibility = if (selectedImages.isEmpty()) View.INVISIBLE else View.VISIBLE } /** diff --git a/app/src/main/res/layout/activity_custom_selector.xml b/app/src/main/res/layout/activity_custom_selector.xml index 9587e7c0a..d96918fee 100644 --- a/app/src/main/res/layout/activity_custom_selector.xml +++ b/app/src/main/res/layout/activity_custom_selector.xml @@ -4,16 +4,10 @@ android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto"> - - - + + - + + - - - + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_custom_selector_image.xml b/app/src/main/res/layout/item_custom_selector_image.xml index 021f463bc..f04a71922 100644 --- a/app/src/main/res/layout/item_custom_selector_image.xml +++ b/app/src/main/res/layout/item_custom_selector_image.xml @@ -40,6 +40,7 @@ app:layout_constraintDimensionRatio="H,1:1" android:textSize="11sp" android:textStyle="bold" + android:textColor="@color/black" android:layout_margin="@dimen/dimen_6" android:gravity="center|center_vertical" style="@style/TextAppearance.AppCompat.Small" diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ab91a42e0..5419803ed 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -640,5 +640,7 @@ Upload your first media by tapping on the add button. Check whether location is correct Custom Selector No Images + Done + Back