LockScreen layout, button style, and owner info fixes

- enable OwnerInfo to appear in status1 if dedicated view not present.
- force all status lines to be singleline and marquee.
- fix justification in landscape layouts.
- use buttonBarStyle for buttons on all LockScreens.
- reduce the size of the clock to fit in landscape.
- no longer show "Draw a pattern to unlock" help message in LockPatternView.

Change-Id: I1ff51550e2180f9d912c8f710ad5e2fd2424d373
This commit is contained in:
Jim Miller
2011-06-24 17:37:24 -07:00
parent 5ecc4601ea
commit 7377cd0ab4
11 changed files with 215 additions and 141 deletions

View File

@@ -24,7 +24,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:rowCount="10"
android:rowCount="11"
android:id="@+id/root"
android:clipChildren="false">
@@ -33,7 +33,8 @@
<com.android.internal.widget.DigitalClock android:id="@+id/time"
android:layout_marginTop="16dip"
android:layout_marginBottom="8dip">
android:layout_marginBottom="8dip"
android:layout_gravity="right">
<!-- Because we can't have multi-tone fonts, we render two TextViews, one on
top of the other. Hence the redundant layout... -->
@@ -67,120 +68,129 @@
android:id="@+id/date"
android:layout_below="@id/time"
android:layout_marginTop="6dip"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:layout_gravity="left"
android:layout_gravity="right"
/>
<TextView
android:id="@+id/alarm_status"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:drawablePadding="4dip"
android:layout_marginTop="4dip"
android:layout_gravity="left"
android:layout_gravity="right"
/>
<TextView
android:id="@+id/status1"
android:layout_marginTop="4dip"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:drawablePadding="4dip"
android:layout_gravity="left"
android:layout_gravity="right"
/>
<TextView
android:id="@+id/status2"
android:layout_marginTop="4dip"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:drawablePadding="4dip"
android:layout_gravity="left"
android:layout_gravity="right"
/>
<TextView
android:id="@+id/screenLocked"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:gravity="center"
android:layout_marginTop="4dip"
android:drawablePadding="4dip"
android:layout_gravity="left"
android:layout_gravity="right"
/>
<Space android:height="20dip"/>
<LinearLayout android:orientation="vertical" >
<TextView
android:id="@+id/carrier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:singleLine="true"
android:ellipsize="marquee"
android:layout_gravity="bottom|left"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:textColor="?android:attr/textColorSecondary"
/>
<!-- "emergency calls only" shown when sim is missing or PUKd -->
<TextView
android:id="@+id/emergencyCallText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginTop="20dip"
android:singleLine="true"
android:ellipsize="marquee"
android:text="@string/emergency_calls_only"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:textColor="?android:attr/textColorSecondary"
/>
<Button
android:id="@+id/emergencyCallButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/ic_emergency"
android:text="@string/lockscreen_emergency_call"
style="@style/Widget.Button.Transparent"
android:drawablePadding="8dip"
android:layout_marginRight="80dip"
android:visibility="visible"
/>
</LinearLayout>
<Space android:height="20dip"/>
<!-- Column 1 -->
<Space android:width="20dip" android:layout_columnWeight="1" android:layout_rowSpan="10" />
<!-- Column 2 - password entry field and PIN keyboard -->
<EditText android:id="@+id/passwordEntry"
android:layout_height="wrap_content"
android:layout_width="match_parent"
<TextView
android:id="@+id/carrier"
android:singleLine="true"
android:textStyle="normal"
android:inputType="textPassword"
android:gravity="center"
android:textSize="24sp"
android:ellipsize="marquee"
android:layout_gravity="right"
android:textAppearance="?android:attr/textAppearanceMedium"
android:background="@drawable/lockscreen_password_field_dark"
android:textColor="?android:attr/textColorPrimary"
/>
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:textColor="?android:attr/textColorSecondary"
/>
<!-- Numeric keyboard -->
<com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
android:layout_width="300dip"
android:layout_height="300dip"
android:background="#40000000"
android:layout_marginTop="5dip"
android:keyBackground="@drawable/btn_keyboard_key_fulltrans"
<!-- "emergency calls only" shown when sim is missing or PUKd -->
<TextView
android:id="@+id/emergencyCallText"
android:layout_marginTop="20dip"
android:layout_gravity="right"
android:singleLine="true"
android:ellipsize="marquee"
android:text="@string/emergency_calls_only"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:textColor="?android:attr/textColorSecondary"
/>
<Button
android:id="@+id/emergencyCallButton"
android:layout_gravity="right"
android:drawableLeft="@drawable/lockscreen_emergency_button"
android:text="@string/lockscreen_emergency_call"
style="?android:attr/buttonBarButtonStyle"
android:drawablePadding="8dip"
android:visibility="visible"
/>
<!-- Column 1 -->
<Space android:layout_columnWeight="1" android:layout_rowSpan="11" />
<!-- Column 2 - password entry field and PIN keyboard -->
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:orientation="vertical"
android:layout_gravity="center|fill"
android:layout_rowSpan="11">
<EditText android:id="@+id/passwordEntry"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:singleLine="true"
android:textStyle="normal"
android:inputType="textPassword"
android:layout_gravity="center"
android:textSize="24sp"
android:minEms="8"
android:textAppearance="?android:attr/textAppearanceMedium"
android:background="@drawable/lockscreen_password_field_dark"
android:textColor="?android:attr/textColorPrimary"
/>
<!-- Numeric keyboard -->
<com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
android:layout_width="250dip"
android:layout_height="100dip"
android:layout_gravity="center"
android:background="#40000000"
android:layout_marginTop="5dip"
android:keyBackground="@drawable/btn_keyboard_key_fulltrans"
android:visibility="visible"
/>
</LinearLayout>
</GridLayout>

View File

@@ -41,10 +41,10 @@
android:layout_marginTop="4dip"
android:layout_marginRight="16dip"
android:layout_gravity="right"
android:drawableLeft="@drawable/ic_emergency"
android:drawableLeft="@drawable/lockscreen_emergency_button"
android:drawablePadding="8dip"
android:text="@string/lockscreen_emergency_call"
style="@style/Widget.Button.Transparent"
style="?android:attr/buttonBarButtonStyle"
/>
<!-- bottom: password -->

View File

@@ -73,6 +73,8 @@
android:id="@+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"/>
@@ -81,6 +83,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="30dip"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"/>
@@ -92,6 +96,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:layout_marginTop="10dip"
@@ -106,6 +112,8 @@
android:layout_height="wrap_content"
android:layout_marginTop="10dip"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
/>

View File

@@ -70,6 +70,8 @@
android:id="@+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"/>
@@ -78,6 +80,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dip"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:drawablePadding="4dip"/>
@@ -90,6 +94,8 @@
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="4dip"
android:singleLine="true"
android:ellipsize="marquee"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:textAppearance="?android:attr/textAppearanceMedium"
/>
@@ -101,6 +107,8 @@
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_alignParentTop="true"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:layout_marginTop="4dip"

View File

@@ -80,6 +80,8 @@
android:id="@+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
/>
@@ -88,6 +90,8 @@
android:id="@+id/alarm_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:drawablePadding="4dip"
@@ -105,6 +109,8 @@
android:layout_marginLeft="16dip"
android:layout_marginRight="16dip"
android:layout_alignParentRight="true"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:drawablePadding="4dip"
@@ -119,6 +125,8 @@
android:layout_marginLeft="16dip"
android:layout_marginRight="16dip"
android:layout_alignParentRight="true"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:drawablePadding="4dip"
@@ -133,6 +141,8 @@
android:layout_marginLeft="16dip"
android:layout_marginRight="16dip"
android:layout_alignParentRight="true"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:layout_marginTop="12dip"
@@ -147,14 +157,13 @@
android:layout_height="wrap_content"
android:layout_marginTop="4dip"
android:layout_marginRight="16dip"
android:drawableLeft="@drawable/ic_emergency"
android:drawableLeft="@drawable/lockscreen_emergency_button"
android:layout_alignParentRight="true"
android:layout_below="@id/screenLocked"
style="@style/Widget.Button.Transparent"
style="?android:attr/buttonBarButtonStyle"
android:drawablePadding="4dip"
android:text="@string/lockscreen_emergency_call"
android:visibility="visible"
android:background="@null"
/>
<RelativeLayout
@@ -207,6 +216,8 @@
android:layout_marginTop="0dip"
android:layout_marginRight="8dip"
android:text="@string/emergency_calls_only"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:textColor="?android:attr/textColorSecondary"

View File

@@ -68,6 +68,8 @@
android:id="@+id/date"
android:layout_below="@id/time"
android:layout_marginTop="6dip"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:layout_gravity="right"
@@ -75,6 +77,8 @@
<TextView
android:id="@+id/alarm_status"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:drawablePadding="4dip"
@@ -85,6 +89,8 @@
<TextView
android:id="@+id/status1"
android:layout_marginTop="4dip"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:drawablePadding="4dip"
@@ -94,6 +100,8 @@
<TextView
android:id="@+id/status2"
android:layout_marginTop="4dip"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:drawablePadding="4dip"
@@ -102,6 +110,8 @@
<TextView
android:id="@+id/screenLocked"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:gravity="center"
@@ -113,7 +123,8 @@
<Space android:height="20dip"/>
<LinearLayout android:orientation="vertical"
android:gravity="fill">
android:layout_gravity="right"
android:gravity="fill_horizontal">
<TextView
android:id="@+id/carrier"
@@ -148,11 +159,10 @@
android:id="@+id/emergencyCallButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/ic_emergency"
android:drawableLeft="@drawable/lockscreen_emergency_button"
android:text="@string/lockscreen_emergency_call"
style="@style/Widget.Button.Transparent"
style="?android:attr/buttonBarButtonStyle"
android:drawablePadding="8dip"
android:layout_marginRight="80dip"
android:visibility="visible"
android:layout_gravity="right"
/>

View File

@@ -26,7 +26,7 @@
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:rowCount="8">
android:rowCount="7">
<!-- Column 0: Time, date and status -->
<com.android.internal.widget.DigitalClock android:id="@+id/time"
@@ -68,6 +68,8 @@
android:id="@+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:layout_gravity="right"
@@ -77,6 +79,8 @@
android:id="@+id/alarm_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:layout_gravity="right"
@@ -87,6 +91,8 @@
android:id="@+id/status1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:layout_gravity="right"
@@ -100,31 +106,43 @@
<TextView android:id="@+id/carrier"
android:layout_gravity="right"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
/>
<Button android:id="@+id/emergencyCallButton"
android:layout_gravity="right"
style="@style/Widget.Button.Transparent"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:text="@string/lockscreen_emergency_call"
android:drawableLeft="@drawable/lockscreen_emergency_button"
android:drawablePadding="0dip"
android:background="@null"
/>
<LinearLayout
style="?android:attr/buttonBarStyle"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right">
<Button android:id="@+id/forgotPatternButton"
android:layout_gravity="right"
style="@style/Widget.Button.Transparent"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:text="@string/lockscreen_forgot_pattern_button_text"
android:drawableLeft="@drawable/lockscreen_forgot_password_button"
android:drawablePadding="0dip"
android:background="@null"
/>
<Button android:id="@+id/emergencyCallButton"
style="?android:attr/buttonBarButtonStyle"
android:layout_gravity="right"
android:layout_width="wrap_content"
android:layout_height="0dip"
android:layout_weight="1"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:text="@string/lockscreen_emergency_call"
android:drawableLeft="@drawable/lockscreen_emergency_button"
android:drawablePadding="0dip"
/>
<Button android:id="@+id/forgotPatternButton"
style="?android:attr/buttonBarButtonStyle"
android:layout_gravity="right"
android:layout_width="wrap_content"
android:layout_height="0dip"
android:layout_weight="1"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:text="@string/lockscreen_forgot_pattern_button_text"
android:drawableLeft="@drawable/lockscreen_forgot_password_button"
android:drawablePadding="0dip"
/>
</LinearLayout>
<!-- Column 1: lock pattern -->
<com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
@@ -134,6 +152,6 @@
android:layout_marginRight="8dip"
android:layout_marginBottom="8dip"
android:layout_marginLeft="8dip"
android:layout_rowSpan="8"/>
android:layout_rowSpan="7"/>
</GridLayout>

View File

@@ -68,6 +68,8 @@
android:id="@+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
/>
@@ -77,6 +79,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dip"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:drawablePadding="4dip"
@@ -89,22 +93,22 @@
android:id="@+id/status1"
android:layout_gravity="right"
android:layout_marginRight="@dimen/keyguard_lockscreen_status_line_font_right_margin"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:drawablePadding="4dip"
android:singleLine="true"
android:ellipsize="marquee"
/>
<TextView
android:id="@+id/status2"
android:layout_gravity="right"
android:layout_marginRight="@dimen/keyguard_lockscreen_status_line_font_right_margin"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:drawablePadding="4dip"
android:singleLine="true"
android:ellipsize="marquee"
android:visibility="gone"
/>
@@ -136,30 +140,33 @@
<!-- Footer: an emergency call button and an initially hidden "Forgot pattern" button -->
<LinearLayout
android:orientation="horizontal"
android:layout_gravity="fill_horizontal">
android:layout_width="match_parent"
style="?android:attr/buttonBarStyle"
android:gravity="center"
android:weightSum="2">
<Button android:id="@+id/emergencyCallButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
style="@style/Widget.Button.Transparent"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
style="?android:attr/buttonBarButtonStyle"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:text="@string/lockscreen_emergency_call"
android:drawableLeft="@drawable/lockscreen_emergency_button"
android:drawablePadding="0dip"
android:background="@null"
/>
<Button android:id="@+id/forgotPatternButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
style="@style/Widget.Button.Transparent"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
style="?android:attr/buttonBarButtonStyle"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:text="@string/lockscreen_forgot_pattern_button_text"
android:drawableLeft="@drawable/lockscreen_forgot_password_button"
android:drawablePadding="0dip"
android:background="@null"
/>
</LinearLayout>

View File

@@ -35,6 +35,6 @@
<dimen name="action_bar_icon_vertical_padding">4dip</dimen>
<!-- Size of clock font in LockScreen on Unsecure unlock screen. -->
<dimen name="keyguard_lockscreen_clock_font_size">80sp</dimen>
<dimen name="keyguard_lockscreen_clock_font_size">70sp</dimen>
</resources>

View File

@@ -183,8 +183,7 @@ class PatternUnlockScreen extends LinearLayoutWithDefaultTouchRecepient
mStatusView = new StatusView(this, mUpdateMonitor, mLockPatternUtils);
// This shows up when no other information is required on status1
mStatusView.setHelpMessage(R.string.lockscreen_pattern_instructions,
StatusView.LOCK_ICON);
//mStatusView.setHelpMessage(R.string.lockscreen_pattern_instructions,StatusView.LOCK_ICON);
mLockPatternView = (LockPatternView) findViewById(R.id.lockPattern);

View File

@@ -40,7 +40,7 @@ class StatusView {
private String mInstructions = null;
private TextView mStatus1;
private TextView mPropertyOf;
private TextView mOwnerInfo;
private boolean mHasCarrier;
private boolean mHasDate;
@@ -105,7 +105,7 @@ class StatusView {
mStatus1 = (TextView) findViewById(R.id.status1);
mAlarmStatus = (TextView) findViewById(R.id.alarm_status);
mAlarmStatus.setCompoundDrawablesWithIntrinsicBounds(ALARM_ICON, 0, 0, 0);
mPropertyOf = (TextView) findViewById(R.id.propertyOf);
mOwnerInfo = (TextView) findViewById(R.id.propertyOf);
resetStatusInfo(updateMonitor, lockPatternUtils);
@@ -153,20 +153,22 @@ class StatusView {
void updateStatusLines(boolean showStatusLines) {
if (!showStatusLines) {
mStatus1.setVisibility(showStatusLines ? View.VISIBLE : View.INVISIBLE);
mAlarmStatus.setVisibility(showStatusLines ? View.VISIBLE : View.INVISIBLE);
mAlarmStatus.setVisibility(showStatusLines ? View.VISIBLE : View.GONE);
return;
}
// Update owner info
if (mPropertyOf != null) {
ContentResolver res = getContext().getContentResolver();
String info = Settings.Secure.getString(res, Settings.Secure.LOCK_SCREEN_OWNER_INFO);
boolean enabled = Settings.Secure.getInt(res,
Settings.Secure.LOCK_SCREEN_OWNER_INFO_ENABLED, 1) != 0;
mPropertyOf.setText(info);
mPropertyOf.setVisibility(enabled && !TextUtils.isEmpty(info) ?
View.VISIBLE : View.INVISIBLE);
final ContentResolver res = getContext().getContentResolver();
final boolean ownerInfoEnabled = Settings.Secure.getInt(res,
Settings.Secure.LOCK_SCREEN_OWNER_INFO_ENABLED, 1) != 0;
String ownerInfo = null;
if (ownerInfoEnabled) {
ownerInfo = Settings.Secure.getString(res, Settings.Secure.LOCK_SCREEN_OWNER_INFO);
if (mOwnerInfo != null) {
mOwnerInfo.setText(ownerInfo);
mOwnerInfo.setVisibility(ownerInfoEnabled && !TextUtils.isEmpty(ownerInfo) ?
View.VISIBLE : View.INVISIBLE);
}
}
// Update Alarm status
@@ -175,7 +177,7 @@ class StatusView {
mAlarmStatus.setText(nextAlarm);
mAlarmStatus.setVisibility(View.VISIBLE);
} else {
mAlarmStatus.setVisibility(View.INVISIBLE);
mAlarmStatus.setVisibility(View.GONE);
}
// Update Status1
@@ -204,15 +206,16 @@ class StatusView {
} else {
mStatus1.setVisibility(View.INVISIBLE);
}
} else if (mHelpMessageId != 0) {
mStatus1.setText(mHelpMessageId);
mStatus1.setCompoundDrawablesWithIntrinsicBounds(mHelpIconId, 0,0, 0);
mStatus1.setVisibility(View.VISIBLE);
} else if (ownerInfoEnabled && mOwnerInfo == null && ownerInfo != null) {
mStatus1.setText(ownerInfo);
mStatus1.setCompoundDrawablesWithIntrinsicBounds(0, 0,0, 0);
mStatus1.setVisibility(View.VISIBLE);
} else {
// nothing specific to show; show help message and icon, if provided
if (mHelpMessageId != 0) {
mStatus1.setText(mHelpMessageId);
mStatus1.setCompoundDrawablesWithIntrinsicBounds(mHelpIconId, 0,0, 0);
mStatus1.setVisibility(View.VISIBLE);
} else {
mStatus1.setVisibility(View.INVISIBLE);
}
mStatus1.setVisibility(View.INVISIBLE);
}
}