refactor(common): tweak visibility of module members

This commit is contained in:
Harsh Shandilya 2022-12-12 12:47:23 +05:30
parent c7b7a786f3
commit 7d324ddb8c
No known key found for this signature in database
8 changed files with 22 additions and 22 deletions

View file

@ -6,7 +6,7 @@
*/
package dev.msfjarvis.claw.common
sealed class NetworkState {
internal sealed class NetworkState {
class Success<T>(val data: T) : NetworkState()
class Error(val error: Throwable, val description: String) : NetworkState()
object Loading : NetworkState()

View file

@ -47,7 +47,7 @@ import java.time.Instant
import java.time.temporal.TemporalAccessor
@Composable
fun CommentsHeader(
internal fun CommentsHeader(
postDetails: LobstersPostDetails,
postActions: PostActions,
htmlConverter: HTMLConverter,
@ -98,7 +98,7 @@ fun CommentsHeader(
}
@Composable
fun PostLink(
private fun PostLink(
linkMetadata: LinkMetadata,
modifier: Modifier = Modifier,
) {
@ -130,7 +130,7 @@ private val CommentEntryPadding = 16f.dp
@OptIn(ExperimentalAnimationApi::class)
@Composable
fun CommentEntry(
internal fun CommentEntry(
commentNode: CommentNode,
htmlConverter: HTMLConverter,
toggleExpanded: (CommentNode) -> Unit,

View file

@ -10,7 +10,7 @@ import androidx.compose.foundation.lazy.LazyListScope
import androidx.compose.material3.Divider
import dev.msfjarvis.claw.model.Comment
data class CommentNode(
internal data class CommentNode(
val comment: Comment,
var parent: CommentNode? = null,
val children: MutableList<CommentNode> = mutableListOf(),
@ -26,7 +26,7 @@ data class CommentNode(
}
}
fun createListNode(comments: List<Comment>): MutableList<CommentNode> {
internal fun createListNode(comments: List<Comment>): MutableList<CommentNode> {
val commentNodes = mutableListOf<CommentNode>()
for (i in comments.indices) {
@ -40,7 +40,7 @@ fun createListNode(comments: List<Comment>): MutableList<CommentNode> {
return commentNodes
}
fun toggleAllExpanded(commentNode: CommentNode): CommentNode {
internal fun toggleAllExpanded(commentNode: CommentNode): CommentNode {
commentNode.isExpanded = !commentNode.isExpanded
if (commentNode.children.isNotEmpty()) {
@ -49,7 +49,7 @@ fun toggleAllExpanded(commentNode: CommentNode): CommentNode {
return commentNode
}
fun findTopMostParent(node: CommentNode): CommentNode {
internal fun findTopMostParent(node: CommentNode): CommentNode {
val parent = node.parent
return if (parent != null) {
findTopMostParent(parent)
@ -58,7 +58,7 @@ fun findTopMostParent(node: CommentNode): CommentNode {
}
}
fun LazyListScope.nodes(
internal fun LazyListScope.nodes(
nodes: List<CommentNode>,
htmlConverter: HTMLConverter,
toggleExpanded: (CommentNode) -> Unit,
@ -72,7 +72,7 @@ fun LazyListScope.nodes(
}
}
fun LazyListScope.node(
private fun LazyListScope.node(
node: CommentNode,
htmlConverter: HTMLConverter,
toggleExpanded: (CommentNode) -> Unit,

View file

@ -115,7 +115,7 @@ fun PostDetails(post: SavedPost, modifier: Modifier = Modifier) {
}
@Composable
fun PostTitle(
internal fun PostTitle(
title: String,
modifier: Modifier = Modifier,
) {
@ -128,7 +128,7 @@ fun PostTitle(
}
@Composable
fun Submitter(
internal fun Submitter(
text: AnnotatedString,
avatarUrl: String,
contentDescription: String,
@ -151,7 +151,7 @@ fun Submitter(
}
@Composable
fun SaveButton(
private fun SaveButton(
isSaved: Boolean,
modifier: Modifier = Modifier,
) {
@ -169,7 +169,7 @@ fun SaveButton(
@Composable
@OptIn(ExperimentalMaterial3Api::class)
fun CommentsButton(
private fun CommentsButton(
commentCount: Int?,
modifier: Modifier = Modifier,
) {
@ -200,7 +200,7 @@ fun CommentsButton(
}
@Composable
fun TagRow(
internal fun TagRow(
tags: List<String>,
modifier: Modifier = Modifier,
) {
@ -214,7 +214,7 @@ fun TagRow(
}
@Composable
fun TagText(
private fun TagText(
tag: String,
modifier: Modifier = Modifier,
) {

View file

@ -19,7 +19,7 @@ import androidx.compose.runtime.ProvidedValue
import androidx.compose.ui.platform.LocalContext
import com.halilibo.richtext.ui.material3.SetupMaterial3RichText
internal val LightThemeColors =
private val LightThemeColors =
lightColorScheme(
primary = md_theme_light_primary,
onPrimary = md_theme_light_onPrimary,
@ -48,7 +48,7 @@ internal val LightThemeColors =
inverseSurface = md_theme_light_inverseSurface,
)
internal val DarkThemeColors =
private val DarkThemeColors =
darkColorScheme(
primary = md_theme_dark_primary,
onPrimary = md_theme_dark_onPrimary,

View file

@ -23,7 +23,7 @@ import dev.msfjarvis.claw.common.theme.LobstersTheme
import dev.msfjarvis.claw.common.ui.preview.ThemePreviews
@Composable
fun ThemedRichText(
internal fun ThemedRichText(
text: String,
modifier: Modifier = Modifier,
) {
@ -50,7 +50,7 @@ fun ThemedRichText(
@ThemePreviews
@Composable
fun ThemedRichTextPreview() {
internal fun ThemedRichTextPreview() {
val text =
"""
### Heading

View file

@ -72,6 +72,6 @@ fun NetworkError(
@ThemePreviews
@Composable
fun NetworkErrorPreview() {
internal fun NetworkErrorPreview() {
LobstersTheme { NetworkError(label = "Failed to load posts", error = Throwable("Preview")) }
}

View file

@ -12,7 +12,7 @@ import androidx.compose.ui.graphics.painter.Painter
import coil.compose.AsyncImage
@Composable
fun NetworkImage(
internal fun NetworkImage(
url: String?,
placeholder: Painter,
contentDescription: String,