Skip to content

Commit

Permalink
Merge branch 'release/v0.11.0-beta03' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
wax911 committed Nov 23, 2021
2 parents 4bded99 + e155278 commit bac32ba
Show file tree
Hide file tree
Showing 50 changed files with 1,055 additions and 326 deletions.
67 changes: 0 additions & 67 deletions .travis.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import androidx.fragment.app.commit
import co.anitrend.arch.ui.view.image.SupportImageView
import co.anitrend.retrofit.graphql.core.model.FragmentItem
import coil.Coil
import coil.request.LoadRequest
import coil.request.RequestDisposable
import coil.load
import coil.request.Disposable
import coil.transform.Transformation
import coil.transition.CrossfadeTransition
import timber.log.Timber
Expand Down Expand Up @@ -67,16 +67,10 @@ fun SupportImageView.using(
imageUrl: String?,
placeHolder: Drawable? = null,
vararg transformations: Transformation = emptyArray()
): RequestDisposable? {
val requestBuilder = LoadRequest.Builder(context)


@Suppress("EXPERIMENTAL_API_USAGE")
val request = requestBuilder
.placeholder(drawable)
.transition(CrossfadeTransition(350))
.transformations(transformations.asList())
.data(imageUrl).target(this).build()

return Coil.imageLoader(context).execute(request)
): Disposable {
return load(imageUrl) {
placeholder(placeHolder)
transition(CrossfadeTransition(350))
transformations(transformations.toList())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ import co.anitrend.retrofit.graphql.core.extension.using
import co.anitrend.retrofit.graphql.domain.entities.bucket.BucketFile
import co.anitrend.retrofit.graphql.sample.R
import co.anitrend.retrofit.graphql.sample.databinding.BucketFileItemBinding
import coil.request.RequestDisposable
import coil.request.Disposable
import coil.transform.RoundedCornersTransformation
import kotlinx.coroutines.flow.MutableStateFlow

internal class BucketFileItem(
private val entity: BucketFile?
) : RecyclerItem(entity?.id?.toLong()) {

private var disposable: RequestDisposable? = null
private var disposable: Disposable? = null
private var binding: BucketFileItemBinding? = null

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ import co.anitrend.retrofit.graphql.domain.entities.market.MarketPlaceListing
import co.anitrend.retrofit.graphql.sample.R
import co.anitrend.retrofit.graphql.sample.databinding.MarketPlaceItemBinding
import co.anitrend.retrofit.graphql.sample.view.content.market.ui.adapter.MarketPlaceCategoryAdapter
import coil.request.RequestDisposable
import coil.request.Disposable
import kotlinx.coroutines.flow.MutableStateFlow

class MarketPlaceListingItem(
private val entity: MarketPlaceListing?
) : RecyclerItem(entity?.id?.hashCode()?.toLong()) {

private var disposable: RequestDisposable? = null
private var disposable: Disposable? = null
private var binding: MarketPlaceItemBinding? = null

private fun setUpCategories() {
Expand Down
15 changes: 10 additions & 5 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ repositories {
google()
jcenter()
mavenCentral()
gradlePluginPortal()
maven {
url = URI("https://www.jitpack.io")
setUrl("https://plugins.gradle.org/m2/")
}
}

val buildToolsVersion = "4.1.3"
val kotlinVersion = "1.4.31"
val dokkaVersion = "0.10.1"
val manesVersion = "0.33.0"
val buildToolsVersion = "7.0.3"
val kotlinVersion = "1.4.32"
val dokkaVersion = "1.4.32"
val manesVersion = "0.38.0"
val spotlessVersion = "6.0.0"

dependencies {
/* Depend on the android gradle plugin, since we want to access it in our plugin */
Expand All @@ -32,6 +34,9 @@ dependencies {
/** Dependency management */
implementation("com.github.ben-manes:gradle-versions-plugin:$manesVersion")

/** Spotless */
implementation("com.diffplug.spotless:spotless-plugin-gradle:$spotlessVersion")

/* Depend on the default Gradle API's since we want to build a custom plugin */
implementation(gradleApi())
implementation(localGroovy())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ object Libraries {
object Android {

object Tools {
private const val version = "4.1.3"
private const val version = "7.0.3"
const val buildGradle = "com.android.tools.build:gradle:$version"
}
}

object AndroidX {

object Activity {
private const val version = "1.2.0-alpha06"
private const val version = "1.2.0"
const val activity = "androidx.activity:activity:$version"
const val activityKtx = "androidx.activity:activity-ktx:$version"
}

object Annotation {
private const val version = "1.2.0-alpha01"
private const val version = "1.2.0"
const val annotation = "androidx.annotation:annotation:$version"
}

Expand All @@ -40,24 +40,24 @@ object Libraries {
}

object Core {
private const val version = "1.5.0-alpha01"
private const val version = "1.5.0"
const val core = "androidx.core:core:$version"
const val coreKtx = "androidx.core:core-ktx:$version"
}

object ConstraintLayout {
private const val version = "2.0.0-beta7"
private const val version = "2.0.0"
const val constraintLayout = "androidx.constraintlayout:constraintlayout:$version"
const val constraintLayoutSolver = "androidx.constraintlayout:constraintlayout-solver:$version"
}

object Emoji {
private const val version = "1.1.0-rc01"
private const val version = "1.1.0"
const val appCompat = "androidx.emoji:emoji-appcompat:$version"
}

object Fragment {
private const val version = "1.3.0-alpha06"
private const val version = "1.3.0"
const val fragment = "androidx.fragment:fragment:$version"
const val fragmentKtx = "androidx.fragment:fragment-ktx:$version"
const val test = "androidx.fragment:fragment-ktx:fragment-testing$version"
Expand Down Expand Up @@ -86,7 +86,7 @@ object Libraries {
}

object Recycler {
private const val version = "1.2.0-alpha03"
private const val version = "1.2.0"
const val recyclerView = "androidx.recyclerview:recyclerview:$version"
const val recyclerViewSelection = "androidx.recyclerview:recyclerview-selection:$version"
}
Expand All @@ -100,36 +100,36 @@ object Libraries {
}

object StartUp {
private const val version = "1.0.0-alpha02"
private const val version = "1.1.0"
const val startUpRuntime = "androidx.startup:startup-runtime:$version"
}

object SwipeRefresh {
private const val version = "1.1.0-rc01"
private const val version = "1.1.0"
const val swipeRefreshLayout = "androidx.swiperefreshlayout:swiperefreshlayout:$version"
}

object Test {
private const val version = "1.3.0-rc01"
private const val version = "1.3.0"
const val core = "androidx.test:core:$version"
const val coreKtx = "androidx.test:core-ktx:$version"
const val runner = "androidx.test:runner:$version"
const val rules = "androidx.test:rules:$version"

object Espresso {
private const val version = "3.3.0-rc01"
private const val version = "3.3.0"
const val core = "androidx.test.espresso:espresso-core:$version"
}

object Extension {
private const val version = "1.1.2-rc01"
private const val version = "1.1.2"
const val junit = "androidx.test.ext:junit:$version"
const val junitKtx = "androidx.test.ext:junit-ktx:$version"
}
}

object Work {
private const val version = "2.4.0-beta01"
private const val version = "2.4.0"
const val runtimeKtx = "androidx.work:work-runtime-ktx:$version"
const val runtime = "androidx.work:work-runtime:$version"
const val test = "androidx.work:work-test:$version"
Expand Down Expand Up @@ -163,7 +163,7 @@ object Libraries {
}

object Coil {
private const val version = "0.11.0"
private const val version = "1.2.1"
const val coil = "io.coil-kt:coil:$version"
const val base = "io.coil-kt:coil-base:$version"
const val gif = "io.coil-kt:coil-gif:$version"
Expand All @@ -174,15 +174,15 @@ object Libraries {
object Google {

object Material {
private const val version = "1.3.0-alpha01"
private const val version = "1.3.0"
const val material = "com.google.android.material:material:$version"
}
}

object JetBrains {

object Dokka {
private const val version = "1.4.0"
private const val version = "1.4.32"
const val gradlePlugin = "org.jetbrains.dokka:dokka-gradle-plugin:$version"
}

Expand All @@ -203,7 +203,7 @@ object Libraries {

object KotlinX {
object Coroutines {
private const val version = "1.3.8"
private const val version = "1.4.3"
const val core = "org.jetbrains.kotlinx:kotlinx-coroutines-core:$version"
const val android = "org.jetbrains.kotlinx:kotlinx-coroutines-android:$version"
const val test = "org.jetbrains.kotlinx:kotlinx-coroutines-test:$version"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,32 @@ package co.anitrend.retrofit.graphql.buildSrc.common

object Versions {

private fun Int.toVersion(): String {
return if (this < 9) "0$this" else "$this"
}

const val compileSdk = 30
const val targetSdk = 30
const val minSdk = 17

const val versionCode = 110012
const val versionName = "0.11.0-beta02"
private const val major = 0
private const val minor = 11
private const val patch = 0
private const val revision = 2

private const val channel = "beta"

const val versionCode = major * 100_000 + minor * 10_000 + patch * 1_000 + revision * 100
val versionName = if (revision > 0)
"$major.$minor.$patch-$channel${revision.toVersion()}"
else "$major.$minor.$patch"

const val mockk = "1.10.0"
const val junit = "4.13"
const val mockk = "1.12.0"
const val junit = "4.13.2"

const val timber = "4.7.1"
const val threeTenBp = "1.2.4"
const val timber = "5.0.1"
const val threeTenBp = "1.3.1"
const val ktlint = "0.43.0"

const val debugDB = "1.0.6"
const val treesSence = "0.3.2"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package co.anitrend.retrofit.graphql.buildSrc.module

internal object Modules {

interface Module {
val id: String

/**
* @return Formatted id of module as a path string
*/
fun path(): String = ":$id"
}

enum class Components(override val id: String) : Module {
App("app"),
Library("library")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import co.anitrend.retrofit.graphql.buildSrc.plugin.components.configureAndroid
import co.anitrend.retrofit.graphql.buildSrc.plugin.components.configureDependencies
import co.anitrend.retrofit.graphql.buildSrc.plugin.components.configureOptions
import co.anitrend.retrofit.graphql.buildSrc.plugin.components.configurePlugins
import co.anitrend.retrofit.graphql.buildSrc.plugin.components.configureSpotless
import org.gradle.api.Plugin
import org.gradle.api.Project

Expand Down Expand Up @@ -38,5 +39,6 @@ open class CorePlugin : Plugin<Project> {
project.configureAndroid()
project.configureOptions()
project.configureDependencies()
project.configureSpotless()
}
}

0 comments on commit bac32ba

Please sign in to comment.