-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use edge to edge #1351
Merged
+53
−85
Merged
Use edge to edge #1351
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ef103a7
WIP edge to edge
MV-GH 2d89baa
Merge branch 'main' into use-edge-to-edge
MV-GH fe53f5f
Merge branch 'main' into use-edge-to-edge
MV-GH 6c8d460
Merge branch 'main' into use-edge-to-edge
MV-GH f87ebfd
Fix edge to edge
MV-GH 37d85fd
Fix remnant
MV-GH 77c91c2
Fix remnant
MV-GH c28bc4d
Merge branch 'main' into use-edge-to-edge
MV-GH 6ca6dd5
Remove remnant
MV-GH 159cc0f
Merge branch 'main' into use-edge-to-edge
MV-GH File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ import android.os.Bundle | |
import android.util.Patterns | ||
import android.widget.TextView | ||
import androidx.activity.compose.setContent | ||
import androidx.activity.enableEdgeToEdge | ||
import androidx.activity.viewModels | ||
import androidx.appcompat.app.AppCompatActivity | ||
import androidx.compose.animation.EnterTransition | ||
|
@@ -90,7 +91,7 @@ class MainActivity : AppCompatActivity() { | |
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
|
||
enableEdgeToEdge() | ||
setContent { | ||
val ctx = LocalContext.current | ||
|
||
|
@@ -119,7 +120,7 @@ class MainActivity : AppCompatActivity() { | |
} | ||
|
||
DisposableEffect(appSettings.backConfirmationMode) { | ||
when (BackConfirmationMode.entries[appSettings.backConfirmationMode]) { | ||
when (appSettings.backConfirmationMode.toEnum<BackConfirmationMode>()) { | ||
BackConfirmationMode.Toast -> { | ||
[email protected](appState.navController, ctx) | ||
} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,14 +12,14 @@ import androidx.compose.runtime.CompositionLocalProvider | |
import androidx.compose.runtime.ReadOnlyComposable | ||
import androidx.compose.runtime.staticCompositionLocalOf | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.graphics.toArgb | ||
import androidx.compose.ui.platform.LocalContext | ||
import androidx.compose.ui.platform.LocalView | ||
import androidx.core.graphics.ColorUtils | ||
import androidx.core.view.WindowCompat | ||
import com.jerboa.ThemeColor | ||
import com.jerboa.ThemeMode | ||
import com.jerboa.db.entity.AppSettings | ||
import com.jerboa.toEnum | ||
|
||
// Defines a provider for custom color scheme use; initializes it to a default scheme that will | ||
// be overridden by JerboaTheme | ||
|
@@ -30,8 +30,8 @@ fun JerboaTheme( | |
appSettings: AppSettings, | ||
content: @Composable () -> Unit, | ||
) { | ||
val themeMode = ThemeMode.entries[appSettings.theme] | ||
val themeColor = ThemeColor.entries[appSettings.themeColor] | ||
val themeMode = appSettings.theme.toEnum<ThemeMode>() | ||
val themeColor = appSettings.themeColor.toEnum<ThemeColor>() | ||
val fontSize = appSettings.fontSize | ||
|
||
val ctx = LocalContext.current | ||
|
@@ -55,7 +55,7 @@ fun JerboaTheme( | |
), | ||
) | ||
} else { | ||
pink() | ||
blue() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't like the pink theme as default 👯 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Haha alright. |
||
} | ||
|
||
val colorPair = | ||
|
@@ -122,10 +122,7 @@ fun JerboaTheme( | |
window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE) | ||
} | ||
|
||
window.statusBarColor = colors.material.background.toArgb() | ||
// The navigation bar color is also set on BottomAppBarAll | ||
window.navigationBarColor = colors.material.background.toArgb() | ||
|
||
// The navigation bar color is set on BottomAppBarAll | ||
insets.isAppearanceLightStatusBars = isLight | ||
insets.isAppearanceLightNavigationBars = isLight | ||
|
||
|
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 |
---|---|---|
@@ -1,9 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
|
||
<style name="Theme.Jerboa" parent="Theme.AppCompat.Light.NoActionBar"> | ||
<item name="android:windowTranslucentStatus">true</item> | ||
<item name="android:windowLightStatusBar">true</item> | ||
<style name="Theme.Jerboa" parent="Theme.AppCompat.NoActionBar"> | ||
<item name="android:windowBackground">@color/window_background</item> | ||
</style> | ||
</resources> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo here, feel free to merge after you fixed tho.