Jim Miller | 5ecd811 | 2013-01-09 18:50:26 -0800 | [diff] [blame] | 1 | package com.android.keyguard; |
Jim Miller | 838906b | 2012-10-19 18:41:25 -0700 | [diff] [blame] | 2 | |
| 3 | import android.content.Context; |
| 4 | import android.util.AttributeSet; |
Chris Wren | 052999f | 2012-11-02 14:36:56 -0400 | [diff] [blame] | 5 | import android.view.View; |
Jim Miller | 838906b | 2012-10-19 18:41:25 -0700 | [diff] [blame] | 6 | import android.widget.FrameLayout; |
| 7 | |
| 8 | public class KeyguardSecurityContainer extends FrameLayout { |
Jim Miller | 838906b | 2012-10-19 18:41:25 -0700 | [diff] [blame] | 9 | public KeyguardSecurityContainer(Context context, AttributeSet attrs) { |
| 10 | this(context, attrs, 0); |
| 11 | } |
| 12 | |
| 13 | public KeyguardSecurityContainer(Context context) { |
| 14 | this(null, null, 0); |
| 15 | } |
| 16 | |
| 17 | public KeyguardSecurityContainer(Context context, AttributeSet attrs, int defStyle) { |
| 18 | super(context, attrs, defStyle); |
Chris Wren | c345146 | 2012-10-30 11:22:58 -0400 | [diff] [blame] | 19 | } |
| 20 | |
Chris Wren | c0ae9e6 | 2012-11-05 13:16:31 -0500 | [diff] [blame] | 21 | KeyguardSecurityViewFlipper getFlipper() { |
Chris Wren | 052999f | 2012-11-02 14:36:56 -0400 | [diff] [blame] | 22 | for (int i = 0; i < getChildCount(); i++) { |
| 23 | View child = getChildAt(i); |
| 24 | if (child instanceof KeyguardSecurityViewFlipper) { |
Chris Wren | c0ae9e6 | 2012-11-05 13:16:31 -0500 | [diff] [blame] | 25 | return (KeyguardSecurityViewFlipper) child; |
Chris Wren | 052999f | 2012-11-02 14:36:56 -0400 | [diff] [blame] | 26 | } |
| 27 | } |
| 28 | return null; |
| 29 | } |
| 30 | |
Chris Wren | c0ae9e6 | 2012-11-05 13:16:31 -0500 | [diff] [blame] | 31 | public void showBouncer(int duration) { |
| 32 | KeyguardSecurityViewFlipper flipper = getFlipper(); |
| 33 | if (flipper != null) { |
| 34 | flipper.showBouncer(duration); |
Chris Wren | 052999f | 2012-11-02 14:36:56 -0400 | [diff] [blame] | 35 | } |
Chris Wren | c0ae9e6 | 2012-11-05 13:16:31 -0500 | [diff] [blame] | 36 | } |
| 37 | |
| 38 | public void hideBouncer(int duration) { |
| 39 | KeyguardSecurityViewFlipper flipper = getFlipper(); |
| 40 | if (flipper != null) { |
| 41 | flipper.hideBouncer(duration); |
| 42 | } |
Chris Wren | 052999f | 2012-11-02 14:36:56 -0400 | [diff] [blame] | 43 | } |
Jim Miller | 838906b | 2012-10-19 18:41:25 -0700 | [diff] [blame] | 44 | } |
Chris Wren | c0ae9e6 | 2012-11-05 13:16:31 -0500 | [diff] [blame] | 45 | |