Skip to content

Commit a62979d

Browse files
committed
chore: remove haze
1 parent e83f1c8 commit a62979d

File tree

1 file changed

+11
-35
lines changed
  • app/src/main/java/to/bitkit/ui/components

1 file changed

+11
-35
lines changed

app/src/main/java/to/bitkit/ui/components/TabBar.kt

Lines changed: 11 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import androidx.compose.material.icons.Icons
2020
import androidx.compose.material.icons.filled.ArrowDownward
2121
import androidx.compose.material.icons.filled.ArrowUpward
2222
import androidx.compose.material3.Icon
23+
import androidx.compose.material3.MaterialTheme
2324
import androidx.compose.runtime.Composable
2425
import androidx.compose.ui.Alignment
2526
import androidx.compose.ui.Modifier
@@ -38,11 +39,11 @@ import dev.chrisbanes.haze.materials.CupertinoMaterials
3839
import dev.chrisbanes.haze.materials.ExperimentalHazeMaterialsApi
3940
import dev.chrisbanes.haze.rememberHazeState
4041
import to.bitkit.R
42+
import to.bitkit.ui.shared.util.gradientBackground
43+
import to.bitkit.ui.shared.util.primaryButtonStyle
4144
import to.bitkit.ui.theme.AppThemeSurface
4245
import to.bitkit.ui.theme.Colors
4346

44-
private val buttonBg = Color(40, 40, 40).copy(alpha = 0.95f)
45-
private val buttonBgOverlay = Brush.verticalGradient(colors = listOf(buttonBg, Color.Transparent))
4647

4748
private val iconToTextGap = 4.dp
4849
private val iconSize = 20.dp
@@ -64,37 +65,23 @@ fun BoxScope.TabBar(
6465
modifier = modifier
6566
.align(Alignment.BottomCenter)
6667
.fillMaxWidth()
67-
.background(
68-
Brush.verticalGradient(
69-
colorStops = arrayOf(
70-
0.0f to Color.Transparent,
71-
0.5f to Colors.Black,
72-
),
73-
)
74-
)
7568
.padding(horizontal = 16.dp)
7669
.padding(bottom = 16.dp)
7770
.navigationBarsPadding()
7871
) {
79-
Row {
80-
val buttonMaterial = CupertinoMaterials.ultraThin(containerColor = buttonBg)
72+
Row(
73+
modifier = Modifier.primaryButtonStyle(
74+
isEnabled = true,
75+
shape = MaterialTheme.shapes.large,
76+
)
77+
) {
8178
// Send Button
8279
Box(
8380
contentAlignment = Alignment.Center,
8481
modifier = Modifier
8582
.weight(1f)
8683
.height(60.dp)
8784
.clip(buttonLeftShape)
88-
.background(buttonBg) // fallback if no haze
89-
.hazeEffect(
90-
state = hazeState,
91-
style = buttonMaterial,
92-
)
93-
.background(
94-
Brush.verticalGradient(
95-
colors = listOf(buttonBg, Color.Transparent),
96-
)
97-
)
9885
.clickable { onSendClick() }
9986
.testTag("Send")
10087
) {
@@ -116,12 +103,6 @@ fun BoxScope.TabBar(
116103
.weight(1f)
117104
.height(60.dp)
118105
.clip(buttonRightShape)
119-
.background(buttonBg) // fallback if no haze
120-
.hazeEffect(
121-
state = hazeState,
122-
style = buttonMaterial,
123-
)
124-
.background(buttonBgOverlay)
125106
.clickable { onReceiveClick() }
126107
.testTag("Receive")
127108
) {
@@ -146,11 +127,6 @@ fun BoxScope.TabBar(
146127
modifier = Modifier
147128
.size(80.dp)
148129
.clip(CircleShape)
149-
.background(buttonBg) // fallback if no haze
150-
.hazeEffect(
151-
state = hazeState,
152-
style = CupertinoMaterials.regular(containerColor = buttonBg),
153-
)
154130
.background(
155131
Brush.verticalGradient(colors = listOf(Colors.White10, Color.Transparent))
156132
)
@@ -164,7 +140,6 @@ fun BoxScope.TabBar(
164140
modifier = Modifier
165141
.size(76.dp)
166142
.clip(CircleShape)
167-
.background(buttonBg) // fallback if no haze
168143
.hazeEffect(
169144
state = hazeState,
170145
style = CupertinoMaterials.regular(containerColor = Color.Transparent),
@@ -190,7 +165,8 @@ private fun Preview() {
190165
contentAlignment = Alignment.BottomCenter,
191166
modifier = Modifier
192167
.fillMaxSize()
193-
.background(Colors.Brand)
168+
.background(Colors.Black)
169+
.gradientBackground()
194170
) {
195171
// Content Behind
196172
Column(

0 commit comments

Comments
 (0)