diff options
author | orionlee <orionlee@yahoo.com> | 2019-04-04 15:30:00 -0700 |
---|---|---|
committer | orionlee <orionlee@yahoo.com> | 2019-04-06 11:12:34 -0700 |
commit | 46f7805a963f0d89cb1443105529d6cc804f2513 (patch) | |
tree | 4caa8b4547c5eca3e700af22d84346b40bf84791 | |
parent | b3fbf0b4aa6a7b51238f446f34f38a792ec81868 (diff) | |
download | AntennaPod-46f7805a963f0d89cb1443105529d6cc804f2513.zip |
refactor - bulk edit UI - make fab clickable on Pre-Lollipop devices without custom codes.
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java | 18 | ||||
-rw-r--r-- | app/src/main/res/layout/episodes_apply_action_fragment.xml | 20 |
2 files changed, 13 insertions, 25 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 355b97e75..612d6d608 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; @@ -221,28 +220,11 @@ public class EpisodesApplyActionFragment extends Fragment { } @Override - public void onStart() { - super.onStart(); - compatEnsureSpeedDialClickable(); - } - - @Override public void onStop() { restoreActionBarTitle(); // it might have been changed to "N selected". Restore original. super.onStop(); } - private void compatEnsureSpeedDialClickable() { - // On pre-Lollipop devices (that does not support elevation), - // need to explicitly bring the fab to the front, otherwise it won't be clickable. - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { - ViewGroup root = (ViewGroup)getView(); - root.bringChildToFront(root.findViewById(R.id.fabSDScrollCtr)); - root.requestLayout(); - root.invalidate(); - } - } - private void showSpeedDialIfAnyChecked() { mSpeedDialView.setVisibility(checkedIds.size() > 0 ? View.VISIBLE : View.GONE); } diff --git a/app/src/main/res/layout/episodes_apply_action_fragment.xml b/app/src/main/res/layout/episodes_apply_action_fragment.xml index 4ac9e25cf..9693d44d4 100644 --- a/app/src/main/res/layout/episodes_apply_action_fragment.xml +++ b/app/src/main/res/layout/episodes_apply_action_fragment.xml @@ -4,11 +4,24 @@ android:layout_width="match_parent" android:layout_height="match_parent"> + <ListView + android:id="@android:id/list" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_alignParentTop="true" + android:layout_marginTop="0dp" /> <com.leinardi.android.speeddial.SpeedDialOverlayLayout android:id="@+id/fabSDOverlay" android:layout_width="match_parent" android:layout_height="match_parent" /> + <!-- The FAB SpeedDial + 1. MUST be placed at the bottom of the layout xml to ensure it is at the front, + clickable on Pre-Lollipop devices (that do not support elevation). + See: https://stackoverflow.com/a/2614402 + 2. ScrollView is needed to ensure the vertical list of speed dials are + accessible when screen height is small, eg., landscape mode on most phones. + --> <ScrollView android:id="@+id/fabSDScrollCtr" android:layout_width="wrap_content" @@ -37,11 +50,4 @@ /> </ScrollView> - <ListView - android:id="@android:id/list" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_alignParentTop="true" - android:layout_marginTop="0dp" /> - </RelativeLayout> |