0

I have gallery with custom web views. My adapter:

public class AddImgAdp extends BaseAdapter {
    int GalItemBg;
    private Context cont;

    public AddImgAdp(Context c) {
        cont = c;
        TypedArray typArray = obtainStyledAttributes(R.styleable.GalleryTheme);
        GalItemBg = typArray.getResourceId(R.styleable.GalleryTheme_android_galleryItemBackground, 0);
        typArray.recycle();
    }

    public int getCount() {
        return pagesArray.length;
    }

    public Object getItem(int position) {
        return pagesArray[position];
    }

    public long getItemId(int position) {
        return position;
    }

    public View getView(int position, View convertView, ViewGroup parent) {

        final WebView wView = pagesArray[position];
        if(wView!=null){
            if(wView.loaded==0){
                wView.setInitialScale(50);
                wView.getSettings().setJavaScriptEnabled(true);
                wView.getSettings().setSupportZoom(false);
                wView.getSettings().setBuiltInZoomControls(false);
                wView.getSettings().setUseWideViewPort(true);
                wView.setPadding(0, 0, 0, 0);

                wView.setWebViewClient(new WebViewClient() {
                    @Override
                    public void onReceivedError(WebView view, int errorCode, String description, String failingUrl){
                        super.onReceivedError(view, errorCode, description, failingUrl);
                    }

                    @Override
                    public boolean shouldOverrideUrlLoading(WebView view, String url){
                        view.loadUrl(url);
                        return true;
                    }

                    @Override
                    public void onPageFinished(WebView view, String url){
                        wView.loaded = 1;
                    }

                });

                wView.loadUrl(URL_TO_LOAD);
                wView.setBackgroundResource(GalItemBg);
                Gallery.LayoutParams params = new Gallery.LayoutParams(400, 430);
                wView.setLayoutParams(params);
            }
        }
        return wView;

    }

}

And, how to implement zoom in gallery in such a way that all the whole will increase/decrease?

benni_mac_b
  • 8,803
  • 5
  • 39
  • 59
Nips
  • 13,162
  • 23
  • 65
  • 103

2 Answers2

1

There are no functions that allow you to do this with imageview or gallery.

But here is a excellent tutorial to get you on your way.

Pinch zoom

coder_For_Life22
  • 26,645
  • 20
  • 86
  • 118
0

I have tried with viewflipper, why dont you try like this.I have paste my code here .
http://www.anddev.org/code-snippets-for-android-f33/horizontal-grid-view-in-android-t56753.html

Ramesh Akula
  • 5,720
  • 4
  • 43
  • 67