Changeset View
Changeset View
Standalone View
Standalone View
app/src/main/java/it/reyboz/bustorino/fragments/ResultBaseFragment.java
- This file was added.
| package it.reyboz.bustorino.fragments; | |||||
| import android.content.Context; | |||||
| import androidx.annotation.NonNull; | |||||
| import androidx.fragment.app.Fragment; | |||||
| public abstract class ResultBaseFragment extends Fragment { | |||||
| protected FragmentListenerMain mListener; | |||||
| protected static final String MESSAGE_TEXT_VIEW = "message_text_view"; | |||||
| public ResultBaseFragment() { | |||||
| } | |||||
| @Override | |||||
| public void onAttach(@NonNull Context context) { | |||||
| super.onAttach(context); | |||||
| if (context instanceof FragmentListenerMain) { | |||||
| mListener = (FragmentListenerMain) context; | |||||
| } else { | |||||
| throw new RuntimeException(context.toString() | |||||
| + " must implement FragmentListenerMain"); | |||||
| } | |||||
| } | |||||
| @Override | |||||
| public void onDetach() { | |||||
| mListener.showFloatingActionButton(false); | |||||
| mListener = null; | |||||
| super.onDetach(); | |||||
| } | |||||
| } | |||||
Public contents are in Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) or GNU Free Documentation License (at your option) unless otherwise noted. · Contact / Register