Redesigned keyguard layout in the no-SIM case.
The emergency call button has been removed (since the user can disable the keyguard, open the phone app, and enter the emergency number there). This change also restores a number of the informational & help messages that were previously removed from the lock screen. (Requires I07bfc0f1c5b3f0e10b8cb72768848251439e19dd) Bug: 2421380 Change-Id: I46a78c700427d769da6f7f2d3e9f419c2a921a61
This commit is contained in:
@@ -66,7 +66,7 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
|
||||
private TextView mStatus1;
|
||||
private TextView mStatus2;
|
||||
private TextView mScreenLocked;
|
||||
private Button mEmergencyCallButton;
|
||||
private TextView mEmergencyCallText;
|
||||
|
||||
// current configuration state of keyboard and display
|
||||
private int mKeyboardHidden;
|
||||
@@ -203,18 +203,12 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
|
||||
mStatus1 = (TextView) findViewById(R.id.status1);
|
||||
mStatus2 = (TextView) findViewById(R.id.status2);
|
||||
|
||||
mEmergencyCallButton = (Button) findViewById(R.id.emergencyCallButton);
|
||||
mEmergencyCallButton.setText(R.string.lockscreen_emergency_call);
|
||||
mLockPatternUtils.updateEmergencyCallButtonState(mEmergencyCallButton);
|
||||
mScreenLocked = (TextView) findViewById(R.id.screenLocked);
|
||||
mSelector = (SlidingTab) findViewById(R.id.tab_selector);
|
||||
mSelector.setHoldAfterTrigger(true, false);
|
||||
mSelector.setLeftHintText(R.string.lockscreen_unlock_label);
|
||||
mEmergencyCallButton.setOnClickListener(new View.OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
mCallback.takeEmergencyCallAction();
|
||||
}
|
||||
});
|
||||
|
||||
mEmergencyCallText = (TextView) findViewById(R.id.emergencyCallText);
|
||||
|
||||
setFocusable(true);
|
||||
setFocusableInTouchMode(true);
|
||||
@@ -269,7 +263,6 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
|
||||
|
||||
refreshBatteryStringAndIcon();
|
||||
refreshAlarmDisplay();
|
||||
mLockPatternUtils.updateEmergencyCallButtonState(mEmergencyCallButton);
|
||||
|
||||
mTimeFormat = DateFormat.getTimeFormat(getContext());
|
||||
mDateFormatString = getContext().getString(R.string.full_wday_month_day_no_year);
|
||||
@@ -340,8 +333,6 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
|
||||
* @param iconResourceId The left hand icon.
|
||||
*/
|
||||
private void toastMessage(final TextView textView, final String text, final int color, final int iconResourceId) {
|
||||
if (DBG) android.util.Log.d("LockScreen", "toastMessage(text=" + text +", color=" + color + ")");
|
||||
|
||||
if (mPendingR1 != null) {
|
||||
textView.removeCallbacks(mPendingR1);
|
||||
mPendingR1 = null;
|
||||
@@ -499,9 +490,8 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
|
||||
* Update the layout to match the current status.
|
||||
*/
|
||||
private void updateLayout(Status status) {
|
||||
// The emergency call button appears where the carrier would
|
||||
// ordinarily be shown, so if one is VISIBLE the other must be
|
||||
// INVISIBLE.
|
||||
// The emergency call button no longer appears on this screen.
|
||||
if (DBG) Log.d(TAG, "updateLayout: status=" + status);
|
||||
switch (status) {
|
||||
case Normal:
|
||||
// text
|
||||
@@ -509,12 +499,13 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
|
||||
getCarrierString(
|
||||
mUpdateMonitor.getTelephonyPlmn(),
|
||||
mUpdateMonitor.getTelephonySpn()));
|
||||
// mScreenLocked.setText(R.string.lockscreen_screen_locked);
|
||||
// unnecessary clutter
|
||||
//mScreenLocked.setText(R.string.lockscreen_screen_locked);
|
||||
|
||||
// layout
|
||||
mScreenLocked.setVisibility(View.VISIBLE);
|
||||
mScreenLocked.setVisibility(View.INVISIBLE);
|
||||
mSelector.setVisibility(View.VISIBLE);
|
||||
mEmergencyCallButton.setVisibility(View.GONE);
|
||||
mEmergencyCallText.setVisibility(View.GONE);
|
||||
break;
|
||||
case NetworkLocked:
|
||||
// The carrier string shows both sim card status (i.e. No Sim Card) and
|
||||
@@ -528,35 +519,30 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
|
||||
// layout
|
||||
mScreenLocked.setVisibility(View.VISIBLE);
|
||||
mSelector.setVisibility(View.VISIBLE);
|
||||
mEmergencyCallButton.setVisibility(View.GONE);
|
||||
mEmergencyCallText.setVisibility(View.GONE);
|
||||
break;
|
||||
case SimMissing:
|
||||
// text
|
||||
mCarrier.setText("");
|
||||
mScreenLocked.setText(
|
||||
getCarrierString(
|
||||
mUpdateMonitor.getTelephonyPlmn(),
|
||||
getContext().getText(R.string.lockscreen_missing_sim_message_short)));
|
||||
// previously shown here: lockscreen_instructions_when_pattern_disabled
|
||||
mCarrier.setText(R.string.lockscreen_missing_sim_message_short);
|
||||
mScreenLocked.setText(R.string.lockscreen_missing_sim_instructions);
|
||||
|
||||
// layout
|
||||
mScreenLocked.setVisibility(View.VISIBLE);
|
||||
mSelector.setVisibility(View.VISIBLE);
|
||||
mEmergencyCallButton.setVisibility(View.VISIBLE);
|
||||
mEmergencyCallText.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
case SimMissingLocked:
|
||||
// text
|
||||
mCarrier.setText("");
|
||||
mScreenLocked.setText(
|
||||
mCarrier.setText(
|
||||
getCarrierString(
|
||||
mUpdateMonitor.getTelephonyPlmn(),
|
||||
getContext().getText(R.string.lockscreen_missing_sim_message_short)));
|
||||
// previously shown here: lockscreen_missing_sim_instructions
|
||||
mScreenLocked.setText(R.string.lockscreen_missing_sim_instructions);
|
||||
|
||||
// layout
|
||||
mScreenLocked.setVisibility(View.VISIBLE);
|
||||
mSelector.setVisibility(View.GONE);
|
||||
mEmergencyCallButton.setVisibility(View.VISIBLE);
|
||||
mEmergencyCallText.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
case SimLocked:
|
||||
// text
|
||||
@@ -568,21 +554,20 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
|
||||
// layout
|
||||
mScreenLocked.setVisibility(View.INVISIBLE);
|
||||
mSelector.setVisibility(View.VISIBLE);
|
||||
mEmergencyCallButton.setVisibility(View.GONE);
|
||||
mEmergencyCallText.setVisibility(View.GONE);
|
||||
break;
|
||||
case SimPukLocked:
|
||||
// text
|
||||
mCarrier.setText("");
|
||||
mScreenLocked.setText(
|
||||
mCarrier.setText(
|
||||
getCarrierString(
|
||||
mUpdateMonitor.getTelephonyPlmn(),
|
||||
getContext().getText(R.string.lockscreen_sim_puk_locked_message)));
|
||||
// previously shown here: lockscreen_sim_puk_locked_instructions);
|
||||
mScreenLocked.setText(R.string.lockscreen_sim_puk_locked_instructions);
|
||||
|
||||
// layout
|
||||
mScreenLocked.setVisibility(View.VISIBLE);
|
||||
mSelector.setVisibility(View.GONE);
|
||||
mEmergencyCallButton.setVisibility(View.VISIBLE);
|
||||
mEmergencyCallText.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -655,7 +640,6 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
|
||||
/** {@inheritDoc} */
|
||||
public void onResume() {
|
||||
resetStatusInfo(mUpdateMonitor);
|
||||
mLockPatternUtils.updateEmergencyCallButtonState(mEmergencyCallButton);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@@ -673,6 +657,5 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
|
||||
}
|
||||
|
||||
public void onPhoneStateChanged(String newState) {
|
||||
mLockPatternUtils.updateEmergencyCallButtonState(mEmergencyCallButton);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user