transparency webView - java

I am trying to make my background webView transparent like that :
webView.setBackgroundColor(0x00000000);
but it doesn't work and if I add this line everything is transparent(I don't see my html page) :
webView.setLayerType(WebView.LAYER_TYPE_SOFTWARE, null);
I read that some times there is a problem when this android:hardwareAccelerated="true" is in the manifest, but I don't have this line.
HTML :
<BODY style=\"padding:0;margin:0;\">
<div style="padding:0;margin:0;background:transparent;border:none;position:relative;cursor:pointer;overflow:hidden;height:165px;">
<object ggnoclick ggswfcid name="fo_GGUID" id="fo_GGUID" width="100%" height="165" data="http://c.gumgum.com/ads/com/cesar/big_dogs/cesar_250x100_01.swf?modalURL=GGUID" type="application/x-shockwave-flash" allowscriptaccess="always" wmode="transparent" background="transparent" style="background:transparent;">
<param name="AllowScriptAccess" value="always" />
<param name="wmode" value="transparent" />
</object>
</div>
</BODY>

myWebView.setBackgroundColor(0);
This works for my case.I use android 2.2.
See that same topic in This Link

Related

Running an applet - Blocked by Security

Basically, what I am trying to do is run an applet.
I made applet, tested it (offline, from Eclipse), exported .jar file and posted on dropbox.com. Then I made simple hmtl which should run that applet.
However I can't get pass the Java security (keep getting "Application Blocked by Java Security" error), even after adding dropbox to "Exception Site List" in Java Control Panel.
<!DOCTYPE html>
<html>
<head>
<title>
My Title v3.0
</title>
</head>
<body>
<object width="480" height="360" data="MyNumber.jar" type="application/x-java-applet">
<param name="codebase" value="https://www.dropbox.com/s/mz6y145mwdtge7r/MyNumber.jar?dl=0" />
<param name="code" value="mynumber.online.MyNumberOnline />
<param name="width" value="480" />
<param name="height" value="360" />
<param name="archive" value="MyNumber.jar" />
</object>
</body>
</html>
Is there a way to get past this?
You have to sign this applet with a certificate as the dialog says "identified by a certificate".

JSP markup inside <tiles:put> or a or an alternative

I've inherited an old application that is using Struts 1.2 Tiles 1. For various annoying reasons I can't upgrade.
I'm not very familiar with Struts, or specifically Tiles in general and I'm trying to do something that makes sense in my head but I can't seem to make work in practice. Here's an example of what I'm trying to accomplish:
<tiles-definition>
<definition name="content-with-sidebar" path="/content_with_sidebar.jsp">
<put name="top" value="" type="string" />
<put name="sidebar" value="/tiles/sidebar.jsp" />
<put name="main" value="" type="string" />
<put name="bottom" value="" type="string" />
</definition
</tiles-definition>
content_with_sidebar.jsp
...
<tiles:insert attribute="top" flush="false" />
<div id="content">
<aside>
<tiles:insert attribute="sidebar" flush="false" />
</aside>
<div id="main">
<tiles:insert attribute="main" flush="false" />
</diV>
</div>
<tiles:insert attribute="top" flush="false" />
...
actual_page.jsp
<tiles:insert definition="content-with-sidebar" flush="false">
<tiles:put name="top" type="string">
<div>Maybe this page has something on the top that isn't the page header</div>
</tiles:put>
<!-- use the default sidebar -->
<tiles:put name="main">
<strong>Current Location:</strong>
<address><h:outputText value="#{locationDesc} #{zipCode}" /></address>
<!-- Some more dynamic jsp markup -->
</tiles:put>
<!-- This one doesn't have anything extra on the bottom -->
</tiles:insert>
This almost works but the dynamic bits get rendered above and outside the <tiles:insert> and the plain strings go where they should. I understand now, after much searching, that <tiles:put> in this, er, context, is expecting a plain ole string.
Is there a pattern to accomplish what I want with dynamic context?
As it stands I'm having to create another jsp file to be referenced by the <tiles:put> tag. i.e.
<tiles:put name="main" value="/actual_page_body.jsp" />
I'd rather not have to create an additional file when one would do. Any advice would be helpful.
With tiles, when the definition is rendered (content-with-sidebar in your code), the jsp corresponding to the 'path' attribute (/content_with_sidebar.jsp) will be invoked. All other jsps have to be manually invoked using a <tiles:insert>. What tiles provides you is a way to configurationally invoke them as definition attributes.

Composition is not rendered in Richfaces tabPanel

I am a user of JSF and Richfaces. I will simplify the code about my question to make things easier.
I have a composition named 'mytab.xhtml' defined like following:
<cc:interface>
<cc:attribute name="header" required="true"/>
</cc:interface>
<cc:implementation>
<rich:tab id="my-tab" header="#{cc.attrs.header}" >
<cc:insertChildren />
</rich:tab>
</cc:implementation>
This composition is used in another xhtml file like following:
<rich:tabPanel id="tp" switchType="ajax" headerPosition="top" >
<ic:mytab id="tab1" header="header1">
<h:outputText>content1</h:outputText>
</ic:mytab>
<ic:mytab id="tab2" header="header2">
<h:outputText>content1</h:outputText>
</ic:mytab>
</rich:tabPanel>
But it is very strange that the tab is not rendered at all.
To find the reason, if I add an outputText in the composition definition file like this:
<cc:interface>
<cc:attribute name="header" required="true"/>
</cc:interface>
<cc:implementation>
<h:outputText>#{cc.attrs.header}</h:outputText>
<rich:tab id="my-tab" header="#{cc.attrs.header}" >
<cc:insertChildren />
</rich:tab>
</cc:implementation>
The outputText will be rendered, but tab is not rendered.
Or, if I change one of the tab to richfaces tab directly:
<rich:tabPanel id="tp" switchType="ajax" headerPosition="top" >
<ic:mytab id="tab1" header="header1">
<h:outputText>content1</h:outputText>
</ic:mytab>
<rich:tab id="tab2" header="header2">
<h:outputText>content1</h:outputText>
</rich:tab>
</rich:tabPanel>
The first tab will not be rendered, but the second tab will be rendered.
Thank you if you could give me any help.
Composite components are rendered as own UINamingContainer. So between the UITabPanel and the UITab-component now is a UINamingContainer, UITab might not know what to do with it (same problem with datatable, by the way). What you can do is to use a classic facelet tag instead.

Iframe over applet flickering

I am using a iFrame to show content over my Applet in my online game.
It work's perfectly in Safari, Chrome, Firefox, Opera etc. But as always not in Internet Explorer on Windows.
When the iframe opens over the applet, the content become to "Flickering"/"Blinking" like the applet is updating a lot, which it doesn't.
What can i do? I am using this:
<applet id="applet" code="main.AvatarClient.class" archive="qqqqqAvatarClient.jar" name="Chat" width="760" height="582" scriptable="true" MAYSCRIPT="true" >
<param name="cache_option" value="YES" / >
<param name="localization" value="locDK/" />
<param name="userName" value="<?=$user?>" />
<param name="password" value="<?=$pass?>" />
And the overlay where iframe is:
<div class="add-block qw no-rounded-borders" id="wo" style="position:absolute;left:756px;margin-top:-30px;z-index:99999999999999999999999999999999999999999999999999999999999999;height:380px;width:495px;display:none;">
<iframe id="my" src="loading.php" frameborder="0" height="380" width="496" scrolling="no" style="z-index:9999999999999999999999999999999999;position:absolute"></iframe>
</div>

Can't load Java applet from another directory in HTML

When i try to load an applet with :
<object type="application/x-java-applet" height="300" width="550">
<param name="code" value="Sokoban" />
</object>
when the html file is in the same directory as the applet it loads as expected.
But when the applet is in an another directory the following code won't work :
<object type="application/x-java-applet" height="300" width="550">
<param name="code" value="sokoban/Sokoban" />
</object>
(sokoban is the directory the applet is in, Sokoban is the applet => Sokoban.class)
Use deployJava.js to deploy the applet (linked from the applet info. page).
Use the codebase attribute to point to the sokoban directory.
Since the code attribute needs to be the fully qualified class name, return it to just Sokoban

Categories

Resources