master 54e160817cd6 cached
41 files
65.6 KB
17.2k tokens
48 symbols
1 requests
Download .txt
Repository: TheKhaeng/pushdown-anim-click
Branch: master
Commit: 54e160817cd6
Files: 41
Total size: 65.6 KB

Directory structure:
gitextract_yyt_bbyb/

├── .gitignore
├── .travis.yml
├── LICENSE.txt
├── README.md
├── app/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       ├── androidTest/
│       │   └── java/
│       │       └── com/
│       │           └── thekhaeng/
│       │               └── pushdownanim/
│       │                   └── ExampleInstrumentedTest.java
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── java/
│       │   │   └── com/
│       │   │       └── thekhaeng/
│       │   │           └── pushdownanimexample/
│       │   │               └── MainActivity.java
│       │   └── res/
│       │       ├── drawable/
│       │       │   ├── button_green_focused.xml
│       │       │   ├── button_green_normal.xml
│       │       │   ├── button_green_pressed.xml
│       │       │   ├── button_white_focused.xml
│       │       │   ├── button_white_normal.xml
│       │       │   ├── button_white_pressed.xml
│       │       │   ├── ic_launcher_background.xml
│       │       │   ├── ic_music.xml
│       │       │   ├── selector_button_green.xml
│       │       │   └── selector_button_white.xml
│       │       ├── drawable-v21/
│       │       │   ├── selector_button_green.xml
│       │       │   └── selector_button_white.xml
│       │       ├── layout/
│       │       │   └── activity_main.xml
│       │       └── values/
│       │           ├── colors.xml
│       │           ├── strings.xml
│       │           └── styles.xml
│       └── test/
│           └── java/
│               └── com/
│                   └── thekhaeng/
│                       └── pushdownanim/
│                           └── ExampleUnitTest.java
├── build.gradle
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── pushdown-anim-click/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           └── java/
│               └── com/
│                   └── thekhaeng/
│                       └── pushdownanim/
│                           ├── PushDown.java
│                           ├── PushDownAnim.java
│                           └── PushDownAnimList.java
└── settings.gradle

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
### Android ###
# Built application files
*.apk
*.ap_
reports/
pushlibrary*
*.json

# Media
resources/
*.ai
*.psd
*.svg
*.mp4


# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# Intellij
*.iml
.idea/

# Keystore files
*.jks

### Android Patch ###
gen-external-apklibs


### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

### Intellij Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

# *.iml
# modules.xml
# *.ipr

================================================
FILE: .travis.yml
================================================

language: android
jdk: openjdk8

android:
  components:
    - tools
    - build-tools-27.0.3
    - android-27
    - extra-android-m2repository
    - extra-android-support
  licenses:
    - 'android-sdk-license-.+'
    - 'google-gdk-license-.+'

notifications:
  email: false

before_install:
 - yes | sdkmanager "platforms;android-27"
 - chmod +x gradlew
 - mkdir "$ANDROID_HOME/licenses" || true
 - echo -e "\nd56f5187479451eabf01fb78af6dfcb131a6481e\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
 - echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"
 - touch ./pushlibrary.gradle

script: ./gradlew clean build

================================================
FILE: LICENSE.txt
================================================
                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright [yyyy] [name of copyright owner]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License 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.


================================================
FILE: README.md
================================================
# **「 Push Down Animation Click 」**

![alt text](./pictures/logo.png)

[![Build Status](https://travis-ci.org/TheKhaeng/pushdown-anim-click.svg?branch=master)](https://travis-ci.org/TheKhaeng/pushdown-anim-click) [ ![Download](https://api.bintray.com/packages/nonthawit/TheKhaeng/pushdown-anim-click/images/download.svg) ](https://bintray.com/nonthawit/TheKhaeng/pushdown-anim-click/_latestVersion) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Push%20Down%20Animation%20Click-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/6821) [![Google play store](https://img.shields.io/badge/Google-play%20store-green.svg)](https://play.google.com/store/apps/details?id=com.thekhaeng.pushdownanimexample)

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

![alt text](./pictures/screenshot_1.png)
![alt text](./pictures/push_down_anim.gif)


## 「 DEMO APPLICATION 」

```
clone repo and build it :)
```

or

<a href="https://play.google.com/store/apps/details?id=com.thekhaeng.pushdownanimexample" target="_blank">
<img src="https://storage.googleapis.com/support-kms-prod/D90D94331E54D2005CC8CEE352FF98ECF639" height="60" width="200">
</a>

## 「 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
<dependency>
  <groupId>com.github.thekhaeng</groupId>
  <artifactId>pushdown-anim-click</artifactId>
  <version>1.1.1</version>
  <type>pom</type>
</dependency>
```

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

```java
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](./pictures/push_down_scale.gif)

```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


![TheKhaeng](./pictures/push_down_static.gif)

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


[<img src="./pictures/profile2_circle.png" width="170">](https://www.facebook.com/nonthawit) [![TheKhaeng](./pictures/thekhaeng_logo.png)](https://www.facebook.com/thekhaeng.io/)


Follow [facebook.com/thekhaeng.io](https://www.facebook.com/thekhaeng.io) on Facebook page.
or [@nonthawit](https://medium.com/@nonthawit) at my Medium blog. :)

For contact, shoot me an email at nonthawit.thekhaeng@gmail.com



================================================
FILE: app/.gitignore
================================================
/build


================================================
FILE: app/build.gradle
================================================
apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    buildToolsVersion "27.0.3"
    defaultConfig {
        applicationId "com.thekhaeng.pushdownanimexample"
        minSdkVersion 18
        targetSdkVersion 27
        versionCode 2
        versionName "1.1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    signingConfigs {
//        release {
//            storeFile file(KEYSTORE_FILE)
//            storePassword KEYSTORE_PASSWORD
//            keyAlias KEYSTORE_ALIAS
//            keyPassword KEYSTORE_PASSWORD
//        }
    }


    buildTypes {
        release {
//            signingConfig signingConfigs.release
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    lintOptions {
        abortOnError false
    }

}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    implementation "com.andkulikov:transitionseverywhere:1.7.9"

    implementation(project(':pushdown-anim-click'))

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

    testImplementation 'junit:junit:4.12'
    androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
}


================================================
FILE: app/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile


================================================
FILE: app/src/androidTest/java/com/thekhaeng/pushdownanim/ExampleInstrumentedTest.java
================================================
package com.thekhaeng.pushdownanim;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
 * Instrumented test, which will execute on an Android device.
 *
 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
 */
@RunWith( AndroidJUnit4.class )
public class ExampleInstrumentedTest{
    @Test
    public void useAppContext() throws Exception{
        // Context of the app under test.
        Context appContext = InstrumentationRegistry.getTargetContext();

        assertEquals( "com.thekhaeng.pushdownanim", appContext.getPackageName() );
    }
}


================================================
FILE: app/src/main/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.thekhaeng.pushdownanimexample"
          xmlns:android="http://schemas.android.com/apk/res/android">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name="com.thekhaeng.pushdownanimexample.MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>

                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
    </application>

</manifest>

================================================
FILE: app/src/main/java/com/thekhaeng/pushdownanimexample/MainActivity.java
================================================
package com.thekhaeng.pushdownanimexample;

import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.OvershootInterpolator;
import android.widget.Button;
import android.widget.Toast;

import com.thekhaeng.pushdownanim.PushDownAnim;
import com.transitionseverywhere.Fade;
import com.transitionseverywhere.TransitionManager;
import com.transitionseverywhere.TransitionSet;
import com.transitionseverywhere.extra.Scale;


public class MainActivity extends AppCompatActivity{

    private Button button1;
    private Button button2;
    private View music;
    private ViewGroup container;

    @Override
    protected void onCreate( Bundle savedInstanceState ){
        super.onCreate( savedInstanceState );
        setContentView( R.layout.activity_main );

        container = findViewById(R.id.container);
        button1 = findViewById( R.id.button1 );
        button2 = findViewById( R.id.button2 );


        music = findViewById( R.id.music );

        // music.setEnabled( false ); // if you want to disable click
//        PushDownAnim.setPushDownAnimTo( music )
//                .setScale( PushDownAnim.MODE_STATIC_DP, 2 )
//                .setOnClickListener( getClickListener() )
//                .setOnLongClickListener( getLongClickListener() );
//
//        PushDownAnim.setPushDownAnimTo( button1 )
//                .setOnClickListener( getClickListener() )
//                .setOnLongClickListener( getLongClickListener() );
//
//        PushDownAnim.setPushDownAnimTo( button2 )
//                .setOnClickListener( getClickListener() )
//                .setOnLongClickListener( getLongClickListener() );

//        [equal]
//        PushDownAnim.setPushDownAnimTo( button )
//                .setScale( PushDownAnim.MODE_SCALE , PushDownAnim.DEFAULT_PUSH_SCALE )
//                .setDurationPush( PushDownAnim.DEFAULT_PUSH_DURATION )
//                .setDurationRelease( PushDownAnim.DEFAULT_RELEASE_DURATION )
//                .setInterpolatorPush( PushDownAnim.DEFAULT_INTERPOLATOR )
//                .setInterpolatorRelease( PushDownAnim.DEFAULT_INTERPOLATOR
//                .setOnClickListener( getClickListener() )
//                .setOnLongClickListener( getLongClickListener() );
//        [equal]
        PushDownAnim.setPushDownAnimTo( music, button1, button2 )
                .setScale( PushDownAnim.MODE_STATIC_DP , 2 )
                .setDurationPush( PushDownAnim.DEFAULT_PUSH_DURATION )
                .setDurationRelease( PushDownAnim.DEFAULT_RELEASE_DURATION )
                .setInterpolatorPush( PushDownAnim.DEFAULT_INTERPOLATOR )
                .setInterpolatorRelease( PushDownAnim.DEFAULT_INTERPOLATOR )
                .setOnClickListener( getClickListener() )
                .setOnLongClickListener( getLongClickListener() );


        // delay show view to check PushDownAnim.MODE_STATIC_DP not calculate size of view is zero.
        button2.setVisibility(View.GONE);
        final Handler handler = new Handler();
        handler.postDelayed(new Runnable() {
            @Override
            public void run() {
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
                    TransitionSet set = new TransitionSet()
                            .addTransition(new Scale())
                            .addTransition(new Fade())
                            .setDuration(200)
                            .setInterpolator(new OvershootInterpolator(1.0f));
                    TransitionManager.beginDelayedTransition(container, set);
                    TransitionManager.beginDelayedTransition(container);
                    button2.setVisibility(View.VISIBLE);
                }
            }
        }, 1000);


    }

    @NonNull
    private View.OnClickListener getClickListener(){
        return new View.OnClickListener(){
            @Override
            public void onClick( View view ){
                if( view == music ){
                    Toast.makeText( MainActivity.this, "PUSH DOWN 1 !!", Toast.LENGTH_SHORT ).show();
                }else if( view == button1 ){
                    Toast.makeText( MainActivity.this, "PUSH DOWN 2 !!", Toast.LENGTH_SHORT ).show();
                }else if( view == button2 ){
                    Toast.makeText( MainActivity.this, "PUSH DOWN 3 !!", Toast.LENGTH_SHORT ).show();
                }
            }

        };
    }

    @NonNull
    private View.OnLongClickListener getLongClickListener(){
        return new View.OnLongClickListener(){
            @Override
            public boolean onLongClick( View view ){
                if( view == music ){
                    Toast.makeText( MainActivity.this, "LONG PUSH DOWN 1 !!", Toast.LENGTH_SHORT ).show();
                }else if( view == button1 ){
                    Toast.makeText( MainActivity.this, "LONG PUSH DOWN 2 !!", Toast.LENGTH_SHORT ).show();
                }else if( view == button2 ){
                    Toast.makeText( MainActivity.this, "LONG PUSH DOWN 3 !!", Toast.LENGTH_SHORT ).show();
                }
                return true; // true: not effect to single click
            }
        };
    }


}


================================================
FILE: app/src/main/res/drawable/button_green_focused.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">

    <solid android:color="@color/colorAccent"/>

    <corners android:radius="30dp"/>

</shape>

================================================
FILE: app/src/main/res/drawable/button_green_normal.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">

    <solid android:color="@color/colorAccent"/>

    <corners android:radius="30dp"/>

</shape>

================================================
FILE: app/src/main/res/drawable/button_green_pressed.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">

    <solid android:color="@color/colorAccentDark"/>

    <corners android:radius="30dp"/>

</shape>

================================================
FILE: app/src/main/res/drawable/button_white_focused.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">

    <solid android:color="@android:color/white"/>

    <corners android:radius="30dp"/>

</shape>

================================================
FILE: app/src/main/res/drawable/button_white_normal.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">

    <solid android:color="@android:color/white"/>

    <corners android:radius="30dp"/>

</shape>

================================================
FILE: app/src/main/res/drawable/button_white_pressed.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">

    <solid android:color="@color/colorAccent"/>

    <corners android:radius="30dp"/>

</shape>

================================================
FILE: app/src/main/res/drawable/ic_launcher_background.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<vector
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:viewportHeight="108.0"
    android:viewportWidth="108.0">
    <path
        android:fillColor="#26A69A"
        android:pathData="M0,0h108v108h-108z"
        android:strokeColor="#66FFFFFF"
        android:strokeWidth="0.8"/>
    <path
        android:fillColor="#00000000"
        android:pathData="M19,0L19,108"
        android:strokeColor="#33FFFFFF"
        android:strokeWidth="0.8"/>
    <path
        android:fillColor="#00000000"
        android:pathData="M9,0L9,108"
        android:strokeColor="#66FFFFFF"
        android:strokeWidth="0.8"/>
    <path
        android:fillColor="#00000000"
        android:pathData="M39,0L39,108"
        android:strokeColor="#66FFFFFF"
        android:strokeWidth="0.8"/>
    <path
        android:fillColor="#00000000"
        android:pathData="M29,0L29,108"
        android:strokeColor="#66FFFFFF"
        android:strokeWidth="0.8"/>
    <path
        android:fillColor="#00000000"
        android:pathData="M59,0L59,108"
        android:strokeColor="#66FFFFFF"
        android:strokeWidth="0.8"/>
    <path
        android:fillColor="#00000000"
        android:pathData="M49,0L49,108"
        android:strokeColor="#66FFFFFF"
        android:strokeWidth="0.8"/>
    <path
        android:fillColor="#00000000"
        android:pathData="M79,0L79,108"
        android:strokeColor="#66FFFFFF"
        android:strokeWidth="0.8"/>
    <path
        android:fillColor="#00000000"
        android:pathData="M69,0L69,108"
        android:strokeColor="#66FFFFFF"
        android:strokeWidth="0.8"/>
    <path
        android:fillColor="#00000000"
        android:pathData="M89,0L89,108"
        android:strokeColor="#33FFFFFF"
        android:strokeWidth="0.8"/>
    <path
        android:fillColor="#00000000"
        android:pathData="M99,0L99,108"
        android:strokeColor="#66FFFFFF"
        android:strokeWidth="0.8"/>
    <path
        android:fillColor="#00000000"
        android:pathData="M0,89L108,89"
        android:strokeColor="#33FFFFFF"
        android:strokeWidth="0.8"/>
    <path
        android:fillColor="#00000000"
        android:pathData="M0,99L108,99"
        android:strokeColor="#66FFFFFF"
        android:strokeWidth="0.8"/>
    <path
        android:fillColor="#00000000"
        android:pathData="M0,69L108,69"
        android:strokeColor="#66FFFFFF"
        android:strokeWidth="0.8"/>
    <path
        android:fillColor="#00000000"
        android:pathData="M0,79L108,79"
        android:strokeColor="#66FFFFFF"
        android:strokeWidth="0.8"/>
    <path
        android:fillColor="#00000000"
        android:pathData="M0,49L108,49"
        android:strokeColor="#66FFFFFF"
        android:strokeWidth="0.8"/>
    <path
        android:fillColor="#00000000"
        android:pathData="M0,59L108,59"
        android:strokeColor="#66FFFFFF"
        android:strokeWidth="0.8"/>
    <path
        android:fillColor="#00000000"
        android:pathData="M0,29L108,29"
        android:strokeColor="#66FFFFFF"
        android:strokeWidth="0.8"/>
    <path
        android:fillColor="#00000000"
        android:pathData="M0,39L108,39"
        android:strokeColor="#66FFFFFF"
        android:strokeWidth="0.8"/>
    <path
        android:fillColor="#00000000"
        android:pathData="M0,19L108,19"
        android:strokeColor="#33FFFFFF"
        android:strokeWidth="0.8"/>
    <path
        android:fillColor="#00000000"
        android:pathData="M0,9L108,9"
        android:strokeColor="#66FFFFFF"
        android:strokeWidth="0.8"/>
</vector>



================================================
FILE: app/src/main/res/drawable/ic_music.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="55dp"
        android:height="55dp"
        android:viewportWidth="55"
        android:viewportHeight="55">

    <path
        android:fillColor="#000000"
        android:pathData="M52.66,0.249c-0.216-0.189-0.501-0.275-0.789-0.241l-31,4.011C20.373,4.084,20,4.507,20,5.01v6.017v4.212v25.384
C18.174,38.428,15.273,37,12,37c-5.514,0-10,4.037-10,9s4.486,9,10,9s10-4.037,10-9c0-0.232-0.019-0.46-0.039-0.687
C21.974,45.248,22,45.189,22,45.121V16.118l29-3.753v18.257C49.174,28.428,46.273,27,43,27c-5.514,0-10,4.037-10,9s4.486,9,10,9
c5.464,0,9.913-3.966,9.993-8.867c0-0.013,0.007-0.024,0.007-0.037V11.227V7.016V1C53,0.712,52.876,0.438,52.66,0.249z
M12,53 c-4.411,0-8-3.141-8-7s3.589-7,8-7s8,3.141,8,7S16.411,53,12,53z
M43,43c-4.411,0-8-3.141-8-7s3.589-7,8-7s8,3.141,8,7 S47.411,43,43,43z
M22,14.101v-3.074V5.889l29-3.752v4.879v3.332L22,14.101z" />
</vector>

================================================
FILE: app/src/main/res/drawable/selector_button_green.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:drawable="@drawable/button_green_pressed"
          android:state_pressed="true" />

    <item android:drawable="@drawable/button_green_focused"
          android:state_focused="true" />

    <item android:drawable="@drawable/button_green_normal" />

</selector>

================================================
FILE: app/src/main/res/drawable/selector_button_white.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:drawable="@drawable/button_white_pressed"
          android:state_pressed="true" />

    <item android:drawable="@drawable/button_white_focused"
          android:state_focused="true" />

    <item android:drawable="@drawable/button_white_normal" />

</selector>

================================================
FILE: app/src/main/res/drawable-v21/selector_button_green.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
        android:color="@color/colorAccentDark">
    <item
        android:id="@android:id/mask"
        android:drawable="@drawable/button_green_normal"/>
    <item android:drawable="@drawable/button_green_normal"/>
</ripple>

================================================
FILE: app/src/main/res/drawable-v21/selector_button_white.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
        android:color="@color/colorAccent">
    <item
        android:id="@android:id/mask"
        android:drawable="@drawable/button_white_normal"/>
    <item android:drawable="@drawable/button_white_normal"/>
</ripple>

================================================
FILE: app/src/main/res/layout/activity_main.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fillViewport="true">

    <android.support.constraint.ConstraintLayout
        android:id="@+id/container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/background"
        tools:layout_editor_absoluteX="0dp"
        tools:layout_editor_absoluteY="81dp">

        <android.support.v7.widget.AppCompatTextView
            android:id="@+id/tv_push_down_size_1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="4dp"
            android:text="8dp"
            android:textColor="@android:color/white"
            android:visibility="gone"
            app:layout_constraintBottom_toTopOf="@+id/line1"
            app:layout_constraintEnd_toEndOf="@+id/line2"
            app:layout_constraintStart_toStartOf="@+id/line1"
            />

        <android.support.v7.widget.AppCompatTextView
            android:id="@+id/tv_push_down_size_2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="4dp"
            android:text="8dp"
            android:textColor="@android:color/white"
            android:visibility="gone"
            app:layout_constraintBottom_toTopOf="@+id/line3"
            app:layout_constraintEnd_toEndOf="@+id/line4"
            app:layout_constraintStart_toStartOf="@+id/line3"/>

        <View
            android:id="@+id/line1"
            android:layout_width="1dp"
            android:layout_height="180dp"
            android:background="@android:color/holo_green_light"
            android:visibility="gone"
            app:layout_constraintBottom_toBottomOf="@+id/music"
            app:layout_constraintStart_toStartOf="@+id/music"
            app:layout_constraintTop_toTopOf="@+id/music"
            />

        <View
            android:id="@+id/line2"
            android:layout_width="1dp"
            android:layout_height="0dp"
            android:layout_marginStart="8dp"
            android:background="@android:color/holo_red_light"
            android:visibility="gone"
            app:layout_constraintBottom_toBottomOf="@+id/line1"
            app:layout_constraintStart_toEndOf="@+id/line1"
            app:layout_constraintTop_toTopOf="@+id/line1"
            />

        <View
            android:id="@+id/line3"
            android:layout_width="1dp"
            android:layout_height="140dp"
            android:background="@android:color/holo_green_light"
            android:visibility="gone"
            app:layout_constraintBottom_toBottomOf="@+id/button2"
            app:layout_constraintStart_toStartOf="@+id/button1"
            app:layout_constraintTop_toTopOf="@+id/button1"/>

        <View
            android:id="@+id/line4"
            android:layout_width="1dp"
            android:layout_height="0dp"
            android:layout_marginStart="8dp"
            android:background="@android:color/holo_red_light"
            android:visibility="gone"
            app:layout_constraintBottom_toBottomOf="@+id/line3"
            app:layout_constraintStart_toEndOf="@+id/line3"
            app:layout_constraintTop_toTopOf="@+id/line3"
            />


        <Button
            android:id="@+id/button1"
            android:layout_width="200dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="44dp"
            android:background="@drawable/selector_button_green"
            android:text="Push down Anim"
            android:textColor="@android:color/white"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/music"
            />

        <Button
            android:id="@+id/button2"
            android:layout_width="200dp"
            android:layout_height="wrap_content"
            android:layout_marginBottom="16dp"
            android:layout_marginTop="8dp"
            android:background="@drawable/selector_button_white"
            android:text="Push down Anim"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/button1"
            app:layout_constraintVertical_bias="0.19"/>

        <FrameLayout
            android:id="@+id/music"
            android:layout_width="150dp"
            android:layout_height="150dp"
            android:layout_marginEnd="8dp"
            android:layout_marginStart="8dp"
            android:layout_marginTop="92dp"
            android:background="@color/gray"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <android.support.v7.widget.AppCompatImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:tint="@color/grayLight"
                app:srcCompat="@drawable/ic_music"/>

        </FrameLayout>

    </android.support.constraint.ConstraintLayout>

</android.support.v4.widget.NestedScrollView>


================================================
FILE: app/src/main/res/values/colors.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#222326</color>
    <color name="colorPrimaryDark">#0B0B0B</color>
    <color name="colorAccent">#1DD35E</color>
    <color name="colorAccentDark">#164D2A</color>

    <color name="background">#121212</color>

    <color name="grayLight">#88898C</color>
    <color name="gray">#222326</color>
</resources>


================================================
FILE: app/src/main/res/values/strings.xml
================================================
<resources>
    <string name="app_name">PushDown Anim</string>
</resources>


================================================
FILE: app/src/main/res/values/styles.xml
================================================
<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

</resources>


================================================
FILE: app/src/test/java/com/thekhaeng/pushdownanim/ExampleUnitTest.java
================================================
package com.thekhaeng.pushdownanim;

import org.junit.Test;

import static org.junit.Assert.*;

/**
 * Example local unit test, which will execute on the development machine (host).
 *
 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
 */
public class ExampleUnitTest{
    @Test
    public void addition_isCorrect() throws Exception{
        assertEquals( 4, 2 + 2 );
    }
}

================================================
FILE: build.gradle
================================================
buildscript {
    
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}


================================================
FILE: gradle/wrapper/gradle-wrapper.properties
================================================
#Fri Apr 27 20:21:13 ICT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip


================================================
FILE: gradle.properties
================================================
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true



================================================
FILE: gradlew
================================================
#!/usr/bin/env bash

##############################################################################
##
##  Gradle start up script for UN*X
##
##############################################################################

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
    echo "$*"
}

die ( ) {
    echo
    echo "$*"
    echo
    exit 1
}

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
  CYGWIN* )
    cygwin=true
    ;;
  Darwin* )
    darwin=true
    ;;
  MINGW* )
    msys=true
    ;;
esac

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
    ls=`ls -ld "$PRG"`
    link=`expr "$ls" : '.*-> \(.*\)$'`
    if expr "$link" : '/.*' > /dev/null; then
        PRG="$link"
    else
        PRG=`dirname "$PRG"`"/$link"
    fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
        # IBM's JDK on AIX uses strange locations for the executables
        JAVACMD="$JAVA_HOME/jre/sh/java"
    else
        JAVACMD="$JAVA_HOME/bin/java"
    fi
    if [ ! -x "$JAVACMD" ] ; then
        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
    fi
else
    JAVACMD="java"
    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
    MAX_FD_LIMIT=`ulimit -H -n`
    if [ $? -eq 0 ] ; then
        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
            MAX_FD="$MAX_FD_LIMIT"
        fi
        ulimit -n $MAX_FD
        if [ $? -ne 0 ] ; then
            warn "Could not set maximum file descriptor limit: $MAX_FD"
        fi
    else
        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
    fi
fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
    JAVACMD=`cygpath --unix "$JAVACMD"`

    # We build the pattern for arguments to be converted via cygpath
    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
    SEP=""
    for dir in $ROOTDIRSRAW ; do
        ROOTDIRS="$ROOTDIRS$SEP$dir"
        SEP="|"
    done
    OURCYGPATTERN="(^($ROOTDIRS))"
    # Add a user-defined pattern to the cygpath arguments
    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
    fi
    # Now convert the arguments - kludge to limit ourselves to /bin/sh
    i=0
    for arg in "$@" ; do
        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option

        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
        else
            eval `echo args$i`="\"$arg\""
        fi
        i=$((i+1))
    done
    case $i in
        (0) set -- ;;
        (1) set -- "$args0" ;;
        (2) set -- "$args0" "$args1" ;;
        (3) set -- "$args0" "$args1" "$args2" ;;
        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
    esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
    JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"


================================================
FILE: gradlew.bat
================================================
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem  Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windowz variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega


================================================
FILE: pushdown-anim-click/.gitignore
================================================
/build


================================================
FILE: pushdown-anim-click/build.gradle
================================================
apply plugin: 'com.android.library'

android {
    compileSdkVersion 27
    buildToolsVersion "27.0.3"


    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 27
        versionCode 1
        versionName "1.1.1"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

}

dependencies {
    compile 'com.android.support:appcompat-v7:27.1.1'
}

apply from: "$project.rootDir/pushlibrary.gradle"



================================================
FILE: pushdown-anim-click/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile


================================================
FILE: pushdown-anim-click/src/main/AndroidManifest.xml
================================================
<manifest package="com.thekhaeng.pushdownanim"
          xmlns:android="http://schemas.android.com/apk/res/android"/>


================================================
FILE: pushdown-anim-click/src/main/java/com/thekhaeng/pushdownanim/PushDown.java
================================================
package com.thekhaeng.pushdownanim;

import android.view.View;
import android.view.animation.AccelerateDecelerateInterpolator;

/**
 * Created by The Khaeng on 21 Mar 2018 :)
 */

public interface PushDown{
    PushDown setScale( float scale );

    PushDown setScale( @PushDownAnim.Mode int mode, float scale );

    PushDown setDurationPush( long duration );

    PushDown setDurationRelease( long duration );

    PushDown setInterpolatorPush( AccelerateDecelerateInterpolator interpolatorPush );

    PushDown setInterpolatorRelease( AccelerateDecelerateInterpolator interpolatorRelease );

    PushDown setOnClickListener( View.OnClickListener clickListener );

    PushDown setOnLongClickListener( View.OnLongClickListener clickListener );

    PushDown setOnTouchEvent( View.OnTouchListener eventListener );
}


================================================
FILE: pushdown-anim-click/src/main/java/com/thekhaeng/pushdownanim/PushDownAnim.java
================================================
package com.thekhaeng.pushdownanim;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.TimeInterpolator;
import android.animation.ValueAnimator;
import android.graphics.Rect;
import android.support.annotation.IntDef;
import android.util.TypedValue;
import android.view.MotionEvent;
import android.view.View;
import android.view.animation.AccelerateDecelerateInterpolator;

import java.lang.annotation.Retention;
import java.lang.ref.WeakReference;

import static java.lang.annotation.RetentionPolicy.SOURCE;

/**
 * Created by The Khaeng on 09 Sep 2017
 */

public class PushDownAnim implements PushDown{
    @Retention( SOURCE )
    @IntDef( {MODE_SCALE, MODE_STATIC_DP} )
    public @interface Mode{
    }


    public static final float DEFAULT_PUSH_SCALE = 0.97f;
    public static final float DEFAULT_PUSH_STATIC = 2;
    public static final long DEFAULT_PUSH_DURATION = 50;
    public static final long DEFAULT_RELEASE_DURATION = 125;
    public static final int MODE_SCALE = 0;
    public static final int MODE_STATIC_DP = 1;
    public static final AccelerateDecelerateInterpolator DEFAULT_INTERPOLATOR
            = new AccelerateDecelerateInterpolator();

    private final float defaultScale;
    private int mode = MODE_SCALE;
    private float pushScale = DEFAULT_PUSH_SCALE;
    private float pushStatic = DEFAULT_PUSH_STATIC;
    private long durationPush = DEFAULT_PUSH_DURATION;
    private long durationRelease = DEFAULT_RELEASE_DURATION;
    private AccelerateDecelerateInterpolator interpolatorPush = DEFAULT_INTERPOLATOR;
    private AccelerateDecelerateInterpolator interpolatorRelease = DEFAULT_INTERPOLATOR;
    private WeakReference<View> weakView;
    private AnimatorSet scaleAnimSet;

    private PushDownAnim( final View view ){
        this.weakView = new WeakReference<>(view) ;
        this.weakView.get().setClickable( true );
        defaultScale = view.getScaleX();
    }


    public static PushDownAnim setPushDownAnimTo( final View view ){
        PushDownAnim pushAnim = new PushDownAnim( view );
        pushAnim.setOnTouchEvent( null );
        return pushAnim;
    }

    public static PushDownAnimList setPushDownAnimTo( View... views ){
        return new PushDownAnimList( views );
    }

    @Override
    public PushDown setScale( float scale ){
        if( this.mode == MODE_SCALE ){
            this.pushScale = scale;
        }else if( this.mode == MODE_STATIC_DP ){
            this.pushStatic = scale;
        }
        return this;
    }

    @Override
    public PushDown setScale( @Mode int mode, float scale ){
        this.mode = mode;
        this.setScale( scale );
        return this;
    }

    @Override
    public PushDown setDurationPush( long duration ){
        this.durationPush = duration;
        return this;
    }

    @Override
    public PushDown setDurationRelease( long duration ){
        this.durationRelease = duration;
        return this;
    }

    @Override
    public PushDown setInterpolatorPush( AccelerateDecelerateInterpolator interpolatorPush ){
        this.interpolatorPush = interpolatorPush;
        return this;
    }

    @Override
    public PushDown setInterpolatorRelease( AccelerateDecelerateInterpolator interpolatorRelease ){
        this.interpolatorRelease = interpolatorRelease;
        return this;
    }

    @Override
    public PushDown setOnClickListener( View.OnClickListener clickListener ){
        if( weakView.get() != null ){
            weakView.get().setOnClickListener( clickListener );
        }
        return this;
    }

    @Override
    public PushDown setOnLongClickListener( View.OnLongClickListener clickListener ){
        if( weakView.get() != null ){
            weakView.get().setOnLongClickListener( clickListener );
        }
        return this;
    }

    @Override
    public PushDown setOnTouchEvent( final View.OnTouchListener eventListener ){
        if( weakView.get() != null ){
            if( eventListener == null ){
                weakView.get().setOnTouchListener( new View.OnTouchListener(){
                    boolean isOutSide;
                    Rect rect;

                    @Override
                    public boolean onTouch( View view, MotionEvent motionEvent ){
                        if( view.isClickable() ){
                            int i = motionEvent.getAction();
                            if( i == MotionEvent.ACTION_DOWN ){
                                isOutSide = false;
                                rect = new Rect(
                                        view.getLeft(),
                                        view.getTop(),
                                        view.getRight(),
                                        view.getBottom() );
                                makeDecisionAnimScale( view,
                                        mode,
                                        pushScale,
                                        pushStatic,
                                        durationPush,
                                        interpolatorPush,
                                        i );
                            }else if( i == MotionEvent.ACTION_MOVE ){
                                if( rect != null
                                        && !isOutSide
                                        && !rect.contains(
                                        view.getLeft() + (int) motionEvent.getX(),
                                        view.getTop() + (int) motionEvent.getY() ) ){
                                    isOutSide = true;
                                    makeDecisionAnimScale( view,
                                            mode,
                                            defaultScale,
                                            0,
                                            durationRelease,
                                            interpolatorRelease,
                                            i );
                                }
                            }else if( i == MotionEvent.ACTION_CANCEL
                                    || i == MotionEvent.ACTION_UP ){
                                makeDecisionAnimScale( view,
                                        mode,
                                        defaultScale,
                                        0,
                                        durationRelease,
                                        interpolatorRelease,
                                        i );
                            }
                        }
                        return false;
                    }
                } );

            }else{
                weakView.get().setOnTouchListener( new View.OnTouchListener(){

                    @Override
                    public boolean onTouch( View v, MotionEvent motionEvent ){
                        return eventListener.onTouch( weakView.get(), motionEvent );
                    }
                } );
            }
        }

        return this;
    }

    /* =========================== Private method =============================================== */
    private void makeDecisionAnimScale( final View view,
                                        @Mode int mode,
                                        float pushScale,
                                        float pushStatic,
                                        long duration,
                                        TimeInterpolator interpolator,
                                        int action ){
        float tmpScale = pushScale;
        if( mode == MODE_STATIC_DP ){
            tmpScale = getScaleFromStaticSize( pushStatic );
        }
        animScale( view, tmpScale, duration, interpolator );
    }

    private void animScale( final View view,
                            float scale,
                            long duration,
                            TimeInterpolator interpolator ){

        view.animate().cancel();
        if( scaleAnimSet != null ){
            scaleAnimSet.cancel();
        }

        ObjectAnimator scaleX = ObjectAnimator.ofFloat( view, "scaleX", scale );
        ObjectAnimator scaleY = ObjectAnimator.ofFloat( view, "scaleY", scale );
        scaleX.setInterpolator( interpolator );
        scaleX.setDuration( duration );
        scaleY.setInterpolator( interpolator );
        scaleY.setDuration( duration );

        scaleAnimSet = new AnimatorSet();
        scaleAnimSet
                .play( scaleX )
                .with( scaleY );
        scaleX.addListener( new AnimatorListenerAdapter(){
            @Override
            public void onAnimationStart( Animator animation ){
                super.onAnimationStart( animation );
            }

            @Override
            public void onAnimationEnd( Animator animation ){
                super.onAnimationEnd( animation );
            }
        } );
        scaleX.addUpdateListener( new ValueAnimator.AnimatorUpdateListener(){
            @Override
            public void onAnimationUpdate( ValueAnimator valueAnimator ){
                View p = (View) view.getParent();
                if( p != null ) p.invalidate();
            }
        } );
        scaleAnimSet.start();
    }

    private float getScaleFromStaticSize( float sizeStaticDp ){
        if( sizeStaticDp <= 0 ) return defaultScale;

        float sizePx = dpToPx( sizeStaticDp );
        if( getViewWidth() > getViewHeight() ){
            if( sizePx > getViewWidth() ) return 1.0f;
            float pushWidth = getViewWidth() - ( sizePx * 2 );
            return pushWidth / getViewWidth();
        }else{
            if( sizePx > getViewHeight() ) return 1.0f;
            float pushHeight = getViewHeight() - ( sizePx * 2 );
            return pushHeight / (float) getViewHeight();
        }
    }

    private int getViewHeight(){
        return weakView.get().getMeasuredHeight();
    }

    private int getViewWidth(){
        return weakView.get().getMeasuredWidth();
    }

    private float dpToPx( final float dp ){
        return TypedValue.applyDimension( TypedValue.COMPLEX_UNIT_DIP, dp, weakView.get().getResources().getDisplayMetrics() );
    }


}


================================================
FILE: pushdown-anim-click/src/main/java/com/thekhaeng/pushdownanim/PushDownAnimList.java
================================================
package com.thekhaeng.pushdownanim;

import android.view.View;
import android.view.animation.AccelerateDecelerateInterpolator;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by The Khaeng on 09 Sep 2017
 */

public class PushDownAnimList implements PushDown{

    private final List<PushDownAnim> pushDownList = new ArrayList<>();


    PushDownAnimList( View... views ){
        for( View view : views ){
            PushDownAnim pushDown = PushDownAnim.setPushDownAnimTo( view );
            pushDown.setOnTouchEvent( null );
            this.pushDownList.add( pushDown );
        }
    }

    @Override
    public PushDownAnimList setScale( float scale ){
        for( PushDownAnim pushDown : pushDownList ){
            pushDown.setScale( scale );
        }
        return this;
    }

    @Override
    public PushDown setScale( int mode, float scale ){
        for( PushDownAnim pushDown : pushDownList ){
            pushDown.setScale( mode, scale );
        }
        return this;
    }

    @Override
    public PushDownAnimList setDurationPush( long duration ){
        for( PushDownAnim pushDown : pushDownList ){
            pushDown.setDurationPush( duration );
        }
        return this;
    }

    @Override
    public PushDownAnimList setDurationRelease( long duration ){
        for( PushDownAnim pushDown : pushDownList ){
            pushDown.setDurationRelease( duration );
        }
        return this;
    }

    @Override
    public PushDownAnimList setInterpolatorPush( AccelerateDecelerateInterpolator interpolatorPush ){
        for( PushDownAnim pushDown : pushDownList ){
            pushDown.setInterpolatorPush( interpolatorPush );
        }
        return this;
    }

    @Override
    public PushDownAnimList setInterpolatorRelease( AccelerateDecelerateInterpolator interpolatorRelease ){
        for( PushDownAnim pushDown : pushDownList ){
            pushDown.setInterpolatorRelease( interpolatorRelease );
        }
        return this;
    }


    @Override
    public PushDownAnimList setOnClickListener( View.OnClickListener clickListener ){
        for( PushDownAnim pushDown : pushDownList ){
            if( clickListener != null ){
                pushDown.setOnClickListener( clickListener );
            }
        }
        return this;
    }

    @Override
    public PushDown setOnLongClickListener( View.OnLongClickListener clickListener ){
        for( PushDownAnim pushDown : pushDownList ){
            if( clickListener != null ){
                pushDown.setOnLongClickListener( clickListener );
            }
        }
        return this;
    }

    public PushDownAnimList setOnTouchEvent( final View.OnTouchListener eventListener ){
        for( PushDownAnim pushDown : pushDownList ){
            if( eventListener != null ){
                pushDown.setOnTouchEvent( eventListener );
            }
        }
        return this;
    }

}


================================================
FILE: settings.gradle
================================================
include ':app', ':pushdown-anim-click'
Download .txt
gitextract_yyt_bbyb/

├── .gitignore
├── .travis.yml
├── LICENSE.txt
├── README.md
├── app/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       ├── androidTest/
│       │   └── java/
│       │       └── com/
│       │           └── thekhaeng/
│       │               └── pushdownanim/
│       │                   └── ExampleInstrumentedTest.java
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── java/
│       │   │   └── com/
│       │   │       └── thekhaeng/
│       │   │           └── pushdownanimexample/
│       │   │               └── MainActivity.java
│       │   └── res/
│       │       ├── drawable/
│       │       │   ├── button_green_focused.xml
│       │       │   ├── button_green_normal.xml
│       │       │   ├── button_green_pressed.xml
│       │       │   ├── button_white_focused.xml
│       │       │   ├── button_white_normal.xml
│       │       │   ├── button_white_pressed.xml
│       │       │   ├── ic_launcher_background.xml
│       │       │   ├── ic_music.xml
│       │       │   ├── selector_button_green.xml
│       │       │   └── selector_button_white.xml
│       │       ├── drawable-v21/
│       │       │   ├── selector_button_green.xml
│       │       │   └── selector_button_white.xml
│       │       ├── layout/
│       │       │   └── activity_main.xml
│       │       └── values/
│       │           ├── colors.xml
│       │           ├── strings.xml
│       │           └── styles.xml
│       └── test/
│           └── java/
│               └── com/
│                   └── thekhaeng/
│                       └── pushdownanim/
│                           └── ExampleUnitTest.java
├── build.gradle
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── pushdown-anim-click/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           └── java/
│               └── com/
│                   └── thekhaeng/
│                       └── pushdownanim/
│                           ├── PushDown.java
│                           ├── PushDownAnim.java
│                           └── PushDownAnimList.java
└── settings.gradle
Download .txt
SYMBOL INDEX (48 symbols across 6 files)

FILE: app/src/androidTest/java/com/thekhaeng/pushdownanim/ExampleInstrumentedTest.java
  class ExampleInstrumentedTest (line 17) | @RunWith( AndroidJUnit4.class )
    method useAppContext (line 19) | @Test

FILE: app/src/main/java/com/thekhaeng/pushdownanimexample/MainActivity.java
  class MainActivity (line 21) | public class MainActivity extends AppCompatActivity{
    method onCreate (line 28) | @Override
    method getClickListener (line 96) | @NonNull
    method getLongClickListener (line 113) | @NonNull

FILE: app/src/test/java/com/thekhaeng/pushdownanim/ExampleUnitTest.java
  class ExampleUnitTest (line 12) | public class ExampleUnitTest{
    method addition_isCorrect (line 13) | @Test

FILE: pushdown-anim-click/src/main/java/com/thekhaeng/pushdownanim/PushDown.java
  type PushDown (line 10) | public interface PushDown{
    method setScale (line 11) | PushDown setScale( float scale );
    method setScale (line 13) | PushDown setScale( @PushDownAnim.Mode int mode, float scale );
    method setDurationPush (line 15) | PushDown setDurationPush( long duration );
    method setDurationRelease (line 17) | PushDown setDurationRelease( long duration );
    method setInterpolatorPush (line 19) | PushDown setInterpolatorPush( AccelerateDecelerateInterpolator interpo...
    method setInterpolatorRelease (line 21) | PushDown setInterpolatorRelease( AccelerateDecelerateInterpolator inte...
    method setOnClickListener (line 23) | PushDown setOnClickListener( View.OnClickListener clickListener );
    method setOnLongClickListener (line 25) | PushDown setOnLongClickListener( View.OnLongClickListener clickListene...
    method setOnTouchEvent (line 27) | PushDown setOnTouchEvent( View.OnTouchListener eventListener );

FILE: pushdown-anim-click/src/main/java/com/thekhaeng/pushdownanim/PushDownAnim.java
  class PushDownAnim (line 25) | public class PushDownAnim implements PushDown{
    method PushDownAnim (line 52) | private PushDownAnim( final View view ){
    method setPushDownAnimTo (line 59) | public static PushDownAnim setPushDownAnimTo( final View view ){
    method setPushDownAnimTo (line 65) | public static PushDownAnimList setPushDownAnimTo( View... views ){
    method setScale (line 69) | @Override
    method setScale (line 79) | @Override
    method setDurationPush (line 86) | @Override
    method setDurationRelease (line 92) | @Override
    method setInterpolatorPush (line 98) | @Override
    method setInterpolatorRelease (line 104) | @Override
    method setOnClickListener (line 110) | @Override
    method setOnLongClickListener (line 118) | @Override
    method setOnTouchEvent (line 126) | @Override
    method makeDecisionAnimScale (line 197) | private void makeDecisionAnimScale( final View view,
    method animScale (line 211) | private void animScale( final View view,
    method getScaleFromStaticSize (line 253) | private float getScaleFromStaticSize( float sizeStaticDp ){
    method getViewHeight (line 268) | private int getViewHeight(){
    method getViewWidth (line 272) | private int getViewWidth(){
    method dpToPx (line 276) | private float dpToPx( final float dp ){

FILE: pushdown-anim-click/src/main/java/com/thekhaeng/pushdownanim/PushDownAnimList.java
  class PushDownAnimList (line 13) | public class PushDownAnimList implements PushDown{
    method PushDownAnimList (line 18) | PushDownAnimList( View... views ){
    method setScale (line 26) | @Override
    method setScale (line 34) | @Override
    method setDurationPush (line 42) | @Override
    method setDurationRelease (line 50) | @Override
    method setInterpolatorPush (line 58) | @Override
    method setInterpolatorRelease (line 66) | @Override
    method setOnClickListener (line 75) | @Override
    method setOnLongClickListener (line 85) | @Override
    method setOnTouchEvent (line 95) | public PushDownAnimList setOnTouchEvent( final View.OnTouchListener ev...
Condensed preview — 41 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (73K chars).
[
  {
    "path": ".gitignore",
    "chars": 1265,
    "preview": "### Android ###\n# Built application files\n*.apk\n*.ap_\nreports/\npushlibrary*\n*.json\n\n# Media\nresources/\n*.ai\n*.psd\n*.svg\n"
  },
  {
    "path": ".travis.yml",
    "chars": 714,
    "preview": "\nlanguage: android\njdk: openjdk8\n\nandroid:\n  components:\n    - tools\n    - build-tools-27.0.3\n    - android-27\n    - ext"
  },
  {
    "path": "LICENSE.txt",
    "chars": 11357,
    "preview": "                                 Apache License\n                           Version 2.0, January 2004\n                   "
  },
  {
    "path": "README.md",
    "chars": 5882,
    "preview": "# **「 Push Down Animation Click 」**\n\n![alt text](./pictures/logo.png)\n\n[![Build Status](https://travis-ci.org/TheKhaeng/"
  },
  {
    "path": "app/.gitignore",
    "chars": 7,
    "preview": "/build\n"
  },
  {
    "path": "app/build.gradle",
    "chars": 1614,
    "preview": "apply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion 27\n    buildToolsVersion \"27.0.3\"\n    defaultCo"
  },
  {
    "path": "app/proguard-rules.pro",
    "chars": 751,
    "preview": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguar"
  },
  {
    "path": "app/src/androidTest/java/com/thekhaeng/pushdownanim/ExampleInstrumentedTest.java",
    "chars": 755,
    "preview": "package com.thekhaeng.pushdownanim;\n\nimport android.content.Context;\nimport android.support.test.InstrumentationRegistry"
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "chars": 710,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest package=\"com.thekhaeng.pushdownanimexample\"\n          xmlns:android=\"ht"
  },
  {
    "path": "app/src/main/java/com/thekhaeng/pushdownanimexample/MainActivity.java",
    "chars": 5341,
    "preview": "package com.thekhaeng.pushdownanimexample;\n\nimport android.os.Build;\nimport android.os.Bundle;\nimport android.os.Handler"
  },
  {
    "path": "app/src/main/res/drawable/button_green_focused.xml",
    "chars": 232,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:sha"
  },
  {
    "path": "app/src/main/res/drawable/button_green_normal.xml",
    "chars": 232,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:sha"
  },
  {
    "path": "app/src/main/res/drawable/button_green_pressed.xml",
    "chars": 236,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:sha"
  },
  {
    "path": "app/src/main/res/drawable/button_white_focused.xml",
    "chars": 234,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:sha"
  },
  {
    "path": "app/src/main/res/drawable/button_white_normal.xml",
    "chars": 234,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:sha"
  },
  {
    "path": "app/src/main/res/drawable/button_white_pressed.xml",
    "chars": 232,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:sha"
  },
  {
    "path": "app/src/main/res/drawable/ic_launcher_background.xml",
    "chars": 3686,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<vector\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    androi"
  },
  {
    "path": "app/src/main/res/drawable/ic_music.xml",
    "chars": 979,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        androi"
  },
  {
    "path": "app/src/main/res/drawable/selector_button_green.xml",
    "chars": 390,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <item "
  },
  {
    "path": "app/src/main/res/drawable/selector_button_white.xml",
    "chars": 390,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <item "
  },
  {
    "path": "app/src/main/res/drawable-v21/selector_button_green.xml",
    "chars": 331,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ripple xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        androi"
  },
  {
    "path": "app/src/main/res/drawable-v21/selector_button_white.xml",
    "chars": 327,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ripple xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        androi"
  },
  {
    "path": "app/src/main/res/layout/activity_main.xml",
    "chars": 5699,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<android.support.v4.widget.NestedScrollView\n    xmlns:android=\"http://schemas.and"
  },
  {
    "path": "app/src/main/res/values/colors.xml",
    "chars": 388,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#222326</color>\n    <color name=\"color"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "chars": 76,
    "preview": "<resources>\n    <string name=\"app_name\">PushDown Anim</string>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "chars": 383,
    "preview": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar"
  },
  {
    "path": "app/src/test/java/com/thekhaeng/pushdownanim/ExampleUnitTest.java",
    "chars": 404,
    "preview": "package com.thekhaeng.pushdownanim;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * Example local uni"
  },
  {
    "path": "build.gradle",
    "chars": 448,
    "preview": "buildscript {\n    \n    repositories {\n        google()\n        jcenter()\n    }\n    dependencies {\n        classpath 'com"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "chars": 230,
    "preview": "#Fri Apr 27 20:21:13 ICT 2018\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
  },
  {
    "path": "gradle.properties",
    "chars": 731,
    "preview": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will o"
  },
  {
    "path": "gradlew",
    "chars": 4971,
    "preview": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start "
  },
  {
    "path": "gradlew.bat",
    "chars": 2404,
    "preview": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@r"
  },
  {
    "path": "pushdown-anim-click/.gitignore",
    "chars": 7,
    "preview": "/build\n"
  },
  {
    "path": "pushdown-anim-click/build.gradle",
    "chars": 625,
    "preview": "apply plugin: 'com.android.library'\n\nandroid {\n    compileSdkVersion 27\n    buildToolsVersion \"27.0.3\"\n\n\n    defaultConf"
  },
  {
    "path": "pushdown-anim-click/proguard-rules.pro",
    "chars": 751,
    "preview": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguar"
  },
  {
    "path": "pushdown-anim-click/src/main/AndroidManifest.xml",
    "chars": 118,
    "preview": "<manifest package=\"com.thekhaeng.pushdownanim\"\n          xmlns:android=\"http://schemas.android.com/apk/res/android\"/>\n"
  },
  {
    "path": "pushdown-anim-click/src/main/java/com/thekhaeng/pushdownanim/PushDown.java",
    "chars": 817,
    "preview": "package com.thekhaeng.pushdownanim;\n\nimport android.view.View;\nimport android.view.animation.AccelerateDecelerateInterpo"
  },
  {
    "path": "pushdown-anim-click/src/main/java/com/thekhaeng/pushdownanim/PushDownAnim.java",
    "chars": 10304,
    "preview": "package com.thekhaeng.pushdownanim;\n\nimport android.animation.Animator;\nimport android.animation.AnimatorListenerAdapter"
  },
  {
    "path": "pushdown-anim-click/src/main/java/com/thekhaeng/pushdownanim/PushDownAnimList.java",
    "chars": 2924,
    "preview": "package com.thekhaeng.pushdownanim;\n\nimport android.view.View;\nimport android.view.animation.AccelerateDecelerateInterpo"
  },
  {
    "path": "settings.gradle",
    "chars": 39,
    "preview": "include ':app', ':pushdown-anim-click'\n"
  }
]

// ... and 1 more files (download for full content)

About this extraction

This page contains the full source code of the TheKhaeng/pushdown-anim-click GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 41 files (65.6 KB), approximately 17.2k tokens, and a symbol index with 48 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!