diff --git a/feature/git/detekt-baseline.xml b/feature/git/detekt-baseline.xml
index eed893ac..3043930a 100644
--- a/feature/git/detekt-baseline.xml
+++ b/feature/git/detekt-baseline.xml
@@ -8,13 +8,8 @@
CyclomaticComplexMethod:GitHistoryScreen.kt$@Composable private fun GitHistoryScreen( uiState: GitHistoryUiState, interactionListener: GitHistoryInteractionListener, onBack: () -> Unit, onOpenDiff: (String, String) -> Unit, )
CyclomaticComplexMethod:GitPanelScreen.kt$@Composable private fun GitChangesHeader( uiState: GitPanelUiState, interactionListener: GitPanelInteractionListener, )
CyclomaticComplexMethod:GitPanelScreen.kt$@Composable private fun GitPanelScreen( uiState: GitPanelUiState, interactionListener: GitPanelInteractionListener, onClose: () -> Unit, onOpenDiff: (String, GitDiffTarget) -> Unit, onOpenHistory: () -> Unit, onOpenBranches: () -> Unit, onOpenTags: () -> Unit, onOpenStashes: () -> Unit, onOpenConflicts: () -> Unit, )
- ForbiddenImport:GitAuthPrompt.kt$import androidx.compose.material3.MaterialTheme
- ForbiddenImport:GitBlameScreen.kt$import androidx.compose.material3.MaterialTheme
- ForbiddenImport:GitConflictScreen.kt$import androidx.compose.material3.MaterialTheme
ForbiddenImport:GitDiffScreen.kt$import androidx.compose.material3.MaterialTheme
ForbiddenImport:GitHistoryScreen.kt$import androidx.compose.material3.MaterialTheme
- ForbiddenImport:GitPanelScreen.kt$import androidx.compose.material3.MaterialTheme
- ForbiddenImport:GitRefsScreen.kt$import androidx.compose.material3.MaterialTheme
LambdaParameterInRestartableEffect:GitHistoryScreen.kt$onLoadNext
LongMethod:GitAuthPrompt.kt$@Composable fun GitHubAuthDialog(state: GitAuthPromptState, actions: GitAuthPromptActions)
LongMethod:GitDiffScreen.kt$@Composable private fun GitDiffScreen( uiState: GitDiffUiState, interactionListener: GitDiffInteractionListener, onBack: () -> Unit, )
diff --git a/feature/git/src/main/java/com/ahmadkharfan/androidstudiolite/feature/editor/git/GitPanelScreen.kt b/feature/git/src/main/java/com/ahmadkharfan/androidstudiolite/feature/editor/git/GitPanelScreen.kt
index d99d9792..42c7a526 100644
--- a/feature/git/src/main/java/com/ahmadkharfan/androidstudiolite/feature/editor/git/GitPanelScreen.kt
+++ b/feature/git/src/main/java/com/ahmadkharfan/androidstudiolite/feature/editor/git/GitPanelScreen.kt
@@ -15,7 +15,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.HorizontalDivider
-import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
@@ -58,6 +57,7 @@ import com.ahmadkharfan.androidstudiolite.designsystem.component.navigation.AslT
import com.ahmadkharfan.androidstudiolite.designsystem.component.navigation.rememberAslToolWindowWidth
import com.ahmadkharfan.androidstudiolite.designsystem.theme.AslShape
import com.ahmadkharfan.androidstudiolite.designsystem.theme.AslTheme
+import com.ahmadkharfan.androidstudiolite.designsystem.theme.AslTypography
import com.ahmadkharfan.androidstudiolite.domain.model.GitFileStatus
import com.ahmadkharfan.androidstudiolite.domain.model.GitDiffTarget
import com.ahmadkharfan.androidstudiolite.domain.model.PullMode
@@ -293,7 +293,7 @@ private fun GitChangesHeader(
Row(verticalAlignment = Alignment.CenterVertically) {
Text(
text = statusText,
- style = MaterialTheme.typography.labelSmall,
+ style = AslTypography.labelSmall,
color = colors.textSecondary,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
@@ -472,7 +472,7 @@ private fun SubmodulesView(
Column(modifier = Modifier.fillMaxSize()) {
Text(
text = stringResource(R.string.git_submodules_hint),
- style = MaterialTheme.typography.bodySmall,
+ style = AslTypography.bodySmall,
color = AslTheme.colors.textSecondary,
modifier = Modifier.padding(12.dp),
)
@@ -551,6 +551,7 @@ private fun BootstrapDialog(uiState: GitPanelUiState, interactionListener: GitPa
@Composable
private fun OperationBanner(uiState: GitPanelUiState, interactionListener: GitPanelInteractionListener) {
+ val colors = AslTheme.colors
Row(
modifier = Modifier.fillMaxWidth().padding(horizontal = 12.dp, vertical = 8.dp),
verticalAlignment = Alignment.CenterVertically,
@@ -562,8 +563,8 @@ private fun OperationBanner(uiState: GitPanelUiState, interactionListener: GitPa
repositoryStateLabel(uiState.repositoryState),
),
modifier = Modifier.weight(1f),
- style = MaterialTheme.typography.labelMedium,
- color = MaterialTheme.colorScheme.error,
+ style = AslTypography.labelMedium,
+ color = colors.error,
)
if (uiState.repositoryState == GitRepositoryState.REBASING) {
AslButton(stringResource(R.string.git_operation_continue), interactionListener::onContinueOperation, variant = AslButtonVariant.Tertiary, disabled = uiState.isBusy)
@@ -738,12 +739,12 @@ private fun SectionHeader(
}
Text(
text = title,
- style = MaterialTheme.typography.labelMedium,
+ style = AslTypography.labelMedium,
color = colors.textSecondary,
)
Text(
text = count.toString(),
- style = MaterialTheme.typography.labelSmall,
+ style = AslTypography.labelSmall,
color = colors.textTertiary,
modifier = Modifier
.background(colors.surfaceContainerLow, AslShape.xs)
@@ -832,7 +833,7 @@ private fun RemotesView(uiState: GitPanelUiState, interactionListener: GitPanelI
) {
Text(
text = stringResource(R.string.git_remotes_configured),
- style = MaterialTheme.typography.labelMedium,
+ style = AslTypography.labelMedium,
color = AslTheme.colors.textSecondary,
modifier = Modifier.weight(1f),
)
@@ -933,7 +934,7 @@ private fun DiffView(
AslIconButton(icon = "arrow-left", contentDescription = stringResource(CommonR.string.action_back), onClick = { interactionListener.onCloseDiff() })
Text(
text = uiState.selectedPath.orEmpty(),
- style = MaterialTheme.typography.bodySmall,
+ style = AslTypography.bodySmall,
color = colors.textPrimary,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
diff --git a/feature/git/src/main/java/com/ahmadkharfan/androidstudiolite/feature/editor/git/conflict/GitConflictScreen.kt b/feature/git/src/main/java/com/ahmadkharfan/androidstudiolite/feature/editor/git/conflict/GitConflictScreen.kt
index 3575cd82..29c3b561 100644
--- a/feature/git/src/main/java/com/ahmadkharfan/androidstudiolite/feature/editor/git/conflict/GitConflictScreen.kt
+++ b/feature/git/src/main/java/com/ahmadkharfan/androidstudiolite/feature/editor/git/conflict/GitConflictScreen.kt
@@ -9,7 +9,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material3.HorizontalDivider
-import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
@@ -27,6 +26,7 @@ import com.ahmadkharfan.androidstudiolite.designsystem.component.feedback.AslDia
import com.ahmadkharfan.androidstudiolite.designsystem.component.feedback.AslDialogVariant
import com.ahmadkharfan.androidstudiolite.designsystem.component.feedback.AslLinearProgress
import com.ahmadkharfan.androidstudiolite.designsystem.component.navigation.AslTopAppBar
+import com.ahmadkharfan.androidstudiolite.designsystem.theme.AslTypography
import java.io.File
import org.koin.androidx.compose.koinViewModel
import org.koin.core.parameter.parametersOf
@@ -76,8 +76,8 @@ private fun GitConflictScreen(
else -> LazyColumn(Modifier.padding(padding).fillMaxSize()) {
items(uiState.entries, key = { it.path }) { entry ->
Column(Modifier.fillMaxWidth().padding(16.dp), verticalArrangement = Arrangement.spacedBy(10.dp)) {
- Text(entry.path.middleEllipsis(), style = MaterialTheme.typography.titleSmall, fontFamily = FontFamily.Monospace)
- Text(entry.worktree.orEmpty().lineSequence().take(8).joinToString("\n"), fontFamily = FontFamily.Monospace, style = MaterialTheme.typography.bodySmall)
+ Text(entry.path.middleEllipsis(), style = AslTypography.titleSmall, fontFamily = FontFamily.Monospace)
+ Text(entry.worktree.orEmpty().lineSequence().take(8).joinToString("\n"), fontFamily = FontFamily.Monospace, style = AslTypography.bodySmall)
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
AslButton(stringResource(R.string.git_conflict_accept_ours), { interactionListener.acceptOurs(entry.path) }, variant = AslButtonVariant.Secondary)
AslButton(stringResource(R.string.git_conflict_accept_theirs), { interactionListener.acceptTheirs(entry.path) }, variant = AslButtonVariant.Secondary)
diff --git a/feature/git/src/main/java/com/ahmadkharfan/androidstudiolite/feature/editor/git/diff/GitDiffScreen.kt b/feature/git/src/main/java/com/ahmadkharfan/androidstudiolite/feature/editor/git/diff/GitDiffScreen.kt
index 8d77515c..0bdfe1bb 100644
--- a/feature/git/src/main/java/com/ahmadkharfan/androidstudiolite/feature/editor/git/diff/GitDiffScreen.kt
+++ b/feature/git/src/main/java/com/ahmadkharfan/androidstudiolite/feature/editor/git/diff/GitDiffScreen.kt
@@ -56,6 +56,8 @@ import com.ahmadkharfan.androidstudiolite.designsystem.component.inputs.AslSegme
import com.ahmadkharfan.androidstudiolite.designsystem.component.content.AslEmptyState
import com.ahmadkharfan.androidstudiolite.designsystem.component.feedback.AslLinearProgress
import com.ahmadkharfan.androidstudiolite.designsystem.component.navigation.AslTopAppBar
+import com.ahmadkharfan.androidstudiolite.designsystem.theme.AslTheme
+import com.ahmadkharfan.androidstudiolite.designsystem.theme.AslTypography
import com.ahmadkharfan.androidstudiolite.domain.model.GitFileDiff
import com.ahmadkharfan.androidstudiolite.domain.model.GitDiffHunk
import com.ahmadkharfan.androidstudiolite.domain.model.GitDiffKind
@@ -265,10 +267,11 @@ private fun DiffPaneColumn(
@Composable
private fun DiffPaneCell(line: GitDiffLine?, isLeft: Boolean) {
+ val colors = AslTheme.colors
val kind = line?.kind
val bg = when (kind) {
- GitDiffKind.REMOVED -> MaterialTheme.colorScheme.error.copy(alpha = 0.10f)
- GitDiffKind.ADDED, GitDiffKind.MODIFIED -> MaterialTheme.colorScheme.primary.copy(alpha = 0.10f)
+ GitDiffKind.REMOVED -> colors.error.copy(alpha = 0.10f)
+ GitDiffKind.ADDED, GitDiffKind.MODIFIED -> colors.accentPrimary.copy(alpha = 0.10f)
else -> Color.Transparent
}
val number = if (isLeft) line?.oldNo else line?.newNo
@@ -280,16 +283,16 @@ private fun DiffPaneCell(line: GitDiffLine?, isLeft: Boolean) {
number?.toString().orEmpty(),
modifier = Modifier.width(42.dp).padding(end = 6.dp),
textAlign = androidx.compose.ui.text.style.TextAlign.End,
- color = MaterialTheme.colorScheme.onSurfaceVariant,
+ color = colors.textSecondary,
fontFamily = FontFamily.Monospace,
- style = MaterialTheme.typography.labelSmall,
+ style = AslTypography.labelSmall,
)
Text(
line?.text.orEmpty(),
modifier = Modifier.padding(end = 12.dp),
fontFamily = FontFamily.Monospace,
- style = MaterialTheme.typography.bodySmall,
- color = MaterialTheme.colorScheme.onSurface,
+ style = AslTypography.bodySmall,
+ color = colors.textPrimary,
softWrap = false,
maxLines = 1,
overflow = TextOverflow.Clip,
@@ -299,6 +302,7 @@ private fun DiffPaneCell(line: GitDiffLine?, isLeft: Boolean) {
@Composable
private fun HunkNavBar(count: Int, onPrevious: () -> Unit, onNext: () -> Unit) {
+ val colors = AslTheme.colors
Row(
Modifier.fillMaxWidth().padding(horizontal = 8.dp, vertical = 4.dp),
horizontalArrangement = Arrangement.spacedBy(6.dp),
@@ -306,14 +310,14 @@ private fun HunkNavBar(count: Int, onPrevious: () -> Unit, onNext: () -> Unit) {
) {
Text(
pluralStringResource(R.plurals.git_diff_hunks, count, count),
- style = MaterialTheme.typography.labelSmall,
- color = MaterialTheme.colorScheme.onSurfaceVariant,
+ style = AslTypography.labelSmall,
+ color = colors.textSecondary,
modifier = Modifier.weight(1f),
)
AslIconButton(icon = "chevron-up", contentDescription = stringResource(R.string.git_diff_previous_hunk), onClick = onPrevious, size = 32.dp, iconSize = 16.dp)
AslIconButton(icon = "chevron-down", contentDescription = stringResource(R.string.git_diff_next_hunk), onClick = onNext, size = 32.dp, iconSize = 16.dp)
}
- HorizontalDivider(color = MaterialTheme.colorScheme.outlineVariant)
+ HorizontalDivider(color = colors.borderDefault)
}
@Composable
diff --git a/feature/git/src/main/java/com/ahmadkharfan/androidstudiolite/feature/editor/git/git/GitAuthPrompt.kt b/feature/git/src/main/java/com/ahmadkharfan/androidstudiolite/feature/editor/git/git/GitAuthPrompt.kt
index fd862ad6..151c50da 100644
--- a/feature/git/src/main/java/com/ahmadkharfan/androidstudiolite/feature/editor/git/git/GitAuthPrompt.kt
+++ b/feature/git/src/main/java/com/ahmadkharfan/androidstudiolite/feature/editor/git/git/GitAuthPrompt.kt
@@ -21,7 +21,6 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
-import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import com.ahmadkharfan.androidstudiolite.designsystem.component.buttons.AslButton
import com.ahmadkharfan.androidstudiolite.designsystem.component.buttons.AslButtonVariant
@@ -33,6 +32,7 @@ import com.ahmadkharfan.androidstudiolite.designsystem.component.inputs.AslTextF
import com.ahmadkharfan.androidstudiolite.designsystem.component.inputs.AslTextFieldType
import com.ahmadkharfan.androidstudiolite.designsystem.theme.AslShape
import com.ahmadkharfan.androidstudiolite.designsystem.theme.AslTheme
+import com.ahmadkharfan.androidstudiolite.designsystem.theme.AslTypography
import com.ahmadkharfan.androidstudiolite.domain.model.GitCredentials
import com.ahmadkharfan.androidstudiolite.domain.repository.GitCredentialStore
import com.ahmadkharfan.androidstudiolite.domain.repository.GitHubDeviceAuthState
@@ -214,12 +214,12 @@ fun GitHubAuthDialog(state: GitAuthPromptState, actions: GitAuthPromptActions) {
if (state.succeeded) {
Text(
text = stringResource(R.string.git_auth_connected_github),
- style = MaterialTheme.typography.titleSmall,
+ style = AslTypography.titleSmall,
color = colors.success,
)
Text(
text = stringResource(R.string.git_auth_connected_hint),
- style = MaterialTheme.typography.bodySmall,
+ style = AslTypography.bodySmall,
color = colors.textSecondary,
)
return@Column
@@ -246,18 +246,18 @@ fun GitHubAuthDialog(state: GitAuthPromptState, actions: GitAuthPromptActions) {
if (device == null) {
Text(
stringResource(R.string.git_auth_device_hint),
- style = MaterialTheme.typography.bodySmall,
+ style = AslTypography.bodySmall,
color = colors.textSecondary,
)
} else {
Text(
stringResource(R.string.git_auth_copy_code_hint),
- style = MaterialTheme.typography.bodySmall,
+ style = AslTypography.bodySmall,
color = colors.textSecondary,
)
Text(
text = device.userCode,
- style = MaterialTheme.typography.headlineSmall,
+ style = AslTypography.headlineSmall,
color = colors.textPrimary,
textAlign = TextAlign.Center,
modifier = Modifier
@@ -271,7 +271,7 @@ fun GitHubAuthDialog(state: GitAuthPromptState, actions: GitAuthPromptActions) {
)
Text(
text = stringResource(if (codeCopied) R.string.git_auth_copied else R.string.git_auth_tap_copy),
- style = MaterialTheme.typography.labelSmall,
+ style = AslTypography.labelSmall,
color = if (codeCopied) colors.success else colors.textTertiary,
textAlign = TextAlign.Center,
modifier = Modifier.fillMaxWidth(),
@@ -285,14 +285,14 @@ fun GitHubAuthDialog(state: GitAuthPromptState, actions: GitAuthPromptActions) {
)
Text(
stringResource(R.string.git_auth_waiting_github),
- style = MaterialTheme.typography.bodySmall,
+ style = AslTypography.bodySmall,
color = colors.textTertiary,
)
}
} else {
Text(
stringResource(R.string.git_auth_token_hint, host),
- style = MaterialTheme.typography.bodySmall,
+ style = AslTypography.bodySmall,
color = colors.textSecondary,
)
AslTextField(
@@ -315,7 +315,7 @@ fun GitHubAuthDialog(state: GitAuthPromptState, actions: GitAuthPromptActions) {
}
state.error?.let {
- Text(text = it, style = MaterialTheme.typography.bodySmall, color = colors.error)
+ Text(text = it, style = AslTypography.bodySmall, color = colors.error)
}
}
},
diff --git a/feature/git/src/main/java/com/ahmadkharfan/androidstudiolite/feature/editor/git/history/GitBlameScreen.kt b/feature/git/src/main/java/com/ahmadkharfan/androidstudiolite/feature/editor/git/history/GitBlameScreen.kt
index 434d1ed5..208296a1 100644
--- a/feature/git/src/main/java/com/ahmadkharfan/androidstudiolite/feature/editor/git/history/GitBlameScreen.kt
+++ b/feature/git/src/main/java/com/ahmadkharfan/androidstudiolite/feature/editor/git/history/GitBlameScreen.kt
@@ -7,7 +7,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.rememberScrollState
-import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
@@ -21,6 +20,7 @@ import com.ahmadkharfan.androidstudiolite.core.format.middleEllipsis
import com.ahmadkharfan.androidstudiolite.designsystem.component.content.AslEmptyState
import com.ahmadkharfan.androidstudiolite.designsystem.component.feedback.AslLinearProgress
import com.ahmadkharfan.androidstudiolite.designsystem.component.navigation.AslTopAppBar
+import com.ahmadkharfan.androidstudiolite.designsystem.theme.AslTypography
import com.ahmadkharfan.androidstudiolite.feature.editor.git.blameGutterText
import org.koin.androidx.compose.koinViewModel
import org.koin.core.parameter.parametersOf
@@ -48,8 +48,8 @@ fun GitBlameRoute(
LazyColumn(Modifier.padding(padding).fillMaxSize()) {
items(state.lines, key = { it.lineNo }) { line ->
Row(Modifier.horizontalScroll(scroll).padding(horizontal = 8.dp, vertical = 2.dp)) {
- Text(blameGutterText(line.lineNo, line.shortId, line.authorName), fontFamily = FontFamily.Monospace, style = MaterialTheme.typography.bodySmall)
- Text(line.lineText, fontFamily = FontFamily.Monospace, style = MaterialTheme.typography.bodySmall)
+ Text(blameGutterText(line.lineNo, line.shortId, line.authorName), fontFamily = FontFamily.Monospace, style = AslTypography.bodySmall)
+ Text(line.lineText, fontFamily = FontFamily.Monospace, style = AslTypography.bodySmall)
}
}
}
diff --git a/feature/git/src/main/java/com/ahmadkharfan/androidstudiolite/feature/editor/git/history/GitHistoryScreen.kt b/feature/git/src/main/java/com/ahmadkharfan/androidstudiolite/feature/editor/git/history/GitHistoryScreen.kt
index b8932770..ac89aaaf 100644
--- a/feature/git/src/main/java/com/ahmadkharfan/androidstudiolite/feature/editor/git/history/GitHistoryScreen.kt
+++ b/feature/git/src/main/java/com/ahmadkharfan/androidstudiolite/feature/editor/git/history/GitHistoryScreen.kt
@@ -51,6 +51,8 @@ import com.ahmadkharfan.androidstudiolite.designsystem.component.buttons.AslOver
import com.ahmadkharfan.androidstudiolite.designsystem.component.feedback.AslDialog
import com.ahmadkharfan.androidstudiolite.designsystem.component.feedback.AslDialogVariant
import com.ahmadkharfan.androidstudiolite.designsystem.component.inputs.AslTextField
+import com.ahmadkharfan.androidstudiolite.designsystem.theme.AslTheme
+import com.ahmadkharfan.androidstudiolite.designsystem.theme.AslTypography
import com.ahmadkharfan.androidstudiolite.domain.model.GitResetMode
import com.ahmadkharfan.androidstudiolite.domain.model.GitCommitDetails
import com.ahmadkharfan.androidstudiolite.domain.model.GitCommitSummary
@@ -210,7 +212,7 @@ private fun HistoryList(
if (state.shallow && state.nextCursor == null) {
item {
Column(Modifier.fillMaxWidth().padding(16.dp), verticalArrangement = Arrangement.spacedBy(8.dp)) {
- Text(stringResource(R.string.git_history_shallow), style = MaterialTheme.typography.bodyMedium)
+ Text(stringResource(R.string.git_history_shallow), style = AslTypography.bodyMedium)
AslButton(stringResource(R.string.git_history_deepen), onDeepen, variant = AslButtonVariant.Secondary)
}
}
@@ -220,6 +222,7 @@ private fun HistoryList(
@Composable
private fun HistoryRow(commit: GitCommitSummary, graph: GitGraphRow?, onClick: () -> Unit, onReset: () -> Unit) {
+ val colors = AslTheme.colors
Row(Modifier.fillMaxWidth().clickable(onClick = onClick)) {
if (graph != null) {
GitGraphGutter(graph)
@@ -239,18 +242,18 @@ private fun HistoryRow(commit: GitCommitSummary, graph: GitGraphRow?, onClick: (
Text(
commit.message,
modifier = Modifier.weight(1f),
- style = MaterialTheme.typography.titleSmall,
+ style = AslTypography.titleSmall,
fontWeight = FontWeight.Medium,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
)
- Text(commit.shortId, fontFamily = FontFamily.Monospace, style = MaterialTheme.typography.labelMedium)
+ Text(commit.shortId, fontFamily = FontFamily.Monospace, style = AslTypography.labelMedium)
HistoryResetMenu(onReset = onReset)
}
Text(
"${commit.authorName} ยท ${formatRelativeTime(LocalContext.current, commit.authorTimeMillis)}",
- style = MaterialTheme.typography.bodySmall,
- color = MaterialTheme.colorScheme.onSurfaceVariant,
+ style = AslTypography.bodySmall,
+ color = colors.textSecondary,
)
if (commit.refs.isNotEmpty()) {
Row(horizontalArrangement = Arrangement.spacedBy(6.dp)) {
@@ -263,8 +266,8 @@ private fun HistoryRow(commit: GitCommitSummary, graph: GitGraphRow?, onClick: (
}
}
}
- if (commit.isShallowBoundary) Text(stringResource(R.string.git_history_shallow_boundary), style = MaterialTheme.typography.labelSmall)
- commit.path?.let { Text(it.middleEllipsis(), style = MaterialTheme.typography.labelSmall, fontFamily = FontFamily.Monospace) }
+ if (commit.isShallowBoundary) Text(stringResource(R.string.git_history_shallow_boundary), style = AslTypography.labelSmall)
+ commit.path?.let { Text(it.middleEllipsis(), style = AslTypography.labelSmall, fontFamily = FontFamily.Monospace) }
}
}
HorizontalDivider()
@@ -291,11 +294,12 @@ private val GitGraphRowHeight = 72.dp
@Composable
private fun GitGraphGutter(row: GitGraphRow) {
+ val colors = AslTheme.colors
val palette = listOf(
- MaterialTheme.colorScheme.primary,
+ colors.accentPrimary,
MaterialTheme.colorScheme.tertiary,
MaterialTheme.colorScheme.secondary,
- MaterialTheme.colorScheme.error,
+ colors.error,
Color(0xFF43A047),
Color(0xFFFF8F00),
)
@@ -347,15 +351,15 @@ private fun CommitDetails(details: GitCommitDetails, onOpenDiff: (String, String
item {
val initialCommit = stringResource(R.string.git_history_initial_commit)
Column(Modifier.padding(16.dp), verticalArrangement = Arrangement.spacedBy(8.dp)) {
- Text(details.fullMessage, style = MaterialTheme.typography.titleMedium)
- Text("${details.author.name} <${details.author.email}>", style = MaterialTheme.typography.bodyMedium)
- Text(details.id, fontFamily = FontFamily.Monospace, style = MaterialTheme.typography.bodySmall)
+ Text(details.fullMessage, style = AslTypography.titleMedium)
+ Text("${details.author.name} <${details.author.email}>", style = AslTypography.bodyMedium)
+ Text(details.id, fontFamily = FontFamily.Monospace, style = AslTypography.bodySmall)
Text(
stringResource(
R.string.git_history_parents,
details.parents.joinToString().ifEmpty { initialCommit },
),
- style = MaterialTheme.typography.bodySmall,
+ style = AslTypography.bodySmall,
)
}
HorizontalDivider()
diff --git a/feature/git/src/main/java/com/ahmadkharfan/androidstudiolite/feature/editor/git/refs/GitRefsScreen.kt b/feature/git/src/main/java/com/ahmadkharfan/androidstudiolite/feature/editor/git/refs/GitRefsScreen.kt
index 58d270ec..2d28dcc0 100644
--- a/feature/git/src/main/java/com/ahmadkharfan/androidstudiolite/feature/editor/git/refs/GitRefsScreen.kt
+++ b/feature/git/src/main/java/com/ahmadkharfan/androidstudiolite/feature/editor/git/refs/GitRefsScreen.kt
@@ -10,7 +10,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material3.HorizontalDivider
-import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
@@ -44,6 +43,7 @@ import com.ahmadkharfan.androidstudiolite.designsystem.component.inputs.AslCheck
import com.ahmadkharfan.androidstudiolite.designsystem.component.inputs.AslTextField
import com.ahmadkharfan.androidstudiolite.designsystem.component.navigation.AslTopAppBar
import com.ahmadkharfan.androidstudiolite.designsystem.theme.AslTheme
+import com.ahmadkharfan.androidstudiolite.designsystem.theme.AslTypography
import com.ahmadkharfan.androidstudiolite.feature.editor.git.git.GitHubAuthDialog
import com.ahmadkharfan.androidstudiolite.domain.model.GitBranch
import com.ahmadkharfan.androidstudiolite.domain.model.GitStash
@@ -75,6 +75,7 @@ private fun GitRefsScreen(
interactionListener: GitRefsInteractionListener,
onBack: () -> Unit,
) {
+ val colors = AslTheme.colors
val dialogState = remember { GitRefsDialogState() }
val title = when (uiState.mode) {
GitRefsMode.BRANCHES -> stringResource(R.string.git_refs_branches)
@@ -115,8 +116,8 @@ private fun GitRefsScreen(
Text(
uiState.error,
modifier = Modifier.fillMaxWidth().padding(12.dp),
- color = MaterialTheme.colorScheme.error,
- style = MaterialTheme.typography.bodySmall,
+ color = colors.error,
+ style = AslTypography.bodySmall,
)
}
if (uiState.loading) AslLinearProgress(label = stringResource(R.string.git_refs_updating, title), modifier = Modifier.padding(12.dp))
@@ -289,7 +290,7 @@ private fun BranchList(
state.ahead?.takeIf { it > 0 }?.let { AslChip(label = aheadLabel(it), kind = AslChipKind.Status, status = AslChipStatus.Success) }
Text(
text = state.syncMessage.orEmpty(),
- style = MaterialTheme.typography.labelSmall,
+ style = AslTypography.labelSmall,
color = colors.textSecondary,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
@@ -393,7 +394,7 @@ private fun BranchList(
private fun SectionLabel(text: String) {
Text(
text = text.uppercase(),
- style = MaterialTheme.typography.labelSmall,
+ style = AslTypography.labelSmall,
color = AslTheme.colors.textTertiary,
modifier = Modifier.padding(start = 16.dp, end = 16.dp, top = 12.dp, bottom = 4.dp),
)
@@ -450,8 +451,8 @@ private fun StashList(
@Composable
private fun RefRow(name: String, detail: String?, actions: @Composable () -> Unit) {
Column(Modifier.fillMaxWidth().padding(horizontal = 16.dp, vertical = 10.dp)) {
- Text(name, fontFamily = FontFamily.Monospace, style = MaterialTheme.typography.titleSmall)
- detail?.let { Text(it, maxLines = 1, overflow = TextOverflow.Ellipsis, style = MaterialTheme.typography.bodySmall) }
+ Text(name, fontFamily = FontFamily.Monospace, style = AslTypography.titleSmall)
+ detail?.let { Text(it, maxLines = 1, overflow = TextOverflow.Ellipsis, style = AslTypography.bodySmall) }
Row(Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.End) { actions() }
}
HorizontalDivider()