From dc10658111a7efc2d89922399dcb5574f7842ecf Mon Sep 17 00:00:00 2001 From: AnMokoto Date: Fri, 11 Jan 2019 20:54:55 +0800 Subject: [PATCH] Fix a objAnimation crash on Kitkat and below (#104) Fix a crash when objAnimation is not supported and the device's version is lower than `KITKAT 4.4`. --- library/src/main/java/org/angmarch/views/NiceSpinner.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/library/src/main/java/org/angmarch/views/NiceSpinner.java b/library/src/main/java/org/angmarch/views/NiceSpinner.java index f703982..b1d2fb2 100644 --- a/library/src/main/java/org/angmarch/views/NiceSpinner.java +++ b/library/src/main/java/org/angmarch/views/NiceSpinner.java @@ -237,6 +237,14 @@ protected void onDetachedFromWindow() { } super.onDetachedFromWindow(); } + + @Override + protected void onAttachedToWindow() { + super.onAttachedToWindow(); + if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) { + onVisibilityChanged(this, getVisibility()); + } + } @Override protected void onVisibilityChanged(View changedView, int visibility) {