Giter VIP home page Giter VIP logo

zoomlayout's Introduction

ZoomLayout

ZoomLayout is a ViewGroup, that enables pinch-zoom and panning on child-views.

Download

Add this in your root build.gradle file (not your module build.gradle file):

allprojects {
	repositories {
        maven { url "https://jitpack.io" }
    }
}

Then, add the library to your module build.gradle

dependencies {
    implementation 'com.github.shopgun:zoomlayout:3.0.0'
}

Features

  • Zoom and pan on any view, using multi-touch.
  • Support for scrolling parents (ViewPager e.t.c.)
  • Notifications on zoom, pan, tap e.t.c.

Usage

There is a sample

Issues

Currently childviews doesn't receive touch events.

zoomlayout's People

Contributors

agnesebussone avatar oizo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

zoomlayout's Issues

how to pan to view so that it is in the center of the screen

I have a zoomLayout with size width: 5000dp, height: 3000dp and one of view with size width: 100dp, height: 100dp and position x: 3000dp, y: 1500dp, i have tried engine.panTo and engine.panBy but it moves me to different places on different zoom.
for example: I have minZoom: 1f and maxZoom: 20f

if I set zoom 6.5f and pan to the view, then everything is fine; it is displayed in the center of the screen; if I set zoom 4f, the view is displayed closer to the upper left edge of the screen.
code than pan to view looks something like that:

val screenWidth = resources.displayMetrics.widthPixels
val screenHeight = resources.displayMetrics.heightPixels
val x = view.x - (screenWidth / 2 - view.width / 2)
val y = view.y - (screenHeight / 2 - view.height / 2)
engine.panTo(x = -x, y = -y, animated = true)

Not able to scroll inside recycler view if ZoomLayout is added as parent to Recycler view.

    <com.shopgun.android.zoomlayout.ZoomLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/recycler_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
    </com.shopgun.android.zoomlayout.ZoomLayout>

Able to zoom the recycler view but the scroll is not working

Drag to move require.

Kindly, can you do like this on drag the view it should be moveable in zoom layout?

Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.