@@ -0,0 +1,2624 @@
+package fr.xtof54.mousetodon;%0A%0Aimport android.webkit.WebView;%0Aimport android.webkit.WebViewClient;%0Aimport android.webkit.WebChromeClient;%0Aimport android.content.Context;%0Aimport android.util.AttributeSet;%0Aimport android.graphics.Canvas;%0Aimport android.graphics.Bitmap;%0Aimport android.view.View;%0A%0Apublic class DetWebView extends WebView %7B%0A    WebView dwv=null;%0A%0A    public DetWebView(Context context) %7B%0A        this(context, null);%0A    %7D%0A%0A    public DetWebView(Context context, AttributeSet attrs) %7B%0A        this(context, attrs, 0);%0A    %7D%0A%0A    public static Bitmap loadBitmapFromView(View v) %7B%0A        Bitmap b = Bitmap.createBitmap( 100,100, Bitmap.Config.ARGB_8888);%0A        Canvas c = new Canvas(b);%0A        // v.layout(v.getLeft(), v.getTop(), v.getRight(), v.getBottom());%0A        v.draw(c);%0A        return b;%0A    %7D%0A%0A    public DetWebView(Context context, AttributeSet attrs, int defStyle) %7B%0A        super(context, attrs, defStyle);%0A        dwv=this;%0A        this.getSettings().setDomStorageEnabled(true);%0A        this.getSettings().setLoadsImagesAutomatically(true);%0A        this.setWebViewClient(new WebViewClient() %7B%0A            @Override %0A            public void onPageFinished(WebView view, String url) %7B %0A                final String xurl=%22%22+url;%0A                System.out.println(%22webimgpage finished %22+url);%0A                dwv.setDrawingCacheEnabled(true);%0A                dwv.buildDrawingCache();%0A                Thread tt = new Thread(new Runnable() %7B%0A                    public void run() %7B%0A                        try %7B%0A                            Thread.sleep(100);%0A                            MouseApp.main.runOnUiThread(new Runnable() %7B%0A                                @Override%0A                                public void run() %7B%0A                                    Bitmap img = loadBitmapFromView(dwv);%0A                                    DetIcons.newImg(xurl,img);%0A                                %7D%0A                            %7D);%0A                        %7D catch (Exception e) %7B%0A                            e.printStackTrace();%0A                        %7D%0A                    %7D%0A                %7D);%0A                tt.start();%0A            %7D %0A        %7D);%0A        this.setWebChromeClient(new WebChromeClient() %7B%0A            public void onProgressChanged(WebView view, int progress) %7B%0A                if(progress == 100) %7B%0A                    System.out.println(%22WEBPROGRESS %22+Integer.toString(progress));%0A                %7D%0A            %7D%0A        %7D);        %0A    %7D%0A%0A    @Override%0A    public void loadUrl(String url) %7B%0A        System.out.println(%22webview LAODURL %22+url);%0A        super.loadUrl(url);%0A    %7D%0A%0A%7D%0A%0A

prepare follow