From 3996d6718d2ddcc10724ef304b179bb9b1865a47 Mon Sep 17 00:00:00 2001 From: Kale Date: Mon, 28 May 2018 17:33:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86image=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=EF=BC=8C=E9=98=B2=E6=AD=A2=E5=92=8Csrc=E5=86=B2?= =?UTF-8?q?=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/main/java/kale/injection/SelectorInjection.java | 3 +++ lib/src/main/res/values/attrs.xml | 1 + 2 files changed, 4 insertions(+) diff --git a/lib/src/main/java/kale/injection/SelectorInjection.java b/lib/src/main/java/kale/injection/SelectorInjection.java index 28fc613..1fb695c 100644 --- a/lib/src/main/java/kale/injection/SelectorInjection.java +++ b/lib/src/main/java/kale/injection/SelectorInjection.java @@ -92,6 +92,9 @@ public void loadFromAttributes(AttributeSet attrs, int defStyleAttr) { showRipple = a.getBoolean(R.styleable.SelectorInjection_ripple, false); Drawable src = a.getDrawable(R.styleable.SelectorInjection_src); + if (src == null) { + src = a.getDrawable(R.styleable.SelectorInjection_image); + } if (src != null && view instanceof ImageView) { ((ImageView) view).setImageDrawable(src); } diff --git a/lib/src/main/res/values/attrs.xml b/lib/src/main/res/values/attrs.xml index cc899b2..61dca86 100644 --- a/lib/src/main/res/values/attrs.xml +++ b/lib/src/main/res/values/attrs.xml @@ -45,6 +45,7 @@ +