X-Git-Url: https://git.gag.com/?a=blobdiff_plain;ds=sidebyside;f=android%2Fsrc%2Fnet%2Fsf%2Fopenrocket%2Fandroid%2Factionbarcompat%2FActionBarHelper.java;fp=android%2Fsrc%2Fnet%2Fsf%2Fopenrocket%2Fandroid%2Factionbarcompat%2FActionBarHelper.java;h=0000000000000000000000000000000000000000;hb=9349577cdfdff682b2aabd6daa24fdc3a7449b58;hp=e0595d8fc99dd1ce054855833a613609a392602d;hpb=30ba0a882f0c061176ba14dbf86d3d6fad096c02;p=debian%2Fopenrocket diff --git a/android/src/net/sf/openrocket/android/actionbarcompat/ActionBarHelper.java b/android/src/net/sf/openrocket/android/actionbarcompat/ActionBarHelper.java deleted file mode 100644 index e0595d8f..00000000 --- a/android/src/net/sf/openrocket/android/actionbarcompat/ActionBarHelper.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright 2011 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.sf.openrocket.android.actionbarcompat; - -import net.sf.openrocket.R; -import android.app.Activity; -import android.os.Build; -import android.os.Bundle; -import android.view.Menu; -import android.view.MenuInflater; - -/** - * An abstract class that handles some common action bar-related functionality in the app. This - * class provides functionality useful for both phones and tablets, and does not require any Android - * 3.0-specific features, although it uses them if available. - * - * Two implementations of this class are {@link ActionBarHelperBase} for a pre-Honeycomb version of - * the action bar, and {@link ActionBarHelperHoneycomb}, which uses the built-in ActionBar features - * in Android 3.0 and later. - */ -public abstract class ActionBarHelper { - protected Activity mActivity; - - /** - * Factory method for creating {@link ActionBarHelper} objects for a - * given activity. Depending on which device the app is running, either a basic helper or - * Honeycomb-specific helper will be returned. - */ - public static ActionBarHelper createInstance(Activity activity) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { - return new ActionBarHelperICS(activity); - } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { - return new ActionBarHelperHoneycomb(activity); - } else { - return new ActionBarHelperBase(activity); - } - } - - protected ActionBarHelper(Activity activity) { - mActivity = activity; - } - - /** - * Action bar helper code to be run in {@link Activity#onCreate(android.os.Bundle)}. - */ - public void onCreate(Bundle savedInstanceState) { - } - - /** - * Action bar helper code to be run in {@link Activity#onPostCreate(android.os.Bundle)}. - */ - public void onPostCreate(Bundle savedInstanceState) { - } - - /** - * Action bar helper code to be run in {@link Activity#onCreateOptionsMenu(android.view.Menu)}. - * - * NOTE: Setting the visibility of menu items in menu is not currently supported. - */ - public boolean onCreateOptionsMenu(Menu menu) { - return true; - } - - /** - * Action bar helper code to be run in {@link Activity#onTitleChanged(CharSequence, int)}. - */ - protected void onTitleChanged(CharSequence title, int color) { - } - - /** - * Sets the indeterminate loading state of the item with ID {@link R.id.menu_refresh}. - * (where the item ID was menu_refresh). - */ - public abstract void setRefreshActionItemState(boolean refreshing); - - /** - * Returns a {@link MenuInflater} for use when inflating menus. The implementation of this - * method in {@link ActionBarHelperBase} returns a wrapped menu inflater that can read - * action bar metadata from a menu resource pre-Honeycomb. - */ - public MenuInflater getMenuInflater(MenuInflater superMenuInflater) { - return superMenuInflater; - } - - public abstract void setDisplayHomeAsUpEnabled( boolean enabled ); - - public abstract void hide(); -}