Make crypt dialogs material

White on black material theme
Center text
Remove fade to black task
Fix emergency call button

Note - does not implement all requirements of frames in the defect. More
to follow.

Bug: 15328359
Change-Id: I878e59dccffff366ba2484bb77482e168cbd2b81
This commit is contained in:
Paul Lawrence
2014-07-11 07:34:44 -07:00
parent 6f877156e0
commit 89c7570dd4
9 changed files with 19 additions and 41 deletions

View File

@@ -33,17 +33,16 @@
> >
<include layout="@layout/crypt_keeper_password_field" /> <include layout="@layout/crypt_keeper_password_field" />
</LinearLayout> </LinearLayout>
<!-- Emergency call button. <!-- Emergency call button.
Text and icon are set by CryptKeeper.updateEmergencyCallButtonState() --> Text is set by CryptKeeper.updateEmergencyCallButtonState() -->
<Button android:id="@+id/emergencyCallButton" <Button android:id="@+id/emergencyCallButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginTop="16dip" android:layout_marginTop="16dip"
style="@*android:style/Widget.Button.Transparent" style="?android:attr/borderlessButtonStyle"
android:textSize="14sp" android:textSize="14sp"
android:drawablePadding="6dip" android:drawablePadding="6dip"
/> />
</LinearLayout> </LinearLayout>

View File

@@ -28,6 +28,7 @@
android:inputType="textPassword" android:inputType="textPassword"
android:imeOptions="flagForceAscii|actionDone" android:imeOptions="flagForceAscii|actionDone"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:gravity="center_horizontal"
/> />
<ImageView android:id="@+id/switch_ime_button" <ImageView android:id="@+id/switch_ime_button"

View File

@@ -41,8 +41,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginTop="16dip" android:layout_marginTop="16dip"
style="@*android:style/Widget.Button.Transparent" style="?android:attr/borderlessButtonStyle"
android:textSize="14sp"
android:drawablePadding="6dip" android:drawablePadding="6dip"
/> />

View File

@@ -41,8 +41,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginTop="16dip" android:layout_marginTop="16dip"
style="@*android:style/Widget.Button.Transparent" style="?android:attr/borderlessButtonStyle"
android:textSize="14sp"
android:drawablePadding="6dip" android:drawablePadding="6dip"
/> />

View File

@@ -28,6 +28,7 @@
android:inputType="numberPassword" android:inputType="numberPassword"
android:imeOptions="flagForceAscii|actionDone" android:imeOptions="flagForceAscii|actionDone"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:gravity="center_horizontal"
/> />
<ImageView android:id="@+id/switch_ime_button" <ImageView android:id="@+id/switch_ime_button"

View File

@@ -50,6 +50,10 @@
<color name="lock_pattern_view_success_color">@color/theme_accent</color> <color name="lock_pattern_view_success_color">@color/theme_accent</color>
<color name="lock_pattern_view_error_color">#fff4511e</color> <color name="lock_pattern_view_error_color">#fff4511e</color>
<color name="unlock_pattern_view_regular_color">@android:color/white</color>
<color name="unlock_pattern_view_success_color">@color/theme_accent</color>
<color name="unlock_pattern_view_error_color">#fff4511e</color>
<!-- Palette colors referenced by top-level themes. --> <!-- Palette colors referenced by top-level themes. -->
<color name="theme_primary">#ff263238</color> <color name="theme_primary">#ff263238</color>
<color name="theme_primary_dark">#ff21272b</color> <color name="theme_primary_dark">#ff21272b</color>

View File

@@ -221,7 +221,7 @@
<item name="android:windowIsFloating">true</item> <item name="android:windowIsFloating">true</item>
</style> </style>
<style name="CryptKeeperBlankTheme" parent="@android:style/Theme.Material.Light.NoActionBar"> <style name="CryptKeeperBlankTheme" parent="@android:style/Theme.Material.NoActionBar">
<item name="android:background">#ff000000</item> <item name="android:background">#ff000000</item>
</style> </style>

View File

@@ -143,11 +143,11 @@
<item name="android:actionBarStyle">@style/Theme.ActionBar</item> <item name="android:actionBarStyle">@style/Theme.ActionBar</item>
</style> </style>
<style name="Theme.CryptKeeper" parent="@android:style/Theme.Material.Light.NoActionBar"> <style name="Theme.CryptKeeper" parent="@android:style/Theme.Material.NoActionBar">
<!-- LockPatternView colors --> <!-- LockPatternView colors -->
<item name="@*android:regularColor">@color/lock_pattern_view_regular_color</item> <item name="@*android:regularColor">@color/unlock_pattern_view_regular_color</item>
<item name="@*android:successColor">@color/lock_pattern_view_success_color</item> <item name="@*android:successColor">@color/unlock_pattern_view_success_color</item>
<item name="@*android:errorColor">@color/lock_pattern_view_error_color</item> <item name="@*android:errorColor">@color/unlock_pattern_view_error_color</item>
</style> </style>
<style name="Theme.SubSettingsDialogWhenLarge" parent="Theme.DialogWhenLarge"> <style name="Theme.SubSettingsDialogWhenLarge" parent="Theme.DialogWhenLarge">

View File

@@ -148,22 +148,6 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
} }
} }
/**
* Activity used to fade the screen to black after the password is entered.
*/
public static class FadeToBlack extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.crypt_keeper_blank);
}
/** Ignore all back events. */
@Override
public void onBackPressed() {
return;
}
}
private class DecryptTask extends AsyncTask<String, Void, Integer> { private class DecryptTask extends AsyncTask<String, Void, Integer> {
@Override @Override
protected Integer doInBackground(String... params) { protected Integer doInBackground(String... params) {
@@ -179,13 +163,8 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
@Override @Override
protected void onPostExecute(Integer failedAttempts) { protected void onPostExecute(Integer failedAttempts) {
if (failedAttempts == 0) { if (failedAttempts == 0) {
// The password was entered successfully. Start the Blank activity // The password was entered successfully. Simply do nothing
// so this activity animates to black before the devices starts. Note // and wait for the service restart to switch to surfacefligner
// It has 1 second to complete the animation or it will be frozen
// until the boot animation comes back up.
Intent intent = new Intent(CryptKeeper.this, FadeToBlack.class);
finish();
startActivity(intent);
} else if (failedAttempts == MAX_FAILED_ATTEMPTS) { } else if (failedAttempts == MAX_FAILED_ATTEMPTS) {
// Factory reset the device. // Factory reset the device.
sendBroadcast(new Intent("android.intent.action.MASTER_CLEAR")); sendBroadcast(new Intent("android.intent.action.MASTER_CLEAR"));
@@ -862,14 +841,10 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
int textId; int textId;
if (getPhoneManager().isInAPhoneCall()) { if (getPhoneManager().isInAPhoneCall()) {
// Show "return to call" text and show phone icon // Show "return to call"
textId = R.string.cryptkeeper_return_to_call; textId = R.string.cryptkeeper_return_to_call;
final int phoneCallIcon = R.drawable.stat_sys_phone_call;
emergencyCall.setCompoundDrawablesWithIntrinsicBounds(phoneCallIcon, 0, 0, 0);
} else { } else {
textId = R.string.cryptkeeper_emergency_call; textId = R.string.cryptkeeper_emergency_call;
final int emergencyIcon = R.drawable.ic_emergency;
emergencyCall.setCompoundDrawablesWithIntrinsicBounds(emergencyIcon, 0, 0, 0);
} }
emergencyCall.setText(textId); emergencyCall.setText(textId);
} }