android:layout_width="wrap_content"
android:layout_height="@dimen/keyguard_security_height"
androidprv:layout_childType="challenge"
- android:background="@drawable/kg_bouncer_bg_white"
android:padding="0dp"
android:gravity="bottom|center_horizontal">
<com.android.internal.policy.impl.keyguard.KeyguardSecurityViewFlipper
android:layout_height="wrap_content"
/>
- <com.android.internal.widget.FaceUnlockView
- android:id="@+id/face_unlock_area_view"
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:background="@*android:drawable/intro_bg"
- android:gravity="center"
- android:layout_weight="1">
+ <FrameLayout
+ android:id="@+id/keyguard_bouncer_frame"
+ android:background="@*android:drawable/kg_bouncer_bg_white"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ >
+ <com.android.internal.widget.FaceUnlockView
+ android:id="@+id/face_unlock_area_view"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@*android:drawable/intro_bg"
+ android:gravity="center">
- <View
- android:id="@+id/spotlightMask"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@*android:color/facelock_spotlight_mask"
- />
+ <View
+ android:id="@+id/spotlightMask"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@*android:color/facelock_spotlight_mask"
+ />
- <ImageButton
- android:id="@+id/face_unlock_cancel_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:padding="5dip"
- android:layout_alignParentTop="true"
- android:layout_alignParentEnd="true"
- android:background="#00000000"
- android:src="@*android:drawable/ic_facial_backup"
- />
- </com.android.internal.widget.FaceUnlockView>
+ <ImageButton
+ android:id="@+id/face_unlock_cancel_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:padding="5dip"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentEnd="true"
+ android:background="#00000000"
+ android:src="@*android:drawable/ic_facial_backup"
+ />
+ </com.android.internal.widget.FaceUnlockView>
+ </FrameLayout>
<include layout="@layout/keyguard_emergency_carrier_area"
android:id="@+id/keyguard_selector_fade_container"
<!-- Password entry field -->
<!-- Note: the entire container is styled to look like the edit field,
since the backspace/IME switcher looks better inside -->
- <LinearLayout
+ <FrameLayout
+ android:id="@+id/keyguard_bouncer_frame"
+ android:background="@*android:drawable/kg_bouncer_bg_white"
android:layout_height="wrap_content"
android:layout_width="match_parent"
- android:orientation="horizontal"
- android:background="#70000000"
- android:layout_marginTop="8dp"
- android:layout_marginBottom="8dp"
>
-
- <EditText android:id="@+id/passwordEntry"
- android:layout_width="0dip"
+ <LinearLayout
android:layout_height="wrap_content"
- android:layout_weight="1"
- android:gravity="center_horizontal"
- android:layout_gravity="center_vertical"
- android:layout_marginStart="@*android:dimen/keyguard_lockscreen_pin_margin_left"
- android:singleLine="true"
- android:textStyle="normal"
- android:inputType="textPassword"
- android:textSize="36sp"
- android:background="@null"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="#ffffffff"
- android:imeOptions="flagForceAscii|actionDone"
- />
+ android:layout_width="match_parent"
+ android:orientation="horizontal"
+ android:background="#70000000"
+ android:layout_marginTop="8dp"
+ android:layout_marginBottom="8dp"
+ >
- <ImageView android:id="@+id/switch_ime_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@*android:drawable/ic_lockscreen_ime"
- android:clickable="true"
- android:padding="8dip"
- android:layout_gravity="center"
- android:background="?android:attr/selectableItemBackground"
- android:visibility="gone"
- />
+ <EditText android:id="@+id/passwordEntry"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:gravity="center_horizontal"
+ android:layout_gravity="center_vertical"
+ android:layout_marginStart="@*android:dimen/keyguard_lockscreen_pin_margin_left"
+ android:singleLine="true"
+ android:textStyle="normal"
+ android:inputType="textPassword"
+ android:textSize="36sp"
+ android:background="@null"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="#ffffffff"
+ android:imeOptions="flagForceAscii|actionDone"
+ />
- </LinearLayout>
+ <ImageView android:id="@+id/switch_ime_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@*android:drawable/ic_lockscreen_ime"
+ android:clickable="true"
+ android:padding="8dip"
+ android:layout_gravity="center"
+ android:background="?android:attr/selectableItemBackground"
+ android:visibility="gone"
+ />
+ </LinearLayout>
+ </FrameLayout>
<include layout="@layout/keyguard_emergency_carrier_area"
android:id="@+id/keyguard_selector_fade_container"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_gravity="center">
- <!-- We need MATCH_PARENT here only to force the size of the parent to be passed to
- the pattern view for it to compute its size. This is an unusual case, caused by
- LockPatternView's requirement to maintain a square aspect ratio based on the width
- of the screen. -->
+ <FrameLayout
+ android:id="@+id/keyguard_bouncer_frame"
+ android:background="@*android:drawable/kg_bouncer_bg_white"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ >
<com.android.internal.widget.LockPatternView
android:id="@+id/lockPatternView"
- android:layout_width="wrap_content"
- android:layout_height="0dp"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginEnd="8dip"
android:layout_marginBottom="4dip"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:contentDescription="@string/keyguard_accessibility_pattern_area" />
-
- <include layout="@layout/keyguard_emergency_carrier_area"
- android:id="@+id/keyguard_selector_fade_container"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:layout_gravity="bottom|center_horizontal"
- android:gravity="center_horizontal" />
-
+ </FrameLayout>
+ <include layout="@layout/keyguard_emergency_carrier_area"
+ android:id="@+id/keyguard_selector_fade_container"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:layout_gravity="bottom|center_horizontal"
+ android:gravity="center_horizontal" />
</LinearLayout>
</FrameLayout>
android:layout_height="wrap_content"
/>
<LinearLayout
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:orientation="horizontal"
- android:layout_weight="1"
- >
- <TextView android:id="@+id/pinEntry"
- android:editable="true"
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:gravity="center"
- android:layout_marginStart="@*android:dimen/keyguard_lockscreen_pin_margin_left"
- android:singleLine="true"
- android:cursorVisible="false"
- android:background="@null"
- android:textAppearance="@android:style/TextAppearance.NumPadKey"
- android:imeOptions="flagForceAscii|actionDone"
- />
- <ImageButton android:id="@+id/delete_button"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:gravity="center_vertical"
- android:src="@*android:drawable/ic_input_delete"
- android:clickable="true"
- android:paddingTop="8dip"
- android:paddingBottom="8dip"
- android:paddingLeft="24dp"
- android:paddingRight="24dp"
- android:background="?android:attr/selectableItemBackground"
- android:contentDescription="@string/keyboardview_keycode_delete"
- />
- </LinearLayout>
- <View
- android:layout_width="wrap_content"
- android:layout_height="1dp"
- android:background="#55FFFFFF"
- />
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1"
- android:orientation="horizontal"
- >
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key1"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="1"
- />
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key2"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="2"
- />
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key3"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="3"
- />
- </LinearLayout>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1"
- android:orientation="horizontal"
- >
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key4"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="4"
- />
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key5"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="5"
- />
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key6"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="6"
- />
+ android:id="@+id/keyguard_bouncer_frame"
+ android:background="@*android:drawable/kg_bouncer_bg_white"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:orientation="vertical"
+ android:layout_weight="1"
+ >
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:orientation="horizontal"
+ android:layout_weight="1"
+ >
+ <TextView android:id="@+id/pinEntry"
+ android:editable="true"
+ android:layout_width="0dip"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:gravity="center"
+ android:layout_marginStart="@*android:dimen/keyguard_lockscreen_pin_margin_left"
+ android:singleLine="true"
+ android:cursorVisible="false"
+ android:background="@null"
+ android:textAppearance="@style/TextAppearance.NumPadKey"
+ android:imeOptions="flagForceAscii|actionDone"
+ />
+ <ImageButton android:id="@+id/delete_button"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:gravity="center_vertical"
+ android:src="@*android:drawable/ic_input_delete"
+ android:clickable="true"
+ android:paddingTop="8dip"
+ android:paddingBottom="8dip"
+ android:paddingLeft="24dp"
+ android:paddingRight="24dp"
+ android:background="?android:attr/selectableItemBackground"
+ android:contentDescription="@string/keyboardview_keycode_delete"
+ />
+ </LinearLayout>
+ <View
+ android:layout_width="wrap_content"
+ android:layout_height="1dp"
+ android:background="#55FFFFFF"
+ />
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:orientation="horizontal"
+ >
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key1"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="1"
+ />
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key2"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="2"
+ />
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key3"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="3"
+ />
+ </LinearLayout>
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:orientation="horizontal"
+ >
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key4"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="4"
+ />
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key5"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="5"
+ />
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key6"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="6"
+ />
+ </LinearLayout>
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:orientation="horizontal"
+ android:layout_weight="1"
+ >
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key7"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="7"
+ />
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key8"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="8"
+ />
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key9"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="9"
+ />
+ </LinearLayout>
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:orientation="horizontal"
+ >
+ <Space
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ />
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key0"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="0"
+ />
+ <ImageButton
+ android:id="@+id/key_enter"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:paddingRight="30dp"
+ android:src="@drawable/sym_keyboard_return_holo"
+ android:contentDescription="@string/keyboardview_keycode_enter"
+ />
+ </LinearLayout>
</LinearLayout>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:orientation="horizontal"
- android:layout_weight="1"
- >
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key7"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="7"
- />
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key8"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="8"
- />
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key9"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="9"
- />
- </LinearLayout>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1"
- android:orientation="horizontal"
- >
- <Space
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- />
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key0"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="0"
- />
- <ImageButton
- android:id="@+id/key_enter"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:paddingRight="30dp"
- android:src="@drawable/sym_keyboard_return_holo"
- android:contentDescription="@string/keyboardview_keycode_enter"
- />
- </LinearLayout>
-
<include layout="@layout/keyguard_emergency_carrier_area"
android:id="@+id/keyguard_selector_fade_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<LinearLayout
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:orientation="horizontal"
- android:layout_weight="1"
- >
- <TextView android:id="@+id/pinEntry"
- android:editable="true"
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:gravity="center"
- android:layout_marginStart="@*android:dimen/keyguard_lockscreen_pin_margin_left"
- android:singleLine="true"
- android:cursorVisible="false"
- android:background="@null"
- android:textAppearance="@style/TextAppearance.NumPadKey"
- android:imeOptions="flagForceAscii|actionDone"
- />
- <ImageButton android:id="@+id/delete_button"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:gravity="center_vertical"
- android:src="@*android:drawable/ic_input_delete"
- android:clickable="true"
- android:paddingTop="8dip"
- android:paddingBottom="8dip"
- android:paddingLeft="24dp"
- android:paddingRight="24dp"
- android:background="?android:attr/selectableItemBackground"
- android:contentDescription="@string/keyboardview_keycode_delete"
- />
- </LinearLayout>
- <View
- android:layout_width="wrap_content"
- android:layout_height="1dp"
- android:background="#55FFFFFF"
- />
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1"
- android:orientation="horizontal"
- >
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key1"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="1"
- />
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key2"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="2"
- />
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key3"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="3"
- />
- </LinearLayout>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1"
- android:orientation="horizontal"
- >
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key4"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="4"
- />
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key5"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="5"
- />
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key6"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="6"
- />
- </LinearLayout>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:orientation="horizontal"
- android:layout_weight="1"
- >
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key7"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="7"
- />
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key8"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="8"
- />
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key9"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="9"
- />
- </LinearLayout>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1"
- android:orientation="horizontal"
- >
- <Space
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- />
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key0"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="0"
- />
- <ImageButton
- android:id="@+id/key_enter"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:paddingRight="30dp"
- android:src="@drawable/sym_keyboard_return_holo"
- android:contentDescription="@string/keyboardview_keycode_enter"
- />
+ android:id="@+id/keyguard_bouncer_frame"
+ android:background="@*android:drawable/kg_bouncer_bg_white"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:orientation="vertical"
+ android:layout_weight="1"
+ >
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:orientation="horizontal"
+ android:layout_weight="1"
+ >
+ <TextView android:id="@+id/pinEntry"
+ android:editable="true"
+ android:layout_width="0dip"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:gravity="center"
+ android:layout_marginStart="@*android:dimen/keyguard_lockscreen_pin_margin_left"
+ android:singleLine="true"
+ android:cursorVisible="false"
+ android:background="@null"
+ android:textAppearance="@style/TextAppearance.NumPadKey"
+ android:imeOptions="flagForceAscii|actionDone"
+ />
+ <ImageButton android:id="@+id/delete_button"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:gravity="center_vertical"
+ android:src="@*android:drawable/ic_input_delete"
+ android:clickable="true"
+ android:paddingTop="8dip"
+ android:paddingBottom="8dip"
+ android:paddingLeft="24dp"
+ android:paddingRight="24dp"
+ android:background="?android:attr/selectableItemBackground"
+ android:contentDescription="@string/keyboardview_keycode_delete"
+ />
+ </LinearLayout>
+ <View
+ android:layout_width="wrap_content"
+ android:layout_height="1dp"
+ android:background="#55FFFFFF"
+ />
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:orientation="horizontal"
+ >
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key1"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="1"
+ />
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key2"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="2"
+ />
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key3"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="3"
+ />
+ </LinearLayout>
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:orientation="horizontal"
+ >
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key4"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="4"
+ />
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key5"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="5"
+ />
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key6"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="6"
+ />
+ </LinearLayout>
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:orientation="horizontal"
+ android:layout_weight="1"
+ >
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key7"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="7"
+ />
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key8"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="8"
+ />
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key9"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="9"
+ />
+ </LinearLayout>
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:orientation="horizontal"
+ >
+ <Space
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ />
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key0"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="0"
+ />
+ <ImageButton
+ android:id="@+id/key_enter"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:paddingRight="30dp"
+ android:src="@drawable/sym_keyboard_return_holo"
+ android:contentDescription="@string/keyboardview_keycode_enter"
+ />
+ </LinearLayout>
</LinearLayout>
<include layout="@layout/keyguard_emergency_carrier_area"
android:layout_height="wrap_content"
/>
<LinearLayout
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:orientation="horizontal"
- android:layout_weight="1"
- >
- <TextView android:id="@+id/pinEntry"
- android:editable="true"
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:gravity="center"
- android:layout_marginStart="@*android:dimen/keyguard_lockscreen_pin_margin_left"
- android:singleLine="true"
- android:cursorVisible="false"
- android:background="@null"
- android:textAppearance="@style/TextAppearance.NumPadKey"
- android:imeOptions="flagForceAscii|actionDone"
- />
- <ImageButton android:id="@+id/delete_button"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:gravity="center_vertical"
- android:src="@*android:drawable/ic_input_delete"
- android:clickable="true"
- android:paddingTop="8dip"
- android:paddingBottom="8dip"
- android:paddingLeft="24dp"
- android:paddingRight="24dp"
- android:background="?android:attr/selectableItemBackground"
- android:contentDescription="@string/keyboardview_keycode_delete"
- />
- </LinearLayout>
- <View
- android:layout_width="wrap_content"
- android:layout_height="1dp"
- android:background="#55FFFFFF"
- />
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1"
- android:orientation="horizontal"
- >
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key1"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="1"
- />
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key2"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="2"
- />
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key3"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="3"
- />
- </LinearLayout>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1"
- android:orientation="horizontal"
- >
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key4"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="4"
- />
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key5"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="5"
- />
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key6"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="6"
- />
- </LinearLayout>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:orientation="horizontal"
- android:layout_weight="1"
- >
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key7"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="7"
- />
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key8"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="8"
- />
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key9"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="9"
- />
- </LinearLayout>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1"
- android:orientation="horizontal"
- >
- <Space
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- />
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
- android:id="@+id/key0"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="0"
- />
- <ImageButton
- android:id="@+id/key_enter"
- style="@style/Widget.Button.NumPadKey"
- android:layout_width="0px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:paddingRight="30dp"
- android:src="@drawable/sym_keyboard_return_holo"
- android:contentDescription="@string/keyboardview_keycode_enter"
- />
+ android:id="@+id/keyguard_bouncer_frame"
+ android:background="@*android:drawable/kg_bouncer_bg_white"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:orientation="vertical"
+ android:layout_weight="1"
+ >
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:orientation="horizontal"
+ android:layout_weight="1"
+ >
+ <TextView android:id="@+id/pinEntry"
+ android:editable="true"
+ android:layout_width="0dip"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:gravity="center"
+ android:layout_marginStart="@*android:dimen/keyguard_lockscreen_pin_margin_left"
+ android:singleLine="true"
+ android:cursorVisible="false"
+ android:background="@null"
+ android:textAppearance="@style/TextAppearance.NumPadKey"
+ android:imeOptions="flagForceAscii|actionDone"
+ />
+ <ImageButton android:id="@+id/delete_button"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:gravity="center_vertical"
+ android:src="@*android:drawable/ic_input_delete"
+ android:clickable="true"
+ android:paddingTop="8dip"
+ android:paddingBottom="8dip"
+ android:paddingLeft="24dp"
+ android:paddingRight="24dp"
+ android:background="?android:attr/selectableItemBackground"
+ android:contentDescription="@string/keyboardview_keycode_delete"
+ />
+ </LinearLayout>
+ <View
+ android:layout_width="wrap_content"
+ android:layout_height="1dp"
+ android:background="#55FFFFFF"
+ />
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:orientation="horizontal"
+ >
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key1"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="1"
+ />
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key2"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="2"
+ />
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key3"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="3"
+ />
+ </LinearLayout>
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:orientation="horizontal"
+ >
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key4"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="4"
+ />
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key5"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="5"
+ />
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key6"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="6"
+ />
+ </LinearLayout>
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:orientation="horizontal"
+ android:layout_weight="1"
+ >
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key7"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="7"
+ />
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key8"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="8"
+ />
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key9"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="9"
+ />
+ </LinearLayout>
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:orientation="horizontal"
+ >
+ <Space
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ />
+ <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ android:id="@+id/key0"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ androidprv:textView="@+id/pinEntry"
+ androidprv:digit="0"
+ />
+ <ImageButton
+ android:id="@+id/key_enter"
+ style="@style/Widget.Button.NumPadKey"
+ android:layout_width="0px"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:paddingRight="30dp"
+ android:src="@drawable/sym_keyboard_return_holo"
+ android:contentDescription="@string/keyboardview_keycode_enter"
+ />
+ </LinearLayout>
</LinearLayout>
<include layout="@layout/keyguard_emergency_carrier_area"
<java-symbol type="id" name="keyguard_account_view" />
<java-symbol type="id" name="keyguard_selector_fade_container" />
<java-symbol type="id" name="keyguard_widget_pager_delete_target" />
+ <java-symbol type="id" name="keyguard_bouncer_frame" />
<java-symbol type="id" name="app_widget_container" />
<java-symbol type="id" name="view_flipper" />
<java-symbol type="id" name="emergency_call_button" />
import android.content.Context;
import android.graphics.Rect;
+import android.graphics.drawable.Drawable;
import android.os.CountDownTimer;
import android.os.SystemClock;
import android.text.Editable;
protected TextView mPasswordEntry;
protected LockPatternUtils mLockPatternUtils;
protected SecurityMessageDisplay mSecurityMessageDisplay;
+ protected View mEcaView;
+ private Drawable mBouncerFrame;
protected boolean mEnableHaptics;
// To avoid accidental lockout due to events while the device in in the pocket, ignore
}
});
mSecurityMessageDisplay = new KeyguardMessageArea.Helper(this);
+ mEcaView = findViewById(R.id.keyguard_selector_fade_container);
+ View bouncerFrameView = findViewById(R.id.keyguard_bouncer_frame);
+ if (bouncerFrameView != null) {
+ mBouncerFrame = bouncerFrameView.getBackground();
+ }
}
@Override
| HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING);
}
}
+
+ @Override
+ public void showBouncer(int duration) {
+ KeyguardSecurityViewHelper.
+ showBouncer(mSecurityMessageDisplay, mEcaView, mBouncerFrame, duration);
+ }
+
+ @Override
+ public void hideBouncer(int duration) {
+ KeyguardSecurityViewHelper.
+ hideBouncer(mSecurityMessageDisplay, mEcaView, mBouncerFrame, duration);
+ }
}
@Override
public void showUsabilityHint() {
}
+
+ @Override
+ public void showBouncer(int duration) {
+ }
+
+ @Override
+ public void hideBouncer(int duration) {
+ }
}
package com.android.internal.policy.impl.keyguard;
import android.content.Context;
+import android.graphics.drawable.Drawable;
import android.os.PowerManager;
import android.telephony.TelephonyManager;
import android.util.AttributeSet;
private BiometricSensorUnlock mBiometricUnlock;
private View mFaceUnlockAreaView;
private ImageButton mCancelButton;
+ private SecurityMessageDisplay mSecurityMessageDisplay;
+ private View mEcaView;
+ private Drawable mBouncerFrame;
private boolean mIsShowing = false;
private final Object mIsShowingLock = new Object();
super.onFinishInflate();
initializeBiometricUnlockView();
+
+ mSecurityMessageDisplay = new KeyguardMessageArea.Helper(this);
+ mEcaView = findViewById(R.id.keyguard_selector_fade_container);
+ View bouncerFrameView = findViewById(R.id.keyguard_bouncer_frame);
+ if (bouncerFrameView != null) {
+ mBouncerFrame = bouncerFrameView.getBackground();
+ }
}
@Override
@Override
public void showUsabilityHint() {
}
+
+ @Override
+ public void showBouncer(int duration) {
+ KeyguardSecurityViewHelper.
+ showBouncer(mSecurityMessageDisplay, mEcaView, mBouncerFrame, duration);
+ }
+
+ @Override
+ public void hideBouncer(int duration) {
+ KeyguardSecurityViewHelper.
+ hideBouncer(mSecurityMessageDisplay, mEcaView, mBouncerFrame, duration);
+ }
+
}
KeyguardSecurityView ksv = (KeyguardSecurityView) view;
ksv.setKeyguardCallback(mCallback);
ksv.setLockPatternUtils(mLockPatternUtils);
+ if (mViewStateManager.isBouncing()) {
+ ksv.showBouncer(0);
+ } else {
+ ksv.hideBouncer(0);
+ }
} else {
Log.w(TAG, "View " + view + " is not a KeyguardSecurityView");
}
}
private void hideMessage(int duration, boolean thenUpdate) {
- Animator anim = ObjectAnimator.ofFloat(this, "alpha", 0f);
- anim.setDuration(duration);
- if (thenUpdate) {
- anim.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
- update();
- }
+ if (duration > 0) {
+ Animator anim = ObjectAnimator.ofFloat(this, "alpha", 0f);
+ anim.setDuration(duration);
+ if (thenUpdate) {
+ anim.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ update();
+ }
});
+ }
+ anim.start();
+ } else {
+ setAlpha(0f);
+ if (thenUpdate) {
+ update();
+ }
}
- anim.start();
}
private void showMessage(int duration) {
- Animator anim = ObjectAnimator.ofFloat(this, "alpha", 1f);
- anim.setDuration(duration);
- anim.start();
+ if (duration > 0) {
+ Animator anim = ObjectAnimator.ofFloat(this, "alpha", 1f);
+ anim.setDuration(duration);
+ anim.start();
+ } else {
+ setAlpha(1f);
+ }
}
}
import android.accounts.OperationCanceledException;
import android.content.Context;
import android.graphics.Rect;
+import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.SystemClock;
};
private Rect mTempRect = new Rect();
private SecurityMessageDisplay mSecurityMessageDisplay;
+ private View mEcaView;
+ private Drawable mBouncerFrame;
enum FooterMode {
Normal,
maybeEnableFallback(mContext);
mSecurityMessageDisplay = new KeyguardMessageArea.Helper(this);
+ mEcaView = findViewById(R.id.keyguard_selector_fade_container);
+ View bouncerFrameView = findViewById(R.id.keyguard_bouncer_frame);
+ if (bouncerFrameView != null) {
+ mBouncerFrame = bouncerFrameView.getBackground();
+ }
}
private void updateFooter(FooterMode mode) {
public KeyguardSecurityCallback getCallback() {
return mCallback;
}
-}
-
+ @Override
+ public void showBouncer(int duration) {
+ KeyguardSecurityViewHelper.
+ showBouncer(mSecurityMessageDisplay, mEcaView, mBouncerFrame, duration);
+ }
+ @Override
+ public void hideBouncer(int duration) {
+ KeyguardSecurityViewHelper.
+ hideBouncer(mSecurityMessageDisplay, mEcaView, mBouncerFrame, duration);
+ }
+}
package com.android.internal.policy.impl.keyguard;
-import android.animation.Animator;
-import android.animation.AnimatorSet;
-import android.animation.ObjectAnimator;
import android.content.Context;
-import android.graphics.Canvas;
-import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
import com.android.internal.R;
public class KeyguardSecurityContainer extends FrameLayout {
-
- private float mBackgroundAlpha;
- private Drawable mBackgroundDrawable;
-
public KeyguardSecurityContainer(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public KeyguardSecurityContainer(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
- mBackgroundDrawable = context.getResources().getDrawable(R.drawable.kg_bouncer_bg_white);
- }
-
- public void setBackgroundAlpha(float alpha) {
- if (Float.compare(mBackgroundAlpha, alpha) != 0) {
- mBackgroundAlpha = alpha;
- invalidate();
- }
- }
-
- public float getBackgroundAlpha() {
- return mBackgroundAlpha;
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- if (mBackgroundAlpha > 0.0f && mBackgroundDrawable != null) {
- Drawable bg = mBackgroundDrawable;
- bg.setAlpha((int) (mBackgroundAlpha * 255));
- bg.setBounds(0, 0, getMeasuredWidth(), getMeasuredHeight());
- bg.draw(canvas);
- }
- super.dispatchDraw(canvas);
}
- public void showBouncer(int duration) {
- SecurityMessageDisplay message = new KeyguardMessageArea.Helper(getSecurityView());
- message.showBouncer(duration);
- AnimatorSet anim = new AnimatorSet();
- anim.playTogether(ObjectAnimator.ofFloat(this, "backgroundAlpha", 1f), getEcaAnim(0f));
- anim.setDuration(duration);
- anim.start();
- }
-
- public void hideBouncer(int duration) {
- SecurityMessageDisplay message = new KeyguardMessageArea.Helper(getSecurityView());
- message.hideBouncer(duration);
- AnimatorSet anim = new AnimatorSet();
- anim.playTogether(ObjectAnimator.ofFloat(this, "backgroundAlpha", 0f), getEcaAnim(1f));
- anim.setDuration(duration);
- anim.start();
- }
-
- View getSecurityView() {
+ KeyguardSecurityViewFlipper getFlipper() {
for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i);
if (child instanceof KeyguardSecurityViewFlipper) {
- return (View) (((KeyguardSecurityViewFlipper) child).getSecurityView());
+ return (KeyguardSecurityViewFlipper) child;
}
}
return null;
}
- Animator getEcaAnim(float alpha) {
- Animator anim = null;
- View securityView = getSecurityView();
- if (securityView != null) {
- View ecaView = securityView.findViewById(R.id.keyguard_selector_fade_container);
- if (ecaView != null) {
- anim = ObjectAnimator.ofFloat(ecaView, "alpha", alpha);
- }
+ public void showBouncer(int duration) {
+ KeyguardSecurityViewFlipper flipper = getFlipper();
+ if (flipper != null) {
+ flipper.showBouncer(duration);
+ }
+ }
+
+ public void hideBouncer(int duration) {
+ KeyguardSecurityViewFlipper flipper = getFlipper();
+ if (flipper != null) {
+ flipper.hideBouncer(duration);
}
- return anim;
}
}
+
*
*/
void showUsabilityHint();
+
+ /**
+ * Place the security view into bouncer mode.
+ * Animate transisiton if duration is non-zero.
+ * @param duration millisends for the transisiton animation.
+ */
+ void showBouncer(int duration);
+
+ /**
+ * Place the security view into non-bouncer mode.
+ * Animate transisiton if duration is non-zero.
+ * @param duration millisends for the transisiton animation.
+ */
+ void hideBouncer(int duration);
}
ksv.showUsabilityHint();
}
}
+
+ @Override
+ public void showBouncer(int duration) {
+ for (int i = 0; i < getChildCount(); i++) {
+ View child = getChildAt(i);
+ if (child instanceof KeyguardSecurityView) {
+ KeyguardSecurityView ksv = (KeyguardSecurityView) child;
+ ksv.showBouncer(child.getVisibility() == View.VISIBLE ? duration : 0);
+ }
+ }
+ }
+
+ @Override
+ public void hideBouncer(int duration) {
+ for (int i = 0; i < getChildCount(); i++) {
+ View child = getChildAt(i);
+ if (child instanceof KeyguardSecurityView) {
+ KeyguardSecurityView ksv = (KeyguardSecurityView) child;
+ ksv.hideBouncer(child.getVisibility() == View.VISIBLE ? duration : 0);
+ }
+ }
+ }
}
--- /dev/null
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.internal.policy.impl.keyguard;
+
+import android.animation.Animator;
+import android.animation.ObjectAnimator;
+import android.graphics.drawable.Drawable;
+import android.view.View;
+
+/**
+ * Some common functions that are useful for KeyguardSecurityViews.
+ */
+public class KeyguardSecurityViewHelper {
+
+ public static void showBouncer(SecurityMessageDisplay securityMessageDisplay,
+ View ecaView, Drawable bouncerFrame, int duration) {
+ if (securityMessageDisplay != null) {
+ securityMessageDisplay.showBouncer(duration);
+ }
+ if (ecaView != null) {
+ if (duration > 0) {
+ Animator anim = ObjectAnimator.ofFloat(ecaView, "alpha", 0f);
+ anim.setDuration(duration);
+ anim.start();
+ } else {
+ ecaView.setAlpha(0f);
+ }
+ }
+ if (bouncerFrame != null) {
+ if (duration > 0) {
+ Animator anim = ObjectAnimator.ofInt(bouncerFrame, "alpha", 255);
+ anim.setDuration(duration);
+ anim.start();
+ } else {
+ bouncerFrame.setAlpha(255);
+ }
+ }
+ }
+
+ public static void hideBouncer(SecurityMessageDisplay securityMessageDisplay,
+ View ecaView, Drawable bouncerFrame, int duration) {
+ if (securityMessageDisplay != null) {
+ securityMessageDisplay.hideBouncer(duration);
+ }
+ if (ecaView != null) {
+ if (duration > 0) {
+ Animator anim = ObjectAnimator.ofFloat(ecaView, "alpha", 1f);
+ anim.setDuration(duration);
+ anim.start();
+ } else {
+ ecaView.setAlpha(1f);
+ }
+ }
+ if (bouncerFrame != null) {
+ if (duration > 0) {
+ Animator anim = ObjectAnimator.ofInt(bouncerFrame, "alpha", 0);
+ anim.setDuration(duration);
+ anim.start();
+ } else {
+ bouncerFrame.setAlpha(0);
+ }
+ }
+ }
+}
public KeyguardSecurityCallback getCallback() {
return mCallback;
}
+
+ @Override
+ public void showBouncer(int duration) {
+ }
+
+ @Override
+ public void hideBouncer(int duration) {
+ }
}
mChallengeLayout.showBouncer();
}
+ public boolean isBouncing() {
+ return mChallengeLayout.isBouncing();
+ }
+
public void fadeOutSecurity(int duration) {
((View) mKeyguardSecurityContainer).animate().alpha(0).setDuration(duration);
}