2016-10-09 21:04:12 +02:00
|
|
|
/*
|
2017-02-24 18:47:14 +01:00
|
|
|
This file is part of the dandelion*.
|
2016-10-09 21:04:12 +02:00
|
|
|
|
2017-02-24 18:47:14 +01:00
|
|
|
dandelion* is free software: you can redistribute it and/or modify
|
2016-10-09 21:04:12 +02:00
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
2017-02-24 18:47:14 +01:00
|
|
|
dandelion* is distributed in the hope that it will be useful,
|
2016-10-09 21:04:12 +02:00
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2017-02-24 18:47:14 +01:00
|
|
|
along with the dandelion*.
|
2016-10-09 21:04:12 +02:00
|
|
|
|
|
|
|
If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2016-10-26 16:23:14 +02:00
|
|
|
package com.github.dfa.diaspora_android.ui.theme;
|
2016-09-21 21:15:34 +02:00
|
|
|
|
2016-09-22 00:54:32 +02:00
|
|
|
import android.os.Bundle;
|
2016-09-21 21:15:34 +02:00
|
|
|
import android.support.v4.app.Fragment;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Customized abstract Fragment class with some useful methods
|
|
|
|
* Created by vanitas on 21.09.16.
|
|
|
|
*/
|
|
|
|
|
|
|
|
public abstract class CustomFragment extends Fragment {
|
2016-09-22 00:54:32 +02:00
|
|
|
|
2016-10-26 16:23:14 +02:00
|
|
|
public static final String TAG = "com.github.dfa.diaspora_android.ui.theme.CustomFragment";
|
2016-09-28 21:43:25 +02:00
|
|
|
|
2016-09-22 00:54:32 +02:00
|
|
|
/**
|
|
|
|
* We have an optionsMenu
|
2016-10-14 01:26:56 +02:00
|
|
|
*
|
2016-09-22 00:54:32 +02:00
|
|
|
* @param savedInstanceState state
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public void onCreate(Bundle savedInstanceState) {
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
setHasOptionsMenu(true);
|
|
|
|
}
|
|
|
|
|
2016-09-21 21:15:34 +02:00
|
|
|
/**
|
|
|
|
* Return the tag used to identify the Fragment.
|
2016-10-14 01:26:56 +02:00
|
|
|
*
|
2016-09-21 21:15:34 +02:00
|
|
|
* @return tag
|
|
|
|
*/
|
|
|
|
public abstract String getFragmentTag();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return true if the fragment reacted to a back button press, false else.
|
|
|
|
* In case the fragment returned false, the parent activity should handle the backPress.
|
2016-10-14 01:26:56 +02:00
|
|
|
*
|
2016-09-21 21:15:34 +02:00
|
|
|
* @return did we react to the back press?
|
|
|
|
*/
|
|
|
|
public abstract boolean onBackPressed();
|
2016-10-27 12:55:42 +02:00
|
|
|
|
|
|
|
public boolean isAllowedIntellihide() {
|
|
|
|
return true;
|
|
|
|
}
|
2016-09-21 21:15:34 +02:00
|
|
|
}
|
|
|
|
|