mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-06-28 12:36:03 +02:00
![arkon](/assets/img/avatar_default.png)
Also renaming the helper composables so it's a bit easier to find/replace everything in forks.
52 lines
1.6 KiB
Kotlin
52 lines
1.6 KiB
Kotlin
package eu.kanade.presentation.more.settings.widget
|
|
|
|
import androidx.compose.foundation.layout.Arrangement
|
|
import androidx.compose.foundation.layout.Column
|
|
import androidx.compose.foundation.layout.padding
|
|
import androidx.compose.material.icons.Icons
|
|
import androidx.compose.material.icons.outlined.Info
|
|
import androidx.compose.material3.Icon
|
|
import androidx.compose.material3.MaterialTheme
|
|
import androidx.compose.material3.Surface
|
|
import androidx.compose.material3.Text
|
|
import androidx.compose.runtime.Composable
|
|
import androidx.compose.ui.Modifier
|
|
import androidx.compose.ui.tooling.preview.PreviewLightDark
|
|
import eu.kanade.presentation.theme.TachiyomiTheme
|
|
import tachiyomi.i18n.MR
|
|
import tachiyomi.presentation.core.components.material.padding
|
|
import tachiyomi.presentation.core.i18n.stringResource
|
|
import tachiyomi.presentation.core.util.secondaryItemAlpha
|
|
|
|
@Composable
|
|
internal fun InfoWidget(text: String) {
|
|
Column(
|
|
modifier = Modifier
|
|
.padding(
|
|
horizontal = PrefsHorizontalPadding,
|
|
vertical = MaterialTheme.padding.medium,
|
|
)
|
|
.secondaryItemAlpha(),
|
|
verticalArrangement = Arrangement.spacedBy(MaterialTheme.padding.medium),
|
|
) {
|
|
Icon(
|
|
imageVector = Icons.Outlined.Info,
|
|
contentDescription = null,
|
|
)
|
|
Text(
|
|
text = text,
|
|
style = MaterialTheme.typography.bodySmall,
|
|
)
|
|
}
|
|
}
|
|
|
|
@PreviewLightDark
|
|
@Composable
|
|
private fun InfoWidgetPreview() {
|
|
TachiyomiTheme {
|
|
Surface {
|
|
InfoWidget(text = stringResource(MR.strings.download_ahead_info))
|
|
}
|
|
}
|
|
}
|