[android] Added method to show toast at the top after layer is enabled

This commit is contained in:
Александр Зацепин 2020-04-22 13:37:39 +03:00 committed by yoksnod
parent 513e8cc41d
commit f650884a41

View file

@ -1,10 +1,14 @@
package com.mapswithme.maps.widget.menu;
import android.content.Context;
import android.view.Gravity;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.core.widget.NestedScrollView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
@ -110,6 +114,14 @@ public class MainMenuRenderer implements MenuRenderer
mScrollView.scrollTo(0, 0);
}
// TODO: use this method to show layer toast.
private static void showToast(@NonNull Context context, @StringRes int stringId)
{
Toast toast = Toast.makeText(context, stringId, Toast.LENGTH_LONG);
toast.setGravity(Gravity.TOP, 0, 0);
toast.show();
}
private class SubwayItemClickListener extends DefaultClickListener
{
SubwayItemClickListener()