Skip to content
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

Added theme for high contrast (e-ink) and adapted colors to always fit #130

Merged
Merged
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 @@ -65,6 +65,7 @@ class ListWidgetConfigActivity : ComponentActivity() {
DropdownSettingOption.THEME_TRUE_DARK -> true
else -> isSystemInDarkTheme()
},
contrastTheme = settingsStateHolder.settingTheme.value == DropdownSettingOption.THEME_CONTRAST,
trueDarkTheme = settingsStateHolder.settingTheme.value == DropdownSettingOption.THEME_TRUE_DARK,
dynamicColor = isProPurchased.value
) {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/at/techbee/jtx/MainActivity2.kt
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ class MainActivity2 : AppCompatActivity() {
DropdownSettingOption.THEME_TRUE_DARK -> true
else -> isSystemInDarkTheme()
},
contrastTheme = settingsStateHolder.settingTheme.value == DropdownSettingOption.THEME_CONTRAST,
trueDarkTheme = settingsStateHolder.settingTheme.value == DropdownSettingOption.THEME_TRUE_DARK,
dynamicColor = isProPurchased.value
) {
Expand Down
5 changes: 1 addition & 4 deletions app/src/main/java/at/techbee/jtx/ui/about/TranslatorCard.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ fun TranslatorCard(
modifier: Modifier = Modifier
) {

ElevatedCard(
colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surface),
modifier = modifier
) {
ElevatedCard(modifier = modifier) {

Row(
modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ fun CollectionCard(


ElevatedCard(
colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surface),
modifier = modifier
) {

Expand Down Expand Up @@ -107,7 +106,6 @@ fun CollectionCard(
Text(
collection.description ?: "",
style = Typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant
)
}

Expand All @@ -126,18 +124,15 @@ fun CollectionCard(
Text(
stringResource(id = R.string.collections_journals_num, numJournals),
style = Typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant
)
Text(
stringResource(id = R.string.collections_notes_num, numNotes),
style = Typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier.padding(start = 8.dp)
)
Text(
stringResource(id = R.string.collections_tasks_num, numTodos),
style = Typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier.padding(start = 8.dp)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ fun CollectionsScreen(
showCollectionsAddDialog = true
menuExpanded.value = false
},
leadingIcon = { Icon(Icons.Outlined.LocalLibrary, null) }
leadingIcon = { Icon(Icons.Outlined.LocalLibrary, null) },
)
if (isDAVx5available) {
DropdownMenuItem(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ fun DetailsCardAttendees(
bringIntoViewRequester.bringIntoView()
}
},
colors = TextFieldDefaults.textFieldColors(containerColor = Color.Transparent),
isError = newAttendee.isNotEmpty(),
modifier = Modifier
.fillMaxWidth()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import androidx.compose.material3.*
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardCapitalization
Expand Down Expand Up @@ -154,7 +153,6 @@ fun DetailsCardCategories(
newCategory = newCategoryName
onCategoriesUpdated(categories)
},
colors = TextFieldDefaults.textFieldColors(containerColor = Color.Transparent),
modifier = Modifier.fillMaxWidth(),
isError = newCategory.isNotEmpty(),
keyboardOptions = KeyboardOptions(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ fun DetailsCardComments(
},
label = { Text(stringResource(id = R.string.edit_comment_helper)) },
onValueChange = { newValue -> newComment = newValue },
//colors = TextFieldDefaults.textFieldColors(containerColor = Color.Transparent),
isError = newComment.isNotEmpty(),
modifier = Modifier
.fillMaxWidth()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ fun DetailsCardLocation(
location = newLocation
onLocationUpdated(newLocation, geoLat, geoLong)
},
//colors = TextFieldDefaults.textFieldColors(containerColor = Color.Transparent),
keyboardOptions = KeyboardOptions(capitalization = KeyboardCapitalization.Sentences, keyboardType = KeyboardType.Text, imeAction = ImeAction.Done),
modifier = Modifier.weight(1f)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import androidx.compose.material3.*
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardCapitalization
Expand Down Expand Up @@ -146,7 +145,6 @@ fun DetailsCardResources(
onValueChange = { newResourceName ->
newResource = newResourceName
},
colors = TextFieldDefaults.textFieldColors(containerColor = Color.Transparent),
isError = newResource.isNotEmpty(),
modifier = Modifier.fillMaxWidth(),
keyboardOptions = KeyboardOptions(capitalization = KeyboardCapitalization.Sentences, keyboardType = KeyboardType.Text, imeAction = ImeAction.Done),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ fun DetailsCardSubtasks(
},
label = { Text(stringResource(id = R.string.edit_subtasks_add_helper)) },
onValueChange = { newValue -> newSubtaskText = newValue },
//colors = TextFieldDefaults.textFieldColors(containerColor = Color.Transparent),
isError = newSubtaskText.isNotEmpty(),
modifier = Modifier
.fillMaxWidth()
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/java/at/techbee/jtx/ui/detail/DetailsCardUrl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import androidx.compose.material3.*
import androidx.compose.runtime.*
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
Expand Down Expand Up @@ -85,7 +84,6 @@ fun DetailsCardUrl(
url = newUrl
onUrlUpdated(url)
},
colors = TextFieldDefaults.textFieldColors(containerColor = Color.Transparent),
modifier = Modifier
.fillMaxWidth()
)
Expand Down
24 changes: 21 additions & 3 deletions app/src/main/java/at/techbee/jtx/ui/detail/DetailsScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -196,15 +196,27 @@ fun DetailsScreen(
detailViewModel.shareAsText(context)
menuExpanded.value = false
},
leadingIcon = { Icon(Icons.Outlined.Mail, null) }
leadingIcon = {
Icon(
imageVector = Icons.Outlined.Mail,
contentDescription = null,
tint = Color.Unspecified
)
}
)
DropdownMenuItem(
text = { Text(text = stringResource(id = R.string.menu_view_share_ics)) },
onClick = {
detailViewModel.shareAsICS(context)
menuExpanded.value = false
},
leadingIcon = { Icon(Icons.Outlined.Description, null) }
leadingIcon = {
Icon(
imageVector = Icons.Outlined.Description,
contentDescription = null,
tint = Color.Unspecified
)
}
)
DropdownMenuItem(
text = { Text(text = stringResource(id = R.string.menu_view_copy_to_clipboard)) },
Expand All @@ -216,7 +228,13 @@ fun DetailsScreen(
Toast.makeText(context, context.getText(R.string.menu_view_copy_to_clipboard_copied), Toast.LENGTH_SHORT).show()
menuExpanded.value = false
},
leadingIcon = { Icon(Icons.Outlined.ContentPaste, null) }
leadingIcon = {
Icon(
imageVector = Icons.Outlined.ContentPaste,
contentDescription = null,
tint = Color.Unspecified
)
}
)
}

Expand Down
6 changes: 1 addition & 5 deletions app/src/main/java/at/techbee/jtx/ui/list/ListCard.kt
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ fun ICalObjectListCard(


ElevatedCard(
colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surface),
modifier = modifier
) {

Expand All @@ -111,7 +110,6 @@ fun ICalObjectListCard(
style = Typography.labelMedium,
overflow = TextOverflow.Ellipsis,
maxLines = 1,
color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier.padding(end = 16.dp).weight(0.2f),
)

Expand All @@ -123,7 +121,6 @@ fun ICalObjectListCard(
modifier = Modifier
.padding(end = 16.dp)
.weight(0.2f),
color = MaterialTheme.colorScheme.onSurfaceVariant,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
)
Expand All @@ -136,7 +133,6 @@ fun ICalObjectListCard(
fontWeight = FontWeight.Bold,
fontStyle = FontStyle.Italic,
modifier = Modifier.padding(end = 16.dp).weight(0.2f),
color = MaterialTheme.colorScheme.onSurfaceVariant,
maxLines = 1
)
}
Expand All @@ -146,7 +142,7 @@ fun ICalObjectListCard(
style = Typography.labelMedium,
fontWeight = FontWeight.Bold,
fontStyle = FontStyle.Italic,
color = if(ICalObject.isOverdue(iCalObject.percent, it, iCalObject.dueTimezone) == true) MaterialTheme.colorScheme.error else MaterialTheme.colorScheme.onSurfaceVariant,
color = if(ICalObject.isOverdue(iCalObject.percent, it, iCalObject.dueTimezone) == true) MaterialTheme.colorScheme.error else LocalContentColor.current,
modifier = Modifier.padding(end = 16.dp).weight(0.2f),
maxLines = 1
)
Expand Down
6 changes: 1 addition & 5 deletions app/src/main/java/at/techbee/jtx/ui/list/ListCardCompact.kt
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ fun ListCardCompact(
modifier = Modifier
.padding(end = 16.dp)
.weight(1f),
color = MaterialTheme.colorScheme.onSurfaceVariant,
maxLines = 1,
overflow = TextOverflow.Ellipsis
)
Expand All @@ -128,7 +127,6 @@ fun ListCardCompact(
style = Typography.labelMedium,
fontWeight = FontWeight.Bold,
fontStyle = FontStyle.Italic,
color = MaterialTheme.colorScheme.onSurfaceVariant,
maxLines = 1,
overflow = TextOverflow.Ellipsis
)
Expand All @@ -139,7 +137,7 @@ fun ListCardCompact(
style = Typography.labelMedium,
fontWeight = FontWeight.Bold,
fontStyle = FontStyle.Italic,
color = if(ICalObject.isOverdue(iCalObject.percent, iCalObject.due, iCalObject.dueTimezone) == true) MaterialTheme.colorScheme.error else MaterialTheme.colorScheme.onSurfaceVariant,
color = if(ICalObject.isOverdue(iCalObject.percent, iCalObject.due, iCalObject.dueTimezone) == true) MaterialTheme.colorScheme.error else LocalContentColor.current,
maxLines = 1,
overflow = TextOverflow.Ellipsis
)
Expand Down Expand Up @@ -188,7 +186,6 @@ fun ListCardCompact(
text = iCalObject.description?.trim() ?: "",
maxLines = 1,
overflow = TextOverflow.Ellipsis,
color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier.fillMaxWidth()
)
}
Expand Down Expand Up @@ -254,7 +251,6 @@ fun ListCardCompact(

if (subtask.id != subtasks.last().id)
Divider(
color = MaterialTheme.colorScheme.onSurfaceVariant,
thickness = 1.dp,
modifier = Modifier.alpha(0.25f)
)
Expand Down
5 changes: 1 addition & 4 deletions app/src/main/java/at/techbee/jtx/ui/list/ListCardGrid.kt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ fun ListCardGrid(
modifier = Modifier
.padding(end = 16.dp)
.weight(1f),
color = MaterialTheme.colorScheme.onSurfaceVariant,
maxLines = 1,
overflow = TextOverflow.Ellipsis
)
Expand All @@ -97,7 +96,6 @@ fun ListCardGrid(
style = Typography.labelMedium,
fontWeight = FontWeight.Bold,
fontStyle = FontStyle.Italic,
color = MaterialTheme.colorScheme.onSurfaceVariant,
maxLines = 1,
overflow = TextOverflow.Ellipsis
)
Expand All @@ -108,7 +106,7 @@ fun ListCardGrid(
style = Typography.labelMedium,
fontWeight = FontWeight.Bold,
fontStyle = FontStyle.Italic,
color = if(ICalObject.isOverdue(iCalObject.percent, iCalObject.due, iCalObject.dueTimezone) == true) MaterialTheme.colorScheme.error else MaterialTheme.colorScheme.onSurfaceVariant,
color = if(ICalObject.isOverdue(iCalObject.percent, iCalObject.due, iCalObject.dueTimezone) == true) MaterialTheme.colorScheme.error else LocalContentColor.current,
maxLines = 1,
overflow = TextOverflow.Ellipsis
)
Expand Down Expand Up @@ -162,7 +160,6 @@ fun ListCardGrid(
text = iCalObject.description?.trim() ?: "",
maxLines = 4,
overflow = TextOverflow.Ellipsis,
color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier.fillMaxWidth().padding(end = 8.dp)
)
}
Expand Down
Loading