New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mimic Native ActionBar API #25

Closed
wants to merge 47 commits into
base: master
from

Conversation

Projects
None yet
4 participants
@JakeWharton
Contributor

JakeWharton commented May 14, 2011

Mimic the API of the native ActionBar on Android 3.0+. This implements all of the methods using behavior that is follows as closely to the 3.0+ version's implementation as possible.

The example application has also been updated with buttons to demonstrate the new functionality.

JakeWharton added some commits May 14, 2011

Implement all methods from the native ActionBar API which deal with t…
…he standard navigation state (i.e., not tabbed or list navigation).
Add accidentally-removed `clearHomeAction()` method which is a deprec…
…ated marshal to `setDisplayShowHomeEnabled(boolean)`.
Add navigation mode handling (currently only standard and list). Upda…
…te example application to demonstrate all the new features. Clean up some code from previous commits to conform to existing style of library.
@JakeWharton

This comment has been minimized.

Contributor

JakeWharton commented May 14, 2011

Added navigation modes for standard (title only) and list navigation.

JakeWharton added some commits May 14, 2011

Add left padding the logo so it is not directly against the left of t…
…he screen and aligns more properly with the up indicator.
Add logo and home action item. Buttons now enable/disable when their …
…underlying values are relevant to the current action bar state.
Parse Build.VERSION.SDK string since Build.VERSION.SDK_INT only becam…
…e available on API level 4 and our minimum target is API level 3.
Move logo loading to its own class so it properly works on pre-Ginger…
…bread devices. Update both the minimum and target API levels to 4 (Android 1.6) and 10 (Android 2.3.3), respectively. API level 3 accounts for only about 2% of all devices and has a highly broken implementation of the layout rendering engine which already did not render this library properly most of the time. API level 10 is the newest and final API level without a native ActionBar.
@JakeWharton

This comment has been minimized.

Contributor

JakeWharton commented May 15, 2011

I believe I have everything except for tabbed navigation implemented. Been a crazy 24 hours of hacking all this support in but I think it turned out pretty well. I still have a few things on my TODO list other than tabbed navigation but they can wait a bit.

Check out the example app for a full demo of the new features.

QR Code

@johannilsson

This comment has been minimized.

Owner

johannilsson commented May 15, 2011

Wow, you've been busy at work! And it looks really really good, will see if I can fix the tabbed navigation soonish. Sorry that I has been slightly away but it's been a crazy week here.

@slapperwan

This comment has been minimized.

slapperwan commented May 15, 2011

Checked out the example and really like the navigation mode list :)

@kottkrig

This comment has been minimized.

kottkrig commented May 15, 2011

Amazing! Great work.

@johannilsson

This comment has been minimized.

Owner

johannilsson commented May 16, 2011

I've merged this to the branch mimic-native-api and added initial support for tabs.

Support for tabs is far from complete but it do look pretty good already even though it's hacked up and lack support for configuration and such, will continue the work during the week.

JakeWharton and others added some commits May 17, 2011

Convert Actions to be MenuItem implementations and the ActionBar to b…
…e a Menu implementor. This allows for fun stuff like inflation of action items from menu XML files (see OtherActivity in the demo).

Restrictions:
 * isEnabled/isVisible do not work.
 * Home action item must have id of `R.id.actionbar_item_home` to be properly recognized.
Merge remote-tracking branch 'upstream/mimic-native-api' into mimic-n…
…ative-api

Conflicts:
	actionbar/src/com/markupartist/android/widget/ActionBar.java
@JakeWharton

This comment has been minimized.

Contributor

JakeWharton commented May 17, 2011

Let me know what you think of JakeWharton/android-actionbar@0b3d97218adc265a67d8ecb7896abf5d9ef041d3. I can revert it if it is not the route you want to go in. It fixes #7 and is something I do in the custom version of your library that is used in the yet-unreleased ActionBarSherlock v3.

JakeWharton added some commits May 17, 2011

Marshal visibility directly to the view. Make sure the is/setChecked(…
…) methods require that the item is checkable.
Use our Action class to differentiate from MenuItem and add the abili…
…ty for future support of custom views and showAsAction support.
Toggle Action isChecked() on click to allow updating the icon/title/v…
…iew in the click listener. Use direct lookups to Action and Tab instance properties to save a method lookup and call.
Add icon and custom views, along with the remainder of methods from t…
…he native ActionBar.Tab class. Demo activity has been updated to randomly assign these to new tabs.
@JakeWharton

This comment has been minimized.

Contributor

JakeWharton commented May 18, 2011

Updated demo apk linked above for those interested.

Two problems i've noticed:

  • Custom tab views (or at least the simple one I have created) are distorted.
  • List view dropdown doesn't show d-pad selection. The selection with the d-pad works, but there is no state displayed on screen because the list items do not use the normal style.
@johannilsson

This comment has been minimized.

Owner

johannilsson commented May 18, 2011

Jake, this looks really good and you have made huge progress during the last days, I'm not too happy with the naming of the add methods but I guess I can get used to it and I see the benefits of implementing Menu. It might be possible to refactor out handling of action items to a separate view and have addAction methods to delagate to that view from the action bar, will have to think about that. My time is somewhat limited since I can only contribute a few hours each evening, but I will review and apply a few fixes as soon as I can.

I've started to work on the selection issues on the list view last night and I hope to finish that and a few other things during the week. I have also have a couple of uncommited fixes for the tab handling I hope I can wrap up really soon.

Anyway, thank you and I'm looking forward to ActionBarSherlock v3.

JakeWharton added some commits May 18, 2011

Revert implementing the Menu interface directly and use the old xxxAc…
…tion(...)-style methods. The Menu implementation has been moved to a local subclass which is accessable via the `asMenu()` method.
@johannilsson

This comment has been minimized.

Owner

johannilsson commented May 19, 2011

I've pushed a small fix yesterday that solves the list navigation problems with trackball, your latest changes is also merged to mimic-native-api.

@JakeWharton

This comment has been minimized.

Contributor

JakeWharton commented May 31, 2011

Closing this since you've already merged it into a topic branch and I want to delete my forked repo since a few people started to watch it instead of yours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment