From d4f80f308dc8e43642d8996f3c3a095193419563 Mon Sep 17 00:00:00 2001 From: Konrad Pozniak Date: Tue, 3 Sep 2019 18:35:42 +0200 Subject: [PATCH] upgrade Android gradle plugin, Kotlin and jetifier (#1468) --- .../tusky/entity/DeletedStatus.kt | 2 +- .../com/keylesspalace/tusky/entity/History.kt | 14 -------- .../keylesspalace/tusky/util/MultiListing.kt | 35 ------------------- .../tusky/util/NotificationTypeConverter.kt | 2 +- build.gradle | 6 ++-- 5 files changed, 5 insertions(+), 54 deletions(-) delete mode 100644 app/src/main/java/com/keylesspalace/tusky/entity/History.kt delete mode 100644 app/src/main/java/com/keylesspalace/tusky/util/MultiListing.kt diff --git a/app/src/main/java/com/keylesspalace/tusky/entity/DeletedStatus.kt b/app/src/main/java/com/keylesspalace/tusky/entity/DeletedStatus.kt index a3c775bc0..289a93fb7 100644 --- a/app/src/main/java/com/keylesspalace/tusky/entity/DeletedStatus.kt +++ b/app/src/main/java/com/keylesspalace/tusky/entity/DeletedStatus.kt @@ -29,6 +29,6 @@ data class DeletedStatus( @SerializedName("created_at") val createdAt: Date ) { fun isEmpty(): Boolean { - return text == null && attachments == null; + return text == null && attachments == null } } \ No newline at end of file diff --git a/app/src/main/java/com/keylesspalace/tusky/entity/History.kt b/app/src/main/java/com/keylesspalace/tusky/entity/History.kt deleted file mode 100644 index b92975ba9..000000000 --- a/app/src/main/java/com/keylesspalace/tusky/entity/History.kt +++ /dev/null @@ -1,14 +0,0 @@ -package com.keylesspalace.tusky.entity - -import com.google.gson.annotations.SerializedName - -data class History( - @field:SerializedName("day") - val day: String, - - @field:SerializedName("uses") - val uses: Int, - - @field:SerializedName("accounts") - val accounts: Int -) \ No newline at end of file diff --git a/app/src/main/java/com/keylesspalace/tusky/util/MultiListing.kt b/app/src/main/java/com/keylesspalace/tusky/util/MultiListing.kt deleted file mode 100644 index 550c1a934..000000000 --- a/app/src/main/java/com/keylesspalace/tusky/util/MultiListing.kt +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.keylesspalace.tusky.util - -import androidx.lifecycle.LiveData -import androidx.paging.PagedList - -/** - * Data class that is necessary for a UI to show a listing and interact w/ the rest of the system - */ -data class MultiListing( - val pagedLists: List>>, - // represents the network request status to show to the user - val networkState: LiveData, - // represents the refresh status to show to the user. Separate from networkState, this - // value is importantly only when refresh is requested. - val refreshState: LiveData, - // refreshes the whole data and fetches it from scratch. - val refresh: () -> Unit, - // retries any failed requests. - val retry: () -> Unit) \ No newline at end of file diff --git a/app/src/main/java/com/keylesspalace/tusky/util/NotificationTypeConverter.kt b/app/src/main/java/com/keylesspalace/tusky/util/NotificationTypeConverter.kt index 19efb116e..65c8f6c08 100644 --- a/app/src/main/java/com/keylesspalace/tusky/util/NotificationTypeConverter.kt +++ b/app/src/main/java/com/keylesspalace/tusky/util/NotificationTypeConverter.kt @@ -34,7 +34,7 @@ fun deserialize(data: String?): Set { val ret = HashSet() data?.let { val array = JSONArray(data) - for (i in 0..(array.length() - 1)) { + for (i in 0 until array.length()) { val item = array.getString(i) val type = Notification.Type.byString(item) if (type != Notification.Type.UNKNOWN) diff --git a/build.gradle b/build.gradle index b3360fa01..98df4e943 100644 --- a/build.gradle +++ b/build.gradle @@ -1,14 +1,14 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.3.41' + ext.kotlin_version = '1.3.50' repositories { jcenter() google() } dependencies { - classpath 'com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta05' - classpath 'com.android.tools.build:gradle:3.4.2' + classpath 'com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta06' + classpath 'com.android.tools.build:gradle:3.5.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } }