mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-05-15 22:42:51 +00:00
Added material intro screen including icons
This commit is contained in:
parent
ed829d004b
commit
9112c16235
23 changed files with 128 additions and 32 deletions
56
app/src/main/java/me/impy/aegis/IntroActivity.java
Normal file
56
app/src/main/java/me/impy/aegis/IntroActivity.java
Normal file
|
@ -0,0 +1,56 @@
|
|||
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.support.design.widget.FloatingActionButton;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
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()
|
||||
.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());
|
||||
|
||||
addSlide(new SlideFragmentBuilder()
|
||||
.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(),
|
||||
new MessageButtonBehaviour(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
}
|
||||
}, "Permission granted"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
super.onFinish();
|
||||
SharedPreferences prefs = this.getSharedPreferences("me.impy.aegis", Context.MODE_PRIVATE);
|
||||
prefs.edit().putBoolean("passedIntro", true).apply();
|
||||
}
|
||||
|
||||
}
|
|
@ -4,6 +4,7 @@ import android.content.ClipData;
|
|||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
|
@ -42,6 +43,14 @@ public class MainActivity extends AppCompatActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
SharedPreferences prefs = this.getSharedPreferences("me.impy.aegis", Context.MODE_PRIVATE);
|
||||
if(!prefs.getBoolean("passedIntro", false))
|
||||
{
|
||||
Intent intro = new Intent(this, IntroActivity.class);
|
||||
startActivity(intro);
|
||||
}
|
||||
|
||||
setContentView(R.layout.activity_main);
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
@ -109,35 +118,6 @@ public class MainActivity extends AppCompatActivity {
|
|||
Intent intent = new Intent(this, AddProfileActivity.class);
|
||||
intent.putExtra("KeyProfile", keyProfile);
|
||||
startActivityForResult(intent, ADD_KEYINFO);
|
||||
/* new LovelyTextInputDialog(this, R.style.EditTextTintTheme)
|
||||
.setTopColorRes(R.color.colorHeaderSuccess)
|
||||
.setTitle("New profile added")
|
||||
.setMessage("How do you want to call it?")
|
||||
.setIcon(R.drawable.ic_check)
|
||||
.setInitialInput(keyProfile.Name)
|
||||
.setInputFilter("Nah, not possible man.", new LovelyTextInputDialog.TextFilter() {
|
||||
@Override
|
||||
public boolean check(String text) {
|
||||
return true;
|
||||
//return text.matches("\\w+");
|
||||
}
|
||||
})
|
||||
.setConfirmButton(android.R.string.ok, new LovelyTextInputDialog.OnTextInputConfirmListener() {
|
||||
@Override
|
||||
public void onTextInputConfirmed(String text) {
|
||||
keyProfile.Name = text;
|
||||
mKeyProfiles.add(keyProfile);
|
||||
mKeyProfileAdapter.notifyDataSetChanged();
|
||||
|
||||
try {
|
||||
database.addKey(keyProfile);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
})
|
||||
.show();*/
|
||||
|
||||
//TODO: do something with the result.
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue