Skip to content
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 from
Closed

Mimic Native ActionBar API #25

wants to merge 47 commits into from

Conversation

JakeWharton
Copy link
Contributor

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.

…he standard navigation state (i.e., not tabbed or list navigation).
…ated marshal to `setDisplayShowHomeEnabled(boolean)`.
…te example application to demonstrate all the new features. Clean up some code from previous commits to conform to existing style of library.
@JakeWharton
Copy link
Contributor Author

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

…he screen and aligns more properly with the up indicator.
…underlying values are relevant to the current action bar state.
…e available on API level 4 and our minimum target is API level 3.
…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
Copy link
Contributor Author

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
Copy link
Owner

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
Copy link

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

@kottkrig
Copy link

Amazing! Great work.

@johannilsson
Copy link
Owner

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 8 commits May 17, 2011 10:29
…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.
…ative-api

Conflicts:
	actionbar/src/com/markupartist/android/widget/ActionBar.java
@JakeWharton
Copy link
Contributor Author

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.

…) methods require that the item is checkable.
…ty for future support of custom views and showAsAction support.
…iew in the click listener. Use direct lookups to Action and Tab instance properties to save a method lookup and call.
…he native ActionBar.Tab class. Demo activity has been updated to randomly assign these to new tabs.
@JakeWharton
Copy link
Contributor Author

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
Copy link
Owner

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.

…tion(...)-style methods. The Menu implementation has been moved to a local subclass which is accessable via the `asMenu()` method.
@johannilsson
Copy link
Owner

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
Copy link
Contributor Author

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants