Remove unnecessary backgrounds to reduce overdraw. (#218)

This commit is contained in:
David Perez 2023-11-07 10:04:33 -06:00 committed by Álison Fernandes
parent bfab83f372
commit 7fc571bb92
16 changed files with 3 additions and 43 deletions

View file

@ -1,7 +1,6 @@
package com.x8bit.bitwarden.ui.auth.feature.createaccount package com.x8bit.bitwarden.ui.auth.feature.createaccount
import android.widget.Toast import android.widget.Toast
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable import androidx.compose.foundation.clickable
import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Arrangement
@ -194,7 +193,6 @@ fun CreateAccountScreen(
.semantics { testTagsAsResourceId = true } .semantics { testTagsAsResourceId = true }
.padding(innerPadding) .padding(innerPadding)
.fillMaxSize() .fillMaxSize()
.background(color = MaterialTheme.colorScheme.surface)
.verticalScroll(rememberScrollState()), .verticalScroll(rememberScrollState()),
) { ) {
Spacer(modifier = Modifier.height(16.dp)) Spacer(modifier = Modifier.height(16.dp))

View file

@ -1,7 +1,6 @@
package com.x8bit.bitwarden.ui.auth.feature.environment package com.x8bit.bitwarden.ui.auth.feature.environment
import android.widget.Toast import android.widget.Toast
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.WindowInsets
@ -16,7 +15,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold import androidx.compose.material3.Scaffold
import androidx.compose.material3.ScaffoldDefaults import androidx.compose.material3.ScaffoldDefaults
import androidx.compose.material3.TopAppBarDefaults import androidx.compose.material3.TopAppBarDefaults
@ -110,7 +108,6 @@ fun EnvironmentScreen(
Modifier Modifier
.padding(innerPadding) .padding(innerPadding)
.fillMaxSize() .fillMaxSize()
.background(color = MaterialTheme.colorScheme.surface)
.imePadding() .imePadding()
.verticalScroll(rememberScrollState()), .verticalScroll(rememberScrollState()),
) { ) {

View file

@ -1,7 +1,6 @@
package com.x8bit.bitwarden.ui.auth.feature.login package com.x8bit.bitwarden.ui.auth.feature.login
import android.widget.Toast import android.widget.Toast
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
@ -102,7 +101,6 @@ fun LoginScreen(
modifier = Modifier modifier = Modifier
.padding(innerPadding) .padding(innerPadding)
.fillMaxSize() .fillMaxSize()
.background(MaterialTheme.colorScheme.surface)
.verticalScroll(rememberScrollState()), .verticalScroll(rememberScrollState()),
) { ) {
BitwardenLoadingDialog( BitwardenLoadingDialog(

View file

@ -1,6 +1,5 @@
package com.x8bit.bitwarden.ui.platform.feature.settings package com.x8bit.bitwarden.ui.platform.feature.settings
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable import androidx.compose.foundation.clickable
import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Arrangement
@ -79,7 +78,6 @@ fun SettingsScreen(
modifier = Modifier modifier = Modifier
.padding(innerPadding) .padding(innerPadding)
.fillMaxSize() .fillMaxSize()
.background(color = MaterialTheme.colorScheme.surface)
.verticalScroll(state = rememberScrollState()), .verticalScroll(state = rememberScrollState()),
) { ) {
Settings.values().forEach { Settings.values().forEach {
@ -145,8 +143,7 @@ private fun SettingsRows_preview() {
Column( Column(
modifier = Modifier modifier = Modifier
.padding(16.dp) .padding(16.dp)
.fillMaxSize() .fillMaxSize(),
.background(color = MaterialTheme.colorScheme.surface),
) { ) {
Settings.values().forEach { Settings.values().forEach {
SettingsRow( SettingsRow(

View file

@ -1,7 +1,6 @@
package com.x8bit.bitwarden.ui.platform.feature.settings.about package com.x8bit.bitwarden.ui.platform.feature.settings.about
import android.widget.Toast import android.widget.Toast
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable import androidx.compose.foundation.clickable
import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Arrangement
@ -152,7 +151,6 @@ private fun ContentColum(
) { ) {
Column( Column(
modifier = modifier modifier = modifier
.background(color = MaterialTheme.colorScheme.surface)
.verticalScroll(rememberScrollState()), .verticalScroll(rememberScrollState()),
) { ) {
Spacer(modifier = Modifier.height(8.dp)) Spacer(modifier = Modifier.height(8.dp))

View file

@ -1,7 +1,6 @@
package com.x8bit.bitwarden.ui.platform.feature.settings.accountsecurity package com.x8bit.bitwarden.ui.platform.feature.settings.accountsecurity
import android.widget.Toast import android.widget.Toast
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
@ -126,7 +125,6 @@ fun AccountSecurityScreen(
Modifier Modifier
.padding(innerPadding) .padding(innerPadding)
.fillMaxSize() .fillMaxSize()
.background(color = MaterialTheme.colorScheme.surface)
.verticalScroll(rememberScrollState()), .verticalScroll(rememberScrollState()),
) { ) {
BitwardenListHeaderText( BitwardenListHeaderText(

View file

@ -1,13 +1,11 @@
package com.x8bit.bitwarden.ui.platform.feature.settings.appearance package com.x8bit.bitwarden.ui.platform.feature.settings.appearance
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold import androidx.compose.material3.Scaffold
import androidx.compose.material3.TopAppBarDefaults import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.material3.rememberTopAppBarState import androidx.compose.material3.rememberTopAppBarState
@ -58,7 +56,6 @@ fun AppearanceScreen(
Modifier Modifier
.padding(innerPadding) .padding(innerPadding)
.fillMaxSize() .fillMaxSize()
.background(color = MaterialTheme.colorScheme.surface)
.verticalScroll(rememberScrollState()), .verticalScroll(rememberScrollState()),
) { ) {
// TODO: BIT-929 Display Appearance UI // TODO: BIT-929 Display Appearance UI

View file

@ -1,7 +1,6 @@
package com.x8bit.bitwarden.ui.platform.feature.settings.autofill package com.x8bit.bitwarden.ui.platform.feature.settings.autofill
import android.widget.Toast import android.widget.Toast
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
@ -82,7 +81,6 @@ fun AutoFillScreen(
Modifier Modifier
.padding(innerPadding) .padding(innerPadding)
.fillMaxSize() .fillMaxSize()
.background(color = MaterialTheme.colorScheme.surface)
.verticalScroll(rememberScrollState()), .verticalScroll(rememberScrollState()),
) { ) {
BitwardenListHeaderText( BitwardenListHeaderText(

View file

@ -1,13 +1,11 @@
package com.x8bit.bitwarden.ui.platform.feature.settings.other package com.x8bit.bitwarden.ui.platform.feature.settings.other
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold import androidx.compose.material3.Scaffold
import androidx.compose.material3.TopAppBarDefaults import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.material3.rememberTopAppBarState import androidx.compose.material3.rememberTopAppBarState
@ -58,7 +56,6 @@ fun OtherScreen(
Modifier Modifier
.padding(innerPadding) .padding(innerPadding)
.fillMaxSize() .fillMaxSize()
.background(color = MaterialTheme.colorScheme.surface)
.verticalScroll(rememberScrollState()), .verticalScroll(rememberScrollState()),
) { ) {
// TODO: BIT-930 Display Other UI // TODO: BIT-930 Display Other UI

View file

@ -1,13 +1,11 @@
package com.x8bit.bitwarden.ui.platform.feature.settings.vault package com.x8bit.bitwarden.ui.platform.feature.settings.vault
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold import androidx.compose.material3.Scaffold
import androidx.compose.material3.TopAppBarDefaults import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.material3.rememberTopAppBarState import androidx.compose.material3.rememberTopAppBarState
@ -58,7 +56,6 @@ fun VaultScreen(
Modifier Modifier
.padding(innerPadding) .padding(innerPadding)
.fillMaxSize() .fillMaxSize()
.background(color = MaterialTheme.colorScheme.surface)
.verticalScroll(rememberScrollState()), .verticalScroll(rememberScrollState()),
) { ) {
// TODO: BIT-928 Display Vault UI // TODO: BIT-928 Display Vault UI

View file

@ -3,7 +3,6 @@
package com.x8bit.bitwarden.ui.tools.feature.generator package com.x8bit.bitwarden.ui.tools.feature.generator
import android.widget.Toast import android.widget.Toast
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Row
@ -16,7 +15,6 @@ import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.foundation.verticalScroll import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedTextField import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.Scaffold import androidx.compose.material3.Scaffold
import androidx.compose.material3.Slider import androidx.compose.material3.Slider
@ -150,7 +148,6 @@ private fun ScrollContent(
verticalArrangement = Arrangement.spacedBy(16.dp), verticalArrangement = Arrangement.spacedBy(16.dp),
modifier = modifier modifier = modifier
.fillMaxHeight() .fillMaxHeight()
.background(color = MaterialTheme.colorScheme.surface)
.verticalScroll(rememberScrollState()), .verticalScroll(rememberScrollState()),
) { ) {

View file

@ -1,6 +1,5 @@
package com.x8bit.bitwarden.ui.tools.feature.send package com.x8bit.bitwarden.ui.tools.feature.send
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.Spacer
@ -29,8 +28,7 @@ fun SendEmpty(
) { ) {
Column( Column(
modifier = Modifier modifier = Modifier
.fillMaxSize() .fillMaxSize(),
.background(color = MaterialTheme.colorScheme.surface),
verticalArrangement = Arrangement.Center, verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally, horizontalAlignment = Alignment.CenterHorizontally,
) { ) {

View file

@ -1,7 +1,6 @@
package com.x8bit.bitwarden.ui.vault.feature.vault package com.x8bit.bitwarden.ui.vault.feature.vault
import android.widget.Toast import android.widget.Toast
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
@ -102,7 +101,6 @@ fun VaultAddItemScreen(
Column( Column(
modifier = Modifier modifier = Modifier
.padding(innerPadding) .padding(innerPadding)
.background(MaterialTheme.colorScheme.surface)
.fillMaxSize() .fillMaxSize()
.verticalScroll(scrollState), .verticalScroll(scrollState),
verticalArrangement = Arrangement.spacedBy(16.dp), verticalArrangement = Arrangement.spacedBy(16.dp),

View file

@ -1,6 +1,5 @@
package com.x8bit.bitwarden.ui.vault.feature.vault package com.x8bit.bitwarden.ui.vault.feature.vault
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.PaddingValues
@ -10,7 +9,6 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
/** /**
* Content view for the [VaultScreen]. * Content view for the [VaultScreen].
@ -21,7 +19,6 @@ fun VaultContent(paddingValues: PaddingValues) {
Column( Column(
modifier = Modifier modifier = Modifier
.fillMaxSize() .fillMaxSize()
.background(Color.White)
.padding(paddingValues), .padding(paddingValues),
verticalArrangement = Arrangement.Center, verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally, horizontalAlignment = Alignment.CenterHorizontally,

View file

@ -1,13 +1,11 @@
package com.x8bit.bitwarden.ui.vault.feature.vault package com.x8bit.bitwarden.ui.vault.feature.vault
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.material3.CircularProgressIndicator import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
@ -20,7 +18,6 @@ fun VaultLoading(paddingValues: PaddingValues) {
Column( Column(
modifier = Modifier modifier = Modifier
.fillMaxSize() .fillMaxSize()
.background(MaterialTheme.colorScheme.surface)
.padding(paddingValues), .padding(paddingValues),
verticalArrangement = Arrangement.Center, verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally, horizontalAlignment = Alignment.CenterHorizontally,

View file

@ -1,6 +1,5 @@
package com.x8bit.bitwarden.ui.vault.feature.vault package com.x8bit.bitwarden.ui.vault.feature.vault
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.PaddingValues
@ -32,8 +31,7 @@ fun VaultNoItems(
Column( Column(
modifier = Modifier modifier = Modifier
.fillMaxSize() .fillMaxSize()
.padding(paddingValues) .padding(paddingValues),
.background(color = MaterialTheme.colorScheme.surface),
verticalArrangement = Arrangement.Center, verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally, horizontalAlignment = Alignment.CenterHorizontally,
) { ) {