-
Notifications
You must be signed in to change notification settings - Fork 0
Knji #19
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
base: master
Are you sure you want to change the base?
Knji #19
Changes from all commits
497957b
03bd380
56314a3
7d5072b
cce51a9
2fa323c
57a76a6
097b342
0ae0f3d
c1f8e3e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,28 @@ | ||
| package com.karan.hashin | ||
|
|
||
| import android.app.Activity | ||
| import android.graphics.Color.TRANSPARENT | ||
| import android.os.Build | ||
| import android.os.Bundle | ||
| import android.view.View | ||
| import android.view.Window | ||
| import android.view.WindowInsets | ||
| import android.view.WindowInsetsController | ||
| import android.view.WindowManager | ||
| import androidx.activity.ComponentActivity | ||
| import androidx.activity.SystemBarStyle | ||
| import androidx.activity.compose.LocalActivity | ||
| import androidx.activity.compose.setContent | ||
| import androidx.activity.enableEdgeToEdge | ||
| import androidx.annotation.RequiresApi | ||
| import androidx.compose.foundation.isSystemInDarkTheme | ||
| 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.core.view.WindowCompat | ||
| import androidx.core.view.WindowInsetsControllerCompat | ||
| import androidx.navigation.NavHostController | ||
| import androidx.navigation.compose.rememberNavController | ||
| import com.karan.hashin.navigation.NavGraph | ||
|
|
@@ -13,12 +32,15 @@ class MainActivity : ComponentActivity() { | |
|
|
||
| private lateinit var navController: NavHostController | ||
|
|
||
|
|
||
| override fun onCreate(savedInstanceState: Bundle?) { | ||
| super.onCreate(savedInstanceState) | ||
| enableEdgeToEdge() | ||
|
|
||
| WindowCompat.setDecorFitsSystemWindows(window, false) | ||
|
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. 🧩 Analysis chainVerify redundant edge-to-edge configuration.
Run the following script to confirm the edge-to-edge handling in Theme.kt: 🏁 Script executed: #!/bin/bash
# Verify edge-to-edge handling in Theme.kt
rg -nP -A5 'enableEdgeToEdge' --type=ktLength of output: 26 🏁 Script executed: #!/bin/bash
# Search for enableEdgeToEdge in all Kotlin files without type filter
rg -nP -A5 'enableEdgeToEdge' --type-list | grep -i kotlinLength of output: 389 🏁 Script executed: #!/bin/bash
# Find Theme.kt and search for enableEdgeToEdge directly
fd -e kt -path '*Theme.kt' --exec grep -n 'enableEdgeToEdge' {} \;Length of output: 168 🏁 Script executed: #!/bin/bash
# Broader search for enableEdgeToEdge without type filtering
rg -nP -A5 'enableEdgeToEdge'Length of output: 1729 🏁 Script executed: #!/bin/bash
# Also verify WindowCompat.setDecorFitsSystemWindows usage in MainActivity
rg -nP -B3 -A3 'WindowCompat.setDecorFitsSystemWindows' Length of output: 563 🏁 Script executed: #!/bin/bash
# Check if MainActivity actually calls enableEdgeToEdge (not just imports)
rg -nP 'enableEdgeToEdge\s*\(' app/src/main/java/com/karan/hashin/MainActivity.ktLength of output: 0 🏁 Script executed: #!/bin/bash
# Get full context of Theme.kt lines 120-145 to see the DisposableEffect structure
sed -n '120,145p' app/src/main/java/com/karan/hashin/ui/theme/Theme.ktLength of output: 662 🏁 Script executed: #!/bin/bash
# Get context around setContent in MainActivity to see when HashinTheme is called
rg -nP -B2 -A8 'setContent' app/src/main/java/com/karan/hashin/MainActivity.ktLength of output: 748 🌐 Web query: 💡 Result: Short answer: Yes — calling ComponentActivity.enableEdgeToEdge and then also calling WindowCompat.setDecorFitsSystemWindows(false) is usually redundant. enableEdgeToEdge is a convenience helper that sets up edge‑to‑edge for you (including turning off decor fitting and configuring system bars), so you normally only need enableEdgeToEdge. [1][2] If you need custom behavior (different insets handling or bar styles) you can skip enableEdgeToEdge and call WindowCompat.setDecorFitsSystemWindows / WindowInsetsController APIs yourself. [1][2] Sources:
Remove redundant window configuration at line 39. Calling 🤖 Prompt for AI Agents |
||
|
|
||
|
|
||
| setContent { | ||
| HashinTheme { | ||
| HashinTheme(dynamicColor = false) { | ||
| navController = rememberNavController() | ||
| NavGraph(navController) | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,75 +1,74 @@ | ||||||
| package com.karan.hashin.components | ||||||
|
|
||||||
| import android.content.res.Configuration | ||||||
| import com.karan.hashin.ui.theme.iconTintDark | ||||||
| import androidx.compose.ui.graphics.Color | ||||||
| import com.karan.hashin.R | ||||||
| import androidx.compose.foundation.background | ||||||
| import androidx.compose.runtime.getValue | ||||||
| import com.karan.hashin.ui.theme.iconTintDark | ||||||
| import androidx.compose.foundation.border | ||||||
| import androidx.compose.foundation.clickable | ||||||
| import androidx.compose.foundation.isSystemInDarkTheme | ||||||
| import androidx.compose.foundation.layout.Arrangement | ||||||
| import androidx.compose.foundation.layout.Box | ||||||
| import androidx.compose.foundation.layout.Column | ||||||
| import androidx.compose.foundation.layout.Row | ||||||
| import androidx.compose.foundation.layout.Spacer | ||||||
| import androidx.compose.foundation.layout.fillMaxSize | ||||||
| import androidx.compose.foundation.layout.fillMaxWidth | ||||||
| import androidx.compose.foundation.layout.height | ||||||
| import androidx.compose.foundation.layout.navigationBarsPadding | ||||||
| import androidx.compose.foundation.layout.padding | ||||||
| import androidx.compose.foundation.layout.size | ||||||
| import androidx.compose.foundation.layout.wrapContentHeight | ||||||
| import androidx.compose.foundation.shape.RoundedCornerShape | ||||||
| import androidx.compose.material.icons.Icons | ||||||
| import androidx.compose.material.icons.filled.Key | ||||||
| import androidx.compose.material.icons.outlined.Settings | ||||||
| import androidx.compose.material.icons.rounded.Add | ||||||
| import androidx.compose.material.icons.rounded.Settings | ||||||
| import androidx.compose.material3.Card | ||||||
| import androidx.compose.material3.CardDefaults | ||||||
| import androidx.compose.material3.Icon | ||||||
| import androidx.compose.material3.MaterialTheme | ||||||
| import androidx.compose.runtime.Composable | ||||||
| import androidx.compose.runtime.mutableStateOf | ||||||
| import androidx.compose.runtime.remember | ||||||
| import androidx.compose.ui.Alignment | ||||||
| import androidx.compose.ui.Modifier | ||||||
| import androidx.compose.ui.draw.clip | ||||||
| import androidx.compose.ui.graphics.RectangleShape | ||||||
| import androidx.compose.ui.graphics.vector.ImageVector | ||||||
| import androidx.compose.ui.res.vectorResource | ||||||
| import androidx.compose.ui.semantics.Role | ||||||
| import androidx.compose.ui.semantics.semantics | ||||||
| import androidx.compose.ui.tooling.preview.Preview | ||||||
| import androidx.compose.ui.unit.dp | ||||||
| import com.karan.hashin.ui.theme.HashinTheme | ||||||
| import com.karan.hashin.ui.theme.PurpleA700 | ||||||
| import com.karan.hashin.ui.theme.iconTintLight | ||||||
|
|
||||||
| @Composable | ||||||
| fun BottomAppBar( | ||||||
| fun NavigationBar( | ||||||
| toVault: () -> Unit = {}, | ||||||
| toPassKey: () -> Unit = {}, | ||||||
| toSetting: () -> Unit = {}, | ||||||
| selection: Int, | ||||||
| modifier: Modifier = Modifier | ||||||
| ) { | ||||||
| val iconTint = iconTintDark | ||||||
| val iconTint by remember { mutableStateOf(iconTintDark) } | ||||||
|
||||||
| val iconTint by remember { mutableStateOf(iconTintDark) } | |
| val iconTint = iconTintDark |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| package com.karan.hashin.screens.home | ||
|
|
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.
[nitpick] Remove the unnecessary blank line 35.