johannilsson / android-actionbar

DEPRECATED Android Action Bar Implementation
1.31k stars 564 forks source link

[Q] Does this use native action bar when run on 4.0...??? #55

Closed adiktz closed 12 years ago

adiktz commented 12 years ago

I happen to write an application which would be for 2.3 as well as 3.0 as well as 4.0...!!! I used the native-mimic-api...!!! I want to know if this library would automatically use native action bar on 3.0 and above or not...!!!

The situation is like this, I have an activity in my application which has an EditText in it, now when run in 2.3 its all okay, but when i ran it in 4.0, there is a problem...!!! When I long press on EditText with some text in it, default action bar of android shows with cut,copy past option and my action bar slides down...!!! I would need that when the native action bar is shown, it shouldn't slide down, but should be replaced by that default one...!!!

Any solution...???

rfgamaral commented 12 years ago

I'm afraid not. But I think that @johannilsson's idea has been all along to do that in the future, but we need to ask him about it... I'm curious about one thing:

"I would need that when the native action bar is shown, it shouldn't slide down, but should be replaced by that default one...!!!"

Is this what really happens in Android 4.0? If you are using the native ActionBar, does it really get replaced by the cut/copy/paste bar? I'm really curious because I also noticed that behavior you are describing...

adiktz commented 12 years ago

When I had the code without this library and I had not set the title bar to hide from within my code, then in 4.0, that cut/copy/paste bar used to overlap the title bar...!!! And I guess that title bar in 4.0 is very much called "Action Bar"...!!! More over just to have a solution to this problem, I tried replacing the title bar of the application (requestCustomTitle feature) with the "Action bar" from this library...!!! Thats works fine in Android 4.0, but in pre 3.0 the height of title bar is too small to be approached by this method...!!!

One solution would be to have two different codes which would be switched according to the api version available on the phone, but that would be too much for just one editText...!!!

Now what would be an easy solution to this...???

JakeWharton commented 12 years ago

You can control the height of the title bar with the android:windowTitleSize theme attribute.

adiktz commented 12 years ago

Yes...!!! Lolzzz...!!! I overlooked it...!!! My bad...!!! But I want to know what is the exact size of "action bar" from this library...??? does the height change if its on a Tablet...???

Okay, I will use that for now...!!! I think that would solve my problem...!!! I have almost completed my app, with many action bar dynamic codes, will make the changes and see if it behaves in the same way...!!1

JakeWharton commented 12 years ago

I would set it as

<item name="android:windowTitleSize">@dimen/actionbar_height</item>

so it always matches the height of the action bar.

adiktz commented 12 years ago

In which file exactly, I haven't overridden the theme of the action bar...???

adiktz commented 12 years ago

Of course in my theme file...!!! I get so dumb sometimes...!!1

johannilsson commented 12 years ago

Yes, should work as @JakeWharton suggest, this is how I have done it myself too. Think it would be nice to have a small support library for these things though.

adiktz commented 12 years ago

Yes I did in the conventional way so that I could get the split functionality, but I didn't...!!! Now I am writing it to use custom title bar...!!!

johannilsson commented 12 years ago

If you want a more tight integration there's of course the ActionBarSherlock too, but I guess you already know about that.

Closing this ticket since it's currently out of the scope for this action bar.

rfgamaral commented 12 years ago

Can any of you please recap what needs to be done o hide this library's ActionBar when the default system one, by long pressing an EditText with cut/copy/paste options, appears? I assume that's exactly what's the issue is about?

I'm a little confused on what should be done...