crosswall / android-coverflow Goto Github PK
View Code? Open in Web Editor NEWA beautiful coverflow lib for android
License: Other
A beautiful coverflow lib for android
License: Other
I custom NormalActivity with .pagerMargin(getResources().getDimensionPixelSize(R.dimen.overlap_pager_margin))
and
container.setOverlapEnabled(true);
It don't make overlap for PagerContainer but with FragmentPagerAdapter it work ok
More: If I move viewpager to item 1 when init and use overlap it work not correct (fragment and view)
does it work with viewPager2 ?
In the demo,the following code doesn't work,when I click the item,it doesn't pop-up.
I want to know if it's my method or the code itself is wrong.
Thank you!
container.setPageItemClickListener(new PageItemClickListener() {
@Override
public void onItemClick(View view, int position) {
Toast.makeText(NormalActivity.this,"position:" + position,Toast.LENGTH_SHORT).show();
}
});
Hi,I got this error,anyone know how to fix this?thanks
就嵌套了一个下拉刷新就一边黏住了。。很影响用户体验,希望博主能看到
if(rotationY!=0){
float realRotationY = Math.min(rotationY,Math.abs(position * rotationY));
page.setRotationY(position < 0f ? realRotationY : - realRotationY);
}
其实我想要一开是315度不动的效果。。但是我想他们滑动平移的时候,不要每个item翻转得太厉害,想平滑的滑动。。我发现改了这里会影响一开始的315度的效果。。。对不起打扰了,还是请教一下。。
I want to make coverflow with next button. Can you help me to control next action? And second question is how can I focus on second item in viewpager when start. Thank you so much!
location me.crosswall.lib.coverflow.core.CoverTransformer
line32 Log.d("CoverTransformer", "position:" + position);
minSdkVersion 19
targetSdkVersion 30
I imported this lib to my project. But when running my project, i have an issue like this:
java.lang.IllegalAccessError: Method 'void androidx.viewpager.widget.PagerAdapter.setViewPagerObserver(android.database.DataSetObserver)' is inaccessible to class 'androidx.core.view.LinkagePager' (declaration of 'androidx.core.view.LinkagePager' appears in /data/app/~~Hg3GxUqloIVujMjqhSB2hA==/com.mascom.sll-2xKoWGBjqDwuZbvJuSF-ZQ==/base.apk)
So please show me the solution to solve this error ?
First of all, i initialize an empty list. After call web service, update the list and call notifyDataSetChanged.
Then drag to the third Fragment, will get this issue.
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setElevation(float)' on a null object reference
at android.support.v4.view.ViewCompatLollipop.setElevation(ViewCompatLollipop.java:45)
at android.support.v4.view.ViewCompat$LollipopViewCompatImpl.setElevation(ViewCompat.java:1538)
at android.support.v4.view.ViewCompat.setElevation(ViewCompat.java:2713)
at me.crosswall.lib.coverflow.core.PagerContainer.onPageSelected(PagerContainer.java:126)
at android.support.v4.view.ViewPager.dispatchOnPageSelected(ViewPager.java:1867)
at android.support.v4.view.ViewPager.scrollToItem(ViewPager.java:625)
at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:609)
at android.support.v4.view.ViewPager.onTouchEvent(ViewPager.java:2181)
有什么Transform可以实现弧形的Tab效果吗?
hi
i am beginner developer.
i find a problem.
Clicks on Upper LinkagePager in Linkage2 coverflow. are reversed
And paged in the reverse direction.
I fixed this problem at random.
first, download libaray and import,
second,
modify
onTouchEvent() in LinkagePagerContainer Class in package me.crosswall.lib.coverflow.core
//ev.offsetLocation(mCenter.x - mInitialTouch.x, mCenter.y - mInitialTouch.y); //erase
ev.offsetLocation(mInitialTouch.x - mCenter.x, mCenter.y - mInitialTouch.y); //new
i Modified the two parts of above source and paged in the desired direction.
Great library, works really well.
Would it be possible for you to remove android:allowBackup="true" from the manifest? I'm getting build errors when I add android:allowBackup="false" to my app manifest and tools:replace is not working.
Thanks,
Adam
Hello,
When I want to add setPageItemClickListener to action when I click into screen It not works.
I do into onCreateView :
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
activity?.title = getString(R.string.title_offres)
val view = inflater.inflate(R.layout.fragment_offres, container, false)
top5 = view.findViewById(R.id.top5) as PagerContainer
top5.setOverlapEnabled(true)
val pager = top5.getViewPager()
val adapter = Top5Adapter(container!!.context, generateData())
top5.setOnClickListener {
v -> { // not works
Toast.makeText(v.context, "SFSDFSDFSF", Toast.LENGTH_LONG).show()
}
}
pager.adapter = adapter
pager.clipChildren = false
//
pager.offscreenPageLimit = 5
// NOT WORKS
top5.setPageItemClickListener(PageItemClickListener { v, position ->
startActivity(Intent(context, DetailOffreActivity::class.java))
})
CoverFlow.Builder().with(pager)
.scale(0.3f)
.pagerMargin(resources.getDimensionPixelSize(R.dimen.text_margin).toFloat())
.spaceSize(0f)
.build()
return view
}
Thansk for help.
On initial fragment launch which contains viewpager. It doesn't transform and after scroll, it works fine.
Here a code in onCreateView() fragment:
homeBinding =
DataBindingUtil.inflate(inflater, R.layout.fragment_home_layout, container, false);
view = homeBinding.getRoot();
mHomeAdapter = new HomePagePagerAdapter(projectList, getActivity(), mConfig);
ViewPager pager = homeBinding.pagerContainer.getViewPager();
pager.setAdapter(mHomeAdapter);
pager.setOffscreenPageLimit(3);
new CoverFlow.Builder()
.with(pager)
.scale(0.3f)
.pagerMargin(-100)
.spaceSize(0f)
.build();
My App Version:
minSdkVersion 21
targetSdkVersion 30
Show to Error like as:
How do I restore the origin viewpager?
thank you.
Iam making an app need to show layouts design in each card and then it need onclick listner to goto second activity. please help how can i achieve that. thanks
Hello,
I want to know if theres a way i could know when the user swipes, or moves from one cardview to another.
I tried an setPageItemClickListener(), but that only shows me when the user clicks a card, not when he swipes, or uses the Left and Right button. Is there a way i can catch any user movement?
Your help would be greatly appreciated!! You have my thanks
如题,目前没有onItemClick 和OnItemLongClick接口
is there a possibility to get a vertical version of your coverflow?
I want to leave the first two items at normal scale and after that make them smaller.
Is that possible ? thanks
I tried setting a cardview inside fragment with PagerContainer and viewpager, but there's no elevation shadow .
I tried same setting in any other view, there's no problem.
The transition between the image covers are not smooth. Is there any setting to tweak it? Or any code level optimisation is required? If you can point me to the right direction, I can look into it.
Cannot get property 'supportV4' on extra properties extension as it does not exist
coverflow overlap Effect do not work when i use PageAdapter replace FragmentPagerAdapter
hello!
how to handle tap on central (elevated) item?
i'm trying to use your example (pagerContainer.setPageItemClickListener(new PageItemClickListener() ...) but it works for only side elements, not for central.
Any chance you can comment out
Log.d(TAG,"position:"+position);
in CoverTransformer.java? It fills up the console output.
Thanks.
I added TextView on each items, that TextView is scrollable by enabling scroll on its attribute, and it happens that it scroll isn't working, you will see it will scrolled once I skip to next item then back to previous page.
Does anyone here experienced this issue?
if I insert the element into a vertical scroll view , the scroll-sensation it's very bad
I am experiencing a strange bug with scrolling.
I am using:
compile 'com.github.crosswall:Android-Coverflow:release-v1.0.4'
When I have more than two items in the coverflow, and a middle item is selected- for example, if there are three items, and the 2nd one is in the center- when I attempt to scroll, the center item jumps to where my finger touches down.
This makes scrolling very jarring. The items on the edge scroll correctly, but the item in the center leaps to my finger's location. It also prevents me from tapping on the items on the side.
My OnCreate:
PagerContainer container = (PagerContainer) findViewById(R.id.pager_container);
container.setOverlapEnabled(false);
final ViewPager pager = container.getViewPager();
pager.setOffscreenPageLimit(5);
pager.setAdapter(new MyPagerAdapter());
pager.setClipChildren(true);
new CoverFlow.Builder()
.with(pager)
.scale(0.2f)
.pagerMargin(0f)
.spaceSize(0f)
.build();
if (pager.getAdapter().getCount() > 1) {
pager.setCurrentItem(pager.getAdapter().getCount() / 2);
}
My adapter:
private class MyPagerAdapter extends PagerAdapter {
@Override
public Object instantiateItem(ViewGroup container, int position) {
View view = LayoutInflater.from(CoverflowActivity.this).inflate(R.layout.twitch_card_small,null);
ImageView imageView = (ImageView) view.findViewById(R.id.imageView);
Picasso.with(LiveStreamActivity.this).load(mItems().get(position).getImage()).fit().into(imageView);
//add text here!
container.addView(view);
return view;
}
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
container.removeView((View)object);
}
@Override
public int getCount() {
int size = getItems().size();
return size;
}
@Override
public boolean isViewFromObject(View view, Object object) {
return (view == object);
}
}
My XML:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="130dp"
android:orientation="vertical">
<me.crosswall.lib.coverflow.core.PagerContainer
android:id="@+id/pager_container"
android:layout_width="match_parent"
android:layout_height="125dp"
android:background="@color/colorBlack">
<android.support.v4.view.ViewPager
android:id="@+id/overlap_pager"
android:layout_width="125dp"
android:layout_height="125dp"
android:layout_gravity="center"
android:clipToPadding="true"/>
</me.crosswall.lib.coverflow.core.PagerContainer>
</LinearLayout>
Any ideas?
The CardView elevation & radius is not visible even in your demo app. I tried setting a higher value, but still there's no corner radius / elevation shadow.
相当于不放大的另外两个改变翘起方向
compile 'com.github.crosswall:Android-Coverflow:release-v1.0.4'
Dependency is not working.
After call notifyDataSetChanged(), the scale of item will has some problem(e.g. even the item is not the center one, their scale will become 1.0f, as big as the center one ) but after scroll a little bit, it will become normal. So, any idea of this problem ? Thank you
hi, is there any way in the current version to disable scroll position logging when scrolling the pager? we have a use case where the pager with Coverflow handles a lot of scrolling so constantly logging the scroll position floods the logcat, not to mention impact on perf
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.