diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2015-06-18 03:11:29 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2015-06-18 03:11:29 +0200 |
commit | 0cb868ff250e8d86a1a8f8ace79cc18e4cbc721e (patch) | |
tree | d7698fb11fd1b61d97d1746a5898855d5a27dc83 /OpenKeychain | |
parent | c11fef6e7c80681ce69e5fdc7f4796b0b7a18e2b (diff) | |
download | open-keychain-0cb868ff250e8d86a1a8f8ace79cc18e4cbc721e.tar.gz open-keychain-0cb868ff250e8d86a1a8f8ace79cc18e4cbc721e.tar.bz2 open-keychain-0cb868ff250e8d86a1a8f8ace79cc18e4cbc721e.zip |
fix ToolableViewAnimator (againl)
Diffstat (limited to 'OpenKeychain')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/ToolableViewAnimator.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/ToolableViewAnimator.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/ToolableViewAnimator.java index f0d7ae5ac..18e830139 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/ToolableViewAnimator.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/ToolableViewAnimator.java @@ -27,6 +27,7 @@ package org.sufficientlysecure.keychain.ui.widget; import android.content.Context; import android.content.res.TypedArray; +import android.support.annotation.NonNull; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; @@ -47,6 +48,12 @@ public class ToolableViewAnimator extends ViewAnimator { public ToolableViewAnimator(Context context, AttributeSet attrs) { super(context, attrs); + + if (isInEditMode()) { + TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ToolableViewAnimator); + mInitChild = a.getInt(R.styleable.ToolableViewAnimator_initialView, -1); + a.recycle(); + } } public ToolableViewAnimator(Context context, AttributeSet attrs, int defStyleAttr) { @@ -60,7 +67,7 @@ public class ToolableViewAnimator extends ViewAnimator { } @Override - public void addView(View child, int index, ViewGroup.LayoutParams params) { + public void addView(@NonNull View child, int index, ViewGroup.LayoutParams params) { if (isInEditMode() && mInitChild-- > 0) { return; } |