123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- package de.tudarmstadt.informatik.hostage.ui2.fragment;
- import android.app.Fragment;
- /**
- * This abstract fragments allows the definition of an child - parent relation of fragments. It is necessary for the app to allow Up navigation of fragments.
- *
- * @author Alexander Brakowski
- * @created 12.03.14 16:20
- */
- public abstract class UpNavigatibleFragment extends TrackerFragment {
- /**
- * Holds a reference to the parent fragment
- */
- private Class<?> mUpFragment;
- /**
- * Indicates whether the fragment is up navigatible
- */
- private boolean mIsUpNavigatible = false;
- private boolean mAllowBack = false;
- /**
- * Retrieves the parent fragment to be used for up navigation
- * @return the parent fragment
- */
- public Class<?> getUpFragment(){
- return mUpFragment;
- }
- /**
- * Sets the parent fragment of this fragment.
- * @param upFragment the fragment to set as parent
- */
- public void setUpFragment(Class<?> upFragment){
- this.mUpFragment = upFragment;
- }
- /**
- * Checks whether this fragment can be navigated up
- *
- * @return true if this fragment can be up navigated,
- * false otherwise
- */
- public boolean isUpNavigatible(){
- return mIsUpNavigatible;
- }
- /**
- * Sets the state of up navigation for this fragment
- * @param isUpNavigatible true to allow up navigation
- * false no up navigation
- */
- public void setUpNavigatible(boolean isUpNavigatible){
- this.mIsUpNavigatible = isUpNavigatible;
- }
- public boolean getAllowBack(){
- return mAllowBack;
- }
- public void setAllowBack(boolean allowBack){
- this.mAllowBack = allowBack;
- }
- }
|