mirror of
https://github.com/LiveFastEatTrashRaccoon/RaccoonForLemmy.git
synced 2025-02-08 18:58:42 +01:00
chore: add ktlint (#854)
This commit is contained in:
parent
1adad36bf9
commit
0703b1573f
2
.editorconfig
Normal file
2
.editorconfig
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[*.{kt,kts}]
|
||||||
|
ktlint_code_style = ktlint_official
|
@ -325,7 +325,7 @@ in `:core:notifications` is used.
|
|||||||
### 6.2.1 General Kotlin rules
|
### 6.2.1 General Kotlin rules
|
||||||
|
|
||||||
Please refer to [this page](https://kotlinlang.org/docs/coding-conventions.html) for the conventions
|
Please refer to [this page](https://kotlinlang.org/docs/coding-conventions.html) for the conventions
|
||||||
to apply to Kotlin code, most of which are already enforced by Android Studio inspections.
|
to apply to Kotlin code.
|
||||||
|
|
||||||
### 6.2.2 Compose rules
|
### 6.2.2 Compose rules
|
||||||
|
|
||||||
@ -334,6 +334,12 @@ As far as Compose code is concerned, we take Google’s indications as a baselin
|
|||||||
- [general Compose API](https://android.googlesource.com/platform/frameworks/support/+/androidx-main/compose/docs/compose-api-guidelines.md)
|
- [general Compose API](https://android.googlesource.com/platform/frameworks/support/+/androidx-main/compose/docs/compose-api-guidelines.md)
|
||||||
- [Compose component API](https://android.googlesource.com/platform/frameworks/support/+/androidx-main/compose/docs/compose-component-api-guidelines.md)
|
- [Compose component API](https://android.googlesource.com/platform/frameworks/support/+/androidx-main/compose/docs/compose-component-api-guidelines.md)
|
||||||
|
|
||||||
|
### 6.2.3 Linter
|
||||||
|
|
||||||
|
The recommended lint to use is [Ktlint](https://pinterest.github.io/ktlint/latest/) with the `ktlint_official` code
|
||||||
|
style. There is a plugin for IntelliJ/Android Studio that allows to have distraction-free formatting upon saving, to
|
||||||
|
make sure any new code is compliant with the rules.
|
||||||
|
|
||||||
### 6.3 Test structure
|
### 6.3 Test structure
|
||||||
|
|
||||||
#### 6.3.1 Unit tests
|
#### 6.3.1 Unit tests
|
||||||
|
@ -41,8 +41,8 @@ android {
|
|||||||
setProguardFiles(
|
setProguardFiles(
|
||||||
listOf(
|
listOf(
|
||||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||||
"proguard-rules.pro"
|
"proguard-rules.pro",
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ kotlin {
|
|||||||
listOf(
|
listOf(
|
||||||
iosX64(),
|
iosX64(),
|
||||||
iosArm64(),
|
iosArm64(),
|
||||||
iosSimulatorArm64()
|
iosSimulatorArm64(),
|
||||||
).forEach {
|
).forEach {
|
||||||
it.binaries.framework {
|
it.binaries.framework {
|
||||||
baseName = "api"
|
baseName = "api"
|
||||||
|
@ -10,5 +10,7 @@ import de.jensklingenberg.ktorfit.http.POST
|
|||||||
interface AuthService {
|
interface AuthService {
|
||||||
@POST("user/login")
|
@POST("user/login")
|
||||||
@Headers("Content-Type: application/json")
|
@Headers("Content-Type: application/json")
|
||||||
suspend fun login(@Body form: LoginForm): Response<LoginResponse>
|
suspend fun login(
|
||||||
|
@Body form: LoginForm,
|
||||||
|
): Response<LoginResponse>
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,6 @@ import de.jensklingenberg.ktorfit.http.Url
|
|||||||
import io.ktor.client.request.forms.*
|
import io.ktor.client.request.forms.*
|
||||||
|
|
||||||
interface PostService {
|
interface PostService {
|
||||||
|
|
||||||
@GET("post/list")
|
@GET("post/list")
|
||||||
suspend fun getAll(
|
suspend fun getAll(
|
||||||
@Header("Authorization") authHeader: String? = null,
|
@Header("Authorization") authHeader: String? = null,
|
||||||
|
@ -19,7 +19,7 @@ kotlin {
|
|||||||
listOf(
|
listOf(
|
||||||
iosX64(),
|
iosX64(),
|
||||||
iosArm64(),
|
iosArm64(),
|
||||||
iosSimulatorArm64()
|
iosSimulatorArm64(),
|
||||||
).forEach {
|
).forEach {
|
||||||
it.binaries.framework {
|
it.binaries.framework {
|
||||||
baseName = "appearance"
|
baseName = "appearance"
|
||||||
|
@ -31,4 +31,4 @@ actual fun getColorSchemeProvider(): ColorSchemeProvider {
|
|||||||
actual fun getBarColorProvider(): BarColorProvider {
|
actual fun getBarColorProvider(): BarColorProvider {
|
||||||
val res by inject<BarColorProvider>(BarColorProvider::class.java)
|
val res by inject<BarColorProvider>(BarColorProvider::class.java)
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
@ -114,4 +114,4 @@ class DefaultThemeRepositoryTest {
|
|||||||
val resAfter = sut.commentBarTheme.value
|
val resAfter = sut.commentBarTheme.value
|
||||||
assertEquals(CommentBarTheme.Green, resAfter)
|
assertEquals(CommentBarTheme.Green, resAfter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,6 @@ fun Float.toFontScale(): FontScale = when (this) {
|
|||||||
else -> FontScale.Normal
|
else -> FontScale.Normal
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// log(2 + 0.1 * n) / log(2)
|
// log(2 + 0.1 * n) / log(2)
|
||||||
private object ReferenceValues {
|
private object ReferenceValues {
|
||||||
const val largest = 1.2f
|
const val largest = 1.2f
|
||||||
|
@ -56,13 +56,13 @@ fun formatToReadableValue(
|
|||||||
addStyle(
|
addStyle(
|
||||||
style = SpanStyle(color = upVoteColor),
|
style = SpanStyle(color = upVoteColor),
|
||||||
start = 0,
|
start = 0,
|
||||||
end = text.length
|
end = text.length,
|
||||||
)
|
)
|
||||||
} else if (downVoted) {
|
} else if (downVoted) {
|
||||||
addStyle(
|
addStyle(
|
||||||
style = SpanStyle(color = downVoteColor),
|
style = SpanStyle(color = downVoteColor),
|
||||||
start = 0,
|
start = 0,
|
||||||
end = length
|
end = length,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -74,7 +74,7 @@ fun formatToReadableValue(
|
|||||||
addStyle(
|
addStyle(
|
||||||
style = SpanStyle(color = upVoteColor),
|
style = SpanStyle(color = upVoteColor),
|
||||||
start = 0,
|
start = 0,
|
||||||
end = upvoteText.length
|
end = upvoteText.length,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
append(" / ")
|
append(" / ")
|
||||||
@ -84,7 +84,7 @@ fun formatToReadableValue(
|
|||||||
addStyle(
|
addStyle(
|
||||||
style = SpanStyle(color = downVoteColor),
|
style = SpanStyle(color = downVoteColor),
|
||||||
start = upvoteText.length + 3,
|
start = upvoteText.length + 3,
|
||||||
end = upvoteText.length + 3 + downvoteText.length
|
end = upvoteText.length + 3 + downvoteText.length,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -96,13 +96,13 @@ fun formatToReadableValue(
|
|||||||
addStyle(
|
addStyle(
|
||||||
style = SpanStyle(color = upVoteColor),
|
style = SpanStyle(color = upVoteColor),
|
||||||
start = 0,
|
start = 0,
|
||||||
end = text.length
|
end = text.length,
|
||||||
)
|
)
|
||||||
} else if (downVoted) {
|
} else if (downVoted) {
|
||||||
addStyle(
|
addStyle(
|
||||||
style = SpanStyle(color = downVoteColor),
|
style = SpanStyle(color = downVoteColor),
|
||||||
start = 0,
|
start = 0,
|
||||||
end = length
|
end = length,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@ import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.UiFontFamil
|
|||||||
import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.UiTheme
|
import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.UiTheme
|
||||||
import kotlinx.coroutines.flow.MutableStateFlow
|
import kotlinx.coroutines.flow.MutableStateFlow
|
||||||
|
|
||||||
|
|
||||||
internal class DefaultThemeRepository : ThemeRepository {
|
internal class DefaultThemeRepository : ThemeRepository {
|
||||||
|
|
||||||
override val uiTheme = MutableStateFlow<UiTheme?>(null)
|
override val uiTheme = MutableStateFlow<UiTheme?>(null)
|
||||||
|
@ -80,5 +80,5 @@ val md_theme_black_onSecondaryContainer = Color(0xFFFFFFFF)
|
|||||||
val md_theme_black_tertiaryContainer = Color(0xFF262626)
|
val md_theme_black_tertiaryContainer = Color(0xFF262626)
|
||||||
val md_theme_black_onTertiaryContainer = Color(0xFFFFFFFF)
|
val md_theme_black_onTertiaryContainer = Color(0xFFFFFFFF)
|
||||||
|
|
||||||
//val seed = Color(0xFF6345CB)
|
// val seed = Color(0xFF6345CB)
|
||||||
val ic_launcher_background = Color(0xFFBCC5FF)
|
val ic_launcher_background = Color(0xFFBCC5FF)
|
||||||
|
@ -19,7 +19,7 @@ kotlin {
|
|||||||
listOf(
|
listOf(
|
||||||
iosX64(),
|
iosX64(),
|
||||||
iosArm64(),
|
iosArm64(),
|
||||||
iosSimulatorArm64()
|
iosSimulatorArm64(),
|
||||||
).forEach {
|
).forEach {
|
||||||
it.binaries.framework {
|
it.binaries.framework {
|
||||||
baseName = "architecture"
|
baseName = "architecture"
|
||||||
|
@ -19,7 +19,7 @@ kotlin {
|
|||||||
listOf(
|
listOf(
|
||||||
iosX64(),
|
iosX64(),
|
||||||
iosArm64(),
|
iosArm64(),
|
||||||
iosSimulatorArm64()
|
iosSimulatorArm64(),
|
||||||
).forEach {
|
).forEach {
|
||||||
it.binaries.framework {
|
it.binaries.framework {
|
||||||
baseName = "components"
|
baseName = "components"
|
||||||
|
@ -62,7 +62,7 @@ actual fun CustomImage(
|
|||||||
},
|
},
|
||||||
onSuccess = {
|
onSuccess = {
|
||||||
painterState = it
|
painterState = it
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
when (val state = painterState) {
|
when (val state = painterState) {
|
||||||
@ -95,4 +95,4 @@ actual fun CustomImage(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ actual fun CustomWebView(
|
|||||||
WebView(context).apply {
|
WebView(context).apply {
|
||||||
layoutParams = ViewGroup.LayoutParams(
|
layoutParams = ViewGroup.LayoutParams(
|
||||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||||
ViewGroup.LayoutParams.MATCH_PARENT
|
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||||
)
|
)
|
||||||
webViewClient = object : WebViewClient() {
|
webViewClient = object : WebViewClient() {
|
||||||
override fun onPageStarted(view: WebView, url: String?, favicon: Bitmap?) {
|
override fun onPageStarted(view: WebView, url: String?, favicon: Bitmap?) {
|
||||||
@ -55,7 +55,8 @@ actual fun CustomWebView(
|
|||||||
available = Offset(
|
available = Offset(
|
||||||
x = (oldScrollX - scrollX) / density,
|
x = (oldScrollX - scrollX) / density,
|
||||||
y = (oldScrollY - scrollY) / density,
|
y = (oldScrollY - scrollY) / density,
|
||||||
), source = NestedScrollSource.Drag
|
),
|
||||||
|
source = NestedScrollSource.Drag,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ actual fun VideoPlayer(
|
|||||||
val defaultDataSourceFactory = DefaultDataSource.Factory(context)
|
val defaultDataSourceFactory = DefaultDataSource.Factory(context)
|
||||||
val dataSourceFactory: DataSource.Factory = DefaultDataSource.Factory(
|
val dataSourceFactory: DataSource.Factory = DefaultDataSource.Factory(
|
||||||
context,
|
context,
|
||||||
defaultDataSourceFactory
|
defaultDataSourceFactory,
|
||||||
)
|
)
|
||||||
val source = ProgressiveMediaSource.Factory(dataSourceFactory)
|
val source = ProgressiveMediaSource.Factory(dataSourceFactory)
|
||||||
.createMediaSource(MediaItem.fromUri(url))
|
.createMediaSource(MediaItem.fromUri(url))
|
||||||
@ -72,7 +72,7 @@ actual fun VideoPlayer(
|
|||||||
player = exoPlayer
|
player = exoPlayer
|
||||||
layoutParams = FrameLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT)
|
layoutParams = FrameLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT)
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
DisposableEffect(Unit) {
|
DisposableEffect(Unit) {
|
||||||
|
@ -29,7 +29,7 @@ fun rememberWebViewNavigator(): WebViewNavigator {
|
|||||||
val scope = rememberCoroutineScope()
|
val scope = rememberCoroutineScope()
|
||||||
return remember {
|
return remember {
|
||||||
WebViewNavigator(
|
WebViewNavigator(
|
||||||
coroutineScope = scope
|
coroutineScope = scope,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,6 @@ fun DraggableSideMenu(
|
|||||||
onDismiss: (() -> Unit)? = null,
|
onDismiss: (() -> Unit)? = null,
|
||||||
content: @Composable () -> Unit = {},
|
content: @Composable () -> Unit = {},
|
||||||
) {
|
) {
|
||||||
|
|
||||||
val density = LocalDensity.current
|
val density = LocalDensity.current
|
||||||
val maxWidth = if (availableWidth.isSpecified) availableWidth * 0.85f else 500.dp
|
val maxWidth = if (availableWidth.isSpecified) availableWidth * 0.85f else 500.dp
|
||||||
val draggableState = remember(availableWidth) {
|
val draggableState = remember(availableWidth) {
|
||||||
@ -96,7 +95,7 @@ fun DraggableSideMenu(
|
|||||||
top = Spacing.xxl,
|
top = Spacing.xxl,
|
||||||
bottom = Spacing.m,
|
bottom = Spacing.m,
|
||||||
end = Spacing.s,
|
end = Spacing.s,
|
||||||
start = Spacing.s
|
start = Spacing.s,
|
||||||
),
|
),
|
||||||
) {
|
) {
|
||||||
content()
|
content()
|
||||||
|
@ -66,12 +66,12 @@ fun FloatingActionButtonMenu(
|
|||||||
val enterTransition = remember {
|
val enterTransition = remember {
|
||||||
fadeIn(
|
fadeIn(
|
||||||
initialAlpha = 0.3f,
|
initialAlpha = 0.3f,
|
||||||
animationSpec = tween(ANIMATION_DURATION, easing = FastOutSlowInEasing)
|
animationSpec = tween(ANIMATION_DURATION, easing = FastOutSlowInEasing),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val exitTransition = remember {
|
val exitTransition = remember {
|
||||||
fadeOut(
|
fadeOut(
|
||||||
animationSpec = tween(ANIMATION_DURATION, easing = FastOutSlowInEasing)
|
animationSpec = tween(ANIMATION_DURATION, easing = FastOutSlowInEasing),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val numberOfItems by animateIntAsState(
|
val numberOfItems by animateIntAsState(
|
||||||
@ -79,7 +79,7 @@ fun FloatingActionButtonMenu(
|
|||||||
animationSpec = tween(
|
animationSpec = tween(
|
||||||
durationMillis = ANIMATION_DURATION * items.size,
|
durationMillis = ANIMATION_DURATION * items.size,
|
||||||
easing = LinearEasing,
|
easing = LinearEasing,
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
val indices: List<Int> = if (numberOfItems == 0) {
|
val indices: List<Int> = if (numberOfItems == 0) {
|
||||||
emptyList()
|
emptyList()
|
||||||
@ -104,7 +104,7 @@ fun FloatingActionButtonMenu(
|
|||||||
AnimatedVisibility(
|
AnimatedVisibility(
|
||||||
visible = idx in indices,
|
visible = idx in indices,
|
||||||
enter = enterTransition,
|
enter = enterTransition,
|
||||||
exit = exitTransition
|
exit = exitTransition,
|
||||||
) {
|
) {
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier.onClick(
|
modifier = Modifier.onClick(
|
||||||
@ -114,7 +114,7 @@ fun FloatingActionButtonMenu(
|
|||||||
},
|
},
|
||||||
).padding(end = 15.dp),
|
).padding(end = 15.dp),
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.spacedBy(Spacing.xxs)
|
horizontalArrangement = Arrangement.spacedBy(Spacing.xxs),
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
@ -124,7 +124,7 @@ fun FloatingActionButtonMenu(
|
|||||||
shape = RoundedCornerShape(CornerSize.s),
|
shape = RoundedCornerShape(CornerSize.s),
|
||||||
).padding(
|
).padding(
|
||||||
vertical = Spacing.xs,
|
vertical = Spacing.xs,
|
||||||
horizontal = Spacing.s
|
horizontal = Spacing.s,
|
||||||
),
|
),
|
||||||
text = item.text,
|
text = item.text,
|
||||||
style = MaterialTheme.typography.bodyMedium,
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
@ -135,7 +135,7 @@ fun FloatingActionButtonMenu(
|
|||||||
.size(IconSize.m)
|
.size(IconSize.m)
|
||||||
.background(
|
.background(
|
||||||
color = MaterialTheme.colorScheme.primaryContainer,
|
color = MaterialTheme.colorScheme.primaryContainer,
|
||||||
shape = CircleShape
|
shape = CircleShape,
|
||||||
).padding(6.dp),
|
).padding(6.dp),
|
||||||
imageVector = item.icon,
|
imageVector = item.icon,
|
||||||
contentDescription = null,
|
contentDescription = null,
|
||||||
@ -147,12 +147,11 @@ fun FloatingActionButtonMenu(
|
|||||||
Spacer(modifier = Modifier.height(Spacing.xxs))
|
Spacer(modifier = Modifier.height(Spacing.xxs))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
val fabContainerColor = when (theme) {
|
val fabContainerColor = when (theme) {
|
||||||
UiTheme.Black -> schemeProvider.getColorScheme(
|
UiTheme.Black -> schemeProvider.getColorScheme(
|
||||||
theme = UiTheme.Dark,
|
theme = UiTheme.Dark,
|
||||||
dynamic = dynamicColors,
|
dynamic = dynamicColors,
|
||||||
customSeed = seedColor
|
customSeed = seedColor,
|
||||||
).primaryContainer
|
).primaryContainer
|
||||||
|
|
||||||
else -> MaterialTheme.colorScheme.primaryContainer
|
else -> MaterialTheme.colorScheme.primaryContainer
|
||||||
|
@ -25,4 +25,4 @@ fun MultiColorPreview(
|
|||||||
start += step
|
start += step
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,11 +45,11 @@ fun SectionSelector(
|
|||||||
} else {
|
} else {
|
||||||
onSectionSelected((currentSection + 1).coerceAtMost(titles.lastIndex))
|
onSectionSelected((currentSection + 1).coerceAtMost(titles.lastIndex))
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
Modifier
|
Modifier
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
selected = i == currentSection,
|
selected = i == currentSection,
|
||||||
text = {
|
text = {
|
||||||
@ -64,6 +64,6 @@ fun SectionSelector(
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,6 @@ fun SwipeActionCard(
|
|||||||
swipeToEndActions.getOrNull(1)?.onTriggered?.invoke()
|
swipeToEndActions.getOrNull(1)?.onTriggered?.invoke()
|
||||||
} else {
|
} else {
|
||||||
swipeToEndActions.firstOrNull()?.onTriggered?.invoke()
|
swipeToEndActions.firstOrNull()?.onTriggered?.invoke()
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -129,9 +128,9 @@ fun SwipeActionCard(
|
|||||||
val enableSecondAction = actions.size > 1
|
val enableSecondAction = actions.size > 1
|
||||||
val bgColor by animateColorAsState(
|
val bgColor by animateColorAsState(
|
||||||
targetValue = if (
|
targetValue = if (
|
||||||
dismissState.progress < SECOND_ACTION_THRESHOLD
|
dismissState.progress < SECOND_ACTION_THRESHOLD ||
|
||||||
|| dismissState.targetValue == SwipeToDismissBoxValue.Settled
|
dismissState.targetValue == SwipeToDismissBoxValue.Settled ||
|
||||||
|| !enableSecondAction
|
!enableSecondAction
|
||||||
) {
|
) {
|
||||||
actions.firstOrNull()?.backgroundColor ?: Color.Transparent
|
actions.firstOrNull()?.backgroundColor ?: Color.Transparent
|
||||||
} else {
|
} else {
|
||||||
@ -184,14 +183,14 @@ private fun rememberNoFlingSwipeToDismissBoxState(
|
|||||||
saver = SwipeToDismissBoxState.Saver(
|
saver = SwipeToDismissBoxState.Saver(
|
||||||
confirmValueChange = confirmValueChange,
|
confirmValueChange = confirmValueChange,
|
||||||
density = density,
|
density = density,
|
||||||
positionalThreshold = positionalThreshold
|
positionalThreshold = positionalThreshold,
|
||||||
)
|
),
|
||||||
) {
|
) {
|
||||||
SwipeToDismissBoxState(
|
SwipeToDismissBoxState(
|
||||||
initialValue = initialValue,
|
initialValue = initialValue,
|
||||||
density = density,
|
density = density,
|
||||||
confirmValueChange = confirmValueChange,
|
confirmValueChange = confirmValueChange,
|
||||||
positionalThreshold = positionalThreshold
|
positionalThreshold = positionalThreshold,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -124,8 +124,8 @@ fun ZoomableImage(
|
|||||||
initialValue = 0f,
|
initialValue = 0f,
|
||||||
targetValue = 1f,
|
targetValue = 1f,
|
||||||
animationSpec = InfiniteRepeatableSpec(
|
animationSpec = InfiniteRepeatableSpec(
|
||||||
animation = tween(LOADING_ANIMATION_DURATION)
|
animation = tween(LOADING_ANIMATION_DURATION),
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
res
|
res
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ actual fun CustomWebView(
|
|||||||
}
|
}
|
||||||
WKWebView(
|
WKWebView(
|
||||||
frame = CGRectZero.readValue(),
|
frame = CGRectZero.readValue(),
|
||||||
configuration = config
|
configuration = config,
|
||||||
).apply {
|
).apply {
|
||||||
userInteractionEnabled = true
|
userInteractionEnabled = true
|
||||||
allowsBackForwardNavigationGestures = true
|
allowsBackForwardNavigationGestures = true
|
||||||
@ -82,7 +82,6 @@ actual fun CustomWebView(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}.also {
|
}.also {
|
||||||
webView = it
|
webView = it
|
||||||
}
|
}
|
||||||
@ -90,6 +89,6 @@ actual fun CustomWebView(
|
|||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
onRelease = {
|
onRelease = {
|
||||||
webView = null
|
webView = null
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ kotlin {
|
|||||||
listOf(
|
listOf(
|
||||||
iosX64(),
|
iosX64(),
|
||||||
iosArm64(),
|
iosArm64(),
|
||||||
iosSimulatorArm64()
|
iosSimulatorArm64(),
|
||||||
).forEach {
|
).forEach {
|
||||||
it.binaries.framework {
|
it.binaries.framework {
|
||||||
baseName = "detailopener-api"
|
baseName = "detailopener-api"
|
||||||
|
@ -5,4 +5,4 @@ import org.koin.java.KoinJavaComponent.inject
|
|||||||
actual fun getDetailOpener(): DetailOpener {
|
actual fun getDetailOpener(): DetailOpener {
|
||||||
val res: DetailOpener by inject(DetailOpener::class.java)
|
val res: DetailOpener by inject(DetailOpener::class.java)
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
@ -7,4 +7,4 @@ actual fun getDetailOpener(): DetailOpener = DetailOpenerApiDiHelper.detailOpene
|
|||||||
|
|
||||||
object DetailOpenerApiDiHelper : KoinComponent {
|
object DetailOpenerApiDiHelper : KoinComponent {
|
||||||
val detailOpener: DetailOpener by inject()
|
val detailOpener: DetailOpener by inject()
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ kotlin {
|
|||||||
listOf(
|
listOf(
|
||||||
iosX64(),
|
iosX64(),
|
||||||
iosArm64(),
|
iosArm64(),
|
||||||
iosSimulatorArm64()
|
iosSimulatorArm64(),
|
||||||
).forEach {
|
).forEach {
|
||||||
it.binaries.framework {
|
it.binaries.framework {
|
||||||
baseName = "detailopener-impl"
|
baseName = "detailopener-impl"
|
||||||
|
@ -19,7 +19,7 @@ kotlin {
|
|||||||
listOf(
|
listOf(
|
||||||
iosX64(),
|
iosX64(),
|
||||||
iosArm64(),
|
iosArm64(),
|
||||||
iosSimulatorArm64()
|
iosSimulatorArm64(),
|
||||||
).forEach {
|
).forEach {
|
||||||
it.binaries.framework {
|
it.binaries.framework {
|
||||||
baseName = "lemmyui"
|
baseName = "lemmyui"
|
||||||
|
@ -6,4 +6,4 @@ import org.koin.java.KoinJavaComponent
|
|||||||
actual fun getFabNestedScrollConnection(): FabNestedScrollConnection {
|
actual fun getFabNestedScrollConnection(): FabNestedScrollConnection {
|
||||||
val res: FabNestedScrollConnection by KoinJavaComponent.inject(FabNestedScrollConnection::class.java)
|
val res: FabNestedScrollConnection by KoinJavaComponent.inject(FabNestedScrollConnection::class.java)
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
@ -60,11 +60,11 @@ fun CollapsedCommentCard(
|
|||||||
Column(
|
Column(
|
||||||
modifier = modifier.onClick(
|
modifier = modifier.onClick(
|
||||||
onClick = onClick ?: {},
|
onClick = onClick ?: {},
|
||||||
)
|
),
|
||||||
) {
|
) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier.padding(
|
modifier = Modifier.padding(
|
||||||
start = (INDENT_AMOUNT * comment.depth).dp
|
start = (INDENT_AMOUNT * comment.depth).dp,
|
||||||
),
|
),
|
||||||
) {
|
) {
|
||||||
Column(
|
Column(
|
||||||
@ -76,7 +76,7 @@ fun CollapsedCommentCard(
|
|||||||
horizontal = Spacing.s,
|
horizontal = Spacing.s,
|
||||||
).onGloballyPositioned {
|
).onGloballyPositioned {
|
||||||
commentHeight = it.size.toSize().height
|
commentHeight = it.size.toSize().height
|
||||||
}
|
},
|
||||||
) {
|
) {
|
||||||
CommunityAndCreatorInfo(
|
CommunityAndCreatorInfo(
|
||||||
iconSize = IconSize.s,
|
iconSize = IconSize.s,
|
||||||
@ -120,7 +120,7 @@ fun CollapsedCommentCard(
|
|||||||
.padding(top = Spacing.xxs)
|
.padding(top = Spacing.xxs)
|
||||||
.width(barWidth)
|
.width(barWidth)
|
||||||
.height(commentHeight.toLocalDp())
|
.height(commentHeight.toLocalDp())
|
||||||
.background(color = barColor)
|
.background(color = barColor),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,11 +89,11 @@ fun CommentCard(
|
|||||||
Box(
|
Box(
|
||||||
modifier = Modifier.onClick(
|
modifier = Modifier.onClick(
|
||||||
onClick = onClick ?: {},
|
onClick = onClick ?: {},
|
||||||
onDoubleClick = onDoubleClick ?: {}
|
onDoubleClick = onDoubleClick ?: {},
|
||||||
).padding(
|
).padding(
|
||||||
start = indentAmount.takeIf { it > 0 }?.let {
|
start = indentAmount.takeIf { it > 0 }?.let {
|
||||||
(it * comment.depth).dp + Spacing.xxxs
|
(it * comment.depth).dp + Spacing.xxxs
|
||||||
} ?: 0.dp
|
} ?: 0.dp,
|
||||||
),
|
),
|
||||||
) {
|
) {
|
||||||
Column(
|
Column(
|
||||||
@ -184,7 +184,7 @@ fun CommentCard(
|
|||||||
.padding(top = Spacing.xxs)
|
.padding(top = Spacing.xxs)
|
||||||
.width(barWidth)
|
.width(barWidth)
|
||||||
.height(commentHeight.toLocalDp())
|
.height(commentHeight.toLocalDp())
|
||||||
.background(color = barColor, shape = RoundedCornerShape(barWidth / 2))
|
.background(color = barColor, shape = RoundedCornerShape(barWidth / 2)),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,12 +34,12 @@ fun CommentCardPlaceholder(
|
|||||||
if (!hideAuthor) {
|
if (!hideAuthor) {
|
||||||
Row(
|
Row(
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.spacedBy(Spacing.s)
|
horizontalArrangement = Arrangement.spacedBy(Spacing.s),
|
||||||
) {
|
) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier.size(IconSize.s)
|
modifier = Modifier.size(IconSize.s)
|
||||||
.clip(CircleShape)
|
.clip(CircleShape)
|
||||||
.shimmerEffect()
|
.shimmerEffect(),
|
||||||
)
|
)
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.padding(vertical = Spacing.xxxs),
|
modifier = Modifier.padding(vertical = Spacing.xxxs),
|
||||||
@ -49,13 +49,13 @@ fun CommentCardPlaceholder(
|
|||||||
modifier = Modifier.height(IconSize.s)
|
modifier = Modifier.height(IconSize.s)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clip(RoundedCornerShape(CornerSize.m))
|
.clip(RoundedCornerShape(CornerSize.m))
|
||||||
.shimmerEffect()
|
.shimmerEffect(),
|
||||||
)
|
)
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier.height(IconSize.s)
|
modifier = Modifier.height(IconSize.s)
|
||||||
.fillMaxWidth(0.5f)
|
.fillMaxWidth(0.5f)
|
||||||
.clip(RoundedCornerShape(CornerSize.m))
|
.clip(RoundedCornerShape(CornerSize.m))
|
||||||
.shimmerEffect()
|
.shimmerEffect(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -65,14 +65,14 @@ fun CommentCardPlaceholder(
|
|||||||
.height(80.dp)
|
.height(80.dp)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clip(RoundedCornerShape(CornerSize.s))
|
.clip(RoundedCornerShape(CornerSize.s))
|
||||||
.shimmerEffect()
|
.shimmerEffect(),
|
||||||
)
|
)
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.height(IconSize.l)
|
.height(IconSize.l)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clip(RoundedCornerShape(CornerSize.m))
|
.clip(RoundedCornerShape(CornerSize.m))
|
||||||
.shimmerEffect()
|
.shimmerEffect(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ fun CommunityAndCreatorInfo(
|
|||||||
Row(
|
Row(
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.spacedBy(Spacing.s)
|
horizontalArrangement = Arrangement.spacedBy(Spacing.s),
|
||||||
) {
|
) {
|
||||||
if (communityIcon.isNotEmpty()) {
|
if (communityIcon.isNotEmpty()) {
|
||||||
if (autoLoadImages) {
|
if (autoLoadImages) {
|
||||||
|
@ -85,7 +85,7 @@ fun CommunityHeader(
|
|||||||
Row(
|
Row(
|
||||||
modifier = Modifier.fillMaxWidth().padding(Spacing.s).align(Alignment.Center),
|
modifier = Modifier.fillMaxWidth().padding(Spacing.s).align(Alignment.Center),
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.spacedBy(Spacing.m)
|
horizontalArrangement = Arrangement.spacedBy(Spacing.m),
|
||||||
) {
|
) {
|
||||||
val communityIcon = community.icon.orEmpty()
|
val communityIcon = community.icon.orEmpty()
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ fun CommunityItem(
|
|||||||
Modifier
|
Modifier
|
||||||
} else {
|
} else {
|
||||||
Modifier.padding(Spacing.s)
|
Modifier.padding(Spacing.s)
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.spacedBy(Spacing.xs),
|
horizontalArrangement = Arrangement.spacedBy(Spacing.xs),
|
||||||
@ -150,7 +150,7 @@ fun CommunityItem(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(IconSize.m)
|
.size(IconSize.m)
|
||||||
.onClick(
|
.onClick(
|
||||||
onClick = { onSubscribe?.invoke() }
|
onClick = { onSubscribe?.invoke() },
|
||||||
),
|
),
|
||||||
imageVector = when (community.subscribed) {
|
imageVector = when (community.subscribed) {
|
||||||
true -> {
|
true -> {
|
||||||
|
@ -46,14 +46,14 @@ fun CommunityItemPlaceholder() {
|
|||||||
.height(40.dp)
|
.height(40.dp)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clip(RoundedCornerShape(CornerSize.s))
|
.clip(RoundedCornerShape(CornerSize.s))
|
||||||
.shimmerEffect()
|
.shimmerEffect(),
|
||||||
)
|
)
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.height(20.dp)
|
.height(20.dp)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clip(RoundedCornerShape(CornerSize.s))
|
.clip(RoundedCornerShape(CornerSize.s))
|
||||||
.shimmerEffect()
|
.shimmerEffect(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,13 +36,13 @@ fun DetailInfoItem(
|
|||||||
SpanStyle(
|
SpanStyle(
|
||||||
fontWeight = FontWeight.Bold,
|
fontWeight = FontWeight.Bold,
|
||||||
color = MaterialTheme.colorScheme.primary,
|
color = MaterialTheme.colorScheme.primary,
|
||||||
)
|
),
|
||||||
) {
|
) {
|
||||||
append(value)
|
append(value)
|
||||||
}
|
}
|
||||||
append(" ")
|
append(" ")
|
||||||
append(title)
|
append(title)
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,10 +26,9 @@ internal class DefaultFabNestedScrollConnection : FabNestedScrollConnection {
|
|||||||
.stateIn(
|
.stateIn(
|
||||||
scope = scope,
|
scope = scope,
|
||||||
started = SharingStarted.WhileSubscribed(5_000),
|
started = SharingStarted.WhileSubscribed(5_000),
|
||||||
initialValue = true
|
initialValue = true,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
override fun onPreScroll(available: Offset, source: NestedScrollSource): Offset {
|
override fun onPreScroll(available: Offset, source: NestedScrollSource): Offset {
|
||||||
if (available.y < -THRESHOLD) {
|
if (available.y < -THRESHOLD) {
|
||||||
fabVisible.value = false
|
fabVisible.value = false
|
||||||
|
@ -69,7 +69,7 @@ fun InboxCard(
|
|||||||
.padding(vertical = Spacing.s)
|
.padding(vertical = Spacing.s)
|
||||||
} else {
|
} else {
|
||||||
Modifier.background(MaterialTheme.colorScheme.background)
|
Modifier.background(MaterialTheme.colorScheme.background)
|
||||||
}
|
},
|
||||||
).onClick(
|
).onClick(
|
||||||
onClick = {
|
onClick = {
|
||||||
onOpenPost(mention.post)
|
onOpenPost(mention.post)
|
||||||
|
@ -38,7 +38,7 @@ fun InboxCardPlaceholder(
|
|||||||
.padding(Spacing.s)
|
.padding(Spacing.s)
|
||||||
} else {
|
} else {
|
||||||
Modifier
|
Modifier
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
verticalArrangement = Arrangement.spacedBy(Spacing.xs),
|
verticalArrangement = Arrangement.spacedBy(Spacing.xs),
|
||||||
) {
|
) {
|
||||||
@ -47,7 +47,7 @@ fun InboxCardPlaceholder(
|
|||||||
.height(IconSize.l)
|
.height(IconSize.l)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clip(RoundedCornerShape(CornerSize.m))
|
.clip(RoundedCornerShape(CornerSize.m))
|
||||||
.shimmerEffect()
|
.shimmerEffect(),
|
||||||
)
|
)
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
@ -55,14 +55,14 @@ fun InboxCardPlaceholder(
|
|||||||
.height(50.dp)
|
.height(50.dp)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clip(RoundedCornerShape(CornerSize.m))
|
.clip(RoundedCornerShape(CornerSize.m))
|
||||||
.shimmerEffect()
|
.shimmerEffect(),
|
||||||
)
|
)
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.height(IconSize.l)
|
.height(IconSize.l)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clip(RoundedCornerShape(CornerSize.m))
|
.clip(RoundedCornerShape(CornerSize.m))
|
||||||
.shimmerEffect()
|
.shimmerEffect(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,6 @@ fun InboxCardHeader(
|
|||||||
append(LocalXmlStrings.current.inboxItemReplyComment)
|
append(LocalXmlStrings.current.inboxItemReplyComment)
|
||||||
} else {
|
} else {
|
||||||
append(LocalXmlStrings.current.inboxItemReplyPost)
|
append(LocalXmlStrings.current.inboxItemReplyPost)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -228,7 +228,7 @@ fun InboxReplySubtitle(
|
|||||||
),
|
),
|
||||||
imageVector = Icons.Default.MoreHoriz,
|
imageVector = Icons.Default.MoreHoriz,
|
||||||
contentDescription = null,
|
contentDescription = null,
|
||||||
tint = ancillaryColor
|
tint = ancillaryColor,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Spacer(modifier = Modifier.weight(1f))
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
|
@ -26,7 +26,7 @@ fun IndicatorChip(
|
|||||||
.border(
|
.border(
|
||||||
color = MaterialTheme.colorScheme.onBackground,
|
color = MaterialTheme.colorScheme.onBackground,
|
||||||
width = Dp.Hairline,
|
width = Dp.Hairline,
|
||||||
shape = RoundedCornerShape(CornerSize.m)
|
shape = RoundedCornerShape(CornerSize.m),
|
||||||
)
|
)
|
||||||
.padding(
|
.padding(
|
||||||
vertical = Spacing.xxxs,
|
vertical = Spacing.xxxs,
|
||||||
|
@ -13,7 +13,6 @@ sealed interface ModeratorZoneAction {
|
|||||||
data object GlobalReports : ModeratorZoneAction
|
data object GlobalReports : ModeratorZoneAction
|
||||||
|
|
||||||
data object ModeratedContents : ModeratorZoneAction
|
data object ModeratedContents : ModeratorZoneAction
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Int.toModeratorZoneAction(): ModeratorZoneAction = when (this) {
|
fun Int.toModeratorZoneAction(): ModeratorZoneAction = when (this) {
|
||||||
|
@ -72,9 +72,8 @@ fun MultiCommunityItem(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.weight(1f).padding(start = Spacing.xs)
|
modifier = Modifier.weight(1f).padding(start = Spacing.xs),
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
modifier = Modifier.padding(vertical = Spacing.s),
|
modifier = Modifier.padding(vertical = Spacing.s),
|
||||||
@ -86,7 +85,6 @@ fun MultiCommunityItem(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (options.isNotEmpty()) {
|
if (options.isNotEmpty()) {
|
||||||
Box {
|
Box {
|
||||||
Icon(
|
Icon(
|
||||||
|
@ -96,7 +96,7 @@ fun PostCard(
|
|||||||
.padding(horizontal = Spacing.xs)
|
.padding(horizontal = Spacing.xs)
|
||||||
.shadow(
|
.shadow(
|
||||||
elevation = 5.dp,
|
elevation = 5.dp,
|
||||||
shape = RoundedCornerShape(CornerSize.l)
|
shape = RoundedCornerShape(CornerSize.l),
|
||||||
)
|
)
|
||||||
.clip(RoundedCornerShape(CornerSize.l))
|
.clip(RoundedCornerShape(CornerSize.l))
|
||||||
.background(
|
.background(
|
||||||
@ -105,7 +105,7 @@ fun PostCard(
|
|||||||
.padding(vertical = Spacing.s)
|
.padding(vertical = Spacing.s)
|
||||||
} else {
|
} else {
|
||||||
Modifier
|
Modifier
|
||||||
}
|
},
|
||||||
).onClick(
|
).onClick(
|
||||||
onClick = onClick ?: {},
|
onClick = onClick ?: {},
|
||||||
onDoubleClick = onDoubleClick ?: {},
|
onDoubleClick = onDoubleClick ?: {},
|
||||||
@ -228,7 +228,7 @@ private fun CompactPost(
|
|||||||
},
|
},
|
||||||
onTap = {
|
onTap = {
|
||||||
onClick?.invoke()
|
onClick?.invoke()
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
verticalArrangement = Arrangement.spacedBy(Spacing.xxs),
|
verticalArrangement = Arrangement.spacedBy(Spacing.xxs),
|
||||||
@ -258,7 +258,7 @@ private fun CompactPost(
|
|||||||
Row(
|
Row(
|
||||||
modifier = Modifier.padding(horizontal = Spacing.xs),
|
modifier = Modifier.padding(horizontal = Spacing.xs),
|
||||||
verticalAlignment = Alignment.Top,
|
verticalAlignment = Alignment.Top,
|
||||||
horizontalArrangement = Arrangement.spacedBy(Spacing.xs)
|
horizontalArrangement = Arrangement.spacedBy(Spacing.xs),
|
||||||
) {
|
) {
|
||||||
CustomizedContent(ContentFontClass.Title) {
|
CustomizedContent(ContentFontClass.Title) {
|
||||||
PostCardTitle(
|
PostCardTitle(
|
||||||
@ -313,7 +313,7 @@ private fun CompactPost(
|
|||||||
Modifier
|
Modifier
|
||||||
} else {
|
} else {
|
||||||
Modifier.aspectRatio(1f)
|
Modifier.aspectRatio(1f)
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
.padding(vertical = Spacing.xs)
|
.padding(vertical = Spacing.xs)
|
||||||
.clip(RoundedCornerShape(CornerSize.s)),
|
.clip(RoundedCornerShape(CornerSize.s)),
|
||||||
@ -422,11 +422,11 @@ private fun ExtendedPost(
|
|||||||
val navigationCoordinator = remember { getNavigationCoordinator() }
|
val navigationCoordinator = remember { getNavigationCoordinator() }
|
||||||
val optionsMenuOpen = remember { mutableStateOf(false) }
|
val optionsMenuOpen = remember { mutableStateOf(false) }
|
||||||
val postLinkUrl = post.url.orEmpty().takeIf {
|
val postLinkUrl = post.url.orEmpty().takeIf {
|
||||||
it != post.imageUrl
|
it != post.imageUrl &&
|
||||||
&& it != post.videoUrl
|
it != post.videoUrl &&
|
||||||
&& !it.looksLikeAnImage
|
!it.looksLikeAnImage &&
|
||||||
&& !it.looksLikeAVideo
|
!it.looksLikeAVideo &&
|
||||||
&& !it.showInEmbeddedWebView
|
!it.showInEmbeddedWebView
|
||||||
}.orEmpty()
|
}.orEmpty()
|
||||||
|
|
||||||
Column(
|
Column(
|
||||||
@ -439,7 +439,7 @@ private fun ExtendedPost(
|
|||||||
},
|
},
|
||||||
onTap = {
|
onTap = {
|
||||||
onClick?.invoke()
|
onClick?.invoke()
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
verticalArrangement = Arrangement.spacedBy(Spacing.xxs),
|
verticalArrangement = Arrangement.spacedBy(Spacing.xxs),
|
||||||
@ -556,13 +556,13 @@ private fun ExtendedPost(
|
|||||||
Modifier.clip(RoundedCornerShape(CornerSize.xl))
|
Modifier.clip(RoundedCornerShape(CornerSize.xl))
|
||||||
} else {
|
} else {
|
||||||
Modifier
|
Modifier
|
||||||
}
|
},
|
||||||
).then(
|
).then(
|
||||||
if (fullHeightImage) {
|
if (fullHeightImage) {
|
||||||
Modifier
|
Modifier
|
||||||
} else {
|
} else {
|
||||||
Modifier.heightIn(max = 200.dp)
|
Modifier.heightIn(max = 200.dp)
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
imageUrl = post.imageUrl,
|
imageUrl = post.imageUrl,
|
||||||
blurred = blurNsfw && post.nsfw,
|
blurred = blurNsfw && post.nsfw,
|
||||||
|
@ -124,7 +124,7 @@ fun PostCardFooter(
|
|||||||
.padding(start = Spacing.xxs)
|
.padding(start = Spacing.xxs)
|
||||||
.background(
|
.background(
|
||||||
color = MaterialTheme.colorScheme.secondary,
|
color = MaterialTheme.colorScheme.secondary,
|
||||||
shape = RoundedCornerShape(CornerSize.s)
|
shape = RoundedCornerShape(CornerSize.s),
|
||||||
)
|
)
|
||||||
.padding(horizontal = Spacing.xxs),
|
.padding(horizontal = Spacing.xxs),
|
||||||
text = "+$unreadComments",
|
text = "+$unreadComments",
|
||||||
@ -149,7 +149,7 @@ fun PostCardFooter(
|
|||||||
Modifier.padding(0.5.dp)
|
Modifier.padding(0.5.dp)
|
||||||
} else {
|
} else {
|
||||||
Modifier
|
Modifier
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
imageVector = if (isShowingUpdateDate) {
|
imageVector = if (isShowingUpdateDate) {
|
||||||
Icons.Default.Update
|
Icons.Default.Update
|
||||||
@ -285,5 +285,3 @@ fun PostCardFooter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -67,8 +67,8 @@ fun PostCardImage(
|
|||||||
initialValue = 0f,
|
initialValue = 0f,
|
||||||
targetValue = 1f,
|
targetValue = 1f,
|
||||||
animationSpec = InfiniteRepeatableSpec(
|
animationSpec = InfiniteRepeatableSpec(
|
||||||
animation = tween(1000)
|
animation = tween(1000),
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
res
|
res
|
||||||
}
|
}
|
||||||
|
@ -39,12 +39,12 @@ fun PostCardPlaceholder(
|
|||||||
) {
|
) {
|
||||||
Row(
|
Row(
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.spacedBy(Spacing.s)
|
horizontalArrangement = Arrangement.spacedBy(Spacing.s),
|
||||||
) {
|
) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier.size(IconSize.s)
|
modifier = Modifier.size(IconSize.s)
|
||||||
.clip(CircleShape)
|
.clip(CircleShape)
|
||||||
.shimmerEffect()
|
.shimmerEffect(),
|
||||||
)
|
)
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.padding(vertical = Spacing.xxxs),
|
modifier = Modifier.padding(vertical = Spacing.xxxs),
|
||||||
@ -54,33 +54,33 @@ fun PostCardPlaceholder(
|
|||||||
modifier = Modifier.height(IconSize.s)
|
modifier = Modifier.height(IconSize.s)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clip(RoundedCornerShape(CornerSize.m))
|
.clip(RoundedCornerShape(CornerSize.m))
|
||||||
.shimmerEffect()
|
.shimmerEffect(),
|
||||||
)
|
)
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier.height(IconSize.s)
|
modifier = Modifier.height(IconSize.s)
|
||||||
.fillMaxWidth(0.5f)
|
.fillMaxWidth(0.5f)
|
||||||
.clip(RoundedCornerShape(CornerSize.m))
|
.clip(RoundedCornerShape(CornerSize.m))
|
||||||
.shimmerEffect()
|
.shimmerEffect(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Row(
|
Row(
|
||||||
verticalAlignment = Alignment.Top,
|
verticalAlignment = Alignment.Top,
|
||||||
horizontalArrangement = Arrangement.spacedBy(Spacing.xs)
|
horizontalArrangement = Arrangement.spacedBy(Spacing.xs),
|
||||||
) {
|
) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.weight(0.2f)
|
.weight(0.2f)
|
||||||
.aspectRatio(1.33f)
|
.aspectRatio(1.33f)
|
||||||
.clip(RoundedCornerShape(CornerSize.s))
|
.clip(RoundedCornerShape(CornerSize.s))
|
||||||
.shimmerEffect()
|
.shimmerEffect(),
|
||||||
)
|
)
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.height(40.dp)
|
.height(40.dp)
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
.clip(RoundedCornerShape(CornerSize.m))
|
.clip(RoundedCornerShape(CornerSize.m))
|
||||||
.shimmerEffect()
|
.shimmerEffect(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Box(
|
Box(
|
||||||
@ -88,7 +88,7 @@ fun PostCardPlaceholder(
|
|||||||
.height(IconSize.l)
|
.height(IconSize.l)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clip(RoundedCornerShape(CornerSize.s))
|
.clip(RoundedCornerShape(CornerSize.s))
|
||||||
.shimmerEffect()
|
.shimmerEffect(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -106,13 +106,13 @@ fun PostCardPlaceholder(
|
|||||||
) {
|
) {
|
||||||
Row(
|
Row(
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.spacedBy(Spacing.s)
|
horizontalArrangement = Arrangement.spacedBy(Spacing.s),
|
||||||
) {
|
) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(IconSize.l)
|
.size(IconSize.l)
|
||||||
.clip(CircleShape)
|
.clip(CircleShape)
|
||||||
.shimmerEffect()
|
.shimmerEffect(),
|
||||||
)
|
)
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.padding(vertical = Spacing.xxxs),
|
modifier = Modifier.padding(vertical = Spacing.xxxs),
|
||||||
@ -122,13 +122,13 @@ fun PostCardPlaceholder(
|
|||||||
modifier = Modifier.height(IconSize.s)
|
modifier = Modifier.height(IconSize.s)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clip(RoundedCornerShape(CornerSize.m))
|
.clip(RoundedCornerShape(CornerSize.m))
|
||||||
.shimmerEffect()
|
.shimmerEffect(),
|
||||||
)
|
)
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier.height(IconSize.s)
|
modifier = Modifier.height(IconSize.s)
|
||||||
.fillMaxWidth(0.5f)
|
.fillMaxWidth(0.5f)
|
||||||
.clip(RoundedCornerShape(CornerSize.m))
|
.clip(RoundedCornerShape(CornerSize.m))
|
||||||
.shimmerEffect()
|
.shimmerEffect(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -136,21 +136,21 @@ fun PostCardPlaceholder(
|
|||||||
modifier = Modifier.height(IconSize.l)
|
modifier = Modifier.height(IconSize.l)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clip(RoundedCornerShape(CornerSize.m))
|
.clip(RoundedCornerShape(CornerSize.m))
|
||||||
.shimmerEffect()
|
.shimmerEffect(),
|
||||||
)
|
)
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.height(200.dp)
|
.height(200.dp)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clip(RoundedCornerShape(CornerSize.s))
|
.clip(RoundedCornerShape(CornerSize.s))
|
||||||
.shimmerEffect()
|
.shimmerEffect(),
|
||||||
)
|
)
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.height(IconSize.l)
|
.height(IconSize.l)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clip(RoundedCornerShape(CornerSize.m))
|
.clip(RoundedCornerShape(CornerSize.m))
|
||||||
.shimmerEffect()
|
.shimmerEffect(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -162,13 +162,13 @@ fun PostCardPlaceholder(
|
|||||||
) {
|
) {
|
||||||
Row(
|
Row(
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.spacedBy(Spacing.s)
|
horizontalArrangement = Arrangement.spacedBy(Spacing.s),
|
||||||
) {
|
) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(IconSize.l)
|
.size(IconSize.l)
|
||||||
.clip(CircleShape)
|
.clip(CircleShape)
|
||||||
.shimmerEffect()
|
.shimmerEffect(),
|
||||||
)
|
)
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.padding(vertical = Spacing.xxxs),
|
modifier = Modifier.padding(vertical = Spacing.xxxs),
|
||||||
@ -178,13 +178,13 @@ fun PostCardPlaceholder(
|
|||||||
modifier = Modifier.height(IconSize.s)
|
modifier = Modifier.height(IconSize.s)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clip(RoundedCornerShape(CornerSize.m))
|
.clip(RoundedCornerShape(CornerSize.m))
|
||||||
.shimmerEffect()
|
.shimmerEffect(),
|
||||||
)
|
)
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier.height(IconSize.s)
|
modifier = Modifier.height(IconSize.s)
|
||||||
.fillMaxWidth(0.5f)
|
.fillMaxWidth(0.5f)
|
||||||
.clip(RoundedCornerShape(CornerSize.m))
|
.clip(RoundedCornerShape(CornerSize.m))
|
||||||
.shimmerEffect()
|
.shimmerEffect(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -193,21 +193,21 @@ fun PostCardPlaceholder(
|
|||||||
.height(IconSize.l)
|
.height(IconSize.l)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clip(RoundedCornerShape(CornerSize.m))
|
.clip(RoundedCornerShape(CornerSize.m))
|
||||||
.shimmerEffect()
|
.shimmerEffect(),
|
||||||
)
|
)
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.height(200.dp)
|
.height(200.dp)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clip(RoundedCornerShape(CornerSize.s))
|
.clip(RoundedCornerShape(CornerSize.s))
|
||||||
.shimmerEffect()
|
.shimmerEffect(),
|
||||||
)
|
)
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.height(IconSize.l)
|
.height(IconSize.l)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clip(RoundedCornerShape(CornerSize.m))
|
.clip(RoundedCornerShape(CornerSize.m))
|
||||||
.shimmerEffect()
|
.shimmerEffect(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ fun PostCardVideo(
|
|||||||
url = url,
|
url = url,
|
||||||
onPlaybackStarted = {
|
onPlaybackStarted = {
|
||||||
loading = false
|
loading = false
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
if (loading) {
|
if (loading) {
|
||||||
Box(
|
Box(
|
||||||
|
@ -40,7 +40,7 @@ fun PostLinkBanner(
|
|||||||
text = url,
|
text = url,
|
||||||
maxLines = 1,
|
maxLines = 1,
|
||||||
overflow = TextOverflow.Ellipsis,
|
overflow = TextOverflow.Ellipsis,
|
||||||
style = MaterialTheme.typography.labelMedium
|
style = MaterialTheme.typography.labelMedium,
|
||||||
)
|
)
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.Default.Link,
|
imageVector = Icons.Default.Link,
|
||||||
|
@ -48,7 +48,7 @@ fun SettingsFormattedInfo(
|
|||||||
text = value,
|
text = value,
|
||||||
onClick = {
|
onClick = {
|
||||||
onEdit?.invoke()
|
onEdit?.invoke()
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ import com.github.diegoberaldin.raccoonforlemmy.core.utils.compose.onClick
|
|||||||
fun SettingsImageInfo(
|
fun SettingsImageInfo(
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
imageModifier: Modifier = Modifier,
|
imageModifier: Modifier = Modifier,
|
||||||
contentScale : ContentScale = ContentScale.FillBounds,
|
contentScale: ContentScale = ContentScale.FillBounds,
|
||||||
title: String = "",
|
title: String = "",
|
||||||
url: String = "",
|
url: String = "",
|
||||||
onEdit: (() -> Unit)? = null,
|
onEdit: (() -> Unit)? = null,
|
||||||
|
@ -51,7 +51,7 @@ fun SettingsIntValueRow(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Row(
|
Row(
|
||||||
verticalAlignment = Alignment.CenterVertically
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
) {
|
) {
|
||||||
FeedbackButton(
|
FeedbackButton(
|
||||||
imageVector = Icons.Default.RemoveCircleOutline,
|
imageVector = Icons.Default.RemoveCircleOutline,
|
||||||
|
@ -67,7 +67,7 @@ fun SettingsRow(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.weight(1f)
|
modifier = Modifier.weight(1f),
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = title,
|
text = title,
|
||||||
|
@ -46,7 +46,7 @@ fun SettingsSwitchRow(
|
|||||||
checked = value,
|
checked = value,
|
||||||
onCheckedChange = {
|
onCheckedChange = {
|
||||||
onValueChanged(it)
|
onValueChanged(it)
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ fun TextFormattingBar(
|
|||||||
it.text.substring(
|
it.text.substring(
|
||||||
selection.start,
|
selection.start,
|
||||||
selection.end,
|
selection.end,
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
append("**")
|
append("**")
|
||||||
@ -80,7 +80,7 @@ fun TextFormattingBar(
|
|||||||
it.text.substring(
|
it.text.substring(
|
||||||
selection.end,
|
selection.end,
|
||||||
it.text.length,
|
it.text.length,
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val newSelection = if (selection.collapsed) {
|
val newSelection = if (selection.collapsed) {
|
||||||
@ -120,7 +120,7 @@ fun TextFormattingBar(
|
|||||||
it.text.substring(
|
it.text.substring(
|
||||||
selection.start,
|
selection.start,
|
||||||
selection.end,
|
selection.end,
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
append("*")
|
append("*")
|
||||||
@ -128,7 +128,7 @@ fun TextFormattingBar(
|
|||||||
it.text.substring(
|
it.text.substring(
|
||||||
selection.end,
|
selection.end,
|
||||||
it.text.length,
|
it.text.length,
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val newSelection = if (selection.collapsed) {
|
val newSelection = if (selection.collapsed) {
|
||||||
@ -168,7 +168,7 @@ fun TextFormattingBar(
|
|||||||
it.text.substring(
|
it.text.substring(
|
||||||
selection.start,
|
selection.start,
|
||||||
selection.end,
|
selection.end,
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
append("~~")
|
append("~~")
|
||||||
@ -176,7 +176,7 @@ fun TextFormattingBar(
|
|||||||
it.text.substring(
|
it.text.substring(
|
||||||
selection.end,
|
selection.end,
|
||||||
it.text.length,
|
it.text.length,
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val newSelection = if (selection.collapsed) {
|
val newSelection = if (selection.collapsed) {
|
||||||
@ -232,7 +232,7 @@ fun TextFormattingBar(
|
|||||||
it.text.substring(
|
it.text.substring(
|
||||||
selection.start,
|
selection.start,
|
||||||
selection.end,
|
selection.end,
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
append("](")
|
append("](")
|
||||||
@ -242,7 +242,7 @@ fun TextFormattingBar(
|
|||||||
it.text.substring(
|
it.text.substring(
|
||||||
selection.end,
|
selection.end,
|
||||||
it.text.length,
|
it.text.length,
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val newSelection = if (selection.collapsed) {
|
val newSelection = if (selection.collapsed) {
|
||||||
@ -282,7 +282,7 @@ fun TextFormattingBar(
|
|||||||
it.text.substring(
|
it.text.substring(
|
||||||
selection.start,
|
selection.start,
|
||||||
selection.end,
|
selection.end,
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
append("`")
|
append("`")
|
||||||
@ -290,7 +290,7 @@ fun TextFormattingBar(
|
|||||||
it.text.substring(
|
it.text.substring(
|
||||||
selection.end,
|
selection.end,
|
||||||
it.text.length,
|
it.text.length,
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val newSelection = if (selection.collapsed) {
|
val newSelection = if (selection.collapsed) {
|
||||||
@ -327,7 +327,7 @@ fun TextFormattingBar(
|
|||||||
it.text.substring(
|
it.text.substring(
|
||||||
selection.end,
|
selection.end,
|
||||||
it.text.length,
|
it.text.length,
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val newSelection = TextRange(index = selection.start + 3)
|
val newSelection = TextRange(index = selection.start + 3)
|
||||||
@ -357,7 +357,7 @@ fun TextFormattingBar(
|
|||||||
it.text.substring(
|
it.text.substring(
|
||||||
selection.end,
|
selection.end,
|
||||||
it.text.length,
|
it.text.length,
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val newSelection = TextRange(index = selection.start + 3)
|
val newSelection = TextRange(index = selection.start + 3)
|
||||||
@ -387,7 +387,7 @@ fun TextFormattingBar(
|
|||||||
it.text.substring(
|
it.text.substring(
|
||||||
selection.end,
|
selection.end,
|
||||||
it.text.length,
|
it.text.length,
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val newSelection = TextRange(index = selection.start + 4)
|
val newSelection = TextRange(index = selection.start + 4)
|
||||||
|
@ -86,7 +86,7 @@ fun UserHeader(
|
|||||||
Row(
|
Row(
|
||||||
modifier = Modifier.fillMaxWidth().padding(Spacing.s).align(Alignment.Center),
|
modifier = Modifier.fillMaxWidth().padding(Spacing.s).align(Alignment.Center),
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.spacedBy(Spacing.m)
|
horizontalArrangement = Arrangement.spacedBy(Spacing.m),
|
||||||
) {
|
) {
|
||||||
// avatar
|
// avatar
|
||||||
val userAvatar = user.avatar.orEmpty()
|
val userAvatar = user.avatar.orEmpty()
|
||||||
@ -142,7 +142,7 @@ fun UserHeader(
|
|||||||
Icon(
|
Icon(
|
||||||
modifier = Modifier.size(iconSize),
|
modifier = Modifier.size(iconSize),
|
||||||
imageVector = Icons.AutoMirrored.Default.Article,
|
imageVector = Icons.AutoMirrored.Default.Article,
|
||||||
contentDescription = null
|
contentDescription = null,
|
||||||
)
|
)
|
||||||
Text(
|
Text(
|
||||||
text = postScore.getPrettyNumber(
|
text = postScore.getPrettyNumber(
|
||||||
@ -160,7 +160,7 @@ fun UserHeader(
|
|||||||
Icon(
|
Icon(
|
||||||
modifier = Modifier.size(iconSize),
|
modifier = Modifier.size(iconSize),
|
||||||
imageVector = Icons.AutoMirrored.Default.Reply,
|
imageVector = Icons.AutoMirrored.Default.Reply,
|
||||||
contentDescription = null
|
contentDescription = null,
|
||||||
)
|
)
|
||||||
Text(
|
Text(
|
||||||
text = commentScore.getPrettyNumber(
|
text = commentScore.getPrettyNumber(
|
||||||
@ -179,7 +179,7 @@ fun UserHeader(
|
|||||||
Icon(
|
Icon(
|
||||||
modifier = Modifier.size(iconSize),
|
modifier = Modifier.size(iconSize),
|
||||||
imageVector = Icons.Default.Cake,
|
imageVector = Icons.Default.Cake,
|
||||||
contentDescription = null
|
contentDescription = null,
|
||||||
)
|
)
|
||||||
Text(
|
Text(
|
||||||
text = user.accountAge.prettifyDate(),
|
text = user.accountAge.prettifyDate(),
|
||||||
|
@ -9,4 +9,4 @@ actual fun getFabNestedScrollConnection(): FabNestedScrollConnection =
|
|||||||
|
|
||||||
object LemmyUiDiHelper : KoinComponent {
|
object LemmyUiDiHelper : KoinComponent {
|
||||||
val fabNestedScrollConnection: FabNestedScrollConnection by inject()
|
val fabNestedScrollConnection: FabNestedScrollConnection by inject()
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ kotlin {
|
|||||||
listOf(
|
listOf(
|
||||||
iosX64(),
|
iosX64(),
|
||||||
iosArm64(),
|
iosArm64(),
|
||||||
iosSimulatorArm64()
|
iosSimulatorArm64(),
|
||||||
).forEach {
|
).forEach {
|
||||||
it.binaries.framework {
|
it.binaries.framework {
|
||||||
baseName = "modals"
|
baseName = "modals"
|
||||||
|
@ -63,7 +63,7 @@ class AppIconBottomSheet : Screen {
|
|||||||
onTap = {
|
onTap = {
|
||||||
navigationCoordinator.hideBottomSheet()
|
navigationCoordinator.hideBottomSheet()
|
||||||
notificationCenter.send(
|
notificationCenter.send(
|
||||||
NotificationCenterEvent.AppIconVariantSelected(value.toInt())
|
NotificationCenterEvent.AppIconVariantSelected(value.toInt()),
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@ -72,4 +72,3 @@ class AppIconBottomSheet : Screen {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ class BarThemeBottomSheet : Screen {
|
|||||||
),
|
),
|
||||||
verticalArrangement = Arrangement.spacedBy(Spacing.s),
|
verticalArrangement = Arrangement.spacedBy(Spacing.s),
|
||||||
) {
|
) {
|
||||||
BottomSheetHeader(LocalXmlStrings.current.settingsBarTheme,)
|
BottomSheetHeader(LocalXmlStrings.current.settingsBarTheme)
|
||||||
val values = listOf(
|
val values = listOf(
|
||||||
UiBarTheme.Transparent,
|
UiBarTheme.Transparent,
|
||||||
UiBarTheme.Opaque,
|
UiBarTheme.Opaque,
|
||||||
@ -62,7 +62,7 @@ class BarThemeBottomSheet : Screen {
|
|||||||
.onClick(
|
.onClick(
|
||||||
onClick = {
|
onClick = {
|
||||||
notificationCenter.send(
|
notificationCenter.send(
|
||||||
NotificationCenterEvent.ChangeSystemBarTheme(value)
|
NotificationCenterEvent.ChangeSystemBarTheme(value),
|
||||||
)
|
)
|
||||||
navigationCoordinator.hideBottomSheet()
|
navigationCoordinator.hideBottomSheet()
|
||||||
},
|
},
|
||||||
|
@ -101,16 +101,16 @@ class BlockBottomSheet(
|
|||||||
onClick = {
|
onClick = {
|
||||||
val event = when (value.first) {
|
val event = when (value.first) {
|
||||||
BlockActionType.Community -> NotificationCenterEvent.BlockActionSelected(
|
BlockActionType.Community -> NotificationCenterEvent.BlockActionSelected(
|
||||||
communityId = value.second
|
communityId = value.second,
|
||||||
)
|
)
|
||||||
|
|
||||||
BlockActionType.Instance ->
|
BlockActionType.Instance ->
|
||||||
NotificationCenterEvent.BlockActionSelected(
|
NotificationCenterEvent.BlockActionSelected(
|
||||||
instanceId = value.second
|
instanceId = value.second,
|
||||||
)
|
)
|
||||||
|
|
||||||
BlockActionType.User -> NotificationCenterEvent.BlockActionSelected(
|
BlockActionType.User -> NotificationCenterEvent.BlockActionSelected(
|
||||||
userId = value.second
|
userId = value.second,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
notificationCenter.send(event)
|
notificationCenter.send(event)
|
||||||
|
@ -59,7 +59,7 @@ class DurationBottomSheet(
|
|||||||
),
|
),
|
||||||
verticalArrangement = Arrangement.spacedBy(Spacing.s),
|
verticalArrangement = Arrangement.spacedBy(Spacing.s),
|
||||||
) {
|
) {
|
||||||
val title = when (type) {
|
val title = when (type) {
|
||||||
DurationBottomSheetType.ZOMBIE_MODE_INTERVAL -> LocalXmlStrings.current.settingsZombieModeInterval
|
DurationBottomSheetType.ZOMBIE_MODE_INTERVAL -> LocalXmlStrings.current.settingsZombieModeInterval
|
||||||
DurationBottomSheetType.INBOX_CHECK_PERIOD -> LocalXmlStrings.current.settingsInboxBackgroundCheckPeriod
|
DurationBottomSheetType.INBOX_CHECK_PERIOD -> LocalXmlStrings.current.settingsInboxBackgroundCheckPeriod
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ fun EditFormattedInfoDialog(
|
|||||||
Spacer(modifier = Modifier.height(Spacing.s))
|
Spacer(modifier = Modifier.height(Spacing.s))
|
||||||
|
|
||||||
Column(
|
Column(
|
||||||
verticalArrangement = Arrangement.spacedBy(Spacing.xs)
|
verticalArrangement = Arrangement.spacedBy(Spacing.xs),
|
||||||
) {
|
) {
|
||||||
SectionSelector(
|
SectionSelector(
|
||||||
titles = listOf(
|
titles = listOf(
|
||||||
@ -96,7 +96,7 @@ fun EditFormattedInfoDialog(
|
|||||||
else -> CreatePostSection.Edit
|
else -> CreatePostSection.Edit
|
||||||
}
|
}
|
||||||
currentSection = section
|
currentSection = section
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
if (currentSection == CreatePostSection.Edit) {
|
if (currentSection == CreatePostSection.Edit) {
|
||||||
@ -141,7 +141,7 @@ fun EditFormattedInfoDialog(
|
|||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.height(400.dp)
|
.height(400.dp)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth(),
|
||||||
) {
|
) {
|
||||||
PostCardBody(
|
PostCardBody(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
@ -57,7 +57,7 @@ class InboxTypeSheet : Screen {
|
|||||||
.onClick(
|
.onClick(
|
||||||
onClick = {
|
onClick = {
|
||||||
notificationCenter.send(
|
notificationCenter.send(
|
||||||
NotificationCenterEvent.ChangeInboxType(true)
|
NotificationCenterEvent.ChangeInboxType(true),
|
||||||
)
|
)
|
||||||
navigationCoordinator.hideBottomSheet()
|
navigationCoordinator.hideBottomSheet()
|
||||||
},
|
},
|
||||||
@ -79,7 +79,7 @@ class InboxTypeSheet : Screen {
|
|||||||
).onClick(
|
).onClick(
|
||||||
onClick = {
|
onClick = {
|
||||||
notificationCenter.send(
|
notificationCenter.send(
|
||||||
NotificationCenterEvent.ChangeInboxType(false)
|
NotificationCenterEvent.ChangeInboxType(false),
|
||||||
)
|
)
|
||||||
navigationCoordinator.hideBottomSheet()
|
navigationCoordinator.hideBottomSheet()
|
||||||
},
|
},
|
||||||
|
@ -100,7 +100,7 @@ class LanguageBottomSheet : Screen {
|
|||||||
.onClick(
|
.onClick(
|
||||||
onClick = {
|
onClick = {
|
||||||
notificationCenter.send(
|
notificationCenter.send(
|
||||||
NotificationCenterEvent.ChangeLanguage(value)
|
NotificationCenterEvent.ChangeLanguage(value),
|
||||||
)
|
)
|
||||||
navigationCoordinator.hideBottomSheet()
|
navigationCoordinator.hideBottomSheet()
|
||||||
},
|
},
|
||||||
|
@ -57,7 +57,7 @@ class LikedTypeSheet : Screen {
|
|||||||
.onClick(
|
.onClick(
|
||||||
onClick = {
|
onClick = {
|
||||||
notificationCenter.send(
|
notificationCenter.send(
|
||||||
NotificationCenterEvent.ChangedLikedType(true)
|
NotificationCenterEvent.ChangedLikedType(true),
|
||||||
)
|
)
|
||||||
navigationCoordinator.hideBottomSheet()
|
navigationCoordinator.hideBottomSheet()
|
||||||
},
|
},
|
||||||
@ -79,7 +79,7 @@ class LikedTypeSheet : Screen {
|
|||||||
).onClick(
|
).onClick(
|
||||||
onClick = {
|
onClick = {
|
||||||
notificationCenter.send(
|
notificationCenter.send(
|
||||||
NotificationCenterEvent.ChangedLikedType(false)
|
NotificationCenterEvent.ChangedLikedType(false),
|
||||||
)
|
)
|
||||||
navigationCoordinator.hideBottomSheet()
|
navigationCoordinator.hideBottomSheet()
|
||||||
},
|
},
|
||||||
|
@ -76,7 +76,7 @@ class ListingTypeBottomSheet(
|
|||||||
NotificationCenterEvent.ChangeFeedType(
|
NotificationCenterEvent.ChangeFeedType(
|
||||||
value = value,
|
value = value,
|
||||||
screenKey = screenKey,
|
screenKey = screenKey,
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
navigationCoordinator.hideBottomSheet()
|
navigationCoordinator.hideBottomSheet()
|
||||||
},
|
},
|
||||||
|
@ -63,7 +63,7 @@ class ModeratorZoneBottomSheet : Screen {
|
|||||||
notificationCenter.send(
|
notificationCenter.send(
|
||||||
NotificationCenterEvent.ModeratorZoneActionSelected(
|
NotificationCenterEvent.ModeratorZoneActionSelected(
|
||||||
value.toInt(),
|
value.toInt(),
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -34,8 +34,8 @@ class PostBodyMaxLinesBottomSheet(
|
|||||||
10,
|
10,
|
||||||
30,
|
30,
|
||||||
50,
|
50,
|
||||||
-1,// custom number
|
-1, // custom number
|
||||||
null,// unlimited
|
null, // unlimited
|
||||||
),
|
),
|
||||||
) : Screen {
|
) : Screen {
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ class PostBodyMaxLinesBottomSheet(
|
|||||||
),
|
),
|
||||||
verticalArrangement = Arrangement.spacedBy(Spacing.s),
|
verticalArrangement = Arrangement.spacedBy(Spacing.s),
|
||||||
) {
|
) {
|
||||||
BottomSheetHeader(LocalXmlStrings.current.settingsPostBodyMaxLines)
|
BottomSheetHeader(LocalXmlStrings.current.settingsPostBodyMaxLines)
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.fillMaxWidth().verticalScroll(rememberScrollState()),
|
modifier = Modifier.fillMaxWidth().verticalScroll(rememberScrollState()),
|
||||||
verticalArrangement = Arrangement.spacedBy(Spacing.xxs),
|
verticalArrangement = Arrangement.spacedBy(Spacing.xxs),
|
||||||
@ -76,7 +76,7 @@ class PostBodyMaxLinesBottomSheet(
|
|||||||
customDialogOpened = true
|
customDialogOpened = true
|
||||||
} else {
|
} else {
|
||||||
notificationCenter.send(
|
notificationCenter.send(
|
||||||
NotificationCenterEvent.ChangePostBodyMaxLines(value)
|
NotificationCenterEvent.ChangePostBodyMaxLines(value),
|
||||||
)
|
)
|
||||||
navigationCoordinator.hideBottomSheet()
|
navigationCoordinator.hideBottomSheet()
|
||||||
}
|
}
|
||||||
@ -110,7 +110,7 @@ class PostBodyMaxLinesBottomSheet(
|
|||||||
onSubmit = { value ->
|
onSubmit = { value ->
|
||||||
notificationCenter.send(NotificationCenterEvent.ChangePostBodyMaxLines(value))
|
notificationCenter.send(NotificationCenterEvent.ChangePostBodyMaxLines(value))
|
||||||
navigationCoordinator.hideBottomSheet()
|
navigationCoordinator.hideBottomSheet()
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ class PostLayoutBottomSheet : Screen {
|
|||||||
.onClick(
|
.onClick(
|
||||||
onClick = {
|
onClick = {
|
||||||
notificationCenter.send(
|
notificationCenter.send(
|
||||||
NotificationCenterEvent.ChangePostLayout(value)
|
NotificationCenterEvent.ChangePostLayout(value),
|
||||||
)
|
)
|
||||||
navigationCoordinator.hideBottomSheet()
|
navigationCoordinator.hideBottomSheet()
|
||||||
},
|
},
|
||||||
|
@ -57,7 +57,7 @@ class ReportListTypeSheet : Screen {
|
|||||||
.onClick(
|
.onClick(
|
||||||
onClick = {
|
onClick = {
|
||||||
notificationCenter.send(
|
notificationCenter.send(
|
||||||
NotificationCenterEvent.ChangeReportListType(true)
|
NotificationCenterEvent.ChangeReportListType(true),
|
||||||
)
|
)
|
||||||
navigationCoordinator.hideBottomSheet()
|
navigationCoordinator.hideBottomSheet()
|
||||||
},
|
},
|
||||||
@ -79,7 +79,7 @@ class ReportListTypeSheet : Screen {
|
|||||||
).onClick(
|
).onClick(
|
||||||
onClick = {
|
onClick = {
|
||||||
notificationCenter.send(
|
notificationCenter.send(
|
||||||
NotificationCenterEvent.ChangeReportListType(false)
|
NotificationCenterEvent.ChangeReportListType(false),
|
||||||
)
|
)
|
||||||
navigationCoordinator.hideBottomSheet()
|
navigationCoordinator.hideBottomSheet()
|
||||||
},
|
},
|
||||||
|
@ -75,7 +75,7 @@ class ResultTypeBottomSheet(
|
|||||||
NotificationCenterEvent.ChangeSearchResultType(
|
NotificationCenterEvent.ChangeSearchResultType(
|
||||||
value = value,
|
value = value,
|
||||||
screenKey = screenKey,
|
screenKey = screenKey,
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
navigationCoordinator.hideBottomSheet()
|
navigationCoordinator.hideBottomSheet()
|
||||||
},
|
},
|
||||||
|
@ -50,7 +50,7 @@ fun SelectLanguageDialog(
|
|||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(Spacing.xs))
|
Spacer(modifier = Modifier.height(Spacing.xs))
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
modifier = Modifier.fillMaxHeight(0.6f)
|
modifier = Modifier.fillMaxHeight(0.6f),
|
||||||
) {
|
) {
|
||||||
items(items = languages, key = { it.id }) { lang ->
|
items(items = languages, key = { it.id }) { lang ->
|
||||||
LanguageItem(
|
LanguageItem(
|
||||||
|
@ -59,14 +59,14 @@ class SliderBottomSheet(
|
|||||||
valueRange = min.rangeTo(max),
|
valueRange = min.rangeTo(max),
|
||||||
onValueChange = {
|
onValueChange = {
|
||||||
value = it
|
value = it
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(Spacing.s))
|
Spacer(modifier = Modifier.height(Spacing.s))
|
||||||
Button(
|
Button(
|
||||||
onClick = {
|
onClick = {
|
||||||
notificationCenter.send(
|
notificationCenter.send(
|
||||||
NotificationCenterEvent.ChangeZombieScrollAmount(value)
|
NotificationCenterEvent.ChangeZombieScrollAmount(value),
|
||||||
)
|
)
|
||||||
navigationCoordinator.hideBottomSheet()
|
navigationCoordinator.hideBottomSheet()
|
||||||
},
|
},
|
||||||
|
@ -68,7 +68,7 @@ class SortBottomSheet(
|
|||||||
comments = comments,
|
comments = comments,
|
||||||
defaultForCommunity = defaultForCommunity,
|
defaultForCommunity = defaultForCommunity,
|
||||||
screenKey = screenKey,
|
screenKey = screenKey,
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -109,7 +109,7 @@ internal class SortBottomSheetMain(
|
|||||||
comments = comments,
|
comments = comments,
|
||||||
defaultForCommunity = defaultForCommunity,
|
defaultForCommunity = defaultForCommunity,
|
||||||
screenKey = screenKey,
|
screenKey = screenKey,
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
val event = if (comments) {
|
val event = if (comments) {
|
||||||
@ -183,7 +183,7 @@ internal class SortBottomSheetTop(
|
|||||||
) {
|
) {
|
||||||
BottomSheetHeader(SortType.Top.Generic.toReadableName() + "…")
|
BottomSheetHeader(SortType.Top.Generic.toReadableName() + "…")
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier.padding(start = Spacing.xxs)
|
modifier = Modifier.padding(start = Spacing.xxs),
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
@ -70,7 +70,7 @@ class ThemeBottomSheet : Screen {
|
|||||||
.onClick(
|
.onClick(
|
||||||
onClick = {
|
onClick = {
|
||||||
notificationCenter.send(
|
notificationCenter.send(
|
||||||
NotificationCenterEvent.ChangeTheme(value)
|
NotificationCenterEvent.ChangeTheme(value),
|
||||||
)
|
)
|
||||||
navigationCoordinator.hideBottomSheet()
|
navigationCoordinator.hideBottomSheet()
|
||||||
},
|
},
|
||||||
|
@ -32,7 +32,7 @@ class UrlOpeningModeBottomSheet(
|
|||||||
private val values: List<UrlOpeningMode> = listOf(
|
private val values: List<UrlOpeningMode> = listOf(
|
||||||
UrlOpeningMode.Internal,
|
UrlOpeningMode.Internal,
|
||||||
UrlOpeningMode.External,
|
UrlOpeningMode.External,
|
||||||
)
|
),
|
||||||
) : Screen {
|
) : Screen {
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
|
@ -69,7 +69,7 @@ class VoteFormatBottomSheet : Screen {
|
|||||||
.onClick(
|
.onClick(
|
||||||
onClick = {
|
onClick = {
|
||||||
notificationCenter.send(
|
notificationCenter.send(
|
||||||
NotificationCenterEvent.ChangeVoteFormat(value)
|
NotificationCenterEvent.ChangeVoteFormat(value),
|
||||||
)
|
)
|
||||||
navigationCoordinator.hideBottomSheet()
|
navigationCoordinator.hideBottomSheet()
|
||||||
},
|
},
|
||||||
|
@ -23,7 +23,7 @@ kotlin {
|
|||||||
listOf(
|
listOf(
|
||||||
iosX64(),
|
iosX64(),
|
||||||
iosArm64(),
|
iosArm64(),
|
||||||
iosSimulatorArm64()
|
iosSimulatorArm64(),
|
||||||
).forEach {
|
).forEach {
|
||||||
it.binaries.framework {
|
it.binaries.framework {
|
||||||
baseName = "l10n"
|
baseName = "l10n"
|
||||||
|
@ -19,7 +19,7 @@ kotlin {
|
|||||||
listOf(
|
listOf(
|
||||||
iosX64(),
|
iosX64(),
|
||||||
iosArm64(),
|
iosArm64(),
|
||||||
iosSimulatorArm64()
|
iosSimulatorArm64(),
|
||||||
).forEach {
|
).forEach {
|
||||||
it.binaries.framework {
|
it.binaries.framework {
|
||||||
baseName = "markdown"
|
baseName = "markdown"
|
||||||
|
@ -82,7 +82,7 @@ internal fun CustomMarkdownImage(
|
|||||||
initialValue = 0f,
|
initialValue = 0f,
|
||||||
targetValue = 1f,
|
targetValue = 1f,
|
||||||
animationSpec = InfiniteRepeatableSpec(
|
animationSpec = InfiniteRepeatableSpec(
|
||||||
animation = tween(LOADING_ANIMATION_DURATION)
|
animation = tween(LOADING_ANIMATION_DURATION),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
res
|
res
|
||||||
|
@ -107,7 +107,7 @@ fun CustomMarkdownWrapper(
|
|||||||
else -> {
|
else -> {
|
||||||
MarkdownParagraph(
|
MarkdownParagraph(
|
||||||
content = model.content,
|
content = model.content,
|
||||||
node = model.node
|
node = model.node,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,6 @@ private fun String.removeEntities(): String =
|
|||||||
.replace(" ", " ")
|
.replace(" ", " ")
|
||||||
.replace("…", "…")
|
.replace("…", "…")
|
||||||
|
|
||||||
|
|
||||||
private fun String.spoilerFixUp(): String = run {
|
private fun String.spoilerFixUp(): String = run {
|
||||||
val finalLines = mutableListOf<String>()
|
val finalLines = mutableListOf<String>()
|
||||||
var isInsideSpoiler = false
|
var isInsideSpoiler = false
|
||||||
|
@ -19,7 +19,7 @@ kotlin {
|
|||||||
listOf(
|
listOf(
|
||||||
iosX64(),
|
iosX64(),
|
||||||
iosArm64(),
|
iosArm64(),
|
||||||
iosSimulatorArm64()
|
iosSimulatorArm64(),
|
||||||
).forEach {
|
).forEach {
|
||||||
it.binaries.framework {
|
it.binaries.framework {
|
||||||
baseName = "navigation"
|
baseName = "navigation"
|
||||||
|
@ -4,7 +4,6 @@ import com.github.diegoberaldin.raccoonforlemmy.core.navigation.DrawerCoordinato
|
|||||||
import com.github.diegoberaldin.raccoonforlemmy.core.navigation.NavigationCoordinator
|
import com.github.diegoberaldin.raccoonforlemmy.core.navigation.NavigationCoordinator
|
||||||
import org.koin.java.KoinJavaComponent.inject
|
import org.koin.java.KoinJavaComponent.inject
|
||||||
|
|
||||||
|
|
||||||
actual fun getNavigationCoordinator(): NavigationCoordinator {
|
actual fun getNavigationCoordinator(): NavigationCoordinator {
|
||||||
val res: NavigationCoordinator by inject(NavigationCoordinator::class.java)
|
val res: NavigationCoordinator by inject(NavigationCoordinator::class.java)
|
||||||
return res
|
return res
|
||||||
|
@ -64,4 +64,4 @@ class DefaultDrawerCoordinatorTest {
|
|||||||
assertEquals(DrawerEvent.OpenCommunity(community), evt)
|
assertEquals(DrawerEvent.OpenCommunity(community), evt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -205,7 +205,6 @@ class DefaultNavigationCoordinatorTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun whenShowBottomSheet_thenInteractionsAreAsExpected() = runTest {
|
fun whenShowBottomSheet_thenInteractionsAreAsExpected() = runTest {
|
||||||
val screen = object : Screen {
|
val screen = object : Screen {
|
||||||
@ -282,4 +281,4 @@ class DefaultNavigationCoordinatorTest {
|
|||||||
assertEquals(message, item)
|
assertEquals(message, item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,4 +13,4 @@ object CoreNavigationHelper : KoinComponent {
|
|||||||
|
|
||||||
val navigationCoordinator: NavigationCoordinator by inject()
|
val navigationCoordinator: NavigationCoordinator by inject()
|
||||||
val drawerCoordinator: DrawerCoordinator by inject()
|
val drawerCoordinator: DrawerCoordinator by inject()
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ kotlin {
|
|||||||
listOf(
|
listOf(
|
||||||
iosX64(),
|
iosX64(),
|
||||||
iosArm64(),
|
iosArm64(),
|
||||||
iosSimulatorArm64()
|
iosSimulatorArm64(),
|
||||||
).forEach {
|
).forEach {
|
||||||
it.binaries.framework {
|
it.binaries.framework {
|
||||||
baseName = "notifications"
|
baseName = "notifications"
|
||||||
|
@ -21,7 +21,6 @@ class DefaultNotificationCenterTest {
|
|||||||
sut.send(NotificationCenterEvent.Logout)
|
sut.send(NotificationCenterEvent.Logout)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sut.subscribe(NotificationCenterEvent.Logout::class).test {
|
sut.subscribe(NotificationCenterEvent.Logout::class).test {
|
||||||
val evt = awaitItem()
|
val evt = awaitItem()
|
||||||
assertEquals(NotificationCenterEvent.Logout, evt)
|
assertEquals(NotificationCenterEvent.Logout, evt)
|
||||||
@ -67,4 +66,4 @@ class DefaultNotificationCenterTest {
|
|||||||
expectNoEvents()
|
expectNoEvents()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -59,4 +59,3 @@ private fun <T : NotificationCenterEvent> isReplayable(clazz: KClass<T>): Boolea
|
|||||||
else -> false
|
else -> false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ sealed interface NotificationCenterEvent {
|
|||||||
data class ChangeSortType(
|
data class ChangeSortType(
|
||||||
val value: SortType,
|
val value: SortType,
|
||||||
val defaultForCommunity: Boolean,
|
val defaultForCommunity: Boolean,
|
||||||
val screenKey: String?
|
val screenKey: String?,
|
||||||
) :
|
) :
|
||||||
NotificationCenterEvent
|
NotificationCenterEvent
|
||||||
|
|
||||||
|
@ -3,4 +3,3 @@ package com.github.diegoberaldin.raccoonforlemmy.core.notifications.di
|
|||||||
import com.github.diegoberaldin.raccoonforlemmy.core.notifications.NotificationCenter
|
import com.github.diegoberaldin.raccoonforlemmy.core.notifications.NotificationCenter
|
||||||
|
|
||||||
expect fun getNotificationCenter(): NotificationCenter
|
expect fun getNotificationCenter(): NotificationCenter
|
||||||
|
|
||||||
|
@ -8,4 +8,4 @@ actual fun getNotificationCenter(): NotificationCenter = NotificationDiHelper.no
|
|||||||
|
|
||||||
internal object NotificationDiHelper : KoinComponent {
|
internal object NotificationDiHelper : KoinComponent {
|
||||||
val notificationCenter: NotificationCenter by inject()
|
val notificationCenter: NotificationCenter by inject()
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ kotlin {
|
|||||||
listOf(
|
listOf(
|
||||||
iosX64(),
|
iosX64(),
|
||||||
iosArm64(),
|
iosArm64(),
|
||||||
iosSimulatorArm64()
|
iosSimulatorArm64(),
|
||||||
).forEach {
|
).forEach {
|
||||||
it.binaries.framework {
|
it.binaries.framework {
|
||||||
baseName = "persistence"
|
baseName = "persistence"
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user