forked from organicmaps/organicmaps
[android] Changed request codes, changed prepare
This commit is contained in:
parent
3ffcf8cf50
commit
a954d3a337
4 changed files with 6 additions and 6 deletions
|
@ -2266,7 +2266,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
@Override
|
||||
public void onAlertDialogPositiveClick(int requestCode, int which)
|
||||
{
|
||||
if (requestCode == REQ_CODE_DRIVING_OPTIONS)
|
||||
if (requestCode == REQ_CODE_ERROR_CALCULATE_ROUTE_FIRST_TIME)
|
||||
DrivingOptionsActivity.start(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -449,7 +449,7 @@ public class RoutingController implements TaxiManager.TaxiListener
|
|||
|
||||
public void prepare(@Nullable MapObject startPoint, @Nullable MapObject endPoint)
|
||||
{
|
||||
prepare(startPoint == null ? LocationHelper.INSTANCE.getMyPosition() : startPoint, endPoint, false);
|
||||
prepare(startPoint, endPoint, false);
|
||||
}
|
||||
|
||||
public void prepare(@Nullable MapObject startPoint, @Nullable MapObject endPoint, boolean fromApi)
|
||||
|
|
|
@ -346,7 +346,7 @@ public class RoutingPlanController extends ToolbarController
|
|||
{
|
||||
mDrivingOptionsBtnContainer.addOnLayoutChangeListener(mDriverOptionsLayoutListener);
|
||||
UiUtils.show(mDrivingOptionsBtnContainer);
|
||||
View image = getToolbar().findViewById(R.id.driving_options_btn_img);
|
||||
View image = getActivity().findViewById(R.id.driving_options_btn_img);
|
||||
UiUtils.showIf(RoutingOptions.hasAnyOptions(), image);
|
||||
TextView title = mDrivingOptionsBtnContainer.findViewById(R.id.driving_options_btn_title);
|
||||
title.setText(RoutingOptions.hasAnyOptions() ? R.string.change_driving_options_btn
|
||||
|
|
|
@ -69,7 +69,7 @@ public class DrivingOptionsFragment extends BaseMwmToolbarFragment
|
|||
outState.putIntegerArrayList(BUNDLE_ROAD_TYPES, savedRoadTypes);
|
||||
}
|
||||
|
||||
private boolean isSameSettingsBeforeAndAfter()
|
||||
private boolean areSettingsNotChanged()
|
||||
{
|
||||
Set<RoadType> lastActiveRoadTypes = RoutingOptions.getActiveRoadTypes();
|
||||
return mRoadTypes.containsAll(lastActiveRoadTypes) && lastActiveRoadTypes.containsAll(mRoadTypes);
|
||||
|
@ -95,8 +95,8 @@ public class DrivingOptionsFragment extends BaseMwmToolbarFragment
|
|||
{
|
||||
if (item.getItemId() == R.id.done)
|
||||
{
|
||||
requireActivity().setResult(isSameSettingsBeforeAndAfter() ? Activity.RESULT_CANCELED
|
||||
: Activity.RESULT_OK);
|
||||
requireActivity().setResult(areSettingsNotChanged() ? Activity.RESULT_CANCELED
|
||||
: Activity.RESULT_OK);
|
||||
requireActivity().finish();
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue