Replace usages of raw button with BitwardenFilledTonalButton (#3960)

This commit is contained in:
David Perez 2024-09-24 16:15:24 -05:00 committed by GitHub
parent 774b828cb0
commit 3d0dd2996e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 39 deletions

View file

@ -18,8 +18,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
@ -43,6 +41,7 @@ import com.x8bit.bitwarden.R
import com.x8bit.bitwarden.ui.platform.base.util.EventsEffect
import com.x8bit.bitwarden.ui.platform.base.util.bottomDivider
import com.x8bit.bitwarden.ui.platform.components.appbar.BitwardenTopAppBar
import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledTonalButton
import com.x8bit.bitwarden.ui.platform.components.fab.BitwardenFloatingActionButton
import com.x8bit.bitwarden.ui.platform.components.scaffold.BitwardenScaffold
import com.x8bit.bitwarden.ui.platform.components.util.rememberVectorPainter
@ -247,22 +246,14 @@ private fun BlockAutoFillNoItems(
Spacer(modifier = Modifier.height(24.dp))
Button(
BitwardenFilledTonalButton(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp),
label = stringResource(id = R.string.new_blocked_uri),
onClick = addItemClickAction,
colors = ButtonDefaults.buttonColors(
containerColor = MaterialTheme.colorScheme.secondaryContainer,
contentColor = MaterialTheme.colorScheme.onSecondaryContainer,
),
) {
Text(
text = stringResource(id = R.string.new_blocked_uri),
style = MaterialTheme.typography.labelLarge,
)
}
}
}
@Composable

View file

@ -8,8 +8,6 @@ import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
@ -19,6 +17,7 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import com.x8bit.bitwarden.R
import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledTonalButton
import com.x8bit.bitwarden.ui.platform.components.text.BitwardenPolicyWarningText
/**
@ -56,21 +55,13 @@ fun SendEmpty(
Spacer(modifier = Modifier.height(24.dp))
Button(
BitwardenFilledTonalButton(
onClick = onAddItemClick,
colors = ButtonDefaults.buttonColors(
containerColor = MaterialTheme.colorScheme.secondaryContainer,
contentColor = MaterialTheme.colorScheme.onSecondaryContainer,
),
label = stringResource(id = R.string.add_a_send),
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp),
) {
Text(
text = stringResource(id = R.string.add_a_send),
style = MaterialTheme.typography.labelLarge,
)
}
Spacer(modifier = Modifier.weight(1F))
Spacer(modifier = Modifier.navigationBarsPadding())
}

View file

@ -9,8 +9,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
@ -21,6 +19,7 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import com.x8bit.bitwarden.R
import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledTonalButton
import com.x8bit.bitwarden.ui.platform.components.text.BitwardenPolicyWarningText
import com.x8bit.bitwarden.ui.platform.components.util.rememberVectorPainter
@ -72,21 +71,13 @@ fun VaultNoItems(
Spacer(modifier = Modifier.height(24.dp))
Button(
BitwardenFilledTonalButton(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp),
label = buttonText,
onClick = addItemClickAction,
colors = ButtonDefaults.buttonColors(
containerColor = MaterialTheme.colorScheme.secondaryContainer,
contentColor = MaterialTheme.colorScheme.onSecondaryContainer,
),
) {
Text(
text = buttonText,
style = MaterialTheme.typography.labelLarge,
)
}
Spacer(modifier = Modifier.weight(1F))
Spacer(modifier = Modifier.navigationBarsPadding())