From 53f3fad499810cc5c6effa196bb24afbe0a73d17 Mon Sep 17 00:00:00 2001 From: djoeni Date: Wed, 22 Jun 2022 19:03:59 +0700 Subject: [PATCH] Chore: Change proxy grid layout to 3 --- core/src/foss/golang/clash | 2 +- .../kr328/clash/design/component/ProxyPageFactory.kt | 4 ++-- .../com/github/kr328/clash/design/component/ProxyView.kt | 4 ++-- design/src/main/res/values/dimens.xml | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/src/foss/golang/clash b/core/src/foss/golang/clash index 0bed1760..f067af9c 160000 --- a/core/src/foss/golang/clash +++ b/core/src/foss/golang/clash @@ -1 +1 @@ -Subproject commit 0bed1760afe30fbce3da7ed07bf4e3b3df1dd369 +Subproject commit f067af9cd516c4a46f558663fe15024f049a249f diff --git a/design/src/main/java/com/github/kr328/clash/design/component/ProxyPageFactory.kt b/design/src/main/java/com/github/kr328/clash/design/component/ProxyPageFactory.kt index 2ad7b8c4..d8cc21a3 100644 --- a/design/src/main/java/com/github/kr328/clash/design/component/ProxyPageFactory.kt +++ b/design/src/main/java/com/github/kr328/clash/design/component/ProxyPageFactory.kt @@ -32,10 +32,10 @@ class ProxyPageFactory(private val config: ProxyViewConfig) { root.addView(recyclerView) recyclerView.apply { - layoutManager = GridLayoutManager(config.context, 2).apply { + layoutManager = GridLayoutManager(config.context, 3).apply { spanSizeLookup = object : GridLayoutManager.SpanSizeLookup() { override fun getSpanSize(position: Int): Int { - return if (config.singleLine) 2 else 1 + return if (config.singleLine) 3 else 1 } } } diff --git a/design/src/main/java/com/github/kr328/clash/design/component/ProxyView.kt b/design/src/main/java/com/github/kr328/clash/design/component/ProxyView.kt index 01027ce7..6a5c9d47 100644 --- a/design/src/main/java/com/github/kr328/clash/design/component/ProxyView.kt +++ b/design/src/main/java/com/github/kr328/clash/design/component/ProxyView.kt @@ -40,9 +40,9 @@ class ProxyView( } val textHeight = state.rect.height() - val exceptHeight = (state.config.layoutPadding * 2 + + val exceptHeight = (state.config.layoutPadding * 4 + state.config.contentPadding * 2 + - textHeight * 2 + + textHeight * 4 + state.config.textMargin).toInt() val height = when (MeasureSpec.getMode(heightMeasureSpec)) { diff --git a/design/src/main/res/values/dimens.xml b/design/src/main/res/values/dimens.xml index a967936c..62c0dfc2 100644 --- a/design/src/main/res/values/dimens.xml +++ b/design/src/main/res/values/dimens.xml @@ -64,10 +64,10 @@ 90dp - 5dp - 15dp - 10dp - 12sp + 3dp + 6dp + 5dp + 11sp 5dp 0dp