View(s) not visible on Android Jelly Bean
Asked Answered
R

2

12

I'm currently developing an application with which a schedule can be retrieved and viewed. To display the schedule I used the TimeRulerView (and BlocksLayout and BlockView) java source files from the Google IO 2011 app because I liked the look and feel. Source code can be found here: https://github.com/underhilllabs/iosched2011 . (Google replaced there one with the code of IO2012).

Since my Galaxy Nexus updated tot Jelly Bean (4.1.1) yesterday the TimeRulerView (and/or one of the others) doesn't get shown anymore.

The weird thing is that they are actually still there, but there not visible. I can see a scrollbar of the length the timeruler normally has. Also when I normally click on an block in the view I get a little pop-up, and this still happens when not seeing the timeruler or a block.

I tested the original IO2011 app on my JB GN but nothing is visible there either, so the problem lies within (one of) the view(s) or the way JellyBean is rendering the view(s) (project butter maybe?).

See here ( https://dl.dropbox.com/u/7102660/TimeRulerView_JellyBean_problem.zip ) for screenshots on ICS (app working), JB (app not working) and the GoogleIO2011 app.

Resent answered 18/7, 2012 at 11:50 Comment(2)
I have the same problem with ImageViews. Since update to jelly bean, the images wont show up anymore. Though the layout space is calculated properly.. ( i manipulate them in the getView of an custom arrayadapter )Truth
Use hierarchyviewer tool to see bounds of your view. You'll learn if it has zero widht/height, or if there's problem with its child views, or if it has correctly computed size, and content is just not drawing. With this information you can move on.Eyestalk
A
4

Thanks to Chris answer I played around with hardware acceleration settings. I use the iosched2011 code as well and only had to remove the line android:layerType="software" from my BlocksLayout View inside the block_content.xml file .

Almonry answered 27/8, 2012 at 13:19 Comment(1)
This solution is what finally caused my custom views to appear, but some of them were glitchy or displayed wrong. I had to add android:hardwareAccelerated="false" to the activity in the manifest for everything to start working as normal again.Bastogne
D
7

Could this be something to do with Hardware acceleration? I just recently ran into an issue on couple phones with ICS, but not all phones/devices were affected. Adding the hardwareAccelerated tag to my manifest didn't fix the issue either, and I had to define it on specific views that I did not want to be hardware accelerate. My solution used android:layerType="software" in my xml layouts and setLayerType(LAYER_TYPE_SOFTWARE, null) in the java code.

EDIT: Testing this more, it didn't fix my issue using setLayerType on Jelly Bean. Setting the layer type to software on ICS did fix my issue. The only way I could make the views show up was setting the whole application or specific activity to android:hardwareAccelerated="false".

Decerebrate answered 1/8, 2012 at 23:28 Comment(1)
android:hardwareAccelerated="false" was what eventually solved this for me, plus Stefan Arn's solution.Bastogne
A
4

Thanks to Chris answer I played around with hardware acceleration settings. I use the iosched2011 code as well and only had to remove the line android:layerType="software" from my BlocksLayout View inside the block_content.xml file .

Almonry answered 27/8, 2012 at 13:19 Comment(1)
This solution is what finally caused my custom views to appear, but some of them were glitchy or displayed wrong. I had to add android:hardwareAccelerated="false" to the activity in the manifest for everything to start working as normal again.Bastogne

© 2022 - 2024 — McMap. All rights reserved.