Skip to content

Commit

Permalink
Speedup unlock animation, improve AppLockService event handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxr1998 committed May 17, 2017
1 parent 3b83d6f commit 59792f4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ public void onAccessibilityEvent(AccessibilityEvent accessibilityEvent) {
return;
}

String packageName = String.valueOf(accessibilityEvent.getPackageName());
final String packageName = String.valueOf(accessibilityEvent.getPackageName());
if (packageName.equals("null") ||
accessibilityEvent.getEventType() != AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED ||
packageName.equals("android") || packageName.matches("com\\.(google\\.)?android\\.systemui") ||
(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && getWindowType(accessibilityEvent) == AccessibilityWindowInfo.TYPE_SYSTEM) ||
Settings.Secure.getString(getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD).startsWith(packageName)) {
((Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && getWindowType(accessibilityEvent) != AccessibilityWindowInfo.TYPE_APPLICATION) ||
packageName.equals("android") || packageName.matches("com\\.(google\\.)?android\\.systemui") ||
Settings.Secure.getString(getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD).startsWith(packageName))) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public void onAuthenticationSucceeded() {
unlocked = true;
NotificationHelper.postIModNotification(this);
finish();
overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
overridePendingTransition(0, R.anim.lockscreen_fade_out_fast);
}

@Override
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/anim/lockscreen_fade_out_fast.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="150"
android:fromAlpha="1.0"
android:interpolator="@android:interpolator/accelerate_quad"
android:toAlpha="0.0" />

0 comments on commit 59792f4

Please sign in to comment.