-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8136 from wmontwe/add-drawer-account-top-view
Add drawer account view
- Loading branch information
Showing
16 changed files
with
428 additions
and
28 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
43 changes: 43 additions & 0 deletions
43
...c/debug/kotlin/app/k9mail/feature/navigation/drawer/ui/account/AccountIndicatorPreview.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,43 @@ | ||
package app.k9mail.feature.navigation.drawer.ui.account | ||
|
||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.graphics.toArgb | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import app.k9mail.core.ui.compose.designsystem.PreviewWithThemes | ||
import app.k9mail.core.ui.compose.theme2.MainTheme | ||
|
||
@Composable | ||
@Preview(showBackground = true) | ||
internal fun AccountIndicatorPreview() { | ||
PreviewWithThemes { | ||
AccountIndicator( | ||
accountColor = 0, | ||
modifier = Modifier.height(MainTheme.spacings.double), | ||
) | ||
} | ||
} | ||
|
||
@Composable | ||
@Preview(showBackground = true) | ||
internal fun AccountIndicatorPreviewWithYellowAccountColor() { | ||
PreviewWithThemes { | ||
AccountIndicator( | ||
accountColor = Color.Yellow.toArgb(), | ||
modifier = Modifier.height(MainTheme.spacings.double), | ||
) | ||
} | ||
} | ||
|
||
@Composable | ||
@Preview(showBackground = true) | ||
internal fun AccountIndicatorPreviewWithGrayAccountColor() { | ||
PreviewWithThemes { | ||
AccountIndicator( | ||
accountColor = Color.Gray.toArgb(), | ||
modifier = Modifier.height(MainTheme.spacings.double), | ||
) | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
...er/src/debug/kotlin/app/k9mail/feature/navigation/drawer/ui/account/AccountViewPreview.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,56 @@ | ||
package app.k9mail.feature.navigation.drawer.ui.account | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import app.k9mail.core.ui.compose.designsystem.PreviewWithThemes | ||
import app.k9mail.feature.navigation.drawer.ui.account.FakeData.DISPLAY_NAME | ||
import app.k9mail.feature.navigation.drawer.ui.account.FakeData.EMAIL_ADDRESS | ||
import app.k9mail.feature.navigation.drawer.ui.account.FakeData.LONG_TEXT | ||
|
||
@Composable | ||
@Preview(showBackground = true) | ||
internal fun AccountViewPreview() { | ||
PreviewWithThemes { | ||
AccountView( | ||
displayName = DISPLAY_NAME, | ||
emailAddress = EMAIL_ADDRESS, | ||
accountColor = 0, | ||
) | ||
} | ||
} | ||
|
||
@Composable | ||
@Preview(showBackground = true) | ||
internal fun AccountViewWithColorPreview() { | ||
PreviewWithThemes { | ||
AccountView( | ||
displayName = DISPLAY_NAME, | ||
emailAddress = EMAIL_ADDRESS, | ||
accountColor = 0xFF0000, | ||
) | ||
} | ||
} | ||
|
||
@Composable | ||
@Preview(showBackground = true) | ||
internal fun AccountViewWithLongDisplayName() { | ||
PreviewWithThemes { | ||
AccountView( | ||
displayName = "$LONG_TEXT $DISPLAY_NAME", | ||
emailAddress = EMAIL_ADDRESS, | ||
accountColor = 0, | ||
) | ||
} | ||
} | ||
|
||
@Composable | ||
@Preview(showBackground = true) | ||
internal fun AccountViewWithLongEmailPreview() { | ||
PreviewWithThemes { | ||
AccountView( | ||
displayName = DISPLAY_NAME, | ||
emailAddress = "$LONG_TEXT@example.com", | ||
accountColor = 0, | ||
) | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...ation/drawer/src/debug/kotlin/app/k9mail/feature/navigation/drawer/ui/account/FakeData.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,37 @@ | ||
package app.k9mail.feature.navigation.drawer.ui.account | ||
|
||
import app.k9mail.feature.navigation.drawer.domain.entity.DisplayAccount | ||
import app.k9mail.legacy.account.Account | ||
import app.k9mail.legacy.account.Identity | ||
|
||
internal object FakeData { | ||
|
||
const val ACCOUNT_UUID = "uuid" | ||
const val DISPLAY_NAME = "Account Name" | ||
const val EMAIL_ADDRESS = "test@example.com" | ||
|
||
const val LONG_TEXT = "loremipsumdolorsitametconsetetursadipscingelitr" + | ||
"seddiamnonumyeirmodtemporinviduntutlaboreetdoloremagnaaliquyameratseddiamvoluptua" | ||
|
||
val ACCOUNT = Account( | ||
uuid = ACCOUNT_UUID, | ||
).apply { | ||
identities = ArrayList() | ||
|
||
val identity = Identity( | ||
signatureUse = false, | ||
signature = "", | ||
description = "", | ||
) | ||
identities.add(identity) | ||
|
||
name = DISPLAY_NAME | ||
email = EMAIL_ADDRESS | ||
} | ||
|
||
val DISPLAY_ACCOUNT = DisplayAccount( | ||
account = ACCOUNT, | ||
unreadMessageCount = 0, | ||
starredMessageCount = 0, | ||
) | ||
} |
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
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
59 changes: 40 additions & 19 deletions
59
...avigation/drawer/src/main/kotlin/app/k9mail/feature/navigation/drawer/ui/DrawerContent.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
3 changes: 3 additions & 0 deletions
3
...vigation/drawer/src/main/kotlin/app/k9mail/feature/navigation/drawer/ui/DrawerContract.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
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
Oops, something went wrong.