A photoView to scale image and finish activity,高仿微信可拖拽返回PhotoView

Overview

DragPhotoView(English)

高仿微信可拖拽返回PhotoView

基于 PhotoView

##下载APK体验

特性

  • 拖拽缩放图片,并且结束Activity
  • 其他PhotoView所有特性如下:
  • Out of the box zooming, using multi-touch and double-tap.
  • Scrolling, with smooth scrolling fling.
  • Works perfectly when used in a scrolling parent (such as ViewPager).
  • Allows the application to be notified when the displayed Matrix has changed. Useful for when you need to update your UI based on the >current zoom/scroll position.
  • Allows the application to be notified when the user taps on the Photo.

image

使用

修改你的 build.gradle文件

//root project
allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}
    
//module project
    	dependencies {
	        compile 'com.github.githubwing:DragPhotoView:1.0.1'
	}
    

使用法放和普通的ImageView一毛一样

	// 所有ImageView用法都可以	
	DragPhotoView photoView = (DragPhotoView)findViewById(R.id.photoView);
	photoView.setImageResource(R.drawable.ram);
	//必须添加一个onExitListener,在拖拽到底部时触发.	
	photoView.setOnExitListener()
	
	photoView.setOnTapListener()

小贴士

想要达到demo效果,需要把你的Activity背景改为透明

修改style.xml

  <style name="translucent" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:windowBackground" >@android:color/transparent</item>
        <item name="android:windowIsTranslucent">true</item>
    </style>

全版本共享元素实现(包括Activity转跳和拖拽共享元素)在Demo里,如有需要,参照demo思路实现即可.

欢迎Star ,欢迎加入我的Android酒馆 :425983695

License

Copyright 2016 androidwing1992

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You might also like...
Android library to generate image avatar from the first letter of a username. Letter avatar like Gmail Android best practice
Android library to generate image avatar from the first letter of a username. Letter avatar like Gmail Android best practice

AvatarImageGenerator Generate first letter avatar Image like gmail's contact avatar. It generates an drawable that can be be set to an ImageView. Inst

Custom ImageView to generate captcha image.
Custom ImageView to generate captcha image.

CaptchaImageView Custom ImageView to generate captcha image. Add CaptchaImageView to your layout test.jinesh.captchaimageviewlib.CaptchaImageView

This is a library for make auto slide image in android
This is a library for make auto slide image in android

Auto Image Slider Screenshot Image Slider Default Image Slider With Custom Adapter Usage Add ImageSlider to your layout

Android Library for cropping an image at ease.
Android Library for cropping an image at ease.

Cropper - Android Image Cropper Android Image Cropper Powerful (Zoom, Rotation, Multi-Source); Customizable (Shape, Limits, Style); Optimized (Async,

A library for Android provides blurred drop shadows to ImageView similar to iOS image backdrop shadows
A library for Android provides blurred drop shadows to ImageView similar to iOS image backdrop shadows

A library for Android provides blurred drop shadows to ImageView similar to iOS image backdrop shadows.Provides fast canvas draw as no renderscript needed .The similar shadow blurred effects can also be seen in iOS Music App.

ImageView and FrameLayout with gestures control and position animation
ImageView and FrameLayout with gestures control and position animation

GestureViews ImageView and FrameLayout with gestures control and position animation. Main goal of this library is to make images viewing process as sm

TouchPhotoViewer - A project configured with the AndroidX SDK 21 and and higher

TouchPhotoViewer A project configured with the AndroidX SDK 19 and and higher License Copyright (C) 2022 by HoangChung Licensed Licensed under the Apa

This light-weight library provides images with letter/text like the Gmail app. It extends the Drawable class thus can be used with existing/custom/network ImageView classes. Also included is a fluent interface for creating drawables and a customizable ColorGenerator.
Android ImageView widget with zoom and pan capabilities

ImageViewTouch for Android ImageViewTouch is an android ImageView widget with zoom and pan capabilities. This is an implementation of the ImageView wi

Comments
  • ViewPager 滑动事件冲突

    ViewPager 滑动事件冲突

    1 DragPhotoView 的 dispatchTouchEvent 方法 ACTION_MOVE 里面处理得有问题有时候左右移动会响应 Y 轴 onActionMove 事件 有时候又交给 viewpager 去处理了 2 下滑到一部分松手会出现另外一个问题DragPhotoView 的 dispatchTouchEvent 方法 MotionEvent.ACTION_UP 里面可能同时触发 onExit onTap 两个回调

    代码还在看,目前只是发现了问题没能解决不好意思。如果能提供一些思路不胜感激 ,这个库 star 这么多还是值得好好维护。

    opened by 13120241790 0
Releases(1.0.2)
Owner
androidwing
androidwing
Slider-Gallery-Zoom: image slider for android supporting indicator and auto scroll with clicking on image

image slider supporting indicator and auto scroll with clicking on image to open full screen image slider swipe and pinch zoom gestures like gallery,just pass your images and the position of the current image.

Mahmoud Elian 3 May 28, 2022
Image Picker with Customizable UI for Android, Pick an image from Gallery

Image Picker A Image Picker Library for Android (Supports Android 12) with fully

null 2 May 29, 2022
Android widget for cropping and rotating an image.

Cropper The Cropper is an image cropping tool. It provides a way to set an image in XML and programmatically, and displays a resizable crop window on

Edmodo 2.9k Nov 14, 2022
Customizable Android full screen image viewer for Fresco library supporting "pinch to zoom" and "swipe to dismiss" gestures. Made by Stfalcon

This project is no longer supported. If you're able to switch from Fresco to any other library that works with the Android's ImageView, please migrate

Stfalcon LLC 1.8k Dec 19, 2022
Add curve at bottom of image views and relative layouts.

Crescento Android library that adds a curve at the below of image views and relative layouts. CrescentoImageView and CrescentoContainer are the image

Shivam Satija 1.3k Nov 18, 2022
Android ImageView replacement which allows image loading from URLs or contact address book, with caching

Smart Image View for Android SmartImageView is a drop-in replacement for Android’s standard ImageView which additionally allows images to be loaded fr

James Smith 1.3k Dec 24, 2022
Replacement for deprecated official Android crop image function

The MIT License (MIT) Copyright (c) 2012 Jan Muller Permission is hereby granted, free of charge, to any person obtaining a copy of this software and

Jan Muller 561 Nov 25, 2022
Custom ImageView for moving image around the screen (Android)

MovingImageView Create a custom ImageView for moving image around the screen. Usage To use MovingImageView, add the module into your project and start

Albert Grobas 819 Nov 18, 2022
Flickable ImageView for Android. It's like a view of twitter's detail image.

FlickableView Flickable ImageView for Android. It's like a view of twitter's detail image. It's possible that other views animate with FlickableView.

goka 153 Nov 14, 2022
Android library written in kotlin that add a noise effect to image.

NoiseView With NoiseView you can easily add a noise effect to your image. See demo on YouTube Setup The library is pushed to jCenter() as an AAR, so y

Przemek 46 Sep 8, 2022