Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .idea/compiler.xml

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

2 changes: 1 addition & 1 deletion .idea/gradle.xml

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

3 changes: 2 additions & 1 deletion .idea/misc.xml

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

9 changes: 2 additions & 7 deletions app/src/main/java/com/greybox/projectmesh/GlobalApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ All dependencies are defined in one place, which makes it easier to manage and t
class GlobalApp : Application(), DIAware {
// it is an instance of Preferences.key<Int>, used to interact with "DataStore"
private val addressKey = intPreferencesKey("virtual_node_address")
/*data object DeviceInfoManager {
data object DeviceInfoManager {
// Global HashMap to store IP-DeviceName mapping
private val deviceNameMap = ConcurrentHashMap<String, String?>()

Expand All @@ -82,7 +82,7 @@ class GlobalApp : Application(), DIAware {
fun getChatName(inetAddress: InetAddress): String {
return inetAddress.hostAddress
}
}*/
}
object GlobalUserRepo {
// Lateinit or lazy property
lateinit var userRepository: UserRepository
Expand Down Expand Up @@ -365,7 +365,6 @@ class GlobalApp : Application(), DIAware {
}
})
.fallbackToDestructiveMigration() // handle migrations destructively
// .allowMainThreadQueries() // this should generally be avoided for production apps
.build()
}

Expand Down Expand Up @@ -398,10 +397,6 @@ class GlobalApp : Application(), DIAware {
}

onReady {
// clears all data in the existing tables
//GlobalScope.launch {
// instance<MeshDatabase>().messageDao().clearTable()
//}
val logger: MNetLogger = instance()
instance<AppServer>().start()
logger(Log.DEBUG,"AppServer started successfully on Port: ${AppServer.DEFAULT_PORT}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ fun TransparentButton(
contentColor = Color.Black // Text color
),
border = BorderStroke(1.dp, Color.Black), // Black border
shape = RoundedCornerShape(8.dp), // Optional: Rounded corners
modifier = modifier.fillMaxWidth(),
shape = RoundedCornerShape(8.dp),
modifier = modifier.fillMaxWidth().padding(horizontal = 16.dp).padding(vertical = 8.dp).size(50.dp),
enabled = enabled
) {
Text(text = text)
Expand Down
39 changes: 21 additions & 18 deletions app/src/main/java/com/greybox/projectmesh/ui/theme/Theme.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,34 @@ import androidx.compose.runtime.Composable
import androidx.compose.material3.*
import androidx.compose.ui.graphics.Color

// Define the color schemes for light and dark themes
enum class AppTheme {
SYSTEM, LIGHT, DARK
}

private val DarkColorScheme = darkColorScheme(
primary = Color(0xFFBB86FC),
secondary = Color(0xFF03DAC5),
background = Color(0xFF121212),
surface = Color(0xFF121212),
primary = Color(0xFFB6A4F5),
onPrimary = Color.Black,
onSecondary = Color.Black,
background = Color(0xFF121212),
onBackground = Color.White,
onSurface = Color.White
surface = Color(0xFF1E1E1E),
onSurface = Color.White,
secondary = Color(0xFFAAAAAA),
onSecondary = Color.Black,
outline = Color(0xFF444444)
)

private val LightColorScheme = lightColorScheme(
primary = Color(0xFF6200EE),
secondary = Color(0xFF03DAC5),
background = Color(0xFFFFFFFF),
surface = Color(0xFFFFFFFF),
primary = Color(0xFF6A5AE0), // vibrant purple (used for buttons, etc.)
onPrimary = Color.White,
onSecondary = Color.Black,
background = Color(0xFFF9F9F9), // soft white background
onBackground = Color.Black,
onSurface = Color.Black
surface = Color.White,
onSurface = Color.Black,
secondary = Color(0xFFB0B0B0), // soft gray
onSecondary = Color.Black,
outline = Color(0xFFE0E0E0) // subtle border color
)

enum class AppTheme {
SYSTEM, LIGHT, DARK
}

@Composable
fun ProjectMeshTheme(
Expand All @@ -42,9 +44,10 @@ fun ProjectMeshTheme(
AppTheme.LIGHT -> false
AppTheme.DARK -> true
}

MaterialTheme(
colorScheme = if (darkTheme) DarkColorScheme else LightColorScheme,
content = content,
typography = Typography,
content = content
)
}
}
16 changes: 0 additions & 16 deletions app/src/main/java/com/greybox/projectmesh/ui/theme/Type.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,4 @@ val Typography = Typography(
lineHeight = 24.sp,
letterSpacing = 0.5.sp
)
/* Other default text styles to override
titleLarge = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
fontSize = 22.sp,
lineHeight = 28.sp,
letterSpacing = 0.sp
),
labelSmall = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Medium,
fontSize = 11.sp,
lineHeight = 16.sp,
letterSpacing = 0.5.sp
)
*/
)
Loading