All Projects → skydoves → Elasticviews

skydoves / Elasticviews

Licence: mit
✨ An easy way to implement an elastic touch effect for Android.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Elasticviews

Ctrpf Ar Cheat Codes
[Database] CTRPF AR CHEAT CODES TO BE USED WITH CTRPF WITH ACTION REPLAY SUPPORT
Stars: ✭ 310 (-47.28%)
Mutual labels:  action
Rest In Action
REST in Action 《REST 实战》。基于 Jersey 构建 RESTful 服务。
Stars: ✭ 472 (-19.73%)
Mutual labels:  action
Motionlayoutexamples
🆒 Motion layout animation examples
Stars: ✭ 543 (-7.65%)
Mutual labels:  android-animation
Android Extensions
An Android library with modules to quickly bootstrap an Android application.
Stars: ✭ 356 (-39.46%)
Mutual labels:  android-animation
Pfelk
pfSense/OPNsense + ELK
Stars: ✭ 417 (-29.08%)
Mutual labels:  elastic
Mediumclap Android
👏 The Medium's Clapping Effect developed in Android
Stars: ✭ 485 (-17.52%)
Mutual labels:  android-animation
Android Nosql
Lightweight, simple structured NoSQL database for Android
Stars: ✭ 284 (-51.7%)
Mutual labels:  elastic
Elasticview
Elastic view is a regular CardView, which can flex from user touches
Stars: ✭ 566 (-3.74%)
Mutual labels:  elastic
Ticker
An Android text view with scrolling text change animation
Stars: ✭ 4,194 (+613.27%)
Mutual labels:  android-animation
Zentral
Zentral is an open-source solution for infrastructure monitoring and endpoint event stream processing. It provides build-in orchestration of macOS security components (Santa, Osquery, et-al.), event correlation and event management. It consolidates its features with various data store backends (ElasticStack, Azure Log Analytics, Splunk, et-al.).
Stars: ✭ 522 (-11.22%)
Mutual labels:  elastic
Ssh Agent
GitHub Action to setup `ssh-agent` with a private key
Stars: ✭ 365 (-37.93%)
Mutual labels:  action
React Native Actions Sheet
A Cross Platform(Android & iOS) ActionSheet with a flexible api, native performance and zero dependency code for react native. Create anything you want inside ActionSheet.
Stars: ✭ 412 (-29.93%)
Mutual labels:  action
Rxanimations
Repository for android animations Rx wrapper
Stars: ✭ 488 (-17.01%)
Mutual labels:  android-animation
Elasticdragdismisslayout
Standard ViewGroups which responds to nested scrolls to create drag-dismissable layouts.
Stars: ✭ 312 (-46.94%)
Mutual labels:  elastic
Redux Ecosystem Links
A categorized list of Redux-related addons, libraries, and utilities
Stars: ✭ 5,076 (+763.27%)
Mutual labels:  action
Compressed Size Action
GitHub Action that adds compressed size changes to your PRs.
Stars: ✭ 300 (-48.98%)
Mutual labels:  action
Naev
Naev is a 2d action/rpg space game that combines elements from the action, rpg and simulation genres.
Stars: ✭ 482 (-18.03%)
Mutual labels:  action
Audio Visualizer Android
🎵 [Android Library] A light-weight and easy-to-use Audio Visualizer for Android.
Stars: ✭ 581 (-1.19%)
Mutual labels:  android-animation
Animation Tutorials
🍭🚀💗 Tutorials about animations with Animators, Animated Vector Drawables, Shared Transitions, and more
Stars: ✭ 557 (-5.27%)
Mutual labels:  android-animation
Graphql Compose Elasticsearch
Hide Elastic Search REST API behind GraphQL.
Stars: ✭ 498 (-15.31%)
Mutual labels:  elastic

ElasticViews

License API Build Status Android Weekly Javadoc

✨ An easy way to implement an elastic touch effect for Android.

Including in your project

Maven Central Kitpack

Gradle

Add below codes to your root build.gradle file (not your module build.gradle file).

allprojects {
    repositories {
        mavenCentral()
    }
}

And add a dependency code to your module's build.gradle file. dependencies { implementation "com.github.skydoves:elasticviews:2.0.9" }


## Usage
`ElasticViews` lets we use like using normal views and gives all of the Views or GroupViews touch effect very simply.

#### Add XML Namespace
First add below XML Namespace inside your XML layout file.

```gradle
xmlns:app="http://schemas.android.com/apk/res-auto"

OnClick Method

All of ElasticViews should be set OnClickListener or OnClick method. If not, nothing happens.

ElasticButton elasticButton = (ElasticButton)findViewById(R.id.elasticbutton);
elasticButton.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        // do something
    }
});

ElasticButton

<com.skydoves.elasticviews.ElasticButton
   android:layout_width="match_parent"
   android:layout_height="wrap_content"
   android:text="Elastic Button"
   android:textColor="@android:color/white"
   android:textSize="17sp"
   app:button_cornerRadius="4dp"
   app:button_duration="250"
   app:button_scale="0.87" />

ElasticCheckButton

<com.skydoves.elasticviews.ElasticCheckButton
   android:layout_width="match_parent"
   android:layout_height="45dp"
   android:background="#30354b"
   android:text="Text"
   android:textColor="@android:color/white"
   android:textStyle="bold"
   app:checkButton_cornerRadius="4dp"
   app:checkButton_alpha="0.7"
   app:checkButton_duration="400"
   app:checkButton_scale="0.9" />

ElasticImageView

<com.skydoves.elasticviews.ElasticImageView
   android:layout_width="23dp"
   android:layout_height="23dp"
   android:scaleType="fitXY"
   android:src="@drawable/ic_question"
   android:tint="#3d95c9"
   app:imageView_scale="0.7"
   app:imageView_duration="300" />

ElasticFloatingButton

<com.skydoves.elasticviews.ElasticFloatingActionButton
   android:layout_width="64dp"
   android:layout_height="64dp"
   android:src="@drawable/ic_add"
   android:tint="#ffffff"
   app:fabSize="normal"
   app:fabutton_duration="400"
   app:fabutton_scale="0.85" />

ElasticCardView

<com.skydoves.elasticviews.ElasticCardView
  android:layout_width="match_parent"
  android:layout_height="120dp"
  app:cardCornerRadius="8dp"
  app:cardElevation="12dp"
  app:cardBackgroundColor="@color/background"
  app:cardView_duration="250"
  app:cardView_scale="0.8" >

  ...

</com.skydoves.elasticviews.ElasticCardView>

ElasticLayout

ElasticLayout gives elastic animation to all child views.

<com.skydoves.elasticviews.ElasticLayout
  android:layout_width="match_parent"
  android:layout_height="80dp"
  app:layout_cornerRadius="4dp"
  app:layout_duration="500"
  app:layout_scale="0.85">

  <TextView
      android:id="@+id/textView0"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:text="This is"
      android:textColor="#ffffff"
      android:textSize="18sp" />

  <TextView
      android:layout_below="@+id/textView1"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_alignParentBottom="true"
      android:text="ElasticLayout"
      android:textColor="#ffffff"
      android:textSize="18sp"
      android:gravity="end" />
</com.skydoves.elasticviews.ElasticLayout>

ElasticAnimation

ElasticAnimation implements elastic animations for android views and view groups.

new ElasticAnimation(clickedView).setScaleX(0.9f).setScaleY(0.9f).setDuration(400)
.setOnFinishListener(onFinishListener).doAction();

ViewPropertyAnimatorListener

we can set ViewPropertyAnimatorListener using setListener method and detect animation's status.

.setListener(new ViewPropertyAnimatorListener() {
   @Override
   public void onAnimationStart(View view) {
       // do something
   }

   Override
   public void onAnimationEnd(View view) {
       finishListener.onFinished();
   }

   Override
   public void onAnimationCancel(View view) {
       // do something
   }
});

Kotlin Extension

ElasticAnimation supports kotlin extension elasticAnimation.

val anim = textView.elasticAnimation(0.8f, 0.8f, 400, object: ElasticFinishListener {
    override fun onFinished() {
        // do anything
    }
})
anim.doAction()

Kotlin dsl

elasticAnimation(this) {
  setDuration(duration)
  setScaleX(scale)
  setScaleY(scale)
  setOnFinishListener(object : ElasticFinishListener {
       override fun onFinished() {
       onClick()
    }
  })
}.doAction()

Example : Normal Button

we can implement animation on all of the views like below.

@OnClick(R.id.button)
public void addNewAlarm(View v){
    // implements animation uising ElasticAnimation
    new ElasticAnimation(v).setScaleX(0.85f).setScaleY(0.85f).setDuration(500)
    .setOnFinishListener(new ElasticFinishListener() {
            @Override
            public void onFinished() {
                // Do something after duration time
            }
        }).doAction();
    }
}

Example : ListView Item

So also we can implement animation on listView's items like below.

private class ListViewItemClickListener implements AdapterView.OnItemClickListener {
    @Override
    public void onItemClick(AdapterView<?> adapterView, View clickedView, final int pos, long id) {
      new ElasticAnimation(clickedView).setScaleX(0.9f).setScaleY(0.9f).setDuration(400)
        .setOnFinishListener(new ElasticFinishListener() {
              @Override
              public void onFinished() {
              //Do something after duration time
              Toast.makeText(getBaseContext(), "ListViewItem" + pos, Toast.LENGTH_SHORT).show();
              }
          }).doAction();
        }
    };

Find this library useful? ❤️

Support it by joining stargazers for this repository. ⭐️

Sponsor ☕️

If you feel like to sponsor me a coffee for my efforts, I would greatly appreciate it.

Buy Me A Coffee

License

The MIT License (MIT)

Copyright (c) 2017 skydoves

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].