Skip to content

Commit

Permalink
Upgraded a bunch of dependencies (#2382)
Browse files Browse the repository at this point in the history
  • Loading branch information
gpeal authored Sep 3, 2023
1 parent 3b6bab2 commit 34aa06b
Show file tree
Hide file tree
Showing 25 changed files with 177 additions and 175 deletions.
2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ import org.ajoberstar.grgit.Grgit
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id "com.android.tools.build" apply false
id 'net.ltgt.errorprone' apply false
id "com.google.devtools.ksp" apply false
id "org.ajoberstar.grgit" apply false
id "com.android.library" apply false
id "org.jetbrains.kotlin.jvm" apply false
id "com.vanniktech.maven.publish" apply false
id "org.jetbrains.dokka" apply false
}

allprojects {
def compileJavaVersion = JavaVersion.VERSION_17
def targetJavaVersion = JavaVersion.VERSION_1_8
def targetJavaVersion = JavaVersion.VERSION_17
pluginManager.withPlugin("java") {
java {
toolchain {
Expand Down
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

androidx-activity-compose = "androidx.activity:activity-compose:_"
androidx-appcompat = "androidx.appcompat:appcompat:_"
androidx-fragment = "androidx.fragment:fragment-ktx:_"
androidx-browser = "androidx.browser:browser:_"
androidx-cardview = "androidx.cardview:cardview:_"
androidx-collection-ktx = "androidx.collection:collection:_"
Expand Down
4 changes: 2 additions & 2 deletions issue-repro-compose/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ plugins {

android {
namespace 'com.airbnb.lottie.issues.compose'
compileSdk 33
compileSdk 34
defaultConfig {
applicationId "com.airbnb.lottie.issues.compose"
minSdk 21
targetSdk 33
targetSdk 34
versionCode 1
versionName "1.0"
}
Expand Down
4 changes: 2 additions & 2 deletions issue-repro/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ plugins {

android {
namespace 'com.airbnb.lottie.issues'
compileSdk 33
compileSdk 34
defaultConfig {
applicationId "com.airbnb.lottie.issues"
minSdk 16
targetSdk 33
targetSdk 34
versionCode 1
versionName "1.0"
}
Expand Down
6 changes: 3 additions & 3 deletions lottie-compose/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ plugins {

android {
namespace 'com.airbnb.lottie.compose'
compileSdk 33
compileSdk 34
defaultConfig {
minSdk 21
targetSdk 33
targetSdk 34
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down Expand Up @@ -50,4 +50,4 @@ dependencies {
testImplementation libs.junit4
androidTestImplementation libs.androidx.test.junit
androidTestImplementation libs.androidx.test.espresso
}
}
4 changes: 2 additions & 2 deletions lottie/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ plugins {
android {
namespace 'com.airbnb.lottie'
resourcePrefix 'lottie_'
compileSdk 33
compileSdk 34
defaultConfig {
minSdk 16
targetSdk 33
targetSdk 34
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
lintOptions {
Expand Down
7 changes: 3 additions & 4 deletions lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import androidx.annotation.RestrictTo;

import com.airbnb.lottie.animation.LPaint;
import com.airbnb.lottie.animation.keyframe.PathKeyframe;
import com.airbnb.lottie.manager.FontAssetManager;
import com.airbnb.lottie.manager.ImageAssetManager;
import com.airbnb.lottie.model.Font;
Expand Down Expand Up @@ -336,7 +335,7 @@ public boolean getClipToCompositionBounds() {
* Be wary if you are using many images, however. Lottie is designed to work with vector shapes
* from After Effects. If your images look like they could be represented with vector shapes,
* see if it is possible to convert them to shape layers and re-export your animation. Check
* the documentation at http://airbnb.io/lottie for more information about importing shapes from
* the documentation at <a href="http://airbnb.io/lottie">airbnb.io/lottie</a> for more information about importing shapes from
* Sketch or Illustrator to avoid this.
*/
public void setImagesAssetsFolder(@Nullable String imageAssetsFolder) {
Expand Down Expand Up @@ -460,7 +459,7 @@ public boolean getAsyncUpdatesEnabled() {
* <p/>
* Sets the current value for {@link AsyncUpdates}. Refer to the docs for {@link AsyncUpdates} for more info.
*/
public void setAsyncUpdates(AsyncUpdates asyncUpdates) {
public void setAsyncUpdates(@Nullable AsyncUpdates asyncUpdates) {
this.asyncUpdates = asyncUpdates;
}

Expand Down Expand Up @@ -1318,7 +1317,7 @@ public List<KeyPath> resolveKeyPath(KeyPath keyPath) {
* <p>
* Internally, this will check if the {@link KeyPath} has already been resolved with
* {@link #resolveKeyPath(KeyPath)} and will resolve it if it hasn't.
*
* <p>
* Set the callback to null to clear it.
*/
public <T> void addValueCallback(
Expand Down
4 changes: 2 additions & 2 deletions sample-compose-benchmark/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ plugins {

android {
namespace 'com.airbnb.lottie.sample.compose.benchmark'
compileSdk 33
compileSdk 34

kotlinOptions {
freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
}

defaultConfig {
minSdk 30
targetSdk 33
targetSdk 34

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
4 changes: 2 additions & 2 deletions sample-compose/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ plugins {

android {
namespace 'com.airbnb.lottie.sample.compose'
compileSdk 33
compileSdk 34
defaultConfig {
applicationId "com.airbnb.lottie.sample.compose"
minSdk 21
targetSdk 33
targetSdk 34
versionCode 1
versionName VERSION_NAME
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,16 @@ import com.airbnb.lottie.sample.compose.R
@Composable
fun ViewPagerExamplePage() {
val colors = listOf(Color.Red, Color.Green, Color.Blue, Color.Magenta)
val pagerState = rememberPagerState()
val pagerState = rememberPagerState { colors.size }
Box(
modifier = Modifier
.fillMaxSize()
.fillMaxSize(),
) {
HorizontalPager(
colors.size,
state = pagerState
) { page ->
HorizontalPager(pagerState) { page ->
Box(
modifier = Modifier
.fillMaxSize()
.background(colors[page])
.background(colors[page]),
)
}
WalkthroughAnimation(pagerState, colors.size)
Expand All @@ -47,6 +44,6 @@ private fun WalkthroughAnimation(pagerState: PagerState, size: Int) {
composition,
{ progress },
modifier = Modifier
.fillMaxSize()
.fillMaxSize(),
)
}
}
7 changes: 4 additions & 3 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ plugins {

android {
namespace 'com.airbnb.lottie.samples'
compileSdk 33
compileSdk 34
defaultConfig {
applicationId "com.airbnb.lottie"
minSdk 16
targetSdk 33
targetSdk 34
versionCode 70
versionName VERSION_NAME
multiDexEnabled true
Expand Down Expand Up @@ -58,6 +58,7 @@ dependencies {
implementation libs.androidx.multidex

implementation libs.androidx.appcompat
implementation libs.androidx.fragment
implementation libs.androidx.recyclerview
implementation libs.androidx.paging.runtime.ktx
implementation libs.androidx.viewmodel.ktx
Expand All @@ -69,7 +70,7 @@ dependencies {

implementation libs.epoxy
ksp libs.epoxy.processor
implementation libs.mvrx
implementation libs.mavericks

implementation libs.kotlinx.coroutines.android
implementation libs.qrcodereaderview
Expand Down
Binary file added sample/src/main/assets/fonts/Comic Neue.ttf
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.airbnb.lottie.samples
import androidx.multidex.MultiDexApplication
import com.airbnb.lottie.L
import com.airbnb.lottie.samples.api.LottiefilesApi
import com.airbnb.mvrx.Mavericks
import com.google.gson.FieldNamingPolicy
import com.google.gson.GsonBuilder
import okhttp3.OkHttpClient
Expand Down Expand Up @@ -37,6 +38,7 @@ class LottieApplication : MultiDexApplication() {

override fun onCreate() {
super.onCreate()
Mavericks.initialize(this)
L.DBG = true
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import android.os.Bundle
import android.view.View
import android.view.ViewGroup
import androidx.core.view.isVisible
import androidx.fragment.app.Fragment
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.viewModelScope
import androidx.paging.Pager
import androidx.paging.PagingConfig
import androidx.paging.PagingDataAdapter
Expand All @@ -20,13 +20,14 @@ import com.airbnb.lottie.samples.databinding.LottiefilesFragmentBinding
import com.airbnb.lottie.samples.model.AnimationData
import com.airbnb.lottie.samples.model.AnimationResponse
import com.airbnb.lottie.samples.model.CompositionArgs
import com.airbnb.lottie.samples.utils.MvRxViewModel
import com.airbnb.lottie.samples.utils.BaseFragment
import com.airbnb.lottie.samples.utils.hideKeyboard
import com.airbnb.lottie.samples.utils.viewBinding
import com.airbnb.lottie.samples.views.AnimationItemView
import com.airbnb.mvrx.BaseMvRxFragment
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MvRxViewModelFactory
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.MavericksView
import com.airbnb.mvrx.MavericksViewModel
import com.airbnb.mvrx.MavericksViewModelFactory
import com.airbnb.mvrx.ViewModelContext
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
Expand All @@ -38,9 +39,9 @@ import kotlinx.coroutines.launch
data class LottiefilesState(
val mode: LottiefilesMode = LottiefilesMode.Recent,
val query: String = ""
) : MvRxState
) : MavericksState

class LottiefilesViewModel(initialState: LottiefilesState, private val api: LottiefilesApi) : MvRxViewModel<LottiefilesState>(initialState) {
class LottiefilesViewModel(initialState: LottiefilesState, private val api: LottiefilesApi) : MavericksViewModel<LottiefilesState>(initialState) {

private var mode = initialState.mode
private var query = initialState.query
Expand All @@ -51,7 +52,7 @@ class LottiefilesViewModel(initialState: LottiefilesState, private val api: Lott
}.flow.cachedIn(viewModelScope)

init {
selectSubscribe(LottiefilesState::mode, LottiefilesState::query) { mode, query ->
onEach(LottiefilesState::mode, LottiefilesState::query) { mode, query ->
this.mode = mode
this.query = query
dataSource?.invalidate()
Expand All @@ -62,7 +63,7 @@ class LottiefilesViewModel(initialState: LottiefilesState, private val api: Lott

fun setQuery(query: String) = setState { copy(query = query) }

companion object : MvRxViewModelFactory<LottiefilesViewModel, LottiefilesState> {
companion object : MavericksViewModelFactory<LottiefilesViewModel, LottiefilesState> {
override fun create(viewModelContext: ViewModelContext, state: LottiefilesState): LottiefilesViewModel {
val service = viewModelContext.app<LottieApplication>().lottiefilesService
return LottiefilesViewModel(state, service)
Expand Down Expand Up @@ -109,7 +110,7 @@ class LottiefilesDataSource(
}
}

class LottiefilesFragment : BaseMvRxFragment(R.layout.lottiefiles_fragment) {
class LottiefilesFragment : BaseFragment(R.layout.lottiefiles_fragment) {
private val binding: LottiefilesFragmentBinding by viewBinding()
private val viewModel: LottiefilesViewModel by fragmentViewModel()

Expand Down
Loading

0 comments on commit 34aa06b

Please sign in to comment.