Sfoglia il codice sorgente

Chore: Change proxy grid layout to 3

djoeni 3 anni fa
parent
commit
53f3fad499

+ 1 - 1
core/src/foss/golang/clash

@@ -1 +1 @@
-Subproject commit 0bed1760afe30fbce3da7ed07bf4e3b3df1dd369
+Subproject commit f067af9cd516c4a46f558663fe15024f049a249f

+ 2 - 2
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
                     }
                 }
             }

+ 2 - 2
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)) {

+ 4 - 4
design/src/main/res/values/dimens.xml

@@ -64,10 +64,10 @@
     <dimen name="main_top_banner_height">90dp</dimen>
 
     <!--  Proxy Design -->
-    <dimen name="proxy_layout_padding">5dp</dimen>
-    <dimen name="proxy_content_padding">15dp</dimen>
-    <dimen name="proxy_text_margin">10dp</dimen>
-    <dimen name="proxy_text_size">12sp</dimen>
+    <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_card_radius">5dp</dimen>
     <dimen name="proxy_card_offset">0dp</dimen>