[android] Fixed review notes

https://github.com/mapsme/omim/pull/12429#discussion_r367342769
This commit is contained in:
Dmitry Donskoy 2020-01-17 09:29:47 +03:00 committed by Daria Volvenkova
parent 67e596615c
commit d28b7ccf08
10 changed files with 37 additions and 37 deletions

View file

@ -1724,13 +1724,13 @@ Java_com_mapswithme_maps_Framework_nativeIsTransitSchemeEnabled(JNIEnv * env, jc
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_Framework_nativeSetIsoLinesLayerEnabled(JNIEnv * env, jclass, jboolean enabled)
Java_com_mapswithme_maps_Framework_nativeSetIsolinesLayerEnabled(JNIEnv * env, jclass, jboolean enabled)
{
/* frm()->...(static_cast<bool>(enabled));*/
}
JNIEXPORT jboolean JNICALL
Java_com_mapswithme_maps_Framework_nativeIsIsoLinesLayerEnabled(JNIEnv * env, jclass)
Java_com_mapswithme_maps_Framework_nativeIsIsolinesLayerEnabled(JNIEnv * env, jclass)
{
return /*static_cast<jboolean>(frm()->())*/ false;
}

View file

@ -422,9 +422,9 @@ public class Framework
public static native boolean nativeIsTransitSchemeEnabled();
public static native void nativeSetIsoLinesLayerEnabled(boolean enabled);
public static native void nativeSetIsolinesLayerEnabled(boolean enabled);
public static native boolean nativeIsIsoLinesLayerEnabled();
public static native boolean nativeIsIsolinesLayerEnabled();
@NonNull
public static native MapObject nativeDeleteBookmarkFromMapObject();

View file

@ -68,7 +68,7 @@ import com.mapswithme.maps.location.CompassData;
import com.mapswithme.maps.location.LocationHelper;
import com.mapswithme.maps.maplayer.MapLayerCompositeController;
import com.mapswithme.maps.maplayer.Mode;
import com.mapswithme.maps.maplayer.OnIsoLinesLayerToggleListener;
import com.mapswithme.maps.maplayer.OnIsolinesLayerToggleListener;
import com.mapswithme.maps.maplayer.subway.OnSubwayLayerToggleListener;
import com.mapswithme.maps.maplayer.subway.SubwayManager;
import com.mapswithme.maps.maplayer.traffic.OnTrafficLayerToggleListener;
@ -174,7 +174,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
AppBackgroundTracker.OnTransitionListener,
MaterialTapTargetPrompt.PromptStateChangeListener,
WelcomeDialogFragment.OnboardingStepPassedListener,
OnIsoLinesLayerToggleListener
OnIsolinesLayerToggleListener
{
private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
private static final String TAG = MwmActivity.class.getSimpleName();
@ -1213,7 +1213,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
}
@Override
public void onIsoLinesLayerSelected()
public void onIsolinesLayerSelected()
{
mToggleMapLayerController.toggleMode(Mode.ISOLINES);
}

View file

@ -23,7 +23,7 @@ import com.mapswithme.maps.geofence.GeofenceRegistry;
import com.mapswithme.maps.geofence.GeofenceRegistryImpl;
import com.mapswithme.maps.location.LocationHelper;
import com.mapswithme.maps.location.TrackRecorder;
import com.mapswithme.maps.maplayer.isolines.IsoLinesManager;
import com.mapswithme.maps.maplayer.isolines.IsolinesManager;
import com.mapswithme.maps.maplayer.subway.SubwayManager;
import com.mapswithme.maps.maplayer.traffic.TrafficManager;
import com.mapswithme.maps.routing.RoutingController;
@ -62,7 +62,7 @@ public class MwmApplication extends Application implements AppBackgroundTracker.
@SuppressWarnings("NullableProblems")
@NonNull
private IsoLinesManager mIsoLinesManager;
private IsolinesManager mIsolinesManager;
private boolean mFrameworkInitialized;
private boolean mPlatformInitialized;
@ -100,9 +100,9 @@ public class MwmApplication extends Application implements AppBackgroundTracker.
}
@NonNull
public IsoLinesManager getIsoLinesManager()
public IsolinesManager getIsolinesManager()
{
return mIsoLinesManager;
return mIsolinesManager;
}
public MwmApplication()
@ -190,7 +190,7 @@ public class MwmApplication extends Application implements AppBackgroundTracker.
mBackgroundTracker = new AppBackgroundTracker();
mBackgroundTracker.addListener(mVisibleAppLaunchListener);
mSubwayManager = new SubwayManager(this);
mIsoLinesManager = new IsoLinesManager();
mIsolinesManager = new IsolinesManager();
mConnectivityListener = new ConnectivityJobScheduler(this);
mConnectivityListener.listen();

View file

@ -83,9 +83,9 @@ public abstract class BottomSheetItem
}
}
public static class IsoLines extends BottomSheetItem
public static class Isolines extends BottomSheetItem
{
private IsoLines(int drawableResId, int disabledStateDrawableResId)
private Isolines(int drawableResId, int disabledStateDrawableResId)
{
super(drawableResId, disabledStateDrawableResId, R.string.button_layer_traffic, Mode.ISOLINES);
}
@ -94,7 +94,7 @@ public abstract class BottomSheetItem
{
int disabled = ThemeUtils.getResource(mContext, R.attr.isoLinesMenuDisabled);
return new IsoLines(R.drawable.ic_planning_route_isomaps_dark_on, disabled);
return new Isolines(R.drawable.ic_planning_route_isomaps_dark_on, disabled);
}
}
}

View file

@ -4,7 +4,7 @@ import android.content.Context;
import androidx.annotation.NonNull;
import com.mapswithme.maps.maplayer.isolines.IsoLinesManager;
import com.mapswithme.maps.maplayer.isolines.IsolinesManager;
import com.mapswithme.maps.maplayer.subway.SubwayManager;
import com.mapswithme.maps.maplayer.traffic.TrafficManager;
@ -30,7 +30,7 @@ public enum Mode
{
TrafficManager.INSTANCE.toggle();
SubwayManager.from(context).setEnabled(false);
IsoLinesManager.from(context).setEnabled(false);
IsolinesManager.from(context).setEnabled(false);
}
},
SUBWAY
@ -52,7 +52,7 @@ public enum Mode
{
SubwayManager.from(context).toggle();
TrafficManager.INSTANCE.setEnabled(false);
IsoLinesManager.from(context).setEnabled(false);
IsolinesManager.from(context).setEnabled(false);
}
},
@ -61,19 +61,19 @@ public enum Mode
@Override
public boolean isEnabled(@NonNull Context context)
{
return IsoLinesManager.from(context).isEnabled();
return IsolinesManager.from(context).isEnabled();
}
@Override
public void setEnabled(@NonNull Context context, boolean isEnabled)
{
IsoLinesManager.from(context).setEnabled(isEnabled);
IsolinesManager.from(context).setEnabled(isEnabled);
}
@Override
public void toggle(@NonNull Context context)
{
IsoLinesManager.from(context).toggle();
IsolinesManager.from(context).toggle();
TrafficManager.INSTANCE.setEnabled(false);
SubwayManager.from(context).setEnabled(false);
}

View file

@ -1,6 +0,0 @@
package com.mapswithme.maps.maplayer;
public interface OnIsoLinesLayerToggleListener
{
void onIsoLinesLayerSelected();
}

View file

@ -0,0 +1,6 @@
package com.mapswithme.maps.maplayer;
public interface OnIsolinesLayerToggleListener
{
void onIsolinesLayerSelected();
}

View file

@ -92,9 +92,9 @@ public class ToggleMapLayerDialog extends DialogFragment
Pair<BottomSheetItem, OnItemClickListener<BottomSheetItem>> traffic
= new Pair<>(BottomSheetItem.Traffic.makeInstance(getContext()), trafficListener);
IsoLinesItemClickListener isoLinesListener = new IsoLinesItemClickListener();
IsolinesItemClickListener isoLinesListener = new IsolinesItemClickListener();
Pair<BottomSheetItem, OnItemClickListener<BottomSheetItem>> isoLines
= new Pair<>(BottomSheetItem.IsoLines.makeInstance(getContext()), isoLinesListener);
= new Pair<>(BottomSheetItem.Isolines.makeInstance(getContext()), isoLinesListener);
return Arrays.asList(traffic, subway/*, isoLines*/);
}
@ -225,13 +225,13 @@ public class ToggleMapLayerDialog extends DialogFragment
}
}
private class IsoLinesItemClickListener extends DefaultClickListener
private class IsolinesItemClickListener extends DefaultClickListener
{
@Override
void onItemClickInternal(@NonNull View v, @NonNull BottomSheetItem item)
{
OnIsoLinesLayerToggleListener listener = (OnIsoLinesLayerToggleListener) requireActivity();
listener.onIsoLinesLayerSelected();
OnIsolinesLayerToggleListener listener = (OnIsolinesLayerToggleListener) requireActivity();
listener.onIsolinesLayerSelected();
}
}
}

View file

@ -6,18 +6,18 @@ import androidx.annotation.NonNull;
import com.mapswithme.maps.Framework;
import com.mapswithme.maps.MwmApplication;
public class IsoLinesManager
public class IsolinesManager
{
@NonNull
public static IsoLinesManager from(@NonNull Context context)
public static IsolinesManager from(@NonNull Context context)
{
MwmApplication app = (MwmApplication) context.getApplicationContext();
return app.getIsoLinesManager();
return app.getIsolinesManager();
}
public boolean isEnabled()
{
return Framework.nativeIsIsoLinesLayerEnabled();
return Framework.nativeIsIsolinesLayerEnabled();
}
public void setEnabled(boolean isEnabled)
@ -25,7 +25,7 @@ public class IsoLinesManager
if (isEnabled == isEnabled())
return;
Framework.nativeSetIsoLinesLayerEnabled(isEnabled);
Framework.nativeSetIsolinesLayerEnabled(isEnabled);
}
public void toggle()