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 custom listview,with interaction pattern load more and pull to refresh to load data dinamically

The first thing that i have to say is render thanks to johannilsson because all the part of pull to refresh listview is based in the code of his repos

Fabian Leon 447 Nov 15, 2022
Android widget with pull to refresh for all the views,and support loadMore for ListView , RecyclerView, GridView and SwipeRefreshLayout.

CommonPullToRefresh Android widget with pull to refresh for all the views,and support loadMore for ListView,RecyclerView,GridView and SwipeRefreshLayo

null 1.1k Nov 10, 2022
A generic, customizable, open source Android ListView implementation that has 'Pull to Refresh' functionality.

Android 'Pull to Refresh' ListView library Demo video: http://www.youtube.com/watch?v=VjmdELnm3GI Project A generic, customizable, open source Android

Erik Wallentinsen 639 Nov 17, 2022
Android library to display a ListView whose cells are not rigid but flabby and react to ListView scroll.

FlabbyListView This library is not maintained anymore and there will be no further releases Android library to display a ListView which cells are not

JPARDOGO 762 Nov 23, 2022
HorizontalListView is an Android ListView widget which scrolls in a horizontal manner (in contrast with the SDK-provided ListView which scrolls vertically).

HorizontalListView HorizontalListView is an Android ListView widget which scrolls in a horizontal manner (in contrast with the SDK-provided ListView w

MeetMe 722 Nov 10, 2022
A small android library for tagging views inside a ScrollView as "sticky" making them stick to the top of the scroll container until a new sticky view comes and takes it's place

StickyScrollViewItems StickyScrollViewItems is a ScrollView subclass that allowed you to mark items inside the ScrollView as sticky. The items marked

Emil Sjölander 1k Jan 7, 2023
A tiling scrollview to display large picture (similar to iOS "CATiledLayer")

Project is not maintained right now. Please see the note at the end of this file. Introduction This Android widget aims to provide a scalable way to d

Sebastian Roth 245 Nov 25, 2022
This project aims to provide a reusable pull to refresh widget for Android.

Pull To Refresh for Android Note This library is deprecated, a swipe refresh layout is available in the v4 support library. This project aims to provi

Johan Berg 2.5k Jan 2, 2023
Phoenix Pull-to-Refresh

Phoenix Pull-to-Refresh This project aims to provide a simple and customizable pull to refresh implementation. Made in [Yalantis] (https://yalantis.co

Yalantis 4k Dec 30, 2022
Bringing extended scrolling features to Android's native ListView and ExpandableListView.

About QuickScroll QuickScroll is a library aimed at creating similar scrolling experiences to the native Contacts app's People view. It has the same s

Andras Kindler 461 Nov 11, 2022
An easy to use Drag & Drop List for Android. Direct replacement of the android ListView.

DragNDropListView DragNDropListView is a direct replacement for the stock Android ListView. If you know how to use ListView, you already know how to u

null 187 Dec 22, 2022
Easy to use ListView with pinned sections for Android.

Easy to use ListView with pinned sections for Android 2.1 and higher. Pinned section is a header view which sticks to the top of the list until at lea

Sergej Shafarenka 2.6k Dec 21, 2022
A ListView with pinned section headers for Android

PinnedHeaderListView This library provides a sectioned ListView with pinned headers. It looks and feels much like the default contacts app does on And

James Smith 665 Nov 29, 2022
Awesome Listview filter functionality in Android.

About Awesome Listview filter functionality in Android. See it in Action: https://www.youtube.com/watch?v=RO54U1ES5CA Listview with beautiful transpar

Bhavya  Mehta 446 Nov 20, 2022
Android ListView with sticky headers

DEPRECATED HeaderListView is deprecated. No new development will be taking place. Quickstart Import the HeaderListView module in your Android Studio p

Applidium 314 Nov 10, 2022
Simple ListView based Android AccordionView

Android Accordion View Example git pull import to eclipse properties->android uncheck is library run as android application See main.xml. Screenshot L

Maciej Lopacinski 164 Nov 28, 2022
Android ListView that implements the QuickReturn UI pattern. Written from scratch with focus on performance.

QuickReturn Android ListView that implements the QuickReturn UI pattern. Written from scratch with focus on performance. Demo Usage In your build.grad

Felipe Lima 191 Nov 25, 2022
AssignmentListView is an Android ListView widget which calculate image loading times.

AssignmentListView is an Android ListView widget which calculate image loading times.

null 5 Sep 9, 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 Dec 16, 2022