aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain/android-libs/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockFragment.java
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2013-01-16 14:31:16 +0100
committerDominik Schürmann <dominik@dominikschuermann.de>2013-01-16 14:31:16 +0100
commit1feb948acf81532f82b36456080920543004b097 (patch)
treef22e51163db4303ad72b9205a3347aea8211c15e /OpenPGP-Keychain/android-libs/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockFragment.java
parentdbbd8f6856086a9aa17b565080959fb77dc24cd9 (diff)
downloadopen-keychain-1feb948acf81532f82b36456080920543004b097.tar.gz
open-keychain-1feb948acf81532f82b36456080920543004b097.tar.bz2
open-keychain-1feb948acf81532f82b36456080920543004b097.zip
Renaming APG to OpenPGP Keychain
Diffstat (limited to 'OpenPGP-Keychain/android-libs/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockFragment.java')
-rw-r--r--OpenPGP-Keychain/android-libs/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockFragment.java68
1 files changed, 68 insertions, 0 deletions
diff --git a/OpenPGP-Keychain/android-libs/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockFragment.java b/OpenPGP-Keychain/android-libs/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockFragment.java
new file mode 100644
index 000000000..0f24e9c85
--- /dev/null
+++ b/OpenPGP-Keychain/android-libs/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockFragment.java
@@ -0,0 +1,68 @@
+package com.actionbarsherlock.app;
+
+import android.app.Activity;
+import android.support.v4.app.Fragment;
+import com.actionbarsherlock.internal.view.menu.MenuItemWrapper;
+import com.actionbarsherlock.internal.view.menu.MenuWrapper;
+import com.actionbarsherlock.view.Menu;
+import com.actionbarsherlock.view.MenuInflater;
+import com.actionbarsherlock.view.MenuItem;
+
+import static com.actionbarsherlock.app.SherlockFragmentActivity.OnCreateOptionsMenuListener;
+import static com.actionbarsherlock.app.SherlockFragmentActivity.OnOptionsItemSelectedListener;
+import static com.actionbarsherlock.app.SherlockFragmentActivity.OnPrepareOptionsMenuListener;
+
+public class SherlockFragment extends Fragment implements OnCreateOptionsMenuListener, OnPrepareOptionsMenuListener, OnOptionsItemSelectedListener {
+ private SherlockFragmentActivity mActivity;
+
+ public SherlockFragmentActivity getSherlockActivity() {
+ return mActivity;
+ }
+
+ @Override
+ public void onAttach(Activity activity) {
+ if (!(activity instanceof SherlockFragmentActivity)) {
+ throw new IllegalStateException(getClass().getSimpleName() + " must be attached to a SherlockFragmentActivity.");
+ }
+ mActivity = (SherlockFragmentActivity)activity;
+
+ super.onAttach(activity);
+ }
+
+ @Override
+ public void onDetach() {
+ mActivity = null;
+ super.onDetach();
+ }
+
+ @Override
+ public final void onCreateOptionsMenu(android.view.Menu menu, android.view.MenuInflater inflater) {
+ onCreateOptionsMenu(new MenuWrapper(menu), mActivity.getSupportMenuInflater());
+ }
+
+ @Override
+ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+ //Nothing to see here.
+ }
+
+ @Override
+ public final void onPrepareOptionsMenu(android.view.Menu menu) {
+ onPrepareOptionsMenu(new MenuWrapper(menu));
+ }
+
+ @Override
+ public void onPrepareOptionsMenu(Menu menu) {
+ //Nothing to see here.
+ }
+
+ @Override
+ public final boolean onOptionsItemSelected(android.view.MenuItem item) {
+ return onOptionsItemSelected(new MenuItemWrapper(item));
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ //Nothing to see here.
+ return false;
+ }
+}