Skip to content

Commit

Permalink
Downgrade material3 - Keyboard doesn't let the user change language o…
Browse files Browse the repository at this point in the history
…n search page
  • Loading branch information
vipulyaara committed Jun 28, 2024
1 parent 02025f7 commit 8900fb9
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.selection.selectable
import androidx.compose.material.ripple.rememberRipple
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.ripple
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.getValue
Expand Down Expand Up @@ -54,7 +54,7 @@ internal fun HomeNavigationRailItemRow(
enabled = enabled,
role = Role.Tab,
interactionSource = interactionSource,
indication = ripple(bounded = true, color = activeColor)
indication = rememberRipple(bounded = true, color = activeColor)
)
.padding(horizontal = Dimens.Spacing40, vertical = Dimens.Spacing20)
) {
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dagger = "2.51.1"
icons = "1.0.0"
kotlin = "2.0.0"
kotlin-immutable = "0.3.7"
material3 = "1.3.0-beta03"
material3 = "1.2.1"
media3 = "1.3.1"
mixpanel = "7.0.0"
okhttp = "4.12.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxScope
import androidx.compose.foundation.layout.size
import androidx.compose.material.ripple.rememberRipple
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.ripple
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
Expand Down Expand Up @@ -69,7 +69,7 @@ fun IconButton(
role = Role.Button,
onClickLabel = onClickLabel,
interactionSource = interactionSource,
indication = ripple(
indication = rememberRipple(
bounded = false,
color = rippleColor,
radius = rippleRadius
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.pager.HorizontalPager
import androidx.compose.foundation.pager.rememberPagerState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.carousel.HorizontalMultiBrowseCarousel
import androidx.compose.material3.carousel.rememberCarouselState
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.kafka.data.entities.Item
import kotlinx.collections.immutable.ImmutableList
import org.kafka.ui.components.item.FeaturedItem
Expand All @@ -23,24 +22,20 @@ internal fun Carousels(
modifier: Modifier = Modifier,
lazyListState: LazyListState = rememberLazyListState()
) {
val state = rememberCarouselState { carouselItems.size }
val state = rememberPagerState { carouselItems.size }

HorizontalMultiBrowseCarousel(
HorizontalPager(
state = state,
preferredItemWidth = 350.dp,
minSmallItemWidth = 56.dp,
maxSmallItemWidth = 72.dp,
modifier = modifier.padding(Dimens.Spacing02),
contentPadding = PaddingValues(horizontal = Dimens.Spacing12),
itemSpacing = Dimens.Spacing08
) { index ->
carouselItems.getOrNull(index)?.let { item ->
FeaturedItem(
item = item,
label = item.title,
imageUrl = images.getOrNull(index),
onClick = { onBannerClick(item.itemId) },
modifier = Modifier.maskClip(shape = RoundedCornerShape(Dimens.Radius20))
shape = RoundedCornerShape(Dimens.Radius20)
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion ui/item/src/main/java/org/kafka/item/detail/ItemDetail.kt
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ private fun ItemDetail(

if (state.isLoading) {
item(span = { GridItemSpan(GridItemSpan) }) {
Delayed(modifier = Modifier.animateItem()) {
Delayed(modifier = Modifier.animateItemPlacement()) {
InfiniteProgressBar()
}
}
Expand Down
2 changes: 1 addition & 1 deletion ui/search/src/main/java/com.kafka.search/RecentSearches.kt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fun RecentSearches(
recentSearch = recentSearch,
onSearchClicked = onSearchClicked,
onRemoveSearch = onRemoveSearch,
modifier = Modifier.animateItem()
modifier = Modifier.animateItemPlacement()
)
}
}
Expand Down

0 comments on commit 8900fb9

Please sign in to comment.