johannilsson / android-actionbar

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

Use more appropriate themes on API level 11 and above #56

Closed rfgamaral closed 12 years ago

rfgamaral commented 12 years ago

I found a small bug on Android which we introduced in the ActionBar on 4caf6f3637daabd011107a2e669f9b95e8618139. The problem exists in the Light theme which I'm using in my app. This bug does not exist on the Default/Dark theme, that's why I noticed it in the first place.

This particular bug happens with all kinds of "popup" windows, like a ContextMenu or an AlertDialog. In the image below you can look at the problem on the Light theme, but everything's fine on the Dark/Default version:

This issue aims to fix it by using the .NoActionBar sub-theme instead, which, apparently, don't show this weird bug. It actually makes more sense to use this theme in this specific library, which is an ActionBar replacement.

For now, this is the solution, and hopefully, it doesn't have any side-effects. However, I already reported the problem to Adam Powell and he said he would look into it. I'll be monitoring this problem and if there's any reason to reverse this commit (or maybe change it a little), I'll fix it as soon as possible. In the mean time, I think it's safe to use this.NoActionBar sub-theme.

johannilsson commented 12 years ago

Late reply, yes makes sense to use the NoActionBar theme.

rfgamaral commented 12 years ago

I just had the confirmation from Adam Powell from Google that the problem I described here with the original theme is a bug and that will be fixed on the next Android update. I think it's safe to use these .NoActionBar themes on this specific library. Feel free to merge the pull request whenever you want :)

rfgamaral commented 12 years ago

The d1017d7 commit above works around the issue described here: http://code.google.com/p/android/issues/detail?id=15862

I just noticed this problem while testing my app on every Honeycomb version. The problem exists on 3.0 and 3.1 but not 3.2 (the theme attribute is public on this latest version).

johannilsson commented 12 years ago

Good catch on the last one. Thanks.

rfgamaral commented 12 years ago

The styling is not that complex, the problem is these tiny bugs that Google misses... The default (dark) version on Honeycomb 3.0 has all the Holo styles public, but the light version misses a few, which got fixed on Honeycomb 3.2.

Yeah, sorry about the naming, that's my bad. I wasn't sure what to pick and eventually picked one similar to the default name, minus the namespace of course. Maybe I over-thought this, Jake's solution is much cleaner. But since it's already merged, maybe we should just leave it like this for now.