Merge "Fix 3330653: Update lockscreen layouts to match latest mocks [DO NOT MERGE]" into honeycomb
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 650 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 679 B |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 521 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 607 B |
@@ -22,18 +22,23 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
>
|
>
|
||||||
|
|
||||||
<!-- left side: status and emergency call button -->
|
<!-- left side: status -->
|
||||||
<LinearLayout
|
<RelativeLayout
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_width="0dip"
|
android:layout_width="0dip">
|
||||||
android:orientation="vertical"
|
|
||||||
android:gravity="center_vertical"
|
<include layout="@layout/keyguard_screen_status_land"
|
||||||
>
|
android:layout_width="wrap_content"
|
||||||
<include layout="@layout/keyguard_screen_status_land" />
|
android:layout_height="wrap_content"
|
||||||
</LinearLayout>
|
android:layout_marginLeft="102dip"
|
||||||
|
android:layout_marginTop="320dip"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_alignParentLeft="true"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
<!-- right side: password -->
|
<!-- right side: password -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="0dip"
|
android:layout_width="0dip"
|
||||||
|
|||||||
@@ -19,21 +19,23 @@
|
|||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical">
|
||||||
>
|
|
||||||
|
<!-- top: status -->
|
||||||
<!-- left side: status and emergency call button -->
|
<RelativeLayout
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dip"
|
android:layout_height="0dip"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1">
|
||||||
android:orientation="vertical"
|
<include layout="@layout/keyguard_screen_status_port"
|
||||||
android:gravity="center_vertical"
|
android:layout_width="wrap_content"
|
||||||
>
|
android:layout_height="wrap_content"
|
||||||
<include layout="@layout/keyguard_screen_status_land" />
|
android:layout_marginTop="134dip"
|
||||||
</LinearLayout>
|
android:layout_marginLeft="266dip"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
<!-- right side: password -->
|
android:layout_alignParentLeft="true"/>
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<!-- bottom: password -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dip"
|
android:layout_height="0dip"
|
||||||
|
|||||||
@@ -23,8 +23,6 @@
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="140dip"
|
|
||||||
android:layout_marginTop="20dip"
|
|
||||||
android:gravity="left"
|
android:gravity="left"
|
||||||
>
|
>
|
||||||
|
|
||||||
@@ -58,7 +56,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:ellipsize="none"
|
android:ellipsize="none"
|
||||||
android:textSize="120sp"
|
android:textSize="98sp"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:textColor="@color/lockscreen_clock_background"
|
android:textColor="@color/lockscreen_clock_background"
|
||||||
android:layout_marginBottom="6dip"
|
android:layout_marginBottom="6dip"
|
||||||
@@ -69,7 +67,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:ellipsize="none"
|
android:ellipsize="none"
|
||||||
android:textSize="120sp"
|
android:textSize="98sp"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:textColor="@color/lockscreen_clock_foreground"
|
android:textColor="@color/lockscreen_clock_foreground"
|
||||||
android:layout_alignLeft="@id/timeDisplayBackground"
|
android:layout_alignLeft="@id/timeDisplayBackground"
|
||||||
@@ -92,15 +90,29 @@
|
|||||||
|
|
||||||
</com.android.internal.widget.DigitalClock>
|
</com.android.internal.widget.DigitalClock>
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/date"
|
android:orientation="horizontal"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/time"
|
android:layout_below="@id/time"
|
||||||
android:layout_marginTop="10dip"
|
android:layout_marginTop="10dip">
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
|
||||||
android:textSize="22sp"
|
<TextView
|
||||||
/>
|
android:id="@+id/date"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
android:textSize="17sp"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/alarm_status"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="30dip"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
android:textSize="17sp"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- Status2 is generally charge status -->
|
<!-- Status2 is generally charge status -->
|
||||||
<TextView
|
<TextView
|
||||||
@@ -109,18 +121,19 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:textSize="22sp"
|
android:textSize="17sp"
|
||||||
android:layout_marginTop="10dip"
|
android:layout_marginTop="10dip"
|
||||||
android:drawablePadding="4dip"
|
android:drawablePadding="4dip"
|
||||||
|
android:visibility="gone"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- Status1 is generally alarm status -->
|
<!-- Status1 is generally battery status and informational messages -->
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/status1"
|
android:id="@+id/status1"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dip"
|
android:layout_marginTop="10dip"
|
||||||
android:textSize="22sp"
|
android:textSize="17sp"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -130,9 +143,10 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:textSize="22sp"
|
android:textSize="17sp"
|
||||||
android:layout_marginTop="20dip"
|
android:layout_marginTop="20dip"
|
||||||
android:singleLine="false"
|
android:singleLine="false"
|
||||||
|
android:textColor="@color/lockscreen_owner_info"
|
||||||
android:visibility="invisible"
|
android:visibility="invisible"
|
||||||
/>
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -44,8 +44,6 @@
|
|||||||
<com.android.internal.widget.DigitalClock android:id="@+id/time"
|
<com.android.internal.widget.DigitalClock android:id="@+id/time"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_marginTop="8dip"
|
android:layout_marginTop="8dip"
|
||||||
android:layout_marginBottom="8dip"
|
android:layout_marginBottom="8dip"
|
||||||
android_layout_marginLeft="-10dip">
|
android_layout_marginLeft="-10dip">
|
||||||
@@ -57,7 +55,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:ellipsize="none"
|
android:ellipsize="none"
|
||||||
android:textSize="120sp"
|
android:textSize="98sp"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:textColor="@color/lockscreen_clock_background"
|
android:textColor="@color/lockscreen_clock_background"
|
||||||
android:layout_marginBottom="6dip"
|
android:layout_marginBottom="6dip"
|
||||||
@@ -68,7 +66,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:ellipsize="none"
|
android:ellipsize="none"
|
||||||
android:textSize="120sp"
|
android:textSize="98sp"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:textColor="@color/lockscreen_clock_foreground"
|
android:textColor="@color/lockscreen_clock_foreground"
|
||||||
android:layout_marginBottom="6dip"
|
android:layout_marginBottom="6dip"
|
||||||
@@ -91,15 +89,29 @@
|
|||||||
|
|
||||||
</com.android.internal.widget.DigitalClock>
|
</com.android.internal.widget.DigitalClock>
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/date"
|
android:orientation="horizontal"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/time"
|
android:layout_below="@id/time"
|
||||||
android:layout_marginTop="10dip"
|
android:layout_marginTop="10dip">
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
|
||||||
android:textSize="22sp"
|
<TextView
|
||||||
/>
|
android:id="@+id/date"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
android:textSize="17sp"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/alarm_status"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="30dip"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
android:textSize="17sp"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- used for status such as the next alarm, and charging status. -->
|
<!-- used for status such as the next alarm, and charging status. -->
|
||||||
<TextView
|
<TextView
|
||||||
@@ -108,9 +120,10 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:textSize="22sp"
|
android:textSize="17sp"
|
||||||
android:layout_marginTop="10dip"
|
android:layout_marginTop="10dip"
|
||||||
android:drawablePadding="4dip"
|
android:drawablePadding="4dip"
|
||||||
|
android:visibility="gone"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -118,7 +131,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dip"
|
android:layout_marginTop="10dip"
|
||||||
android:textSize="22sp"
|
android:textSize="17sp"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -129,8 +142,9 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="20dip"
|
android:layout_marginTop="20dip"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:textSize="22sp"
|
android:textSize="17sp"
|
||||||
android:singleLine="false"
|
android:singleLine="false"
|
||||||
android:visibility="invisible"
|
android:visibility="invisible"
|
||||||
|
android:textColor="@color/lockscreen_owner_info"
|
||||||
/>
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -29,15 +29,18 @@
|
|||||||
android:id="@+id/root"
|
android:id="@+id/root"
|
||||||
android:background="#70000000">
|
android:background="#70000000">
|
||||||
|
|
||||||
<!-- left side: status and emergency call button -->
|
<!-- top: status -->
|
||||||
<LinearLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dip"
|
android:layout_height="0dip"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical">
|
||||||
android:gravity="center_vertical">
|
<include layout="@layout/keyguard_screen_status_port"
|
||||||
<include layout="@layout/keyguard_screen_status_port" />
|
android:layout_width="wrap_content"
|
||||||
</LinearLayout>
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="134dip"
|
||||||
|
android:layout_marginLeft="266dip"/>
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -75,6 +78,7 @@
|
|||||||
android:text="@string/emergency_calls_only"
|
android:text="@string/emergency_calls_only"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
|
android:visibility="gone"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- emergency call button shown when sim is PUKd and tab_selector is
|
<!-- emergency call button shown when sim is PUKd and tab_selector is
|
||||||
@@ -86,7 +90,7 @@
|
|||||||
android:drawableLeft="@drawable/ic_emergency"
|
android:drawableLeft="@drawable/ic_emergency"
|
||||||
android:layout_centerInParent="true"
|
android:layout_centerInParent="true"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_marginBottom="80dip"
|
android:layout_marginBottom="90dip"
|
||||||
style="@style/Widget.Button.Transparent"
|
style="@style/Widget.Button.Transparent"
|
||||||
android:drawablePadding="8dip"
|
android:drawablePadding="8dip"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
|
|||||||
@@ -28,16 +28,21 @@
|
|||||||
android:background="#70000000"
|
android:background="#70000000"
|
||||||
android:id="@+id/root">
|
android:id="@+id/root">
|
||||||
|
|
||||||
<!-- left side: status and emergency call button -->
|
<!-- left side: status -->
|
||||||
<LinearLayout
|
<RelativeLayout
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_width="0dip"
|
android:layout_width="0dip">
|
||||||
android:orientation="vertical"
|
|
||||||
android:gravity="center_vertical"
|
<include layout="@layout/keyguard_screen_status_land"
|
||||||
>
|
android:layout_width="wrap_content"
|
||||||
<include layout="@layout/keyguard_screen_status_land" />
|
android:layout_height="wrap_content"
|
||||||
</LinearLayout>
|
android:layout_marginLeft="102dip"
|
||||||
|
android:layout_marginTop="320dip"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_alignParentLeft="true"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
<!-- right side -->
|
<!-- right side -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|||||||
@@ -26,81 +26,92 @@
|
|||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
>
|
android:background="#70000000">
|
||||||
|
|
||||||
<!-- left side: status and emergency call button -->
|
<!-- left side: status -->
|
||||||
<LinearLayout
|
<RelativeLayout
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_width="0dip"
|
android:layout_width="0dip">
|
||||||
android:orientation="vertical"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
>
|
|
||||||
|
|
||||||
<include layout="@layout/keyguard_screen_status_land" />
|
|
||||||
|
|
||||||
<!-- footer -->
|
<include layout="@layout/keyguard_screen_status_land"
|
||||||
<FrameLayout
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="140dip"
|
android:layout_marginLeft="102dip"
|
||||||
>
|
android:layout_marginTop="320dip"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_alignParentLeft="true"/>
|
||||||
|
|
||||||
<!-- option 1: a single emergency call button -->
|
</RelativeLayout>
|
||||||
<RelativeLayout android:id="@+id/footerNormal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="left"
|
|
||||||
>
|
|
||||||
<Button android:id="@+id/emergencyCallAlone"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/lockscreen_emergency_call"
|
|
||||||
style="@style/Widget.Button.Transparent"
|
|
||||||
android:drawableLeft="@drawable/ic_emergency"
|
|
||||||
android:drawablePadding="8dip"
|
|
||||||
android:visibility="gone"
|
|
||||||
/>
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<!-- option 2: an emergency call button, and a 'forgot pattern?' button -->
|
|
||||||
<LinearLayout android:id="@+id/footerForgotPattern"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="left"
|
|
||||||
>
|
|
||||||
<Button android:id="@+id/forgotPattern"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
style="@style/Widget.Button.Transparent"
|
|
||||||
/>
|
|
||||||
<Button android:id="@+id/emergencyCallTogether"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/lockscreen_emergency_call"
|
|
||||||
style="@style/Widget.Button.Transparent"
|
|
||||||
android:drawableLeft="@drawable/ic_emergency"
|
|
||||||
android:drawablePadding="8dip"
|
|
||||||
android:visibility="gone"
|
|
||||||
/>
|
|
||||||
</LinearLayout>
|
|
||||||
</FrameLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- right side: lock pattern -->
|
<!-- right side: lock pattern -->
|
||||||
<LinearLayout
|
<RelativeLayout
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_width="0dip"
|
android:layout_width="0dip"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
android:gravity="center"
|
|
||||||
>
|
|
||||||
<com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
|
<com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
|
||||||
android:layout_width="354dip"
|
android:layout_width="354dip"
|
||||||
android:layout_height="354dip"
|
android:layout_height="354dip"
|
||||||
android:layout_marginTop="90dip"
|
android:layout_marginLeft="143dip"
|
||||||
android:layout_marginRight="90dip"
|
android:layout_marginTop="201dip"
|
||||||
/>
|
android:layout_gravity="center_vertical"
|
||||||
</LinearLayout>
|
/>
|
||||||
|
|
||||||
|
<!-- footer -->
|
||||||
|
|
||||||
|
<!-- option 1: a single emergency call button -->
|
||||||
|
<RelativeLayout android:id="@+id/footerNormal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/lockPattern"
|
||||||
|
android:layout_alignLeft="@id/lockPattern"
|
||||||
|
android:layout_alignRight="@id/lockPattern"
|
||||||
|
android:layout_marginTop="28dip"
|
||||||
|
android:layout_marginLeft="28dip"
|
||||||
|
android:layout_marginRight="28dip"
|
||||||
|
>
|
||||||
|
<Button android:id="@+id/emergencyCallAlone"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/lockscreen_emergency_call"
|
||||||
|
style="@style/Widget.Button.Transparent"
|
||||||
|
android:drawableLeft="@drawable/ic_emergency"
|
||||||
|
android:drawablePadding="8dip"
|
||||||
|
android:visibility="gone"
|
||||||
|
/>
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<!-- option 2: an emergency call button, and a 'forgot pattern?' button -->
|
||||||
|
<LinearLayout android:id="@+id/footerForgotPattern"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/footerNormal"
|
||||||
|
android:layout_alignLeft="@id/lockPattern"
|
||||||
|
android:layout_alignRight="@id/lockPattern"
|
||||||
|
android:layout_marginTop="28dip"
|
||||||
|
android:layout_marginLeft="28dip"
|
||||||
|
android:layout_marginRight="28dip">
|
||||||
|
|
||||||
|
<Button android:id="@+id/forgotPattern"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/Widget.Button.Transparent"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Button android:id="@+id/emergencyCallTogether"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/lockscreen_emergency_call"
|
||||||
|
style="@style/Widget.Button.Transparent"
|
||||||
|
android:drawableLeft="@drawable/ic_emergency"
|
||||||
|
android:drawablePadding="8dip"
|
||||||
|
android:visibility="gone"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>
|
</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>
|
||||||
|
|||||||
@@ -22,18 +22,21 @@
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:background="#70000000"
|
||||||
>
|
>
|
||||||
|
|
||||||
<!-- left side: status and emergency call button -->
|
<!-- top: status -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_height="0dip"
|
android:layout_height="0dip"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical">
|
||||||
android:gravity="center_vertical"
|
|
||||||
>
|
|
||||||
|
|
||||||
<include layout="@layout/keyguard_screen_status_port" />
|
<include layout="@layout/keyguard_screen_status_port"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="134dip"
|
||||||
|
android:layout_marginLeft="266dip"/>
|
||||||
|
|
||||||
<!-- footer -->
|
<!-- footer -->
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
|
|||||||
@@ -117,11 +117,24 @@
|
|||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<!-- TODO: Redo layout when we release on phones -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/alarm_status"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:drawablePadding="4dip"
|
||||||
|
android:layout_below="@id/date"
|
||||||
|
android:layout_marginTop="4dip"
|
||||||
|
android:layout_marginLeft="24dip"
|
||||||
|
/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/status1"
|
android:id="@+id/status1"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/date"
|
android:layout_below="@id/alarm_status"
|
||||||
android:layout_marginTop="4dip"
|
android:layout_marginTop="4dip"
|
||||||
android:layout_marginLeft="24dip"
|
android:layout_marginLeft="24dip"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
|||||||
@@ -118,11 +118,24 @@
|
|||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<!-- TODO: Redo layout when we release on phones -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/alarm_status"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:drawablePadding="4dip"
|
||||||
|
android:layout_below="@id/date"
|
||||||
|
android:layout_marginTop="4dip"
|
||||||
|
android:layout_marginLeft="24dip"
|
||||||
|
/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/status1"
|
android:id="@+id/status1"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/date"
|
android:layout_below="@id/alarm_status"
|
||||||
android:layout_marginTop="6dip"
|
android:layout_marginTop="6dip"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:drawablePadding="4dip"
|
android:drawablePadding="4dip"
|
||||||
|
|||||||
@@ -38,6 +38,15 @@
|
|||||||
android:layout_marginLeft="24dip"
|
android:layout_marginLeft="24dip"
|
||||||
android:gravity="left"
|
android:gravity="left"
|
||||||
>
|
>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/alarm_status"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:drawablePadding="4dip"
|
||||||
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/status1"
|
android:id="@+id/status1"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|||||||
@@ -127,6 +127,15 @@
|
|||||||
android:layout_marginLeft="12dip"
|
android:layout_marginLeft="12dip"
|
||||||
android:gravity="left"
|
android:gravity="left"
|
||||||
>
|
>
|
||||||
|
<!-- TODO: Redo layout when we release on phones -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/alarm_status"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:drawablePadding="4dip"
|
||||||
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/status1"
|
android:id="@+id/status1"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|||||||
@@ -104,9 +104,10 @@
|
|||||||
<color name="keyguard_text_color_decline">#fe0a5a</color>
|
<color name="keyguard_text_color_decline">#fe0a5a</color>
|
||||||
|
|
||||||
<!-- keyguard clock -->
|
<!-- keyguard clock -->
|
||||||
<color name="lockscreen_clock_background">#ff9a9a9a</color>
|
<color name="lockscreen_clock_background">#b3ffffff</color>
|
||||||
<color name="lockscreen_clock_foreground">#ff666666</color>
|
<color name="lockscreen_clock_foreground">#40000000</color>
|
||||||
<color name="lockscreen_clock_am_pm">#ff9a9a9a</color>
|
<color name="lockscreen_clock_am_pm">#ff9a9a9a</color>
|
||||||
|
<color name="lockscreen_owner_info">#ff9a9a9a</color>
|
||||||
|
|
||||||
<!-- For holo theme -->
|
<!-- For holo theme -->
|
||||||
<drawable name="screen_background_holo_light">#fff3f3f3</drawable>
|
<drawable name="screen_background_holo_light">#fff3f3f3</drawable>
|
||||||
|
|||||||
@@ -80,11 +80,6 @@ class LockScreen extends LinearLayout implements KeyguardScreen,
|
|||||||
// last known battery level
|
// last known battery level
|
||||||
private int mBatteryLevel = 100;
|
private int mBatteryLevel = 100;
|
||||||
|
|
||||||
private String mNextAlarm = null;
|
|
||||||
private Drawable mAlarmIcon = null;
|
|
||||||
private String mCharging = null;
|
|
||||||
private Drawable mChargingIcon = null;
|
|
||||||
|
|
||||||
private boolean mSilentMode;
|
private boolean mSilentMode;
|
||||||
private AudioManager mAudioManager;
|
private AudioManager mAudioManager;
|
||||||
private String mDateFormatString;
|
private String mDateFormatString;
|
||||||
@@ -356,9 +351,6 @@ class LockScreen extends LinearLayout implements KeyguardScreen,
|
|||||||
mStatus = getCurrentStatus(updateMonitor.getSimState());
|
mStatus = getCurrentStatus(updateMonitor.getSimState());
|
||||||
updateLayout(mStatus);
|
updateLayout(mStatus);
|
||||||
|
|
||||||
refreshBatteryStringAndIcon();
|
|
||||||
refreshAlarmDisplay();
|
|
||||||
|
|
||||||
mTimeFormat = DateFormat.getTimeFormat(getContext());
|
mTimeFormat = DateFormat.getTimeFormat(getContext());
|
||||||
mDateFormatString = getContext().getString(R.string.full_wday_month_day_no_year);
|
mDateFormatString = getContext().getString(R.string.full_wday_month_day_no_year);
|
||||||
refreshTimeAndDateDisplay();
|
refreshTimeAndDateDisplay();
|
||||||
@@ -417,14 +409,6 @@ class LockScreen extends LinearLayout implements KeyguardScreen,
|
|||||||
private Runnable mPendingR1;
|
private Runnable mPendingR1;
|
||||||
private Runnable mPendingR2;
|
private Runnable mPendingR2;
|
||||||
|
|
||||||
private void refreshAlarmDisplay() {
|
|
||||||
mNextAlarm = mLockPatternUtils.getNextAlarm();
|
|
||||||
if (mNextAlarm != null) {
|
|
||||||
mAlarmIcon = getContext().getResources().getDrawable(R.drawable.ic_lock_idle_alarm);
|
|
||||||
}
|
|
||||||
updateStatusLines();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
public void onRefreshBatteryInfo(boolean showBatteryInfo, boolean pluggedIn,
|
public void onRefreshBatteryInfo(boolean showBatteryInfo, boolean pluggedIn,
|
||||||
int batteryLevel) {
|
int batteryLevel) {
|
||||||
@@ -433,32 +417,9 @@ class LockScreen extends LinearLayout implements KeyguardScreen,
|
|||||||
mPluggedIn = pluggedIn;
|
mPluggedIn = pluggedIn;
|
||||||
mBatteryLevel = batteryLevel;
|
mBatteryLevel = batteryLevel;
|
||||||
|
|
||||||
refreshBatteryStringAndIcon();
|
|
||||||
updateStatusLines();
|
updateStatusLines();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void refreshBatteryStringAndIcon() {
|
|
||||||
if (!mShowingBatteryInfo) {
|
|
||||||
mCharging = null;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mChargingIcon == null) {
|
|
||||||
mChargingIcon =
|
|
||||||
getContext().getResources().getDrawable(R.drawable.ic_lock_idle_charging);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mPluggedIn) {
|
|
||||||
if (mBatteryLevel >= 100) {
|
|
||||||
mCharging = getContext().getString(R.string.lockscreen_charged);
|
|
||||||
} else {
|
|
||||||
mCharging = getContext().getString(R.string.lockscreen_plugged_in, mBatteryLevel);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
mCharging = getContext().getString(R.string.lockscreen_low_battery);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
public void onTimeChanged() {
|
public void onTimeChanged() {
|
||||||
refreshTimeAndDateDisplay();
|
refreshTimeAndDateDisplay();
|
||||||
@@ -469,7 +430,7 @@ class LockScreen extends LinearLayout implements KeyguardScreen,
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateStatusLines() {
|
private void updateStatusLines() {
|
||||||
mStatusView.updateStatusLines(mStatus.showStatusLines(), mCharging, mChargingIcon, mAlarmIcon);
|
mStatusView.updateStatusLines(mStatus.showStatusLines());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
|
|||||||
@@ -396,7 +396,7 @@ class PatternUnlockScreen extends LinearLayoutWithDefaultTouchRecepient
|
|||||||
mLockPatternView
|
mLockPatternView
|
||||||
.setDisplayMode(LockPatternView.DisplayMode.Correct);
|
.setDisplayMode(LockPatternView.DisplayMode.Correct);
|
||||||
mStatusView.setInstructions("");
|
mStatusView.setInstructions("");
|
||||||
mStatusView.updateStatusLines();
|
mStatusView.updateStatusLines(true);
|
||||||
mCallback.keyguardDone(true);
|
mCallback.keyguardDone(true);
|
||||||
mCallback.reportSuccessfulUnlockAttempt();
|
mCallback.reportSuccessfulUnlockAttempt();
|
||||||
} else {
|
} else {
|
||||||
@@ -416,7 +416,7 @@ class PatternUnlockScreen extends LinearLayoutWithDefaultTouchRecepient
|
|||||||
// TODO mUnlockIcon.setVisibility(View.VISIBLE);
|
// TODO mUnlockIcon.setVisibility(View.VISIBLE);
|
||||||
mStatusView.setInstructions(
|
mStatusView.setInstructions(
|
||||||
getContext().getString(R.string.lockscreen_pattern_wrong));
|
getContext().getString(R.string.lockscreen_pattern_wrong));
|
||||||
mStatusView.updateStatusLines();
|
mStatusView.updateStatusLines(true);
|
||||||
mLockPatternView.postDelayed(
|
mLockPatternView.postDelayed(
|
||||||
mCancelPatternRunnable,
|
mCancelPatternRunnable,
|
||||||
PATTERN_CLEAR_TIMEOUT_MS);
|
PATTERN_CLEAR_TIMEOUT_MS);
|
||||||
@@ -437,7 +437,7 @@ class PatternUnlockScreen extends LinearLayoutWithDefaultTouchRecepient
|
|||||||
mStatusView.setInstructions(getContext().getString(
|
mStatusView.setInstructions(getContext().getString(
|
||||||
R.string.lockscreen_too_many_failed_attempts_countdown,
|
R.string.lockscreen_too_many_failed_attempts_countdown,
|
||||||
secondsRemaining));
|
secondsRemaining));
|
||||||
mStatusView.updateStatusLines();
|
mStatusView.updateStatusLines(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -445,7 +445,7 @@ class PatternUnlockScreen extends LinearLayoutWithDefaultTouchRecepient
|
|||||||
mLockPatternView.setEnabled(true);
|
mLockPatternView.setEnabled(true);
|
||||||
mStatusView.setInstructions(getContext().getString(
|
mStatusView.setInstructions(getContext().getString(
|
||||||
R.string.lockscreen_pattern_instructions));
|
R.string.lockscreen_pattern_instructions));
|
||||||
mStatusView.updateStatusLines();
|
mStatusView.updateStatusLines(true);
|
||||||
// TODO mUnlockIcon.setVisibility(View.VISIBLE);
|
// TODO mUnlockIcon.setVisibility(View.VISIBLE);
|
||||||
mFailedPatternAttemptsSinceLastTimeout = 0;
|
mFailedPatternAttemptsSinceLastTimeout = 0;
|
||||||
if (mEnableFallback) {
|
if (mEnableFallback) {
|
||||||
|
|||||||
@@ -19,6 +19,11 @@ import android.view.View;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
class StatusView {
|
class StatusView {
|
||||||
|
private static final int LOCK_ICON = R.drawable.ic_lock_idle_lock;
|
||||||
|
private static final int ALARM_ICON = R.drawable.ic_lock_idle_alarm;
|
||||||
|
private static final int CHARGING_ICON = R.drawable.ic_lock_idle_charging;
|
||||||
|
private static final int BATTERY_LOW_ICON = R.drawable.ic_lock_idle_low_battery;
|
||||||
|
|
||||||
private String mDateFormatString;
|
private String mDateFormatString;
|
||||||
|
|
||||||
private TextView mCarrier;
|
private TextView mCarrier;
|
||||||
@@ -33,20 +38,18 @@ class StatusView {
|
|||||||
// last known battery level
|
// last known battery level
|
||||||
private int mBatteryLevel = 100;
|
private int mBatteryLevel = 100;
|
||||||
|
|
||||||
private String mNextAlarm = null;
|
|
||||||
|
|
||||||
private String mInstructions = null;
|
private String mInstructions = null;
|
||||||
private TextView mStatus1;
|
private TextView mStatus1;
|
||||||
private TextView mStatus2;
|
|
||||||
private TextView mPropertyOf;
|
private TextView mPropertyOf;
|
||||||
|
|
||||||
private boolean mHasStatus2;
|
|
||||||
private boolean mHasCarrier;
|
private boolean mHasCarrier;
|
||||||
private boolean mHasDate;
|
private boolean mHasDate;
|
||||||
private boolean mHasProperty;
|
|
||||||
|
|
||||||
private View mView;
|
private View mView;
|
||||||
|
|
||||||
|
private TextView mAlarmStatus;
|
||||||
|
private LockPatternUtils mLockPatternUtils;
|
||||||
|
|
||||||
private View findViewById(int id) {
|
private View findViewById(int id) {
|
||||||
return mView.findViewById(id);
|
return mView.findViewById(id);
|
||||||
}
|
}
|
||||||
@@ -69,7 +72,7 @@ class StatusView {
|
|||||||
mShowingBatteryInfo = showBatteryInfo;
|
mShowingBatteryInfo = showBatteryInfo;
|
||||||
mPluggedIn = pluggedIn;
|
mPluggedIn = pluggedIn;
|
||||||
mBatteryLevel = batteryLevel;
|
mBatteryLevel = batteryLevel;
|
||||||
updateStatusLines();
|
updateStatusLines(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void onTimeChanged() {
|
void onTimeChanged() {
|
||||||
@@ -91,14 +94,14 @@ class StatusView {
|
|||||||
mDate = (TextView) findViewById(R.id.date);
|
mDate = (TextView) findViewById(R.id.date);
|
||||||
mHasDate = (mDate != null);
|
mHasDate = (mDate != null);
|
||||||
mDateFormatString = getContext().getString(R.string.full_wday_month_day_no_year);
|
mDateFormatString = getContext().getString(R.string.full_wday_month_day_no_year);
|
||||||
|
mLockPatternUtils = lockPatternUtils;
|
||||||
|
|
||||||
refreshTimeAndDateDisplay();
|
refreshTimeAndDateDisplay();
|
||||||
|
|
||||||
mStatus1 = (TextView) findViewById(R.id.status1);
|
mStatus1 = (TextView) findViewById(R.id.status1);
|
||||||
mStatus2 = (TextView) findViewById(R.id.status2);
|
mAlarmStatus = (TextView) findViewById(R.id.alarm_status);
|
||||||
mHasStatus2 = (mStatus2 != null);
|
mAlarmStatus.setCompoundDrawablesWithIntrinsicBounds(ALARM_ICON, 0, 0, 0);
|
||||||
mPropertyOf = (TextView) findViewById(R.id.propertyOf);
|
mPropertyOf = (TextView) findViewById(R.id.propertyOf);
|
||||||
mHasProperty = (mPropertyOf != null);
|
|
||||||
|
|
||||||
resetStatusInfo(updateMonitor, lockPatternUtils);
|
resetStatusInfo(updateMonitor, lockPatternUtils);
|
||||||
|
|
||||||
@@ -107,7 +110,6 @@ class StatusView {
|
|||||||
mCarrier.setSelected(true);
|
mCarrier.setSelected(true);
|
||||||
mCarrier.setTextColor(0xffffffff);
|
mCarrier.setTextColor(0xffffffff);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void resetStatusInfo(KeyguardUpdateMonitor updateMonitor, LockPatternUtils lockPatternUtils) {
|
void resetStatusInfo(KeyguardUpdateMonitor updateMonitor, LockPatternUtils lockPatternUtils) {
|
||||||
@@ -115,19 +117,18 @@ class StatusView {
|
|||||||
mShowingBatteryInfo = updateMonitor.shouldShowBatteryInfo();
|
mShowingBatteryInfo = updateMonitor.shouldShowBatteryInfo();
|
||||||
mPluggedIn = updateMonitor.isDevicePluggedIn();
|
mPluggedIn = updateMonitor.isDevicePluggedIn();
|
||||||
mBatteryLevel = updateMonitor.getBatteryLevel();
|
mBatteryLevel = updateMonitor.getBatteryLevel();
|
||||||
mNextAlarm = lockPatternUtils.getNextAlarm();
|
updateStatusLines(true);
|
||||||
updateStatusLines();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setInstructionText(int stringId) {
|
void setInstructionText(int stringId) {
|
||||||
mStatus1.setText(stringId);
|
mStatus1.setText(stringId);
|
||||||
mStatus1.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_lock_idle_lock, 0, 0, 0);
|
mStatus1.setCompoundDrawablesWithIntrinsicBounds(LOCK_ICON, 0, 0, 0);
|
||||||
mStatus1.setVisibility(View.VISIBLE);
|
mStatus1.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setInstructionText(String string) {
|
void setInstructionText(String string) {
|
||||||
mStatus1.setText(string);
|
mStatus1.setText(string);
|
||||||
mStatus1.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_lock_idle_lock, 0, 0, 0);
|
mStatus1.setCompoundDrawablesWithIntrinsicBounds(LOCK_ICON, 0, 0, 0);
|
||||||
mStatus1.setVisibility(View.VISIBLE);
|
mStatus1.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,9 +139,22 @@ class StatusView {
|
|||||||
mCarrier.setText(string);
|
mCarrier.setText(string);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Originated from PatternUnlockScreen **/
|
/**
|
||||||
void updateStatusLines() {
|
* Update the status lines based on these rules:
|
||||||
if (mHasProperty) {
|
* AlarmStatus: Alarm state always gets it's own line.
|
||||||
|
* Status1 is shared between help, battery status and generic unlock instructions,
|
||||||
|
* prioritized in that order.
|
||||||
|
* @param showStatusLines status lines are shown if true
|
||||||
|
*/
|
||||||
|
void updateStatusLines(boolean showStatusLines) {
|
||||||
|
if (!showStatusLines) {
|
||||||
|
mStatus1.setVisibility(showStatusLines ? View.VISIBLE : View.GONE);
|
||||||
|
mAlarmStatus.setVisibility(showStatusLines ? View.VISIBLE : View.GONE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update owner info
|
||||||
|
if (mPropertyOf != null) {
|
||||||
ContentResolver res = getContext().getContentResolver();
|
ContentResolver res = getContext().getContentResolver();
|
||||||
String info = Settings.Secure.getString(res, Settings.Secure.LOCK_SCREEN_OWNER_INFO);
|
String info = Settings.Secure.getString(res, Settings.Secure.LOCK_SCREEN_OWNER_INFO);
|
||||||
boolean enabled = Settings.Secure.getInt(res,
|
boolean enabled = Settings.Secure.getInt(res,
|
||||||
@@ -151,104 +165,44 @@ class StatusView {
|
|||||||
View.VISIBLE : View.INVISIBLE);
|
View.VISIBLE : View.INVISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mHasStatus2) return;
|
// Update Alarm status
|
||||||
|
String nextAlarm = mLockPatternUtils.getNextAlarm();
|
||||||
|
if (!TextUtils.isEmpty(nextAlarm)) {
|
||||||
|
mAlarmStatus.setText(nextAlarm);
|
||||||
|
mAlarmStatus.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
mAlarmStatus.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update Status1
|
||||||
if (mInstructions != null) {
|
if (mInstructions != null) {
|
||||||
// instructions only
|
// Instructions only
|
||||||
|
final int resId = TextUtils.isEmpty(mInstructions) ? 0 : LOCK_ICON;
|
||||||
mStatus1.setText(mInstructions);
|
mStatus1.setText(mInstructions);
|
||||||
if (TextUtils.isEmpty(mInstructions)) {
|
mStatus1.setCompoundDrawablesWithIntrinsicBounds(resId, 0, 0, 0);
|
||||||
mStatus1.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
|
|
||||||
} else {
|
|
||||||
mStatus1.setCompoundDrawablesWithIntrinsicBounds(
|
|
||||||
R.drawable.ic_lock_idle_lock, 0, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
mStatus1.setVisibility(View.VISIBLE);
|
mStatus1.setVisibility(View.VISIBLE);
|
||||||
mStatus2.setVisibility(View.INVISIBLE);
|
} else if (mShowingBatteryInfo) {
|
||||||
} else if (mShowingBatteryInfo && mNextAlarm == null) {
|
// Battery status
|
||||||
// battery only
|
|
||||||
if (mPluggedIn) {
|
if (mPluggedIn) {
|
||||||
if (mBatteryLevel >= 100) {
|
// Charging or charged
|
||||||
mStatus1.setText(getContext().getString(R.string.lockscreen_charged));
|
if (mBatteryLevel >= 100) {
|
||||||
} else {
|
mStatus1.setText(getContext().getString(R.string.lockscreen_charged));
|
||||||
mStatus1.setText(getContext().getString(R.string.lockscreen_plugged_in,
|
} else {
|
||||||
mBatteryLevel));
|
mStatus1.setText(getContext().getString(R.string.lockscreen_plugged_in,
|
||||||
}
|
mBatteryLevel));
|
||||||
|
}
|
||||||
|
mStatus1.setCompoundDrawablesWithIntrinsicBounds(CHARGING_ICON, 0, 0, 0);
|
||||||
} else {
|
} else {
|
||||||
|
// Battery is low
|
||||||
mStatus1.setText(getContext().getString(R.string.lockscreen_low_battery));
|
mStatus1.setText(getContext().getString(R.string.lockscreen_low_battery));
|
||||||
|
mStatus1.setCompoundDrawablesWithIntrinsicBounds(BATTERY_LOW_ICON, 0, 0, 0);
|
||||||
}
|
}
|
||||||
mStatus1.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_lock_idle_charging, 0,
|
|
||||||
0, 0);
|
|
||||||
|
|
||||||
mStatus1.setVisibility(View.VISIBLE);
|
mStatus1.setVisibility(View.VISIBLE);
|
||||||
mStatus2.setVisibility(View.INVISIBLE);
|
|
||||||
|
|
||||||
} else if (mNextAlarm != null && !mShowingBatteryInfo) {
|
|
||||||
// alarm only
|
|
||||||
mStatus1.setText(mNextAlarm);
|
|
||||||
mStatus1.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_lock_idle_alarm, 0,
|
|
||||||
0, 0);
|
|
||||||
|
|
||||||
mStatus1.setVisibility(View.VISIBLE);
|
|
||||||
mStatus2.setVisibility(View.INVISIBLE);
|
|
||||||
} else if (mNextAlarm != null && mShowingBatteryInfo) {
|
|
||||||
// both battery and next alarm
|
|
||||||
mStatus1.setText(mNextAlarm);
|
|
||||||
mStatus2.setText(getContext().getString(
|
|
||||||
R.string.lockscreen_battery_short,
|
|
||||||
Math.min(100, mBatteryLevel)));
|
|
||||||
mStatus1.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_lock_idle_alarm, 0,
|
|
||||||
0, 0);
|
|
||||||
if (mPluggedIn) {
|
|
||||||
mStatus2.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_lock_idle_charging,
|
|
||||||
0, 0, 0);
|
|
||||||
} else {
|
|
||||||
mStatus2.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
mStatus1.setVisibility(View.VISIBLE);
|
|
||||||
mStatus2.setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
} else {
|
||||||
// nothing specific to show; show general instructions
|
// nothing specific to show; show general instructions
|
||||||
mStatus1.setText(R.string.lockscreen_pattern_instructions);
|
mStatus1.setText(R.string.lockscreen_pattern_instructions);
|
||||||
mStatus1.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_lock_idle_lock, 0,
|
mStatus1.setCompoundDrawablesWithIntrinsicBounds(LOCK_ICON, 0,0, 0);
|
||||||
0, 0);
|
|
||||||
|
|
||||||
mStatus1.setVisibility(View.VISIBLE);
|
mStatus1.setVisibility(View.VISIBLE);
|
||||||
mStatus2.setVisibility(View.INVISIBLE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Originated from LockScreen **/
|
|
||||||
// TODO Merge with function above
|
|
||||||
void updateStatusLines(boolean showStatusLines, String charging, Drawable chargingIcon,
|
|
||||||
Drawable alarmIcon) {
|
|
||||||
if (!showStatusLines || (charging == null && mNextAlarm == null)) {
|
|
||||||
mStatus1.setVisibility(View.INVISIBLE);
|
|
||||||
mStatus2.setVisibility(View.INVISIBLE);
|
|
||||||
} else if (charging != null && mNextAlarm == null) {
|
|
||||||
// charging only
|
|
||||||
mStatus1.setVisibility(View.VISIBLE);
|
|
||||||
mStatus2.setVisibility(View.INVISIBLE);
|
|
||||||
|
|
||||||
mStatus1.setText(charging);
|
|
||||||
mStatus1.setCompoundDrawablesWithIntrinsicBounds(chargingIcon, null, null, null);
|
|
||||||
} else if (mNextAlarm != null && charging == null) {
|
|
||||||
// next alarm only
|
|
||||||
mStatus1.setVisibility(View.VISIBLE);
|
|
||||||
mStatus2.setVisibility(View.INVISIBLE);
|
|
||||||
|
|
||||||
mStatus1.setText(mNextAlarm);
|
|
||||||
mStatus1.setCompoundDrawablesWithIntrinsicBounds(alarmIcon, null, null, null);
|
|
||||||
} else if (charging != null && mNextAlarm != null) {
|
|
||||||
// both charging and next alarm
|
|
||||||
mStatus1.setVisibility(View.VISIBLE);
|
|
||||||
mStatus2.setVisibility(View.VISIBLE);
|
|
||||||
|
|
||||||
mStatus1.setText(charging);
|
|
||||||
mStatus1.setCompoundDrawablesWithIntrinsicBounds(chargingIcon, null, null, null);
|
|
||||||
mStatus2.setText(mNextAlarm);
|
|
||||||
mStatus2.setCompoundDrawablesWithIntrinsicBounds(alarmIcon, null, null, null);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||