зеркало из https://github.com/mono/mail-archives.git
169 строки
7.6 KiB
HTML
169 строки
7.6 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE> [mono-android] How to use OnProgressChanged in m4a?
|
|
</TITLE>
|
|
<LINK REL="Index" HREF="index.html" >
|
|
<LINK REL="made" HREF="mailto:monodroid%40lists.ximian.com?Subject=%5Bmono-android%5D%20How%20to%20use%20OnProgressChanged%20in%20m4a%3F&In-Reply-To=D6E03668-95BA-47D2-961F-D48B12A46576%40xamarin.com">
|
|
<META NAME="robots" CONTENT="index,nofollow">
|
|
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
<LINK REL="Previous" HREF="007711.html">
|
|
<LINK REL="Next" HREF="007713.html">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#ffffff">
|
|
<H1>[mono-android] How to use OnProgressChanged in m4a?</H1>
|
|
<B>Hernani Delindro</B>
|
|
<A HREF="mailto:monodroid%40lists.ximian.com?Subject=%5Bmono-android%5D%20How%20to%20use%20OnProgressChanged%20in%20m4a%3F&In-Reply-To=D6E03668-95BA-47D2-961F-D48B12A46576%40xamarin.com"
|
|
TITLE="[mono-android] How to use OnProgressChanged in m4a?">vampirevorador at gmail.com
|
|
</A><BR>
|
|
<I>Fri Dec 9 15:54:28 EST 2011</I>
|
|
<P><UL>
|
|
<LI>Previous message: <A HREF="007711.html">[mono-android] How to use OnProgressChanged in m4a?
|
|
</A></li>
|
|
<LI>Next message: <A HREF="007713.html">[mono-android] webservices not working in release mode
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#7714">[ date ]</a>
|
|
<a href="thread.html#7714">[ thread ]</a>
|
|
<a href="subject.html#7714">[ subject ]</a>
|
|
<a href="author.html#7714">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
<HR>
|
|
<!--beginarticle-->
|
|
<PRE>Thanks for the help. That works :)
|
|
|
|
On Fri, Dec 9, 2011 at 7:24 PM, Jonathan Pryor-2 [via Mono for Android] <
|
|
<A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">ml-node+s1047100n5062788h5 at n5.nabble.com</A>> wrote:
|
|
|
|
><i> On Dec 9, 2011, at 12:52 PM, Hernani Delindro wrote:
|
|
</I>><i>
|
|
</I>><i> > Hello, I'm still new to Mono for Android, and C# in general, but I would
|
|
</I>><i> like
|
|
</I>><i> > some help on how to "translate" the following code to m4a, because I'm
|
|
</I>><i> > having trouble understanding with how listeners and callbacks are
|
|
</I>><i> > implemented in m4a.
|
|
</I>><i> >
|
|
</I>><i> > webview.SetWebChromeClient(new WebChromeClient() {
|
|
</I>><i> > public void OnProgressChanged(WebView view, int progress)
|
|
</I>><i> > {
|
|
</I>><i> > activity.SetTitle("Loading...");
|
|
</I>><i> > activity.SetProgress(progress * 100);
|
|
</I>><i> >
|
|
</I>><i> > if(progress == 100)
|
|
</I>><i> > activity.SetTitle(Resource.String.app_name);
|
|
</I>><i> > }
|
|
</I>><i> > });
|
|
</I>><i>
|
|
</I>><i> That is an anonymous inner class, which C# doesn't support. Instead, you
|
|
</I>><i> need to turn it into a "normal" class (either at top-level or a nested
|
|
</I>><i> type, doesn't really matter):
|
|
</I>><i>
|
|
</I>><i> class WebChromeClientDelegator : WebChromeClient {
|
|
</I>><i> public Action<WebView, int> ProgressChanged;
|
|
</I>><i>
|
|
</I>><i> public override void OnProgressChanged (WebView view, int
|
|
</I>><i> newProgress)
|
|
</I>><i> {
|
|
</I>><i> if (ProgressChanged != null)
|
|
</I>><i> ProgressChanged (view, newProgress);
|
|
</I>><i> }
|
|
</I>><i> }
|
|
</I>><i>
|
|
</I>><i> // ...
|
|
</I>><i> webview.SetWebChromeClient (new WebChromeClientDelegator () {
|
|
</I>><i> ProgressChanged = (view, progress) => {
|
|
</I>><i> activity.SetTitle ("Loading...");
|
|
</I>><i> activity.SetProgress (progress * 100);
|
|
</I>><i> if (progress == 100)
|
|
</I>><i> activity.SetTitle
|
|
</I>><i> (Resource.String.app_name);
|
|
</I>><i> },
|
|
</I>><i> });
|
|
</I>><i>
|
|
</I>><i> - Jon
|
|
</I>><i>
|
|
</I>><i> _______________________________________________
|
|
</I>><i> Monodroid mailing list
|
|
</I>><i> [hidden email] <<A HREF="http://user/SendEmail.jtp?type=node&node=5062788&i=0">http://user/SendEmail.jtp?type=node&node=5062788&i=0</A>>
|
|
</I>><i>
|
|
</I>><i> UNSUBSCRIBE INFORMATION:
|
|
</I>><i> <A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">http://lists.ximian.com/mailman/listinfo/monodroid</A>
|
|
</I>><i>
|
|
</I>><i>
|
|
</I>><i> ------------------------------
|
|
</I>><i> If you reply to this email, your message will be added to the discussion
|
|
</I>><i> below:
|
|
</I>><i>
|
|
</I>><i> <A HREF="http://mono-for-android.1047100.n5.nabble.com/How-to-use-OnProgressChanged-in-m4a-tp5062534p5062788.html">http://mono-for-android.1047100.n5.nabble.com/How-to-use-OnProgressChanged-in-m4a-tp5062534p5062788.html</A>
|
|
</I>><i> To unsubscribe from How to use OnProgressChanged in m4a?, click here<<A HREF="http://mono-for-android.1047100.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5062534&code=dmFtcGlyZXZvcmFkb3JAZ21haWwuY29tfDUwNjI1MzR8MTc1OTk0NzAwMg==">http://mono-for-android.1047100.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5062534&code=dmFtcGlyZXZvcmFkb3JAZ21haWwuY29tfDUwNjI1MzR8MTc1OTk0NzAwMg==</A>>
|
|
</I>><i> .
|
|
</I>><i> NAML<<A HREF="http://mono-for-android.1047100.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.InstantMailNamespace&breadcrumbs=instant+emails%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml">http://mono-for-android.1047100.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.InstantMailNamespace&breadcrumbs=instant+emails%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml</A>>
|
|
</I>><i>
|
|
</I>
|
|
|
|
--
|
|
View this message in context: <A HREF="http://mono-for-android.1047100.n5.nabble.com/How-to-use-OnProgressChanged-in-m4a-tp5062534p5063005.html">http://mono-for-android.1047100.n5.nabble.com/How-to-use-OnProgressChanged-in-m4a-tp5062534p5063005.html</A>
|
|
Sent from the Mono for Android mailing list archive at Nabble.com.
|
|
-------------- next part --------------
|
|
An HTML attachment was scrubbed...
|
|
URL: <A HREF="http://lists.ximian.com/pipermail/monodroid/attachments/20111209/87e2232e/attachment.html">http://lists.ximian.com/pipermail/monodroid/attachments/20111209/87e2232e/attachment.html</A>
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--endarticle-->
|
|
<HR>
|
|
<P><UL>
|
|
<!--threads-->
|
|
<LI>Previous message: <A HREF="007711.html">[mono-android] How to use OnProgressChanged in m4a?
|
|
</A></li>
|
|
<LI>Next message: <A HREF="007713.html">[mono-android] webservices not working in release mode
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#7714">[ date ]</a>
|
|
<a href="thread.html#7714">[ thread ]</a>
|
|
<a href="subject.html#7714">[ subject ]</a>
|
|
<a href="author.html#7714">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
|
|
<hr>
|
|
<a href="http://lists.ximian.com/mailman/listinfo/monodroid">More information about the Monodroid
|
|
mailing list</a><br>
|
|
</body></html>
|