forked from organicmaps/organicmaps
[android] Fixed review notes
This commit is contained in:
parent
bf39704b98
commit
7c4a6259a6
3 changed files with 12 additions and 6 deletions
|
@ -35,9 +35,13 @@ Java_com_mapswithme_maps_maplayer_isolines_IsolinesManager_nativeRemoveListener(
|
|||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_com_mapswithme_maps_maplayer_isolines_IsolinesManager_nativeIsVisible(JNIEnv *env, jclass clazz)
|
||||
Java_com_mapswithme_maps_maplayer_isolines_IsolinesManager_nativeShouldShowNotification(JNIEnv *env,
|
||||
jclass clazz)
|
||||
{
|
||||
CHECK(g_framework, ("Framework isn't created yet!"));
|
||||
return static_cast<jboolean>(g_framework->NativeFramework()->GetIsolinesManager().IsVisible());
|
||||
auto const &manager = g_framework->NativeFramework()->GetIsolinesManager();
|
||||
auto const visible = manager.IsVisible();
|
||||
auto const enabled = manager.GetState() == IsolinesManager::IsolinesState::Enabled;
|
||||
return static_cast<jboolean>(!visible && enabled);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.mapswithme.maps.maplayer;
|
|||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.CallSuper;
|
||||
import androidx.annotation.NonNull;
|
||||
import com.mapswithme.maps.R;
|
||||
import com.mapswithme.maps.maplayer.isolines.IsolinesManager;
|
||||
|
@ -18,10 +19,11 @@ public abstract class AbstractIsoLinesClickListener extends DefaultClickListener
|
|||
super(adapter);
|
||||
}
|
||||
|
||||
@CallSuper
|
||||
@Override
|
||||
public void onItemClickInternal(@NonNull View v, @NonNull BottomSheetItem item)
|
||||
{
|
||||
if (IsolinesManager.from(v.getContext()).isVisible())
|
||||
if (IsolinesManager.from(v.getContext()).shouldShowNotification())
|
||||
{
|
||||
Toast.makeText(v.getContext(), R.string.isolines_toast_zooms_1_10, Toast.LENGTH_SHORT).show();
|
||||
Statistics.INSTANCE.trackEvent(Statistics.EventName.MAP_TOAST_SHOW,
|
||||
|
|
|
@ -64,7 +64,7 @@ public class IsolinesManager implements Initializable<Void>, Detachable<Isolines
|
|||
|
||||
private static native void nativeAddListener(@NonNull OnIsolinesChangedListener listener);
|
||||
private static native void nativeRemoveListener(@NonNull OnIsolinesChangedListener listener);
|
||||
private static native boolean nativeIsVisible();
|
||||
private static native boolean nativeShouldShowNotification();
|
||||
|
||||
@Override
|
||||
public void attach(@NonNull IsolinesErrorDialogListener listener)
|
||||
|
@ -78,8 +78,8 @@ public class IsolinesManager implements Initializable<Void>, Detachable<Isolines
|
|||
mListener.detach();
|
||||
}
|
||||
|
||||
public boolean isVisible()
|
||||
public boolean shouldShowNotification()
|
||||
{
|
||||
return nativeIsVisible();
|
||||
return nativeShouldShowNotification();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue