diff --git a/android/res/values/attrs.xml b/android/res/values/attrs.xml
index f3503e537d..1171ef3e61 100644
--- a/android/res/values/attrs.xml
+++ b/android/res/values/attrs.xml
@@ -81,4 +81,7 @@
+
+
+
diff --git a/android/res/values/themes-base.xml b/android/res/values/themes-base.xml
index 29899248af..9ae05466ad 100644
--- a/android/res/values/themes-base.xml
+++ b/android/res/values/themes-base.xml
@@ -127,6 +127,8 @@
- @drawable/ic_ad_light
- @drawable/ic_deal_light
- @drawable/bg_subway_light
+ - @drawable/ic_traffic_menu_light_off
+ - @drawable/ic_subway_menu_light_off
@@ -257,5 +259,7 @@
- @drawable/ic_ad_dark
- @drawable/ic_deal_dark
- @drawable/bg_subway_night
+ - @drawable/ic_traffic_menu_dark_off
+ - @drawable/ic_subway_menu_dark_off
diff --git a/android/src/com/mapswithme/maps/MwmActivity.java b/android/src/com/mapswithme/maps/MwmActivity.java
index 030c388480..919a69e46a 100644
--- a/android/src/com/mapswithme/maps/MwmActivity.java
+++ b/android/src/com/mapswithme/maps/MwmActivity.java
@@ -45,6 +45,7 @@ import com.mapswithme.maps.bookmarks.BookmarkCategoriesActivity;
import com.mapswithme.maps.bookmarks.data.BookmarkManager;
import com.mapswithme.maps.bookmarks.data.FeatureId;
import com.mapswithme.maps.bookmarks.data.MapObject;
+import com.mapswithme.maps.maplayer.MapLayerCompositeController;
import com.mapswithme.maps.discovery.DiscoveryActivity;
import com.mapswithme.maps.discovery.DiscoveryFragment;
import com.mapswithme.maps.discovery.ItemType;
@@ -81,15 +82,13 @@ import com.mapswithme.maps.settings.SettingsActivity;
import com.mapswithme.maps.settings.StoragePathManager;
import com.mapswithme.maps.settings.UnitLocale;
import com.mapswithme.maps.sound.TtsPlayer;
-import com.mapswithme.maps.subway.OnSubwayModeSelectListener;
-import com.mapswithme.maps.subway.SubwayManager;
-import com.mapswithme.maps.subway.ToggleMapLayerDialog;
+import com.mapswithme.maps.maplayer.Mode;
+import com.mapswithme.maps.maplayer.subway.OnSubwayModeSelectListener;
import com.mapswithme.maps.taxi.TaxiInfo;
import com.mapswithme.maps.taxi.TaxiManager;
-import com.mapswithme.maps.traffic.TrafficManager;
-import com.mapswithme.maps.traffic.widget.OnTrafficModeSelectListener;
-import com.mapswithme.maps.traffic.widget.TrafficButton;
-import com.mapswithme.maps.traffic.widget.TrafficButtonController;
+import com.mapswithme.maps.maplayer.traffic.TrafficManager;
+import com.mapswithme.maps.maplayer.traffic.widget.OnTrafficModeSelectListener;
+import com.mapswithme.maps.maplayer.traffic.widget.TrafficButton;
import com.mapswithme.maps.widget.FadeView;
import com.mapswithme.maps.widget.menu.BaseMenu;
import com.mapswithme.maps.widget.menu.MainMenu;
@@ -182,10 +181,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
@NonNull
private View mPositionChooser;
- @SuppressWarnings("NullableProblems")
- @NonNull
- private ImageButton mSubwayBtn;
-
private RoutingPlanInplaceController mRoutingPlanInplaceController;
@Nullable
@@ -199,12 +194,11 @@ public class MwmActivity extends BaseMwmFragmentActivity
@Nullable
private MyPositionButton mNavMyPosition;
- private TrafficButton mTraffic;
@Nullable
private NavigationButtonsAnimationController mNavAnimationController;
- @Nullable
- private TrafficButtonController mTrafficButtonController;
-
+ @SuppressWarnings("NullableProblems")
+ @NonNull
+ private MapLayerCompositeController mToggleMapLayerController;
@Nullable
private SearchFilterController mFilterController;
@@ -234,42 +228,13 @@ public class MwmActivity extends BaseMwmFragmentActivity
@Override
public void onSubwayModeSelected()
{
- if (isOptionalMapLayerEnabled())
- {
- mTraffic.hideImmediately();
- mSubwayBtn.setVisibility(View.VISIBLE);
- mSubwayBtn.setSelected(true);
- return;
- }
- onResetOptionalMapLayers();
+ mToggleMapLayerController.toggleMode(Mode.SUBWAY);
}
@Override
public void onTrafficModeSelected()
{
- if (isOptionalMapLayerEnabled())
- {
- mTraffic.showImmediately();
- mSubwayBtn.setSelected(false);
- mSubwayBtn.setVisibility(View.GONE);
- return;
- }
- onResetOptionalMapLayers();
- }
-
- private void onResetOptionalMapLayers()
- {
- SubwayManager.from(getApplicationContext()).setEnabled(false);
- TrafficManager.INSTANCE.setEnabled(false);
- mTraffic.hideImmediately();
- mSubwayBtn.setVisibility(View.VISIBLE);
- mSubwayBtn.setSelected(false);
- }
-
- private boolean isOptionalMapLayerEnabled()
- {
- return SubwayManager.from(getApplicationContext()).isEnabled()
- || TrafficManager.INSTANCE.isEnabled();
+ mToggleMapLayerController.toggleMode(Mode.TRAFFIC);
}
public interface LeftAnimationTrackListener
@@ -768,33 +733,17 @@ public class MwmActivity extends BaseMwmFragmentActivity
View myPosition = frame.findViewById(R.id.my_position);
mNavMyPosition = new MyPositionButton(myPosition, mOnMyPositionClickListener);
- initToggleMapLayerBtn(frame);
+ initToggleMapLayerController(frame);
mNavAnimationController = new NavigationButtonsAnimationController(
zoomIn, zoomOut, myPosition, getWindow().getDecorView().getRootView(), this);
}
- private void initToggleMapLayerBtn(@NonNull View frame)
- {
- initTrafficBtn(frame);
- initSubwayBtn(frame);
- showToggleMapLayerBtn();
- }
-
- private void initTrafficBtn(@NonNull View frame)
+ private void initToggleMapLayerController(@NonNull View frame)
{
ImageButton trafficBtn = frame.findViewById(R.id.traffic);
- trafficBtn.setOnClickListener(new OpenBottomDialogClickListener());
- mTraffic = new TrafficButton(trafficBtn);
- mTrafficButtonController = new TrafficButtonController(mTraffic, this);
- }
-
- private void initSubwayBtn(@NonNull View frame)
- {
- mSubwayBtn = frame.findViewById(R.id.subway);
- SubwayManager subway = SubwayManager.from(this);
- mSubwayBtn.setSelected(subway.isEnabled());
- mSubwayBtn.setOnClickListener(new OpenBottomDialogClickListener());
- UiUtils.addStatusBarOffset(mSubwayBtn);
+ TrafficButton traffic = new TrafficButton(trafficBtn);
+ View subway = frame.findViewById(R.id.subway);
+ mToggleMapLayerController = new MapLayerCompositeController(traffic, subway, this);
}
public boolean closePlacePage()
@@ -1421,8 +1370,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
RoutingController.get().attach(this);
if (MapFragment.nativeIsEngineCreated())
LocationHelper.INSTANCE.attach(this);
- if (mTrafficButtonController != null)
- TrafficManager.INSTANCE.attach(mTrafficButtonController);
+ mToggleMapLayerController.attachCore();
if (mNavigationController != null)
TrafficManager.INSTANCE.attach(mNavigationController);
mPlacePage.onActivityStarted();
@@ -1437,8 +1385,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
LocationHelper.INSTANCE.detach(!isFinishing());
RoutingController.get().detach();
TrafficManager.INSTANCE.detachAll();
- if (mTrafficButtonController != null)
- mTrafficButtonController.destroy();
+ mToggleMapLayerController.detachCore();
mPlacePage.onActivityStopped();
}
@@ -1633,7 +1580,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
mNavAnimationController.disappearZoomButtons();
if (mNavMyPosition != null)
mNavMyPosition.hide();
- mTraffic.hide();
+ mToggleMapLayerController.hide();
}
else
{
@@ -1650,7 +1597,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
{
appearMenuFrame(menu);
showNavMyPositionBtn();
- showToggleMapLayerBtn();
+ mToggleMapLayerController.applyLastActiveMode();
}
private void showNavMyPositionBtn()
@@ -1671,26 +1618,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
});
}
- private void showToggleMapLayerBtn()
- {
- if (TrafficManager.INSTANCE.isEnabled())
- showTrafficBtn();
- else
- showSubwayBtn();
- }
-
- private void showSubwayBtn()
- {
- Animations.appearSliding(mSubwayBtn, Animations.LEFT, null);
- mTraffic.hideImmediately();
- }
-
- private void showTrafficBtn()
- {
- mTraffic.show();
- mSubwayBtn.setVisibility(View.GONE);
- }
-
@Override
public void onPreviewVisibilityChanged(boolean isVisible)
{
@@ -2171,7 +2098,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
private void adjustTraffic(int offsetX, int offsetY)
{
- mTraffic.setOffset(offsetX, offsetY);
+ mToggleMapLayerController.adjust(offsetX, offsetY);
}
@Override
@@ -2390,7 +2317,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
&& (RoutingController.get().isPlanning() || RoutingController.get().isNavigating()))
{
if (UiUtils.isLandscape(this))
- mTraffic.hide();
+ mToggleMapLayerController.hide();
else
mNavigationController.fadeOutSearchButtons();
}
@@ -2730,18 +2657,4 @@ public class MwmActivity extends BaseMwmFragmentActivity
myPositionClick();
}
}
-
- private class OpenBottomDialogClickListener implements View.OnClickListener
- {
- @Override
- public void onClick(View v)
- {
- if (isOptionalMapLayerEnabled())
- {
- onResetOptionalMapLayers();
- return;
- }
- ToggleMapLayerDialog.show(MwmActivity.this);
- }
- }
}
diff --git a/android/src/com/mapswithme/maps/MwmApplication.java b/android/src/com/mapswithme/maps/MwmApplication.java
index ba03b67d75..555ecd9219 100644
--- a/android/src/com/mapswithme/maps/MwmApplication.java
+++ b/android/src/com/mapswithme/maps/MwmApplication.java
@@ -25,8 +25,8 @@ import com.mapswithme.maps.location.LocationHelper;
import com.mapswithme.maps.location.TrackRecorder;
import com.mapswithme.maps.routing.RoutingController;
import com.mapswithme.maps.sound.TtsPlayer;
-import com.mapswithme.maps.subway.SubwayManager;
-import com.mapswithme.maps.traffic.TrafficManager;
+import com.mapswithme.maps.maplayer.subway.SubwayManager;
+import com.mapswithme.maps.maplayer.traffic.TrafficManager;
import com.mapswithme.maps.ugc.UGC;
import com.mapswithme.util.Config;
import com.mapswithme.util.Counters;
@@ -301,6 +301,7 @@ public class MwmApplication extends Application
LocationHelper.INSTANCE.initialize();
RoutingController.get().initialize();
TrafficManager.INSTANCE.initialize();
+ SubwayManager.from(this).initialize();
mFrameworkInitialized = true;
}
diff --git a/android/src/com/mapswithme/maps/content/CoreDetachable.java b/android/src/com/mapswithme/maps/content/CoreDetachable.java
new file mode 100644
index 0000000000..eabdf9e92f
--- /dev/null
+++ b/android/src/com/mapswithme/maps/content/CoreDetachable.java
@@ -0,0 +1,7 @@
+package com.mapswithme.maps.content;
+
+public interface CoreDetachable
+{
+ void attachCore();
+ void detachCore();
+}
diff --git a/android/src/com/mapswithme/maps/adapter/BottomSheetItem.java b/android/src/com/mapswithme/maps/maplayer/BottomSheetItem.java
similarity index 61%
rename from android/src/com/mapswithme/maps/adapter/BottomSheetItem.java
rename to android/src/com/mapswithme/maps/maplayer/BottomSheetItem.java
index 36429d3f36..ccbfb67c70 100644
--- a/android/src/com/mapswithme/maps/adapter/BottomSheetItem.java
+++ b/android/src/com/mapswithme/maps/maplayer/BottomSheetItem.java
@@ -1,25 +1,28 @@
-package com.mapswithme.maps.adapter;
+package com.mapswithme.maps.maplayer;
+import android.content.Context;
import android.support.annotation.DrawableRes;
import android.support.annotation.NonNull;
import android.support.annotation.StringRes;
import com.mapswithme.maps.R;
-import com.mapswithme.maps.subway.Mode;
import com.mapswithme.util.ThemeUtils;
public abstract class BottomSheetItem
{
+ @DrawableRes
private final int mEnabledStateDrawableResId;
+ @DrawableRes
private final int mDisabledStateDrawableResId;
+ @StringRes
private final int mTitleResId;
@NonNull
private final Mode mMode;
- protected BottomSheetItem(int enabledStateDrawableResId,
- int disabledStateDrawableResId,
- int titleResId,
- @NonNull Mode mode)
+ BottomSheetItem(@DrawableRes int enabledStateDrawableResId,
+ @DrawableRes int disabledStateDrawableResId,
+ @StringRes int titleResId,
+ @NonNull Mode mode)
{
mEnabledStateDrawableResId = enabledStateDrawableResId;
mDisabledStateDrawableResId = disabledStateDrawableResId;
@@ -32,12 +35,6 @@ public abstract class BottomSheetItem
{
return mMode;
}
-/*
-
- boolean isSelected(@NonNull Context context);
-
- void onSelected(@NonNull MwmActivity activity);
-*/
@DrawableRes
public int getEnabledStateDrawable()
@@ -64,22 +61,13 @@ public abstract class BottomSheetItem
super(drawableResId, disabledStateDrawableResId, R.string.button_layer_subway, Mode.SUBWAY);
}
- public static BottomSheetItem makeInstance()
+ public static BottomSheetItem makeInstance(@NonNull Context mContext)
{
- int disabled = getDisabledStateFromTheme(R.drawable.ic_subway_menu_dark_off,
- R.drawable.ic_subway_menu_light_off);
-
+ int disabled = ThemeUtils.getResource(mContext, R.attr.subwayMenuDisabled);
return new Subway(R.drawable.ic_subway_menu_on, disabled);
}
}
- private static int getDisabledStateFromTheme(int light, int dark)
- {
- return ThemeUtils.isNightTheme()
- ? light
- : dark;
- }
-
public static class Traffic extends BottomSheetItem
{
private Traffic(int drawableResId, int disabledStateDrawableResId)
@@ -87,14 +75,11 @@ public abstract class BottomSheetItem
super(drawableResId, disabledStateDrawableResId, R.string.button_layer_traffic, Mode.TRAFFIC);
}
- public static BottomSheetItem makeInstance()
+ public static BottomSheetItem makeInstance(@NonNull Context mContext)
{
- int disabled = getDisabledStateFromTheme(R.drawable.ic_traffic_menu_dark_off,
- R.drawable.ic_traffic_menu_light_off);
+ int disabled = ThemeUtils.getResource(mContext, R.attr.trafficMenuDisabled);
return new Traffic(R.drawable.ic_traffic_menu_on, disabled);
}
}
-
-
}
diff --git a/android/src/com/mapswithme/maps/maplayer/MapLayerCompositeController.java b/android/src/com/mapswithme/maps/maplayer/MapLayerCompositeController.java
new file mode 100644
index 0000000000..1a3a3c07b1
--- /dev/null
+++ b/android/src/com/mapswithme/maps/maplayer/MapLayerCompositeController.java
@@ -0,0 +1,225 @@
+package com.mapswithme.maps.maplayer;
+
+import android.support.annotation.NonNull;
+import android.support.v7.app.AppCompatActivity;
+import android.view.View;
+
+import com.mapswithme.maps.maplayer.subway.SubwayMapLayerController;
+import com.mapswithme.maps.maplayer.traffic.widget.TrafficButton;
+import com.mapswithme.maps.maplayer.traffic.widget.TrafficButtonController;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+public class MapLayerCompositeController implements MapLayerController
+{
+ @NonNull
+ private final AppCompatActivity mActivity;
+ @NonNull
+ private final Collection mChildrenEntries;
+ @NonNull
+ private ControllerAndMode mMasterEntry;
+
+ public MapLayerCompositeController(@NonNull TrafficButton traffic, @NonNull View subway,
+ @NonNull AppCompatActivity activity)
+ {
+ OpenBottomDialogClickListener listener = new OpenBottomDialogClickListener();
+ mActivity = activity;
+ mChildrenEntries = createEntries(traffic, subway, activity, listener);
+ mMasterEntry = getCurrentLayer();
+ toggleMode(mMasterEntry.mMode);
+ }
+
+ @NonNull
+ private static Collection createEntries(@NonNull TrafficButton traffic,
+ @NonNull View subway,
+ @NonNull AppCompatActivity activity,
+ @NonNull OpenBottomDialogClickListener dialogClickListener)
+ {
+ traffic.setOnclickListener(dialogClickListener);
+ TrafficButtonController trafficButtonController = new TrafficButtonController(traffic,
+ activity);
+ subway.setOnClickListener(dialogClickListener);
+ SubwayMapLayerController subwayMapLayerController = new SubwayMapLayerController(subway);
+
+ ControllerAndMode subwayPair = new ControllerAndMode(Mode.SUBWAY, subwayMapLayerController);
+ ControllerAndMode trafficPair = new ControllerAndMode(Mode.TRAFFIC, trafficButtonController);
+ Set entries = new LinkedHashSet<>();
+ entries.add(subwayPair);
+ entries.add(trafficPair);
+ return Collections.unmodifiableSet(entries);
+ }
+
+ public void toggleMode(@NonNull Mode mode)
+ {
+ toggleMode(mode, false);
+ }
+
+ public void toggleMode(@NonNull Mode mode, boolean animate)
+ {
+ setMasterController(mode);
+ showMasterController(animate);
+
+ boolean enabled = mode.isEnabled(mActivity);
+ if (enabled)
+ turnOn();
+ else
+ turnOff();
+ }
+
+ public void applyLastActiveMode()
+ {
+ toggleMode(mMasterEntry.mMode, true);
+ }
+
+ @Override
+ public void attachCore()
+ {
+ for (ControllerAndMode each : mChildrenEntries)
+ {
+ each.mController.attachCore();
+ }
+ }
+
+ @Override
+ public void detachCore()
+ {
+ for (ControllerAndMode each : mChildrenEntries)
+ {
+ each.mController.detachCore();
+ }
+ }
+
+ private void setMasterController(@NonNull Mode mode)
+ {
+ for (ControllerAndMode each : mChildrenEntries)
+ {
+ if (each.mMode == mode)
+ {
+ mMasterEntry = each;
+ }
+ else
+ {
+ each.mController.hideImmediately();
+ each.mMode.setEnabled(mActivity, false);
+ }
+ }
+ }
+
+ private void showMasterController(boolean animate)
+ {
+ if (animate)
+ mMasterEntry.mController.show();
+ else
+ mMasterEntry.mController.showImmediately();
+ }
+
+ @NonNull
+ private ControllerAndMode getCurrentLayer()
+ {
+ for (ControllerAndMode each : mChildrenEntries)
+ {
+ if (each.mMode.isEnabled(mActivity))
+ return each;
+ }
+
+ return mChildrenEntries.iterator().next();
+ }
+
+ @Override
+ public void turnOn()
+ {
+ mMasterEntry.mController.turnOn();
+ mMasterEntry.mMode.setEnabled(mActivity, true);
+ }
+
+ @Override
+ public void turnOff()
+ {
+ mMasterEntry.mController.turnOff();
+ mMasterEntry.mMode.setEnabled(mActivity, false);
+ }
+
+ @Override
+ public void show()
+ {
+ mMasterEntry.mController.show();
+ }
+
+ @Override
+ public void showImmediately()
+ {
+ mMasterEntry.mController.showImmediately();
+ }
+
+ @Override
+ public void hide()
+ {
+ mMasterEntry.mController.hide();
+ }
+
+ @Override
+ public void hideImmediately()
+ {
+ mMasterEntry.mController.hideImmediately();
+ }
+
+ @Override
+ public void adjust(int offsetX, int offsetY)
+ {
+ mMasterEntry.mController.adjust(offsetX, offsetY);
+ }
+
+ private void showDialog()
+ {
+ ToggleMapLayerDialog.show(mActivity);
+ }
+
+ private static class ControllerAndMode
+ {
+ @NonNull
+ private final Mode mMode;
+ @NonNull
+ private final MapLayerController mController;
+
+ ControllerAndMode(@NonNull Mode mode, @NonNull MapLayerController controller)
+ {
+ mMode = mode;
+ mController = controller;
+ }
+
+ @Override
+ public boolean equals(Object o)
+ {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ ControllerAndMode that = (ControllerAndMode) o;
+ return mMode == that.mMode;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return mMode.hashCode();
+ }
+ }
+
+ private class OpenBottomDialogClickListener implements View.OnClickListener
+ {
+ @Override
+ public void onClick(View v)
+ {
+ if (mMasterEntry.mMode.isEnabled(mActivity))
+ {
+ turnOff();
+ toggleMode(getCurrentLayer().mMode);
+ }
+ else
+ {
+ showDialog();
+ }
+ }
+ }
+}
diff --git a/android/src/com/mapswithme/maps/maplayer/MapLayerController.java b/android/src/com/mapswithme/maps/maplayer/MapLayerController.java
new file mode 100644
index 0000000000..07fe30b4dd
--- /dev/null
+++ b/android/src/com/mapswithme/maps/maplayer/MapLayerController.java
@@ -0,0 +1,14 @@
+package com.mapswithme.maps.maplayer;
+
+import com.mapswithme.maps.content.CoreDetachable;
+
+public interface MapLayerController extends CoreDetachable
+{
+ void turnOn();
+ void turnOff();
+ void show();
+ void showImmediately();
+ void hide();
+ void hideImmediately();
+ void adjust(int offsetX, int offsetY);
+}
diff --git a/android/src/com/mapswithme/maps/maplayer/Mode.java b/android/src/com/mapswithme/maps/maplayer/Mode.java
new file mode 100644
index 0000000000..e0db7b281c
--- /dev/null
+++ b/android/src/com/mapswithme/maps/maplayer/Mode.java
@@ -0,0 +1,60 @@
+package com.mapswithme.maps.maplayer;
+
+import android.content.Context;
+import android.support.annotation.NonNull;
+
+import com.mapswithme.maps.maplayer.subway.SubwayManager;
+import com.mapswithme.maps.maplayer.traffic.TrafficManager;
+
+public enum Mode
+{
+ TRAFFIC
+ {
+ @Override
+ public boolean isEnabled(@NonNull Context context)
+ {
+ return !SubwayManager.from(context).isEnabled()
+ && TrafficManager.INSTANCE.isEnabled();
+ }
+
+ @Override
+ public void setEnabled(@NonNull Context context, boolean isEnabled)
+ {
+ TrafficManager.INSTANCE.setEnabled(isEnabled);
+ }
+
+ @Override
+ public void toggle(@NonNull Context context)
+ {
+ TrafficManager.INSTANCE.toggle();
+ SubwayManager.from(context).setEnabled(false);
+ }
+ },
+ SUBWAY
+ {
+ @Override
+ public boolean isEnabled(@NonNull Context context)
+ {
+ return SubwayManager.from(context).isEnabled();
+ }
+
+ @Override
+ public void setEnabled(@NonNull Context context, boolean isEnabled)
+ {
+ SubwayManager.from(context).setEnabled(isEnabled);
+ }
+
+ @Override
+ public void toggle(@NonNull Context context)
+ {
+ SubwayManager.from(context).toggle();
+ TrafficManager.INSTANCE.setEnabled(false);
+ }
+ };
+
+ public abstract boolean isEnabled(@NonNull Context context);
+
+ public abstract void setEnabled(@NonNull Context context, boolean isEnabled);
+
+ public abstract void toggle(@NonNull Context context);
+}
diff --git a/android/src/com/mapswithme/maps/subway/ToggleMapLayerDialog.java b/android/src/com/mapswithme/maps/maplayer/ToggleMapLayerDialog.java
similarity index 86%
rename from android/src/com/mapswithme/maps/subway/ToggleMapLayerDialog.java
rename to android/src/com/mapswithme/maps/maplayer/ToggleMapLayerDialog.java
index 08e006e701..b29d93fda2 100644
--- a/android/src/com/mapswithme/maps/subway/ToggleMapLayerDialog.java
+++ b/android/src/com/mapswithme/maps/maplayer/ToggleMapLayerDialog.java
@@ -1,4 +1,4 @@
-package com.mapswithme.maps.subway;
+package com.mapswithme.maps.maplayer;
import android.app.Dialog;
import android.content.Context;
@@ -20,10 +20,10 @@ import android.widget.ImageButton;
import android.widget.TextView;
import com.mapswithme.maps.R;
-import com.mapswithme.maps.adapter.BottomSheetItem;
-import com.mapswithme.maps.adapter.SpanningLinearLayoutManager;
+import com.mapswithme.maps.maplayer.subway.OnSubwayModeSelectListener;
+import com.mapswithme.maps.widget.recycler.SpanningLinearLayoutManager;
import com.mapswithme.maps.bookmarks.OnItemClickListener;
-import com.mapswithme.maps.traffic.widget.OnTrafficModeSelectListener;
+import com.mapswithme.maps.maplayer.traffic.widget.OnTrafficModeSelectListener;
import java.util.Arrays;
import java.util.List;
@@ -31,10 +31,6 @@ import java.util.Objects;
public class ToggleMapLayerDialog extends DialogFragment
{
- @NonNull
- @SuppressWarnings("NullableProblems")
- private View mRoot;
-
@NonNull
@SuppressWarnings("NullableProblems")
private ModeAdapter mAdapter;
@@ -45,27 +41,27 @@ public class ToggleMapLayerDialog extends DialogFragment
{
BottomSheetDialog dialog = new BottomSheetDialog(getActivity());
LayoutInflater inflater = getActivity().getLayoutInflater();
- mRoot = inflater.inflate(R.layout.fragment_toggle_map_layer, null, false);
- dialog.setContentView(mRoot);
- initChildren();
+ View root = inflater.inflate(R.layout.fragment_toggle_map_layer, null, false);
+ dialog.setContentView(root);
+ initChildren(root);
return dialog;
}
- private void initChildren()
+ private void initChildren(@NonNull View root)
{
- initCloseBtn();
- initRecycler();
+ initCloseBtn(root);
+ initRecycler(root);
}
- private void initCloseBtn()
+ private void initCloseBtn(@NonNull View root)
{
- View closeBtn = mRoot.findViewById(R.id.сlose_btn);
+ View closeBtn = root.findViewById(R.id.сlose_btn);
closeBtn.setOnClickListener(v -> dismiss());
}
- private void initRecycler()
+ private void initRecycler(@NonNull View root)
{
- RecyclerView recycler = mRoot.findViewById(R.id.recycler);
+ RecyclerView recycler = root.findViewById(R.id.recycler);
RecyclerView.LayoutManager layoutManager = new SpanningLinearLayoutManager(getContext(),
LinearLayoutManager.HORIZONTAL,
false);
@@ -79,13 +75,13 @@ public class ToggleMapLayerDialog extends DialogFragment
{
SubwayItemClickListener subwayListener = new SubwayItemClickListener();
Pair> subway
- = new Pair<>(BottomSheetItem.Subway.makeInstance(), subwayListener);
+ = new Pair<>(BottomSheetItem.Subway.makeInstance(getContext()), subwayListener);
TrafficItemClickListener trafficListener = new TrafficItemClickListener();
Pair> traffic
- = new Pair<>(BottomSheetItem.Traffic.makeInstance(), trafficListener);
+ = new Pair<>(BottomSheetItem.Traffic.makeInstance(getContext()), trafficListener);
- return Arrays.asList(subway, traffic);
+ return Arrays.asList(traffic, subway);
}
public static void show(@NonNull AppCompatActivity activity)
@@ -185,6 +181,7 @@ public class ToggleMapLayerDialog extends DialogFragment
@Override
public final void onItemClick(@NonNull View v, @NonNull BottomSheetItem item)
{
+ item.getMode().toggle(getContext());
onItemClickInternal(v, item);
mAdapter.notifyDataSetChanged();
}
diff --git a/android/src/com/mapswithme/maps/subway/OnSubwayModeSelectListener.java b/android/src/com/mapswithme/maps/maplayer/subway/OnSubwayModeSelectListener.java
similarity index 64%
rename from android/src/com/mapswithme/maps/subway/OnSubwayModeSelectListener.java
rename to android/src/com/mapswithme/maps/maplayer/subway/OnSubwayModeSelectListener.java
index eedce247c4..4b98930137 100644
--- a/android/src/com/mapswithme/maps/subway/OnSubwayModeSelectListener.java
+++ b/android/src/com/mapswithme/maps/maplayer/subway/OnSubwayModeSelectListener.java
@@ -1,4 +1,4 @@
-package com.mapswithme.maps.subway;
+package com.mapswithme.maps.maplayer.subway;
public interface OnSubwayModeSelectListener
{
diff --git a/android/src/com/mapswithme/maps/subway/OnTransitSchemeChangedListener.java b/android/src/com/mapswithme/maps/maplayer/subway/OnTransitSchemeChangedListener.java
similarity index 95%
rename from android/src/com/mapswithme/maps/subway/OnTransitSchemeChangedListener.java
rename to android/src/com/mapswithme/maps/maplayer/subway/OnTransitSchemeChangedListener.java
index 8b5decaf05..a7191d4149 100644
--- a/android/src/com/mapswithme/maps/subway/OnTransitSchemeChangedListener.java
+++ b/android/src/com/mapswithme/maps/maplayer/subway/OnTransitSchemeChangedListener.java
@@ -1,4 +1,4 @@
-package com.mapswithme.maps.subway;
+package com.mapswithme.maps.maplayer.subway;
import android.support.annotation.MainThread;
import android.support.annotation.NonNull;
diff --git a/android/src/com/mapswithme/maps/subway/SubwayManager.java b/android/src/com/mapswithme/maps/maplayer/subway/SubwayManager.java
similarity index 68%
rename from android/src/com/mapswithme/maps/subway/SubwayManager.java
rename to android/src/com/mapswithme/maps/maplayer/subway/SubwayManager.java
index fc5efc7c7a..5b575f290f 100644
--- a/android/src/com/mapswithme/maps/subway/SubwayManager.java
+++ b/android/src/com/mapswithme/maps/maplayer/subway/SubwayManager.java
@@ -1,13 +1,10 @@
-package com.mapswithme.maps.subway;
+package com.mapswithme.maps.maplayer.subway;
import android.content.Context;
-import android.support.annotation.DrawableRes;
import android.support.annotation.NonNull;
import com.mapswithme.maps.Framework;
import com.mapswithme.maps.MwmApplication;
-import com.mapswithme.maps.R;
-import com.mapswithme.util.ThemeUtils;
public class SubwayManager
{
@@ -23,11 +20,6 @@ public class SubwayManager
if (isEnabled == isEnabled())
return;
- if (isEnabled)
- addSchemeChangedListener(mSchemeChangedListener);
- else
- removeSchemeChangedListener(mSchemeChangedListener);
-
Framework.nativeSetTransitSchemeEnabled(isEnabled);
Framework.nativeSaveSettingSchemeEnabled(isEnabled);
}
@@ -42,14 +34,14 @@ public class SubwayManager
setEnabled(!isEnabled());
}
- public void addSchemeChangedListener(@NonNull OnTransitSchemeChangedListener listener)
+ public void initialize()
{
- nativeAddListener(listener);
+ registryListener();
}
- public void removeSchemeChangedListener(@NonNull OnTransitSchemeChangedListener listener)
+ private void registryListener()
{
- nativeRemoveListener(listener);
+ nativeAddListener(mSchemeChangedListener);
}
@NonNull
@@ -58,7 +50,7 @@ public class SubwayManager
MwmApplication app = (MwmApplication) context.getApplicationContext();
return app.getSubwayManager();
}
-
private static native void nativeAddListener(@NonNull OnTransitSchemeChangedListener listener);
+
private static native void nativeRemoveListener(@NonNull OnTransitSchemeChangedListener listener);
}
diff --git a/android/src/com/mapswithme/maps/maplayer/subway/SubwayMapLayerController.java b/android/src/com/mapswithme/maps/maplayer/subway/SubwayMapLayerController.java
new file mode 100644
index 0000000000..ab104b9107
--- /dev/null
+++ b/android/src/com/mapswithme/maps/maplayer/subway/SubwayMapLayerController.java
@@ -0,0 +1,77 @@
+package com.mapswithme.maps.maplayer.subway;
+
+import android.support.annotation.NonNull;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.mapswithme.maps.maplayer.MapLayerController;
+import com.mapswithme.util.Animations;
+import com.mapswithme.util.UiUtils;
+
+public class SubwayMapLayerController implements MapLayerController
+{
+ @NonNull
+ private final View mSubwayBtn;
+
+ public SubwayMapLayerController(@NonNull View subwayBtn)
+ {
+ mSubwayBtn = subwayBtn;
+ UiUtils.addStatusBarOffset(mSubwayBtn);
+ }
+
+ @Override
+ public void turnOn()
+ {
+ mSubwayBtn.setSelected(true);
+ }
+
+ @Override
+ public void turnOff()
+ {
+ mSubwayBtn.setSelected(false);
+ }
+
+ @Override
+ public void show()
+ {
+ Animations.appearSliding(mSubwayBtn, Animations.LEFT, null);
+ }
+
+ @Override
+ public void showImmediately()
+ {
+ mSubwayBtn.setVisibility(View.VISIBLE);
+ }
+
+ @Override
+ public void hide()
+ {
+ Animations.disappearSliding(mSubwayBtn, Animations.LEFT, null);
+ }
+
+ @Override
+ public void hideImmediately()
+ {
+ mSubwayBtn.setVisibility(View.GONE);
+ }
+
+ @Override
+ public void adjust(int offsetX, int offsetY)
+ {
+ ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) mSubwayBtn.getLayoutParams();
+ params.setMargins(offsetX, offsetY, 0, 0);
+ mSubwayBtn.setLayoutParams(params);
+ }
+
+ @Override
+ public void attachCore()
+ {
+ /* Do nothing by default */
+ }
+
+ @Override
+ public void detachCore()
+ {
+ /* Do nothing by default */
+ }
+}
diff --git a/android/src/com/mapswithme/maps/subway/TransitSchemeState.java b/android/src/com/mapswithme/maps/maplayer/subway/TransitSchemeState.java
similarity index 89%
rename from android/src/com/mapswithme/maps/subway/TransitSchemeState.java
rename to android/src/com/mapswithme/maps/maplayer/subway/TransitSchemeState.java
index d37363cd91..55a36e5063 100644
--- a/android/src/com/mapswithme/maps/subway/TransitSchemeState.java
+++ b/android/src/com/mapswithme/maps/maplayer/subway/TransitSchemeState.java
@@ -1,4 +1,4 @@
-package com.mapswithme.maps.subway;
+package com.mapswithme.maps.maplayer.subway;
import android.support.annotation.NonNull;
diff --git a/android/src/com/mapswithme/maps/traffic/TrafficManager.java b/android/src/com/mapswithme/maps/maplayer/traffic/TrafficManager.java
similarity index 97%
rename from android/src/com/mapswithme/maps/traffic/TrafficManager.java
rename to android/src/com/mapswithme/maps/maplayer/traffic/TrafficManager.java
index c69318f2e1..1850e2f877 100644
--- a/android/src/com/mapswithme/maps/traffic/TrafficManager.java
+++ b/android/src/com/mapswithme/maps/maplayer/traffic/TrafficManager.java
@@ -1,4 +1,4 @@
-package com.mapswithme.maps.traffic;
+package com.mapswithme.maps.maplayer.traffic;
import android.support.annotation.MainThread;
import android.support.annotation.NonNull;
@@ -38,19 +38,19 @@ public enum TrafficManager
{
checkInitialization();
- if (mState == TrafficState.DISABLED)
- enable();
- else
+ if (isEnabled())
disable();
+ else
+ enable();
}
- public void enable()
+ private void enable()
{
mLogger.d(mTag, "Enable traffic");
TrafficState.nativeEnable();
}
- public void disable()
+ private void disable()
{
checkInitialization();
@@ -107,6 +107,8 @@ public enum TrafficManager
public void setEnabled(boolean enabled)
{
+ checkInitialization();
+
if (isEnabled() == enabled)
return;
diff --git a/android/src/com/mapswithme/maps/traffic/TrafficState.java b/android/src/com/mapswithme/maps/maplayer/traffic/TrafficState.java
similarity index 96%
rename from android/src/com/mapswithme/maps/traffic/TrafficState.java
rename to android/src/com/mapswithme/maps/maplayer/traffic/TrafficState.java
index 8f77c0de05..8f24f16d66 100644
--- a/android/src/com/mapswithme/maps/traffic/TrafficState.java
+++ b/android/src/com/mapswithme/maps/maplayer/traffic/TrafficState.java
@@ -1,4 +1,4 @@
-package com.mapswithme.maps.traffic;
+package com.mapswithme.maps.maplayer.traffic;
import android.support.annotation.IntDef;
import android.support.annotation.MainThread;
@@ -7,7 +7,7 @@ import android.support.annotation.NonNull;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
-public final class TrafficState
+final class TrafficState
{
interface StateChangeListener
{
diff --git a/android/src/com/mapswithme/maps/traffic/widget/OnTrafficModeSelectListener.java b/android/src/com/mapswithme/maps/maplayer/traffic/widget/OnTrafficModeSelectListener.java
similarity index 60%
rename from android/src/com/mapswithme/maps/traffic/widget/OnTrafficModeSelectListener.java
rename to android/src/com/mapswithme/maps/maplayer/traffic/widget/OnTrafficModeSelectListener.java
index c90ea08298..ede2b33b28 100644
--- a/android/src/com/mapswithme/maps/traffic/widget/OnTrafficModeSelectListener.java
+++ b/android/src/com/mapswithme/maps/maplayer/traffic/widget/OnTrafficModeSelectListener.java
@@ -1,4 +1,4 @@
-package com.mapswithme.maps.traffic.widget;
+package com.mapswithme.maps.maplayer.traffic.widget;
public interface OnTrafficModeSelectListener
{
diff --git a/android/src/com/mapswithme/maps/traffic/widget/TrafficButton.java b/android/src/com/mapswithme/maps/maplayer/traffic/widget/TrafficButton.java
similarity index 94%
rename from android/src/com/mapswithme/maps/traffic/widget/TrafficButton.java
rename to android/src/com/mapswithme/maps/maplayer/traffic/widget/TrafficButton.java
index cabf8a7427..d5494db53f 100644
--- a/android/src/com/mapswithme/maps/traffic/widget/TrafficButton.java
+++ b/android/src/com/mapswithme/maps/maplayer/traffic/widget/TrafficButton.java
@@ -1,4 +1,4 @@
-package com.mapswithme.maps.traffic.widget;
+package com.mapswithme.maps.maplayer.traffic.widget;
import android.content.Context;
import android.content.res.Resources;
@@ -107,4 +107,9 @@ public class TrafficButton
{
mButton.setVisibility(View.VISIBLE);
}
+
+ public void setOnclickListener(View.OnClickListener onclickListener)
+ {
+ mButton.setOnClickListener(onclickListener);
+ }
}
diff --git a/android/src/com/mapswithme/maps/traffic/widget/TrafficButtonController.java b/android/src/com/mapswithme/maps/maplayer/traffic/widget/TrafficButtonController.java
similarity index 65%
rename from android/src/com/mapswithme/maps/traffic/widget/TrafficButtonController.java
rename to android/src/com/mapswithme/maps/maplayer/traffic/widget/TrafficButtonController.java
index 8ade1b3a6c..540c81ca97 100644
--- a/android/src/com/mapswithme/maps/traffic/widget/TrafficButtonController.java
+++ b/android/src/com/mapswithme/maps/maplayer/traffic/widget/TrafficButtonController.java
@@ -1,27 +1,28 @@
-package com.mapswithme.maps.traffic.widget;
+package com.mapswithme.maps.maplayer.traffic.widget;
+import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
-import android.support.v7.app.AppCompatActivity;
import android.widget.Toast;
import com.mapswithme.maps.R;
-import com.mapswithme.maps.traffic.TrafficManager;
+import com.mapswithme.maps.maplayer.MapLayerController;
+import com.mapswithme.maps.maplayer.traffic.TrafficManager;
-public class TrafficButtonController implements TrafficManager.TrafficCallback
+public class TrafficButtonController implements TrafficManager.TrafficCallback, MapLayerController
{
@NonNull
private final TrafficButton mButton;
@NonNull
- private final AppCompatActivity mActivity;
+ private final Activity mActivity;
@Nullable
private Dialog mDialog;
public TrafficButtonController(@NonNull TrafficButton button,
- @NonNull AppCompatActivity activity)
+ @NonNull Activity activity)
{
mButton = button;
mActivity = activity;
@@ -29,16 +30,70 @@ public class TrafficButtonController implements TrafficManager.TrafficCallback
@Override
public void onEnabled()
+ {
+ turnOn();
+ }
+
+ @Override
+ public void turnOn()
{
mButton.turnOn();
}
+ @Override
+ public void hideImmediately()
+ {
+ mButton.hideImmediately();
+ }
+
+ @Override
+ public void adjust(int offsetX, int offsetY)
+ {
+ mButton.setOffset(offsetX, offsetY);
+ }
+
+ @Override
+ public void attachCore()
+ {
+ TrafficManager.INSTANCE.attach(this);
+ }
+
+ @Override
+ public void detachCore()
+ {
+ destroy();
+ }
+
@Override
public void onDisabled()
+ {
+ turnOff();
+ }
+
+ @Override
+ public void turnOff()
{
mButton.turnOff();
}
+ @Override
+ public void show()
+ {
+ mButton.show();
+ }
+
+ @Override
+ public void showImmediately()
+ {
+ mButton.showImmediately();
+ }
+
+ @Override
+ public void hide()
+ {
+ mButton.hide();
+ }
+
@Override
public void onWaitingData()
{
@@ -54,7 +109,7 @@ public class TrafficButtonController implements TrafficManager.TrafficCallback
@Override
public void onNoData(boolean notify)
{
- mButton.turnOn();
+ turnOn();
if (notify)
Toast.makeText(mActivity, R.string.traffic_data_unavailable, Toast.LENGTH_SHORT).show();
}
@@ -72,7 +127,7 @@ public class TrafficButtonController implements TrafficManager.TrafficCallback
@Override
public void onClick(DialogInterface dialog, int which)
{
- TrafficManager.INSTANCE.disable();
+ TrafficManager.INSTANCE.setEnabled(false);
}
})
.setCancelable(true)
@@ -81,7 +136,7 @@ public class TrafficButtonController implements TrafficManager.TrafficCallback
@Override
public void onCancel(DialogInterface dialog)
{
- TrafficManager.INSTANCE.disable();
+ TrafficManager.INSTANCE.setEnabled(false);
}
});
mDialog = builder.show();
@@ -96,7 +151,7 @@ public class TrafficButtonController implements TrafficManager.TrafficCallback
@Override
public void onExpiredData(boolean notify)
{
- mButton.turnOn();
+ turnOn();
if (notify)
Toast.makeText(mActivity, R.string.traffic_update_maps_text, Toast.LENGTH_SHORT).show();
}
@@ -104,7 +159,7 @@ public class TrafficButtonController implements TrafficManager.TrafficCallback
@Override
public void onExpiredApp(boolean notify)
{
- mButton.turnOn();
+ turnOn();
if (notify)
Toast.makeText(mActivity, R.string.traffic_update_app, Toast.LENGTH_SHORT).show();
}
diff --git a/android/src/com/mapswithme/maps/routing/NavigationController.java b/android/src/com/mapswithme/maps/routing/NavigationController.java
index 1e448f5315..2e56750675 100644
--- a/android/src/com/mapswithme/maps/routing/NavigationController.java
+++ b/android/src/com/mapswithme/maps/routing/NavigationController.java
@@ -23,7 +23,7 @@ import com.mapswithme.maps.bookmarks.data.DistanceAndAzimut;
import com.mapswithme.maps.location.LocationHelper;
import com.mapswithme.maps.settings.SettingsActivity;
import com.mapswithme.maps.sound.TtsPlayer;
-import com.mapswithme.maps.traffic.TrafficManager;
+import com.mapswithme.maps.maplayer.traffic.TrafficManager;
import com.mapswithme.maps.widget.FlatProgressView;
import com.mapswithme.maps.widget.menu.NavMenu;
import com.mapswithme.util.Animations;
diff --git a/android/src/com/mapswithme/maps/subway/Mode.java b/android/src/com/mapswithme/maps/subway/Mode.java
deleted file mode 100644
index 4ed4ecf4e2..0000000000
--- a/android/src/com/mapswithme/maps/subway/Mode.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package com.mapswithme.maps.subway;
-
-import android.content.Context;
-import android.support.annotation.NonNull;
-
-import com.mapswithme.maps.traffic.TrafficManager;
-
-public enum Mode
-{
- TRAFFIC
- {
- @Override
- public boolean isEnabled(@NonNull Context context)
- {
- return TrafficManager.INSTANCE.isEnabled();
- }
- },
- SUBWAY
- {
- @Override
- public boolean isEnabled(@NonNull Context context)
- {
- return SubwayManager.from(context).isEnabled();
- }
- };
-
- public abstract boolean isEnabled(@NonNull Context context);
-}
diff --git a/android/src/com/mapswithme/maps/widget/menu/NavMenu.java b/android/src/com/mapswithme/maps/widget/menu/NavMenu.java
index 5664cd37ba..b04080ebb7 100644
--- a/android/src/com/mapswithme/maps/widget/menu/NavMenu.java
+++ b/android/src/com/mapswithme/maps/widget/menu/NavMenu.java
@@ -11,7 +11,7 @@ import android.widget.ImageView;
import com.mapswithme.maps.Framework;
import com.mapswithme.maps.R;
import com.mapswithme.maps.sound.TtsPlayer;
-import com.mapswithme.maps.traffic.TrafficManager;
+import com.mapswithme.maps.maplayer.traffic.TrafficManager;
import com.mapswithme.maps.widget.RotateDrawable;
import com.mapswithme.util.Graphics;
import com.mapswithme.util.UiUtils;
diff --git a/android/src/com/mapswithme/maps/adapter/SpanningLinearLayoutManager.java b/android/src/com/mapswithme/maps/widget/recycler/SpanningLinearLayoutManager.java
similarity index 98%
rename from android/src/com/mapswithme/maps/adapter/SpanningLinearLayoutManager.java
rename to android/src/com/mapswithme/maps/widget/recycler/SpanningLinearLayoutManager.java
index 75ad71368e..da189a423f 100644
--- a/android/src/com/mapswithme/maps/adapter/SpanningLinearLayoutManager.java
+++ b/android/src/com/mapswithme/maps/widget/recycler/SpanningLinearLayoutManager.java
@@ -1,4 +1,4 @@
-package com.mapswithme.maps.adapter;
+package com.mapswithme.maps.widget.recycler;
import android.content.Context;
import android.support.annotation.NonNull;
diff --git a/android/src/com/mapswithme/util/UiUtils.java b/android/src/com/mapswithme/util/UiUtils.java
index e53bdb60c5..1e9f9bba69 100644
--- a/android/src/com/mapswithme/util/UiUtils.java
+++ b/android/src/com/mapswithme/util/UiUtils.java
@@ -48,7 +48,7 @@ public final class UiUtils
public static final String PHRASE_SEPARATOR = " • ";
private static float sScreenDensity;
- public static void addStatusBarOffset(View view)
+ public static void addStatusBarOffset(@NonNull View view)
{
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
params.setMargins(0, UiUtils.getStatusBarHeight(view.getContext()), 0, 0);
diff --git a/android/src/com/mapswithme/util/Utils.java b/android/src/com/mapswithme/util/Utils.java
index 9be9e34812..8889114cd4 100644
--- a/android/src/com/mapswithme/util/Utils.java
+++ b/android/src/com/mapswithme/util/Utils.java
@@ -681,6 +681,5 @@ public class Utils
public interface Proc
{
void invoke(@NonNull T param);
-
}
}