-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui: Updated RoundedTag to use ellipsis for text overflow
ui: Removed Settings from drawer ui: Updated CrashHandlerActivity to use CrashHandlerTheme Signed-off-by: Gabriel Fontán <[email protected]>
- Loading branch information
Showing
6 changed files
with
100 additions
and
72 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
35 changes: 35 additions & 0 deletions
35
crashhandler/src/main/java/com/bobbyesp/crashhandler/ui/theme/Theme.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,35 @@ | ||
package com.bobbyesp.crashhandler.ui.theme | ||
|
||
import androidx.compose.foundation.isSystemInDarkTheme | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.darkColorScheme | ||
import androidx.compose.material3.dynamicDarkColorScheme | ||
import androidx.compose.material3.dynamicLightColorScheme | ||
import androidx.compose.material3.lightColorScheme | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.platform.LocalContext | ||
|
||
@Composable | ||
fun CrashHandlerTheme( | ||
darkTheme: Boolean = isSystemInDarkTheme(), | ||
content: @Composable () -> Unit | ||
) { | ||
val context = LocalContext.current | ||
|
||
//if is android higher than 12, use dynamic color scheme, else use static color scheme based on dark theme | ||
if (android.os.Build.VERSION.SDK_INT >= 31) { | ||
MaterialTheme( | ||
colorScheme = if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme( | ||
context | ||
) | ||
) { | ||
content() | ||
} | ||
} else { | ||
MaterialTheme( | ||
colorScheme = if (darkTheme) darkColorScheme() else lightColorScheme() | ||
) { | ||
content() | ||
} | ||
} | ||
} |
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