Skip to content

Commit

Permalink
mwr-651 night
Browse files Browse the repository at this point in the history
  • Loading branch information
arvifox committed Sep 29, 2023
1 parent f22622b commit b84b1fd
Show file tree
Hide file tree
Showing 16 changed files with 52 additions and 37 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ buildscript {
composeMaterial : '1.4.3',
composeCompiler : '1.5.3',
composeConstraintLayout: '1.1.0-alpha05',
uiCore : '0.2.6',
uiCore : '0.2.7',
soraCard : '0.1.45',
lazySodium : '5.0.2',
jna : '5.8.0',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package jp.co.soramitsu.common.presentation.compose.components

import androidx.compose.material.AlertDialog
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.material.TextButton
import androidx.compose.runtime.Composable
Expand All @@ -41,6 +42,7 @@ import androidx.compose.ui.res.stringResource
import jp.co.soramitsu.common.R
import jp.co.soramitsu.common.base.AlertDialogData
import jp.co.soramitsu.common.util.ext.safeCast
import jp.co.soramitsu.ui_core.theme.customColors

@Composable
fun AlertDialogContent(openAlertDialog: MutableState<AlertDialogData>) {
Expand All @@ -49,6 +51,7 @@ fun AlertDialogContent(openAlertDialog: MutableState<AlertDialogData>) {
val message = openAlertDialog.value.message.message()
if (title != null && message != null) {
AlertDialog(
backgroundColor = MaterialTheme.customColors.bgPage,
title = { Text(text = title) },
text = { Text(text = message) },
onDismissRequest = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,6 @@ import jp.co.soramitsu.ui_core.theme.darkColors
import jp.co.soramitsu.ui_core.theme.defaultCustomTypography
import jp.co.soramitsu.ui_core.theme.lightColors

private val LightColors = androidx.compose.material.lightColors(
primary = ThemeColors.Primary,
onPrimary = ThemeColors.OnPrimary,
secondary = ThemeColors.Secondary,
onSecondary = ThemeColors.OnSecondary,
background = ThemeColors.Background,
onBackground = ThemeColors.Background
)

private val DarkColors = androidx.compose.material.darkColors(
primary = ThemeColorsDark.Primary,
onPrimary = ThemeColorsDark.OnPrimary,
secondary = ThemeColorsDark.Secondary,
onSecondary = ThemeColorsDark.OnSecondary,
background = ThemeColorsDark.Background,
onBackground = ThemeColorsDark.Background
)

@Composable
fun SoraAppTheme(
darkTheme: Boolean = isSystemInDarkTheme(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,14 @@ abstract class SoraBaseActivity<T : BaseViewModel> : AppCompatActivity() {
}

Box(modifier = Modifier.fillMaxSize()) {
Image(
modifier = Modifier.fillMaxSize(),
contentScale = ContentScale.FillBounds,
painter = painterResource(id = R.drawable.bg_image),
contentDescription = ""
)
if (!isDarkModeOn.value) {
Image(
modifier = Modifier.fillMaxSize(),
contentScale = ContentScale.FillBounds,
painter = painterResource(id = R.drawable.bg_image),
contentDescription = ""
)
}
Scaffold(
modifier = Modifier
.navigationBarsPadding()
Expand Down
6 changes: 3 additions & 3 deletions common/src/main/res/values-night/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<item name="android:statusBarColor">?attr/baseBackground</item>
<item name="android:navigationBarColor">?attr/baseBackground</item>
<item name="android:windowBackground">?attr/baseBackground</item>
<item name="android:windowLightStatusBar">true</item>
<item name="android:windowLightNavigationBar" tools:targetApi="o_mr1">true</item>
<item name="android:windowLightStatusBar">false</item>
<item name="android:windowLightNavigationBar" tools:targetApi="o_mr1">false</item>
<item name="android:enforceNavigationBarContrast" tools:targetApi="q">true</item>
<item name="android:textColorHint">?attr/disabledButtonTextColor</item>

Expand All @@ -26,7 +26,7 @@
<item name="contentTertiary">@color/grey_500</item>
<item name="contentQuaternary">@color/grey_400</item>
<item name="baseBackground">#FF070707</item>
<item name="baseBackgroundSecond">@color/neu_color_white</item>
<item name="baseBackgroundSecond">#FF171717</item>
<item name="baseBackgroundDark">@color/backgroundDarkColor</item>
<item name="baseBorderPrimary">@color/grey_300</item>
<item name="baseBorderSecondary">@color/grey_200</item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,22 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package jp.co.soramitsu.feature_main_impl.presentation.pincode

import androidx.compose.material.AlertDialog
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.material.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.window.DialogProperties
import jp.co.soramitsu.common.R
import jp.co.soramitsu.ui_core.theme.customColors

@Composable
fun PinCodeNodeConnection(
onSwitchClicked: () -> Unit,
) {
AlertDialog(
backgroundColor = MaterialTheme.customColors.bgPage,
onDismissRequest = {},
properties = DialogProperties(
dismissOnBackPress = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ class OnboardingActivity : SoraBaseActivity<OnboardingViewModel>() {
viewModel.skipDialogState.observeAsState().value?.let {
if (it) {
AlertDialog(
backgroundColor = MaterialTheme.customColors.bgPage,
title = {
Text(
text = stringResource(id = R.string.import_account_not_backed_up),
Expand Down Expand Up @@ -233,6 +234,7 @@ class OnboardingActivity : SoraBaseActivity<OnboardingViewModel>() {
val recoveryDialog = viewModel.recoveryDialog.collectAsStateWithLifecycle()
if (recoveryDialog.value) {
AlertDialog(
backgroundColor = MaterialTheme.customColors.bgPage,
onDismissRequest = viewModel::onRecoverySourceDismiss,
text = {
Text(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ class AccountDetailsFragment : SoraBaseFragment<AccountDetailsViewModel>() {
viewModel.deleteDialogState.observeAsState().value?.let {
if (it) {
AlertDialog(
backgroundColor = MaterialTheme.customColors.bgPage,
title = {
Text(
text = stringResource(id = R.string.delete_backup_alert_title),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ fun MnemonicConfirmationScreen(
.padding(bottom = Dimens.x3, top = Dimens.x1),
) {
Column(
modifier = Modifier.padding(Dimens.x3),
modifier = Modifier
.fillMaxWidth()
.padding(Dimens.x3),
horizontalAlignment = Alignment.CenterHorizontally
) {
Text(
Expand Down Expand Up @@ -106,7 +108,11 @@ fun MnemonicConfirmationScreen(
.size(Dimens.x3)
.padding(vertical = Dimens.x1_2),
painter = painterResource(R.drawable.ic_circle_unchecked),
tint = if (mnemonicConfirmationState.confirmationStep > 1) { MaterialTheme.customColors.accentPrimary } else { MaterialTheme.customColors.bgSurfaceVariant },
tint = if (mnemonicConfirmationState.confirmationStep > 1) {
MaterialTheme.customColors.accentPrimary
} else {
MaterialTheme.customColors.bgSurfaceVariant
},
contentDescription = null
)

Expand All @@ -115,7 +121,11 @@ fun MnemonicConfirmationScreen(
.size(Dimens.x3)
.padding(vertical = Dimens.x1_2),
painter = painterResource(R.drawable.ic_circle_unchecked),
tint = if (mnemonicConfirmationState.confirmationStep > 2) { MaterialTheme.customColors.accentPrimary } else { MaterialTheme.customColors.bgSurfaceVariant },
tint = if (mnemonicConfirmationState.confirmationStep > 2) {
MaterialTheme.customColors.accentPrimary
} else {
MaterialTheme.customColors.bgSurfaceVariant
},
contentDescription = null
)

Expand All @@ -124,7 +134,11 @@ fun MnemonicConfirmationScreen(
.size(Dimens.x3)
.padding(vertical = Dimens.x1_2),
painter = painterResource(R.drawable.ic_circle_unchecked),
tint = if (mnemonicConfirmationState.confirmationStep > 3) { MaterialTheme.customColors.accentPrimary } else { MaterialTheme.customColors.bgSurfaceVariant },
tint = if (mnemonicConfirmationState.confirmationStep > 3) {
MaterialTheme.customColors.accentPrimary
} else {
MaterialTheme.customColors.bgSurfaceVariant
},
contentDescription = null
)
}
Expand Down Expand Up @@ -171,7 +185,6 @@ fun PreviewMnemonicConfirmationScreen() {
0,
listOf("First", "Second", "Thrird"),
0
),
{}
)
)
) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ class LiquidityAddFragment : SoraBaseFragment<LiquidityAddViewModel>() {
val state = viewModel.addState.collectAsStateWithLifecycle()
if (state.value.hintVisible) {
AlertDialog(
backgroundColor = MaterialTheme.customColors.bgPage,
title = {
Text(
text = stringResource(id = R.string.common_supply),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ class LiquidityRemoveFragment : SoraBaseFragment<LiquidityRemoveViewModel>() {
}
if (viewModel.removeState.hintVisible) {
AlertDialog(
backgroundColor = MaterialTheme.customColors.bgPage,
title = {
Text(
text = stringResource(id = R.string.remove_liquidity_title),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ fun RemoveNodeAlertDialog(
onRemoveConfirmed: () -> Unit
) {
AlertDialog(
backgroundColor = MaterialTheme.customColors.bgPage,
title = {
Text(text = stringResource(R.string.remove_node_title))
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ fun SwitchNodeAlert(
onSwitchConfirmed: () -> Unit
) {
AlertDialog(
backgroundColor = MaterialTheme.customColors.bgPage,
title = {
Text(text = stringResource(R.string.select_node_switch_alert_title))
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.material.AlertDialog
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
Expand All @@ -60,6 +61,7 @@ import jp.co.soramitsu.ui_core.component.button.TextButton
import jp.co.soramitsu.ui_core.component.button.properties.Order
import jp.co.soramitsu.ui_core.component.button.properties.Size
import jp.co.soramitsu.ui_core.resources.Dimens
import jp.co.soramitsu.ui_core.theme.customColors

@AndroidEntryPoint
class SoraCardDetailsFragment : SoraBaseFragment<SoraCardDetailsViewModel>() {
Expand Down Expand Up @@ -97,6 +99,7 @@ class SoraCardDetailsFragment : SoraBaseFragment<SoraCardDetailsViewModel>() {
)
if (state.value.logoutDialog) {
AlertDialog(
backgroundColor = MaterialTheme.customColors.bgPage,
onDismissRequest = viewModel::onLogoutDismiss,
buttons = {
Row(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import android.Manifest
import android.os.Build
import android.os.Bundle
import android.view.View
import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.foundation.Image
import androidx.compose.foundation.ScrollState
import androidx.compose.foundation.layout.Box
Expand Down Expand Up @@ -64,7 +63,7 @@ class ClaimFragment : SoraBaseFragment<ClaimViewModel>() {

override val viewModel: ClaimViewModel by viewModels()

@OptIn(ExperimentalUnitApi::class, ExperimentalAnimationApi::class)
@OptIn(ExperimentalUnitApi::class)
override fun NavGraphBuilder.content(
scrollState: ScrollState,
navController: NavHostController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.AlertDialog
import androidx.compose.material.Divider
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
Expand All @@ -53,6 +54,7 @@ import jp.co.soramitsu.ui_core.component.button.TonalButton
import jp.co.soramitsu.ui_core.component.button.properties.Order
import jp.co.soramitsu.ui_core.component.button.properties.Size
import jp.co.soramitsu.ui_core.resources.Dimens
import jp.co.soramitsu.ui_core.theme.customColors

@Composable
fun ModalQrSelectionDialog(
Expand All @@ -61,6 +63,7 @@ fun ModalQrSelectionDialog(
onDismiss: () -> Unit,
) {
AlertDialog(
backgroundColor = MaterialTheme.customColors.bgPage,
onDismissRequest = onDismiss,
shape = RoundedCornerShape(Dimens.x3),
buttons = {
Expand Down

0 comments on commit b84b1fd

Please sign in to comment.