diff --git a/app/src/main/java/com/keylesspalace/tusky/TabData.kt b/app/src/main/java/com/keylesspalace/tusky/TabData.kt index 09d1f1cf4..6bff4a82b 100644 --- a/app/src/main/java/com/keylesspalace/tusky/TabData.kt +++ b/app/src/main/java/com/keylesspalace/tusky/TabData.kt @@ -52,9 +52,7 @@ data class TabData( other as TabData if (id != other.id) return false - if (arguments != other.arguments) return false - - return true + return arguments == other.arguments } override fun hashCode() = Objects.hash(id, arguments) diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java index de4d23802..ca9d5f32f 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java @@ -114,10 +114,10 @@ public abstract class StatusBaseViewHolder extends RecyclerView.ViewHolder { private final TextView cardDescription; private final TextView cardUrl; private final PollAdapter pollAdapter; - protected LinearLayout filteredPlaceholder; - protected TextView filteredPlaceholderLabel; - protected Button filteredPlaceholderShowButton; - protected ConstraintLayout statusContainer; + protected final LinearLayout filteredPlaceholder; + protected final TextView filteredPlaceholderLabel; + protected final Button filteredPlaceholderShowButton; + protected final ConstraintLayout statusContainer; private final NumberFormat numberFormat = NumberFormat.getNumberInstance(); private final AbsoluteTimeFormatter absoluteTimeFormatter = new AbsoluteTimeFormatter(); @@ -838,9 +838,7 @@ public abstract class StatusBaseViewHolder extends RecyclerView.ViewHolder { } filteredPlaceholderLabel.setText(itemView.getContext().getString(R.string.status_filter_placeholder_label_format, matchedFilter.getTitle())); - filteredPlaceholderShowButton.setOnClickListener(view -> { - listener.clearWarningAction(getBindingAdapterPosition()); - }); + filteredPlaceholderShowButton.setOnClickListener(view -> listener.clearWarningAction(getBindingAdapterPosition())); } protected static boolean hasPreviewableAttachment(List attachments) { diff --git a/app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeViewModel.kt b/app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeViewModel.kt index 90389d28c..0919d29d0 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeViewModel.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeViewModel.kt @@ -39,7 +39,6 @@ import com.keylesspalace.tusky.service.ServiceClient import com.keylesspalace.tusky.service.StatusToSend import com.keylesspalace.tusky.util.randomAlphanumericString import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.channels.BufferOverflow import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.MutableStateFlow @@ -53,7 +52,6 @@ import kotlinx.coroutines.launch import kotlinx.coroutines.withContext import javax.inject.Inject -@OptIn(FlowPreview::class) class ComposeViewModel @Inject constructor( private val api: MastodonApi, private val accountManager: AccountManager, @@ -95,7 +93,7 @@ class ComposeViewModel @Inject constructor( val media: MutableStateFlow> = MutableStateFlow(emptyList()) val uploadError = MutableSharedFlow(replay = 0, extraBufferCapacity = 1, onBufferOverflow = BufferOverflow.DROP_OLDEST) - lateinit var composeKind: ComposeKind + private lateinit var composeKind: ComposeKind // Used in ComposeActivity to pass state to result function when cropImage contract inflight var cropImageItemOld: QueuedMedia? = null diff --git a/app/src/main/java/com/keylesspalace/tusky/components/compose/dialog/AddPollOptionsAdapter.kt b/app/src/main/java/com/keylesspalace/tusky/components/compose/dialog/AddPollOptionsAdapter.kt index ded1b7cfd..4d7ecdca8 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/compose/dialog/AddPollOptionsAdapter.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/compose/dialog/AddPollOptionsAdapter.kt @@ -75,10 +75,6 @@ class AddPollOptionsAdapter( } private fun validateInput(): Boolean { - if (options.contains("") || options.distinct().size != options.size) { - return false - } - - return true + return !(options.contains("") || options.distinct().size != options.size) } } diff --git a/app/src/main/java/com/keylesspalace/tusky/components/login/LoginWebViewActivity.kt b/app/src/main/java/com/keylesspalace/tusky/components/login/LoginWebViewActivity.kt index be7e323ad..ed5744165 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/login/LoginWebViewActivity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/login/LoginWebViewActivity.kt @@ -99,7 +99,7 @@ sealed class LoginResult : Parcelable { data class Err(val errorMessage: String) : LoginResult() @Parcelize - object Cancel : LoginResult() + data object Cancel : LoginResult() } /** Activity to do Oauth process using WebView. */ diff --git a/app/src/main/java/com/keylesspalace/tusky/components/notifications/NotificationHelper.java b/app/src/main/java/com/keylesspalace/tusky/components/notifications/NotificationHelper.java index 6a42e8977..481098934 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/notifications/NotificationHelper.java +++ b/app/src/main/java/com/keylesspalace/tusky/components/notifications/NotificationHelper.java @@ -285,7 +285,7 @@ public class NotificationHelper { int accountId = (int) account.getId(); // Initialise the map with all channel IDs. - for (Notification.Type ty : Notification.Type.values()) { + for (Notification.Type ty : Notification.Type.getEntries()) { channelGroups.put(getChannelId(account, ty), new ArrayList<>()); } diff --git a/app/src/main/java/com/keylesspalace/tusky/components/notifications/NotificationsFragment.kt b/app/src/main/java/com/keylesspalace/tusky/components/notifications/NotificationsFragment.kt index 78f7a1565..3c0f0da4d 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/notifications/NotificationsFragment.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/notifications/NotificationsFragment.kt @@ -293,7 +293,7 @@ class NotificationsFragment : val position = adapter.snapshot().indexOfFirst { it?.statusViewData?.status?.id == (action as StatusAction).statusViewData.id } - if (position != RecyclerView.NO_POSITION) { + if (position != NO_POSITION) { adapter.notifyItemChanged(position) } } diff --git a/app/src/main/java/com/keylesspalace/tusky/components/notifications/NotificationsPagingAdapter.kt b/app/src/main/java/com/keylesspalace/tusky/components/notifications/NotificationsPagingAdapter.kt index faa1aefce..8f45a56f2 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/notifications/NotificationsPagingAdapter.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/notifications/NotificationsPagingAdapter.kt @@ -124,7 +124,7 @@ class NotificationsPagingAdapter( override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { val inflater = LayoutInflater.from(parent.context) - return when (NotificationViewKind.values()[viewType]) { + return when (NotificationViewKind.entries[viewType]) { NotificationViewKind.STATUS -> { StatusViewHolder( ItemStatusBinding.inflate(inflater, parent, false), diff --git a/app/src/main/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModel.kt b/app/src/main/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModel.kt index d1d41a947..1f3f982b9 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModel.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModel.kt @@ -46,7 +46,6 @@ import com.keylesspalace.tusky.util.toViewData import com.keylesspalace.tusky.viewdata.NotificationViewData import com.keylesspalace.tusky.viewdata.StatusViewData import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableSharedFlow @@ -70,7 +69,6 @@ import kotlinx.coroutines.rx3.await import retrofit2.HttpException import javax.inject.Inject import kotlin.time.Duration.Companion.milliseconds -import kotlin.time.ExperimentalTime data class UiState( /** Filtered notification types */ @@ -103,7 +101,7 @@ sealed class UiAction /** Actions the user can trigger from the UI. These actions may fail. */ sealed class FallibleUiAction : UiAction() { /** Clear all notifications */ - object ClearNotifications : FallibleUiAction() + data object ClearNotifications : FallibleUiAction() } /** @@ -129,7 +127,7 @@ sealed class InfallibleUiAction : UiAction() { // Resets the account's `lastNotificationId`, which can't fail, which is why this is // infallible. Reloading the data may fail, but that's handled by the paging system / // adapter refresh logic. - object LoadNewest : InfallibleUiAction() + data object LoadNewest : InfallibleUiAction() } /** Actions the user can trigger on an individual notification. These may fail. */ @@ -146,13 +144,13 @@ sealed class UiSuccess { // of these three should trigger the UI to refresh. /** A user was blocked */ - object Block : UiSuccess() + data object Block : UiSuccess() /** A user was muted */ - object Mute : UiSuccess() + data object Mute : UiSuccess() /** A conversation was muted */ - object MuteConversation : UiSuccess() + data object MuteConversation : UiSuccess() } /** The result of a successful action on a notification */ @@ -286,7 +284,7 @@ sealed class UiError( } } -@OptIn(ExperimentalCoroutinesApi::class, FlowPreview::class, ExperimentalTime::class) +@OptIn(ExperimentalCoroutinesApi::class) class NotificationsViewModel @Inject constructor( private val repository: NotificationsRepository, private val preferences: SharedPreferences, diff --git a/app/src/main/java/com/keylesspalace/tusky/components/viewthread/ViewThreadViewModel.kt b/app/src/main/java/com/keylesspalace/tusky/components/viewthread/ViewThreadViewModel.kt index f4b94400b..da8a91e4d 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/viewthread/ViewThreadViewModel.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/viewthread/ViewThreadViewModel.kt @@ -516,7 +516,7 @@ class ViewThreadViewModel @Inject constructor( sealed interface ThreadUiState { /** The initial load of the detailed status for this thread */ - object Loading : ThreadUiState + data object Loading : ThreadUiState /** Loading the detailed status has completed, now loading ancestors/descendants */ data class LoadingThread( @@ -535,7 +535,7 @@ sealed interface ThreadUiState { ) : ThreadUiState /** Refreshing the thread with a swipe */ - object Refreshing : ThreadUiState + data object Refreshing : ThreadUiState } enum class RevealButtonState { diff --git a/app/src/main/java/com/keylesspalace/tusky/components/viewthread/edits/ViewEditsAdapter.kt b/app/src/main/java/com/keylesspalace/tusky/components/viewthread/edits/ViewEditsAdapter.kt index 33085f82b..56bf1ffc4 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/viewthread/edits/ViewEditsAdapter.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/viewthread/edits/ViewEditsAdapter.kt @@ -51,10 +51,10 @@ class ViewEditsAdapter( private val absoluteTimeFormatter = AbsoluteTimeFormatter() /** Size of large text in this theme, in px */ - var largeTextSizePx: Float = 0f + private var largeTextSizePx: Float = 0f /** Size of medium text in this theme, in px */ - var mediumTextSizePx: Float = 0f + private var mediumTextSizePx: Float = 0f override fun onCreateViewHolder( parent: ViewGroup, diff --git a/app/src/main/java/com/keylesspalace/tusky/components/viewthread/edits/ViewEditsViewModel.kt b/app/src/main/java/com/keylesspalace/tusky/components/viewthread/edits/ViewEditsViewModel.kt index 93f663587..85786efa2 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/viewthread/edits/ViewEditsViewModel.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/viewthread/edits/ViewEditsViewModel.kt @@ -132,12 +132,12 @@ class ViewEditsViewModel @Inject constructor(private val api: MastodonApi) : Vie } sealed interface EditsUiState { - object Initial : EditsUiState - object Loading : EditsUiState + data object Initial : EditsUiState + data object Loading : EditsUiState // "Refreshing" state is necessary, otherwise a refresh state transition is Success -> Success, // and state flows don't emit repeated states, so the UI never updates. - object Refreshing : EditsUiState + data object Refreshing : EditsUiState class Error(val throwable: Throwable) : EditsUiState data class Success( val edits: List diff --git a/app/src/main/java/com/keylesspalace/tusky/db/AccountEntity.kt b/app/src/main/java/com/keylesspalace/tusky/db/AccountEntity.kt index 853003e75..84c8874f5 100644 --- a/app/src/main/java/com/keylesspalace/tusky/db/AccountEntity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/db/AccountEntity.kt @@ -129,9 +129,7 @@ data class AccountEntity( other as AccountEntity if (id == other.id) return true - if (domain == other.domain && accountId == other.accountId) return true - - return false + return domain == other.domain && accountId == other.accountId } override fun hashCode(): Int { diff --git a/app/src/main/java/com/keylesspalace/tusky/util/FlowExtensions.kt b/app/src/main/java/com/keylesspalace/tusky/util/FlowExtensions.kt index 7fcf77359..8de7129ce 100644 --- a/app/src/main/java/com/keylesspalace/tusky/util/FlowExtensions.kt +++ b/app/src/main/java/com/keylesspalace/tusky/util/FlowExtensions.kt @@ -20,7 +20,6 @@ package com.keylesspalace.tusky.util import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.flow import kotlin.time.Duration -import kotlin.time.ExperimentalTime import kotlin.time.TimeMark import kotlin.time.TimeSource @@ -54,7 +53,6 @@ import kotlin.time.TimeSource * @param timeout Emissions within this duration of the last emission are filtered * @param timeSource Used to measure elapsed time. Normally only overridden in tests */ -@OptIn(ExperimentalTime::class) fun Flow.throttleFirst( timeout: Duration, timeSource: TimeSource = TimeSource.Monotonic diff --git a/app/src/main/java/com/keylesspalace/tusky/util/NoUnderlineURLSpan.kt b/app/src/main/java/com/keylesspalace/tusky/util/NoUnderlineURLSpan.kt index 12be84d8a..59d8bbabe 100644 --- a/app/src/main/java/com/keylesspalace/tusky/util/NoUnderlineURLSpan.kt +++ b/app/src/main/java/com/keylesspalace/tusky/util/NoUnderlineURLSpan.kt @@ -19,7 +19,7 @@ import android.text.TextPaint import android.text.style.URLSpan import android.view.View -open class NoUnderlineURLSpan constructor(val url: String) : URLSpan(url) { +open class NoUnderlineURLSpan(val url: String) : URLSpan(url) { // This should not be necessary. But if you don't do this the [StatusLengthTest] tests // fail. Without this, accessing the `url` property, or calling `getUrl()` (which should diff --git a/app/src/main/java/com/keylesspalace/tusky/util/SpanUtils.kt b/app/src/main/java/com/keylesspalace/tusky/util/SpanUtils.kt index f89f5fea5..4b1235148 100644 --- a/app/src/main/java/com/keylesspalace/tusky/util/SpanUtils.kt +++ b/app/src/main/java/com/keylesspalace/tusky/util/SpanUtils.kt @@ -128,7 +128,7 @@ private fun findPattern(string: String, fromIndex: Int): FindCharsResult { val result = FindCharsResult() for (i in fromIndex..string.lastIndex) { val c = string[i] - for (matchType in FoundMatchType.values()) { + for (matchType in FoundMatchType.entries) { val finder = finders[matchType] if (finder!!.searchCharacter == c && ( diff --git a/app/src/main/java/com/keylesspalace/tusky/viewmodel/EditProfileViewModel.kt b/app/src/main/java/com/keylesspalace/tusky/viewmodel/EditProfileViewModel.kt index fe5110381..21a8a01d7 100644 --- a/app/src/main/java/com/keylesspalace/tusky/viewmodel/EditProfileViewModel.kt +++ b/app/src/main/java/com/keylesspalace/tusky/viewmodel/EditProfileViewModel.kt @@ -35,7 +35,6 @@ import com.keylesspalace.tusky.util.Resource import com.keylesspalace.tusky.util.Success import com.keylesspalace.tusky.util.getServerErrorMessage import com.keylesspalace.tusky.util.randomAlphanumericString -import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.asFlow @@ -64,7 +63,6 @@ class EditProfileViewModel @Inject constructor( val headerData = MutableLiveData() val saveData = MutableLiveData>() - @OptIn(FlowPreview::class) val instanceData: Flow = instanceInfoRepo::getInstanceInfo.asFlow() .shareIn(viewModelScope, SharingStarted.Eagerly, replay = 1) diff --git a/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsPagingSourceTest.kt b/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsPagingSourceTest.kt index 450f702a7..b91e07161 100644 --- a/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsPagingSourceTest.kt +++ b/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsPagingSourceTest.kt @@ -22,7 +22,6 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import com.google.gson.Gson import com.keylesspalace.tusky.entity.Notification import com.keylesspalace.tusky.network.MastodonApi -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import okhttp3.ResponseBody.Companion.toResponseBody import org.junit.Assert.assertEquals @@ -38,7 +37,6 @@ import retrofit2.Response @Config(sdk = [28]) @RunWith(AndroidJUnit4::class) -@OptIn(ExperimentalCoroutinesApi::class) class NotificationsPagingSourceTest { @Test fun `load() returns error message on HTTP error`() = runTest { diff --git a/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestBase.kt b/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestBase.kt index 773c67662..666d591cd 100644 --- a/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestBase.kt +++ b/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestBase.kt @@ -48,7 +48,7 @@ import retrofit2.HttpException import retrofit2.Response @OptIn(ExperimentalCoroutinesApi::class) -class MainCoroutineRule constructor(private val dispatcher: TestDispatcher = UnconfinedTestDispatcher()) : TestWatcher() { +class MainCoroutineRule(private val dispatcher: TestDispatcher = UnconfinedTestDispatcher()) : TestWatcher() { override fun starting(description: Description) { super.starting(description) Dispatchers.setMain(dispatcher) @@ -62,7 +62,6 @@ class MainCoroutineRule constructor(private val dispatcher: TestDispatcher = Unc @Config(sdk = [28]) @RunWith(AndroidJUnit4::class) -@OptIn(ExperimentalCoroutinesApi::class) abstract class NotificationsViewModelTestBase { protected lateinit var notificationsRepository: NotificationsRepository protected lateinit var sharedPreferencesMap: MutableMap @@ -73,7 +72,7 @@ abstract class NotificationsViewModelTestBase { protected lateinit var viewModel: NotificationsViewModel /** Empty success response, for API calls that return one */ - protected var emptySuccess = Response.success("".toResponseBody()) + protected var emptySuccess: Response = Response.success("".toResponseBody()) /** Empty error response, for API calls that return one */ protected var emptyError: Response = Response.error(404, "".toResponseBody()) diff --git a/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestClearNotifications.kt b/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestClearNotifications.kt index 03d850617..e6b765be4 100644 --- a/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestClearNotifications.kt +++ b/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestClearNotifications.kt @@ -19,7 +19,6 @@ package com.keylesspalace.tusky.components.notifications import app.cash.turbine.test import com.google.common.truth.Truth.assertThat -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.Test import org.mockito.kotlin.doReturn @@ -34,7 +33,6 @@ import org.mockito.kotlin.verify * This is only tested in the success case; if it passed there it must also * have passed in the error case. */ -@OptIn(ExperimentalCoroutinesApi::class) class NotificationsViewModelTestClearNotifications : NotificationsViewModelTestBase() { @Test fun `clearing notifications succeeds && invalidate the repository`() = runTest { diff --git a/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestFilter.kt b/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestFilter.kt index a2be13e2a..98737e431 100644 --- a/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestFilter.kt +++ b/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestFilter.kt @@ -21,7 +21,6 @@ import app.cash.turbine.test import com.google.common.truth.Truth.assertThat import com.keylesspalace.tusky.db.AccountEntity import com.keylesspalace.tusky.entity.Notification -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.Test import org.mockito.kotlin.argumentCaptor @@ -33,7 +32,6 @@ import org.mockito.kotlin.verify * - Is the [UiState] updated correctly? * - Are the correct [AccountManager] functions called, with the correct arguments? */ -@OptIn(ExperimentalCoroutinesApi::class) class NotificationsViewModelTestFilter : NotificationsViewModelTestBase() { @Test diff --git a/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestNotificationAction.kt b/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestNotificationAction.kt index b6177c556..3c48dd2b1 100644 --- a/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestNotificationAction.kt +++ b/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestNotificationAction.kt @@ -21,7 +21,6 @@ import app.cash.turbine.test import com.google.common.truth.Truth.assertThat import com.keylesspalace.tusky.entity.Relationship import io.reactivex.rxjava3.core.Single -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.Test import org.mockito.kotlin.any @@ -39,7 +38,6 @@ import org.mockito.kotlin.verify * This is only tested in the success case; if it passed there it must also * have passed in the error case. */ -@OptIn(ExperimentalCoroutinesApi::class) class NotificationsViewModelTestNotificationAction : NotificationsViewModelTestBase() { /** Dummy relationship */ private val relationship = Relationship( diff --git a/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestStatusAction.kt b/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestStatusAction.kt index 3a102c12a..cf7ce2dc1 100644 --- a/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestStatusAction.kt +++ b/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestStatusAction.kt @@ -22,7 +22,6 @@ import at.connyduck.calladapter.networkresult.NetworkResult import com.google.common.truth.Truth.assertThat import com.keylesspalace.tusky.FilterV1Test.Companion.mockStatus import com.keylesspalace.tusky.viewdata.StatusViewData -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.Test import org.mockito.kotlin.any @@ -40,7 +39,6 @@ import org.mockito.kotlin.verify * This is only tested in the success case; if it passed there it must also * have passed in the error case. */ -@OptIn(ExperimentalCoroutinesApi::class) class NotificationsViewModelTestStatusAction : NotificationsViewModelTestBase() { private val status = mockStatus(pollOptions = listOf("Choice 1", "Choice 2", "Choice 3")) private val statusViewData = StatusViewData.Concrete( diff --git a/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestStatusDisplayOptions.kt b/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestStatusDisplayOptions.kt index 29e3c7a18..f3dd3c478 100644 --- a/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestStatusDisplayOptions.kt +++ b/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestStatusDisplayOptions.kt @@ -23,7 +23,6 @@ import com.keylesspalace.tusky.appstore.PreferenceChangedEvent import com.keylesspalace.tusky.settings.PrefKeys import com.keylesspalace.tusky.util.CardViewMode import com.keylesspalace.tusky.util.StatusDisplayOptions -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.Test @@ -34,7 +33,6 @@ import org.junit.Test * - Does the make() function correctly use an updated preference? * - Is the correct update emitted when a relevant preference changes? */ -@OptIn(ExperimentalCoroutinesApi::class) class NotificationsViewModelTestStatusDisplayOptions : NotificationsViewModelTestBase() { private val defaultStatusDisplayOptions = StatusDisplayOptions( diff --git a/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestUiState.kt b/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestUiState.kt index a77e503ca..e295dda05 100644 --- a/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestUiState.kt +++ b/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestUiState.kt @@ -22,7 +22,6 @@ import com.google.common.truth.Truth.assertThat import com.keylesspalace.tusky.appstore.PreferenceChangedEvent import com.keylesspalace.tusky.entity.Notification import com.keylesspalace.tusky.settings.PrefKeys -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.Test @@ -32,7 +31,6 @@ import org.junit.Test * - Is the initial value taken from values in sharedPreferences and account? * - Is the correct update emitted when a relevant preference changes? */ -@OptIn(ExperimentalCoroutinesApi::class) class NotificationsViewModelTestUiState : NotificationsViewModelTestBase() { private val initialUiState = UiState( diff --git a/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestVisibleId.kt b/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestVisibleId.kt index 03a9a8708..f6b7360e6 100644 --- a/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestVisibleId.kt +++ b/app/src/test/java/com/keylesspalace/tusky/components/notifications/NotificationsViewModelTestVisibleId.kt @@ -19,13 +19,11 @@ package com.keylesspalace.tusky.components.notifications import com.google.common.truth.Truth.assertThat import com.keylesspalace.tusky.db.AccountEntity -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.Test import org.mockito.kotlin.argumentCaptor import org.mockito.kotlin.verify -@OptIn(ExperimentalCoroutinesApi::class) class NotificationsViewModelTestVisibleId : NotificationsViewModelTestBase() { @Test diff --git a/gradle.properties b/gradle.properties index dc6a0c69a..84fe860c9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,9 +5,6 @@ org.gradle.jvmargs=-XX:+UseParallelGC -Xmx4g -Dfile.encoding=UTF-8 -XX:MaxMetasp org.gradle.parallel=true org.gradle.configuration-cache=true -# https://blog.jetbrains.com/kotlin/2022/07/a-new-approach-to-incremental-compilation-in-kotlin/ -kotlin.incremental.useClasspathSnapshot=true - # Disable buildFeatures flags by default android.defaults.buildfeatures.resvalues=false android.defaults.buildfeatures.shaders=false diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1ef4a5ceb..27c4b7fa1 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -33,7 +33,7 @@ glide = "4.15.1" # Deliberate downgrade, https://github.com/tuskyapp/Tusky/issues/3631 glide-animation-plugin = "2.23.0" gson = "2.10.1" -kotlin = "1.8.22" +kotlin = "1.9.0" image-cropper = "4.3.2" material = "1.9.0" material-drawer = "8.4.5" @@ -56,7 +56,7 @@ xmlwriter = "1.0.4" [plugins] android-application = { id = "com.android.application", version.ref = "agp" } -google-ksp = "com.google.devtools.ksp:1.8.22-1.0.11" +google-ksp = "com.google.devtools.ksp:1.9.0-1.0.12" kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" } kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" } @@ -113,7 +113,6 @@ glide-compiler = { module = "com.github.bumptech.glide:ksp", version.ref = "glid glide-core = { module = "com.github.bumptech.glide:glide", version.ref = "glide" } glide-okhttp3-integration = { module = "com.github.bumptech.glide:okhttp3-integration", version.ref = "glide" } gson = { module = "com.google.code.gson:gson", version.ref = "gson" } -kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" } kotlinx-coroutines-rx3 = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-rx3", version.ref = "coroutines" } kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" } diff --git a/renovate.json b/renovate.json index f9c2c3270..79fe8ab4e 100644 --- a/renovate.json +++ b/renovate.json @@ -2,5 +2,17 @@ "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ "config:base" + ], + "packageRules": [ + { + "groupName": "Kotlin", + "groupSlug": "kotlin", + "matchPackagePrefixes": [ + "com.google.devtools.ksp" + ], + "matchPackagePatterns": [ + "org.jetbrains.kotlin.*" + ] + } ] }