Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use chris banes compose-bom. #1530

Merged
merged 1 commit into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 20 additions & 15 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,18 @@ composeCompiler {
}

dependencies {
implementation("androidx.appcompat:appcompat:1.6.1")
// Unfortunately, ui tooling, and the markdown thing, still brings in the other material2 dependencies
// This is the "official" composeBom, but it breaks the imageviewer until 1.7 is released. See:
// https://github.com/LemmyNet/jerboa/pull/1502#issuecomment-2137935525
// val composeBom = platform("androidx.compose:compose-bom:2024.05.00")

val composeBom = platform("dev.chrisbanes.compose:compose-bom:2024.05.00-alpha03")
implementation(composeBom)
implementation("androidx.activity:activity-compose")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming only the androidx. namespace things can use this composeBom.

I tried to do it with all of them at first, but some still required explicit versioning.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding was that only the libraries listed where were covered
https://developer.android.com/develop/ui/compose/bom/bom-mapping

But that is not case. So I am not sure, you can probably look at the dependencies of the BOM to find out. Which libs are covered.

implementation("androidx.appcompat:appcompat:1.7.0")
androidTestImplementation(composeBom)
testImplementation("androidx.arch.core:core-testing:2.2.0")

implementation("me.zhanghai.compose.preference:library:1.0.0")

// Markdown support
Expand All @@ -129,8 +140,8 @@ dependencies {

// LiveData
implementation("androidx.compose.runtime:runtime-livedata")
implementation("androidx.lifecycle:lifecycle-runtime-compose:2.8.0")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.8.0")
implementation("androidx.lifecycle:lifecycle-runtime-compose")
implementation("androidx.lifecycle:lifecycle-livedata-ktx")

// Images
implementation("io.coil-kt:coil-compose:2.6.0")
Expand Down Expand Up @@ -161,13 +172,9 @@ dependencies {

implementation("io.arrow-kt:arrow-core:1.2.4")

// Unfortunately, ui tooling, and the markdown thing, still brings in the other material2 dependencies
val composeBom = platform("androidx.compose:compose-bom:2024.05.00")
implementation(composeBom)
androidTestImplementation(composeBom)

implementation("androidx.compose.material3:material3:1.2.1")
implementation("androidx.compose.material3:material3-window-size-class:1.2.1")
implementation("androidx.compose.material3:material3")
implementation("androidx.compose.material3:material3-window-size-class")

implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-tooling-preview")
Expand All @@ -177,21 +184,19 @@ dependencies {
implementation("androidx.compose.material:material-icons-extended")

implementation("org.ocpsoft.prettytime:prettytime:5.0.8.Final")
implementation("androidx.navigation:navigation-compose:2.7.7")
implementation("androidx.navigation:navigation-compose")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.8.1")
testImplementation("androidx.arch.core:core-testing:2.2.0")

implementation("androidx.activity:activity-compose:1.9.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation("androidx.test.ext:junit")
androidTestImplementation("androidx.test.espresso:espresso-core")

testImplementation("org.mockito:mockito-core:5.12.0")
testImplementation("org.mockito.kotlin:mockito-kotlin:5.3.1")

implementation("androidx.browser:browser:1.8.0")

implementation("androidx.profileinstaller:profileinstaller:1.3.1")
implementation("androidx.profileinstaller:profileinstaller")
baselineProfile(project(":benchmarks"))

implementation("it.vercruysse.lemmyapi:lemmy-api:0.2.15-SNAPSHOT")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@ fun Modifier.onAutofill(

@OptIn(ExperimentalFoundationApi::class)
fun Modifier.customMarquee(): Modifier {
return this.basicMarquee(delayMillis = 4_000)
return this.basicMarquee(initialDelayMillis = 4_000)
}
7 changes: 4 additions & 3 deletions app/src/main/java/com/jerboa/ui/components/login/Login.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.LocalTextStyle
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.MenuAnchorType
import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.OutlinedTextFieldDefaults
import androidx.compose.material3.Text
Expand Down Expand Up @@ -76,7 +77,7 @@ fun MyTextField(
KeyboardOptions.Default.copy(
capitalization = KeyboardCapitalization.None,
keyboardType = KeyboardType.Text,
autoCorrect = false,
autoCorrectEnabled = false,
),
modifier =
modifier
Expand Down Expand Up @@ -153,7 +154,7 @@ fun InstancePicker(
OutlinedTextField(
modifier =
Modifier
.menuAnchor()
.menuAnchor(MenuAnchorType.PrimaryEditable, true)
.width(OutlinedTextFieldDefaults.MinWidth),
label = { Text(stringResource(R.string.login_instance)) },
placeholder = { Text(stringResource(R.string.login_instance_placeholder)) },
Expand All @@ -166,7 +167,7 @@ fun InstancePicker(
trailingIcon = {
TrailingIcon(expanded = expand)
},
keyboardOptions = KeyboardOptions(autoCorrect = false, keyboardType = KeyboardType.Uri),
keyboardOptions = KeyboardOptions(autoCorrectEnabled = false, keyboardType = KeyboardType.Uri),
)

DropdownMenu(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fun SettingsTextField(
KeyboardOptions.Default.copy(
capitalization = KeyboardCapitalization.None,
keyboardType = KeyboardType.Text,
autoCorrect = false,
autoCorrectEnabled = false,
),
)
}
Expand Down