All Projects → zoonooz → Simple View Behavior

zoonooz / Simple View Behavior

Licence: mit
Simple and easy way to deal with CoordinatorLayout Behavior

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Simple View Behavior

Bottomsheetcoordinatorlayout
A handy CoordinatorLayout that works well when used in a bottom sheet, even with AppBarLayouts inside.
Stars: ✭ 241 (-44.47%)
Mutual labels:  coordinatorlayout, android-ui
Scrollingpagerindicator
Pager indicator inspired by Instagram. Lightweight and easy to set up.
Stars: ✭ 419 (-3.46%)
Mutual labels:  android-ui
Fastadapter
The bullet proof, fast and easy to use adapter library, which minimizes developing time to a fraction...
Stars: ✭ 3,512 (+709.22%)
Mutual labels:  android-ui
Pudding
🌟 Pudding use WindowManager(don't need request permission) to pull down a view that are displayed on top their attached window
Stars: ✭ 371 (-14.52%)
Mutual labels:  android-ui
Doublelift
🦋 Expands and collapses a layout horizontally and vertically sequentially.
Stars: ✭ 343 (-20.97%)
Mutual labels:  android-ui
Cornercutlinearlayout
Linear Layout that allow corner (parent and children) cuts, complex shadow and divider.
Stars: ✭ 391 (-9.91%)
Mutual labels:  android-ui
Oneadapter
A Viewholderless Adapter for RecyclerView, who supports builtin diffing, states (paging, empty...), events (clicking, swiping...), and more.
Stars: ✭ 321 (-26.04%)
Mutual labels:  android-ui
Treeview
An android tree structure view with high performance and rich features
Stars: ✭ 429 (-1.15%)
Mutual labels:  android-ui
Material Progressview
🔥A beautiful, gradual and simple used progress view for android.
Stars: ✭ 406 (-6.45%)
Mutual labels:  android-ui
Themed Toggle Button Group
Customisable toggle buttons inside a FlexboxLayout.
Stars: ✭ 357 (-17.74%)
Mutual labels:  android-ui
Indicatorscrollview
🧀 A dynamic scroll view that animates indicators according to its scroll position.
Stars: ✭ 355 (-18.2%)
Mutual labels:  android-ui
Recyclerstickyheaderview
Sticky header view or suspending view for RecyclerView.
Stars: ✭ 347 (-20.05%)
Mutual labels:  android-ui
Viewpagerbottomsheet
Use ViewPagers in Bottom Sheets!
Stars: ✭ 393 (-9.45%)
Mutual labels:  android-ui
Stacklayoutmanager
customized layoutmanager,let item pile up like stackview/类似最美有物卡片堆叠效果
Stars: ✭ 343 (-20.97%)
Mutual labels:  android-ui
Coordinatortablayout
Combination of TabLayout and CoordinatorLayout./TabLayout和CoordinatorLayout相结合的折叠控件
Stars: ✭ 4,114 (+847.93%)
Mutual labels:  coordinatorlayout
Expenso
📊 A Minimal Expense Tracker App built to demonstrate the use of modern android architecture component with MVVM Architecture
Stars: ✭ 325 (-25.12%)
Mutual labels:  android-ui
Awesome Android Ui
😎 A curated list of awesome Android UI/UX libraries
Stars: ✭ 353 (-18.66%)
Mutual labels:  android-ui
Loginui Android
Login User Interface in android with innovative, beautiful and creative background 😊😊😉
Stars: ✭ 374 (-13.82%)
Mutual labels:  android-ui
Ticker
An Android text view with scrolling text change animation
Stars: ✭ 4,194 (+866.36%)
Mutual labels:  android-ui
Avatarview
A circular Image View with a lot of perks. Including progress animation and highlight state with borders and gradient color.
Stars: ✭ 429 (-1.15%)
Mutual labels:  android-ui

Build Status

simple-view-behavior

Simple View Behavior for Android CoordinatorLayout.

This library provide you easy ways to config and setup the view behavior without creating subclass of Behavior

Installation

compile 'com.zoonref:simple-view-behavior:1.0'

Usage

You can setup behavior effect by using only xml option.

  1. set the layout behavior to this library class app:layout_behavior="com.zoonref.SimpleViewBehavior"
  2. set the dependency view by specify resource id by app:dependsOn="@+id/{your view id}"
  3. set the type of dependency app:dependType="{x,y,width,height}"
  4. set the dependency view target value according to the type you choose app:dependTargetXXX="{value}"
  5. set the target appearance that you want your view to animate to

There are two ways to specify the animation when the dependency view changed.

1. xml

<View
        android:layout_width="40dp"
        android:layout_height="40dp"
        android:layout_marginTop="8dp"
        android:layout_marginLeft="20dp"
        android:rotationX="90"
        android:elevation="10dp"
        android:background="@android:color/holo_blue_bright"
        android:alpha="0"
        app:layout_behavior="com.zoonref.SimpleViewBehavior"
        app:dependsOn="@+id/app_bar"
        app:dependType="y"
        app:dependTargetY="-156dp"
        app:targetAlpha="1"
        app:targetRotateX="0"/>

This View will depend on the y positon of @+id/app_bar which is AppBarLayout. View will animation from current state of AppBarLayout until y position of AppBarLayout is -156dp with the animation, View will animate alpha to app:targetAlpha="1" rotate x to app:targetRotateX="0"

Don't forget to add xmlns:app="http://schemas.android.com/apk/res-auto"

The output will be

2. view animation resource file

When you use animation, all of animate target option from xml will be ignored.

for example

<View
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_gravity="center|top"
        android:layout_marginTop="80dp"
        android:elevation="10dp"
        android:background="@android:color/holo_orange_dark"
        app:layout_behavior="com.zoonref.SimpleViewBehavior"
        app:dependsOn="@+id/app_bar"
        app:dependType="y"
        app:dependTargetY="-156dp"
        app:animation="@anim/rotate"/>
<set xmlns:android="http://schemas.android.com/apk/res/android">
    <scale
        android:duration="100"
        android:fromXScale="1"
        android:fromYScale="1"
        android:pivotX="50%"
        android:pivotY="50%"
        android:toXScale="40dp"
        android:toYScale="40dp"/>
    <rotate
        android:duration="100"
        android:fromDegrees="0"
        android:pivotX="50%"
        android:pivotY="50%"
        android:toDegrees="360"/>
    <alpha
        android:duration="100"
        android:toAlpha="0"/>
</set>

The output will be

Options

You can see all available option at attrs.xml

Author

Amornchai Kanokpullwad, @zoonref

License

simple-view-behavior is available under the MIT license. See the LICENSE file for more info.

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