All Projects → TheKhaeng → Pushdown Anim Click

TheKhaeng / Pushdown Anim Click

Licence: apache-2.0
A library for Android developers who want to create "push down animation click" for view like spotify application.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Pushdown Anim Click

Android Extensions
An Android library with modules to quickly bootstrap an Android application.
Stars: ✭ 356 (+104.6%)
Mutual labels:  android-animation
Animationsplayground
This repo is an attempt to implement a complex animation
Stars: ✭ 630 (+262.07%)
Mutual labels:  android-animation
Rx2animations
Repository for android animations Rx2 wrapper
Stars: ✭ 95 (-45.4%)
Mutual labels:  android-animation
Mediumclap Android
👏 The Medium's Clapping Effect developed in Android
Stars: ✭ 485 (+178.74%)
Mutual labels:  android-animation
Audio Visualizer Android
🎵 [Android Library] A light-weight and easy-to-use Audio Visualizer for Android.
Stars: ✭ 581 (+233.91%)
Mutual labels:  android-animation
Androidsnowfall
Snowfall App Demo
Stars: ✭ 8 (-95.4%)
Mutual labels:  android-animation
koleton
The easiest library to show skeleton screens in an Android app.
Stars: ✭ 84 (-51.72%)
Mutual labels:  android-animation
Propertyfindar
🏘 🎃 Real Estate Sample App with RxJava3+Coroutines Flow, Dynamic Feature Modules, Dagger Hilt, Offline First, ConcatAdapter, Animations and tests for Room, Retrofit, useCase and ViewModels with TDD.
Stars: ✭ 133 (-23.56%)
Mutual labels:  android-animation
Elasticviews
✨ An easy way to implement an elastic touch effect for Android.
Stars: ✭ 588 (+237.93%)
Mutual labels:  android-animation
Fabfilter
Android app to showcase complex UI/Animations with and without MotionLayout
Stars: ✭ 1,333 (+666.09%)
Mutual labels:  android-animation
Rxanimations
Repository for android animations Rx wrapper
Stars: ✭ 488 (+180.46%)
Mutual labels:  android-animation
Animation Tutorials
🍭🚀💗 Tutorials about animations with Animators, Animated Vector Drawables, Shared Transitions, and more
Stars: ✭ 557 (+220.11%)
Mutual labels:  android-animation
Confetti
An Android particle system library for displaying confetti!
Stars: ✭ 1,194 (+586.21%)
Mutual labels:  android-animation
Ticker
An Android text view with scrolling text change animation
Stars: ✭ 4,194 (+2310.34%)
Mutual labels:  android-animation
Medal
🏅An easy way to implement medal effect for Android.
Stars: ✭ 112 (-35.63%)
Mutual labels:  android-animation
Tickview
一个精致带感的打钩小动画
Stars: ✭ 284 (+63.22%)
Mutual labels:  android-animation
Ubercaranimation
A demo app showing movement of car on map like in Uber.
Stars: ✭ 643 (+269.54%)
Mutual labels:  android-animation
Noty
A simple library for creating animated warnings/dialogs/alerts for Android.
Stars: ✭ 136 (-21.84%)
Mutual labels:  android-animation
Teammate Android
A Team Management app for creating tournaments and games for various sports
Stars: ✭ 116 (-33.33%)
Mutual labels:  android-animation
Android Ripple Pulse Animation
A cool ripple and pulse background animation for android
Stars: ✭ 88 (-49.43%)
Mutual labels:  android-animation

「 Push Down Animation Click 」

alt text

Build Status Download Android Arsenal Google play store

A library for Android developers who want to create "push down animation click" for view like spotify application. :)

alt text alt text

「 DEMO APPLICATION 」

clone repo and build it :)

or

「 UPDATE 」

  • version: 1.1.1

    • remove ViewTreeObserver.OnGlobalLayoutListener use getMeasuredWidth()/getMeasuredHeight() instead
  • version: 1.1.0

    • add setOnLongClickListener(...)
    • add new mode
      • MODE_SCALE
      • MODE_STATIC_DP
  • version: 1.0.8

    • change setOnTouchPushDownAnim(...) to setPushDownAnimTo(...)
    • can set multiple view at setPushDownAnimTo(...)

「 Installation 」

Maven

<dependency>
  <groupId>com.github.thekhaeng</groupId>
  <artifactId>pushdown-anim-click</artifactId>
  <version>1.1.1</version>
  <type>pom</type>
</dependency>

Gradle

compile( 'com.github.thekhaeng:pushdown-anim-click:1.1.1' ){
    exclude group: 'com.android.support'
}

「 Usage 」

Button button = findViewById( R.id.button );

PushDownAnim.setPushDownAnimTo( button, ... )
        .setOnClickListener( new View.OnClickListener(){
            @Override
            public void onClick( View view ){
                Toast.makeText( MainActivity.this, "PUSH DOWN !!", Toast.LENGTH_SHORT ).show();
            }

        } );

Full option

PushDownAnim.setPushDownAnimTo( button, ... )
        .setScale( MODE_SCALE | MODE_STATIC_DP,
         	   PushDownAnim.DEFAULT_PUSH_SCALE | PushDownAnim.DEFAULT_PUSH_STATIC  ) 
        .setDurationPush( PushDownAnim.DEFAULT_PUSH_DURATION )
        .setDurationRelease( PushDownAnim.DEFAULT_RELEASE_DURATION )
        .setInterpolatorPush( PushDownAnim.DEFAULT_INTERPOLATOR )
        .setInterpolatorRelease( PushDownAnim.DEFAULT_INTERPOLATOR )
        .setOnClickListener( new View.OnClickListener(){
            @Override
            public void onClick( View view ){
                Toast.makeText( MainActivity.this, "PUSH DOWN !!", Toast.LENGTH_SHORT ).show();
            }
        } )
        .setOnLongClickListener( new View.OnLongClickListener(){
            @Override
            public boolean onLongClick( View view ){
		Toast.makeText( MainActivity.this, "LONG PUSH DOWN !!", Toast.LENGTH_SHORT ).show();
                return true; // true: not effect to single click
            }
        } )
        .setOnTouchEvent( new View.OnTouchListener(){
            @Override
            public boolean onTouch( View view, MotionEvent motionEvent ){
                return false;
            }
        } );

Default values

  • Default mode: MODE_SCALE
  • Default scale: 0.97f
  • Default push duration: 50 millisecond
  • Default release duration: 125 millisecond
  • Default interpolator push/release: AccelerateDecelerateInterpolator()

「 MODE 」

1. MODE_SCALE: use range scale 0.00 - 1.00 to push down view.

EXAMPLE: This case 8dp ≈ 0.89 scale

TheKhaeng

PushDownAnim.setPushDownAnimTo( button )
	.setScale( MODE_SCALE, 0.89f  ) 
        ...;

2. MODE_STATIC_DP: use static dp unit to push down view.

EXAMPLE: 8dp static scale

TheKhaeng

PushDownAnim.setPushDownAnimTo( button )
	.setScale( MODE_STATIC_DP, 8  ) 
        ...;

「 Long Click 」

setOnClickListener(...)

@Override
public boolean onLongClick( View view ){
    ...
    return true; // true: not effect to single click
}

NOTE: If you do not want to trigger a normal click return true

「 Disable Click Programmatically 」

If your project has logic that want to disable click programmatically. You must use setEnabled(...) (do not use setClickable(...) it is not effective.)

button.setEnabled( false );

Licence

Copyright 2017 TheKhaeng

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Developed By Thai android developer.

TheKhaeng

Follow facebook.com/thekhaeng.io on Facebook page. or @nonthawit at my Medium blog. :)

For contact, shoot me an email at [email protected]

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