-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
06b6d19
commit 93fca3c
Showing
16 changed files
with
231 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
networksurvey/src/main/java/com/craxiom/networksurvey/ui/theme/Color.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.craxiom.networksurvey.ui.theme | ||
|
||
import androidx.compose.ui.graphics.Color | ||
|
||
val ColorBlack = Color(0xFF000000) | ||
val ColorOffBlack = Color(0xFF161616) | ||
val ColorWhiteCultured = Color(0xFFF4F4F4) | ||
val ColorRedFieryRose = Color(0xFFF45B69) | ||
val ColorBlueIceberg = Color(0xFF8BAED0) |
91 changes: 91 additions & 0 deletions
91
networksurvey/src/main/java/com/craxiom/networksurvey/ui/theme/NsTheme.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
package com.craxiom.networksurvey.ui.theme | ||
|
||
import android.app.Activity | ||
import androidx.compose.material3.ColorScheme | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.Typography | ||
import androidx.compose.material3.darkColorScheme | ||
import androidx.compose.material3.lightColorScheme | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.SideEffect | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.graphics.toArgb | ||
import androidx.compose.ui.platform.LocalView | ||
import androidx.compose.ui.res.colorResource | ||
import androidx.core.view.WindowCompat | ||
import com.craxiom.networksurvey.R | ||
|
||
@Composable | ||
fun OldNsTheme(content: @Composable () -> Unit) { | ||
val darkColorScheme = | ||
darkColorScheme( | ||
surface = colorResource(id = R.color.colorCardDark), | ||
background = Color.Black, | ||
primary = colorResource(id = R.color.colorAccent), | ||
tertiary = colorResource(id = R.color.colorAccent), | ||
) | ||
MaterialTheme( | ||
colorScheme = darkColorScheme, | ||
typography = Typography(), | ||
content = content, | ||
) | ||
} | ||
|
||
private val DarkColorScheme: ColorScheme | ||
@Composable | ||
get() = darkColorScheme( | ||
primary = colorResource(id = R.color.colorAccent), | ||
secondary = ColorBlueIceberg, | ||
tertiary = colorResource(id = R.color.colorAccent), | ||
background = ColorBlack, | ||
surface = ColorBlack, | ||
onPrimary = ColorOffBlack, | ||
onSecondary = ColorWhiteCultured, | ||
onTertiary = ColorWhiteCultured, | ||
onBackground = ColorWhiteCultured, | ||
onSurface = colorResource(id = R.color.normalText), | ||
surfaceTint = ColorWhiteCultured | ||
) | ||
|
||
private val LightColorScheme = lightColorScheme( | ||
primary = ColorWhiteCultured, | ||
secondary = ColorBlueIceberg, | ||
tertiary = ColorRedFieryRose, | ||
background = ColorBlueIceberg, | ||
surface = ColorBlueIceberg, | ||
onPrimary = ColorOffBlack, | ||
onSecondary = ColorWhiteCultured, | ||
onTertiary = ColorWhiteCultured, | ||
onBackground = ColorWhiteCultured, | ||
onSurface = ColorWhiteCultured, | ||
surfaceTint = ColorBlack | ||
) | ||
|
||
@Composable | ||
fun NsTheme( | ||
darkTheme: Boolean = true, | ||
content: @Composable () -> Unit | ||
) { | ||
val colorScheme = DarkColorScheme | ||
val view = LocalView.current | ||
val currentWindow = (view.context as? Activity)?.window | ||
if (!view.isInEditMode && currentWindow != null) { | ||
/*val currentWindow = (view.context as? Activity)?.window | ||
?: throw Exception("Not in an activity - unable to get Window reference")*/ | ||
|
||
SideEffect { | ||
(view.context as Activity).window.statusBarColor = colorScheme.background.toArgb() | ||
(view.context as Activity).window.navigationBarColor = colorScheme.background.toArgb() | ||
WindowCompat.getInsetsController(currentWindow, view).isAppearanceLightStatusBars = | ||
false | ||
/*WindowCompat.setDecorFitsSystemWindows(currentWindow, false) | ||
val insetsController = WindowCompat.getInsetsController(currentWindow, view) | ||
insetsController.isAppearanceLightStatusBars = false | ||
insetsController.hide(WindowInsetsCompat.Type.statusBars())*/ | ||
} | ||
} | ||
|
||
MaterialTheme( | ||
colorScheme = colorScheme, typography = Typography(), content = content | ||
) | ||
} |
Oops, something went wrong.