enhance(mobile): polish UI spacing and background styling in various components

This commit is contained in:
charlie
2025-12-13 19:01:25 +08:00
parent ff7ecc4baa
commit c75322f55e
5 changed files with 28 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
package com.logseq.app
import android.graphics.Color
import android.graphics.drawable.GradientDrawable
import android.os.Handler
import android.os.Looper
import android.view.View
@@ -50,9 +51,27 @@ class NativeBottomSheetPlugin : Plugin() {
ViewGroup.LayoutParams.MATCH_PARENT
)
val cornerRadius = NativeUiUtils.dp(ctx, 16f).toFloat()
val roundedBackground = GradientDrawable().apply {
setColor(LogseqTheme.current().background)
cornerRadii = floatArrayOf(
cornerRadius, cornerRadius, // 左上角
cornerRadius, cornerRadius, // 右上角
0f, 0f, // 右下角
0f, 0f // 左下角
)
}
container!!.background = roundedBackground
container!!.clipToOutline = true
val sheet = BottomSheetDialog(ctx)
sheet.setContentView(container!!)
sheet.setOnShowListener {
val bottomSheet = sheet.findViewById<View>(com.google.android.material.R.id.design_bottom_sheet)
bottomSheet?.setBackgroundColor(Color.TRANSPARENT)
}
WebViewSnapshotManager.showSnapshot(snapshotTag, webView)
// Move the WebView into the BottomSheet container

View File

@@ -5,6 +5,7 @@ import android.view.Gravity
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.clickable
import androidx.compose.foundation.horizontalScroll
import androidx.compose.foundation.layout.Arrangement
@@ -205,8 +206,8 @@ private fun SelectionActionBar(
Surface(
color = background,
shadowElevation = 6.dp,
shape = RoundedCornerShape(16.dp)
shape = RoundedCornerShape(16.dp),
border = BorderStroke(1.dp, tint.copy(alpha = 0.05f))
) {
Row(
modifier = Modifier