2016-09-29 12:31:55 +02:00
|
|
|
package me.impy.aegis;
|
|
|
|
|
|
|
|
import android.Manifest;
|
|
|
|
import android.content.Context;
|
|
|
|
import android.content.SharedPreferences;
|
|
|
|
import android.os.Bundle;
|
|
|
|
import android.support.annotation.Nullable;
|
|
|
|
import android.view.View;
|
|
|
|
|
|
|
|
import agency.tango.materialintroscreen.MaterialIntroActivity;
|
|
|
|
import agency.tango.materialintroscreen.MessageButtonBehaviour;
|
|
|
|
import agency.tango.materialintroscreen.SlideFragmentBuilder;
|
|
|
|
|
|
|
|
public class IntroActivity extends MaterialIntroActivity {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
|
|
|
|
addSlide(new SlideFragmentBuilder()
|
2017-08-02 21:29:27 +02:00
|
|
|
.backgroundColor(R.color.colorPrimary)
|
|
|
|
.buttonsColor(R.color.colorAccent)
|
|
|
|
.image(R.drawable.intro_shield)
|
|
|
|
.title("Welcome")
|
|
|
|
.description("Aegis is a brand new open source(!) authenticator app which generates tokens for your accounts.")
|
|
|
|
.build());
|
2016-09-29 12:31:55 +02:00
|
|
|
|
|
|
|
addSlide(new SlideFragmentBuilder()
|
2017-08-02 21:29:27 +02:00
|
|
|
.backgroundColor(R.color.colorAccent)
|
|
|
|
.buttonsColor(R.color.colorPrimary)
|
|
|
|
.neededPermissions(new String[]{Manifest.permission.CAMERA})
|
|
|
|
.image(R.drawable.intro_scanner)
|
|
|
|
.title("Permissions")
|
|
|
|
.description("Aegis needs permission to your camera in order to function properly. This is needed to scan QR codes.")
|
|
|
|
.build(),
|
2016-09-29 12:31:55 +02:00
|
|
|
new MessageButtonBehaviour(new View.OnClickListener() {
|
|
|
|
@Override
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
|
|
|
}
|
|
|
|
}, "Permission granted"));
|
2017-08-05 15:15:31 +02:00
|
|
|
|
|
|
|
addSlide(new CustomAuthenticationSlide());
|
|
|
|
addSlide(new CustomAuthenticatedSlide());
|
2016-09-29 12:31:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onFinish() {
|
|
|
|
super.onFinish();
|
|
|
|
SharedPreferences prefs = this.getSharedPreferences("me.impy.aegis", Context.MODE_PRIVATE);
|
|
|
|
prefs.edit().putBoolean("passedIntro", true).apply();
|
|
|
|
}
|
|
|
|
}
|