Moves the image border modifier to an app variable.
This commit is contained in:
@@ -5,7 +5,6 @@ import android.util.Log
|
|||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.compose.foundation.ExperimentalFoundationApi
|
import androidx.compose.foundation.ExperimentalFoundationApi
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.border
|
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.combinedClickable
|
import androidx.compose.foundation.combinedClickable
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
@@ -73,9 +72,8 @@ import com.vitorpamplona.amethyst.ui.actions.CloseButton
|
|||||||
import com.vitorpamplona.amethyst.ui.actions.LoadingAnimation
|
import com.vitorpamplona.amethyst.ui.actions.LoadingAnimation
|
||||||
import com.vitorpamplona.amethyst.ui.actions.SaveToGallery
|
import com.vitorpamplona.amethyst.ui.actions.SaveToGallery
|
||||||
import com.vitorpamplona.amethyst.ui.note.BlankNote
|
import com.vitorpamplona.amethyst.ui.note.BlankNote
|
||||||
import com.vitorpamplona.amethyst.ui.theme.QuoteBorder
|
|
||||||
import com.vitorpamplona.amethyst.ui.theme.hashVerified
|
import com.vitorpamplona.amethyst.ui.theme.hashVerified
|
||||||
import com.vitorpamplona.amethyst.ui.theme.subtleBorder
|
import com.vitorpamplona.amethyst.ui.theme.imageModifier
|
||||||
import kotlinx.collections.immutable.ImmutableList
|
import kotlinx.collections.immutable.ImmutableList
|
||||||
import kotlinx.collections.immutable.toImmutableList
|
import kotlinx.collections.immutable.toImmutableList
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
@@ -175,14 +173,7 @@ fun ZoomableContentView(content: ZoomableContent, images: ImmutableList<Zoomable
|
|||||||
mutableStateOf(false)
|
mutableStateOf(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
var mainImageModifier = Modifier
|
var mainImageModifier = MaterialTheme.colors.imageModifier
|
||||||
.fillMaxWidth()
|
|
||||||
.clip(shape = QuoteBorder)
|
|
||||||
.border(
|
|
||||||
1.dp,
|
|
||||||
MaterialTheme.colors.subtleBorder,
|
|
||||||
QuoteBorder
|
|
||||||
)
|
|
||||||
|
|
||||||
if (content is ZoomableUrlContent) {
|
if (content is ZoomableUrlContent) {
|
||||||
mainImageModifier = mainImageModifier.combinedClickable(
|
mainImageModifier = mainImageModifier.combinedClickable(
|
||||||
|
|||||||
@@ -96,6 +96,24 @@ val RepostPictureBorderLight = Modifier.border(
|
|||||||
CircleShape
|
CircleShape
|
||||||
)
|
)
|
||||||
|
|
||||||
|
val DarkImageModifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.clip(shape = QuoteBorder)
|
||||||
|
.border(
|
||||||
|
1.dp,
|
||||||
|
DarkSubtleBorder,
|
||||||
|
QuoteBorder
|
||||||
|
)
|
||||||
|
|
||||||
|
val LightImageModifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.clip(shape = QuoteBorder)
|
||||||
|
.border(
|
||||||
|
1.dp,
|
||||||
|
LightSubtleBorder,
|
||||||
|
QuoteBorder
|
||||||
|
)
|
||||||
|
|
||||||
val MarkDownStyleOnDark = richTextDefaults.copy(
|
val MarkDownStyleOnDark = richTextDefaults.copy(
|
||||||
paragraphSpacing = DefaultParagraphSpacing,
|
paragraphSpacing = DefaultParagraphSpacing,
|
||||||
headingStyle = DefaultHeadingStyle,
|
headingStyle = DefaultHeadingStyle,
|
||||||
@@ -209,6 +227,9 @@ val Colors.markdownStyle: RichTextStyle
|
|||||||
val Colors.repostProfileBorder: Modifier
|
val Colors.repostProfileBorder: Modifier
|
||||||
get() = if (isLight) RepostPictureBorderLight else RepostPictureBorderDark
|
get() = if (isLight) RepostPictureBorderLight else RepostPictureBorderDark
|
||||||
|
|
||||||
|
val Colors.imageModifier: Modifier
|
||||||
|
get() = if (isLight) LightImageModifier else DarkImageModifier
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun AmethystTheme(darkTheme: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit) {
|
fun AmethystTheme(darkTheme: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit) {
|
||||||
val colors = if (darkTheme) {
|
val colors = if (darkTheme) {
|
||||||
|
|||||||
Reference in New Issue
Block a user