{"id":13507728,"url":"https://github.com/emilsjolander/android-FlipView","last_synced_at":"2025-03-30T09:33:02.120Z","repository":{"id":7751687,"uuid":"9119163","full_name":"emilsjolander/android-FlipView","owner":"emilsjolander","description":"A small, easy to use android library for implementing flipping between views as seen in the popular Flipboard application","archived":false,"fork":false,"pushed_at":"2018-05-12T22:03:06.000Z","size":1337,"stargazers_count":923,"open_issues_count":54,"forks_count":273,"subscribers_count":41,"default_branch":"master","last_synced_at":"2024-11-01T07:33:13.579Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emilsjolander.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-30T17:16:00.000Z","updated_at":"2024-11-01T03:18:18.000Z","dependencies_parsed_at":"2022-09-11T03:40:28.309Z","dependency_job_id":null,"html_url":"https://github.com/emilsjolander/android-FlipView","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilsjolander%2Fandroid-FlipView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilsjolander%2Fandroid-FlipView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilsjolander%2Fandroid-FlipView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilsjolander%2Fandroid-FlipView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emilsjolander","download_url":"https://codeload.github.com/emilsjolander/android-FlipView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246301963,"owners_count":20755512,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T02:00:38.291Z","updated_at":"2025-03-30T09:33:01.736Z","avatar_url":"https://github.com/emilsjolander.png","language":"Java","funding_links":[],"categories":["CN","Libs"],"sub_categories":["[Emil Sjölander](https://github.com/emilsjolander)","\u003cA NAME=\"Widget\"\u003e\u003c/A\u003eWidget"],"readme":"FlipView\n=========\n\nAbout\n-----\nThis library is made to be very easy to use and at the same time be feature complete.\nWith only a few lines of code you can have a flipping animation between your views, \nthis looks and acts very much like the Flipboard application.\n\nAll flipping animations should be very smooth and i have added lighting effects so the flipping look more realistic.\n\nHoneycomb (api lvl 11) or above is required for this library to work properly, however it will compile (and run, though without good performance) for much lower versions with just a few tweaks.\n\nDownload a compiled version of the sample here:\nhttps://www.dropbox.com/s/tvmdhre4ra8l41p/sample-debug-unaligned.apk\n\nInstalling\n---------------\n###Gradle\nAdd the following gradle dependency exchanging `x.x.x` for the latest release.\n```groovy\ndependencies {\n    compile 'se.emilsjolander:android-flipview:x.x.x'\n}\n```\n\nUsage\n-----\nAfter installing, create a layout file container a something similar to this:\n```xml\n\u003cse.emilsjolander.flipview.FlipView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:flipview=\"http://schemas.android.com/apk/res-auto\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:id=\"@+id/flip_view\"\n    flipview:orientation=\"vertical\"\n    flipview:overFlipMode=\"glow\" /\u003e\n```\n\nIn your activity/fragment you should do somthing like this:\n```java\nFlipView flipView = (FlipView) findViewById(R.id.flip_view);\nMyAdapter adapter = new MyAdapter();\nflipView.setAdapter(adapter);\n```\n\n```MyAdapter```in this case is just a normal adapter, nothing different from on you would use with a ```ListView```.\n\n\nApi\n---\nI have designed the api to be as similar as possible to that of a ```ListView```.\n\nFlipView uses a regular ```ListAdapter```, get and set the adapter with the following methods:\n```java\nvoid setAdapter(ListAdapter adapter);\nListAdapter getAdapter();\n```\n\nUse the following methods to get the number of pages and what the current visible page is.\n```java\nint getPageCount();\nint getCurrentPage();\n```\n\nThe following methods work like ```scrollTo```, ```smoothScrollTo```, ```scrollBy``` and ```smoothScrollBy```  from ```ListView```.\n```java\nvoid flipTo(int page);\nvoid smoothFlipTo(int page);\nvoid flipBy(int pageDelta);\nvoid smoothFlipBy(int pageDelta);\n```\n\nPeaking is a way to inform the user that there is more content, or to teach the user how to interact with your application.\nPeaking can be done either once or until the ```FlipView``` has been interacted with.\n```java\nvoid peakNext(boolean once);\nvoid peakPrevious(boolean once);\n```\n\n```FlipView``` supports both vertical (default) and horizontal flipping. \nI feel it would be wrong to change the orientation dynamically so i have limited it to being set via xml.\n```java\nboolean isFlippingVertically();\n```\n\nThis is how to set a listener on the ```FlipView``` to recieve callbacks.\n```java\nvoid setOnFlipListener(OnFlipListener onFlipListener);\n```\n\nThere are multiple over flip modes. The 2 that exists now are `GLOW` and `RUBBER_BAND`. `GLOW` is using the edge glow effect seen in all android lists and is the default over flip mode. `RUBBER_BAND` is more like the iOS way to inform of the end of lists, this is also a lot like the flipboard app informs users that they are on the first/last page.\nThis can be set in xml using the following attribute. The mode can be either \"glow\" or \"rubber_band\".\n```xml\nflipview:overFlipMode=\"glow\"\n```\nHere are the corrosponding java method calls. The OverFlipMode enum contains GLOW and RUBBER_BAND values.\n```java\nvoid setOverFlipMode(OverFlipMode overFlipMode);\n```\n\nThere is also a listener for detecting over flip. This is usefull when wanting to implement pull-to-refresh functionality or just detecting that the user is intressted in seeing more data.\n```java\nvoid setOnOverFlipListener(OnOverFlipListener onOverFlipListener);\n```\n\nMuch like AdapterView subclasses you can set a view that will be shown/hidden depending on if the FlipView has any data.\n```java\nvoid setEmptyView(View empty);\n```\nRemember that you are responsible for adding the view that you pass into this method into the view hierarchy. A typical way of using this method is to include a view in your layout file with `android:id=\"@+id/empty_view\"` and then putting the following code in your onCreate() method.\n```java\nmFlipView.setEmptyView(findViewById(R.id.empty_view));\n```\n\nContributing\n------------\nPull requests and issues are very welcome!\n\nFeature request are also welcome but i can't make any promise that they will make it in.\nI would like to keep the library as general as possible, if you are unsure you can just ask before you code ;)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femilsjolander%2Fandroid-FlipView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femilsjolander%2Fandroid-FlipView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femilsjolander%2Fandroid-FlipView/lists"}