Fixed date alignment and preview
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: Balazs Toldi <balazs@toldi.eu>
This commit is contained in:
parent
d295eae730
commit
1257055704
2 changed files with 29 additions and 17 deletions
|
@ -30,6 +30,7 @@
|
||||||
<entry key="../../../../../layout/compose-model-1634049671897.xml" value="0.2777777777777778" />
|
<entry key="../../../../../layout/compose-model-1634049671897.xml" value="0.2777777777777778" />
|
||||||
<entry key="../../../../../layout/compose-model-1634139145792.xml" value="0.8684834123222749" />
|
<entry key="../../../../../layout/compose-model-1634139145792.xml" value="0.8684834123222749" />
|
||||||
<entry key="../../../../../layout/compose-model-1635019781952.xml" value="0.5435185185185185" />
|
<entry key="../../../../../layout/compose-model-1635019781952.xml" value="0.5435185185185185" />
|
||||||
|
<entry key="../../../../../layout/compose-model-1635084830227.xml" value="0.67" />
|
||||||
<entry key="app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml" value="0.21458333333333332" />
|
<entry key="app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml" value="0.21458333333333332" />
|
||||||
</map>
|
</map>
|
||||||
</option>
|
</option>
|
||||||
|
|
|
@ -29,6 +29,7 @@ import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
import androidx.compose.ui.text.style.TextOverflow
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import coil.compose.rememberImagePainter
|
import coil.compose.rememberImagePainter
|
||||||
|
@ -41,6 +42,7 @@ import eu.toldi.balazs.anotherfeedreader.ui.theme.AnotherFeedReaderTheme
|
||||||
import eu.toldi.balazs.anotherfeedreader.viewmodel.FeedViewModel
|
import eu.toldi.balazs.anotherfeedreader.viewmodel.FeedViewModel
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
import java.time.ZonedDateTime
|
||||||
import java.time.format.DateTimeFormatter
|
import java.time.format.DateTimeFormatter
|
||||||
import java.time.format.FormatStyle
|
import java.time.format.FormatStyle
|
||||||
|
|
||||||
|
@ -304,7 +306,9 @@ class MainActivity : ComponentActivity() {
|
||||||
) {
|
) {
|
||||||
Column {
|
Column {
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier.padding(horizontal = 3.dp, vertical = 6.dp),
|
modifier = Modifier
|
||||||
|
.padding(horizontal = 3.dp, vertical = 6.dp)
|
||||||
|
.fillMaxWidth(),
|
||||||
horizontalArrangement = Arrangement.Start,
|
horizontalArrangement = Arrangement.Start,
|
||||||
verticalAlignment = Alignment.CenterVertically
|
verticalAlignment = Alignment.CenterVertically
|
||||||
) {
|
) {
|
||||||
|
@ -340,18 +344,22 @@ class MainActivity : ComponentActivity() {
|
||||||
}).invoke(),
|
}).invoke(),
|
||||||
fontSize = 11.sp,
|
fontSize = 11.sp,
|
||||||
textAlign = TextAlign.Center,
|
textAlign = TextAlign.Center,
|
||||||
modifier = Modifier.padding(horizontal = 10.dp),
|
modifier = Modifier.padding(horizontal = 2.dp),
|
||||||
maxLines = 1,
|
maxLines = 1,
|
||||||
overflow = TextOverflow.Ellipsis
|
overflow = TextOverflow.Ellipsis
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
article.pubDate?.let {
|
article.pubDate?.let {
|
||||||
Text(
|
Column(
|
||||||
it.format(DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM)),
|
horizontalAlignment = Alignment.End,
|
||||||
fontSize = 11.sp,
|
modifier = Modifier.fillMaxWidth()
|
||||||
textAlign = TextAlign.Right,
|
) {
|
||||||
//modifier = Modifier.width(350.dp)
|
Text(
|
||||||
)
|
it.format(DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM)),
|
||||||
|
fontSize = 11.sp,
|
||||||
|
textAlign = TextAlign.Right,
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (article.imageURL != null) {
|
if (article.imageURL != null) {
|
||||||
|
@ -498,31 +506,34 @@ class MainActivity : ComponentActivity() {
|
||||||
|
|
||||||
}, content = content)
|
}, content = content)
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
@Preview(showBackground = true)
|
@Preview(showBackground = true)
|
||||||
@Composable
|
@Composable
|
||||||
fun DefaultPreview() {
|
fun DefaultPreview() {
|
||||||
AnotherFeedReaderTheme {
|
AnotherFeedReaderTheme {
|
||||||
Column() {
|
Column() {
|
||||||
MenuBar({})
|
MenuBar({})
|
||||||
val article = Article(null,
|
val feed = Feed("Test 1")
|
||||||
|
val article = Article(
|
||||||
|
null,
|
||||||
title = "Teszt Article",
|
title = "Teszt Article",
|
||||||
description = "Ez az cikk azért létezik, hogy kipróbájam a cikkek megjelenítését.",
|
description = "Ez az cikk azért létezik, hogy kipróbájam a cikkek megjelenítését.",
|
||||||
author = "Toldi Balázs",
|
author = "Toldi Balázs",
|
||||||
pubDate_stamp = LocalDateTime.now().toEpochSecond(ZoneOffset.UTC),
|
pubDate_stamp = ZonedDateTime.now().toEpochSecond(),
|
||||||
feed = Feed("Test 1")
|
feed = feed
|
||||||
)
|
)
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.padding(horizontal = 1.dp)
|
modifier = Modifier.padding(horizontal = 1.dp)
|
||||||
) {
|
) {
|
||||||
showArticle(article)
|
showArticle(feed, article)
|
||||||
showArticle(
|
showArticle(
|
||||||
Article(null,
|
feed,
|
||||||
|
Article(
|
||||||
|
null,
|
||||||
title = "Teszt Article #2",
|
title = "Teszt Article #2",
|
||||||
description = "Ez egy másik megjelenítést tesztelő cikk. Ebben egy nagyon hosszú szöveget akarok ábrázolni, aminek nem szabad egyben kiférnie. Legfeljebb 2 sort jeleníthet meg",
|
description = "Ez egy másik megjelenítést tesztelő cikk. Ebben egy nagyon hosszú szöveget akarok ábrázolni, aminek nem szabad egyben kiférnie. Legfeljebb 2 sort jeleníthet meg",
|
||||||
author = "Toldi Balázs",
|
author = "Toldi Balázs",
|
||||||
pubDate_stamp = LocalDateTime.now().plusDays(-1).toEpochSecond(
|
pubDate_stamp = ZonedDateTime.now().plusDays(-1).toEpochSecond(),
|
||||||
ZoneOffset.UTC),
|
|
||||||
feed = Feed("Test 1")
|
feed = Feed("Test 1")
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -530,7 +541,7 @@ class MainActivity : ComponentActivity() {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
fun openArticle(articleURL: String, feedName: String) {
|
fun openArticle(articleURL: String, feedName: String) {
|
||||||
WebView.webURL = articleURL
|
WebView.webURL = articleURL
|
||||||
WebView.barTitle = feedName
|
WebView.barTitle = feedName
|
||||||
|
|
Loading…
Reference in a new issue