Skip to content

Commit

Permalink
Merge pull request #203 from ptkNktq/update/compose_lib
Browse files Browse the repository at this point in the history
Compose BOMの更新
  • Loading branch information
ptkNktq authored Oct 12, 2024
2 parents 56c2683 + ecb7b25 commit 08da654
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 50 deletions.
2 changes: 1 addition & 1 deletion AndroidApp/.idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

88 changes: 77 additions & 11 deletions AndroidApp/.idea/other.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ import me.nya_n.notificationnotifier.ui.screen.selection.SelectionViewModel
import me.nya_n.notificationnotifier.ui.screen.settings.SettingsViewModel
import me.nya_n.notificationnotifier.ui.screen.target.TargetViewModel
import org.koin.android.ext.koin.androidContext
import org.koin.androidx.viewmodel.dsl.viewModel
import org.koin.core.context.startKoin
import org.koin.core.module.dsl.viewModel
import org.koin.dsl.module

class App : Application() {
Expand Down
2 changes: 1 addition & 1 deletion AndroidApp/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ androidx-core = "1.13.1"
androidx-appcompat = "1.7.0"
androidx-security = "1.1.0-alpha06"
androidx-splashscreen = "1.0.1"
androidx-compose-bom = "2024.06.00"
androidx-compose-bom = "2024.09.03"
androidx-compose-activity = "1.9.2"
androidx-compose-viewmodel = "2.8.6"
androidx-compose-navigation = "2.8.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material.ripple.rememberRipple
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.ripple
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
Expand Down Expand Up @@ -53,7 +53,7 @@ fun AppListItem(
.fillMaxWidth()
.clickable(
interactionSource = interactionSource,
indication = rememberRipple(bounded = true),
indication = ripple(bounded = true),
onClick = { onAppSelected(app) }
)
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalLifecycleOwner
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleEventObserver
import androidx.lifecycle.compose.LocalLifecycleOwner
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package me.nya_n.notificationnotifier.ui.screen.main

import android.app.Activity
import androidx.activity.compose.BackHandler
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
Expand All @@ -14,6 +13,7 @@ import androidx.compose.material.icons.automirrored.rounded.List
import androidx.compose.material.icons.outlined.NotificationsActive
import androidx.compose.material.icons.outlined.Settings
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.NavigationBar
import androidx.compose.material3.NavigationBarItem
import androidx.compose.material3.SnackbarHostState
Expand All @@ -37,7 +37,6 @@ import me.nya_n.notificationnotifier.ui.screen.target.TargetScreen
import me.nya_n.notificationnotifier.ui.theme.AppTheme

/** メイン画面 */
@OptIn(ExperimentalFoundationApi::class)
@Composable
fun MainScreen(navController: NavController) {
val snackbarHostState = remember { SnackbarHostState() }
Expand Down Expand Up @@ -78,7 +77,6 @@ fun MainScreen(navController: NavController) {
}

/** メイン画面のコンテンツ本体 */
@OptIn(ExperimentalFoundationApi::class)
@Composable
private fun MainContent(
snackbarHostState: SnackbarHostState,
Expand Down Expand Up @@ -114,7 +112,9 @@ private fun BottomBar(
currentPage: Int,
onTabSelected: (selected: Int) -> Unit
) {
NavigationBar {
NavigationBar(
containerColor = MaterialTheme.colorScheme.primary
) {
items.forEachIndexed { index, item ->
NavigationBarItem(
selected = index == currentPage,
Expand All @@ -138,7 +138,6 @@ private data class TabItem(
}
)

@OptIn(ExperimentalFoundationApi::class)
@Preview
@Composable
private fun MainPreview() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,39 +1,14 @@
package me.nya_n.notificationnotifier.ui.theme

import androidx.compose.material.ripple.LocalRippleTheme
import androidx.compose.material.ripple.RippleAlpha
import androidx.compose.material.ripple.RippleTheme
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.graphics.Color

@Composable
fun AppTheme(
content: @Composable () -> Unit
) {
MaterialTheme(
colorScheme = AppColorScheme
) {
CompositionLocalProvider(
LocalRippleTheme provides WhiteRippleTheme,
content = content
)
}
colorScheme = AppColorScheme,
content = content
)
}

object WhiteRippleTheme : RippleTheme {
@Composable
override fun defaultColor(): Color {
return Color.White
}

@Composable
override fun rippleAlpha(): RippleAlpha {
return RippleTheme.defaultRippleAlpha(
contentColor = LocalContentColor.current,
lightTheme = false // AppColorSchemeがdarkColorSchemeのみサポートしている
)
}
}

0 comments on commit 08da654

Please sign in to comment.