Skip to content

Commit

Permalink
WTA #40: Added new animations and added link to source for all animat…
Browse files Browse the repository at this point in the history
…ions.
  • Loading branch information
Jacob3075 committed Nov 7, 2022
1 parent f521091 commit 86e411d
Show file tree
Hide file tree
Showing 12 changed files with 341,329 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,22 @@ fun WtaAnimation(
text: String,
animationTestTag: String,
modifier: Modifier = Modifier,
) = Column(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center,
modifier = modifier.fillMaxSize()
) {
val composition by rememberLottieComposition(RawRes(animation))

Column(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center,
modifier = modifier.fillMaxSize()
) {
LottieAnimation(
composition = composition,
iterations = LottieConstants.IterateForever,
modifier = Modifier.testTag(animationTestTag)
)
Spacer(modifier = Modifier.height(MaterialTheme.spacing.lMedium))
Text(
text = text,
style = MaterialTheme.typography.titleMedium,
)
}
Spacer(modifier = Modifier.weight(0.5f))
LottieAnimation(
composition = composition,
iterations = LottieConstants.IterateForever,
modifier = Modifier.testTag(animationTestTag).weight(2f),
)
Spacer(modifier = Modifier.height(MaterialTheme.spacing.lMedium))
Text(
text = text,
style = MaterialTheme.typography.titleMedium,
modifier = Modifier.weight(1f)
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,71 +6,118 @@ import com.jacob.wakatimeapp.core.ui.R.raw

@Immutable
object Animations {
@RawRes
private val blueLoading = raw.blue_loading

/**
* [Source](https://lottiefiles.com/81813-blue-loading)
*/
@RawRes
private val dotsAndLinesLoadingPlexus = raw.dots_and_lines_loading_plexus
private val blueLoading = raw.blue_loading

/**
* [Source](https://lottiefiles.com/629-empty-box)
*/
@RawRes
private val emptyBox1 = raw.empty_box_1

@RawRes
private val emptyBox2 = raw.empty_box_2

@RawRes
private val empty = raw.empty

/**
* [Source](https://lottiefiles.com/38463-error)
*/
@RawRes
private val error1 = raw.error_1

/**
* [Source](https://lottiefiles.com/51382-astronaut-light-theme)
*/
@RawRes
private val error2 = raw.error_2

/**
* [Source](https://lottiefiles.com/67012-404-error-animation)
*/
@RawRes
private val errorAnimation = raw.error_animation

/**
* [Source](https://lottiefiles.com/87491-liquid-blobby-loader-green)
*/
@RawRes
private val liquidBlobLoaderGreen = raw.liquid_blob_loader_green

/**
* [Source](https://lottiefiles.com/60867-waiting)
*/
@RawRes
private val expandingUiElements = raw.expanding_ui_elements
private val loading1 = raw.loading_1

/**
* [Source](https://lottiefiles.com/9305-loading-bloob)
*/
@RawRes
private val internet = raw.internet
private val loadingBlob = raw.loading_blob

/**
* [Source](https://lottiefiles.com/9844-loading-40-paperplane)
*/
@RawRes
private val jumpingBoxOnRopeLoadingAnimation = raw.jumping_box_on_rope_loading_animation
private val loadingPaperPlane = raw.loading_paper_plane_1

/**
* [Source](https://lottiefiles.com/64095-no-mobile-internet)
*/
@RawRes
private val liquidBlobLoaderGreen = raw.liquid_blob_loader_green
private val noMobileInternet = raw.no_mobile_internet

@RawRes
private val loading1 = raw.loading_1
/**
* [Source](https://lottiefiles.com/78255-background-looping-animation)
*/
private val backgroundLooping = raw.background_looping_animation

/**
* [Source](https://lottiefiles.com/98312-empty)
*/
@RawRes
private val loading2 = raw.loading_2
private val empty = raw.empty_2

/**
* [Source](https://lottiefiles.com/8572-liquid-blobby-loader)
* */
@RawRes
private val loadingAnimation = raw.loading_animation
private val liquidBlobLoader = raw.liquid_blobby_loader

/**
* [Source](https://lottiefiles.com/28-loading)
*/
@RawRes
private val loadingBlob = raw.loading_blob
private val loading2 = raw.loading_3

/**
* [Source](https://lottiefiles.com/101961-non-data-found)
* */
@RawRes
private val loadingPaperPlane1 = raw.loading_paper_plane_1
private val noDataFound = raw.no_data_found

/**
* [Source](https://lottiefiles.com/94905-404-not-found)
* */
@RawRes
private val loopLoadingAnimation = raw.loop_loading_animation
private val notFound = raw.not_found

/**
* [Source](https://lottiefiles.com/448-ripple-loading-animation)
*/
@RawRes
private val noMobileInternet = raw.no_mobile_internet
private val rippleLoading = raw.ripple_loading_animation

/**
* [Source](https://lottiefiles.com/66934-tumbleweed-rolling)
*/
@RawRes
private val worldLocations = raw.world_locations
private val tumbleweed = raw.tumbleweed_rolling

private val otherAnimations = listOf(
private val emptyAnimations = listOf(
emptyBox1,
empty,
internet, // noMobileInternet,
// emptyBox2,
)

private val errorAnimations = listOf(
Expand All @@ -81,17 +128,21 @@ object Animations {

private val loadingAnimations = listOf(
loadingBlob,
loadingPaperPlane1,
loadingPaperPlane,
liquidBlobLoaderGreen,
liquidBlobLoader,
blueLoading,
loading1,
loopLoadingAnimation, // FIXME: CHANGE COLOR
jumpingBoxOnRopeLoadingAnimation, // FIXME: CHANGE COLOR
// dotsAndLinesLoadingPlexus,
// loadingAnimation,
// expandingUiElements,
// worldLocations,
// loading2,
loading2,
tumbleweed,
rippleLoading,
backgroundLooping,
)

private val noDataAnimations = listOf(
notFound,
noDataFound,
noMobileInternet,
)

val randomLoadingAnimation
Expand All @@ -100,6 +151,9 @@ object Animations {
val randomErrorAnimation
@RawRes get() = errorAnimations.random()

val randomOtherAnimation
@RawRes get() = otherAnimations.random()
val randomEmptyAnimation
@RawRes get() = emptyAnimations.random()

val randomNoDataAnimation
@RawRes get() = noDataAnimations.random()
}
Loading

0 comments on commit 86e411d

Please sign in to comment.