{"id":18663802,"url":"https://github.com/lopspower/rxanimation","last_synced_at":"2025-04-04T19:09:25.527Z","repository":{"id":57726672,"uuid":"192572226","full_name":"lopspower/RxAnimation","owner":"lopspower","description":"Simple way to animate your views on Android with Rx 🚀","archived":false,"fork":false,"pushed_at":"2022-11-25T11:37:58.000Z","size":4539,"stargazers_count":593,"open_issues_count":4,"forks_count":47,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-28T18:09:09.810Z","etag":null,"topics":["android","animation","animation-library","rxanimations","rxjava2","rxkotlin","rxkotlin-android"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lopspower.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null},"funding":{"github":"lopspower","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2019-06-18T15:59:51.000Z","updated_at":"2025-02-14T14:51:10.000Z","dependencies_parsed_at":"2023-01-23T16:00:30.286Z","dependency_job_id":null,"html_url":"https://github.com/lopspower/RxAnimation","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lopspower%2FRxAnimation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lopspower%2FRxAnimation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lopspower%2FRxAnimation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lopspower%2FRxAnimation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lopspower","download_url":"https://codeload.github.com/lopspower/RxAnimation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247234921,"owners_count":20905854,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","animation","animation-library","rxanimations","rxjava2","rxkotlin","rxkotlin-android"],"created_at":"2024-11-07T08:19:50.726Z","updated_at":"2025-04-04T19:09:25.506Z","avatar_url":"https://github.com/lopspower.png","language":"Kotlin","funding_links":["https://github.com/sponsors/lopspower"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"/preview/header.png\"\u003e\u003c/p\u003e\n\n\u003cimg src=\"/preview/title.gif\" alt=\"title\" title=\"title\" width=\"300\" height=\"87.8\" /\u003e\n\n[![Platform](https://img.shields.io/badge/platform-android-green.svg)](http://developer.android.com/index.html)\n[![API](https://img.shields.io/badge/API-16%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=16)\n[![Maven Central](https://img.shields.io/maven-central/v/com.mikhaellopez/rxanimation.svg?label=Maven%20Central)](https://search.maven.org/artifact/com.mikhaellopez/rxanimation)\n[![Twitter](https://img.shields.io/badge/Twitter-@LopezMikhael-blue.svg?style=flat)](http://twitter.com/lopezmikhael)\n\nThis is an Android library to make a simple way to animate your views on Android with Rx.\n\n\u003ca href=\"https://play.google.com/store/apps/details?id=com.mikhaellopez.lopspower\"\u003e\n  \u003cimg alt=\"Android app on Google Play\" src=\"https://developer.android.com/images/brand/en_app_rgb_wo_45.png\" /\u003e\n\u003c/a\u003e\n\nUSAGE\n-----\n\nAdd RxAnimation library under **Rx3** with Gradle:\n\n```groovy\nimplementation 'com.mikhaellopez:rxanimation:2.1.1'\n```\n\n:warning: If you use **Rx2** you need to implement the following version (just on jcenter):\n\n```groovy\nimplementation 'com.mikhaellopez:rxanimation:1.0.0'\n```\n\nKOTLIN\n-----\n\n\u003cimg src=\"/preview/0.gif\" alt=\"sample\" title=\"sample\" width=\"250\" height=\"160\" align=\"right\" /\u003e\n\n-   Animate your views and handle it in [Completable](http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Completable.html). For example **`alpha()`** and **`resize()`**:\n\n```kotlin\nview1.alpha(1f)\n    .andThen(view2.resize(100, 100))\n```\n\n\u003cbr/\u003e\n\n\u003cimg src=\"/preview/1.gif\" alt=\"sample\" title=\"sample\" width=\"250\" height=\"160\" align=\"right\" /\u003e\n\n-   If you want to apply animation in the same time you can used **`RxAnimation.together()`**:\n\n```kotlin\nRxAnimation.together(\n    view1.fadeIn(),\n    view1.translation(20f, 30f),\n    view2.backgroundColor(\n        ContextCompat.getColor(this, R.color.accent),\n        ContextCompat.getColor(this, R.color.primary)\n    ),\n    view2.resize(100, 100)\n)\n```\n\n\u003cimg src=\"/preview/2.gif\" alt=\"sample\" title=\"sample\" width=\"250\" height=\"160\" align=\"right\" /\u003e\n\n-   If you want to apply animation one by one you can used **`RxAnimation.sequentially()`** instead of multi `andThen()`:\n\n```kotlin\nRxAnimation.sequentially(\n    view1.fadeIn(),\n    view1.translation(20f, 30f),\n    view2.backgroundColor(\n        ContextCompat.getColor(this, R.color.accent),\n        ContextCompat.getColor(this, R.color.primary)\n    ),\n    view2.resize(100, 100)\n)\n```\n\n\u003cimg src=\"/preview/3.gif\" alt=\"sample\" title=\"sample\" width=\"250\" height=\"160\" align=\"right\" /\u003e\n\n-   You can also used **`RxAnimation.from(view)`** if you want to update multi properties one by one in the same view:\n\n```kotlin\nRxAnimation.from(view)\n    .fadeIn()\n    .translation(20f, 30f)\n    .backgroundColor(\n        ContextCompat.getColor(this, R.color.accent),\n        ContextCompat.getColor(this, R.color.primary)\n    )\n    .resize(100, 100)\n```\n\n\u003cimg src=\"/preview/4.gif\" alt=\"sample\" title=\"sample\" width=\"250\" height=\"160\" align=\"right\" /\u003e\n\n-   You can also use the **`range()`** function to animate a change on a custom property:\n\n```kotlin\n(4f to 20f).rangeFloatToCompletable { \n    circularImageView.borderWidth = it \n}\n\n// or\n\nRxAnimation.from(circularImageView)\n    .rangeFloat(4f, 20f) { circularImageView?.borderWidth = it }\n```\n\n-   Use `reverse` properties to back to the initial value in all methods:\n\n```kotlin\nview.fadeIn(reverse = true)\n```\n\n-   If you want to repeat an animation you can use the native method [`repeat`](http://reactivex.io/documentation/operators/repeat.html) from Rx like this:\n\n```kotlin\nRxAnimation.from(view)\n    .fadeIn()\n    .shake()\n    .fadeOut()\n    .repeat(NB_REPEAT)\n    .subscribe()\n```\n\nALL PROPERTIES\n-----\n\n### Default\n\n| Properties           | View to Completable | RxAnimation.from(view) |\n| -------------------- | ------------------- | ---------------------- |\n| alpha                | alpha               | alpha                  |\n| translationX         | translationX        | translationX           |\n| translationY         | translationY        | translationY           |\n| translation X + Y    | translation(X, Y)   | translation(X, Y)      |\n| scaleX               | scaleX              | scaleX                 |\n| scaleY               | scaleY              | scaleY                 |\n| scale X = Y          | scale               | scale                  |\n| rotation             | rotation            | rotation               |\n| rotationX            | rotationX           | rotationX              |\n| rotationY            | rotationY           | rotationY              |\n| X                    | x                   | x                      |\n| Y                    | y                   | y                      |\n| Z                    | z                   | z                      |\n| X + Y + Z            | xyz                 | xyz                    |\n| backgroundColor      | backgroundColor     | backgroundColor        |\n| width                | width               | width                  |\n| height               | height              | height                 |\n| width + height       | resize              | resize                 |\n| ValueAnimator        | start               | startValueAnimator     |\n| ViewPropertyAnimator | animate             | -                      |\n\n### Custom Properties\n\n| View to Completable     | RxAnimation.from(view) |\n| ----------------------- | ---------------------- |\n| rangeFloatToCompletable | rangeFloat             |\n| rangeIntToCompletable   | rangeInt               |\n\n### Smart function\n\n| Animation | View to Completable | RxAnimation.from(view) |\n| --------- | ------------------- | ---------------------- |\n| alpha=1f  | fadeIn              | fadeIn                 |\n| alpha=0f  | fadeOut             | fadeOut                |\n| shake     | shake               | shake                  |\n| press     | press               | press                  |\n| text      | text                | text                   |\n\n:information_source: All the functions have `duration: Long`, `interpolator: TimeInterpolator`, `startDelay: Long` and `reverse: Boolean` properties.\n\nSUPPORT ❤️\n-----\n\nFind this library useful? Support it by joining [**stargazers**](https://github.com/lopspower/RxAnimation/stargazers) for this repository ⭐️\n\u003cbr/\u003e\nAnd [**follow me**](https://github.com/lopspower?tab=followers) for my next creations 👍\n\nLICENCE\n-----\n\nRxAnimation by [Lopez Mikhael](http://mikhaellopez.com/) is licensed under a [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flopspower%2Frxanimation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flopspower%2Frxanimation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flopspower%2Frxanimation/lists"}