Merge "Only ripple rotate btn if attached to window" into pi-dev
This commit is contained in:
@@ -521,7 +521,7 @@ public class NavigationBarFragment extends Fragment implements Callbacks {
|
|||||||
|
|
||||||
// Clear any pending suggestion flag as it has either been nullified or is being shown
|
// Clear any pending suggestion flag as it has either been nullified or is being shown
|
||||||
mPendingRotationSuggestion = false;
|
mPendingRotationSuggestion = false;
|
||||||
getView().removeCallbacks(mCancelPendingRotationProposal);
|
if (getView() != null) getView().removeCallbacks(mCancelPendingRotationProposal);
|
||||||
|
|
||||||
// Handle the visibility change and animation
|
// Handle the visibility change and animation
|
||||||
if (visible) { // Appear and change (cannot force)
|
if (visible) { // Appear and change (cannot force)
|
||||||
@@ -1141,6 +1141,7 @@ public class NavigationBarFragment extends Fragment implements Callbacks {
|
|||||||
private final Runnable mRipple = new Runnable() {
|
private final Runnable mRipple = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() { // Cause the ripple to fire via false presses
|
public void run() { // Cause the ripple to fire via false presses
|
||||||
|
if (!mRoot.isAttachedToWindow()) return;
|
||||||
mRoot.setPressed(true);
|
mRoot.setPressed(true);
|
||||||
mRoot.setPressed(false);
|
mRoot.setPressed(false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user