Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgraded AGP and kotlin version #856

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion app/src/main/java/io/plaidapp/ui/HomeViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ class HomeViewModel(
positions.add(i)
}

val scrollToPosition = positions.max()
val scrollToPosition = positions.maxOrNull()
return if (scrollToPosition == null) {
null
} else {
Expand Down
8 changes: 6 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ buildscript { scriptHandler ->
'gson' : '2.8.5',
'jsoup' : '1.11.3',
'junit' : '4.12',
'kotlin' : '1.3.50',
'kotlin' : '1.5.21',
'ktlint' : '0.36.0',
'legacyCoreUtils' : '1.0.0',
'lifecycle' : '2.2.0-alpha03',
Expand All @@ -60,7 +60,7 @@ buildscript { scriptHandler ->
]

dependencies {
classpath 'com.android.tools.build:gradle:3.6.1'
classpath 'com.android.tools.build:gradle:7.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
classpath "com.google.gms:google-services:${versions.googleServices}"
classpath "io.fabric.tools:gradle:${versions.fabric}"
Expand All @@ -82,6 +82,10 @@ subprojects {
apply from: rootProject.file('repositories.gradle')
}

repositories {
mavenCentral()
}

apply plugin: 'com.diffplug.gradle.spotless'
spotless {
kotlin {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ShotWeigher : PlaidItemSorting.PlaidItemGroupWeigher<Shot> {

override fun weigh(shots: List<Shot>) {
// We add 1 to the max so that weights don't 'overflow' into the next page range
val maxLikes = (shots.maxBy { it.likesCount }?.likesCount?.toFloat() ?: 0f) + 1f
val maxLikes = (shots.maxByOrNull { it.likesCount }?.likesCount?.toFloat() ?: 0f) + 1f
shots.forEach { shot ->
val weight = 1f - (shot.likesCount.toFloat() / maxLikes)
shot.weight = shot.page + weight
Expand Down
1 change: 1 addition & 0 deletions designernews/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ dependencies {
implementation "androidx.room:room-ktx:${versions.room}"
implementation "com.android.support:customtabs:${versions.supportLibrary}"
implementation "com.github.bumptech.glide:glide:${versions.glide}"
implementation "androidx.constraintlayout:constraintlayout:${versions.constraintLayout}"

kapt "com.google.dagger:dagger-compiler:${versions.dagger}"
}
Expand Down
1 change: 1 addition & 0 deletions dribbble/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ dependencies {
implementation "com.android.support:customtabs:${versions.supportLibrary}"
implementation "com.android.support:palette-v7:${versions.supportLibrary}"
implementation "com.github.bumptech.glide:recyclerview-integration:${versions.glide}"
implementation "androidx.constraintlayout:constraintlayout:${versions.constraintLayout}"

kapt "com.google.dagger:dagger-compiler:${versions.dagger}"
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
1 change: 1 addition & 0 deletions repositories.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ repositories {
includeGroup "com.google.android.material"
includeGroup "com.google.gms"
includeGroup "zipflinger"
includeGroup "com.google.testing.platform"
}
}

Expand Down