From cbe61a6815d2bfa6dfa8afeae9a879b380eadadc Mon Sep 17 00:00:00 2001 From: orionlee Date: Tue, 3 Sep 2019 11:50:23 -0700 Subject: [PATCH 1/3] #3374 fix batch edit FAB overlay remains when deselect all --- .../antennapod/dialog/EpisodesApplyActionFragment.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java index 1d4b62fc3..f6535d937 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java @@ -3,7 +3,6 @@ package de.danoeh.antennapod.dialog; import android.app.AlertDialog; import android.content.res.TypedArray; import android.graphics.drawable.Drawable; -import android.os.Build; import android.os.Bundle; import android.support.annotation.IdRes; import android.support.annotation.NonNull; @@ -13,7 +12,6 @@ import android.support.design.widget.Snackbar; import android.support.v4.app.ActivityCompat; import android.support.v4.app.Fragment; import android.support.v4.util.ArrayMap; -import android.support.v4.view.ViewCompat; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.util.Log; @@ -218,7 +216,11 @@ public class EpisodesApplyActionFragment extends Fragment { } private void showSpeedDialIfAnyChecked() { - mSpeedDialView.setVisibility(checkedIds.size() > 0 ? View.VISIBLE : View.GONE); + if (checkedIds.size() > 0) { + mSpeedDialView.show(); + } else { + mSpeedDialView.hide(); // hide() also handles UI, e.g., overlay properly. + } } @Override From 695698dbece287ef8b0e982ffc29a1b2c0f2118f Mon Sep 17 00:00:00 2001 From: orionlee Date: Tue, 3 Sep 2019 12:09:29 -0700 Subject: [PATCH 2/3] #3373 fix batch edit deselect all text label --- .../danoeh/antennapod/dialog/EpisodesApplyActionFragment.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java index f6535d937..744249a33 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java @@ -244,10 +244,13 @@ public class EpisodesApplyActionFragment extends Fragment { // Prepare icon for select toggle button int[] icon = new int[1]; + @StringRes int titleResId; if (checkedIds.size() == episodes.size()) { icon[0] = R.attr.ic_select_none; + titleResId = R.string.deselect_all_label; } else { icon[0] = R.attr.ic_select_all; + titleResId = R.string.select_all_label; } TypedArray a = getActivity().obtainStyledAttributes(icon); @@ -255,6 +258,7 @@ public class EpisodesApplyActionFragment extends Fragment { a.recycle(); mSelectToggle.setIcon(iconDrawable); + mSelectToggle.setTitle(titleResId); } @Override From 4497c952a90deb3267b145b6f69451747d21f5d2 Mon Sep 17 00:00:00 2001 From: orionlee Date: Tue, 3 Sep 2019 14:22:23 -0700 Subject: [PATCH 3/3] #3374 batch edit fab: avoid call show repeatedly for potential complication per review --- .../danoeh/antennapod/dialog/EpisodesApplyActionFragment.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java index 744249a33..ed35495fa 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java @@ -217,7 +217,9 @@ public class EpisodesApplyActionFragment extends Fragment { private void showSpeedDialIfAnyChecked() { if (checkedIds.size() > 0) { - mSpeedDialView.show(); + if (!mSpeedDialView.isShown()) { + mSpeedDialView.show(); + } } else { mSpeedDialView.hide(); // hide() also handles UI, e.g., overlay properly. }