|
|
|
@ -5,12 +5,18 @@ import static com.beemdevelopment.aegis.ui.slides.SecurityPickerSlide.CRYPT_TYPE
|
|
|
|
|
import static com.beemdevelopment.aegis.ui.slides.SecurityPickerSlide.CRYPT_TYPE_NONE;
|
|
|
|
|
import static com.beemdevelopment.aegis.ui.slides.SecurityPickerSlide.CRYPT_TYPE_PASS;
|
|
|
|
|
|
|
|
|
|
import android.Manifest;
|
|
|
|
|
import android.os.Build;
|
|
|
|
|
import android.os.Bundle;
|
|
|
|
|
import android.view.WindowManager;
|
|
|
|
|
import android.view.inputmethod.InputMethodManager;
|
|
|
|
|
|
|
|
|
|
import androidx.annotation.NonNull;
|
|
|
|
|
import androidx.annotation.Nullable;
|
|
|
|
|
|
|
|
|
|
import com.beemdevelopment.aegis.R;
|
|
|
|
|
import com.beemdevelopment.aegis.ThemeMap;
|
|
|
|
|
import com.beemdevelopment.aegis.helpers.PermissionHelper;
|
|
|
|
|
import com.beemdevelopment.aegis.ui.dialogs.Dialogs;
|
|
|
|
|
import com.beemdevelopment.aegis.ui.intro.IntroBaseActivity;
|
|
|
|
|
import com.beemdevelopment.aegis.ui.intro.SlideFragment;
|
|
|
|
@ -24,6 +30,9 @@ import com.beemdevelopment.aegis.vault.slots.BiometricSlot;
|
|
|
|
|
import com.beemdevelopment.aegis.vault.slots.PasswordSlot;
|
|
|
|
|
|
|
|
|
|
public class IntroActivity extends IntroBaseActivity {
|
|
|
|
|
// Permission request codes
|
|
|
|
|
private static final int CODE_PERM_NOTIFICATIONS = 0;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
@ -40,7 +49,7 @@ public class IntroActivity extends IntroBaseActivity {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected boolean onBeforeSlideChanged(Class<? extends SlideFragment> oldSlide, Class<? extends SlideFragment> newSlide) {
|
|
|
|
|
protected boolean onBeforeSlideChanged(Class<? extends SlideFragment> oldSlide, @NonNull Class<? extends SlideFragment> newSlide) {
|
|
|
|
|
// hide the keyboard before every slide change
|
|
|
|
|
InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
|
|
|
|
|
imm.hideSoftInputFromWindow(findViewById(android.R.id.content).getWindowToken(), 0);
|
|
|
|
@ -67,6 +76,17 @@ public class IntroActivity extends IntroBaseActivity {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void onAfterSlideChanged(@Nullable Class<? extends SlideFragment> oldSlide, @NonNull Class<? extends SlideFragment> newSlide) {
|
|
|
|
|
// If the user has enabled encryption, we need to request permission to show notifications
|
|
|
|
|
// in order to be able to show the "Vault unlocked" notification.
|
|
|
|
|
if (newSlide == DoneSlide.class && getState().getSerializable("creds") != null) {
|
|
|
|
|
if (Build.VERSION.SDK_INT >= 33) {
|
|
|
|
|
PermissionHelper.request(this, CODE_PERM_NOTIFICATIONS, Manifest.permission.POST_NOTIFICATIONS);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void onDonePressed() {
|
|
|
|
|
Bundle state = getState();
|
|
|
|
|