Added material intro screen including icons
|
@ -25,6 +25,7 @@ dependencies {
|
||||||
compile 'com.android.support:appcompat-v7:24.1.1'
|
compile 'com.android.support:appcompat-v7:24.1.1'
|
||||||
compile 'com.github.nisrulz:recyclerviewhelper:24.1.1'
|
compile 'com.github.nisrulz:recyclerviewhelper:24.1.1'
|
||||||
compile 'com.android.support:design:24.1.1'
|
compile 'com.android.support:design:24.1.1'
|
||||||
|
compile 'agency.tango.android:material-intro-screen:0.0.3'
|
||||||
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
|
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
|
||||||
compile 'me.dm7.barcodescanner:zxing:1.9'
|
compile 'me.dm7.barcodescanner:zxing:1.9'
|
||||||
compile 'com.android.support:cardview-v7:24.1.1'
|
compile 'com.android.support:cardview-v7:24.1.1'
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/icon"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/AppTheme">
|
android:theme="@style/AppTheme">
|
||||||
|
@ -22,9 +22,15 @@
|
||||||
</activity>
|
</activity>
|
||||||
<activity android:name=".ScannerActivity">
|
<activity android:name=".ScannerActivity">
|
||||||
</activity>
|
</activity>
|
||||||
<activity android:name=".AddProfileActivity"
|
<activity
|
||||||
|
android:name=".AddProfileActivity"
|
||||||
android:theme="@style/AppTheme.TransparentActionBar">
|
android:theme="@style/AppTheme.TransparentActionBar">
|
||||||
</activity>
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".IntroActivity"
|
||||||
|
android:label="@string/title_activity_intro"
|
||||||
|
android:theme="@style/Theme.Intro">
|
||||||
|
</activity>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
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.ClipboardManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.support.design.widget.FloatingActionButton;
|
import android.support.design.widget.FloatingActionButton;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
@ -42,6 +43,14 @@ public class MainActivity extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(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);
|
setContentView(R.layout.activity_main);
|
||||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
@ -109,35 +118,6 @@ public class MainActivity extends AppCompatActivity {
|
||||||
Intent intent = new Intent(this, AddProfileActivity.class);
|
Intent intent = new Intent(this, AddProfileActivity.class);
|
||||||
intent.putExtra("KeyProfile", keyProfile);
|
intent.putExtra("KeyProfile", keyProfile);
|
||||||
startActivityForResult(intent, ADD_KEYINFO);
|
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.
|
//TODO: do something with the result.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
BIN
app/src/main/res/drawable-hdpi/intro_scanner.png
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
app/src/main/res/drawable-hdpi/intro_shield.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
app/src/main/res/drawable-mdpi/intro_scanner.png
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
app/src/main/res/drawable-mdpi/intro_shield.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
app/src/main/res/drawable-xhdpi/intro_scanner.png
Normal file
After Width: | Height: | Size: 8.1 KiB |
BIN
app/src/main/res/drawable-xhdpi/intro_shield.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
app/src/main/res/drawable-xxhdpi/intro_scanner.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
app/src/main/res/drawable-xxhdpi/intro_shield.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/intro_scanner.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/intro_shield.png
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
app/src/main/res/drawable/icon.png
Normal file
After Width: | Height: | Size: 78 KiB |
35
app/src/main/res/layout/activity_intro.xml
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<android.support.design.widget.CoordinatorLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
|
tools:context="me.impy.aegis.IntroActivity">
|
||||||
|
|
||||||
|
<android.support.design.widget.AppBarLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:theme="@style/AppTheme.AppBarOverlay">
|
||||||
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="?attr/colorPrimary"
|
||||||
|
app:popupTheme="@style/AppTheme.PopupOverlay"/>
|
||||||
|
|
||||||
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
|
<include layout="@layout/content_intro"/>
|
||||||
|
|
||||||
|
<android.support.design.widget.FloatingActionButton
|
||||||
|
android:id="@+id/fab"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom|end"
|
||||||
|
android:layout_margin="@dimen/fab_margin"
|
||||||
|
app:srcCompat="@android:drawable/ic_dialog_email"/>
|
||||||
|
|
||||||
|
</android.support.design.widget.CoordinatorLayout>
|
17
app/src/main/res/layout/content_intro.xml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/content_intro"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||||
|
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||||
|
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||||
|
android:paddingTop="@dimen/activity_vertical_margin"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||||
|
tools:context="me.impy.aegis.IntroActivity"
|
||||||
|
tools:showIn="@layout/activity_intro">
|
||||||
|
|
||||||
|
</RelativeLayout>
|
BIN
app/src/main/res/mipmap-hdpi/icon.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
app/src/main/res/mipmap-mdpi/icon.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
app/src/main/res/mipmap-xhdpi/icon.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon.png
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/icon.png
Normal file
After Width: | Height: | Size: 53 KiB |
|
@ -1,4 +1,5 @@
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">Aegis</string>
|
<string name="app_name">Aegis</string>
|
||||||
<string name="action_settings">Settings</string>
|
<string name="action_settings">Settings</string>
|
||||||
|
<string name="title_activity_intro">IntroActivity</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|