"Android Interface Implementation" Photoview project--implementation of single point/multi-touch zoom image Support

Source: Internet
Author: User

Reprint Please specify source: http://blog.csdn.net/zhaokaiqiang1992

The open source project that we are going to introduce to you today is the Photoview project from GitHub, the main function of this project is to achieve the reduction of the image of the common ImageView control, including single touch and multi touch.

PhotoView's GitHub project address: Https://github.com/chrisbanes/PhotoView

The directory structure of the test project



We can copy the Photoview resource files directly to the project.

Here is the key code

Package Com.example.photoview;import Uk.co.senab.photoview.photoviewattacher;import Android.app.activity;import Android.graphics.drawable.drawable;import Android.os.bundle;import Android.widget.imageview;public Class Mainactivity extends Activity {private ImageView img;private photoviewattacher attacher; @Overrideprotected void OnCreate (Bundle savedinstancestate) {super.oncreate (savedinstancestate); Setcontentview (R.layout.activity_main); img = (ImageView) Findviewbyid (r.id.img);D rawable drawable = Getresources (). getdrawable (R.drawable.ico); Img.setimagedrawable (drawable); attacher = new Photoviewattacher (IMG); attacher.update ();}}

If we were to use the following code,mimageview.setimagedrawable/setimagebitmap/setimageresource/and so on, we just need to call Attacher.update ().

Demo: Https://github.com/ZhaoKaiQiang/PhotoViewDemo

"Android Interface Implementation" Photoview project--implementation of single point/multi-touch zoom image Support

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.