| ... |
... |
@@ -2,6 +2,7 @@ package org.mozilla.fenix.tor |
|
2
|
2
|
|
|
3
|
3
|
import androidx.compose.foundation.Image
|
|
4
|
4
|
import androidx.compose.foundation.layout.Column
|
|
|
5
|
+import androidx.compose.foundation.layout.PaddingValues
|
|
5
|
6
|
import androidx.compose.foundation.layout.Row
|
|
6
|
7
|
import androidx.compose.foundation.layout.Spacer
|
|
7
|
8
|
import androidx.compose.foundation.layout.fillMaxSize
|
| ... |
... |
@@ -20,29 +21,34 @@ import androidx.compose.ui.graphics.Brush |
|
20
|
21
|
import androidx.compose.ui.graphics.Color
|
|
21
|
22
|
import androidx.compose.ui.graphics.painter.BrushPainter
|
|
22
|
23
|
import androidx.compose.ui.res.colorResource
|
|
23
|
|
-import androidx.compose.ui.res.dimensionResource
|
|
24
|
24
|
import androidx.compose.ui.res.painterResource
|
|
25
|
25
|
import androidx.compose.ui.res.stringResource
|
|
26
|
26
|
import androidx.compose.ui.text.TextStyle
|
|
27
|
27
|
import androidx.compose.ui.text.font.FontWeight
|
|
28
|
28
|
import androidx.compose.ui.text.style.TextAlign
|
|
|
29
|
+import androidx.compose.ui.tooling.preview.PreviewParameter
|
|
|
30
|
+import androidx.compose.ui.tooling.preview.PreviewParameterProvider
|
|
29
|
31
|
import androidx.compose.ui.unit.dp
|
|
30
|
32
|
import androidx.compose.ui.unit.sp
|
|
31
|
33
|
import mozilla.components.compose.base.annotation.FlexibleWindowLightDarkPreview
|
|
32
|
34
|
import org.mozilla.fenix.R
|
|
33
|
35
|
|
|
|
36
|
+class PaddingValuesParameterProvider : PreviewParameterProvider<PaddingValues> {
|
|
|
37
|
+ override val values = sequenceOf(
|
|
|
38
|
+ PaddingValues(top = 60.dp),
|
|
|
39
|
+ PaddingValues(bottom = 60.dp),
|
|
|
40
|
+ )
|
|
|
41
|
+}
|
|
|
42
|
+
|
|
34
|
43
|
@Composable
|
|
35
|
44
|
@FlexibleWindowLightDarkPreview
|
|
36
|
45
|
fun TorHomePage(
|
|
37
|
|
- toolBarAtTop: Boolean = true,
|
|
|
46
|
+ @PreviewParameter(PaddingValuesParameterProvider::class) innerPadding: PaddingValues,
|
|
38
|
47
|
) {
|
|
39
|
48
|
Column(
|
|
40
|
49
|
modifier = Modifier
|
|
41
|
50
|
.fillMaxSize()
|
|
42
|
|
- .padding(
|
|
43
|
|
- top = if (toolBarAtTop) dimensionResource(R.dimen.browser_navbar_height) else 0.dp,
|
|
44
|
|
- bottom = if (!toolBarAtTop) dimensionResource(R.dimen.browser_navbar_height) else 0.dp,
|
|
45
|
|
- )
|
|
|
51
|
+ .padding(innerPadding)
|
|
46
|
52
|
.paint(
|
|
47
|
53
|
BrushPainter(
|
|
48
|
54
|
Brush.linearGradient(
|