Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ object RxAnimation {
* @param view [View] param mandatory.
* @return An [Observable] of [View].
*/
@JvmStatic
fun from(view: View): Observable<View> = Observable.just(view)

/**
Expand All @@ -25,6 +26,7 @@ object RxAnimation {
* @see from
* @return A [Completable].
*/
@JvmStatic
fun together(vararg completables: Completable): Completable =
Completable.mergeArray(*completables)

Expand All @@ -35,6 +37,7 @@ object RxAnimation {
* @see from
* @return A [Completable].
*/
@JvmStatic
fun sequentially(vararg completables: Completable): Completable =
completables.first().run {
if (completables.size > 1) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@file:JvmName("RxAnimationExtension")
package com.mikhaellopez.rxanimation

import android.animation.TimeInterpolator
Expand Down Expand Up @@ -27,6 +28,7 @@ private fun Observable<View>.doCompletable(actionCompletable: (View) -> Completa
* @param action ([Any]) -> [Unit] the action to do on UpdateListener.
* @return An [Observable] of [View].
*/
@JvmOverloads
fun Observable<View>.startValueAnimator(
valueAnimator: ValueAnimator,
duration: Long? = null,
Expand All @@ -50,6 +52,7 @@ fun Observable<View>.startValueAnimator(
* @see rangeInt
* @return An [Observable] of [View].
*/
@JvmOverloads
fun Observable<View>.rangeFloat(
start: Float, end: Float,
duration: Long? = null,
Expand All @@ -72,6 +75,7 @@ fun Observable<View>.rangeFloat(
* @see rangeFloat
* @return An [Observable] of [View].
*/
@JvmOverloads
fun Observable<View>.rangeInt(
start: Int, end: Int,
duration: Long? = null,
Expand All @@ -98,6 +102,7 @@ fun Observable<View>.rangeInt(
* @see fadeOut
* @return An [Observable] of [View].
*/
@JvmOverloads
fun Observable<View>.alpha(
alpha: Float,
duration: Long? = null,
Expand All @@ -121,6 +126,7 @@ fun Observable<View>.alpha(
* @see fadeOut
* @return An [Observable] of [View].
*/
@JvmOverloads
fun Observable<View>.fadeIn(
duration: Long? = null,
interpolator: TimeInterpolator? = null,
Expand All @@ -143,6 +149,7 @@ fun Observable<View>.fadeIn(
* @see fadeIn
* @return An [Observable] of [View].
*/
@JvmOverloads
fun Observable<View>.fadeOut(
duration: Long? = null,
interpolator: TimeInterpolator? = null,
Expand All @@ -167,6 +174,7 @@ fun Observable<View>.fadeOut(
* @param reverse [Boolean] optional, false by default.
* @return An [Observable] of [View].
*/
@JvmOverloads
fun Observable<View>.translation(
translationX: Float,
translationY: Float,
Expand Down Expand Up @@ -201,6 +209,7 @@ fun Observable<View>.translation(
* @see translationY
* @return An [Observable] of [View].
*/
@JvmOverloads
fun Observable<View>.translationX(
translationX: Float,
duration: Long? = null,
Expand All @@ -225,6 +234,7 @@ fun Observable<View>.translationX(
* @see translationX
* @return An [Observable] of [View].
*/
@JvmOverloads
fun Observable<View>.translationY(
translationY: Float,
duration: Long? = null,
Expand All @@ -251,6 +261,7 @@ fun Observable<View>.translationY(
* @see scaleY
* @return An [Observable] of [View].
*/
@JvmOverloads
fun Observable<View>.scale(
scale: Float,
duration: Long? = null,
Expand All @@ -275,6 +286,7 @@ fun Observable<View>.scale(
* @see scaleY
* @return An [Observable] of [View].
*/
@JvmOverloads
fun Observable<View>.scaleX(
scaleX: Float,
duration: Long? = null,
Expand All @@ -299,6 +311,7 @@ fun Observable<View>.scaleX(
* @see scaleX
* @return An [Observable] of [View].
*/
@JvmOverloads
fun Observable<View>.scaleY(
scaleY: Float,
duration: Long? = null,
Expand All @@ -325,6 +338,7 @@ fun Observable<View>.scaleY(
* @see rotationY
* @return An [Observable] of [View].
*/
@JvmOverloads
fun Observable<View>.rotation(
rotation: Float,
duration: Long? = null,
Expand All @@ -349,6 +363,7 @@ fun Observable<View>.rotation(
* @see rotationY
* @return An [Observable] of [View].
*/
@JvmOverloads
fun Observable<View>.rotationX(
rotationX: Float,
duration: Long? = null,
Expand All @@ -373,6 +388,7 @@ fun Observable<View>.rotationX(
* @see rotationX
* @return An [Observable] of [View].
*/
@JvmOverloads
fun Observable<View>.rotationY(
rotationY: Float,
duration: Long? = null,
Expand Down Expand Up @@ -400,6 +416,7 @@ fun Observable<View>.rotationY(
* @return An [Observable] of [View].
*/
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@JvmOverloads
fun Observable<View>.xyz(
x: Float? = null,
y: Float? = null,
Expand Down Expand Up @@ -427,6 +444,7 @@ fun Observable<View>.xyz(
* @see z
* @return An [Observable] of [View].
*/
@JvmOverloads
fun Observable<View>.x(
x: Float,
duration: Long? = null,
Expand All @@ -452,6 +470,7 @@ fun Observable<View>.x(
* @see z
* @return An [Observable] of [View].
*/
@JvmOverloads
fun Observable<View>.y(
y: Float,
duration: Long? = null,
Expand All @@ -478,6 +497,7 @@ fun Observable<View>.y(
* @return An [Observable] of [View].
*/
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@JvmOverloads
fun Observable<View>.z(
z: Float,
duration: Long? = null,
Expand All @@ -502,6 +522,7 @@ fun Observable<View>.z(
* @param reverse [Boolean] optional, false by default.
* @return An [Observable] of [View].
*/
@JvmOverloads
fun Observable<View>.resize(
width: Int, height: Int,
duration: Long? = null,
Expand All @@ -524,6 +545,7 @@ fun Observable<View>.resize(
* @see height
* @return An [Observable] of [View].
*/
@JvmOverloads
fun Observable<View>.width(
width: Int,
duration: Long? = null,
Expand All @@ -546,6 +568,7 @@ fun Observable<View>.width(
* @see width
* @return An [Observable] of [View].
*/
@JvmOverloads
fun Observable<View>.height(
height: Int,
duration: Long? = null,
Expand All @@ -570,6 +593,7 @@ fun Observable<View>.height(
* @see View.backgroundColor
* @return An [Observable] of [View].
*/
@JvmOverloads
fun Observable<View>.backgroundColor(
colorFrom: Int,
colorTo: Int,
Expand All @@ -590,6 +614,7 @@ fun Observable<View>.backgroundColor(
* @see View.shake
* @return An [Observable] of [View].
*/
@JvmOverloads
fun Observable<View>.shake(
duration: Long = 300,
nbShake: Float = 2f,
Expand All @@ -610,6 +635,7 @@ fun Observable<View>.shake(
* @see View.press
* @return An [Observable] of [View].
*/
@JvmOverloads
fun Observable<View>.press(
depth: Float = 0.95f,
duration: Long? = null,
Expand All @@ -634,6 +660,7 @@ fun Observable<View>.press(
* @see TextView.text
* @return An [Observable] of [TextView].
*/
@JvmOverloads
fun Observable<TextView>.text(
text: String,
duration: Long = 300L,
Expand Down
Loading