Skip to content

Commit

Permalink
Add error and empty states.
Browse files Browse the repository at this point in the history
  • Loading branch information
ychescale9 committed Dec 13, 2023
1 parent b02b09e commit 2441480
Show file tree
Hide file tree
Showing 10 changed files with 615 additions and 598 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package io.github.reactivecircus.kstreamlined.android.designsystem.component

import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.semantics.Role
import androidx.compose.ui.semantics.role
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.PreviewLightDark
import androidx.compose.ui.unit.dp
import io.github.reactivecircus.kstreamlined.android.designsystem.foundation.KSTheme

@Composable
public fun Button(
text: String,
onClick: () -> Unit,
modifier: Modifier = Modifier,
enabled: Boolean = true,
color: Color = KSTheme.colorScheme.container,
contentColor: Color = KSTheme.colorScheme.primary,
) {
Surface(
onClick = onClick,
modifier = modifier.semantics { role = Role.Button },
enabled = enabled,
shape = CircleShape,
color = color,
contentColor = contentColor,
) {
Row(
modifier = Modifier.padding(
vertical = 12.dp,
horizontal = 16.dp,
),
verticalAlignment = Alignment.CenterVertically,
) {
Text(
text = text.uppercase(),
style = KSTheme.typography.labelLarge.copy(
fontWeight = FontWeight.ExtraBold
),
)
}
}
}

@Composable
@PreviewLightDark
private fun PreviewButton() {
KSTheme {
Surface {
Button(
text = "Button",
onClick = {},
modifier = Modifier.padding(8.dp),
)
}
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="534dp" android:height="534dp" android:viewportWidth="534" android:viewportHeight="534">
<group>
<clip-path android:pathData="M0 0h534v534H0z"/>
<path android:pathData="M422.53 1c6.08 2.44 12.11 4.22 17.22 7.45 10.81 6.83 16.8 17.12 19.28 29.66 4.43 22.44 9.12 44.83 13.64 67.25 4.49 22.27 8.85 44.57 13.36 66.84 4.81 23.7 9.76 47.37 14.58 71.06 1.57 7.69 4 15.4 4.16 23.14 0.33 16.14-7.93 32.68-26.27 39.59-2.27 0.85-4.59 1.57-7.07 2.42 6.17 54.17 12.31 108.25 18.5 162.65 8.2-0.63 14.65 1.18 20.49 6.62 11.41 10.65 5.81 32.37-8.93 35.6-9.53 2.09-19.05 3.06-28.3 0.2-15.87-4.9-24.37-17.85-26.19-33.56-1.63-14.02-3.34-28.03-4.9-42.06-1.13-10.13-1.97-20.29-3.13-30.42-1.16-10.1-2.62-20.16-3.84-30.25-0.8-6.69-1.37-13.42-2.14-20.11-1.27-11.09-2.64-22.16-3.88-33.25-0.24-2.11-0.04-4.26-0.04-6.96-6.5 1.15-12.42 2.11-18.29 3.27-4 0.78-7.93 2.53-11.91 2.61-4.36 0.09-5.68 2.87-6.97 5.78-5.61 12.68-7.46 25.72-6.2 39.77 2.15 24.02 9.21 46.61 18.57 68.41 9.1 21.21 20.04 41.63 30.29 62.34 3.78 7.65 5.11 15.35 0.72 23.03-4.24 7.41-10.71 11.21-19.57 10.98-9.99-0.26-19.99 0.04-29.99-0.1-5.3-0.08-10.77 0.16-15.84-1.09-8.17-2.01-13.83-10.62-13.88-19.33-0.06-10.13 4.79-17.75 13.49-20.62 3.06-1.01 6.36-1.31 10.36-1.78 7.14 0.45 13.47 0.75 21.25 1.11-1.62-2.36-2.02-3.59-2.83-4.01-6.34-3.31-12.72-6.56-19.2-9.57-1.1-0.51-2.77 0.22-4.18 0.38-6.94-16.72-14.79-33.13-20.57-50.25-4.99-14.78-8.62-30.21-11.02-45.63-2.35-15.13-2.69-30.62 0.65-45.86 0.13-0.6-0.12-1.29-0.34-3.44-2.31 1.98-4.19 3.1-5.42 4.72-11.23 14.81-18.26 31.59-19.87 49.98-1 11.42-0.65 23.37 1.56 34.59 5.58 28.35 12.58 56.41 18.94 84.59 3.03 13.41-7.31 26.23-21.03 26.25-9.49 0.01-18.99 0-28.48 0-4.37 0-8.78 0.39-13.1-0.05-11.79-1.23-18.9-12.13-18.05-22.63 0.95-11.87 9.39-19.74 21.36-20.3 3.15-0.15 6.33-0.03 10.24 0.23 6.85 0.27 12.96 0.27 19.06 0.27 0.16-0.58 0.31-1.16 0.46-1.75-6.9-4.21-13.55-8.9-22.11-9.76-3.06-14.04-6.54-28.01-9.05-42.14-1.99-11.13-3.57-22.44-3.95-33.72-0.64-19.16 2.36-37.95 9.32-56.88-15.81 3.13-30.9 6.11-46.26 9.16-0.08 1.42-0.22 2.88-0.22 4.34-0.01 37.83 0.02 75.66-0.06 113.49 0 3.25 0.9 5.17 3.75 7.27 9.1 6.7 10.33 16.05 7.08 25.68-3.73 11.04-16.08 15.08-25.16 13.24-16.03-3.25-25.45-12.62-28.99-28.29-0.43-1.91-0.6-3.91-0.6-5.87-0.04-38.16-0.03-76.33-0.03-114.49v-5.9c-3.27 0.41-5.97 0.98-8.69 1.06-20.08 0.6-38.91-11.07-43.36-34.86-4.09-21.85-8.53-43.63-12.99-65.4-5.16-25.13-10.62-50.19-15.74-75.33-4.56-22.43-8.82-44.92-13.24-67.37-1.23-6.25-3.22-12.44-3.68-18.74-0.78-10.76 2-20.87 8.6-29.58 8.02-10.58 18.51-16.63 32-17.81 8.93-0.79 17.09 0.77 25.06 4.57 27.11 12.94 54.27 25.78 81.41 38.65 10.97 5.2 22.03 10.23 32.89 15.65 8.09 4.03 16.21 0.86 21.16-5.33 6.29-7.86 13.47-15.01 20.19-22.53 13.07-14.67 26.05-29.4 39.12-44.07 6.5-7.28 13.03-14.53 19.67-21.66 3.92-4.2 7.59-8.92 12.29-12.02 5.47-3.6 11.93-5.7 18.14-8.79C411.36 1 416.71 1 422.53 1zM153.28 314.04c5.5 19.1 19.75 27.97 39.12 23.98 31.93-6.57 63.81-13.33 95.7-20.05 48.5-10.23 97.02-20.38 145.47-30.81 17.42-3.75 27.55-20.02 24.03-37.35-7.58-37.31-15.11-74.64-22.67-111.96-3.83-18.91-20.17-29.51-39.05-25.52-79.85 16.88-159.7 33.74-239.56 50.55-19.16 4.03-29.59 19.74-25.71 38.84 7.55 37.16 15.01 74.34 22.67 112.32z" android:fillColor="#7F52FF"/>
<path android:pathData="M68.9 392.9c7.25-10.94 17.45-17.51 30.24-19.86 27.03-4.97 47.83 10.25 56.8 34.23 4.97 13.29 7.35 27.15 6.99 41.33-0.35 13.52-1.28 27.03-2.36 41.01-2.16 1.97-3.98 3.39-5.64 4.99-15.45 14.86-33.62 21.99-55.17 19.42-26.21-3.12-44.44-17.25-55.09-41.03-4-8.93-5.9-18.63-5.29-28.55 0.32-5.11 1.07-10.18 1.62-15.27 6.43-0.48 12.85-0.97 19.82-1.49-2.2-9.56 0.57-19.57 5.09-29.42 10.9 10.18 21.19 20.36 31.43 30.59 11.04 11.01 9.16 11.17 20.1 0.18 1.57-1.58 3.19-3.11 5.6-5.45 0 17.78-0.04 34.21 0.04 50.65 0.01 1.94 0.44 3.93 1.02 5.79 0.23 0.7 1.57 1.63 2.19 1.5 0.96-0.22 2.1-1.09 2.52-1.98 0.46-0.97 0.21-2.28 0.21-3.44 0.01-19.31 0.04-38.62-0.05-57.92-0.01-1.66-0.78-3.31-1.2-4.97-1.88 0.72-4.22 0.97-5.56 2.25-4.92 4.68-9.5 9.71-14.44 14.83-11.74-11.74-22.89-22.93-34.11-34.04-1.36-1.34-3.16-2.24-4.76-3.35z" android:fillColor="#FD2857"/>
<path android:pathData="M40.62 429.11c-0.17 5.15-0.92 10.22-1.24 15.33-0.61 9.92 1.29 19.62 5.29 28.55 10.65 23.78 28.88 37.91 55.09 41.03 21.55 2.57 39.72-4.56 55.17-19.42 1.66-1.6 3.48-3.02 5.57-4.56-0.62 6.35-1.57 12.73-2.95 19.55-2.31 1.42-4.28 2.27-6.04 3.44-17.02 11.28-35.82 16.04-55.83 12.73-31.16-5.16-52.5-22.96-63.86-52.69-4.86-12.71-3.63-25.83-3.82-38.9 4.08-1.71 8.16-3.42 12.62-5.06z" android:fillColor="#F82655"/>
<path android:pathData="M27.65 434.2c0.54 13.04-0.69 26.16 4.17 38.87 11.36 29.73 32.7 47.53 63.86 52.69 20.01 3.31 38.81-1.45 55.83-12.73 1.76-1.17 3.73-2.02 5.97-3.02-0.7 4.88-1.76 9.77-2.83 14.71-27.44 5.02-54.83 9.06-83.27 5.85-1.7-1.24-2.81-2.23-4.09-2.89-11.66-6.04-21.82-14.08-29.97-24.28-14.07-17.62-20.59-37.98-20.36-60.51 3.45-2.89 6.9-5.77 10.69-8.69z" android:fillColor="#F32453"/>
<path android:pathData="M16.65 443.03c0.08 22.39 6.6 42.75 20.67 60.37 8.15 10.2 18.31 18.24 29.97 24.28 1.28 0.66 2.39 1.65 3.64 2.82-9.37-1.55-18.8-3.43-28.63-5.82-1.06-1.44-1.6-2.51-2.43-3.27-16.67-15.3-27.2-34-31.4-56.27-0.29-1.5-1.7-2.79-2.59-4.18 1.76-6.94 5.24-12.88 10.77-17.93z" android:fillColor="#EA2150"/>
<path android:pathData="M68.6 393.06c1.9 0.95 3.7 1.85 5.06 3.19 11.22 11.11 22.37 22.3 34.11 34.04 4.94-5.12 9.52-10.15 14.44-14.83 1.34-1.28 3.68-1.53 5.56-2.25 0.42 1.66 1.19 3.31 1.2 4.97 0.09 19.3 0.06 38.61 0.05 57.92 0 1.16 0.25 2.47-0.21 3.44-0.42 0.89-1.56 1.76-2.52 1.98-0.62 0.13-1.96-0.8-2.19-1.5-0.58-1.86-1.01-3.85-1.02-5.79-0.08-16.44-0.04-32.87-0.04-50.65-2.41 2.34-4.03 3.87-5.6 5.45-10.94 10.99-9.06 10.83-20.1-0.18-10.24-10.23-20.53-20.41-31.11-30.76 0.49-1.72 1.28-3.3 2.37-5.03z" android:fillColor="#CF0C3F"/>
<path android:pathData="M5.55 461.17c1.22 1.18 2.63 2.47 2.92 3.97 4.2 22.27 14.73 40.97 31.4 56.27 0.83 0.76 1.37 1.83 2.08 3.09-19.01-5.6-32.41-17.32-37.7-37.05-2.34-8.71-1.35-17.45 1.3-26.28z" android:fillColor="#DD1D4C"/>
<path android:pathData="M374.94 478.42c1.36-0.53 3.03-1.26 4.13-0.75 6.48 3.01 12.86 6.26 19.2 9.57 0.81 0.42 1.21 1.65 2.83 4.01-7.78-0.36-14.11-0.66-20.82-1.13-2.02-3.89-3.66-7.6-5.34-11.7zm-87.82 0.97c8.61 0.48 15.26 5.17 22.16 9.38-0.15 0.59-0.3 1.17-0.46 1.75-6.1 0-12.21 0-18.6-0.31-1.24-3.68-2.2-7.06-3.1-10.82z" android:fillColor="#784CF8"/>
<path android:pathData="M153.19 313.63c-7.57-37.57-15.03-74.75-22.58-111.91-3.88-19.1 6.55-34.81 25.71-38.84 79.86-16.81 159.71-33.67 239.56-50.55 18.88-3.99 35.22 6.61 39.05 25.52 7.56 37.32 15.09 74.65 22.67 111.96 3.52 17.33-6.61 33.6-24.03 37.35-48.45 10.43-96.97 20.58-145.47 30.81-31.89 6.72-63.78 13.48-95.7 20.05-19.37 3.99-33.62-4.88-39.21-24.39zm240.58-64.18s-0.05-0.47 0.34-1.08c11.32-20.02 11.43-40.23-0.86-59.54-12.35-19.38-30.9-27.69-53.77-25.74-29.77 2.54-53.15 31.26-49.99 60.92 2.03 19.17 11.37 33.7 27.42 44.77-1.59 6.26 0.45 10.55 6.39 12.47 24.57 7.94 52 3.49 70.57-18.55 3.74-4.44 3.72-7.99-0.1-13.25zm-226.64 27.46c-3.49 4.06-3.93 7.8-0.91 11.55 1.86 2.31 4.02 4.53 6.47 6.17 2.73 1.83 3.47 4 3.37 7.1-0.19 5.81-0.22 11.65 0.04 17.45 0.29 6.65 4.91 10.91 11.22 10.81 6.28-0.09 10.58-4.54 10.75-11.25 0.08-3.11 0.02-6.23 0.02-9.45 1.23 0 1.9-0.13 2.51 0.02 21.33 5.28 40.02-0.6 56.95-13.59 6.46-4.95 7.12-8.86 3.41-16.52 13.75-19.58 14.84-44.08 2.8-63.35-12.55-20.1-34.76-29.86-58.8-25.83-38.42 6.43-58.96 53.68-37.17 85.75 0.02 0.35 0.04 0.69-0.66 1.14zm134.56 4.04c0.4 1.96 0.42 4.11 1.31 5.81 0.7 1.34 2.47 2.12 3.76 3.15 1.02-1.48 3.03-3.07 2.88-4.42-0.5-4.43-1.43-8.89-2.84-13.12-2.93-8.75-12.24-13.89-21.51-12.28-9.01 1.56-15.67 9.33-15.38 18.71 0.14 4.6 1.02 9.27 2.25 13.72 0.44 1.63 2.84 2.73 4.35 4.07 0.82-1.75 2.39-3.54 2.3-5.24-0.21-3.78-1.56-7.49-1.9-11.27-0.58-6.4 3.36-11.66 9.26-12.99 6.04-1.36 12 2.06 14.16 8.23 0.55 1.56 0.77 3.23 1.36 5.63zm4.95-125.71c-9.84 5.46-14.41 4.95-22.14-2.61-2.77-2.72-5.77-3.47-8.82-0.83-3.19 2.76-2.97 6.03-0.54 9.29 8.06 10.81 23.36 13.27 36.39 5.94 3.25-1.83 5.35-4.27 4.15-8.03-1.27-3.98-4.37-5.16-9.04-3.76zm-54.52 3.01c-4.66 9.81-11.81 15.15-23.26 13.76-3.39-0.41-5.58 2.23-5.78 5.59-0.22 3.56 1.59 5.86 5.33 6.61 13.26 2.62 27.89-4.84 33-17.46 0.94-2.3 0.73-6.4-0.76-7.97-1.4-1.48-5.17-0.75-8.53-0.53z" android:fillColor="#010102"/>
<path android:pathData="M317.01 268.02c-16.15-10.31-25.49-24.84-27.52-44.01-3.16-29.66 20.23-58.38 49.99-60.92 22.87-1.95 41.42 6.36 53.77 25.74 12.29 19.31 12.18 39.52 0.35 59.69-6.67-2.7-9.45-1.99-14.3 2.61-3.71 3.52-7.56 7.12-11.94 9.65-12.1 6.97-25.06 6.67-38.14 3.13-5.58-1.51-8.46-0.59-11.54 4.02-0.23 0.01-0.67 0.09-0.67 0.09zm-6.55-41.4c5.53 21.21 25.11 33 45.3 27.27 18.47-5.24 29.64-24.53 25.1-43.36-4.41-18.25-22.92-29.94-41.43-26.84-15.36 2.57-32.85 18.19-28.97 42.93z" android:fillColor="#FCFCFC"/>
<path android:pathData="M167.89 275.27c-21.89-31.57-1.35-78.82 37.07-85.25 24.04-4.03 46.25 5.73 58.8 25.83 12.04 19.27 10.95 43.77-3.12 63.64-0.31 0.28-0.69 0.34-0.93 0.05-4.65-2.59-8.67-2.19-12.72 0.9-23.28 17.73-45.08 16.64-66.27-3.35-4.04-3.81-8.2-3.7-12.83-1.82zm64.72-61.52c-15.5-7.72-32.51-4.79-43.69 7.51-10.93 12.01-12.47 29.67-3.8 43.43 8.64 13.7 25.41 20.2 40.87 15.25 15.08-4.84 23.92-15.52 25.42-31.26 1.44-15.15-5.27-26.65-18.8-34.93z" android:fillColor="#FBFBFB"/>
<path android:pathData="M259.95 279.83s0.38-0.06 0.57-0.02c4.15 7.05 3.49 10.95-2.97 15.91-16.93 12.98-35.62 18.87-56.95 13.59-0.61-0.15-1.28-0.02-2.51-0.02 0 3.22 0.06 6.34-0.02 9.45-0.17 6.71-4.47 11.16-10.75 11.25-6.31 0.1-10.93-4.16-11.22-10.81-0.26-5.8-0.23-11.64-0.04-17.45 0.1-3.1-0.64-5.27-3.37-7.1-2.45-1.64-4.61-3.86-6.47-6.17-3.02-3.75-2.58-7.49 1.61-11.48 10.63 13.76 23.7 22.63 40.66 24.46 20.94 2.25 38.48-4.45 51.46-21.61zm-82.91 31.74c0.05 2.15-0.15 4.35 0.2 6.45 0.62 3.81 2.4 6.49 6.95 6.05 4.23-0.4 5.53-3.16 5.73-6.8 0.15-2.64 0.05-5.31 0.03-7.96-0.04-5.43-2.61-9.11-6.37-9.17-3.73-0.07-6.39 3.61-6.53 9.02-0.02 0.5-0.01 1-0.01 2.41z" android:fillColor="#02547F"/>
<path android:pathData="M259.71 279.54c-12.74 17.45-30.28 24.15-51.22 21.9-16.96-1.83-30.03-10.7-40.3-24.52-0.36-0.46-0.38-0.8-0.35-1.4 4.68-2.13 8.84-2.24 12.88 1.57 21.19 19.99 42.99 21.08 66.27 3.35 4.05-3.09 8.07-3.49 12.72-0.9z" android:fillColor="#80D2FD"/>
<path android:pathData="M316.96 268.4c0.05-0.38 0.49-0.46 0.92-0.18 16.33 8.95 32.67 9.77 49.51 3.2 11.12-4.34 19.13-12.38 26.31-21.49 3.89 4.78 3.91 8.33 0.17 12.77-18.57 22.04-46 26.49-70.57 18.55-5.94-1.92-7.98-6.21-6.34-12.85z" android:fillColor="#02547F"/>
<path android:pathData="M393.74 249.69c-7.22 9.35-15.23 17.39-26.35 21.73-16.84 6.57-33.18 5.75-49.28-3.21 2.65-4.89 5.53-5.81 11.11-4.3 13.08 3.54 26.04 3.84 38.14-3.13 4.38-2.53 8.23-6.13 11.94-9.65 4.85-4.59 7.63-5.31 14.1-2.31 0.32 0.16 0.37 0.63 0.34 0.87z" android:fillColor="#80D1FD"/>
<path android:pathData="M301.58 280.56c-0.48-2.01-0.7-3.68-1.24-5.24-2.17-6.17-8.13-9.59-14.17-8.23-5.9 1.33-9.84 6.59-9.26 12.99 0.34 3.78 1.69 7.49 1.9 11.27 0.09 1.7-1.48 3.49-2.3 5.24-1.51-1.34-3.91-2.44-4.35-4.07-1.23-4.45-2.11-9.12-2.25-13.72-0.29-9.38 6.37-17.15 15.38-18.71 9.27-1.61 18.58 3.53 21.51 12.28 1.41 4.23 2.34 8.69 2.84 13.12 0.15 1.35-1.86 2.94-2.88 4.42-1.29-1.03-3.06-1.81-3.76-3.15-0.89-1.7-0.91-3.85-1.42-6.2z" android:fillColor="#F5F5F5"/>
<path android:pathData="M306.98 155.11c4.33-1.27 7.43-0.09 8.7 3.89 1.2 3.76-0.9 6.2-4.15 8.03-13.03 7.33-28.33 4.87-36.39-5.94-2.43-3.26-2.65-6.53 0.54-9.29 3.05-2.64 6.05-1.89 8.82 0.83 7.73 7.56 12.3 8.07 22.48 2.48z" android:fillColor="#F8F8F8"/>
<path android:pathData="M252.44 158.02c3.04 0.01 6.81-0.72 8.21 0.76 1.49 1.57 1.7 5.67 0.76 7.97-5.11 12.62-19.74 20.08-33 17.46-3.74-0.75-5.55-3.05-5.33-6.61 0.2-3.36 2.39-6 5.78-5.59 11.45 1.39 18.6-3.95 23.58-13.99z" android:fillColor="#F9F9F9"/>
<path android:pathData="M310.35 226.2c-3.77-24.32 13.72-39.94 29.08-42.51 18.51-3.1 37.02 8.59 41.43 26.84 4.54 18.83-6.63 38.12-25.1 43.36-20.19 5.73-39.77-6.06-45.41-27.69z" android:fillColor="#020202"/>
<path android:pathData="M232.95 213.9c13.19 8.13 19.9 19.63 18.46 34.78-1.5 15.74-10.34 26.42-25.42 31.26-15.46 4.95-32.23-1.55-40.87-15.25-8.67-13.76-7.13-31.42 3.8-43.43 11.18-12.3 28.19-15.23 44.03-7.36z" android:fillColor="#010101"/>
<path android:pathData="M177.04 311.11c0-0.95-0.01-1.45 0.01-1.95 0.14-5.41 2.8-9.08 6.53-9.02 3.76 0.06 6.33 3.74 6.37 9.17 0.02 2.65 0.12 5.32-0.03 7.96-0.2 3.64-1.5 6.4-5.73 6.8-4.55 0.44-6.33-2.24-6.95-6.05-0.35-2.1-0.15-4.3-0.2-6.91z" android:fillColor="#4B86A5"/>
</group>
</vector>
3 changes: 3 additions & 0 deletions android/feature/home/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
<string name="title_home">KStreamlined</string>
<string name="feeds_selected">%1$d Feeds selected</string>
<string name="sync">Sync</string>

<string name="error_message_network">Looks like you\'re offline.</string>
<string name="error_message_server">Something went wrong. Please try again later.</string>
</resources>
Loading

0 comments on commit 2441480

Please sign in to comment.