mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-05-02 03:24:27 +00:00
parent
553cb16bc4
commit
2a47fa4de5
1 changed files with 16 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
package com.beemdevelopment.aegis;
|
package com.beemdevelopment.aegis;
|
||||||
|
|
||||||
|
import android.animation.ValueAnimator;
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
@ -9,6 +10,8 @@ import android.content.pm.ShortcutInfo;
|
||||||
import android.content.pm.ShortcutManager;
|
import android.content.pm.ShortcutManager;
|
||||||
import android.graphics.drawable.Icon;
|
import android.graphics.drawable.Icon;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
import android.provider.Settings;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.beemdevelopment.aegis.db.DatabaseManager;
|
import com.beemdevelopment.aegis.db.DatabaseManager;
|
||||||
import com.beemdevelopment.aegis.ui.MainActivity;
|
import com.beemdevelopment.aegis.ui.MainActivity;
|
||||||
|
@ -31,6 +34,8 @@ public class AegisApplication extends Application {
|
||||||
ScreenOffReceiver receiver = new ScreenOffReceiver();
|
ScreenOffReceiver receiver = new ScreenOffReceiver();
|
||||||
registerReceiver(receiver, new IntentFilter(Intent.ACTION_SCREEN_OFF));
|
registerReceiver(receiver, new IntentFilter(Intent.ACTION_SCREEN_OFF));
|
||||||
|
|
||||||
|
setGlobalDurationScale();
|
||||||
|
|
||||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
|
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
|
||||||
initAppShortcuts();
|
initAppShortcuts();
|
||||||
}
|
}
|
||||||
|
@ -69,6 +74,17 @@ public class AegisApplication extends Application {
|
||||||
return _prefs.isAutoLockEnabled() && _manager.isEncryptionEnabled() && !_manager.isLocked();
|
return _prefs.isAutoLockEnabled() && _manager.isEncryptionEnabled() && !_manager.isLocked();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setGlobalDurationScale() {
|
||||||
|
float durationScale = Settings.Global.getFloat(getContentResolver(), Settings.Global.ANIMATOR_DURATION_SCALE, 0);
|
||||||
|
if (durationScale != 1) {
|
||||||
|
try {
|
||||||
|
ValueAnimator.class.getMethod("setDurationScale", float.class).invoke(null, 1f);
|
||||||
|
} catch (Throwable t) {
|
||||||
|
Toast.makeText(this, "Unable to reset animator duration scale. Progressbars will be invisible", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private class ScreenOffReceiver extends BroadcastReceiver {
|
private class ScreenOffReceiver extends BroadcastReceiver {
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue