[TIMOB-15021] Android: Use new ActionBar compatibility in Android Support Library 18 to enable ActionBar on all Android versions
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-03-28T22:46:24.000+0000 |
Affected Version/s | n/a |
Fix Version/s | 2014 Sprint 06, 2014 Sprint 06 SDK, Release 3.3.0 |
Components | Android |
Labels | actionbar, android, module_actionbar, qe-testadded, triage |
Reporter | Mark Mokryn |
Assignee | Hieu Pham |
Created | 2013-08-20T08:06:41.000+0000 |
Updated | 2014-05-02T22:17:00.000+0000 |
Description
This is new in Android Support Library 18: http://developer.android.com/reference/android/support/v7/app/ActionBar.html
Should be relatively low hanging fruit - use the support library's activity and action bar's APIs instead of the base Android APIs, and we get Action Bars on all Android versions :)
Titanium already uses the v4 support library for things like fragments - just need to upgrade to the latest v4, add the v7 appcompat lib, and mostly find where android.app.Activity should be replaced by android.support.v7.app.ActionBarActivity
Google video on usage of this library:
http://www.youtube.com/watch?v=6TGgYqfJnyc
I was able to build 3.2.0 with this, but trying to run a test app Studio can't find the resource. If anyone on the Ti team can help it would be great. The intent is to submit a pull request if I can get it to work. See my issue here: http://developer.appcelerator.com/question/156202/android-actionbar-compatibility-library
Pull request: https://github.com/appcelerator/titanium_mobile/pull/4591 Builds cleanly but untested due to the issue in previous comment. It would be great if someone familiar with Titanium Android build integration can help...... Thanks.
Please add this very useful feature to Titanium Mobile.
I believe (hope?) I already did much of the work required - just stuck on how to use an Android library with resources on Titanium, so I can't test. This is a generic issue - not due to this library specifically. Would be great if anyone can assist with that aspect, at least.
Please add this to the Titanium Mobile!!!
Please can we have an official response to this. As it stands this is much needed functionality and it's making life very difficult not knowing if this will be implemented. If it's not happening at all then please just say. I would like to know whether to hold out for this or to start hacking something in myself.
Hello Lee, I agree with the need for this capability and I think it is necessary for Titanium to live up to the vision of providing a first class native experience. I believe that Appcelerator uses the number of watchers as a measure of the interest by the community. If you really want to see this happen, you might try to rally the community to sign up as watchers to make this a more visible issue. John
This would be huge if you can get this in sooner than later.
I actually managed to have actionbarsherlock (and appcompat before) working with Ti framework. I have it packaged with the framework then correctly used to generate and compile the app. I was abled to do that thanks to the new cli for Android. Thanks to a few line changes i had it working great. And it should work with any 3rdparty library. A little more work needs to be done to allow it inside submodules. But it s mostly there Will soon be published [here](https://github.com/Akylas/titanium_mobile)
According to Martin and Chris Barber we are already there: https://github.com/appcelerator/titanium_mobile/pull/4935 Any chance of pushing ActionBarCompat to 3.2.0? Would be a huge win! The source code changes in Titanium are actually quite few.
I don't believe so, but we'll take a look.
This would be great to have in 3.3.0, since Android 2.3.3. will still be around for some time. I see people still buying new (!!) phones running this.
This is actually quite urgent. For example, the Google Cast Android Sender API requires the appcompat library. https://developers.google.com/cast/docs/android_sender Also noting from that page: Note: Since the libraries contribute resources, you cannot simply satisfy the dependencies by including their JAR files; instead you need to import them as library projects for your IDE.
It's awesome that this is already merged for 3.3.0 - great job! Now that this is done it's a great time to add full support for Action Bar functionality for all Android versions: * Action Views (parity with iOS titleControl) * Action Providers, including Share and Custom action providers * Dropdown navigation * ActionBar styling * Split ActionBar
All subtasks done. Resolving Ticket
I just tried 3.3.0 Kitchen Sink, it works fine. However when I tried to use the SearchView widget it bugged out complaining that it requires API 11. It would be a shame to go this far and not use all the appcompat features, including SearchView, e.g. https://developer.android.com/reference/android/support/v7/widget/SearchView.html
And how about action providers? Is there a ticket for that already? Would really like to use the share action provide eg.