Skip to content

Commit

Permalink
Simple support for rlt languages
Browse files Browse the repository at this point in the history
  • Loading branch information
DianQK committed Mar 5, 2023
1 parent 19f691f commit fe1a97d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextRange
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.text.style.TextDirection
import org.dianqk.mdrender.MarkdownTheme
import org.dianqk.mdrender.MarkdownVisualTransformation
import org.dianqk.ruslin.R
Expand Down Expand Up @@ -142,6 +144,7 @@ fun MarkdownTextEditor(
unfocusedIndicatorColor = Color.Transparent,
containerColor = Color.Transparent
),
textStyle = TextStyle(color = Color.Black, textDirection = TextDirection.Content),
visualTransformation = visualTransformation
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.platform.LocalLifecycleOwner
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.style.TextDirection
import androidx.compose.ui.unit.dp
import androidx.compose.ui.zIndex
import androidx.hilt.navigation.compose.hiltViewModel
Expand Down Expand Up @@ -124,6 +126,7 @@ private fun NoteEditor(
.imePadding()
) {
TextField(
modifier = Modifier.fillMaxWidth(),
value = title,
colors = TextFieldDefaults.textFieldColors(
focusedIndicatorColor = Color.Transparent,
Expand All @@ -137,8 +140,8 @@ private fun NoteEditor(
style = MaterialTheme.typography.titleMedium
)
},
textStyle = MaterialTheme.typography.titleLarge
)
textStyle = MaterialTheme.typography.titleLarge.copy(textDirection = TextDirection.Content),
)
Divider()
MarkdownTextEditor(
modifier = Modifier.weight(1f),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.style.TextDirection
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import org.dianqk.ruslin.ui.ext.formatAsYmdHms
Expand Down Expand Up @@ -56,8 +57,9 @@ fun NoteAbbrCard(
}
Column {
Text(
modifier = Modifier.fillMaxWidth(),
text = note.title,
style = MaterialTheme.typography.titleMedium,
style = MaterialTheme.typography.titleMedium.copy(textDirection = TextDirection.Content),
maxLines = 2,
overflow = TextOverflow.Ellipsis
)
Expand Down

0 comments on commit fe1a97d

Please sign in to comment.