android - Orientation change messes with hardware acceleration settings -
android - Orientation change messes with hardware acceleration settings -
i'm developing app sdk 11 (honeycomb). in app create utilize of hardware acceleration (at application level) create animations smoother , without it, unacceptably sluggish. since client wants have them, have find solution turning acceleration off.
the problem have activity
contains few webview
elements. 3, exact - 1 shown , 2 others used preloading pages, invisible (i mean positioned off screen, still "visible"). utilize translation animation "switch" between them. hardware acceleration on, render web pages incorrectly - big, flickering black boxes on page. of course of study unacceptable, bypassed problem turning hardware acceleration off webviews:
webview.setlayertype(view.layer_type_software, null);
i've tried set in xml file (android:layertype="software"
), worked same way (as should be). anyway, both methods work pretty - animations , webviews smooth plenty , there no artifacts. problem arises 1 time orientation changes. though create no of import distinctions between portrait , landscape mode in code, works this:
this had led me think hardware acceleration might problem. proved myself right trying set software acceleration @ different levels of view hierarchy see if unusual behavior stops. found out indeed stop, , works without bugs, 1 time whole activity software accelerated, unacceptable me (my translation animations! [+slow scrolling in webviews]). if views/viewgroups in layout xml file set software accelerated, still bugs. there orientation changes can trigger such behavior? solutions, hacks, hints, suggestions, ideas, thoughts, incomplete, welcome - i'm out of those.
if need more info or code, gladly provide you. give thanks time!
android webview screen-orientation hardware-acceleration
Comments
Post a Comment