forked from JakeWharton/ActionBarSherlock
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change support-lib plugin to allow using binary from Google. Closes J…
…akeWharton#285. Since its true inception (i.e., version 3), ActionBarSherlock has had one major criticism that created a reluctance for a lot of people to leverage it in their apps: its internalization and modification of the Google support library (compatibility package). This was deemed necessary since there is no reliable external way to dispatch anything to attached and visible fragments. With this commit we introduce a new set of base classes which exist independent of the support library (and extend from it) in order to progressively add the action bar functionality. * `SherlockFragmentActivity` replaces `FragmentActivity` and has the job of marshalling our ABS menu classes into native wrappers which can be dispatched along the normal menu callbacks and thus into the appropriate fragments. * `SherlockFragment` (and `SherlockListFragment and `SherlockDialogFragment`) replace `Fragment` and unwrap the menu instances dispatched through the fragment manager so that we can use the ABS menu classes in new callbacks. The regular menu callbacks are finalized just like their activity counterparts so that only the correct ones can be overriden.
- Loading branch information
1 parent
5f395a3
commit e23de78
Showing
96 changed files
with
6,745 additions
and
4,422 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<manifest | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.actionbarsherlock.plugin.support" | ||
android:versionCode="45" | ||
android:versionName="4.0.0-SNAPSHOT"> | ||
|
||
<uses-sdk | ||
android:minSdkVersion="7" | ||
android:targetSdkVersion="15" /> | ||
|
||
</manifest> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# This file is automatically generated by Android Tools. | ||
# Do not modify this file -- YOUR CHANGES WILL BE ERASED! | ||
# | ||
# This file must be checked in Version Control Systems. | ||
# | ||
# To customize properties used by the Ant build system use, | ||
# "ant.properties", and override values to adapt the script to your | ||
# project structure. | ||
|
||
android.library=true | ||
# Project target. | ||
target=android-14 | ||
android.library.reference.1=../../library |
233 changes: 233 additions & 0 deletions
233
plugins/support-lib/src/com/actionbarsherlock/app/MenuItemMule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,233 @@ | ||
package com.actionbarsherlock.app; | ||
|
||
import android.content.Intent; | ||
import android.graphics.drawable.Drawable; | ||
import android.view.ActionProvider; | ||
import android.view.MenuItem; | ||
import android.view.SubMenu; | ||
import android.view.View; | ||
import android.view.ContextMenu.ContextMenuInfo; | ||
|
||
class MenuItemMule implements MenuItem { | ||
private static final String ERROR = "Cannot interact with object designed for temporary " | ||
+ "instance passing. Make sure you using both SherlockFragmentActivity and " | ||
+ "SherlockFragment."; | ||
|
||
|
||
private final com.actionbarsherlock.view.MenuItem mItem; | ||
|
||
public MenuItemMule(com.actionbarsherlock.view.MenuItem item) { | ||
mItem = item; | ||
} | ||
|
||
public com.actionbarsherlock.view.MenuItem unwrap() { | ||
return mItem; | ||
} | ||
|
||
|
||
@Override | ||
public boolean collapseActionView() { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public boolean expandActionView() { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public ActionProvider getActionProvider() { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public View getActionView() { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public char getAlphabeticShortcut() { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public int getGroupId() { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public Drawable getIcon() { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public Intent getIntent() { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public int getItemId() { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public ContextMenuInfo getMenuInfo() { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public char getNumericShortcut() { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public int getOrder() { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public SubMenu getSubMenu() { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public CharSequence getTitle() { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public CharSequence getTitleCondensed() { | ||
return mItem.getTitleCondensed(); | ||
//throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public boolean hasSubMenu() { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public boolean isActionViewExpanded() { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public boolean isCheckable() { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public boolean isChecked() { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public boolean isEnabled() { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public boolean isVisible() { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public MenuItem setActionProvider(ActionProvider arg0) { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public MenuItem setActionView(View arg0) { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public MenuItem setActionView(int arg0) { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public MenuItem setAlphabeticShortcut(char arg0) { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public MenuItem setCheckable(boolean arg0) { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public MenuItem setChecked(boolean arg0) { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public MenuItem setEnabled(boolean arg0) { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public MenuItem setIcon(Drawable arg0) { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public MenuItem setIcon(int arg0) { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public MenuItem setIntent(Intent arg0) { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public MenuItem setNumericShortcut(char arg0) { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public MenuItem setOnActionExpandListener(OnActionExpandListener arg0) { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public MenuItem setOnMenuItemClickListener(OnMenuItemClickListener arg0) { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public MenuItem setShortcut(char arg0, char arg1) { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public void setShowAsAction(int arg0) { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public MenuItem setShowAsActionFlags(int arg0) { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public MenuItem setTitle(CharSequence arg0) { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public MenuItem setTitle(int arg0) { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public MenuItem setTitleCondensed(CharSequence arg0) { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
|
||
@Override | ||
public MenuItem setVisible(boolean arg0) { | ||
throw new IllegalStateException(ERROR); | ||
} | ||
} |
Oops, something went wrong.