BaseFragment: Always anchor Snackbars to FAB

This makes tunnel list fragment correctly render them above the FAB.

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
Harsh Shandilya 2020-03-10 12:32:23 +05:30
parent 5d342ee1ab
commit 37adab76e1

View File

@ -119,7 +119,7 @@ public abstract class BaseFragment extends Fragment implements OnSelectedTunnelC
final String message = requireContext().getString(messageResId, error);
final View view = getView();
if (view != null)
Snackbar.make(view, message, Snackbar.LENGTH_LONG).show();
Snackbar.make(view, message, Snackbar.LENGTH_LONG).setAnchorView(view.findViewById(R.id.create_fab)).show();
else
Toast.makeText(requireContext(), message, Toast.LENGTH_LONG).show();
Log.e(TAG, message, throwable);