123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- package com.vpn.fastestvpnservice.customItems
- import androidx.compose.foundation.background
- import androidx.compose.foundation.layout.Box
- import androidx.compose.foundation.layout.Column
- import androidx.compose.foundation.layout.fillMaxSize
- import androidx.compose.foundation.layout.fillMaxWidth
- import androidx.compose.foundation.layout.padding
- import androidx.compose.material.Text
- import androidx.compose.material3.MaterialTheme
- import androidx.compose.runtime.Composable
- import androidx.compose.ui.Alignment
- import androidx.compose.ui.Modifier
- import androidx.compose.ui.res.colorResource
- import androidx.compose.ui.text.TextStyle
- import androidx.compose.ui.text.style.TextAlign
- import androidx.compose.ui.tooling.preview.Preview
- import androidx.compose.ui.unit.dp
- import androidx.compose.ui.unit.sp
- import com.vpn.fastestvpnservice.R
- import com.vpn.fastestvpnservice.beans.Notification
- @Composable
- fun NotificationItem(item: Notification) {
- Box(modifier = Modifier
- .background(MaterialTheme.colorScheme.background)
- .fillMaxWidth()
- ) {
- Column(
-
- ) {
- Text(
- text = item.title,
- color = MaterialTheme.colorScheme.primary,
- style = MaterialTheme.typography.labelMedium,
- textAlign = TextAlign.Start,
- modifier = Modifier
- .padding(start = 16.dp, bottom = 5.dp)
- .fillMaxWidth(),
- maxLines = 2
- )
- Text(
- text = item.html,
- color = MaterialTheme.colorScheme.primary,
- style = MaterialTheme.typography.labelMedium,
- textAlign = TextAlign.Start,
- modifier = Modifier
- .padding(start = 16.dp, bottom = 0.dp)
- .fillMaxWidth(),
- maxLines = 2
- )
- }
- }
- }
- @Preview
- @Composable
- fun NotificationItemPreview() {
- NotificationItem(Notification("0", "Title", "Description"))
- }
|