Skip to content

Commit

Permalink
fix alignment of text
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredsburrows committed Jan 26, 2024
1 parent 41c6012 commit 9e192de
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxSize
Expand All @@ -37,11 +36,12 @@ import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.PlainTooltipBox
import androidx.compose.material3.PlainTooltipState
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.material3.TooltipBox
import androidx.compose.material3.TooltipDefaults
import androidx.compose.material3.TooltipState
import androidx.compose.material3.TopAppBar
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.material3.TopAppBarScrollBehavior
Expand Down Expand Up @@ -183,8 +183,8 @@ private fun TheToolBar(
openSearch: MutableState<Boolean>,
showMenu: MutableState<Boolean>,
) {
val searchTooltipState = remember { PlainTooltipState() }
val moreTooltipState = remember { PlainTooltipState() }
val searchTooltipState = remember { TooltipState() }
val moreTooltipState = remember { TooltipState() }

TopAppBar(
title = {
Expand All @@ -195,13 +195,13 @@ private fun TheToolBar(
// Search for Gifs
actions = {
// Search for Gifs
PlainTooltipBox(
TooltipBox(
positionProvider = TooltipDefaults.rememberPlainTooltipPositionProvider(),
tooltip = { Text("Search gifs") },
tooltipState = searchTooltipState,
state = searchTooltipState,
) {
IconButton(
onClick = { openSearch.value = false },
modifier = Modifier.tooltipAnchor(),
) {
Icon(
imageVector = Icons.Filled.Search,
Expand All @@ -210,13 +210,13 @@ private fun TheToolBar(
}
}
// Overflow menu item
PlainTooltipBox(
TooltipBox(
positionProvider = TooltipDefaults.rememberPlainTooltipPositionProvider(),
tooltip = { Text("Show menu") },
tooltipState = moreTooltipState,
state = moreTooltipState,
) {
IconButton(
onClick = { showMenu.value = !showMenu.value },
modifier = Modifier.tooltipAnchor(),
) {
Icon(
imageVector = Icons.Filled.MoreVert,
Expand Down Expand Up @@ -328,7 +328,7 @@ private fun TheContent(
items = listItems.value,
key = { item -> item.tinyGifUrl },
) { item ->
BoxWithConstraints(
Box(
modifier = Modifier.animateItemPlacement(
animationSpec = tween(durationMillis = 350),
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@file:OptIn(
ExperimentalMaterial3Api::class,
ExperimentalAnimationApi::class,
ExperimentalComposeUiApi::class,
)

package com.burrowsapps.gif.search.ui.giflist
Expand All @@ -14,25 +13,22 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.LocalContentAlpha
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material.icons.filled.Close
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.OutlinedTextFieldDefaults
import androidx.compose.material3.Text
import androidx.compose.material3.TextFieldDefaults
import androidx.compose.material3.TopAppBar
import androidx.compose.material3.TopAppBarScrollBehavior
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.State
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
Expand Down Expand Up @@ -63,7 +59,7 @@ internal fun SearchBar(
navigationIcon = {
IconButton(onClick = { onNavigateBack() }) {
Icon(
imageVector = Icons.Filled.ArrowBack,
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
contentDescription = stringResource(id = R.string.menu_back),
)
}
Expand All @@ -82,11 +78,10 @@ internal fun SearchBar(
placeholder = {
Text(text = placeholderText)
},
colors = TextFieldDefaults.textFieldColors(
focusedIndicatorColor = Color.Transparent,
unfocusedIndicatorColor = Color.Transparent,
containerColor = Color.Transparent,
cursorColor = LocalContentColor.current.copy(alpha = LocalContentAlpha.current),
colors = OutlinedTextFieldDefaults.colors(
focusedBorderColor = Color.Transparent,
unfocusedBorderColor = Color.Transparent,
focusedContainerColor = Color.Transparent,
),
trailingIcon = {
AnimatedVisibility(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
Expand Down Expand Up @@ -109,7 +109,7 @@ private fun TheToolbar(
},
) {
Icon(
imageVector = Icons.Filled.ArrowBack,
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
contentDescription = stringResource(R.string.menu_back),
)
}
Expand Down
3 changes: 3 additions & 0 deletions config/lint/lint.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@

<!-- AGP 7.2.0 - Error: Invalid package reference in org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm; -->
<issue id="InvalidPackage" severity="ignore" />

<!-- https://issuetracker.google.com/issues/322379997 -->
<issue id="ObsoleteLintCustomCheck" severity="ignore" />
</lint>
18 changes: 9 additions & 9 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[versions]
# plugins
# See https://developer.android.com/build/releases/gradle-plugin
android = "8.2.0"
android = "8.2.2"
dagger = "2.50"
# libraries
accompanist = "0.32.0"
accompanist = "0.34.0"
activity = "1.8.2"
# See https://androidx.dev/storage/compose-compiler/repository
compose = "1.5.4"
compose-compiler = "1.5.7"
compose = "1.6.0"
compose-compiler = "1.5.8"
glide = "4.16.0"
kotlinx = "1.7.3"
landscapist = "2.2.13"
leakcanary = "2.13"
lifecycle = "2.6.2"
lifecycle = "2.7.0"
moshi = "1.15.0"
okhttp = "4.12.0"
retrofit = "2.9.0"
Expand Down Expand Up @@ -46,10 +46,10 @@ androidx-activityktx = { module = "androidx.activity:activity-ktx", version.ref
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activity" }
androidx-annotation = { module = "androidx.annotation:annotation", version = "1.7.1" }
androidx-appcompat = { module = "androidx.appcompat:appcompat", version = "1.6.1" }
androidx-compose-bom = { module = "androidx.compose:compose-bom", version = "2023.10.01" }
androidx-compose-bom = { module = "androidx.compose:compose-bom", version = "2024.01.00" }
androidx-compose-compiler = { module = "androidx.compose.compiler:compiler", version.ref = "compose-compiler" }
androidx-compose-material = { module = "androidx.compose.material:material", version = "1.5.4" }
androidx-compose-material3 = { module = "androidx.compose.material3:material3", version = "1.1.2" }
androidx-compose-material = { module = "androidx.compose.material:material", version = "1.6.0" }
androidx-compose-material3 = { module = "androidx.compose.material3:material3", version = "1.2.0-rc01" }
androidx-compose-navigation = { module = "androidx.navigation:navigation-compose", version = "2.7.6" }
androidx-compose-runtime = { module = "androidx.compose.runtime:runtime", version.ref = "compose" }
androidx-compose-ui = { module = "androidx.compose.ui:ui", version.ref = "compose" }
Expand All @@ -67,7 +67,7 @@ androidx-test-junit = { module = "androidx.test.ext:junit", version = "1.1.5" }
androidx-test-orchestrator = { module = "androidx.test:orchestrator", version = "1.4.2" }
androidx-test-rules = { module = "androidx.test:rules", version = "1.5.0" }
androidx-test-runner = { module = "androidx.test:runner", version = "1.5.2" }
androidx-webkit = { module = "androidx.webkit:webkit", version = "1.9.0" }
androidx-webkit = { module = "androidx.webkit:webkit", version = "1.10.0" }
bumptech-glide = { module = "com.github.bumptech.glide:glide", version.ref = "glide" }
bumptech-glide-ksp = { module = "com.github.bumptech.glide:ksp", version.ref = "glide" }
bumptech-glide-okhttp = { module = "com.github.bumptech.glide:okhttp3-integration", version.ref = "glide" }
Expand Down

0 comments on commit 9e192de

Please sign in to comment.