forked from organicmaps/organicmaps
[android] Added hidding the USE button if location is not determined
This commit is contained in:
parent
6b813fa9fc
commit
a49718f473
3 changed files with 21 additions and 5 deletions
|
@ -1945,6 +1945,10 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
{
|
||||
if (mNavMyPosition != null)
|
||||
mNavMyPosition.update(newMode);
|
||||
|
||||
RoutingController controller = RoutingController.get();
|
||||
if (controller.isPlanning())
|
||||
showAddStartOrFinishFrame(controller, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -177,12 +177,20 @@ final class RoutingBottomMenuController implements View.OnClickListener
|
|||
|
||||
void showAddStartFrame()
|
||||
{
|
||||
UiUtils.show(mActionFrame, mActionButton);
|
||||
UiUtils.show(mActionFrame);
|
||||
mActionMessage.setText(R.string.routing_add_start_point);
|
||||
Drawable icon = ContextCompat.getDrawable(mContext, R.drawable.ic_my_location);
|
||||
int colorAccent = ContextCompat.getColor(mContext,
|
||||
UiUtils.getStyledResourceId(mContext, R.attr.colorAccent));
|
||||
mActionIcon.setImageDrawable(Graphics.tint(icon, colorAccent));
|
||||
if (LocationHelper.INSTANCE.getMyPosition() != null)
|
||||
{
|
||||
UiUtils.show(mActionButton);
|
||||
Drawable icon = ContextCompat.getDrawable(mContext, R.drawable.ic_my_location);
|
||||
int colorAccent = ContextCompat.getColor(mContext,
|
||||
UiUtils.getStyledResourceId(mContext, R.attr.colorAccent));
|
||||
mActionIcon.setImageDrawable(Graphics.tint(icon, colorAccent));
|
||||
}
|
||||
else
|
||||
{
|
||||
UiUtils.hide(mActionButton);
|
||||
}
|
||||
}
|
||||
|
||||
void showAddFinishFrame()
|
||||
|
|
|
@ -667,6 +667,8 @@ public class RoutingController
|
|||
Framework.nativeAddRoutePoint("", RoutePointInfo.ROUTE_MARK_START, 0,
|
||||
MapObject.isOfType(MapObject.MY_POSITION, mStartPoint),
|
||||
mStartPoint.getLat(), mStartPoint.getLon());
|
||||
if (mContainer != null)
|
||||
mContainer.updateMenu();
|
||||
}
|
||||
|
||||
if (mEndPoint == null)
|
||||
|
@ -678,6 +680,8 @@ public class RoutingController
|
|||
Framework.nativeAddRoutePoint("", RoutePointInfo.ROUTE_MARK_FINISH, 0,
|
||||
MapObject.isOfType(MapObject.MY_POSITION, mEndPoint),
|
||||
mEndPoint.getLat(), mEndPoint.getLon());
|
||||
if (mContainer != null)
|
||||
mContainer.updateMenu();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue