Update actionbarsherlock from 4.2 to 4.4
This commit is contained in:
@@ -3,18 +3,17 @@ package android.support.v4.app;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import com.actionbarsherlock.ActionBarSherlock;
|
||||
import com.actionbarsherlock.ActionBarSherlock.OnCreatePanelMenuListener;
|
||||
import com.actionbarsherlock.ActionBarSherlock.OnMenuItemSelectedListener;
|
||||
import com.actionbarsherlock.ActionBarSherlock.OnPreparePanelListener;
|
||||
import com.actionbarsherlock.view.Menu;
|
||||
import com.actionbarsherlock.view.MenuInflater;
|
||||
import com.actionbarsherlock.view.MenuItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/** I'm in ur package. Stealing ur variables. */
|
||||
public abstract class Watson extends FragmentActivity implements OnCreatePanelMenuListener, OnPreparePanelListener, OnMenuItemSelectedListener {
|
||||
private static final boolean DEBUG = false;
|
||||
private static final String TAG = "Watson";
|
||||
|
||||
/** Fragment interface for menu creation callback. */
|
||||
@@ -39,11 +38,11 @@ public abstract class Watson extends FragmentActivity implements OnCreatePanelMe
|
||||
|
||||
@Override
|
||||
public boolean onCreatePanelMenu(int featureId, Menu menu) {
|
||||
if (DEBUG) Log.d(TAG, "[onCreatePanelMenu] featureId: " + featureId + ", menu: " + menu);
|
||||
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onCreatePanelMenu] featureId: " + featureId + ", menu: " + menu);
|
||||
|
||||
if (featureId == Window.FEATURE_OPTIONS_PANEL) {
|
||||
boolean result = onCreateOptionsMenu(menu);
|
||||
if (DEBUG) Log.d(TAG, "[onCreatePanelMenu] activity create result: " + result);
|
||||
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onCreatePanelMenu] activity create result: " + result);
|
||||
|
||||
MenuInflater inflater = getSupportMenuInflater();
|
||||
boolean show = false;
|
||||
@@ -73,10 +72,10 @@ public abstract class Watson extends FragmentActivity implements OnCreatePanelMe
|
||||
|
||||
mCreatedMenus = newMenus;
|
||||
|
||||
if (DEBUG) Log.d(TAG, "[onCreatePanelMenu] fragments create result: " + show);
|
||||
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onCreatePanelMenu] fragments create result: " + show);
|
||||
result |= show;
|
||||
|
||||
if (DEBUG) Log.d(TAG, "[onCreatePanelMenu] returning " + result);
|
||||
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onCreatePanelMenu] returning " + result);
|
||||
return result;
|
||||
}
|
||||
return false;
|
||||
@@ -84,11 +83,11 @@ public abstract class Watson extends FragmentActivity implements OnCreatePanelMe
|
||||
|
||||
@Override
|
||||
public boolean onPreparePanel(int featureId, View view, Menu menu) {
|
||||
if (DEBUG) Log.d(TAG, "[onPreparePanel] featureId: " + featureId + ", view: " + view + " menu: " + menu);
|
||||
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onPreparePanel] featureId: " + featureId + ", view: " + view + " menu: " + menu);
|
||||
|
||||
if (featureId == Window.FEATURE_OPTIONS_PANEL) {
|
||||
boolean result = onPrepareOptionsMenu(menu);
|
||||
if (DEBUG) Log.d(TAG, "[onPreparePanel] activity prepare result: " + result);
|
||||
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onPreparePanel] activity prepare result: " + result);
|
||||
|
||||
boolean show = false;
|
||||
if (mFragments.mAdded != null) {
|
||||
@@ -101,11 +100,11 @@ public abstract class Watson extends FragmentActivity implements OnCreatePanelMe
|
||||
}
|
||||
}
|
||||
|
||||
if (DEBUG) Log.d(TAG, "[onPreparePanel] fragments prepare result: " + show);
|
||||
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onPreparePanel] fragments prepare result: " + show);
|
||||
result |= show;
|
||||
|
||||
result &= menu.hasVisibleItems();
|
||||
if (DEBUG) Log.d(TAG, "[onPreparePanel] returning " + result);
|
||||
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onPreparePanel] returning " + result);
|
||||
return result;
|
||||
}
|
||||
return false;
|
||||
@@ -113,7 +112,7 @@ public abstract class Watson extends FragmentActivity implements OnCreatePanelMe
|
||||
|
||||
@Override
|
||||
public boolean onMenuItemSelected(int featureId, MenuItem item) {
|
||||
if (DEBUG) Log.d(TAG, "[onMenuItemSelected] featureId: " + featureId + ", item: " + item);
|
||||
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onMenuItemSelected] featureId: " + featureId + ", item: " + item);
|
||||
|
||||
if (featureId == Window.FEATURE_OPTIONS_PANEL) {
|
||||
if (onOptionsItemSelected(item)) {
|
||||
|
||||
Reference in New Issue
Block a user