From 8641b0f2203becfdf0a9de5df693399fe1622422 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sun, 3 May 2020 04:28:26 +0300 Subject: [PATCH] Patch to compile, downgrade Kotlin version, otherwise it fails with useless message, disable incremental kapt otherwise it fails --- app/build.gradle | 2 +- .../tusky/adapter/MutedStatusViewHolder.java | 2 -- .../java/com/keylesspalace/tusky/adapter/PollAdapter.kt | 3 +-- .../components/search/fragments/SearchStatusesFragment.kt | 2 +- .../main/java/com/keylesspalace/tusky/db/Converters.kt | 1 + app/src/main/java/com/keylesspalace/tusky/di/AppModule.kt | 6 ------ .../main/java/com/keylesspalace/tusky/entity/Account.kt | 8 -------- app/src/main/java/com/keylesspalace/tusky/entity/Emoji.kt | 6 ++---- .../tusky/fragment/NotificationsFragment.java | 4 ++-- .../java/com/keylesspalace/tusky/viewdata/PollViewData.kt | 1 - build.gradle | 2 +- gradle.properties | 1 + 12 files changed, 10 insertions(+), 28 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index d539414c..abdbd83b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -22,7 +22,7 @@ def buildnum = { android { compileSdkVersion 29 - ndkVersion "20.1.5948944" + //ndkVersion "20.1.5948944" defaultConfig { applicationId APP_ID minSdkVersion 21 diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/MutedStatusViewHolder.java b/app/src/main/java/com/keylesspalace/tusky/adapter/MutedStatusViewHolder.java index ea42f73d..0c147a05 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/MutedStatusViewHolder.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/MutedStatusViewHolder.java @@ -31,7 +31,6 @@ import com.keylesspalace.tusky.entity.Emoji; import com.keylesspalace.tusky.entity.Status; import com.keylesspalace.tusky.interfaces.StatusActionListener; import com.keylesspalace.tusky.util.CustomEmojiHelper; -import com.keylesspalace.tusky.util.HtmlUtils; import com.keylesspalace.tusky.util.ImageLoadingHelper; import com.keylesspalace.tusky.util.LinkHelper; import com.keylesspalace.tusky.util.StatusDisplayOptions; @@ -42,7 +41,6 @@ import com.keylesspalace.tusky.viewdata.PollOptionViewData; import com.keylesspalace.tusky.viewdata.PollViewData; import com.keylesspalace.tusky.viewdata.PollViewDataKt; import com.keylesspalace.tusky.viewdata.StatusViewData; -import com.mikepenz.iconics.utils.Utils; import java.text.SimpleDateFormat; import java.util.Date; diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/PollAdapter.kt b/app/src/main/java/com/keylesspalace/tusky/adapter/PollAdapter.kt index 0adc0c37..11aaaef4 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/PollAdapter.kt +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/PollAdapter.kt @@ -26,7 +26,6 @@ import androidx.recyclerview.widget.RecyclerView import com.keylesspalace.tusky.R import com.keylesspalace.tusky.entity.Emoji import com.keylesspalace.tusky.util.CustomEmojiHelper -import com.keylesspalace.tusky.util.HtmlUtils import com.keylesspalace.tusky.util.visible import com.keylesspalace.tusky.viewdata.PollOptionViewData import com.keylesspalace.tusky.viewdata.buildDescription @@ -118,4 +117,4 @@ class PollViewHolder(view: View): RecyclerView.ViewHolder(view) { val radioButton: RadioButton = view.findViewById(R.id.status_poll_radio_button) val checkBox: CheckBox = view.findViewById(R.id.status_poll_checkbox) -} \ No newline at end of file +} diff --git a/app/src/main/java/com/keylesspalace/tusky/components/search/fragments/SearchStatusesFragment.kt b/app/src/main/java/com/keylesspalace/tusky/components/search/fragments/SearchStatusesFragment.kt index b8d59bf8..24b13dfa 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/search/fragments/SearchStatusesFragment.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/search/fragments/SearchStatusesFragment.kt @@ -306,7 +306,7 @@ class SearchStatusesFragment : SearchFragment { searchAdapter.getItem(position)?.let { foundStatus -> - viewModel.muteConversation(foundStatus, status.muted != true) + viewModel.muteConversation(foundStatus.first, status.muted != true) } return@setOnMenuItemClickListener true } diff --git a/app/src/main/java/com/keylesspalace/tusky/db/Converters.kt b/app/src/main/java/com/keylesspalace/tusky/db/Converters.kt index b4650e35..b40a65db 100644 --- a/app/src/main/java/com/keylesspalace/tusky/db/Converters.kt +++ b/app/src/main/java/com/keylesspalace/tusky/db/Converters.kt @@ -29,6 +29,7 @@ import com.keylesspalace.tusky.entity.Emoji import com.keylesspalace.tusky.entity.Poll import com.keylesspalace.tusky.entity.Status import com.keylesspalace.tusky.json.SpannedTypeAdapter +import com.keylesspalace.tusky.util.trimTrailingWhitespace import java.net.URLDecoder import java.net.URLEncoder import java.util.* diff --git a/app/src/main/java/com/keylesspalace/tusky/di/AppModule.kt b/app/src/main/java/com/keylesspalace/tusky/di/AppModule.kt index 48845386..901b6137 100644 --- a/app/src/main/java/com/keylesspalace/tusky/di/AppModule.kt +++ b/app/src/main/java/com/keylesspalace/tusky/di/AppModule.kt @@ -81,10 +81,4 @@ class AppModule { AppDatabase.MIGRATION_22_23, AppDatabase.MIGRATION_23_24) .build() } - - @Provides - @Singleton - fun providesHtmlConverter(): HtmlConverter { - return HtmlConverterImpl() - } } diff --git a/app/src/main/java/com/keylesspalace/tusky/entity/Account.kt b/app/src/main/java/com/keylesspalace/tusky/entity/Account.kt index 01d472b2..8f53504f 100644 --- a/app/src/main/java/com/keylesspalace/tusky/entity/Account.kt +++ b/app/src/main/java/com/keylesspalace/tusky/entity/Account.kt @@ -101,11 +101,3 @@ data class PleromaAccount( @SerializedName("is_moderator") val isModerator: Boolean? = null, @SerializedName("is_admin") val isAdmin: Boolean? = null ) - -object SpannedParceler : Parceler { - override fun create(parcel: Parcel): Spanned = HtmlUtils.fromHtml(parcel.readString()) - - override fun Spanned.write(parcel: Parcel, flags: Int) { - parcel.writeString(HtmlUtils.toHtml(this)) - } -} diff --git a/app/src/main/java/com/keylesspalace/tusky/entity/Emoji.kt b/app/src/main/java/com/keylesspalace/tusky/entity/Emoji.kt index f147bbcf..e2b5f28c 100644 --- a/app/src/main/java/com/keylesspalace/tusky/entity/Emoji.kt +++ b/app/src/main/java/com/keylesspalace/tusky/entity/Emoji.kt @@ -19,17 +19,15 @@ import android.os.Parcelable import com.google.gson.annotations.SerializedName import kotlinx.android.parcel.Parcelize -@Parcelize data class Emoji( val shortcode: String, val url: String, @SerializedName("visible_in_picker") val visibleInPicker: Boolean? -) : Parcelable +) -@Parcelize data class EmojiReaction( val name: String, val count: Int, val me: Boolean, val accounts: List? // only for emoji_reactions_by -) : Parcelable +) diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java index 5fd94799..bb77db91 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java @@ -651,7 +651,7 @@ public class NotificationsFragment extends SFragment implements NotificationViewData.Concrete newViewData = new NotificationViewData.Concrete( viewdata.getType(), viewdata.getId(), viewdata.getAccount(), - viewDataBuilder.createStatusViewData(), viewdata.isExpanded(), viewdata.getEmoji()); + viewDataBuilder.createStatusViewData(), viewdata.getEmoji()); notifications.setPairedItem(position, newViewData); } @@ -1362,7 +1362,7 @@ public class NotificationsFragment extends SFragment implements NotificationViewData.Concrete newViewData = new NotificationViewData.Concrete( viewdata.getType(), viewdata.getId(), viewdata.getAccount(), - ViewDataUtils.statusToViewData(newStatus, false, false), viewdata.isExpanded(), viewdata.getEmoji()); + ViewDataUtils.statusToViewData(newStatus, false, false), viewdata.getEmoji()); notifications.setPairedItem(position, newViewData); updateAdapter(); diff --git a/app/src/main/java/com/keylesspalace/tusky/viewdata/PollViewData.kt b/app/src/main/java/com/keylesspalace/tusky/viewdata/PollViewData.kt index b683746f..ecfdbd70 100644 --- a/app/src/main/java/com/keylesspalace/tusky/viewdata/PollViewData.kt +++ b/app/src/main/java/com/keylesspalace/tusky/viewdata/PollViewData.kt @@ -22,7 +22,6 @@ import androidx.core.text.parseAsHtml import com.keylesspalace.tusky.R import com.keylesspalace.tusky.entity.Poll import com.keylesspalace.tusky.entity.PollOption -import com.keylesspalace.tusky.util.HtmlUtils import java.util.* import kotlin.math.roundToInt diff --git a/build.gradle b/build.gradle index 38f3d2b4..a71af6f1 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.3.70' + ext.kotlin_version = '1.3.61' repositories { google() jcenter() diff --git a/gradle.properties b/gradle.properties index 8144ece0..6ad24fed 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,3 +17,4 @@ org.gradle.parallel=true android.enableR8.fullMode=true android.useAndroidX=true +kapt.incremental.apt=false