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
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.core.content.ContextCompat
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.viewmodel.compose.viewModel
import com.pr0ph0z.fgoaccountswitcher.components.AccountDeleteDialog
Expand Down Expand Up @@ -88,7 +90,8 @@ class MainActivity : ComponentActivity() {
}) {
Icon(Icons.Default.Add, contentDescription = "Add")
}
}
},
containerColor = Color(ContextCompat.getColor(applicationContext, R.color.bg))
) { innerPadding ->
Column(modifier = Modifier.padding(innerPadding)) {
ListView(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fun DefaultTopBar(title: String) {
title = { Text(title) },
colors = TopAppBarDefaults.topAppBarColors(
containerColor = Color(0xff191c20),
titleContentColor = MaterialTheme.colorScheme.onPrimaryContainer,
titleContentColor = Color.White,
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@ import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.currentCompositionLocalContext
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Dialog
import androidx.core.content.ContextCompat
import com.pr0ph0z.fgoaccountswitcher.FormMode
import com.pr0ph0z.fgoaccountswitcher.R

@Composable
fun AccountFormDialog(
Expand All @@ -36,12 +41,13 @@ fun AccountFormDialog(
.fillMaxWidth()
.padding(16.dp),
shape = MaterialTheme.shapes.medium,
color = MaterialTheme.colorScheme.surface
color = Color(0xFF191C20)
) {
Column(modifier = Modifier.padding(16.dp)) {
Text(
"${if (formMode == FormMode.CREATE) "Add New" else "Edit"} Account",
style = MaterialTheme.typography.headlineSmall
style = MaterialTheme.typography.headlineSmall,
color = Color.White
)
Spacer(modifier = Modifier.height(16.dp))
OutlinedTextField(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.pr0ph0z.fgoaccountswitcher.components

import android.content.res.Resources
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
Expand All @@ -22,6 +23,7 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.pr0ph0z.fgoaccountswitcher.Account
import com.pr0ph0z.fgoaccountswitcher.R

@Composable
fun ListItem(account: Account, onItemClick: (Account) -> Unit) {
Expand Down Expand Up @@ -54,10 +56,12 @@ fun ListItem(
.padding(16.dp)
) {
Column {
Text(text = account.name)
Text(text = account.name, color = Color.White)
Text(text = "(${account.userID.dropLast(1).replace(Regex(".{3}")){
"${it.value},"
} + account.userID.last()})", fontSize = 13.sp, color = Color.White.copy(alpha = 0.5f))
} + account.userID.last()})",
fontSize = 13.sp,
color = Color.White.copy(alpha = 0.5f))
}
}
}
Expand All @@ -77,7 +81,8 @@ fun ListView(
Text(
text = "No data",
style = MaterialTheme.typography.headlineMedium,
textAlign = TextAlign.Center
textAlign = TextAlign.Center,
color = Color.White
)
}
} else {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
<color name="colorAccent">#03DAC5</color>
<color name="background">#1B1B1D</color>
<color name="muted">#80FFFFFF</color>
<color name="bg">#FF191C20</color>
</resources>
5 changes: 5 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@
<string name="app_name">FGO Account Switcher</string>
<string name="app_name_debug">FGO Account Switcher Debug</string>
<string name="minimize">Minimize</string>
<string name="no_data">No data</string>
<string name="add">Add</string>
<string name="root_granted">Root granted</string>
<string name="root_not_granted">Root is not granted</string>
<string name="overlay_permission_denied">Overlay Permission Denied</string>
</resources>
6 changes: 5 additions & 1 deletion app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="Theme.FGOAccountSwitcher" parent="android:Theme.Material.Light.NoActionBar" />
<style name="Theme.FGOAccountSwitcher" parent="Theme.Material3.DayNight.NoActionBar">
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
</style>

</resources>