An Android custom ListView and ScrollView with pull to zoom-in.



An Android custom ListView and ScrollView with pull to zoom-in.


  • Set ZoomView enable
  • Add HeaderView Custom
  • ZoomView Parallax or Normal
  • HeaderView Show or Hide


In your build.gradle:

 dependencies {
   compile 'com.github.frank-zhu:pullzoomview:1.0.0'

or Maven:


Using this library?

If you're using this library in one of your projects just send me a G+ message and I'll add your project to the list.


Pull requests are welcome!

If you have a bug to report a feature to request or have other questions, file an issue. I'll try to answer as soon as I can.


Developers @matrixxun PullToZoomInListView

About me

Click Me


Copyright 2014 Frank Zhu

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

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.
  • getSerializableExtra Error

    getSerializableExtra Error

    Hi. I'm trying to set my contents from java class but it gives me the following error: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.samanefarhangi/com.example.samanefarhangi.PullToZoomScrollActivity}: java.lang.ClassCastException: com.example.samanefarhangi.pulllib.PullToZoomScrollViewEx cannot be cast to com.example.samanefarhangi.pulllib.PullToZoomScrollView at at at$800( at$H.handleMessage( at android.os.Handler.dispatchMessage( at android.os.Looper.loop( at at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke( at$ at at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.ClassCastException: com.example.samanefarhangi.pulllib.PullToZoomScrollViewEx cannot be cast to com.example.samanefarhangi.pulllib.PullToZoomScrollView

    here is the code: private void loadViewForCode() {

        feed = (FeedItem) this.getIntent().getSerializableExtra("feed");
        PullToZoomScrollView scrollView = (PullToZoomScrollView) findViewById(;
        View headView = LayoutInflater.from(this).inflate(R.layout.profile_head_view, null, false);
        TextView title = (TextView) headView.findViewById(;
        TextView author = (TextView) headView.findViewById(;
        TextView date = (TextView) headView.findViewById(;
        View zoomView = LayoutInflater.from(this).inflate(R.layout.profile_zoom_view, null, false);
        ImageView contentImage = (ImageView) headView.findViewById(;
        try {
            new ImageDownloaderTask(contentImage).execute(feed.getAttachmentUrl());
        }catch (Exception e){
        View contentView = LayoutInflater.from(this).inflate(R.layout.profile_content_view, null, false);
        TextView htmlTextView = (TextView) contentView.findViewById(;
        htmlTextView.setText(Html.fromHtml(feed.getContent(), null, null));

    I think it's a library problem!

    opened by Sorush-moradisani 6
  • ScrollView Bounce not working

    ScrollView Bounce not working

    I am trying to use PullToZoomScrollViewEx , it is working fine when the height of content view is less then the height of screen, means if content goes out of the screen, zooming stops working. I am using note 3 device. can you please check what is the issue? I tried to use the demo code as well having same issue.

    opened by faizandedia 5
  • zoomView无法正常呈现,被contentView遮挡


    很感谢提供这么酷的控件,但在使用中遇到一些问题 英文比较烂,描述就直接写中文了 我在Activity中仅有此控件:PullToZoomScrollViewEx 但是呈现结果却不尽人意,zoomView被遮挡,且图片高度较高的情况下无法正常缩放 2015-11-02 17 16 35

    代码如下如下 MainActivity 2015-11-02 17 30 52

    activity_main.xml 2015-11-02 17 31 06

    contentView 2015-11-02 17 32 07

    zoomView 2015-11-02 17 32 36

    headerView 2015-11-02 17 32 25


    opened by susuzero 3
  • 滑动切换页面跳页面会报错


    ViewPager +fragmentsList +底部控制按钮做的切换页面。顺序点击控制的时候没问题,但跳着点就会报错。PullToZoomScrollView 页面是第三页,1跳到3,1跳到4或4跳到2时都会报错。 后来在网上找到解决方法 mViewPager.setOffscreenPageLimit(4);//初始化时全部预加载 不知道是bug还是使用方法的问题。发上来希望能帮助遇到同样问题的朋友 Thread [<1> main](Suspended %28exception IllegalArgumentException%29)

    PullToZoomScrollViewEx(View).onRestoreInstanceState(Parcelable) line: 12993 PullToZoomScrollViewEx(PullToZoomBase).onRestoreInstanceState(Parcelable) line: 60
    PullToZoomScrollViewEx(View).dispatchRestoreInstanceState(SparseArray) line: 12969
    PullToZoomScrollViewEx(ViewGroup).dispatchRestoreInstanceState(SparseArray) line: 2761
    LinearLayout(ViewGroup).dispatchRestoreInstanceState(SparseArray) line: 2767
    LinearLayout(View).restoreHierarchyState(SparseArray) line: 12947
    UserFragment(Fragment).restoreViewState(Bundle) line: 447
    FragmentManagerImpl.moveToState(Fragment, int, int, int, boolean) line: 960 FragmentManagerImpl.attachFragment(Fragment, int, int) line: 1291 line: 672 FragmentManagerImpl.execPendingActions() line: 1478 FragmentManagerImpl.executePendingTransactions() line: 478
    RightPagerAdapter(FragmentPagerAdapter).finishUpdate(ViewGroup) line: 141
    MianViewPager(ViewPager).populate(int) line: 1068
    MianViewPager(ViewPager).setCurrentItemInternal(int, boolean, boolean, int) line: 550
    MianViewPager(ViewPager).setCurrentItemInternal(int, boolean, boolean) line: 509
    MianViewPager(ViewPager).setCurrentItem(int) line: 490
    MainActivity$MyOnTabsClickListener.onClick(View) line: 182

    opened by ichynul 2
  • Pull to zoom on WebView

    Pull to zoom on WebView

    Hi, thanks for the great library! Now I'm trying to apply the same effect on WebView - to zoom in it content on pull gesture. But it seems that if I'm just replacing ImageView with WebView - scale logic doesn't work at all, it just showing the bottom (hidden) part of webpage content. Any ideas please?

    opened by sergiiz 2
  • PullToZoomListViewEx.onRestoreInstanceState(


    12-10 17:29:07.293: W/System.err(10310): java.lang.IllegalArgumentException: Wrong state class, expecting View State but received class android.widget.AbsListView$SavedState instead. This usually happens when two views of different type have the same id in the same hierarchy. This view's id is id/pullToZoomListView. Make sure other views do not use the same id.

    opened by jzhu1224 2
  • 关于ZoomView触摸事件的拦截



    一个地图(高德),在对zoomView进行滑动时,会被Listview拦截,页面上下滑动,但是我想要的是地图 相应这些滑动事件,比如两指放大缩小、上下移动...我尝试过给zoomView注册touchListener,并返回true 拦截事件,但是发现这样做没有得到想要的结果,给headView和mHeaderContainer注册ontouchListener 也是如此。 想请教下,这是神马原因?有没有解决的方法或是思路。 如果这个问题比较浅薄或者幼稚请见谅,我是新手。 谢谢。

    opened by DevotedTangLiu 2
  • AppCompatActivity and using ToolBar with transparent status bar

    AppCompatActivity and using ToolBar with transparent status bar

    When I switch PullToZoomScrollActivity to AppCompatActivity and use Toolbar in the layout with transparent status bar, the image doesn't always start at the top of the status bar.

    Also, when you get the layoutParams to make it work, at this line. LinearLayout.LayoutParams localObject = new LinearLayout.LayoutParams(mScreenWidth, (int) (7.0F * (mScreenWidth / 16.0F)));

    Then the Pull down to Zoom still doesn't start until the bottom of the status bar and the status bar has a light grey background.


    Any ideas on the pull down to zoom from the top of the status bar?

    In the mean time, I put android:background="?attr/colorPrimaryDark" in the profile_zoom_view.xml ImageView so the grey status bar will be gone.

    opened by rogue5 1
  • 添加一个新的PullToZoomGridView


    作者大人你好: 我使用了android源码中的 HeaderGridView,想将其加入这个工程中,但是使用PullToZoomBase后 zoomview以及headerview中的控件findviewbyid都是Null

    PullToZoomGridView的代码和PullToZoomListViewEx的代码基本一样,只是继承中改成了PullToZoomBase 是不是这样改不行呢?

    opened by chenzhu33 1
  • Zoom header on fling?

    Zoom header on fling?

    Is it possible to start the zooming effect while flinging/fast scrolling? I mean, right now if you try to fling and you reach the top, there is no zooming. It would be really cool to add this feature to improve motion. Let me know if you need any clarification, I don't know if I explained it clear enough

    opened by amanzan 0
  • 可以说一下实现的思路么,我看源码那个缩放比例看了好久,没有注释


          if ((!mIsFinished) && (mScale > 1.0D)) {
                    float currentThreadTime=SystemClock.currentThreadTimeMillis();
                                   float f1 = ((float) SystemClock.currentThreadTimeMillis()- 

    (float) mStartTime) / (float) mDuration; f2 = mScale - (mScale - 1.0F) * PullToZoomScrollViewEx.sInterpolator.getInterpolation(f1);

    opened by kaka-gk 0
  • PullZoomView 下拉时候事件处理有点问题!

    PullZoomView 下拉时候事件处理有点问题!

    你好!很高兴能用到你的库,在用的时候,发现你的PullZoomView(ScrollView) 下拉时候(在顶部上边还有内容时候)往下拉时候!到内容最top的时候拉不动了!要放手才可以往下拉!你的PullToZoomBase类中 在判断的时候放行了事件,在move时候,导致只能内部的scrollView能滑动,PullZoomView没有把事件拦截,在onInterceptTouchEvent方法中 你在move事件判断是否拦截 ,但是放行了事件给子view move事件不会有了,默认move事件一直给子view,导致出现这个问题!

    opened by joe521123270 0
Android ListView that mimics a GridView with asymmetric items. Supports items with row span and column span

AsymmetricGridView An Android custom ListView that implements multiple columns and variable sized elements. Please note that this is currently in a pr

Felipe Lima 1.8k Jan 7, 2023
[] A swipe menu for ListView.

SwipeMenuListView A swipe menu for ListView. Demo Usage Add dependency dependencies { compile 'com.baoyz.swipemenulistview:library:1.3.0' } Step 1

星一 3.5k Dec 16, 2022
ListView with blur/parallax/sticky capabilities

BlurStickyHeaderListView What is BlurStickyHeaderListView? It is a custom ListView with a header that displays pictures from an URL. It then adds a ni

null 129 Oct 26, 2022
A modified version of Android's experimental StaggeredGridView. Includes own OnItemClickListener and OnItemLongClickListener, selector, and fixed position restore.

StaggeredGridView Introduction This is a modified version of Android's experimental StaggeredGridView. The StaggeredGridView allows the user to create

Maurycy Wojtowicz 1.7k Nov 28, 2022
Kotlin way of building RecyclerView Adapter 🧩. You do not have to write RecyclerView Adapters again and again and suffer from handling of different view types. Kiel will help you.

Kiel Kiel is a RecyclerView.Adapter with a minimalistic and convenient Kotlin DSL which provides utility on top of Android's normal RecyclerView.Adapt

ibrahim yilmaz 370 Jan 2, 2023
Drag and drop GridView for Android

DynamicGrid Drag and drop GridView for Android. Depricated It's much better to use solutions based on recycler view. For example

Alex Askerov 920 Dec 2, 2022
A drag-and-drop scrolling grid view for Android

DraggableGridView¶ ↑ a drag-and-drop scrolling grid view for Android Including in your project¶ ↑ To start using DraggableGridView: Place libs/Draggab

Tom Quinn 565 Dec 27, 2022
A very easy-to-use and non-intrusive implement of Swipe to dismiss for RecyclerView.

RecyclerViewSwipeDismiss A very easy-to-use and non-intrusive implement of Swipe to dismiss for RecyclerView. Preview How to use Add these lines to yo

xcodebuild 431 Nov 23, 2022
*** WARNING: This library is no longer maintained *** An easy way to add a simple 'swipe-and-do-something' behavior to your `RecyclerView` items. Just like in Gmail or Inbox apps.

SwipeToAction An easy way to add a simple 'swipe-and-do-something' behavior to your RecyclerView items. Just like in Gmail or Inbox apps. Integration

Victor Calvello 223 Nov 16, 2022
RecyclerView extension library which provides advanced features. (ex. Google's Inbox app like swiping, Play Music app like drag and drop sorting)

Advanced RecyclerView This RecyclerView extension library provides Google's Inbox app like swiping, Play Music app like drag-and-drop sorting and expa

Haruki Hasegawa 5.2k Dec 23, 2022
👇 Easy Google Photos style multi-selection for RecyclerViews, powered by Kotlin and AndroidX.

Drag Select Recycler View This library allows you to implement Google Photos style multi-selection in your apps! You start by long pressing an item in

Aidan Follestad 1.9k Dec 7, 2022
A GridView which can addHeaderView and addFooterView

Please follow me on GitHub, I need your support Github: twitter: 中文版文档 GridView with Header

Huqiu Liao 1.3k Nov 30, 2022
. Android library that integrate sticky section headers in your RecyclerView

recyclerview-stickyheaders Recyclerview-stickyheaders is an Android library that makes it easy to integrate section headers in your RecyclerView. Thes

null 968 Nov 10, 2022
An android library for section headers that stick to the top

StickyListHeaders StickyListHeaders is an Android library that makes it easy to integrate section headers in your ListView. These section headers stic

Emil Sjölander 5.5k Jan 2, 2023
Android library to achieve in an easy way, the behaviour of the home page in the Expedia app, with a pair of auto-scroll circular parallax ListViews.

ListBuddies This library is not maintained anymore and there will be no further releases Android library of a pair of auto-scroll circular parallax Li

JPARDOGO 970 Dec 29, 2022
Android library to observe scroll events on scrollable views.

Android-ObservableScrollView Android library to observe scroll events on scrollable views. It's easy to interact with the Toolbar introduced in Androi

Soichiro Kashima 9.6k Dec 29, 2022
An Android staggered grid view which supports multiple columns with rows of varying sizes.

AndroidStaggeredGrid ##Notice - Deprecated - 09-2015 This library has been deprecated. We will no longer be shipping any updates or approving communit

Etsy, Inc. 4.8k Dec 29, 2022
An Android Animation library which easily add itemanimator to RecyclerView items.

RecyclerView Animators RecyclerView Animators is an Android library that allows developers to easily create RecyclerView with animations. Please feel

Daichi Furiya 11.2k Jan 5, 2023
Android library providing simple way to control divider items (ItemDecoration) of RecyclerView

RecyclerView-FlexibleDivider Android library providing simple way to control divider items of RecyclerView Release Note [Release Note] (https://github

Yoshihito Ikeda 2.4k Dec 18, 2022