chore: adjust grid style

This commit is contained in:
metacubex 2022-12-29 20:49:18 +08:00
parent 4467ef3351
commit 9587632c49
3 changed files with 14 additions and 8 deletions

View File

@ -40,9 +40,9 @@ class ProxyView(
}
val textHeight = state.rect.height()
val exceptHeight = (state.config.layoutPadding * 4 +
val exceptHeight = (state.config.layoutPadding * 2 +
state.config.contentPadding * 2 +
textHeight * 4 +
textHeight * 2 +
state.config.textMargin).toInt()
val height = when (MeasureSpec.getMode(heightMeasureSpec)) {

View File

@ -21,9 +21,12 @@ class ProxyViewConfig(val context: Context, var proxyLine: Int) {
get() = if (proxyLine==1) Color.TRANSPARENT else colorSurface
val layoutPadding = context.getPixels(R.dimen.proxy_layout_padding).toFloat()
val contentPadding = context.getPixels(R.dimen.proxy_content_padding).toFloat()
val textMargin = context.getPixels(R.dimen.proxy_text_margin)
val textSize = context.getPixels(R.dimen.proxy_text_size).toFloat()
val contentPadding
get() = if (proxyLine==2) context.getPixels(R.dimen.proxy_content_padding).toFloat() else context.getPixels(R.dimen.proxy_content_padding_grid3).toFloat()
val textMargin
get() = if (proxyLine==2) context.getPixels(R.dimen.proxy_text_margin).toFloat() else context.getPixels(R.dimen.proxy_text_margin_grid3).toFloat()
val textSize
get() = if (proxyLine==2) context.getPixels(R.dimen.proxy_text_size).toFloat() else context.getPixels(R.dimen.proxy_text_size_grid3).toFloat()
val shadow = Color.argb(
0x15,

View File

@ -65,9 +65,12 @@
<!-- Proxy Design -->
<dimen name="proxy_layout_padding">3dp</dimen>
<dimen name="proxy_content_padding">6dp</dimen>
<dimen name="proxy_text_margin">5dp</dimen>
<dimen name="proxy_text_size">11sp</dimen>
<dimen name="proxy_content_padding">15dp</dimen>
<dimen name="proxy_content_padding_grid3">12dp</dimen>
<dimen name="proxy_text_margin">10dp</dimen>
<dimen name="proxy_text_margin_grid3">5dp</dimen>
<dimen name="proxy_text_size">12sp</dimen>
<dimen name="proxy_text_size_grid3">11sp</dimen>
<dimen name="proxy_card_radius">5dp</dimen>
<dimen name="proxy_card_offset">0dp</dimen>