[android] Fixed compass arrow for pp

This commit is contained in:
Александр Зацепин 2019-02-05 16:50:20 +03:00 committed by yoksnod
parent 6b570ab183
commit 638a537eb1

View file

@ -322,7 +322,7 @@ public class BottomSheetPlacePageController implements PlacePageController, Loca
@Override
public boolean isClosed()
{
return mPlacePageBehavior.getState() == AnchorBottomSheetBehavior.STATE_HIDDEN;
return isHiddenState(mPlacePageBehavior.getState());
}
@Override
@ -334,6 +334,9 @@ public class BottomSheetPlacePageController implements PlacePageController, Loca
@Override
public void onCompassUpdated(long time, double magneticNorth, double trueNorth, double accuracy)
{
if (isHiddenState(mPlacePageBehavior.getState()))
return;
double north = trueNorth >= 0.0 ? trueNorth : magneticNorth;
mPlacePage.refreshAzimuth(north);
}
@ -502,6 +505,11 @@ public class BottomSheetPlacePageController implements PlacePageController, Loca
return state == AnchorBottomSheetBehavior.STATE_EXPANDED;
}
private static boolean isHiddenState(@AnchorBottomSheetBehavior.State int state)
{
return state == AnchorBottomSheetBehavior.STATE_HIDDEN;
}
@Override
public boolean shouldShowBannerDetails()
{