All Projects → JuniperPhoton → Flipperlayout

JuniperPhoton / Flipperlayout

Android version of FlipperControl for UWP (https://github.com/JuniperPhoton/FlipperControl)

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Flipperlayout

Masonry Layout
An efficient and fast web component that gives you a beautiful masonry layout
Stars: ✭ 43 (-49.41%)
Mutual labels:  layout
Mgrelativekit
Convert absolute to relative layout without autolayout.
Stars: ✭ 62 (-27.06%)
Mutual labels:  layout
Vue Router Layout
Lightweight layout resolver for Vue Router
Stars: ✭ 74 (-12.94%)
Mutual labels:  layout
Samsara
☸️ Continuous UI
Stars: ✭ 1,051 (+1136.47%)
Mutual labels:  layout
Spherelayout
a layout which supports 3d rotate and enable its childview has z-depth for android
Stars: ✭ 55 (-35.29%)
Mutual labels:  layout
Android Ribbonviews
🎀 This is an android view library "RibbonViews".
Stars: ✭ 66 (-22.35%)
Mutual labels:  layout
Allkit
🛠 Async List Layout Kit
Stars: ✭ 40 (-52.94%)
Mutual labels:  layout
Interior
Design system for the modern web.
Stars: ✭ 77 (-9.41%)
Mutual labels:  layout
Phidl
Python GDS layout and CAD geometry creation
Stars: ✭ 56 (-34.12%)
Mutual labels:  layout
Dji Hardware Schematics
Community made schematics for the DJI drones and devices.
Stars: ✭ 72 (-15.29%)
Mutual labels:  layout
Keyboardlayoutguide
⌨️ Manage iOS keyboard with Apple's missing KeyboardLayoutGuide
Stars: ✭ 1,054 (+1140%)
Mutual labels:  layout
Framelayoutkit
FrameLayoutKit is a super fast and easy to use autolayout kit
Stars: ✭ 53 (-37.65%)
Mutual labels:  layout
Swift Layout Animation Transition 30days
Stars: ✭ 68 (-20%)
Mutual labels:  layout
Pep8 Style Guide For Python Code
Python 代码风格指南 & 编程规范
Stars: ✭ 49 (-42.35%)
Mutual labels:  layout
Article
web
Stars: ✭ 75 (-11.76%)
Mutual labels:  layout
View shaper
A library to help create shaped views and layouts in Android
Stars: ✭ 42 (-50.59%)
Mutual labels:  layout
React Xmasonry
Simple, minimalistic and featured native masonry layout for React JS.
Stars: ✭ 62 (-27.06%)
Mutual labels:  layout
Devextreme Angular Template
Responsive Application Layout Templates​ based on DevExtreme Angular Components
Stars: ✭ 80 (-5.88%)
Mutual labels:  layout
Easygrid
EasyGrid - VanillaJS Responsive Grid
Stars: ✭ 77 (-9.41%)
Mutual labels:  layout
Kotlinanim
Create fluent animations in a kotlin way
Stars: ✭ 72 (-15.29%)
Mutual labels:  layout

FlipperView

Android version of FlipperControl for UWP . Now it's written in Kotlin.

A control that uses flip transition to change different states. Works on API 19, but with more tests I think it works well on API 16.

How to use

FlipperView 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.

<com.juniperphoton.flipperviewlib.FlipperView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerInParent="true"
    android:clickable="true"
    android:clipChildren="false"
    android:clipToPadding="false"
    android:foreground="?android:attr/selectableItemBackground"
    android:padding="20dp"
    app:defaultIndex="0"
    app:flipAxis="X">

    <TextView
        android:layout_width="200dp"
        android:layout_height="50dp"
        android:background="@color/exampleColor1"
        android:gravity="center"
        android:text="TAP ME"
        android:textColor="@android:color/white"/>

    <TextView
        android:layout_width="200dp"
        android:layout_height="50dp"
        android:background="@color/exampleColor2"
        android:gravity="center"
        android:text="KEEP TAPPING"
        android:textColor="@android:color/white"/>

    <TextView
        android:layout_width="200dp"
        android:layout_height="50dp"
        android:background="@color/exampleColor3"
        android:gravity="center"
        android:text="TAP ME PLEASE"
        android:textColor="@android:color/white"/>
</com.juniperphoton.flipperviewlib.FlipperView>

It has a sample proj to demonstrate how to use it.

There are a few attrs that control the behavior:

defaultIndex:int

Default display index of view. Note that the value of zero points to the first view you declare in XML.

flipDirection:int

FlipDirection.

XML : backToFront or frontToBack

CODE: FLIP_DIRECTION_BACK_TO_FRONT or FLIP_DIRECTION_FRONT_TO_BACK

flipAxis:int

XML : X or Y

CODE: AXIS_X or AXIS_Y

duration:int

Animation duration in millis. The default value is 200 which I think it's fast enough.

tapToFlip:boolean

Enable tap to flip or not. Default value is false.

Switch views

Current there are 4 ways to switch views:

fun next()

Segue to next view. If it's the end of the views, then segue to the first one.

fun previous()

Segue to the previous view. If it's the head of the views, then segue to the last one.

fun next(Int, Boolean, ViewAction, ViewAction?)

Segue 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.

To understand the running time on both actions, please refer to the advance topic.

Note that both ViewAction has default value for Kotlin.

Please be aware of IndexOutOfBoundsException.

fun refreshCurrent(ViewAction)

Perform the flip animation and run the custom action on exit animation end.

Advance

The flipping animation contains two parts:

  1. Exit animation: the current display view rotates from 0 to 90 degrees
  2. Enter animation: the next display view rotates from -90 to 0 degrees

At the end of both animations, you can perform your actions. See fun next(Int, Boolean, ViewAction, ViewAction?) method for details.

Note for Android P user

Since the elevation shadow in Android P is NOT control by animation transformation, thus it will cause some weird issues on Android P devices.

Thus the FlipperLayout will disable elevation during animation and apply it back for you at the end of animation.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].