frank-zhu / pullzoomview Goto Github PK
View Code? Open in Web Editor NEWAn Android custom ListView and ScrollView with pull to zoom-in.
License: Apache License 2.0
An Android custom ListView and ScrollView with pull to zoom-in.
License: Apache License 2.0
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.
作者大人你好:
我使用了android源码中的 HeaderGridView,想将其加入这个工程中,但是使用PullToZoomBase后 zoomview以及headerview中的控件findviewbyid都是Null
PullToZoomGridView的代码和PullToZoomListViewEx的代码基本一样,只是继承中改成了PullToZoomBase 是不是这样改不行呢?
Can you please add a simple tutorial on how to use your library?
How to prevent the selection of the row when user is scrolling?
when adding imageview as zoomview and load image from URL, there is a problem with imageview's height.
你好!很高兴能用到你的库,在用的时候,发现你的PullZoomView(ScrollView) 下拉时候(在顶部上边还有内容时候)往下拉时候!到内容最top的时候拉不动了!要放手才可以往下拉!你的PullToZoomBase类中 在判断的时候放行了事件,在move时候,导致只能内部的scrollView能滑动,PullZoomView没有把事件拦截,在onInterceptTouchEvent方法中 你在move事件判断是否拦截 ,但是放行了事件给子view move事件不会有了,默认move事件一直给子view,导致出现这个问题!
当 zoomView 为Viewpager的时候.Viewpager显示不全..Viewpager设置高度也无效
添加底部视图放大和滚动都会混乱
adapter.setData(dynamic.getAllrow());
adapter.notifyDataSetChanged();
adapter.addFooterView(new RecyclerViewHeaderAdapter.ExtraItem(RecyclerViewHeaderAdapter.INT_TYPE_FOOTER, new RecyclerView.ViewHolder(getLayoutInflater().inflate(R.layout.def_loading,null,true)) {
@OverRide
public String toString() {
return super.toString();
}
}));`
测量高度我指getMeasuredHeight。
已经在源代码里将mRootContainer的layoutparms宽高设置为了match_parent
导致的结果就是contentView里match_parent的组件并没有占据剩下的整个屏幕(我碰到的组件是viewpager没有显示)。
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
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);
How to import to Android studio? Thanks.
I need this IOS library in android and I already made a stackOverFlow question and found your lib. can you add blur effect to it?
How to monitor headView slid off the screen .I tried using add ScrollListener and override onTouchEvent ,but it does not work.
你的mHeaderContainer过早填充了,parent不是recycleview所以拿到的布局属性不是瀑布流属性,在onbindview那里直接返回过早填充的mHeaderContainer了
Is this library on maven so I can add it as dependency on Android Studio?
If not please add it :)
Thanks
as编译时出现这个
Error:Execution failed for task ':app:processMallDebugManifest'.
Manifest merger failed : Attribute application@icon value=(@mipmap/ic_launcher) from AndroidManifest.xml:44:9-43
is also present at [com.github.frank-zhu:pullzoomview:1.0.0] AndroidManifest.xml:13:9-45 value=(@drawable/ic_launcher).
Suggestion: add 'tools:replace="android:icon"' to element at AndroidManifest.xml:40:5-449:19 to override.
我在下拉ListView时,当我松开手时,会发生ListView中的item会自动触发点击事件,这是怎么回事,还请作者在百忙之中,为我解答下,十分感谢!!!
这个是反编译最美应用还是参考PullToZoomInListView
Great library thanks but crash when change orientation
I'm trying to use a layout with a ViewPager as a scrollContentView and it is not showing up, I can only see the header.
hi, Thanks for your great lib ,
is there any way to put a textview bottom of image to slide with contentview ?
I need to set OnScrollListener for PullToZoomListViewEx to be able to endlessly scroll the list and get results.
如果列表的高度和屏幕高度一样时,滑动到底部后 ,headerView刚好隐藏时 ,列表无法向上滑动
hi, Thanks for your great lib ,
is there any way to put a textview bottom of image to slide with contentview ?
Hi, first of all thanks for the lib! It's really great. I would like to ask if it's possible to place a button in content view and it will be half in content view and half in zoom view (the half that will be in zoom view i want to be transparent, so you will see the button and the rest of the zoom view). With this as default, it will scroll down with the rest of the content view. I have try a lot of things, still nothing exactly as i want it. So if you know any way to do this, it will be great. Thank's anyway.
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!
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.
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.
I want to know whether this has a compile link?
报这样的错
Unable to start activity ComponentInfo{com.xx.xxxx/com.xx.xxxx.ui.XXXXActivity}: android.view.InflateException: Binary XML file line #16: Error inflating class com.ecloud.pulltozoomview.PullToZoomScrollViewEx
16行就是声明该控件的地方
/Users/rong/AndroidStudioProjects/Pikpet/app/build/intermediates/res/merged/debug/drawable-hdpi-v4/ic_launcher.png: error: Duplicate
file./Users/rong/AndroidStudioProjects/Pikpet/app/build/intermediates/res/merged/debug/drawable-hdpi/ic_launcher.png: Original is here. The version qualifier may be implied.
Error:Execution failed for task ':app:processDebugResources'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/rong/Library/Android/sdk/build-tools/23.0.2/aapt'' finished with non-zero exit value 1
headerView加载不出来,应该是不显示,但是可以点击
the library works fine for me, but i am using imageLoaderUniversal to load images for the zoomView and headerView. when the images are loaded, the contentView gets over the zoomView , not under it.
when no images are loaded, the views work fine
thanks for any tip.
br,
Hi
I am using PullToZoomScrollViewEx in my project.There is no way to auto scroll it to bottom. can you show us the way here ?
Thanks
在content中所有可见区域添加OnClickListener, 则scrollvview zoom 效果失效。
可能是事件传递方面略有bug。
please check。
如果多个接口监听下拉事件,放手刷新事件就完美了。
I need to have a webView, but when I try, it doesn't appear
你好FranK-Zhu,首先非常感谢你提供的开源代码,我从中学习到不少东西。
现在的情况是这样的,我使用了你的demo,但是遇到一个问题。我的zoomView(或者headView)是
一个地图(高德),在对zoomView进行滑动时,会被Listview拦截,页面上下滑动,但是我想要的是地图
相应这些滑动事件,比如两指放大缩小、上下移动...我尝试过给zoomView注册touchListener,并返回true
拦截事件,但是发现这样做没有得到想要的结果,给headView和mHeaderContainer注册ontouchListener
也是如此。
想请教下,这是神马原因?有没有解决的方法或是思路。
如果这个问题比较浅薄或者幼稚请见谅,我是新手。
谢谢。
It's possible to specify a minHeight for the image header? Thanks.
In my project,I want add viewpager as zoomView,how to do?
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?
PullToZoomScrollViewEx 滑动的时候..无法显示Zoomview.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.