forked from Jays2Kings/tachiyomiJ2K
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'j2k/master'
- Loading branch information
Showing
24 changed files
with
269 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/FadeChangeHandler.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package eu.kanade.tachiyomi.ui.base.controller | ||
|
||
import android.animation.Animator | ||
import android.animation.AnimatorSet | ||
import android.animation.ObjectAnimator | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import com.bluelinelabs.conductor.ControllerChangeHandler | ||
import com.bluelinelabs.conductor.changehandler.AnimatorChangeHandler | ||
import com.bluelinelabs.conductor.changehandler.FadeChangeHandler | ||
|
||
/** | ||
* A variation of the original [FadeChangeHandler] that will cross fade two views, but keep | ||
* the from view's alpha as 0 | ||
*/ | ||
class FadeChangeHandler : AnimatorChangeHandler { | ||
constructor() : super() | ||
constructor(removesFromViewOnPush: Boolean) : super(removesFromViewOnPush) | ||
constructor(duration: Long) : super(duration) | ||
constructor(duration: Long, removesFromViewOnPush: Boolean) : super(duration, removesFromViewOnPush) | ||
|
||
override fun getAnimator( | ||
container: ViewGroup, | ||
from: View?, | ||
to: View?, | ||
isPush: Boolean, | ||
toAddedToContainer: Boolean, | ||
): Animator { | ||
val animator = AnimatorSet() | ||
if (to != null) { | ||
val start = if (toAddedToContainer) 0F else to.alpha | ||
animator.play(ObjectAnimator.ofFloat(to, View.ALPHA, start, 1f)) | ||
} | ||
if (from != null && (!isPush || removesFromViewOnPush)) { | ||
animator.play(ObjectAnimator.ofFloat(from, View.ALPHA, 0f)) | ||
} | ||
return animator | ||
} | ||
|
||
override fun resetFromView(from: View) {} | ||
|
||
override fun copy(): ControllerChangeHandler = eu.kanade.tachiyomi.ui.base.controller.FadeChangeHandler(animationDuration, removesFromViewOnPush) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.