From 7b4e6d356cd60418adefb59601b81028db46cd5a Mon Sep 17 00:00:00 2001 From: afohrman Date: Thu, 31 Aug 2017 17:44:59 -0400 Subject: [PATCH] Improve logic for setting box background mode. Using a switch statement to ensure that the box background mode is only ever set to one of the BoxBackgroundMode constants. Also pulled the logic out into its own method to improve readability in the already large constructor, and added a check to make sure that the box background's GradientDrawable is only created if a background is requested. PiperOrigin-RevId: 167194185 --- lib/res/values/attrs.xml | 3 +- lib/res/values/styles.xml | 1 + .../design/widget/TextInputLayout.java | 29 ++++++++++++++----- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/lib/res/values/attrs.xml b/lib/res/values/attrs.xml index 0a4c2a884..6482dcf32 100644 --- a/lib/res/values/attrs.xml +++ b/lib/res/values/attrs.xml @@ -321,7 +321,8 @@ - + diff --git a/lib/res/values/styles.xml b/lib/res/values/styles.xml index ed5534b74..a409fc278 100644 --- a/lib/res/values/styles.xml +++ b/lib/res/values/styles.xml @@ -65,6 +65,7 @@