emilsjolander / android-flipview Goto Github PK
View Code? Open in Web Editor NEWA small, easy to use android library for implementing flipping between views as seen in the popular Flipboard application
License: Apache License 2.0
A small, easy to use android library for implementing flipping between views as seen in the popular Flipboard application
License: Apache License 2.0
Hi, is it possible to create setter (and maybe getter) for this field? I have to steal touch event of FlipView and this field allows me to do it, but its marked as private and i dont have access to it. I am now setting it via reflection but i dont like it for obvious reason. Thanks
Hi,
great Library but I'm missing a way to force the adapter to preload the next page by calling getView? Is there a way to do this?
thanks in advance and greetings from germany,
JackDanyels
It seems that android-flip (https://github.com/openaphid/android-flip) aims to achieve the same goals, so how does FlipView compare to android-flip?
Improve the look of shadow / lighting of pages by using a gradient instead of a solid color overlay
Thanks for your great job and wish to add the following
1 flipview.disable() that disables touching the flipview
2 fliptoposition(int pos)
3 setadapter(new adapter(), initial position)
4 rubber band to be more flexable
5 replacing glow effect with gradient and shadow effects making it more realistic
6 there is a bug on flipping, some black noise appears
7 flipview.getcurrentview()
8 flipview.continousflipping(int delay)
please post code that helps in starting flipview at position 0 until you add the new features
Finally,i would like to thank you again for the great job you have made until now
There's an animation when at the first item at first view and I want to remove that but don't know how to.
I want to display a specific page when my FlipActivity is displayed.
I tried to use smoothFlipTo (at the end of FlipActivity.onCreate) but it doesn't work... it's always the first page which is displayed...
How could I do that?
I have a bunch of image views on my flipview page that are center cropped. As I'm turning the page the image view is expanding. I have a horizontal page turn and the image is expanding upward. The image being exposed while it is expanding is the part of the image being cropped out.
This doesn't happen with the squares that contain web views or the square that contains image views with bitmaps not larger than their container.
Any thoughts on that? Library is excellent btw. Only issue I've had.
Hi emilsjolander,
thank you for sharing great lib.
I has use this lib in my app. This working fine, however, if you could train for me. How can i implement pull to refresh like flipboard.
Thanks in advance!
I have images on every page, and images on the 1st page are visible when the flipview loads at the start. But when I start to flip thru pages, images on every page cannot be seen.
I'm testing this on a Genymotion emulator, it's a Nexus 4 virtual machine with Android 4.
Hope this can be fixed!
the flip doesn't render right anymore. if you have no 4.3 device I can make a video.
languages from right to left ,fli pages from right to left
In my project some content is long, so it needs scrolling to be viewed.
For android-FlipView I use this item layout
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ScrollView01"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<RelativeLayout
android:id="@+id/RalativeLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="30dp"
android:background="#dfdfdf" >
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:maxWidth="600dp"
android:padding="5dp"
android:paddingBottom="1dp"
android:textColor="#615F5C"
android:textSize="35sp" />
<ImageView
android:id="@+id/newsImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/title"
android:layout_centerHorizontal="true"
android:adjustViewBounds="true"
android:contentDescription="@string/img_dsc"
android:maxWidth="600dp" />
<TextView
android:id="@+id/contentTxt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/newsImage"
android:layout_centerHorizontal="true"
android:maxWidth="600dp"
android:padding="5dp"
android:paddingBottom="1dp"
android:textColor="#615F5C"
android:textSize="19sp" />
</RelativeLayout>
</ScrollView>
Problem here is that when I scroll one content to bottom and then flip to another content and then back this page in same state(shows the bottom side of content)
How I can fix it? I need to show always the top of content when flipping.
java.lang.NoSuchMethodError: android.view.View.getLayerType
at com.epic.flipview.FlipView.setDrawWithLayer(FlipView.java:874)
at com.epic.flipview.FlipView.dispatchDraw(FlipView.java:643)
I don't know that error is ?
Sometimes I have it.
I have another question: in your sample code, the min sdk is 8. With devices have sdk < 8, can lib run well ?
Hi emilsjolander !
I don't know why but i use a conplex layout include textView,ImageView, it's has problem in viewForPage at line final int viewType = mAdapter.getItemViewType(page);
I've tried to set view type in adapter, it's still happend. But if i replace by final int viewType= 0;
It's work fine.
another question : i want to add two pages for first and last page, and user only flip 3/4 of view like flipboard do, so what can i do to make it ?
Thanks for your library !
Hi, when the sample app opens in my cellphone (Galaxy SIII - i9300), the upper half keeps white and the other one is displaying correctly, after you swipe to the next page, you look all correctly. This bug happens even when you're swiping up or down, it looks a half correct and the otherone looks white. This happens with the Android Emulator too, I'm compiling with 3.0 and I'm testing it over Android 4.3 on both devices.
There is a way to make the flipview look good in all devices? Thanks
This one is when you open the app:
This one is swipping from page 1 to 0:
if the "horizontal" orientation is used and the screen is in landscape mode, then a full swipe on the screen scrolls 2 pages instead of 1
flipview:orientation="horizontal"
When the adapter data changes, stay on the same page(Id) if the adapter has stable ids and the id still exists in the dataset
How do I control the color of the effect, in the sample app, the effect starts with a glowing light color then flips over.
I tried to add to my application but it starts with a black color that looks ugly on the white background, I even tried to put a red background, but same thing.
Is it customizable?
When i put flipview:orientation="horizontal" the effect remains vertical...
How can I flip with webview adapters ?
I design a layout that have a web view -> flip error
First i want to thank for this great library. I tried also the openaphid, but here no flickers at all.
On my FlipPages are a CheckBox and Switch, at OnCheckListener() a TextView should change.
But it changes always the next Page. Only at last Page works like i wish, because no next Page available.
My BaseAdapter uses ViewHolder() and OnCheckListener() implemented in getView().
Its the only View which changes his content dynamically on every Page.
Another thing, maybe they are coherent. By OverFlip on first/last Page a TextView ("start"/"end") become visible at FlipView (means behind FlipPage). On last Page TextView is in front of FlipPage and on first behind like i promised.
Thanks for your attention
Cheers
Hi emilsjolander,
I am using your library for making an application. And its working very good. But i am having some glitches in between when the second haff of the next page appears while filpping.
Please give me some solution for that.
Thanks in Advance....
The rubber band overflipper has a bit too much tension
Thanks for your nice library. But if i use ViewPager inside FlipView then the content of the ViewPager is not visible till i touch the area of ViewPager. I didnot changed your code, I just try to implement ViewPager inslide Flip. That Issue is happening every time when i go the next page.
And is that possible to stop the movement of first page.
I upload video on youtube to show that only the VewPager's text appears when i touched the pager's area. Here is the link https://www.youtube.com/watch?v=4YY4MeIl4rI&feature=youtu.be
When we initialize the FlipView with basic TextViews, the initial load state shows the bottom part flapping back and forth. In this state, when we call flipTo it will not go to that page, and if we call smoothFlipTo it will flip to that page, then immediately return to the initial page, as though it was reset.
Curiously, if we force it to flip by hand once when it first loads, the hanging behavior stops (it becomes static), then both flipTo and smoothFlipTo work more or less as expected.
It also seems to wrap around to -1 when we go over the top.
Edit: we've tracked the error, and it appears that the peekNext (spelled peakNext) was running indefinitely, and it was resetting the flipDistance value to 0. Recommendation: halt the peek behavior as soon as flipping is started. I would do a pull request but Gradle won't build the project on my computer for some reason.
First of all, great library!
what I'm up to is to start to scroll after flipping once. For this reason i implemented a ScrollView for the second Page. I disabled the FlipViews touchevent methods and when i start to swipe over the display a scrollbar becomes visible. Unfortunenately the view does not scroll corresponding. It might be an issue with the view-hierachy, any idea?
Greetings from germany,
JackDanyels
In my adapter I fetch images from the Internet via the Picasso library and I use a placeholder image while the download is in progress. In some cases, the placeholder image is overlayed on top of the downloaded image. If I touch the image and start a flip, the overlay disappears and everything is OK.
Is there a way to refresh the FlipView when the image has been downloaded in order to update the screen?
I'm using your library and am very happy with it .
But I have a problem , I 'm loading images on the internet .
I need to load the image by index , and the method which I believe is what comes back to me is the onFlippedToPage method.
But when I try to get the corresponding view to display page it returns me null
@Override
public void onFlippedToPage(FlipView v, int position, long id) {
Log.i("pageflip", "Page: " + position);
View _view = null;
_view = v.getChildAt(position);
if(_view != null){
ImageView img_left = (ImageView) _view.findViewById(R.id.imgLeftBook);
if(img_left != null){
img_left.setImageDrawable(getResources().getDrawable(R.drawable.ic_book_reload));
}else{
Log.i("pageflip", "img_left empty: " + position);
}
}else{
Log.i("pageflip", "View empty: " + position);
}
}
I have 100 page, and i want startpage at 50. How to set start page?
Thanks
I think there's something wrong with recycling views, or pages are not recycled at all, is it possible to add an option to recycle after X-Pages before/after the current page,
I think that this would affect smooth flip to, but at least that would be better than running out of memory
Api to set overscroll mode. Settings should be OVER_SCROLL_RUBBER_BAND and OVER_SCROLL_GLOW (this is as it is now and should be the default value)
Hi,
I can't make it work with a SimpleCursorAdapter. I got a nullpointerexception
java.lang.NullPointerException
at SimpleCursorAdapter.bindView(SimpleCursorAdapter.java:118)
at android.support.v4.widget.CursorAdapter.getView(CursorAdapter.java:256)
at se.emilsjolander.flipview.FlipView.getView(FlipView.java:417)
at se.emilsjolander.flipview.FlipView.fillPageForIndex(FlipView.java:382)
at se.emilsjolander.flipview.FlipView.setFlipDistance(FlipView.java:367)
at se.emilsjolander.flipview.FlipView.flipTo(FlipView.java:1124)
at se.emilsjolander.flipview.FlipView.dataSetChanged(FlipView.java:226)
at se.emilsjolander.flipview.FlipView.access$000(FlipView.java:33)
at se.emilsjolander.flipview.FlipView$1.onChanged(FlipView.java:86)
at android.database.DataSetObservable.notifyChanged(DataSetObservable.java:37)
at android.widget.BaseAdapter.notifyDataSetChanged(BaseAdapter.java:50)
at android.support.v4.widget.CursorAdapter.swapCursor(CursorAdapter.java:347)
The "from" in the SimpleCursorAdapter is null.
It works well when i use a ListView instead of FlipView.
I have an app that use your library.
When I flip a page, that has a image full screen. => Flip error
Screenshot:
https://mail-attachment.googleusercontent.com/attachment/u/0/?ui=2&ik=ae94870c41&view=att&th=140a915e0f839259&attid=0.1&disp=inline&realattid=1444125400424775680-local0&safe=1&zw&saduie=AG9B_P8ObSoejVAbNJOZAW24Q-6Q&sadet=1377244806426&sads=2C5IaCOMP7RKd7Hw_75yvBxUBjU&sadssc=1
In other device, my app is good.
I am using you library , and inside the flip adapter i use the ViewHolder pattern . reuse the recycled views . it doesn't update the textview text . when i use the recycled view .
Add a "end of list" glow
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.