{"id":13645637,"url":"https://github.com/JuniperPhoton/FlipperLayout","last_synced_at":"2025-04-21T14:31:59.684Z","repository":{"id":70171641,"uuid":"78358281","full_name":"JuniperPhoton/FlipperLayout","owner":"JuniperPhoton","description":"Android version of FlipperControl for UWP (https://github.com/JuniperPhoton/FlipperControl)","archived":false,"fork":false,"pushed_at":"2021-07-31T13:46:52.000Z","size":153,"stargazers_count":92,"open_issues_count":0,"forks_count":22,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-04T00:07:09.681Z","etag":null,"topics":["android","flip","layout"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JuniperPhoton.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-08T17:13:34.000Z","updated_at":"2024-08-02T07:30:28.000Z","dependencies_parsed_at":"2023-07-31T15:45:37.215Z","dependency_job_id":null,"html_url":"https://github.com/JuniperPhoton/FlipperLayout","commit_stats":null,"previous_names":["juniperphoton/flipperview"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuniperPhoton%2FFlipperLayout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuniperPhoton%2FFlipperLayout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuniperPhoton%2FFlipperLayout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuniperPhoton%2FFlipperLayout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JuniperPhoton","download_url":"https://codeload.github.com/JuniperPhoton/FlipperLayout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250070238,"owners_count":21369841,"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":["android","flip","layout"],"created_at":"2024-08-02T01:02:38.840Z","updated_at":"2025-04-21T14:31:59.405Z","avatar_url":"https://github.com/JuniperPhoton.png","language":"Kotlin","readme":"# FlipperView\nAndroid version of [FlipperControl for UWP](https://github.com/JuniperPhoton/FlipperControl) . Now it's written in Kotlin.\n\nA control that uses flip transition to change different states.\nWorks on API 19, but with more tests I think it works well on API 16.\n\n![](https://github.com/JuniperPhoton/FlipperControl/blob/master/demo.gif)\n\n## How to use\n\nFlipperView extends from `FrameLayout` so you can use it as a `FrameLayout` but it only displays one child at a time and you can call `next()` to switch to another child. Please don't put views that do **heavy** work.\n\n    \u003ccom.juniperphoton.flipperviewlib.FlipperView\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_centerInParent=\"true\"\n        android:clickable=\"true\"\n        android:clipChildren=\"false\"\n        android:clipToPadding=\"false\"\n        android:foreground=\"?android:attr/selectableItemBackground\"\n        android:padding=\"20dp\"\n        app:defaultIndex=\"0\"\n        app:flipAxis=\"X\"\u003e\n    \n        \u003cTextView\n            android:layout_width=\"200dp\"\n            android:layout_height=\"50dp\"\n            android:background=\"@color/exampleColor1\"\n            android:gravity=\"center\"\n            android:text=\"TAP ME\"\n            android:textColor=\"@android:color/white\"/\u003e\n    \n        \u003cTextView\n            android:layout_width=\"200dp\"\n            android:layout_height=\"50dp\"\n            android:background=\"@color/exampleColor2\"\n            android:gravity=\"center\"\n            android:text=\"KEEP TAPPING\"\n            android:textColor=\"@android:color/white\"/\u003e\n    \n        \u003cTextView\n            android:layout_width=\"200dp\"\n            android:layout_height=\"50dp\"\n            android:background=\"@color/exampleColor3\"\n            android:gravity=\"center\"\n            android:text=\"TAP ME PLEASE\"\n            android:textColor=\"@android:color/white\"/\u003e\n    \u003c/com.juniperphoton.flipperviewlib.FlipperView\u003e\n\nIt has a sample proj to demonstrate how to use it.\n\nThere are a few attrs that control the behavior:\n\n## defaultIndex:int\nDefault display index of view. Note that the value of zero points to the first view you declare in XML.\n\n## flipDirection:int\nFlipDirection. \n\nXML : `backToFront` or `frontToBack`\n\nCODE: `FLIP_DIRECTION_BACK_TO_FRONT` or `FLIP_DIRECTION_FRONT_TO_BACK`\n\n## flipAxis:int\n\nXML : `X` or `Y`\n\nCODE: `AXIS_X` or `AXIS_Y`\n\n## duration:int\nAnimation duration in millis. The default value is 200 which I think it's fast enough.\n\n## tapToFlip:boolean\nEnable tap to flip or not. Default value is false.\n\n## Switch views\n\nCurrent there are **4** ways to switch views:\n\n#### fun next()\n\nSegue to next view. If it's the end of the views, then segue to the first one.\n\n#### fun previous()\n\nSegue to the previous view. If it's the head of the views, then segue to the last one.\n\n### fun next(Int, Boolean, ViewAction, ViewAction?)\n\nSegue to the specified one with/without animation, and custom the action that  will be applied on the current display view on **Exit animation** end and run the action after the **Enter animation**.\n\nTo understand the running time on both actions, please refer to the **advance** topic.\n\nNote that both `ViewAction` has default value for Kotlin.\n\nPlease be aware of *IndexOutOfBoundsException*.\n\n### fun refreshCurrent(ViewAction)\n\nPerform the flip animation and run the custom action on exit animation end.\n\n## Advance\n\nThe flipping animation contains two parts:\n\n1. Exit animation: the current display view rotates from 0 to 90 degrees\n2. Enter animation: the next display view rotates from -90 to 0 degrees\n\nAt the end of both animations, you can perform your actions. See `fun next(Int, Boolean, ViewAction, ViewAction?)` method for details.\n\n## Note for Android P user\n\nSince the elevation shadow in Android P is NOT control by animation transformation, thus it will cause some weird issues on Android P devices.\n\nThus the FlipperLayout will disable elevation during animation and apply it back for you at the end of animation.","funding_links":[],"categories":["其他"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJuniperPhoton%2FFlipperLayout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJuniperPhoton%2FFlipperLayout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJuniperPhoton%2FFlipperLayout/lists"}