{"id":13645672,"url":"https://github.com/cmfsotelo/FlipLayout","last_synced_at":"2025-04-21T14:32:03.024Z","repository":{"id":123795780,"uuid":"91081312","full_name":"cmfsotelo/FlipLayout","owner":"cmfsotelo","description":"ViewGroup to easily swap between added views.","archived":false,"fork":false,"pushed_at":"2018-04-16T22:59:04.000Z","size":605,"stargazers_count":47,"open_issues_count":0,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-09T18:43:26.341Z","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/cmfsotelo.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-05-12T10:42:06.000Z","updated_at":"2024-11-05T06:31:23.000Z","dependencies_parsed_at":"2024-01-14T11:20:52.008Z","dependency_job_id":"e0592e33-408f-4b2a-a10e-80b8c2d01616","html_url":"https://github.com/cmfsotelo/FlipLayout","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmfsotelo%2FFlipLayout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmfsotelo%2FFlipLayout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmfsotelo%2FFlipLayout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmfsotelo%2FFlipLayout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cmfsotelo","download_url":"https://codeload.github.com/cmfsotelo/FlipLayout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250070253,"owners_count":21369843,"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-02T01:02:39.439Z","updated_at":"2025-04-21T14:32:02.446Z","avatar_url":"https://github.com/cmfsotelo.png","language":"Java","readme":"# FlipLayout\n[![](https://jitpack.io/v/cmfsotelo/fliplayout.svg)](https://jitpack.io/#cmfsotelo/fliplayout)\n![Minimum SDK](https://img.shields.io/badge/minSdkVersion%20-15-blue.svg)\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-FlipLayout-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/5751)\n\nUse the FlipLayout as a ViewGroup to easily swap between child views.\n\n\u003cimg src=\"images/QYwqIQ.gif\"\u003e\u003cimg src=\"images/wPxlIA.gif\"\u003e\u003cimg src=\"images/JxXiRf.gif\"\u003e\u003cimg src=\"images/RSxNeM.gif\"\u003e\n\n\u003ch2\u003eInclude in your project\u003c/h2\u003e\n\u003ch4\u003e In your root/build.gradle\u003c/h4\u003e\n\n```groovy\nallprojects {\n\trepositories {\n\t...\n\tmaven { url 'https://jitpack.io' }\n\t}\n}\n```\n\u003ch4\u003e In your app/build.gradle\u003c/h4\u003e\n\n```groovy\ndependencies {\n\tcompile 'com.github.cmfsotelo:fliplayout:latest.version.here'\n}\n```\n\u003ch2\u003eUsage\u003c/h2\u003e\nSimply use the FrameLayout public methods to change which view is visible.\n\n```java\n/**\n* Shows the child next to the one being shown, animating it. If the current child is the last one, the first child shown.\n*/\npublic void showNextChild();\n\n/**\n* Shows the child previous to the one being shown, animating it. If the current child is the first one, the last child shown.\n*/\npublic void showPreviousChild() ;\n\n/**\n* Sets the target child as the visible one. Can be animated or not. When animated, it animates from the current visible child immediately to the target one.\n*\n* @param targetChild - the target child\n* @param animate     - flag to make the transition animating it or not\n*/\npublic void showChild(int targetChild, boolean animate) \n```\n\n\u003ch2\u003eExamples (click image to expand code)\u003c/h2\u003e\n\u003cimg src=\"images/JxXiRf.gif\"\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch4\u003eUse to simply flip one view with another\u003c/h4\u003e\u003c/summary\u003e\n\n```xml\n\u003ccom.csot.fliplayout.lib.FlipLayout\nandroid:id=\"@+id/fliplayout2\"\nandroid:layout_width=\"wrap_content\"\nandroid:layout_height=\"wrap_content\"\napp:transition=\"FLIP_X\"\u003e\n\n\t\u003cTextView\n\t    android:layout_width=\"match_parent\"\n\t    android:layout_height=\"match_parent\"\n\t    android:layout_margin=\"10dp\"\n\t    android:background=\"@drawable/circle\"\n\t    android:backgroundTint=\"#4286f4\"\n\t    android:gravity=\"center\"\n\t    android:padding=\"20dp\"\n\t    android:text=\"G\"\n\t    android:textColor=\"#fff\"\n\t    android:textSize=\"40dp\"/\u003e\n\n\t\u003cImageView\n\t    android:layout_width=\"match_parent\"\n\t    android:layout_height=\"match_parent\"\n\t    android:layout_margin=\"10dp\"\n\t    android:background=\"@drawable/circle\"\n\t    android:backgroundTint=\"#555\"\n\t    android:gravity=\"center\"\n\t    android:padding=\"20dp\"\n\t    android:src=\"@drawable/ic_done_black_48dp\"\n\t    android:textStyle=\"bold\"\n\t    android:tint=\"#fff\"/\u003e\n\u003c/com.csot.fliplayout.lib.FlipLayout\u003e\n```\n\u003c/details\u003e\n\n\u003ch2\u003eOR\u003c/h2\u003e\n\u003cimg src=\"images/OgR5nT.gif\"\u003e\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch4\u003eUse to swap over several views\u003c/h4\u003e\u003c/summary\u003e\n\n```xml\n\u003ccom.csot.fliplayout.lib.FlipLayout\nandroid:id=\"@+id/fliplayout4\"\nandroid:layout_width=\"wrap_content\"\nandroid:layout_height=\"wrap_content\"\napp:transition=\"TRANSLATE_Y\"\u003e\n\n\t\u003cTextView\n\t    android:layout_width=\"wrap_content\"\n\t    android:layout_height=\"match_parent\"\n\t    android:layout_gravity=\"center\"\n\t    android:layout_margin=\"10dp\"\n\t    android:background=\"#4286f4\"\n\t    android:gravity=\"center\"\n\t    android:padding=\"20dp\"\n\t    android:text=\"FirstView\"\n\t    android:textColor=\"#fff\"\n\t    android:textSize=\"20dp\"/\u003e\n\n\t\u003cTextView\n\t    android:layout_width=\"wrap_content\"\n\t    android:layout_height=\"match_parent\"\n\t    android:layout_gravity=\"center\"\n\t    android:layout_margin=\"10dp\"\n\t    android:background=\"#6016f4\"\n\t    android:gravity=\"center\"\n\t    android:padding=\"20dp\"\n\t    android:text=\"SecondView\"\n\t    android:textColor=\"#fff\"\n\t    android:textSize=\"20dp\"/\u003e\n\n\t\u003cTextView\n\t    android:layout_width=\"wrap_content\"\n\t    android:layout_height=\"match_parent\"\n\t    android:layout_gravity=\"center\"\n\t    android:layout_margin=\"10dp\"\n\t    android:background=\"#f18614\"\n\t    android:gravity=\"center\"\n\t    android:padding=\"50dp\"\n\t    android:text=\"ThirdView\"\n\t    android:textColor=\"#fff\"\n\t    android:textSize=\"50dp\"/\u003e\n\u003c/com.csot.fliplayout.lib.FlipLayout\u003e\n```\n\n\u003c/details\u003e\n\n***\n\n\u003ch2\u003eCustomization\u003c/h2\u003e\n\n| Attribute |Type           | Description | Default |\n|---|---|---|---|\n| startingChild | int | First visible child| 0 |\n| transitionDuration | int | The ending angle for button disposition   | 200 |\n| transition | enum | The type of the transition, one of: FADE, FLIP_X, FLIP_Y, TRANSLATE_X, TRANSLATE_Y, FLIP_Z1, FLIP_Z2 | FLIP_Y |\n\n\n","funding_links":[],"categories":["其他"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmfsotelo%2FFlipLayout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmfsotelo%2FFlipLayout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmfsotelo%2FFlipLayout/lists"}