Skip to content

Commit

Permalink
fix action icon not visiable on lollipop+
Browse files Browse the repository at this point in the history
  • Loading branch information
Wu Jing committed Jun 3, 2015
1 parent 27ecf07 commit 5299e8b
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import android.graphics.drawable.shapes.OvalShape;
import android.os.Build;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.view.ViewCompat;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.VelocityTracker;
Expand Down Expand Up @@ -158,8 +159,12 @@ public void setActionDrawable(Drawable actionDrawable) {
mFlyView = new ImageView(getContext());
mFlyView.setScaleType(ImageView.ScaleType.FIT_XY);
addView(mFlyView, new LayoutParams(ACTION_ICON_SIZE, ACTION_ICON_SIZE));
mFlyView.bringToFront();
float elevation = ViewCompat.getElevation(mActionView);
ViewCompat.setElevation(mFlyView, elevation + 1);
}
mFlyView.setImageDrawable(mActionDrawable);

} else {
if (mActionView != null) {
removeView(mActionView);
Expand Down

2 comments on commit 5299e8b

@rorschach
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you've fixed the bug two months ago, but when I use your library, the problem still occurs.
525857442986939048

@race604
Copy link
Owner

@race604 race604 commented on 5299e8b Aug 5, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have test this on my Android 5.0 device and Emulator, it works fine. Would you please provide more information? What device did you test on?

Please sign in to comment.