diff options
author | Chris Wren <cwren@android.com> | 2012-11-05 13:16:31 -0500 |
---|---|---|
committer | Chris Wren <cwren@android.com> | 2012-11-05 13:30:26 -0500 |
commit | c0ae9e67ebe6f1298800feaed1b43e867139a904 (patch) | |
tree | dff0fdb43a473936344adadd60cb054e3f04db6f | |
parent | 08898375fba7cc776857ebf0846c7183563a300f (diff) | |
download | frameworks_base-c0ae9e67ebe6f1298800feaed1b43e867139a904.tar.gz frameworks_base-c0ae9e67ebe6f1298800feaed1b43e867139a904.tar.bz2 frameworks_base-c0ae9e67ebe6f1298800feaed1b43e867139a904.zip |
bouncer: hide more text and frame less.
Bug: 7464865
Change-Id: Ic8dac2582c014922143919f142fd36eb720dd3a9
Proto-Id: Id80601c9ffbdc34669b485e943b42cee237898f3
20 files changed, 860 insertions, 655 deletions
diff --git a/core/res/res/layout-port/keyguard_host_view.xml b/core/res/res/layout-port/keyguard_host_view.xml index 9921313bb72..b2bf3f147e4 100644 --- a/core/res/res/layout-port/keyguard_host_view.xml +++ b/core/res/res/layout-port/keyguard_host_view.xml @@ -64,7 +64,6 @@ 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 diff --git a/core/res/res/layout/keyguard_face_unlock_view.xml b/core/res/res/layout/keyguard_face_unlock_view.xml index 39e8f318378..c1e35cf780d 100644 --- a/core/res/res/layout/keyguard_face_unlock_view.xml +++ b/core/res/res/layout/keyguard_face_unlock_view.xml @@ -31,32 +31,39 @@ 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" diff --git a/core/res/res/layout/keyguard_password_view.xml b/core/res/res/layout/keyguard_password_view.xml index a054d07a79f..2e2ada8eab1 100644 --- a/core/res/res/layout/keyguard_password_view.xml +++ b/core/res/res/layout/keyguard_password_view.xml @@ -39,45 +39,51 @@ <!-- 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" diff --git a/core/res/res/layout/keyguard_pattern_view.xml b/core/res/res/layout/keyguard_pattern_view.xml index 5ebc0008c0e..1c11fdd335e 100644 --- a/core/res/res/layout/keyguard_pattern_view.xml +++ b/core/res/res/layout/keyguard_pattern_view.xml @@ -43,14 +43,17 @@ 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" @@ -58,15 +61,14 @@ 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> diff --git a/core/res/res/layout/keyguard_pin_view.xml b/core/res/res/layout/keyguard_pin_view.xml index d6cfe2acd32..d486d5ec13f 100644 --- a/core/res/res/layout/keyguard_pin_view.xml +++ b/core/res/res/layout/keyguard_pin_view.xml @@ -31,177 +31,185 @@ 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" diff --git a/core/res/res/layout/keyguard_sim_pin_view.xml b/core/res/res/layout/keyguard_sim_pin_view.xml index 36e1b150cff..fbfb7cfe6ec 100644 --- a/core/res/res/layout/keyguard_sim_pin_view.xml +++ b/core/res/res/layout/keyguard_sim_pin_view.xml @@ -36,175 +36,184 @@ 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" diff --git a/core/res/res/layout/keyguard_sim_puk_view.xml b/core/res/res/layout/keyguard_sim_puk_view.xml index e846a7bb9b9..10b86b8fab9 100644 --- a/core/res/res/layout/keyguard_sim_puk_view.xml +++ b/core/res/res/layout/keyguard_sim_puk_view.xml @@ -37,175 +37,184 @@ 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" diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index a12c14cf6fc..dfa2b4a08cb 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -1320,6 +1320,7 @@ <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" /> diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView.java index 71526d2653b..7c769a705b2 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView.java @@ -18,6 +18,7 @@ package com.android.internal.policy.impl.keyguard; 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; @@ -43,6 +44,8 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout 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 @@ -122,6 +125,11 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout } }); 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 @@ -239,5 +247,17 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout | 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); + } } diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardAccountView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardAccountView.java index 9c877550d4e..3ce61d91cfb 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardAccountView.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardAccountView.java @@ -318,5 +318,13 @@ public class KeyguardAccountView extends LinearLayout implements KeyguardSecurit @Override public void showUsabilityHint() { } + + @Override + public void showBouncer(int duration) { + } + + @Override + public void hideBouncer(int duration) { + } } diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardFaceUnlockView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardFaceUnlockView.java index c0095de6708..8ca6d2a5ab2 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardFaceUnlockView.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardFaceUnlockView.java @@ -16,6 +16,7 @@ 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; @@ -37,6 +38,9 @@ public class KeyguardFaceUnlockView extends LinearLayout implements KeyguardSecu 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(); @@ -54,6 +58,13 @@ public class KeyguardFaceUnlockView extends LinearLayout implements KeyguardSecu 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 @@ -217,4 +228,17 @@ public class KeyguardFaceUnlockView extends LinearLayout implements KeyguardSecu @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); + } + } diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java index 3a901c8f0b0..f8edd5d64cc 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java @@ -196,6 +196,11 @@ public class KeyguardHostView extends KeyguardViewBase { 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"); } diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardMessageArea.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardMessageArea.java index f6f3fabbe58..ee5c4a68a7b 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardMessageArea.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardMessageArea.java @@ -240,22 +240,33 @@ class KeyguardMessageArea extends TextView { } 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); + } } } diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPatternView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPatternView.java index 82cb44baa94..3a826877ae5 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPatternView.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPatternView.java @@ -23,6 +23,7 @@ import android.accounts.AuthenticatorException; 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; @@ -84,6 +85,8 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit }; private Rect mTempRect = new Rect(); private SecurityMessageDisplay mSecurityMessageDisplay; + private View mEcaView; + private Drawable mBouncerFrame; enum FooterMode { Normal, @@ -136,6 +139,11 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit 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) { @@ -381,7 +389,16 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit 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); + } +} diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityContainer.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityContainer.java index 7b115078bdd..375a96abc33 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityContainer.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityContainer.java @@ -1,11 +1,6 @@ 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; @@ -13,10 +8,6 @@ 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); } @@ -27,68 +18,30 @@ public class KeyguardSecurityContainer extends FrameLayout { 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; } } + diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityView.java index 26517435d8f..027b16e5fab 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityView.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityView.java @@ -66,4 +66,18 @@ public interface KeyguardSecurityView { * */ 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); } diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityViewFlipper.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityViewFlipper.java index 58cf56767b0..3d4cb194bcf 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityViewFlipper.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityViewFlipper.java @@ -125,4 +125,26 @@ public class KeyguardSecurityViewFlipper extends ViewFlipper implements Keyguard 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); + } + } + } } diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityViewHelper.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityViewHelper.java new file mode 100644 index 00000000000..2ccdc1d9c5f --- /dev/null +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityViewHelper.java @@ -0,0 +1,78 @@ +/* + * 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); + } + } + } +} diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java index 938e3bd63aa..365256f2e7d 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java @@ -261,4 +261,12 @@ public class KeyguardSelectorView extends LinearLayout implements KeyguardSecuri public KeyguardSecurityCallback getCallback() { return mCallback; } + + @Override + public void showBouncer(int duration) { + } + + @Override + public void hideBouncer(int duration) { + } } diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewStateManager.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewStateManager.java index 054b9b20a69..969b65ef1ef 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewStateManager.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewStateManager.java @@ -92,6 +92,10 @@ public class KeyguardViewStateManager implements SlidingChallengeLayout.OnChalle mChallengeLayout.showBouncer(); } + public boolean isBouncing() { + return mChallengeLayout.isBouncing(); + } + public void fadeOutSecurity(int duration) { ((View) mKeyguardSecurityContainer).animate().alpha(0).setDuration(duration); } |