From dec17299fef93f673d8e8cab0ec0f734bf6b8539 Mon Sep 17 00:00:00 2001 From: Alan Viverette Date: Sat, 12 Jul 2014 00:26:36 -0700 Subject: [PATCH] Fix switch text position when thumb is null Change-Id: I05a107423fabf5a538258cf0562e0916c8be18b6 --- core/java/android/widget/Switch.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/android/widget/Switch.java b/core/java/android/widget/Switch.java index 497cf108cc359..8ea1090e792b6 100644 --- a/core/java/android/widget/Switch.java +++ b/core/java/android/widget/Switch.java @@ -936,7 +936,7 @@ public class Switch extends CompoundButton { final Rect bounds = thumbDrawable.getBounds(); cX = bounds.left + bounds.right; } else { - cX = getWidth() / 2; + cX = getWidth(); } final int left = cX / 2 - switchText.getWidth() / 2;