Skip to content

Commit

Permalink
ui: enlarge history, bookmark font size. fix: #447
Browse files Browse the repository at this point in the history
  • Loading branch information
plateaukao committed Dec 7, 2024
1 parent b4f4d59 commit b96e8e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.text.TextRange
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.core.graphics.Insets
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
Expand Down Expand Up @@ -489,8 +491,8 @@ open class BrowserActivity : FragmentActivity(), BrowserController {
val externalSearchContainer = binding.activityMainContent.externalSearchActionContainer
externalSearchViewModel.searchActions.forEach { action ->
val button = TextView(this).apply {
height = ViewUnit.dpToPixel(40).toInt()
textSize = ViewUnit.dpToPixel(10)
height = 40.dp.value.toInt()
textSize = 10.sp.value
gravity = Gravity.CENTER
background = getDrawable(R.drawable.background_with_border)
text = action.title.take(2).uppercase(Locale.getDefault())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ private fun RecordItem(

Row(
modifier = modifier
.height(60.dp)
.padding(5.dp),
.padding(2.dp),
horizontalArrangement = Arrangement.Center
) {
if (record.type == RecordType.Bookmark) {
Expand Down Expand Up @@ -142,14 +141,14 @@ private fun RecordItem(
AndroidView(
factory = { context ->
TextView(context).apply {
textSize = ViewUnit.dpToPixel(6)
textSize = ViewUnit.dpToPixel(11).toFloat()
maxLines = 1
ellipsize = TextUtils.TruncateAt.MIDDLE
}
},
update = { it.text = record.title ?: "Unknown" }
)
Spacer(modifier = Modifier.height(3.dp))
Spacer(modifier = Modifier.height(1.dp))
Row(
modifier = Modifier.fillMaxWidth(),
) {
Expand All @@ -159,7 +158,7 @@ private fun RecordItem(
.align(Alignment.Top),
factory = { context ->
TextView(context).apply {
textSize = ViewUnit.dpToPixel(5)
textSize = ViewUnit.dpToPixel(8).toFloat()
textAlignment = TextView.TEXT_ALIGNMENT_CENTER
maxLines = 1
ellipsize = TextUtils.TruncateAt.MIDDLE
Expand Down

0 comments on commit b96e8e5

Please sign in to comment.