mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
[GSoC] Improvement and bug Fixes (#4522)
* Improvement and bug Fixes * fixed ellipsize
This commit is contained in:
parent
af3936ae16
commit
9b00c9417f
5 changed files with 58 additions and 49 deletions
|
|
@ -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<Image>) {
|
||||
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
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -4,16 +4,10 @@
|
|||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/toolbar_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
<include
|
||||
layout="@layout/custom_selector_toolbar"
|
||||
android:id="@+id/toolbar"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<include
|
||||
layout="@layout/custom_selector_toolbar"
|
||||
android:id="@+id/toolbar"
|
||||
/>
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/fragment_container"
|
||||
|
|
|
|||
|
|
@ -2,46 +2,55 @@
|
|||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/toolbar_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/back"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_centerVertical="true"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:padding="@dimen/standard_gap"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
app:srcCompat="?attr/custom_selector_back" />
|
||||
<ImageButton
|
||||
android:id="@+id/back"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_centerVertical="true"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:padding="@dimen/standard_gap"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
app:srcCompat="?attr/custom_selector_back"
|
||||
android:contentDescription="@string/back" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:textAlignment="center"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toEndOf="@id/back"
|
||||
app:layout_constraintEnd_toStartOf="@id/done"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:text="@string/custom_selector_title"
|
||||
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toEndOf="@id/back"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginHorizontal="@dimen/standard_gap"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="@string/custom_selector_title"
|
||||
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/done"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerVertical="true"
|
||||
android:clickable="true"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:focusable="true"
|
||||
android:padding="@dimen/standard_gap"
|
||||
app:srcCompat="?attr/custom_selector_done"/>
|
||||
<ImageButton
|
||||
android:id="@+id/done"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerVertical="true"
|
||||
android:clickable="true"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:focusable="true"
|
||||
android:padding="@dimen/standard_gap"
|
||||
app:srcCompat="?attr/custom_selector_done"
|
||||
android:visibility="invisible"
|
||||
android:contentDescription="@string/done" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</merge>
|
||||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -640,5 +640,7 @@ Upload your first media by tapping on the add button.</string>
|
|||
<string name="check_whether_location_is_correct">Check whether location is correct</string>
|
||||
<string name="custom_selector_title">Custom Selector</string>
|
||||
<string name="custom_selector_empty_text">No Images</string>
|
||||
<string name="done">Done</string>
|
||||
<string name="back">Back</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue