Skip to content

Commit

Permalink
feat: ๐ŸŽธ added setSlots method (#42)
Browse files Browse the repository at this point in the history
* feat: ๐ŸŽธ added setSlots method

* chore: ๐Ÿค– bumped version to 0.6.1

* feat: ๐ŸŽธ added activeThemeId and activeAnimationId
  • Loading branch information
afsalz authored Nov 22, 2024
1 parent 55452a7 commit e7ebc3e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dotlottie/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

group = "com.github.LottieFiles"
version = "0.6.0"
version = "0.6.1"

android {
namespace = "com.lottiefiles.dotlottie.core"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ class DotLottieController {
val markers: List<Marker>
get() = dlplayer?.markers() ?: emptyList()

val activeThemeId: String
get() = dlplayer?.activeThemeId() ?: ""

val activeAnimationId: String
get() = dlplayer?.activeAnimationId() ?: ""

fun play() {
dlplayer?.play()
}
Expand Down Expand Up @@ -324,6 +330,10 @@ class DotLottieController {
dlplayer?.resetTheme()
}

fun setSlots(slots: String) {
dlplayer?.setSlots(slots)
}

fun setPlayMode(mode: Mode) {
dlplayer?.let {
val config = it.config()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ class DotLottieDrawable(
dlPlayer!!.setConfig(config)
}

val activeThemeId: String
get() = dlPlayer?.activeThemeId() ?: ""

val activeAnimationId: String
get() = dlPlayer?.activeAnimationId() ?: ""

@get:FloatRange(from = 0.0)
var speed: Float
get() = dlPlayer!!.config().speed
Expand Down Expand Up @@ -293,6 +299,10 @@ class DotLottieDrawable(
dlPlayer?.resetTheme()
}

fun setSlots(slots: String) {
dlPlayer?.setSlots(slots)
}

fun manifest(): Manifest? {
return dlPlayer?.manifest()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ class DotLottieAnimation @JvmOverloads constructor(
val markers: List<Marker>
get() = mLottieDrawable?.markers ?: error("DotLottieDrawable is null")


val activeThemeId: String
get() = mLottieDrawable?.activeThemeId ?: ""

val activeAnimationId: String
get() = mLottieDrawable?.activeAnimationId ?: ""

/***
* Method
*/
Expand Down Expand Up @@ -171,6 +178,10 @@ class DotLottieAnimation @JvmOverloads constructor(
mLottieDrawable?.resetTheme()
}

fun setSlots(slots: String) {
mLottieDrawable?.setSlots(slots)
}

fun play() {
mLottieDrawable?.play()
}
Expand Down

0 comments on commit e7ebc3e

Please sign in to comment.