-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] Show calendar in full with domain when select (#1042)
- Loading branch information
1 parent
b0d8376
commit ef9b713
Showing
4 changed files
with
106 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
app/src/main/java/at/techbee/jtx/ui/reusable/elements/CollectionInfoColumn.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
package at.techbee.jtx.ui.reusable.elements | ||
|
||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.draw.alpha | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.graphics.toArgb | ||
import androidx.compose.ui.text.style.TextOverflow | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import at.techbee.jtx.database.ICalCollection | ||
|
||
|
||
@Composable | ||
fun CollectionInfoColumn(collection: ICalCollection, modifier: Modifier = Modifier) { | ||
Column(modifier = modifier) { | ||
|
||
Row( | ||
verticalAlignment = Alignment.CenterVertically, | ||
horizontalArrangement = Arrangement.spacedBy(8.dp) | ||
) { | ||
collection.displayName?.let { | ||
Text( | ||
text = it, | ||
maxLines = 1, | ||
overflow = TextOverflow.Ellipsis, | ||
modifier = Modifier | ||
) | ||
} | ||
collection.accountName?.let { | ||
Text( | ||
text = it, | ||
style = MaterialTheme.typography.labelMedium, | ||
maxLines = 1, | ||
overflow = TextOverflow.Ellipsis, | ||
modifier = Modifier.alpha(0.5f).weight(1f) | ||
) | ||
} | ||
} | ||
if(collection.accountType != ICalCollection.LOCAL_ACCOUNT_TYPE) { | ||
Text( | ||
text = collection.url, | ||
style = MaterialTheme.typography.labelMedium, | ||
maxLines = 1, | ||
overflow = TextOverflow.Ellipsis, | ||
modifier = Modifier.alpha(0.5f) | ||
) | ||
} | ||
} | ||
} | ||
|
||
|
||
@Preview(showBackground = true) | ||
@Composable | ||
fun CollectionInfoColumn_Preview() { | ||
MaterialTheme { | ||
val collection1 = ICalCollection( | ||
collectionId = 1L, | ||
color = Color.Cyan.toArgb(), | ||
displayName = "Collection Display Name", | ||
description = "Here comes the desc", | ||
accountName = "My account", | ||
accountType = "LOCAL" | ||
) | ||
CollectionInfoColumn(collection1) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters