Bump Material to 1.0.1 version and fix "Always Expand" preview (#374)
* Bump Material 3 to 1.0.1 * Fix(FeedsPagePreview): when disable "Always Expand", hide feeds under group name * Promote(FeedsPagePreview): promote code style
This commit is contained in:
parent
a32dfc20ba
commit
a404a9d882
@ -15,12 +15,12 @@ if (keyPropsFile.exists()) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdk 32
|
compileSdk 33
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "me.ash.reader"
|
applicationId "me.ash.reader"
|
||||||
minSdk 26
|
minSdk 26
|
||||||
targetSdk 32
|
targetSdk 33
|
||||||
versionCode 18
|
versionCode 18
|
||||||
versionName "0.9.7"
|
versionName "0.9.7"
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
freeCompilerArgs = freeCompilerArgs + "-Xopt-in=kotlin.RequiresOptIn"
|
freeCompilerArgs = freeCompilerArgs + "-opt-in=kotlin.RequiresOptIn"
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
|
@ -13,6 +13,7 @@ import androidx.compose.ui.graphics.vector.ImageVector
|
|||||||
import androidx.compose.ui.platform.LocalView
|
import androidx.compose.ui.platform.LocalView
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
|
|
||||||
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun FeedbackIconButton(
|
fun FeedbackIconButton(
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
|
@ -20,6 +20,7 @@ import androidx.compose.ui.text.input.VisualTransformation
|
|||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
import me.ash.reader.R
|
import me.ash.reader.R
|
||||||
|
|
||||||
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun RYOutlineTextField(
|
fun RYOutlineTextField(
|
||||||
readOnly: Boolean = false,
|
readOnly: Boolean = false,
|
||||||
|
@ -20,6 +20,7 @@ import androidx.compose.ui.text.input.VisualTransformation
|
|||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
import me.ash.reader.R
|
import me.ash.reader.R
|
||||||
|
|
||||||
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun RYTextField(
|
fun RYTextField(
|
||||||
readOnly: Boolean,
|
readOnly: Boolean,
|
||||||
|
@ -2,6 +2,7 @@ package me.ash.reader.ui.page.home.feeds
|
|||||||
|
|
||||||
import RYExtensibleVisibility
|
import RYExtensibleVisibility
|
||||||
import android.view.HapticFeedbackConstants
|
import android.view.HapticFeedbackConstants
|
||||||
|
import androidx.compose.foundation.ExperimentalFoundationApi
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.combinedClickable
|
import androidx.compose.foundation.combinedClickable
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
@ -9,6 +10,7 @@ import androidx.compose.foundation.layout.Row
|
|||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.material3.Badge
|
import androidx.compose.material3.Badge
|
||||||
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
@ -27,7 +29,7 @@ import me.ash.reader.ui.page.home.feeds.drawer.feed.FeedOptionViewModel
|
|||||||
import me.ash.reader.ui.theme.ShapeBottom32
|
import me.ash.reader.ui.theme.ShapeBottom32
|
||||||
|
|
||||||
@OptIn(
|
@OptIn(
|
||||||
androidx.compose.foundation.ExperimentalFoundationApi::class,
|
ExperimentalFoundationApi::class, ExperimentalMaterial3Api::class,
|
||||||
)
|
)
|
||||||
@Composable
|
@Composable
|
||||||
fun FeedItem(
|
fun FeedItem(
|
||||||
|
@ -23,6 +23,7 @@ import androidx.compose.ui.unit.dp
|
|||||||
import me.ash.reader.R
|
import me.ash.reader.R
|
||||||
import me.ash.reader.data.constant.ElevationTokens
|
import me.ash.reader.data.constant.ElevationTokens
|
||||||
|
|
||||||
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun SearchBar(
|
fun SearchBar(
|
||||||
value: String,
|
value: String,
|
||||||
|
@ -9,6 +9,7 @@ import androidx.compose.material.icons.Icons
|
|||||||
import androidx.compose.material.icons.outlined.Palette
|
import androidx.compose.material.icons.outlined.Palette
|
||||||
import androidx.compose.material.icons.outlined.Share
|
import androidx.compose.material.icons.outlined.Share
|
||||||
import androidx.compose.material.icons.rounded.Close
|
import androidx.compose.material.icons.rounded.Close
|
||||||
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.SmallTopAppBar
|
import androidx.compose.material3.SmallTopAppBar
|
||||||
import androidx.compose.material3.TopAppBarDefaults
|
import androidx.compose.material3.TopAppBarDefaults
|
||||||
@ -27,6 +28,7 @@ import me.ash.reader.ui.ext.share
|
|||||||
import me.ash.reader.ui.ext.surfaceColorAtElevation
|
import me.ash.reader.ui.ext.surfaceColorAtElevation
|
||||||
import me.ash.reader.ui.page.common.RouteName
|
import me.ash.reader.ui.page.common.RouteName
|
||||||
|
|
||||||
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun TopBar(
|
fun TopBar(
|
||||||
navController: NavHostController,
|
navController: NavHostController,
|
||||||
|
@ -10,6 +10,7 @@ import androidx.compose.material.icons.Icons
|
|||||||
import androidx.compose.material.icons.rounded.Add
|
import androidx.compose.material.icons.rounded.Add
|
||||||
import androidx.compose.material.icons.rounded.ArrowBack
|
import androidx.compose.material.icons.rounded.ArrowBack
|
||||||
import androidx.compose.material.icons.rounded.Refresh
|
import androidx.compose.material.icons.rounded.Refresh
|
||||||
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.SmallTopAppBar
|
import androidx.compose.material3.SmallTopAppBar
|
||||||
import androidx.compose.material3.TopAppBarDefaults
|
import androidx.compose.material3.TopAppBarDefaults
|
||||||
@ -34,6 +35,7 @@ import me.ash.reader.ui.page.home.feeds.GroupItem
|
|||||||
import me.ash.reader.ui.theme.palette.onDark
|
import me.ash.reader.ui.theme.palette.onDark
|
||||||
import kotlin.math.ln
|
import kotlin.math.ln
|
||||||
|
|
||||||
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun FeedsPagePreview(
|
fun FeedsPagePreview(
|
||||||
topBarTonalElevation: FeedsTopBarTonalElevationPreference,
|
topBarTonalElevation: FeedsTopBarTonalElevationPreference,
|
||||||
@ -100,13 +102,10 @@ fun FeedsPagePreview(
|
|||||||
alpha = groupAlpha,
|
alpha = groupAlpha,
|
||||||
indicatorAlpha = groupIndicatorAlpha,
|
indicatorAlpha = groupIndicatorAlpha,
|
||||||
)
|
)
|
||||||
FeedItem(
|
FeedItemExpandSwitcher(
|
||||||
feed = generateFeedPreview(),
|
groupAlpha = groupAlpha,
|
||||||
alpha = groupAlpha,
|
feedBadgeAlpha = feedBadgeAlpha,
|
||||||
badgeAlpha = feedBadgeAlpha,
|
isExpanded = groupListExpand.value)
|
||||||
isEnded = { true },
|
|
||||||
isExpanded = { true },
|
|
||||||
)
|
|
||||||
Spacer(modifier = Modifier.height(12.dp))
|
Spacer(modifier = Modifier.height(12.dp))
|
||||||
FilterBar(
|
FilterBar(
|
||||||
filter = filter,
|
filter = filter,
|
||||||
@ -120,6 +119,28 @@ fun FeedsPagePreview(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Stable
|
||||||
|
@Composable
|
||||||
|
fun FeedItemExpandSwitcher(groupAlpha: Float,feedBadgeAlpha: Float ,isExpanded: Boolean) {
|
||||||
|
FeedPreview(
|
||||||
|
groupAlpha = groupAlpha,
|
||||||
|
feedBadgeAlpha = feedBadgeAlpha,
|
||||||
|
isExpanded = isExpanded
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Stable
|
||||||
|
@Composable
|
||||||
|
fun FeedPreview(groupAlpha: Float,feedBadgeAlpha: Float, isExpanded: Boolean) {
|
||||||
|
FeedItem(
|
||||||
|
feed = generateFeedPreview(),
|
||||||
|
alpha = groupAlpha,
|
||||||
|
badgeAlpha = feedBadgeAlpha,
|
||||||
|
isEnded = { true },
|
||||||
|
isExpanded = { isExpanded }
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
@Stable
|
@Stable
|
||||||
@Composable
|
@Composable
|
||||||
fun generateFeedPreview(): Feed =
|
fun generateFeedPreview(): Feed =
|
||||||
|
@ -10,6 +10,7 @@ import androidx.compose.material.icons.Icons
|
|||||||
import androidx.compose.material.icons.rounded.ArrowBack
|
import androidx.compose.material.icons.rounded.ArrowBack
|
||||||
import androidx.compose.material.icons.rounded.DoneAll
|
import androidx.compose.material.icons.rounded.DoneAll
|
||||||
import androidx.compose.material.icons.rounded.Search
|
import androidx.compose.material.icons.rounded.Search
|
||||||
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.SmallTopAppBar
|
import androidx.compose.material3.SmallTopAppBar
|
||||||
import androidx.compose.material3.TopAppBarDefaults
|
import androidx.compose.material3.TopAppBarDefaults
|
||||||
@ -32,6 +33,7 @@ import me.ash.reader.ui.page.home.flow.ArticleItem
|
|||||||
import me.ash.reader.ui.theme.palette.onDark
|
import me.ash.reader.ui.theme.palette.onDark
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun FlowPagePreview(
|
fun FlowPagePreview(
|
||||||
topBarTonalElevation: FlowTopBarTonalElevationPreference,
|
topBarTonalElevation: FlowTopBarTonalElevationPreference,
|
||||||
|
@ -43,6 +43,7 @@ import me.ash.reader.ui.ext.*
|
|||||||
import me.ash.reader.ui.theme.palette.alwaysLight
|
import me.ash.reader.ui.theme.palette.alwaysLight
|
||||||
import me.ash.reader.ui.theme.palette.onLight
|
import me.ash.reader.ui.theme.palette.onLight
|
||||||
|
|
||||||
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun TipsAndSupportPage(
|
fun TipsAndSupportPage(
|
||||||
navController: NavHostController,
|
navController: NavHostController,
|
||||||
|
@ -5,7 +5,7 @@ buildscript {
|
|||||||
// https://github.com/google/accompanist/releases
|
// https://github.com/google/accompanist/releases
|
||||||
accompanist = '0.24.7-alpha'
|
accompanist = '0.24.7-alpha'
|
||||||
// https://developer.android.com/jetpack/androidx/releases/compose-material3
|
// https://developer.android.com/jetpack/androidx/releases/compose-material3
|
||||||
material3 = '1.0.0-alpha12'
|
material3 = '1.0.1'
|
||||||
// https://developer.android.com/jetpack/androidx/releases/lifecycle
|
// https://developer.android.com/jetpack/androidx/releases/lifecycle
|
||||||
lifecycle = '2.5.0-rc01'
|
lifecycle = '2.5.0-rc01'
|
||||||
// https://developer.android.com/jetpack/androidx/releases/navigation
|
// https://developer.android.com/jetpack/androidx/releases/navigation
|
||||||
|
Loading…
x
Reference in New Issue
Block a user