Skip to content

Commit 5299e8b

Browse files
author
Wu Jing
committed
fix action icon not visiable on lollipop+
1 parent 27ecf07 commit 5299e8b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

library/src/main/java/com/race604/flyrefresh/PullHeaderLayout.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import android.graphics.drawable.shapes.OvalShape;
1212
import android.os.Build;
1313
import android.support.design.widget.FloatingActionButton;
14+
import android.support.v4.view.ViewCompat;
1415
import android.util.AttributeSet;
1516
import android.view.MotionEvent;
1617
import android.view.VelocityTracker;
@@ -158,8 +159,12 @@ public void setActionDrawable(Drawable actionDrawable) {
158159
mFlyView = new ImageView(getContext());
159160
mFlyView.setScaleType(ImageView.ScaleType.FIT_XY);
160161
addView(mFlyView, new LayoutParams(ACTION_ICON_SIZE, ACTION_ICON_SIZE));
162+
mFlyView.bringToFront();
163+
float elevation = ViewCompat.getElevation(mActionView);
164+
ViewCompat.setElevation(mFlyView, elevation + 1);
161165
}
162166
mFlyView.setImageDrawable(mActionDrawable);
167+
163168
} else {
164169
if (mActionView != null) {
165170
removeView(mActionView);

0 commit comments

Comments
 (0)