android图片缩放双击旋转效果


需要jar源码的请留言吧。


部分源码    demo下载地址

package uk.co.senab.photoview.sample;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class LauncherActivity extends ListActivity {

    public static final String[] options = {"Simple Sample", "ViewPager Sample", "Rotation Sample"};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, options));
    }

    @Override
    protected void onListItemClick(ListView l, View v, int position, long id) {
        Intent intent;

        switch (position) {
            default:
            case 0:
                intent = new Intent(this, SimpleSampleActivity.class);
                break;
            case 1:
                intent = new Intent(this, ViewPagerActivity.class);
                break;
            case 2:
                intent = new Intent(this, RotationSampleActivity.class);
                break;
        }

        startActivity(intent);
    }

}


package uk.co.senab.photoview.sample;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;

/**

 */
public class HackyViewPager extends ViewPager {

    public HackyViewPager(Context context) {
        super(context);
    }

    public HackyViewPager(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        try {
            return super.onInterceptTouchEvent(ev);
        } catch (IllegalArgumentException e) {
            e.printStackTrace();
            return false;
        }
    }

}













你可能感兴趣的:(android图片缩放双击旋转效果)