Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes Issue #5619: Add label "Congratulations, all pictures in this album have been either uploaded or marked as not for upload #5696

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import android.view.View
import android.view.ViewGroup
import android.widget.ProgressBar
import android.widget.Switch
import android.widget.TextView
import androidx.appcompat.app.AlertDialog
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.view.isVisible
Expand Down Expand Up @@ -82,6 +83,7 @@ class ImageFragment :
private var loader: ProgressBar? = null
private var switch: Switch? = null
lateinit var filteredImages: ArrayList<Image>
private var appreciationText : TextView? = null

/**
* Stores all images
Expand Down Expand Up @@ -226,6 +228,7 @@ class ImageFragment :
},
)

appreciationText = binding?.appreciationText
switch = binding?.switchWidget
switch?.visibility = View.VISIBLE
_switchState.value = switch?.isChecked ?: false
Expand Down Expand Up @@ -277,6 +280,7 @@ class ImageFragment :
private fun onChangeSwitchState(checked: Boolean) {
if (checked) {
showAlreadyActionedImages = true
appreciationText?.visibility = View.GONE
val sharedPreferences: SharedPreferences =
requireContext().getSharedPreferences(CUSTOM_SELECTOR_PREFERENCE_KEY, MODE_PRIVATE)
val editor = sharedPreferences.edit()
Expand Down Expand Up @@ -338,6 +342,10 @@ class ImageFragment :
allImages = filteredImages
binding?.emptyText?.let {
it.visibility = View.VISIBLE
if (!showAlreadyActionedImages) {
appreciationText?.visibility = View.VISIBLE

}
}
selectorRV?.let {
it.visibility = View.GONE
Expand Down
12 changes: 12 additions & 0 deletions app/src/main/res/layout/fragment_custom_selector.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@
android:padding="@dimen/dimen_10"
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
android:id="@+id/selector_rv"
android:layout_width="match_parent"
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,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="unmarking_as_not_for_upload">Unmarking as not for upload</string>
<string name="show_already_actioned_pictures">Show already actioned pictures</string>
<string name="appreciation_text">Good job!\nAll pictures of this album have been either uploaded or marked as not for upload.\nHow about going for a walk and taking pictures of nearby notable places?</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="this_image_is_already_uploaded">This image is already uploaded</string>
Expand Down