Skip to content

Commit

Permalink
Upgrade deps and Gradle
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
  • Loading branch information
SUPERCILEX committed Feb 8, 2019
1 parent 952e0f9 commit 71cafc1
Show file tree
Hide file tree
Showing 15 changed files with 37 additions and 33 deletions.
29 changes: 15 additions & 14 deletions buildSrc/src/main/kotlin/Config.kt
Expand Up @@ -7,7 +7,7 @@ import org.gradle.plugin.use.PluginDependenciesSpec

@Suppress("MayBeConstant") // Improve perf when changing values
object Config {
private const val kotlinVersion = "1.3.30-dev-482"
private const val kotlinVersion = "1.3.30-dev-1477"

fun RepositoryHandler.deps() {
fun MavenArtifactRepository.ensureGroups(
Expand Down Expand Up @@ -51,9 +51,9 @@ object Config {

val google = "com.google.gms:google-services:4.2.0"
val firebase = "com.google.firebase:perf-plugin:1.1.5"
val fabric = "io.fabric.tools:gradle:1.27.0"
val fabric = "io.fabric.tools:gradle:1.27.1"

val ktlint = "com.github.shyiko:ktlint:0.29.0"
val ktlint = "com.github.shyiko:ktlint:0.30.0"

val PluginDependenciesSpec.publishing get() = id("com.github.triplet.play") version "2.1.0"
val PluginDependenciesSpec.versionChecker
Expand Down Expand Up @@ -85,23 +85,24 @@ object Config {
}

object Jetpack {
private const val lifecycleVersion = "2.1.0-alpha01"
private const val workVersion = "1.0.0-beta03"
private const val lifecycleVersion = "2.1.0-alpha02"
private const val workVersion = "1.0.0-beta05"

val core = "androidx.core:core-ktx:1.1.0-alpha03"
val core = "androidx.core:core-ktx:1.1.0-alpha04"
val multidex = "androidx.multidex:multidex:2.0.1"
val appCompat = "androidx.appcompat:appcompat:1.1.0-alpha01"
val fragment = "androidx.fragment:fragment-ktx:1.1.0-alpha03"
val appCompat = "androidx.appcompat:appcompat:1.1.0-alpha02"
val fragment = "androidx.fragment:fragment-ktx:1.1.0-alpha04"
val rv = "androidx.recyclerview:recyclerview:1.1.0-alpha02"
val rvSelection = "androidx.recyclerview:recyclerview-selection:1.1.0-alpha01"
val constraint = "androidx.constraintlayout:constraintlayout:1.1.3"
val cardView = "androidx.cardview:cardview:1.0.0"
val palette = "androidx.palette:palette-ktx:1.0.0"
val emoji = "androidx.emoji:emoji-appcompat:1.0.0"
val browser = "androidx.browser:browser:1.0.0"
val pref = "androidx.preference:preference:1.1.0-alpha02"
val prefKtx = "androidx.preference:preference-ktx:1.1.0-alpha02"
val pref = "androidx.preference:preference:1.1.0-alpha03"
val prefKtx = "androidx.preference:preference-ktx:1.1.0-alpha03"

val material = "com.google.android.material:material:1.1.0-alpha02"
val material = "com.google.android.material:material:1.1.0-alpha03"

val common = "androidx.lifecycle:lifecycle-common-java8:$lifecycleVersion"
val extensions = "androidx.lifecycle:lifecycle-extensions:$lifecycleVersion"
Expand All @@ -112,15 +113,15 @@ object Config {
}

object Firebase {
val core = "com.google.firebase:firebase-core:16.0.6"
val core = "com.google.firebase:firebase-core:16.0.7"
val auth = "com.google.firebase:firebase-auth:16.1.0"
val firestore = "com.google.firebase:firebase-firestore:17.1.5"
val functions = "com.google.firebase:firebase-functions:16.1.3"
val storage = "com.google.firebase:firebase-storage:16.0.5"
val config = "com.google.firebase:firebase-config:16.1.3"
val config = "com.google.firebase:firebase-config:16.3.0"
val indexing = "com.google.firebase:firebase-appindexing:17.1.0"
val messaging = "com.google.firebase:firebase-messaging:17.3.4"
val invites = "com.google.firebase:firebase-invites:16.0.6"
val invites = "com.google.firebase:firebase-invites:16.1.0"
val perf = "com.google.firebase:firebase-perf:16.2.3"

val crashlytics = "com.crashlytics.sdk.android:crashlytics:2.9.8"
Expand Down
Expand Up @@ -31,7 +31,7 @@ import org.jetbrains.anko.findOptional
import com.supercilex.robotscouter.R as RC

internal class ScoutFragment : MetricListFragment(), View.OnLayoutChangeListener {
private val team by unsafeLazy { checkNotNull(arguments).getTeam() }
private val team by unsafeLazy { requireArguments().getTeam() }
private val scoutId by unsafeLazy { checkNotNull(getTabId(arguments)) }
override val metricsRef by unsafeLazy { team.getScoutMetricsRef(scoutId) }
override val dataId get() = scoutId
Expand Down
Expand Up @@ -74,14 +74,14 @@ internal abstract class ScoutListFragmentBase : FragmentBase(), RecyclerPoolHold
}
protected val bundle: Bundle
get() = getScoutBundle(
team, checkNotNull(arguments).getBoolean(KEY_ADD_SCOUT), scoutId = scoutId)
team, requireArguments().getBoolean(KEY_ADD_SCOUT), scoutId = scoutId)

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setHasOptionsMenu(true)
savedState = savedInstanceState

val state = savedInstanceState ?: checkNotNull(arguments)
val state = savedInstanceState ?: requireArguments()
dataHolder.init(state)
team = state.getTeam()
dataHolder.teamListener.observe(this, this)
Expand Down Expand Up @@ -213,7 +213,7 @@ internal abstract class ScoutListFragmentBase : FragmentBase(), RecyclerPoolHold
viewPager.adapter = pagerAdapter
tabs.setupWithViewPager(viewPager)

checkNotNull(arguments).let {
requireArguments().let {
if (it.getBoolean(KEY_ADD_SCOUT, false)) {
it.remove(KEY_ADD_SCOUT)
addScout(it.getString(KEY_OVERRIDE_TEMPLATE_KEY, null))
Expand Down
Expand Up @@ -21,7 +21,7 @@ internal class TabletScoutListContainer : FragmentBase() {
if (savedInstanceState == null) {
childFragmentManager.commitNow {
add(R.id.scoutList,
TabletScoutListFragment.newInstance(checkNotNull(arguments)),
TabletScoutListFragment.newInstance(requireArguments()),
TabletScoutListFragment.TAG)
}
}
Expand Down
Expand Up @@ -13,7 +13,7 @@ internal class TeamTemplateSelectorDialog : TemplateSelectorDialog() {
override fun onItemSelected(id: String) {
super.onItemSelected(id)
(context as TeamSelectionListener)
.onTeamSelected(getScoutBundle(checkNotNull(arguments).getTeam(), true, id))
.onTeamSelected(getScoutBundle(requireArguments().getTeam(), true, id))
}

companion object {
Expand Down
Expand Up @@ -20,7 +20,7 @@ internal class DeleteTemplateDialog : ManualDismissDialog() {
.createAndSetup(savedInstanceState)

override fun onAttemptDismiss(): Boolean {
trashTemplate(checkNotNull(arguments).getRef().id)
trashTemplate(requireArguments().getRef().id)
return true
}

Expand Down
Expand Up @@ -9,9 +9,9 @@ import com.supercilex.robotscouter.core.data.emptyTrash
import com.supercilex.robotscouter.core.ui.DialogFragmentBase
import com.supercilex.robotscouter.core.unsafeLazy

internal class EmtpyTrashDialog : DialogFragmentBase(), DialogInterface.OnClickListener {
private val ids by unsafeLazy { checkNotNull(arguments?.getStringArray(IDS_KEY)).toList() }
private val emptyAll by unsafeLazy { checkNotNull(arguments).getBoolean(EMPTY_ALL_KEY) }
internal class EmptyTrashDialog : DialogFragmentBase(), DialogInterface.OnClickListener {
private val ids by unsafeLazy { requireArguments().getStringArray(IDS_KEY).orEmpty().toList() }
private val emptyAll by unsafeLazy { requireArguments().getBoolean(EMPTY_ALL_KEY) }

override fun onCreateDialog(savedInstanceState: Bundle?) = AlertDialog.Builder(requireContext())
.setTitle(R.string.trash_empty_dialog_title)
Expand All @@ -27,13 +27,13 @@ internal class EmtpyTrashDialog : DialogFragmentBase(), DialogInterface.OnClickL
}

companion object {
private const val TAG = "EmtpyTrashDialog"
private const val TAG = "EmptyTrashDialog"
private const val IDS_KEY = "ids"
private const val EMPTY_ALL_KEY = "empty_all"

fun show(manager: FragmentManager, ids: List<String>, emptyAll: Boolean) {
require(ids.isNotEmpty())
EmtpyTrashDialog().apply {
EmptyTrashDialog().apply {
arguments = bundleOf(IDS_KEY to ids.toTypedArray(), EMPTY_ALL_KEY to emptyAll)
}.show(manager, TAG)
}
Expand Down
Expand Up @@ -169,7 +169,7 @@ internal class TrashFragment : FragmentBase(), View.OnClickListener,
}

private fun showEmptyTrashDialog(ids: List<String>, emptyAll: Boolean = false) {
EmtpyTrashDialog.show(childFragmentManager, ids, emptyAll)
EmptyTrashDialog.show(childFragmentManager, ids, emptyAll)
}

companion object {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
1 change: 1 addition & 0 deletions library/core-ui/build.gradle.kts
Expand Up @@ -25,6 +25,7 @@ dependencies {
api(Config.Libs.FirebaseUi.firestore)
api(Config.Libs.Anko.design)
api(Config.Libs.Anko.appCompat)
api(Config.Libs.Jetpack.rv)
api(Config.Libs.Jetpack.rvSelection)

implementation(Config.Libs.Jetpack.browser)
Expand Down
Expand Up @@ -29,7 +29,7 @@ internal class CounterValueDialog : ValueDialogBase<Long>() {
valueLayout.error = getString(R.string.number_too_big_error)
return false
}
val ref = checkNotNull(arguments).getRef()
val ref = requireArguments().getRef()
ref.update(FIRESTORE_VALUE, number).logFailures(ref, number)
return true
}
Expand Down
Expand Up @@ -16,7 +16,7 @@ import com.supercilex.robotscouter.core.unsafeLazy

internal class TabNameDialog : ValueDialogBase<String>() {
override val value get() = lastEditText.text.nullOrFull()?.toString()
override val title by unsafeLazy { checkNotNull(arguments).getInt(TITLE_KEY) }
override val title by unsafeLazy { requireArguments().getInt(TITLE_KEY) }
override val hint = R.string.scout_name_title

override fun onShow(dialog: DialogInterface, savedInstanceState: Bundle?) {
Expand All @@ -25,7 +25,7 @@ internal class TabNameDialog : ValueDialogBase<String>() {
}

override fun onAttemptDismiss(): Boolean {
val ref = checkNotNull(arguments).getRef()
val ref = requireArguments().getRef()
ref.update(FIRESTORE_NAME, value).logFailures(ref, value)
return true
}
Expand Down
Expand Up @@ -71,6 +71,8 @@ abstract class TabPagerAdapterBase(
}

override fun onDataChanged() {
if (fragment.view == null) return // Potential race condition

currentScouts = holder.scouts.toList()
if (currentScouts.isNotEmpty() && currentScouts.size == oldScouts.size) {
if (currentScouts == oldScouts) {
Expand Down
Expand Up @@ -26,7 +26,7 @@ internal abstract class ValueDialogBase<out T> : KeyboardDialogBase() {
super.onShow(dialog, savedInstanceState)
valueLayout.hint = getString(hint)
lastEditText.apply {
setText(checkNotNull(arguments).getString(CURRENT_VALUE))
setText(requireArguments().getString(CURRENT_VALUE))
if (savedInstanceState == null) post { selectAll() }
}
}
Expand Down
Expand Up @@ -62,7 +62,7 @@ class TeamDetailsDialog : BottomSheetDialogFragmentBase(), CaptureTeamMediaListe

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
team = savedInstanceState?.getTeam() ?: checkNotNull(arguments).getTeam()
team = savedInstanceState?.getTeam() ?: requireArguments().getTeam()
permHandler.apply {
init(TeamMediaCreator.perms)
onGranted.observe(this@TeamDetailsDialog) {
Expand Down

0 comments on commit 71cafc1

Please sign in to comment.