-
-
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 #7245 from thundernest/add_server_settings_interac…
…tion_mode Add interaction mode to server settings
- Loading branch information
Showing
26 changed files
with
450 additions
and
267 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
...common/src/main/kotlin/app/k9mail/feature/account/common/domain/entity/InteractionMode.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,9 @@ | ||
package app.k9mail.feature.account.common.domain.entity | ||
|
||
/** | ||
* Enum representing the mode a user is interacting with an account or setting. | ||
*/ | ||
enum class InteractionMode { | ||
Create, | ||
Edit, | ||
} |
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
49 changes: 49 additions & 0 deletions
49
...on/src/main/kotlin/app/k9mail/feature/account/common/ui/AccountTopAppBarWithBackButton.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,49 @@ | ||
package app.k9mail.feature.account.common.ui | ||
|
||
import androidx.compose.foundation.layout.PaddingValues | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.res.stringResource | ||
import app.k9mail.core.ui.compose.common.DevicePreviews | ||
import app.k9mail.core.ui.compose.designsystem.atom.button.ButtonIcon | ||
import app.k9mail.core.ui.compose.designsystem.organism.TopAppBar | ||
import app.k9mail.core.ui.compose.theme.Icons | ||
import app.k9mail.core.ui.compose.theme.MainTheme | ||
import app.k9mail.core.ui.compose.theme.PreviewWithThemes | ||
import app.k9mail.feature.account.common.R | ||
|
||
/** | ||
* Top app bar for the account screens with a back button. | ||
*/ | ||
@Composable | ||
fun AccountTopAppBarWithBackButton( | ||
title: String, | ||
modifier: Modifier = Modifier, | ||
onBackClicked: () -> Unit, | ||
) { | ||
TopAppBar( | ||
title = title, | ||
modifier = modifier, | ||
subtitle = stringResource(id = R.string.account_common_title), | ||
titleContentPadding = PaddingValues( | ||
start = MainTheme.spacings.default, | ||
), | ||
navigationIcon = { | ||
ButtonIcon( | ||
onClick = onBackClicked, | ||
imageVector = Icons.Outlined.arrowBack, | ||
) | ||
}, | ||
) | ||
} | ||
|
||
@DevicePreviews | ||
@Composable | ||
internal fun AccountTopAppBarWithBackButtonPreview() { | ||
PreviewWithThemes { | ||
AccountTopAppBarWithBackButton( | ||
title = "Title", | ||
onBackClicked = {}, | ||
) | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...ccount/common/src/main/kotlin/app/k9mail/feature/account/common/ui/WithInteractionMode.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,10 @@ | ||
package app.k9mail.feature.account.common.ui | ||
|
||
import app.k9mail.feature.account.common.domain.entity.InteractionMode | ||
|
||
/** | ||
* Interface for screens that can be used in different interaction modes. | ||
*/ | ||
interface WithInteractionMode { | ||
val mode: InteractionMode | ||
} |
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
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.