Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ data class AppearanceSettings(
val colorSeed: ULong = Color.Blue.value,
val avatarShape: AvatarShape = AvatarShape.CIRCLE,
val showActions: Boolean = true,
val pureColorMode: Boolean = false,
val pureColorMode: Boolean = true,
val showNumbers: Boolean = true,
val showLinkPreview: Boolean = true,
val showMedia: Boolean = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import androidx.compose.ui.graphics.vector.ImageVector.Builder
import androidx.compose.ui.graphics.vector.path
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import compose.icons.FontAwesomeIcons
import dev.dimension.flare.R

@Composable
Expand All @@ -33,13 +34,13 @@ fun BackButton(
),
) {
FAIcon(
imageVector = arrow,
imageVector = FontAwesomeIcons.BackArrow,
contentDescription = stringResource(id = R.string.navigate_back),
)
}
}

private val arrow by lazy {
val FontAwesomeIcons.BackArrow by lazy {
Builder(
name = "Arrow",
defaultWidth = 448.0.dp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.foundation.text.input.TextFieldLineLimits
import androidx.compose.foundation.text.input.delete
import androidx.compose.foundation.text.input.rememberTextFieldState
Expand All @@ -32,6 +33,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.unit.dp
import compose.icons.FontAwesomeIcons
import compose.icons.fontawesomeicons.Solid
Expand All @@ -42,6 +44,8 @@ import dev.dimension.flare.R
import dev.dimension.flare.data.model.RssTimelineTabItem
import dev.dimension.flare.data.repository.SettingsRepository
import dev.dimension.flare.ui.component.FAIcon
import dev.dimension.flare.ui.component.NetworkImage
import dev.dimension.flare.ui.component.listCard
import dev.dimension.flare.ui.model.UiRssSource
import dev.dimension.flare.ui.model.collectAsUiState
import dev.dimension.flare.ui.model.flatMap
Expand Down Expand Up @@ -148,6 +152,11 @@ internal fun RssSourceEditSheet(
label = { Text(text = stringResource(id = R.string.rss_sources_title_label)) },
modifier = Modifier.fillMaxWidth(),
lineLimits = TextFieldLineLimits.SingleLine,
keyboardOptions =
KeyboardOptions(
imeAction = ImeAction.Done,
autoCorrectEnabled = false,
),
)
}

Expand Down Expand Up @@ -216,26 +225,37 @@ internal fun RssSourceEditSheet(
Text(text = stringResource(id = R.string.rss_sources_rss_hub_host_hint))
},
)
publicRssHubServer.forEach {
publicRssHubServer.forEachIndexed { index, it ->
ListItem(
headlineContent = {
Text(text = it)
},
modifier =
Modifier.clickable {
state.rssHubHostText.edit {
delete(0, state.rssHubHostText.text.length)
append(it)
}
},
Modifier
.listCard(
index = index,
totalCount = publicRssHubServer.size,
).clickable {
state.rssHubHostText.edit {
delete(0, state.rssHubHostText.text.length)
append(it)
}
},
)
}
}

is CheckRssSourcePresenter.State.RssState.RssSources -> {
Text(stringResource(R.string.rss_sources_discovered_rss_sources))
rssState.sources.forEach { source ->
rssState.sources.forEachIndexed { index, source ->
ListItem(
leadingContent = {
NetworkImage(
source.favIcon,
contentDescription = null,
modifier = Modifier.size(24.dp),
)
},
headlineContent = {
Text(text = source.title.orEmpty())
},
Expand All @@ -251,9 +271,13 @@ internal fun RssSourceEditSheet(
)
},
modifier =
Modifier.clickable {
state.selectSource(source)
},
Modifier
.listCard(
index = index,
totalCount = rssState.sources.size,
).clickable {
state.selectSource(source)
},
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,12 @@ internal fun RssSourcesScreen(
ListItem(
modifier =
Modifier
.clickable {
onClicked.invoke(it)
}.listCard(
.listCard(
index = index,
totalCount = itemCount,
),
).clickable {
onClicked.invoke(it)
},
headlineContent = {
it.title?.let {
Text(text = it)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.staggeredgrid.StaggeredGridCells
import androidx.compose.foundation.lazy.staggeredgrid.StaggeredGridItemSpan
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.foundation.text.input.TextFieldLineLimits
import androidx.compose.foundation.text.input.rememberTextFieldState
import androidx.compose.material3.Button
Expand Down Expand Up @@ -42,6 +43,7 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import compose.icons.FontAwesomeIcons
Expand Down Expand Up @@ -143,6 +145,11 @@ internal fun ServiceSelectScreen(
)
OutlinedTextField(
state = state.instanceInputState,
keyboardOptions =
KeyboardOptions(
imeAction = ImeAction.Done,
autoCorrectEnabled = false,
),
placeholder = {
Text(
text = stringResource(id = R.string.service_select_instance_input_placeholder),
Expand Down Expand Up @@ -236,6 +243,11 @@ internal fun ServiceSelectScreen(
Modifier
.width(300.dp),
lineLimits = TextFieldLineLimits.SingleLine,
keyboardOptions =
KeyboardOptions(
imeAction = ImeAction.Done,
autoCorrectEnabled = false,
),
)
AnimatedVisibility(state.blueskyInputState.usePasswordLogin) {
OutlinedSecureTextField(
Expand All @@ -260,6 +272,11 @@ internal fun ServiceSelectScreen(
Modifier
.width(300.dp),
lineLimits = TextFieldLineLimits.SingleLine,
keyboardOptions =
KeyboardOptions(
imeAction = ImeAction.Done,
autoCorrectEnabled = false,
),
)
}
AnimatedVisibility(!state.blueskyInputState.usePasswordLogin) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package dev.dimension.flare.ui.screen.serviceselect

import android.graphics.Color
import android.view.View
import android.view.ViewGroup.LayoutParams
import android.webkit.CookieManager
import android.widget.FrameLayout
Expand Down Expand Up @@ -59,7 +58,7 @@ internal fun VVOLoginScreen(toHome: () -> Unit) {
.padding(it)
.fillMaxSize(),
onCreated = {
it.setLayerType(View.LAYER_TYPE_SOFTWARE, null)
// it.setLayerType(View.LAYER_TYPE_SOFTWARE, null)
it.setBackgroundColor(Color.TRANSPARENT)
// clea all cookies
CookieManager.getInstance().removeAllCookies(null)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package dev.dimension.flare.ui.screen.serviceselect

import android.graphics.Color
import android.view.View
import android.view.ViewGroup.LayoutParams
import android.webkit.CookieManager
import android.webkit.WebSettings
Expand Down Expand Up @@ -60,7 +59,7 @@ internal fun XQTLoginScreen(toHome: () -> Unit) {
.padding(it)
.fillMaxSize(),
onCreated = {
it.setLayerType(View.LAYER_TYPE_SOFTWARE, null)
// it.setLayerType(View.LAYER_TYPE_SOFTWARE, null)
it.setBackgroundColor(Color.TRANSPARENT)
// clea all cookies
CookieManager.getInstance().removeAllCookies(null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ internal fun AccountsScreen(
LaunchedEffect(swipeState.settledValue) {
if (swipeState.settledValue != SwipeToDismissBoxValue.Settled) {
delay(AnimationConstants.DefaultDurationMillis.toLong())
swipeState.reset()
swipeState.snapTo(SwipeToDismissBoxValue.Settled)
state.logout(account.accountKey)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.runtime.snapshotFlow
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
Expand All @@ -51,7 +50,8 @@ import dev.dimension.flare.ui.model.onLoading
import dev.dimension.flare.ui.model.onSuccess
import dev.dimension.flare.ui.presenter.invoke
import dev.dimension.flare.ui.presenter.settings.FlareServerProviderPresenter
import dev.dimension.flare.ui.theme.ListCardShapes
import dev.dimension.flare.ui.theme.listCardContainer
import dev.dimension.flare.ui.theme.listCardItem
import dev.dimension.flare.ui.theme.screenHorizontalPadding
import kotlinx.coroutines.FlowPreview
import kotlinx.coroutines.flow.collectLatest
Expand Down Expand Up @@ -89,17 +89,16 @@ internal fun AiConfigScreen(onBack: () -> Unit) {
.verticalScroll(rememberScrollState())
.padding(it)
.padding(horizontal = screenHorizontalPadding)
.clip(ListCardShapes.container()),
.listCardContainer(),
verticalArrangement = Arrangement.spacedBy(2.dp),
) {
ListItem(
modifier =
Modifier
.listCardItem()
.clickable {
state.setShowServerDialog(true)
}.clip(
ListCardShapes.item(),
),
},
overlineContent = {
Text(
text = stringResource(id = R.string.settings_ai_config_server),
Expand Down Expand Up @@ -142,13 +141,12 @@ internal fun AiConfigScreen(onBack: () -> Unit) {
},
modifier =
Modifier
.listCardItem()
.clickable {
state.update {
copy(translation = !state.aiConfig.translation)
}
}.clip(
ListCardShapes.item(),
),
},
)
ListItem(
headlineContent = {
Expand All @@ -173,13 +171,12 @@ internal fun AiConfigScreen(onBack: () -> Unit) {
},
modifier =
Modifier
.listCardItem()
.clickable {
state.update {
copy(tldr = !state.aiConfig.tldr)
}
}.clip(
ListCardShapes.item(),
),
},
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
Expand All @@ -41,7 +40,7 @@ import dev.dimension.flare.ui.component.listCard
import dev.dimension.flare.ui.presenter.invoke
import dev.dimension.flare.ui.presenter.settings.DevModePresenter
import dev.dimension.flare.ui.screen.media.saveByteArrayToDownloads
import dev.dimension.flare.ui.theme.ListCardShapes
import dev.dimension.flare.ui.theme.listCardContainer
import dev.dimension.flare.ui.theme.screenHorizontalPadding
import moe.tlaster.precompose.molecule.producePresenter
import kotlin.time.Clock
Expand Down Expand Up @@ -124,9 +123,10 @@ internal fun AppLoggingScreen(onBack: () -> Unit) {
},
modifier =
Modifier
.listCardContainer()
.clickable {
state.setEnabled(!state.enabled)
}.clip(ListCardShapes.container()),
},
)
}
item {
Expand All @@ -139,9 +139,10 @@ internal fun AppLoggingScreen(onBack: () -> Unit) {
},
modifier =
Modifier
.listCard(index = index, totalCount = state.messages.size)
.clickable {
selectedMessage = it
}.listCard(index = index, totalCount = state.messages.size),
},
)
}
}
Expand Down
Loading