Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

pushdown-anim-click

> 编程语言
Open source

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

191 stars0 likes1 views
WebsiteGitHub

About

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

「 Push Down Animation Click 」

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

「 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

xml

  com.github.thekhaeng
  pushdown-anim-click
  1.1.1
  pom

Gradle

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

「 Usage 」

java
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

…

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

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

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

EXAMPLE: 8dp static scale

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

「 Long Click 」

setOnClickListener(...)

java
@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.)

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

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

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

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Javaandroid-animationandroid-library

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言