mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
Use switch case instead of if-else
This commit is contained in:
parent
d993ee8110
commit
693ddef897
1 changed files with 21 additions and 20 deletions
|
|
@ -297,27 +297,28 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void prepareViewsForSheetPosition(int bottomSheetState) {
|
public void prepareViewsForSheetPosition(int bottomSheetState) {
|
||||||
if (bottomSheetState == BottomSheetBehavior.STATE_COLLAPSED) {
|
|
||||||
if (!fabList.isShown()) fabList.show();
|
switch (bottomSheetState) {
|
||||||
closeFabs(isFabOpen);
|
case (BottomSheetBehavior.STATE_COLLAPSED):
|
||||||
if (!fabPlus.isShown()) showFAB();
|
if (!fabList.isShown()) fabList.show();
|
||||||
this.getView().requestFocus();
|
closeFabs(isFabOpen);
|
||||||
moreInfo.setVisibility(View.VISIBLE);
|
if (!fabPlus.isShown()) showFAB();
|
||||||
//NearbyActivity.bottomSheetStatus = NearbyActivity.BottomSheetStatus.DISPLAY_DETAILS_SHEET_COLLAPSED;
|
this.getView().requestFocus();
|
||||||
|
moreInfo.setVisibility(View.VISIBLE);
|
||||||
|
break;
|
||||||
|
case (BottomSheetBehavior.STATE_EXPANDED):
|
||||||
|
if (fabList.isShown()) fabList.hide();
|
||||||
|
this.getView().requestFocus();
|
||||||
|
moreInfo.setVisibility(View.VISIBLE);
|
||||||
|
break;
|
||||||
|
case (BottomSheetBehavior.STATE_HIDDEN):
|
||||||
|
closeFabs(isFabOpen);
|
||||||
|
hideFAB();
|
||||||
|
moreInfo.setVisibility(View.GONE);
|
||||||
|
this.getView().clearFocus();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else if (bottomSheetState == BottomSheetBehavior.STATE_EXPANDED) {
|
|
||||||
if (fabList.isShown()) fabList.hide();
|
|
||||||
this.getView().requestFocus();
|
|
||||||
moreInfo.setVisibility(View.VISIBLE);
|
|
||||||
//NearbyActivity.bottomSheetStatus = NearbyActivity.BottomSheetStatus.DISPLAY_DETAILS_SHEET_EXPANDED;
|
|
||||||
}
|
|
||||||
else if (bottomSheetState == BottomSheetBehavior.STATE_HIDDEN) {
|
|
||||||
closeFabs(isFabOpen);
|
|
||||||
hideFAB();
|
|
||||||
moreInfo.setVisibility(View.GONE);
|
|
||||||
this.getView().clearFocus();
|
|
||||||
}
|
|
||||||
//currBottomSheetState = bottomSheetState;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void hideFAB() {
|
private void hideFAB() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue