mirror of
https://github.com/gsantner/dandelion
synced 2025-12-15 00:31:11 +01:00
.
This commit is contained in:
parent
586875e32b
commit
a88dc5d13c
3 changed files with 21 additions and 18 deletions
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
This file is part of the dandelion*.
|
||||
|
||||
dandelion* is free software: you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
dandelion* is distributed in the hope that it will be useful,
|
||||
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
|
||||
along with the dandelion*.
|
||||
|
||||
If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package net.gsantner.opoc.activity;
|
||||
|
||||
import android.os.Bundle;
|
||||
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 {
|
||||
|
||||
public static final String TAG = "net.gsantner.opoc.activity.CustomFragment";
|
||||
|
||||
/**
|
||||
* We have an optionsMenu
|
||||
*
|
||||
* @param savedInstanceState state
|
||||
*/
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setHasOptionsMenu(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the tag used to identify the Fragment.
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
* @return did we react to the back press?
|
||||
*/
|
||||
public abstract boolean onBackPressed();
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue