OSDN Git Service

Shorter separator
authorLucas Dupin <dupin@google.com>
Tue, 23 Jan 2018 06:00:21 +0000 (22:00 -0800)
committerLucas Dupin <dupin@google.com>
Tue, 23 Jan 2018 06:00:21 +0000 (22:00 -0800)
Shorter separator on keyguard slice

Test: visual
Bug: 64155983
Change-Id: I86b56fec780b531c9c3064e7147e59add6b9e4a3

packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java

index d80a336..9ff6815 100644 (file)
@@ -333,6 +333,7 @@ public class KeyguardSliceView extends LinearLayout implements View.OnClickListe
      */
     private class KeyguardSliceButton extends Button {
 
+        private static final float SEPARATOR_HEIGHT = 0.7f;
         private final Paint mPaint;
         private boolean mHasDivider;
 
@@ -369,7 +370,9 @@ public class KeyguardSliceView extends LinearLayout implements View.OnClickListe
             super.onDraw(canvas);
             if (mHasDivider) {
                 final int lineX = getLayoutDirection() == LAYOUT_DIRECTION_RTL ? 0 : getWidth();
-                canvas.drawLine(lineX, 0, lineX, getHeight(), mPaint);
+                final int height = (int) (getHeight() * SEPARATOR_HEIGHT);
+                final int startY = getHeight() / 2 - height / 2;
+                canvas.drawLine(lineX, startY, lineX, startY + height, mPaint);
             }
         }
     }