Replace if blocks with switch blocks
This commit is contained in:
parent
99ff2a3914
commit
2d173acc3f
2 changed files with 29 additions and 19 deletions
|
|
@ -81,13 +81,17 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
|
|||
public void onGlobalLayout() {
|
||||
slidingUpPanelLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
||||
|
||||
if (getPanelState() == SlidingUpPanelLayout.PanelState.EXPANDED) {
|
||||
onPanelSlide(slidingUpPanelLayout, 1);
|
||||
onPanelExpanded(slidingUpPanelLayout);
|
||||
} else if (getPanelState() == SlidingUpPanelLayout.PanelState.COLLAPSED) {
|
||||
onPanelCollapsed(slidingUpPanelLayout);
|
||||
} else {
|
||||
playerFragment.onHide();
|
||||
switch (getPanelState()) {
|
||||
case EXPANDED:
|
||||
onPanelSlide(slidingUpPanelLayout, 1);
|
||||
onPanelExpanded(slidingUpPanelLayout);
|
||||
break;
|
||||
case COLLAPSED:
|
||||
onPanelCollapsed(slidingUpPanelLayout);
|
||||
break;
|
||||
default:
|
||||
playerFragment.onHide();
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue