mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-11-03 16:23:54 +01:00
Added aprreciation text when pictures in album have been either uploaded or marked as not for upload."
This commit is contained in:
parent
04f9ef4819
commit
fd67890406
3 changed files with 23 additions and 0 deletions
|
|
@ -9,6 +9,7 @@ import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.ProgressBar
|
import android.widget.ProgressBar
|
||||||
import android.widget.Switch
|
import android.widget.Switch
|
||||||
|
import android.widget.TextView
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
|
|
@ -70,6 +71,7 @@ class ImageFragment : CommonsDaggerSupportFragment(), RefreshUIListener, PassDat
|
||||||
private var loader: ProgressBar? = null
|
private var loader: ProgressBar? = null
|
||||||
private var switch: Switch? = null
|
private var switch: Switch? = null
|
||||||
lateinit var filteredImages: ArrayList<Image>
|
lateinit var filteredImages: ArrayList<Image>
|
||||||
|
private var appreciationText : TextView? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores all images
|
* Stores all images
|
||||||
|
|
@ -203,6 +205,7 @@ class ImageFragment : CommonsDaggerSupportFragment(), RefreshUIListener, PassDat
|
||||||
handleResult(it)
|
handleResult(it)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
appreciationText = binding?.appreciationText
|
||||||
switch = binding?.switchWidget
|
switch = binding?.switchWidget
|
||||||
switch?.visibility = View.VISIBLE
|
switch?.visibility = View.VISIBLE
|
||||||
switch?.setOnCheckedChangeListener { _, isChecked -> onChangeSwitchState(isChecked) }
|
switch?.setOnCheckedChangeListener { _, isChecked -> onChangeSwitchState(isChecked) }
|
||||||
|
|
@ -228,6 +231,7 @@ class ImageFragment : CommonsDaggerSupportFragment(), RefreshUIListener, PassDat
|
||||||
private fun onChangeSwitchState(checked: Boolean) {
|
private fun onChangeSwitchState(checked: Boolean) {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
showAlreadyActionedImages = true
|
showAlreadyActionedImages = true
|
||||||
|
appreciationText?.visibility = View.GONE
|
||||||
val sharedPreferences: SharedPreferences =
|
val sharedPreferences: SharedPreferences =
|
||||||
requireContext().getSharedPreferences(CUSTOM_SELECTOR_PREFERENCE_KEY, MODE_PRIVATE)
|
requireContext().getSharedPreferences(CUSTOM_SELECTOR_PREFERENCE_KEY, MODE_PRIVATE)
|
||||||
val editor = sharedPreferences.edit()
|
val editor = sharedPreferences.edit()
|
||||||
|
|
@ -281,6 +285,10 @@ class ImageFragment : CommonsDaggerSupportFragment(), RefreshUIListener, PassDat
|
||||||
} else {
|
} else {
|
||||||
binding?.emptyText?.let {
|
binding?.emptyText?.let {
|
||||||
it.visibility = View.VISIBLE
|
it.visibility = View.VISIBLE
|
||||||
|
if (!showAlreadyActionedImages) {
|
||||||
|
appreciationText?.visibility = View.VISIBLE
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
selectorRV?.let {
|
selectorRV?.let {
|
||||||
it.visibility = View.GONE
|
it.visibility = View.GONE
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,18 @@
|
||||||
android:padding="@dimen/dimen_10"
|
android:padding="@dimen/dimen_10"
|
||||||
android:checked="true" />
|
android:checked="true" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/appreciationText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:text="@string/appreciation_text"/>
|
||||||
|
|
||||||
|
|
||||||
<com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
|
<com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
|
||||||
android:id="@+id/selector_rv"
|
android:id="@+id/selector_rv"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
||||||
|
|
@ -769,6 +769,9 @@ Upload your first media by tapping on the add button.</string>
|
||||||
<string name="marking_as_not_for_upload">Marking as not for upload</string>
|
<string name="marking_as_not_for_upload">Marking as not for upload</string>
|
||||||
<string name="unmarking_as_not_for_upload">Unmarking as not for upload</string>
|
<string name="unmarking_as_not_for_upload">Unmarking as not for upload</string>
|
||||||
<string name="show_already_actioned_pictures">Show already actioned pictures</string>
|
<string name="show_already_actioned_pictures">Show already actioned pictures</string>
|
||||||
|
<string name="appreciation_text">Good Job! \n All pictures have been either uploaded or marked as not for upload</string>
|
||||||
|
|
||||||
|
|
||||||
<string name="hiding_already_actioned_pictures">Hiding already actioned pictures</string>
|
<string name="hiding_already_actioned_pictures">Hiding already actioned pictures</string>
|
||||||
<string name="no_more_images_found">No more images found</string>
|
<string name="no_more_images_found">No more images found</string>
|
||||||
<string name="this_image_is_already_uploaded">This image is already uploaded</string>
|
<string name="this_image_is_already_uploaded">This image is already uploaded</string>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue