Skip to content

Commit

Permalink
- Update Dependencies & Refine UI
Browse files Browse the repository at this point in the history
This commit updates several dependencies, including:
- KSP to 2.0.21-1.0
.25
- Haze to 0.9.0-beta03
- Kamel Image to 1.0.0

It also refines the UI by:
- Making SearchBar background transparent when blur is enabled in AllFragment, FavoriteFragment, and GlobalSearchFragment.
- Replacing
 the custom PullToRefresh indicator with a ContainedLoadingIndicator.
  • Loading branch information
jacobrein committed Oct 11, 2024
1 parent e9015de commit 1a6a0c0
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.res.stringResource
Expand Down Expand Up @@ -183,6 +184,13 @@ fun AllView(
),
label = ""
).value,
inputFieldColors = if (showBlur)
SearchBarDefaults.inputFieldColors(
focusedContainerColor = Color.Transparent,
unfocusedContainerColor = Color.Transparent,
)
else
SearchBarDefaults.inputFieldColors()
),
modifier = Modifier
.fillMaxWidth()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,13 @@ fun FavoriteUi(
),
label = ""
).value,
inputFieldColors = if (showBlur)
SearchBarDefaults.inputFieldColors(
focusedContainerColor = Color.Transparent,
unfocusedContainerColor = Color.Transparent,
)
else
SearchBarDefaults.inputFieldColors()
),
modifier = Modifier.fillMaxWidth(),
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,13 @@ fun GlobalSearchView(
),
label = ""
).value,
inputFieldColors = if (showBlur)
SearchBarDefaults.inputFieldColors(
focusedContainerColor = Color.Transparent,
unfocusedContainerColor = Color.Transparent,
)
else
SearchBarDefaults.inputFieldColors()
),
modifier = Modifier
.fillMaxWidth()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ fun DynamicSearchBar(
leadingIcon = leadingIcon,
trailingIcon = trailingIcon,
interactionSource = interactionSource,
colors = colors.inputFieldColors
)
},
expanded = active,
Expand All @@ -76,6 +77,7 @@ fun DynamicSearchBar(
leadingIcon = leadingIcon,
trailingIcon = trailingIcon,
interactionSource = interactionSource,
colors = colors.inputFieldColors
)
},
expanded = active,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxScope
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.ContainedLoadingIndicator
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
import androidx.compose.material3.pulltorefresh.PullToRefreshDefaults
import androidx.compose.material3.pulltorefresh.PullToRefreshState
import androidx.compose.material3.pulltorefresh.pullToRefresh
Expand Down Expand Up @@ -75,7 +77,7 @@ fun OtakuPullToRefreshBox(
}

object OtakuPullToRefreshDefaults {
@OptIn(ExperimentalMaterial3Api::class)
@OptIn(ExperimentalMaterial3Api::class, ExperimentalMaterial3ExpressiveApi::class)
@Composable
fun ScalingIndicator(
isRefreshing: Boolean,
Expand All @@ -84,13 +86,23 @@ object OtakuPullToRefreshDefaults {
) {
val scaleFraction =
{ if (isRefreshing) 1f else LinearOutSlowInEasing.transform(state.distanceFraction).coerceIn(0f, 1f) }
PullToRefreshDefaults.Indicator(
/*PullToRefreshDefaults.Indicator(
modifier = modifier.graphicsLayer {
scaleX = scaleFraction()
scaleY = scaleFraction()
},
isRefreshing = isRefreshing,
state = state
)
)*/
PullToRefreshDefaults.IndicatorBox(
modifier = modifier.graphicsLayer {
scaleX = scaleFraction()
scaleY = scaleFraction()
},
isRefreshing = isRefreshing,
state = state
) {
ContainedLoadingIndicator()
}
}
}
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ generativeai = "0.9.0"
gradle = "8.7.0"

kotlin = "2.0.21"
kspVersion = "2.0.20-1.0.25"
kspVersion = "2.0.21-1.0.25"

androidxBaselineprofileGradlePlugin = "1.3.0"
composeCollapsable = "0.3.0"
dragselect = "2.3.2"
easylauncher = "6.4.0"
firebaseCrashlyticsGradle = "3.0.2"
googleServices = "4.4.2"
haze = "0.9.0-beta02"
kamelImage = "1.0.0-beta.7"
haze = "0.9.0-beta03"
kamelImage = "1.0.0"
latestAboutLibsRelease = "11.2.3"
coroutinesVersion = "1.9.0"
glideVersion = "4.16.0"
Expand Down

0 comments on commit 1a6a0c0

Please sign in to comment.