Skip to content

Commit

Permalink
Update deps, notable update to kotlin 1.9 (LemmyNet#1173)
Browse files Browse the repository at this point in the history
Co-authored-by: Kevin Phoenix <[email protected]>
  • Loading branch information
MV-GH and twizmwazin authored Aug 11, 2023
1 parent dd21db4 commit 9912366
Show file tree
Hide file tree
Showing 16 changed files with 36 additions and 36 deletions.
16 changes: 8 additions & 8 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ android {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.4.7"
kotlinCompilerExtensionVersion = "1.5.1"
}
}

Expand All @@ -121,7 +121,7 @@ dependencies {
implementation("com.google.accompanist:accompanist-systemuicontroller:$accompanistVersion")

// LiveData
implementation("androidx.compose.runtime:runtime-livedata:1.4.3")
implementation("androidx.compose.runtime:runtime-livedata:1.5.0")
implementation("androidx.lifecycle:lifecycle-runtime-compose:2.6.1")

// Images
Expand Down Expand Up @@ -151,19 +151,19 @@ dependencies {
// optional - Paging 3 Integration
implementation("androidx.room:room-paging:2.5.2")

implementation("io.arrow-kt:arrow-core:1.1.5")
implementation("io.arrow-kt:arrow-core:1.2.0")
// Unfortunately, ui tooling, and the markdown thing, still brings in the other material2 dependencies
implementation("androidx.compose.material3:material3:1.1.1")
implementation("androidx.compose.material3:material3-window-size-class:1.1.1")

implementation("org.ocpsoft.prettytime:prettytime:5.0.6.Final")
implementation("androidx.navigation:navigation-compose:2.7.0-rc01")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.1")
implementation("androidx.navigation:navigation-compose:2.7.0")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3")
testImplementation("androidx.arch.core:core-testing:2.2.0")
implementation("com.squareup.retrofit2:retrofit:2.9.0")
implementation("com.squareup.retrofit2:converter-gson:2.9.0")

val composeVersion = "1.5.0-rc01"
val composeVersion = "1.5.0"
implementation("androidx.compose.ui:ui:$composeVersion")
implementation("androidx.compose.ui:ui-tooling-preview:$composeVersion")
androidTestImplementation("androidx.compose.ui:ui-test-junit4:$composeVersion")
Expand All @@ -177,9 +177,9 @@ dependencies {
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")

testImplementation("org.mockito:mockito-core:5.4.0")
testImplementation("org.mockito.kotlin:mockito-kotlin:5.0.0")
testImplementation("org.mockito.kotlin:mockito-kotlin:5.1.0")

implementation("androidx.browser:browser:1.5.0")
implementation("androidx.browser:browser:1.6.0")

implementation("androidx.profileinstaller:profileinstaller:1.3.1")
baselineProfile(project(":benchmarks"))
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/jerboa/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class MainActivity : AppCompatActivity() {
}

DisposableEffect(appSettings.backConfirmationMode) {
when (BackConfirmationMode.values()[appSettings.backConfirmationMode]) {
when (BackConfirmationMode.entries[appSettings.backConfirmationMode]) {
BackConfirmationMode.Toast -> {
this@MainActivity.addConfirmationToast(appState.navController, ctx)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ enum class AccountVerificationState {
;

companion object {
val size = values().size
val size = entries.size
}
}

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/jerboa/model/HomeViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ class HomeViewModel : ViewModel(), Initializable {
}

fun updateFromAccount(account: Account) {
updateSortType(SortType.values().getOrElse(account.defaultSortType) { sortType })
updateSortType(SortType.entries.getOrElse(account.defaultSortType) { sortType })
updateListingType(
ListingType.values().getOrElse(account.defaultListingType) { listingType },
ListingType.entries.getOrElse(account.defaultListingType) { listingType },
)
}

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/jerboa/model/SiteViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class SiteViewModel : ViewModel() {
}

fun updateFromAccount(account: Account) {
updateSortType(SortType.values().getOrElse(account.defaultSortType) { sortType })
updateListingType(ListingType.values().getOrElse(account.defaultListingType) { listingType })
updateSortType(SortType.entries.getOrElse(account.defaultSortType) { sortType })
updateListingType(ListingType.entries.getOrElse(account.defaultListingType) { listingType })
}

fun getSite(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ fun BottomAppBarAll(
}

NavigationBar {
for (tab in NavTab.values()) {
for (tab in NavTab.entries) {
val selected = tab == selectedTab
NavigationBarItem(
icon = {
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/jerboa/ui/components/common/Dialogs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ val DONATION_MARKDOWN = """
""".trimIndent()

val topSortTypes = SortType.values().filter { it.name.startsWith("Top") }
val topSortTypes = SortType.entries.filter { it.name.startsWith("Top") }

@Composable
fun SortTopOptionsDialog(
Expand Down Expand Up @@ -214,7 +214,7 @@ fun PostViewModeDialog(
onDismissRequest = onDismissRequest,
text = {
Column {
PostViewMode.values().map {
PostViewMode.entries.map {
IconAndTextDrawerItem(
text = stringResource(it.mode),
onClick = { onClickPostViewMode(it) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ fun CommunityActivity(
communityViewModel.resetPage()

if (account.isAnon()) {
communityViewModel.updateSortType(SortType.values().getOrElse(account.defaultSortType) { siteViewModel.sortType })
communityViewModel.updateSortType(SortType.entries.getOrElse(account.defaultSortType) { siteViewModel.sortType })
}

communityViewModel.getCommunity(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ fun DrawerItemsMain(
}

if (!showBottomNav) {
items(NavTab.values()) {
items(NavTab.entries) {
IconAndTextDrawerItem(
text = stringResource(it.textId),
icon = it.iconOutlined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ fun InboxTabs(
val transferPrivateMessageDepsViaRoot = appState.rootChannel<PrivateMessageDeps>()
val transferCommentReplyDepsViaRoot = appState.rootChannel<CommentReplyDeps>()

val tabTitles = InboxTab.values().map { getLocalizedStringForInboxTab(ctx, it) }
val tabTitles = InboxTab.entries.map { getLocalizedStringForInboxTab(ctx, it) }
val pagerState = rememberPagerState { tabTitles.size }

Column(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ fun UserTabs(
getLocalizedStringForUserTab(ctx, UserTab.Comments),
)
} else {
UserTab.values().map { getLocalizedStringForUserTab(ctx, it) }
UserTab.entries.map { getLocalizedStringForUserTab(ctx, it) }
}
val pagerState = rememberPagerState { tabTitles.size }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,12 @@ fun SettingsForm(
matrix_user_id = matrixUserId,
interface_language = interfaceLang,
bot_account = botAccount.value,
default_sort_type = SortType.values()[defaultSortType.value],
default_sort_type = SortType.entries[defaultSortType.value],
send_notifications_to_email = sendNotificationsToEmail.value,
show_avatars = showAvatars.value,
show_bot_accounts = showBotAccount.value,
show_nsfw = showNsfw.value,
default_listing_type = ListingType.values()[defaultListingType.value],
default_listing_type = ListingType.entries[defaultListingType.value],
show_new_post_notifs = showNewPostNotifs.value,
show_read_posts = showReadPosts.value,
theme = theme,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ fun LookAndFeelActivity(
)
SettingsList(
state = themeState,
items = ThemeMode.values().map { stringResource(it.mode) },
items = ThemeMode.entries.map { stringResource(it.mode) },
icon = {
Icon(
imageVector = Icons.Outlined.Palette,
Expand All @@ -195,7 +195,7 @@ fun LookAndFeelActivity(
)
SettingsList(
state = themeColorState,
items = ThemeColor.values().map { stringResource(it.mode) },
items = ThemeColor.entries.map { stringResource(it.mode) },
icon = {
Icon(
imageVector = Icons.Outlined.Colorize,
Expand All @@ -212,7 +212,7 @@ fun LookAndFeelActivity(
)
SettingsList(
state = postViewModeState,
items = PostViewMode.values().map { stringResource(it.mode) },
items = PostViewMode.entries.map { stringResource(it.mode) },
icon = {
Icon(
imageVector = Icons.Outlined.ViewList,
Expand All @@ -232,7 +232,7 @@ fun LookAndFeelActivity(
Text(text = stringResource(R.string.confirm_exit))
},
state = backConfirmationMode,
items = BackConfirmationMode.values().map { stringResource(it.resId) },
items = BackConfirmationMode.entries.map { stringResource(it.resId) },
onItemSelected = { i, _ ->
backConfirmationMode.value = i
updateAppSettings()
Expand All @@ -249,7 +249,7 @@ fun LookAndFeelActivity(
Text(text = stringResource(R.string.post_actionbar))
},
state = postActionbarMode,
items = PostActionbarMode.values().map { stringResource(it.resId) },
items = PostActionbarMode.entries.map { stringResource(it.resId) },
onItemSelected = { i, _ ->
postActionbarMode.value = i
updateAppSettings()
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/jerboa/ui/theme/Theme.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ fun JerboaTheme(
appSettings: AppSettings,
content: @Composable () -> Unit,
) {
val themeMode = ThemeMode.values()[appSettings.theme]
val themeColor = ThemeColor.values()[appSettings.themeColor]
val themeMode = ThemeMode.entries[appSettings.theme]
val themeColor = ThemeColor.entries[appSettings.themeColor]
val fontSize = appSettings.fontSize.sp

val ctx = LocalContext.current
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ baselineProfile {
dependencies {
implementation("androidx.test.ext:junit:1.1.5")
implementation("androidx.test.espresso:espresso-core:3.5.1")
implementation("androidx.test.uiautomator:uiautomator:2.3.0-alpha03")
implementation("androidx.benchmark:benchmark-macro-junit4:1.2.0-beta01")
implementation("androidx.test.uiautomator:uiautomator:2.3.0-alpha04")
implementation("androidx.benchmark:benchmark-macro-junit4:1.2.0-beta03")
}
8 changes: 4 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("com.android.application") version "8.1.0" apply false
id("com.android.library") version "8.1.0" apply false
id("org.jetbrains.kotlin.android") version "1.8.20" apply false
id("org.jetbrains.kotlin.android") version "1.9.0" apply false
id("com.github.ben-manes.versions") version "0.42.0"
id("org.jmailen.kotlinter") version "3.15.0" apply false
id("com.google.devtools.ksp") version "1.8.21-1.0.11" apply false
id( "com.android.test") version "8.1.0" apply false
id( "androidx.baselineprofile") version "1.2.0-alpha13" apply false
id("com.google.devtools.ksp") version "1.9.0-1.0.13" apply false
id("com.android.test") version "8.1.0" apply false
id("androidx.baselineprofile") version "1.2.0-alpha13" apply false
}

subprojects {
Expand Down

0 comments on commit 9912366

Please sign in to comment.