Skip to content

Commit

Permalink
Update NewFeatureDialogBox
Browse files Browse the repository at this point in the history
  • Loading branch information
sakethpathike committed Jun 11, 2024
1 parent afc85e2 commit 41c4a02
Showing 1 changed file with 1 addition and 114 deletions.
Original file line number Diff line number Diff line change
@@ -1,43 +1,27 @@
package com.sakethh.linkora.ui.commonComposables

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.text.InlineTextContent
import androidx.compose.foundation.text.appendInlineContent
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Info
import androidx.compose.material.icons.filled.Settings
import androidx.compose.material.icons.outlined.UnfoldMore
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Button
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.NavigationBarItem
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.mutableStateOf
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.Placeholder
import androidx.compose.ui.text.PlaceholderVerticalAlign
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.withStyle
import androidx.compose.ui.tooling.preview.PreviewLightDark
import androidx.compose.ui.tooling.preview.PreviewScreenSizes
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.datastore.preferences.core.intPreferencesKey
import com.sakethh.linkora.ui.screens.settings.composables.SettingsAppInfoComponent
import com.sakethh.linkora.ui.theme.LinkoraTheme
import com.sakethh.linkora.ui.viewmodels.SettingsScreenVM
import com.sakethh.linkora.ui.viewmodels.SettingsScreenVM.Settings.dataStore
Expand Down Expand Up @@ -73,111 +57,14 @@ fun NewFeatureDialogBox(isDialogBoxVisible: MutableState<Boolean> = mutableState
) {
Text(text = "")
Text(
text = buildAnnotatedString {
append("A new option has been added to the ")
withStyle(SpanStyle(fontWeight = FontWeight.Bold)) {
append("About")
}
append(" (")
appendInlineContent("aboutIcon")
append(") section in ")
withStyle(SpanStyle(fontWeight = FontWeight.Bold)) {
append("Settings")
}
append(" ( ")
appendInlineContent("settingsIcon")
append(" ), allowing you to easily check what's new in the current release you're using.\nTo access this feature, Tap on:")
},
inlineContent = mapOf(
Pair("aboutIcon", InlineTextContent(
Placeholder(
22.sp, 22.sp, PlaceholderVerticalAlign.TextCenter
)
) {
Icon(
imageVector = Icons.Default.Info,
contentDescription = null
)
}),
Pair("settingsIcon", InlineTextContent(
Placeholder(
22.sp, 22.sp, PlaceholderVerticalAlign.TextCenter
)
) {
NavigationBarItem(selected = true, onClick = { }, icon = {
Icon(
imageVector = Icons.Default.Settings,
contentDescription = null
)
})
}),
),
text = "A new option in Settings lets you use any user agent, helping detect images and titles from web pages using meta tags.\nTo set up custom user agents, go to Settings > General > User Agent.",
style = MaterialTheme.typography.titleSmall,
fontSize = 18.sp,
lineHeight = 28.sp,
textAlign = TextAlign.Start,
modifier = Modifier.padding(end = 10.dp)
)
}
SettingsAppInfoComponent(paddingValues = PaddingValues(
start = 20.dp, end = 20.dp, top = 10.dp
),
hasDescription = false,
description = "",
icon = Icons.Outlined.UnfoldMore,
title = "What's New",
onClick = {})
Text(
text = buildAnnotatedString {
append("in ")
withStyle(SpanStyle(fontWeight = FontWeight.Bold)) {
append("About")
}
append(".")
},
style = MaterialTheme.typography.titleMedium,
fontSize = 18.sp,
lineHeight = 24.sp,
textAlign = TextAlign.Start,
modifier = Modifier.padding(start = 20.dp, top = 10.dp)
)

Row(
modifier = Modifier
.fillMaxWidth()
.wrapContentHeight()
.padding(
start = 10.dp, end = 10.dp, top = 20.dp
)
) {
Text(text = "")
Text(
text = "A few minor UI improvements have been made in the Settings Screen and the Search Screen.",
style = MaterialTheme.typography.titleSmall,
fontSize = 18.sp,
lineHeight = 24.sp,
textAlign = TextAlign.Start,
modifier = Modifier.padding(end = 10.dp)
)
}
Row(
modifier = Modifier
.fillMaxWidth()
.wrapContentHeight()
.padding(
start = 10.dp, end = 10.dp, top = 20.dp
)
) {
Text(text = "")
Text(
text = "Fixed known reported crashes.",
style = MaterialTheme.typography.titleSmall,
fontSize = 18.sp,
lineHeight = 24.sp,
textAlign = TextAlign.Start,
modifier = Modifier.padding(end = 10.dp)
)
}
}
}, confirmButton = {
Button(
Expand Down

0 comments on commit 41c4a02

Please sign in to comment.