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

Overview

PullZoomView

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

Features

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

Usage

In your build.gradle:

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

or Maven:

<dependency>
  <groupId>com.github.frank-zhu</groupId>
  <artifactId>pullzoomview</artifactId>
  <version>1.0.0</version>
  <type>aar</type>
</dependency>

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.

Contribution

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.

Thanks

Developers @matrixxun PullToZoomInListView

About me

Click Me

License

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

 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.
Comments
  • 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 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2439) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2495) at android.app.ActivityThread.access$800(ActivityThread.java:153) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1349) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:157) at android.app.ActivityThread.main(ActivityThread.java:5633) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:896) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:712) 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(R.id.scroll_view);
        View headView = LayoutInflater.from(this).inflate(R.layout.profile_head_view, null, false);
    
    
        TextView title = (TextView) headView.findViewById(R.id.tv_title);
        title.setText(feed.getTitle());
    
        TextView author = (TextView) headView.findViewById(R.id.tv_author);
        author.setText(feed.getAuthor());
    
        TextView date = (TextView) headView.findViewById(R.id.tv_date);
        date.setText(feed.getDate());
    
        View zoomView = LayoutInflater.from(this).inflate(R.layout.profile_zoom_view, null, false);
    
        ImageView contentImage = (ImageView) headView.findViewById(R.id.iv_user_head);
        try {
            new ImageDownloaderTask(contentImage).execute(feed.getAttachmentUrl());
        }catch (Exception e){
            e.printStackTrace();
        }
    
        View contentView = LayoutInflater.from(this).inflate(R.layout.profile_content_view, null, false);
    
        TextView htmlTextView = (TextView) contentView.findViewById(R.id.tv_content);
        htmlTextView.setText(Html.fromHtml(feed.getContent(), null, null));
    
        scrollView.setHeaderContainer(headView);
        scrollView.setZoomView(zoomView);
        scrollView.setContentContainerView(contentView);
    }
    

    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遮挡

    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

    顺便说一句,Gradle添加有问题,Manifest提示错误

    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
    BackStackRecord.run() 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

    bug 
    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(PullToZoomListViewEx.java:332)

    PullToZoomListViewEx.onRestoreInstanceState(PullToZoomListViewEx.java:332)

    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.

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

    关于ZoomView触摸事件的拦截

       你好FranK-Zhu,首先非常感谢你提供的开源代码,我从中学习到不少东西。
       现在的情况是这样的,我使用了你的demo,但是遇到一个问题。我的zoomView(或者headView)是
    

    一个地图(高德),在对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.

    screenshot_2015-07-22-23-05-01

    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

    添加一个新的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
Owner
Frank-Zhu
Frank-Zhu
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 Nov 19, 2022
[] 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 Nov 26, 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 10, 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 371 Oct 29, 2022
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 https://github.com/h6

Alex Askerov 920 Nov 17, 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 566 Nov 15, 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 432 Jun 18, 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 Nov 28, 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 Nov 25, 2022
A GridView which can addHeaderView and addFooterView

Please follow me on GitHub, I need your support Github: https://github.com/liaohuqiu twitter: https://twitter.com/liaohuqiu 中文版文档 GridView with Header

Huqiu Liao 1.3k Nov 24, 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 Nov 26, 2022
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 972 Nov 14, 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 Nov 21, 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 Nov 17, 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 Nov 28, 2022
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 Nov 27, 2022