diff --git a/.classpath b/.classpath
deleted file mode 100644
index 2cc4535..0000000
--- a/.classpath
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/.gitignore b/.gitignore
index f6b286c..3543521 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,40 +1 @@
-# Built application files
-*.apk
-*.ap_
-
-# Files for the ART/Dalvik VM
-*.dex
-
-# Java class files
-*.class
-
-# Generated files
-bin/
-gen/
-out/
-
-# Gradle files
-.gradle/
-build/
-
-# Local configuration file (sdk path, etc)
-local.properties
-
-# Proguard folder generated by Eclipse
-proguard/
-
-# Log Files
-*.log
-
-# Android Studio Navigation editor temp files
-.navigation/
-
-# Android Studio captures folder
-captures/
-
-# Intellij
-*.iml
-.idea/workspace.xml
-
-# Keystore files
-*.jks
+/build
diff --git a/.project b/.project
deleted file mode 100644
index 1c07c17..0000000
--- a/.project
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
- MasterKey
-
-
-
-
-
- com.android.ide.eclipse.adt.ResourceManagerBuilder
-
-
-
-
- com.android.ide.eclipse.adt.PreCompilerBuilder
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- com.android.ide.eclipse.adt.ApkBuilder
-
-
-
-
- org.sonarlint.eclipse.core.sonarlintBuilder
-
-
-
-
-
- com.android.ide.eclipse.adt.AndroidNature
- org.eclipse.jdt.core.javanature
-
-
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 8dada3e..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "{}"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright {yyyy} {name of copyright owner}
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/MasterKey-MasterKey.iml b/MasterKey-MasterKey.iml
new file mode 100644
index 0000000..5c77066
--- /dev/null
+++ b/MasterKey-MasterKey.iml
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ generateReleaseSources
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/README.md b/README.md
deleted file mode 100644
index 6a3149f..0000000
--- a/README.md
+++ /dev/null
@@ -1,21 +0,0 @@
-# MasterKey
-An droid application to secure all passwords.
-
-Initial Setup:
-
-After pull, first update (your own choice of) Digestor and Encyptor configurations in /assets/app.properties file.
-
-For example,
-
-#Properties of DIgester:
-
-DIGESTER_ALGORITHM=MD5
-
-ITERATIONS=1000
-
-
-#Properties of ENcryptor:
-
-ENCRYPTOR_ALGORITHM=PBEWITHMD5ANDTRIPLEDES
-
-SALT_PWD=SALT
diff --git a/assets/app.properties b/assets/app.properties
deleted file mode 100644
index cbcc3a0..0000000
--- a/assets/app.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-#Properties of DIgester
-DIGESTER_ALGORITHM=MD5
-ITERATIONS=1000
-
-#Properties of ENcryptor
-ENCRYPTOR_ALGORITHM=PBEWITHMD5ANDTRIPLEDES
-SALT_PWD=SALT
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..68f0818
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,49 @@
+apply plugin: 'com.android.application'
+
+android {
+ dexOptions {
+ // Prevent OutOfMemory with MultiDex during the build phase
+ javaMaxHeapSize "2g"
+ }
+ signingConfigs {
+ config {
+ keyAlias 'xxxx'
+ keyPassword 'xxx'
+ storeFile file('C:/Users/SUPERLA72/xxx')
+ storePassword 'xxx'
+ }
+ }
+ compileSdkVersion 23
+ buildToolsVersion '25.0.0'
+ defaultConfig {
+ applicationId "com.makinus.masterkey"
+ minSdkVersion 21
+ targetSdkVersion 23
+ versionCode 1
+ versionName "1.0"
+
+ //testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ signingConfig signingConfigs.config
+ zipAlignEnabled true
+ }
+ }
+}
+
+dependencies {
+ compile fileTree(include: ['*.jar'], dir: 'libs')
+ androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
+ exclude group: 'com.android.support', module: 'support-annotations'
+ })
+ compile 'com.android.support:support-v4:23.0.0'
+ compile 'com.android.support:appcompat-v7:23.0.0'
+ compile 'joda-time:joda-time:2.9.4'
+ compile 'org.jasypt:jasypt:1.9.2'
+ testCompile 'junit:junit:4.12'
+ compile 'com.android.support:design:23.0.0'
+}
diff --git a/ic_launcher-web.png b/ic_launcher-web.png
deleted file mode 100644
index bcfb215..0000000
Binary files a/ic_launcher-web.png and /dev/null differ
diff --git a/libs/android-support-v4.jar b/libs/android-support-v4.jar
deleted file mode 100644
index 6080877..0000000
Binary files a/libs/android-support-v4.jar and /dev/null differ
diff --git a/libs/jasypt-1.9.2-lite.jar b/libs/jasypt-1.9.2-lite.jar
deleted file mode 100644
index 976c415..0000000
Binary files a/libs/jasypt-1.9.2-lite.jar and /dev/null differ
diff --git a/libs/joda-time-2.8.2.jar b/libs/joda-time-2.8.2.jar
deleted file mode 100644
index 05960ff..0000000
Binary files a/libs/joda-time-2.8.2.jar and /dev/null differ
diff --git a/proguard-project.txt b/proguard-rules.pro
similarity index 62%
rename from proguard-project.txt
rename to proguard-rules.pro
index f2fe155..a5c4d66 100644
--- a/proguard-project.txt
+++ b/proguard-rules.pro
@@ -1,20 +1,17 @@
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in H:\Data\adt-bundle-windows-x86\sdk/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the proguardFiles
+# directive in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
diff --git a/project.properties b/project.properties
deleted file mode 100644
index 4ab1256..0000000
--- a/project.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-19
diff --git a/res/drawable-mdpi/ic_reminder_active.png b/res/drawable-mdpi/ic_reminder_active.png
deleted file mode 100644
index a890c9a..0000000
Binary files a/res/drawable-mdpi/ic_reminder_active.png and /dev/null differ
diff --git a/res/layout/activity_call.xml b/res/layout/activity_call.xml
deleted file mode 100644
index 202e85f..0000000
--- a/res/layout/activity_call.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
diff --git a/res/layout/activity_main.xml b/res/layout/activity_main.xml
deleted file mode 100644
index e05acad..0000000
--- a/res/layout/activity_main.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/res/values-v11/styles.xml b/res/values-v11/styles.xml
deleted file mode 100644
index 9643ba1..0000000
--- a/res/values-v11/styles.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/res/values-v14/styles.xml b/res/values-v14/styles.xml
deleted file mode 100644
index 50251a1..0000000
--- a/res/values-v14/styles.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/androidTest/java/makinus/com/masterkey/ExampleInstrumentedTest.java b/src/androidTest/java/makinus/com/masterkey/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..2a8beac
--- /dev/null
+++ b/src/androidTest/java/makinus/com/masterkey/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package makinus.com.masterkey;
+
+import android.content.Context;
+import android.support.test.InstrumentationRegistry;
+import android.support.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumentation test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() throws Exception {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getTargetContext();
+
+ assertEquals("makinus.com.masterkey", appContext.getPackageName());
+ }
+}
diff --git a/src/com/makinus/masterkey/LazyAdapter.java b/src/com/makinus/masterkey/LazyAdapter.java
deleted file mode 100644
index f5f78a8..0000000
--- a/src/com/makinus/masterkey/LazyAdapter.java
+++ /dev/null
@@ -1,121 +0,0 @@
-package com.makinus.masterkey;
-
-import java.util.List;
-
-import com.makinus.masterkey.utils.MasterKeyUtils;
-import com.makinus.model.Card;
-import android.annotation.SuppressLint;
-import android.app.Activity;
-import android.content.Context;
-import android.graphics.Color;
-import android.graphics.drawable.GradientDrawable;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.view.ViewGroup;
-import android.widget.BaseAdapter;
-import android.widget.ImageView;
-import android.widget.TextView;
-
-public class LazyAdapter extends BaseAdapter{
-
- protected static final String SHOW = "Show";
- protected static final String HIDE = "Hide";
- private Activity activity;
- private List data;
- private static LayoutInflater inflater=null;
- protected MasterKeyUtils mKeyUtil;
-
- public LazyAdapter(Activity a, List d) {
- activity = a;
- data=d;
- inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- mKeyUtil = MasterKeyUtils.getInstance(a.getApplicationContext());
- }
-
- public int getCount() {
- return data.size();
- }
-
- public Object getItem(int position) {
- return data.get(position);
- }
-
- public long getItemId(int position) {
- return position;
- }
-
- @SuppressLint("InflateParams")
- public View getView(final int position, View convertView, ViewGroup parent) {
- View vi=convertView;
- if(convertView==null)
- vi = inflater.inflate(R.layout.list_row, null);
-
- TextView cardId = (TextView)vi.findViewById(R.id.txtCardId);
- TextView account = (TextView)vi.findViewById(R.id.lAccount);
- TextView username = (TextView)vi.findViewById(R.id.txtUsername);
- final TextView password = (TextView)vi.findViewById(R.id.txtPassword);
- final TextView showHide = (TextView)vi.findViewById(R.id.txtShowHide);
- TextView imgText = (TextView)vi.findViewById(R.id.imgText);
- ImageView imgRemindMe = (ImageView)vi.findViewById(R.id.imgRemindMe);
-
- Card card = data.get(position);
- cardId.setText(""+card.getId());
- account.setText(card.getAccount());
- username.setText(card.getUsername());
- password.setText("********");
- showHide.setText(SHOW);
- imgText.setText(card.getAccount().substring(0,1));
- //setCircleView(imgText, card.getColor());
-
- if(card.getHidePwd().equals("Y")) {
- showHide.setEnabled(false);
- showHide.setTextColor(activity.getResources().getColor(R.color.darkgray));
- }
- else if(card.getHidePwd().equals("N")) {
- showHide.setEnabled(true);
- showHide.setTextColor(activity.getResources().getColor(R.color.linkcolor));
- }
-
- showHide.setOnClickListener(new OnClickListener() {
-
- @Override
- public void onClick(View v) {
- if(showHide.getText().equals(SHOW)) {
- showHide.setText(HIDE);
- password.setText(mKeyUtil.decrypt(data.get(position).getPassword()));
- }
- else {
- showHide.setText(SHOW);
- password.setText("********");
- }
- }
- });
-
- if(card.getRemindMe().equals("Y")) {
- if(mKeyUtil.isExpired(card.getUpdatedOn()))
- imgRemindMe.setImageResource(R.drawable.ic_reminder_expired);
- else
- imgRemindMe.setImageResource(R.drawable.ic_reminder_active);
- }
- else if(card.getRemindMe().equals("N")) {
- imgRemindMe.setImageResource(R.drawable.ic_reminder_inactive);
- }
-
- return vi;
- }
-
- @SuppressWarnings("unused")
- @Deprecated
- private static void setCircleView(View v, int bgColor)
- {
- GradientDrawable shape = new GradientDrawable();
- shape.setShape(GradientDrawable.OVAL);
- //shape.setCornerRadii(new float[] { 8, 8, 8, 8, 0, 0, 0, 0 });
- shape.setSize(60, 60);
- shape.setColor(bgColor);
- shape.setStroke(1, Color.rgb(219 , 219 , 219 ));
- v.setBackground(shape);
-
- }
-}
diff --git a/AndroidManifest.xml b/src/main/AndroidManifest.xml
similarity index 80%
rename from AndroidManifest.xml
rename to src/main/AndroidManifest.xml
index 8be6648..4ecca98 100644
--- a/AndroidManifest.xml
+++ b/src/main/AndroidManifest.xml
@@ -5,7 +5,7 @@
android:versionName="1.0" >
@@ -21,12 +21,15 @@
+ android:screenOrientation="portrait"
+ android:theme="@style/AppTheme.NoActionBar">
+
+
@@ -35,7 +38,16 @@
-
+
diff --git a/src/main/assets/app.properties b/src/main/assets/app.properties
new file mode 100644
index 0000000..de3b0fa
--- /dev/null
+++ b/src/main/assets/app.properties
@@ -0,0 +1,7 @@
+#Properties of DIgester
+DIGESTER_ALGORITHM=
+ITERATIONS=
+
+#Properties of ENcryptor
+ENCRYPTOR_ALGORITHM=
+SALT_PWD=
\ No newline at end of file
diff --git a/src/com/makinus/masterkey/BaseActivity.java b/src/main/java/com/makinus/masterkey/BaseActivity.java
similarity index 55%
rename from src/com/makinus/masterkey/BaseActivity.java
rename to src/main/java/com/makinus/masterkey/BaseActivity.java
index b03dcc2..ffa0b08 100644
--- a/src/com/makinus/masterkey/BaseActivity.java
+++ b/src/main/java/com/makinus/masterkey/BaseActivity.java
@@ -6,26 +6,41 @@
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
-import com.makinus.db.service.impl.DatabaseHandler;
+import com.makinus.masterkey.db.service.impl.DatabaseHandler;
import com.makinus.masterkey.utils.MasterKeyUtils;
import android.annotation.SuppressLint;
+import android.annotation.TargetApi;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.ActivityManager.RunningServiceInfo;
+import android.app.SearchManager;
import android.content.Context;
import android.content.Intent;
+import android.database.MatrixCursor;
+import android.os.Build;
import android.os.Bundle;
+import android.support.v7.app.AppCompatActivity;
+import android.text.TextUtils;
+import android.view.ContextMenu;
import android.view.Menu;
import android.view.MenuItem;
+import android.support.v7.widget.SearchView;
+import android.support.v4.view.MenuItemCompat;
+import android.support.v7.widget.Toolbar;
+import android.support.v7.app.ActionBar;
+import android.view.View;
+import android.widget.ListView;
-public class BaseActivity extends Activity{
+public class BaseActivity extends AppCompatActivity{
public static final int REQ_CODE = 1;
public static final String YES = "Y";
public static final String NO = "N";
-
+
final Context context = this;
+ ListView cardsListView;
+ protected LazyAdapter lazyAdapter;
protected DatabaseHandler dbService;
protected MasterKeyUtils mKeyUtil;
@@ -38,40 +53,6 @@ protected void onCreate(Bundle arg0) {
mKeyUtil = MasterKeyUtils.getInstance(context);
}
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- // Inflate the menu; this adds items to the action bar if it is present.
- getMenuInflater().inflate(R.menu.activity_main, menu);
- return true;
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- Intent i = null;
- switch (item.getItemId()) {
- case R.id.mi_resetPwd:
- i = new Intent(context, ResetMasterPwdActivity.class);
- startActivityForResult(i, REQ_CODE);
- return true;
- case R.id.mi_changePwd:
- i = new Intent(context, ChangeMasterPwdActivity.class);
- startActivityForResult(i, REQ_CODE);
- return true;
- case R.id.mi_generateCode:
- i = new Intent(context, GenerateResetCodeActivity.class);
- startActivityForResult(i, REQ_CODE);
- return true;
- case R.id.mi_about:
- startActivityForResult(new Intent(this, MenuHandlerActivity.class).putExtra("menu", "about"), REQ_CODE);
- return true;
- /*case R.id.mi_help:
- startActivity(new Intent(this, MenuHandlerActivity.class));
- return true;*/
- default:
- return super.onOptionsItemSelected(item);
- }
- }
-
@SuppressLint("TrulyRandom")
public String generateResetCode() {
return new BigInteger(130, new SecureRandom()).toString(32);
@@ -94,4 +75,5 @@ public boolean isNotifyServiceRunning(Class> serviceClass) {
}
return false;
}
+
}
\ No newline at end of file
diff --git a/src/com/makinus/masterkey/ChangeMasterPwdActivity.java b/src/main/java/com/makinus/masterkey/ChangeMasterPwdActivity.java
similarity index 100%
rename from src/com/makinus/masterkey/ChangeMasterPwdActivity.java
rename to src/main/java/com/makinus/masterkey/ChangeMasterPwdActivity.java
diff --git a/src/com/makinus/masterkey/EditCardActivity.java b/src/main/java/com/makinus/masterkey/EditCardActivity.java
similarity index 91%
rename from src/com/makinus/masterkey/EditCardActivity.java
rename to src/main/java/com/makinus/masterkey/EditCardActivity.java
index 759137c..15277f4 100644
--- a/src/com/makinus/masterkey/EditCardActivity.java
+++ b/src/main/java/com/makinus/masterkey/EditCardActivity.java
@@ -1,6 +1,6 @@
package com.makinus.masterkey;
-import com.makinus.model.Card;
+import com.makinus.masterkey.model.Card;
import android.app.Activity;
import android.app.AlertDialog;
@@ -99,7 +99,10 @@ private void setFields(Card card) {
cbHidePwd.setChecked(card.getHidePwd().equals(YES) ? true : false);
cbRemindMe.setChecked(card.getRemindMe().equals(YES) ? true : false);
remindMeDays = card.getRemindMeDays();
- remindMeMsg.setText(remindDaysMsg.replace("%n%", ""+remindMeDays));
+ if (remindMeDays > 0)
+ remindMeMsg.setText(remindDaysMsg.replace("%n%", ""+remindMeDays));
+ else
+ remindMeMsg.setText(R.string.strRemindDaysMsg);
remindMeMsg = (TextView) findViewById(R.id.lblRemindMsg);
@@ -107,8 +110,9 @@ private void setFields(Card card) {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
- if(isChecked)
+ if(isChecked) {
showDialog();
+ }
else {
remindMeDays = 0;
remindMeMsg.setText(R.string.strRemindDaysMsg);
@@ -127,7 +131,7 @@ private Card populateCard() {
.setHidePwd(cbHidePwd.isChecked() ? YES : NO)
.setRemindMe(cbRemindMe.isChecked() ? YES : NO)
.setUpdatedOn(getTodaysDate())
- .setColor(mKeyUtil.getHSBColorCode())
+ .setColor(mKeyUtil.getRGBColorCode())
.setRemindMeDays(remindMeDays);
}
@@ -151,7 +155,7 @@ private void showDialog() {
// custom dialog
dialog = new Dialog(context);
dialog.setContentView(R.layout.activity_remindmedialog);
- dialog.setTitle(">MasterKey");
+ //dialog.setTitle(">MasterKey");
dialog.setCancelable(true);
noOfDaysPicker = (NumberPicker) dialog.findViewById(R.id.noOfDaysPicker);
diff --git a/src/com/makinus/masterkey/FormActivity.java b/src/main/java/com/makinus/masterkey/FormActivity.java
similarity index 93%
rename from src/com/makinus/masterkey/FormActivity.java
rename to src/main/java/com/makinus/masterkey/FormActivity.java
index 6ed27b3..9f9f58a 100644
--- a/src/com/makinus/masterkey/FormActivity.java
+++ b/src/main/java/com/makinus/masterkey/FormActivity.java
@@ -1,6 +1,6 @@
package com.makinus.masterkey;
-import com.makinus.model.Card;
+import com.makinus.masterkey.model.Card;
import android.app.Activity;
import android.app.Dialog;
@@ -29,7 +29,6 @@ public class FormActivity extends BaseActivity{
Dialog dialog;
private NumberPicker noOfDaysPicker;
private int remindMeDays;
-
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -47,8 +46,10 @@ protected void onCreate(Bundle savedInstanceState) {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
- if(isChecked)
+
+ if(isChecked) {
showDialog();
+ }
else {
remindMeDays = 0;
remindMeMsg.setText(R.string.strRemindDaysMsg);
@@ -97,7 +98,7 @@ private Card populateCard() {
.setHidePwd(cbHidePwd.isChecked() ? YES : NO)
.setRemindMe(cbRemindMe.isChecked() ? YES : NO)
.setUpdatedOn(getTodaysDate())
- .setColor(mKeyUtil.getHSBColorCode())
+ .setColor(mKeyUtil.getRGBColorCode())
.setRemindMeDays(remindMeDays);
}
@@ -105,7 +106,7 @@ private void showDialog() {
// custom dialog
dialog = new Dialog(context);
dialog.setContentView(R.layout.activity_remindmedialog);
- dialog.setTitle(">MasterKey");
+ //dialog.setTitle(">MasterKey");
dialog.setCancelable(true);
noOfDaysPicker = (NumberPicker) dialog.findViewById(R.id.noOfDaysPicker);
diff --git a/src/com/makinus/masterkey/GenerateResetCodeActivity.java b/src/main/java/com/makinus/masterkey/GenerateResetCodeActivity.java
similarity index 100%
rename from src/com/makinus/masterkey/GenerateResetCodeActivity.java
rename to src/main/java/com/makinus/masterkey/GenerateResetCodeActivity.java
diff --git a/src/main/java/com/makinus/masterkey/LazyAdapter.java b/src/main/java/com/makinus/masterkey/LazyAdapter.java
new file mode 100644
index 0000000..f0ce4e6
--- /dev/null
+++ b/src/main/java/com/makinus/masterkey/LazyAdapter.java
@@ -0,0 +1,228 @@
+
+package com.makinus.masterkey;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Locale;
+
+import com.makinus.masterkey.utils.MasterKeyUtils;
+import com.makinus.masterkey.model.Card;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.content.Context;
+import android.graphics.drawable.GradientDrawable;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.Filter;
+import android.widget.Filterable;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+public class LazyAdapter extends BaseAdapter { // implements Filterable {
+
+ protected static final String SHOW = "Show";
+ protected static final String HIDE = "Hide";
+ private Activity activity;
+ private List cardList;
+ private ArrayList filteredCardList;
+ private LazyFilter lazyFilter;
+ private static LayoutInflater inflater=null;
+ protected MasterKeyUtils mKeyUtil;
+
+ public LazyAdapter(Activity a, List d) {
+ this.activity = a;
+ this.cardList =d;
+ filteredCardList = new ArrayList();
+ filteredCardList.addAll(cardList);
+ inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ mKeyUtil = MasterKeyUtils.getInstance(a.getApplicationContext());
+ }
+
+ public int getCount() {
+ return cardList.size();
+ }
+
+ public Object getItem(int position) {
+ return cardList.get(position);
+ }
+
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @SuppressLint("InflateParams")
+ public View getView(final int position, View convertView, ViewGroup parent) {
+ View vi=convertView;
+ if(convertView==null)
+ vi = inflater.inflate(R.layout.list_row, null);
+
+ TextView cardId = (TextView)vi.findViewById(R.id.txtCardId);
+ TextView account = (TextView)vi.findViewById(R.id.lAccount);
+ TextView username = (TextView)vi.findViewById(R.id.txtUsername);
+ final TextView password = (TextView)vi.findViewById(R.id.txtPassword);
+ final ImageView showHide = (ImageView)vi.findViewById(R.id.imgShowHide);
+ TextView imgText = (TextView)vi.findViewById(R.id.imgText);
+ ImageView imgRemindMe = (ImageView)vi.findViewById(R.id.imgRemindMe);
+
+ Card card = cardList.get(position);
+ cardId.setText(""+card.getId());
+ account.setText(card.getAccount());
+ username.setText(card.getUsername());
+ password.setText("********");
+ password.setTextColor(activity.getResources().getColor(R.color.textColor));
+ //showHide.setText(SHOW);
+ imgText.setText(card.getAccount().substring(0,1));
+ setCircleView(imgText, card.getColor());
+
+ if(card.getHidePwd().equals("Y")) {
+ showHide.setVisibility(View.INVISIBLE);
+ showHide.setBackgroundResource(R.drawable.ic_action_visibility_off);
+ //showHide.setTextColor(activity.getResources().getColor(R.color.darkgray));
+ }
+ else if(card.getHidePwd().equals("N")) {
+ showHide.setVisibility(View.VISIBLE);
+ showHide.setBackgroundResource(R.drawable.ic_visibility);
+ //showHide.setTextColor(activity.getResources().getColor(R.color.linkcolor));
+ }
+
+ /*showHide.setOnLongClickListener(new OnLongClickListener() {
+
+ @Override
+ public boolean onLongClick(View v) {
+ password.setText(mKeyUtil.decrypt(cardList.get(position).getPassword()));
+ return false;
+ }
+ });
+
+ showHide.setOnClickListener(new OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+ if(showHide.getText().equals(SHOW)) {
+ //showHide.setText(HIDE);
+ }
+ else {
+ //showHide.setText(SHOW);
+ password.setText("********");
+ }
+
+ //password.setText("********");
+ }
+ });*/
+
+ if(card.getRemindMe().equals("Y")) {
+ if(mKeyUtil.isExpired(card.getUpdatedOn()))
+ imgRemindMe.setImageResource(R.drawable.ic_reminder_expired);
+ else
+ imgRemindMe.setImageResource(R.drawable.ic_reminder_active);
+ }
+ else if(card.getRemindMe().equals("N")) {
+ imgRemindMe.setImageResource(R.drawable.ic_reminder_inactive);
+ }
+
+ return vi;
+ }
+
+ @SuppressWarnings("unused")
+ private static void setCircleView(View v, int bgColor)
+ {
+ GradientDrawable shape = new GradientDrawable();
+ shape.setShape(GradientDrawable.OVAL);
+ //shape.setCornerRadii(new float[] { 8, 8, 8, 8, 0, 0, 0, 0 });
+ shape.setSize(110, 110);
+ shape.setColor(bgColor);
+ //shape.setStroke(1, Color.rgb(219 , 219 , 219 ));
+ v.setBackground(shape);
+
+ }
+
+ public void filter(String charText) {
+
+ /*for(Card c: cardList) {
+ filteredCardList.add(c);
+ }*/
+ cardList.clear();
+ if (charText.isEmpty()) {
+ cardList.addAll(filteredCardList);
+ } else {
+ charText = charText.toLowerCase(Locale.getDefault());
+
+ for (Card c : filteredCardList) {
+ if (c.getAccount().toLowerCase().contains(charText.toString().toLowerCase())) {
+ cardList.add(c);
+ }
+ }
+ }
+
+ notifyDataSetChanged();
+ }
+
+ public void sort(String sortBy) {
+
+ if(cardList.size() > 0) {
+ Collections.sort(cardList);
+ if (sortBy.equals("ztoa"))
+ Collections.reverse(cardList);
+
+ notifyDataSetChanged();
+ }
+ }
+
+ /*@Override
+ public Filter getFilter() {
+ if(lazyFilter == null) {
+ return new LazyFilter();
+ }
+ else {
+ return lazyFilter;
+ }
+ }*/
+
+ /**
+ * Custom filter for cards list
+ * Filter content in cards list according to the search text
+ */
+ private class LazyFilter extends Filter {
+
+ @Override
+ protected FilterResults performFiltering(CharSequence constraint) {
+ FilterResults filterResults = new FilterResults();
+ if (constraint!=null && constraint.length()>0) {
+ ArrayList tempList = new ArrayList();
+
+ // search content in cards list
+ for (Card card : cardList) {
+ if (card.getAccount().toLowerCase().contains(constraint.toString().toLowerCase())) {
+ tempList.add(card);
+ }
+ }
+
+ filterResults.count = tempList.size();
+ filterResults.values = tempList;
+ } else {
+ filterResults.count = cardList.size();
+ filterResults.values = cardList;
+ }
+
+ return filterResults;
+ }
+
+ /**
+ * Notify about filtered list to ui
+ * @param constraint text
+ * @param results filtered result
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ protected void publishResults(CharSequence constraint, FilterResults results) {
+ filteredCardList = (ArrayList) results.values;
+ notifyDataSetChanged();
+ }
+ }
+
+}
diff --git a/src/com/makinus/masterkey/MainActivity.java b/src/main/java/com/makinus/masterkey/MainActivity.java
similarity index 50%
rename from src/com/makinus/masterkey/MainActivity.java
rename to src/main/java/com/makinus/masterkey/MainActivity.java
index b2d2267..d7bb58a 100644
--- a/src/com/makinus/masterkey/MainActivity.java
+++ b/src/main/java/com/makinus/masterkey/MainActivity.java
@@ -3,43 +3,62 @@
import java.io.Serializable;
import java.util.List;
-import com.makinus.masterkey.R;
import com.makinus.masterkey.service.MyScheduleReceiver;
import com.makinus.masterkey.service.NotifyService;
-import com.makinus.model.Card;
+import com.makinus.masterkey.model.Card;
import android.app.Activity;
import android.app.Dialog;
+import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.Intent;
import android.content.IntentFilter;
+import android.graphics.Color;
import android.os.Bundle;
+import android.support.design.widget.FloatingActionButton;
+import android.support.v7.app.ActionBar;
+import android.support.v7.widget.PopupMenu;
+import android.support.v7.widget.Toolbar;
+import android.view.ContextMenu;
+import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
+import android.widget.AdapterView.OnItemLongClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
+import android.widget.SearchView;
import android.widget.TextView;
import android.widget.Toast;
+
public class MainActivity extends BaseActivity {
EditText dlgMasterKey, dlgEmail;
Button addNew;
- ListView cardsListView;
- LazyAdapter lazyAdapter;
+ FloatingActionButton addNewFB;
TextView dlgLblMasterKey, dlgLblForgotKey;
-
+
+ SearchView editSearch;
Dialog dialog;
-
+
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
-
+
+ Toolbar myToolbar = (Toolbar) findViewById(R.id.my_toolbar);
+ setSupportActionBar(myToolbar);
+
+ ActionBar ab = getSupportActionBar();
+ // Enable the Up button
+ ab.setDisplayHomeAsUpEnabled(false);
try {
if(!isNotifyServiceRunning(NotifyService.class)) {
//startService(new Intent(context, NotifyService.class));
@@ -52,6 +71,15 @@ protected void onCreate(Bundle savedInstanceState) {
}
//AddNew Button
+ addNewFB = (FloatingActionButton) findViewById(R.id.btnAddNewFB);
+ addNewFB.setOnClickListener(new OnClickListener() {
+
+ @Override
+ public void onClick(View arg0) {
+ startActivityForResult(new Intent(context, FormActivity.class), REQ_CODE);
+ }
+ });
+
addNew = (Button) findViewById(R.id.btnAddNew);
addNew.setText("Enter Master key");
addNew.setOnClickListener(new OnClickListener() {
@@ -70,6 +98,7 @@ public void onClick(View arg0) {
//Cards listView
cardsListView = (ListView)findViewById(R.id.cardsList);
+ cardsListView.setTextFilterEnabled(true);
cardsListView.setOnItemClickListener(new OnItemClickListener() {
@Override
@@ -83,6 +112,47 @@ public void onItemClick(AdapterView> arg0, View arg1, int arg2,
}
});
+
+ cardsListView.setOnItemLongClickListener(new OnItemLongClickListener() {
+
+ @Override
+ public boolean onItemLongClick(AdapterView> parent, View view, int position, long id) {
+ Card c = (Card) cardsListView.getItemAtPosition(position);
+ View vi=view;
+ if(view==null){
+ LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ vi = inflater.inflate(R.layout.list_row, null);
+ }
+ if(c.getHidePwd().equals("N")) {
+ final TextView password = (TextView)vi.findViewById(R.id.txtPassword);
+ if(password.getText().toString().equals("********")) {
+ password.setText(mKeyUtil.decrypt(c.getPassword()));
+ password.setTextColor(Color.RED);
+ }
+ else {
+ password.setText("********");
+ password.setTextColor(context.getResources().getColor(R.color.textColor));
+ }
+ }
+ return true;
+ }
+
+ });
+
+ editSearch = (SearchView) findViewById(R.id.search);
+ editSearch.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
+ @Override
+ public boolean onQueryTextSubmit(String query) {
+ return false;
+ }
+
+ @Override
+ public boolean onQueryTextChange(String newText) {
+ lazyAdapter.filter(newText);
+ return false;
+ }
+ });
+
if(dbService.isValidMasterKey())
showAllCards();
else
@@ -95,7 +165,8 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == REQ_CODE) {
if(resultCode == Activity.RESULT_OK){
- Toast.makeText(context, data.getStringExtra("result"), Toast.LENGTH_SHORT).show();
+ if(!data.getBooleanExtra("isMenu", Boolean.FALSE))
+ Toast.makeText(context, data.getStringExtra("result"), Toast.LENGTH_SHORT).show();
}
}
showAllCards();
@@ -120,11 +191,11 @@ private void showDialog() {
// custom dialog
dialog = new Dialog(context);
dialog.setContentView(R.layout.activity_masterdialog);
- dialog.setTitle(">MasterKey");
+ //dialog.setTitle(">MasterKey");
dialog.setCancelable(true);
dlgMasterKey = (EditText) dialog.findViewById(R.id.eTxtMasterKey);
- dlgLblMasterKey = (TextView) dialog.findViewById(R.id.lblMasterKey);
+ dlgLblMasterKey = (TextView) dialog.findViewById(R.id.lblMasterKey);
dlgLblForgotKey = (TextView) dialog.findViewById(R.id.lblForgotKey);
dlgLblForgotKey.setOnClickListener(new OnClickListener() {
@@ -206,4 +277,93 @@ private boolean checkDlgValidation() {
return true;
}
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ // Inflate the menu; this adds items to the action bar if it is present.
+ getMenuInflater().inflate(R.menu.activity_main, menu);
+
+ return true;
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ Intent i = null;
+ switch (item.getItemId()) {
+ case R.id.mi_resetPwd:
+ i = new Intent(context, ResetMasterPwdActivity.class);
+ startActivityForResult(i, REQ_CODE);
+ return true;
+ case R.id.mi_changePwd:
+ i = new Intent(context, ChangeMasterPwdActivity.class);
+ startActivityForResult(i, REQ_CODE);
+ return true;
+ case R.id.mi_generateCode:
+ i = new Intent(context, GenerateResetCodeActivity.class);
+ startActivityForResult(i, REQ_CODE);
+ return true;
+ /*case R.id.mi_backup:
+ dbService.doBackup(context);
+ return true;
+ case R.id.mi_restore:
+ dbService.doRestore(context);
+ return true;*/
+ case R.id.mi_about:
+ startActivityForResult(new Intent(this, MenuHandlerActivity.class).putExtra("menu", "about"), REQ_CODE);
+ return true;
+ case R.id.mi_sort:
+ showPopupManu();
+ return true;
+ default:
+ return super.onOptionsItemSelected(item);
+ }
+ }
+
+ public void showPopupManu() {
+
+ View menuItemSort = findViewById(R.id.mi_sort);
+ PopupMenu popupMenu = new PopupMenu(this, menuItemSort);
+ MenuInflater inflater = popupMenu.getMenuInflater();
+ inflater.inflate(R.menu.activity_main_popup, popupMenu.getMenu());
+
+ popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
+ @Override
+ public boolean onMenuItemClick(MenuItem item) {
+ switch (item.getItemId()) {
+ case R.id.mi_sort_a:
+ lazyAdapter.sort("atoz");
+ return true;
+ case R.id.mi_sort_z:
+ lazyAdapter.sort("ztoa");
+ return true;
+ default:
+ return false;
+ }
+
+ }
+ });
+ popupMenu.show();
+ }
+
+ /*@Override
+ public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo)
+ {
+ super.onCreateContextMenu(menu, v, menuInfo);
+ menu.setHeaderTitle("Sort by..");
+ menu.add(0, v.getId(), 0, "Ascending");//groupId, itemId, order, title
+ menu.add(0, v.getId(), 0, "Descending");
+ }
+
+ @Override
+ public boolean onContextItemSelected(MenuItem item){
+ if(item.getTitle()=="Ascending")
+ lazyAdapter.sort("atoz");
+ else if(item.getTitle()=="Descending")
+ lazyAdapter.sort("ztoa");
+ else
+ return false;
+
+ return true;
+ }*/
+
}
\ No newline at end of file
diff --git a/src/com/makinus/masterkey/MenuHandlerActivity.java b/src/main/java/com/makinus/masterkey/MenuHandlerActivity.java
similarity index 86%
rename from src/com/makinus/masterkey/MenuHandlerActivity.java
rename to src/main/java/com/makinus/masterkey/MenuHandlerActivity.java
index 05c7ed2..549865b 100644
--- a/src/com/makinus/masterkey/MenuHandlerActivity.java
+++ b/src/main/java/com/makinus/masterkey/MenuHandlerActivity.java
@@ -26,7 +26,7 @@ protected void onCreate(Bundle savedInstanceState) {
@Override
public void onClick(View arg0) {
- setResult(Activity.RESULT_OK, new Intent());
+ setResult(Activity.RESULT_OK, new Intent().putExtra("isMenu", Boolean.TRUE));
finish();
}
});
diff --git a/src/com/makinus/masterkey/ResetMasterPwdActivity.java b/src/main/java/com/makinus/masterkey/ResetMasterPwdActivity.java
similarity index 100%
rename from src/com/makinus/masterkey/ResetMasterPwdActivity.java
rename to src/main/java/com/makinus/masterkey/ResetMasterPwdActivity.java
diff --git a/src/main/java/com/makinus/masterkey/SearchActivity.java b/src/main/java/com/makinus/masterkey/SearchActivity.java
new file mode 100644
index 0000000..6a1c151
--- /dev/null
+++ b/src/main/java/com/makinus/masterkey/SearchActivity.java
@@ -0,0 +1,33 @@
+package com.makinus.masterkey;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+
+public class SearchActivity extends BaseActivity{
+
+ final Context context = this;
+
+ private Button btnBack;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_search);
+
+ btnBack = (Button)findViewById(R.id.btnSearch);
+ btnBack.setOnClickListener(new OnClickListener() {
+
+ @Override
+ public void onClick(View arg0) {
+ setResult(Activity.RESULT_OK, new Intent().putExtra("isSearch", Boolean.TRUE));
+ finish();
+ }
+ });
+ }
+
+}
diff --git a/src/com/makinus/masterkey/ViewCardActivity.java b/src/main/java/com/makinus/masterkey/ViewCardActivity.java
similarity index 85%
rename from src/com/makinus/masterkey/ViewCardActivity.java
rename to src/main/java/com/makinus/masterkey/ViewCardActivity.java
index 1e05a6b..6893ff6 100644
--- a/src/com/makinus/masterkey/ViewCardActivity.java
+++ b/src/main/java/com/makinus/masterkey/ViewCardActivity.java
@@ -4,7 +4,7 @@
import java.util.Calendar;
import com.makinus.masterkey.R;
-import com.makinus.model.Card;
+import com.makinus.masterkey.model.Card;
import android.app.Activity;
import android.content.Intent;
@@ -56,8 +56,11 @@ public void onClick(View arg0) {
}
private String getShareMessage() {
- return "Username : " + txtAccount.getText().toString() +
- "\n Password : " + txtPassword.getText().toString();
+ return "Account Name : " + txtAccount.getText().toString() +
+ "\nUsername : " + txtUsername.getText().toString() +
+ "\nPassword : " + txtPassword.getText().toString() +
+ "\nUrl : " + txtUrl.getText().toString() +
+ "\n\n - shared via >MasterKey app.";
}
@Override
@@ -72,7 +75,6 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
} else {
setFields(dbService.getCard(txtId));
Toast.makeText(context, data.getStringExtra("result"), Toast.LENGTH_SHORT).show();
- finish();
}
}
}
@@ -105,7 +107,10 @@ private void setFields(Card card) {
}
cbRemindMe.setChecked(card.getRemindMe().equals(YES) ? true : false);
remindMeDays = card.getRemindMeDays();
- remindMeMsg.setText(remindDaysMsg.replace("%n%", ""+remindMeDays));
+ if (remindMeDays > 0)
+ remindMeMsg.setText(remindDaysMsg.replace("%n%", ""+remindMeDays));
+ else
+ remindMeMsg.setText(R.string.strRemindDaysMsg);
}
private Card populateCard() {
diff --git a/src/main/java/com/makinus/masterkey/db/service/impl/BackupAndRestore.java b/src/main/java/com/makinus/masterkey/db/service/impl/BackupAndRestore.java
new file mode 100644
index 0000000..aef8440
--- /dev/null
+++ b/src/main/java/com/makinus/masterkey/db/service/impl/BackupAndRestore.java
@@ -0,0 +1,58 @@
+package com.makinus.masterkey.db.service.impl;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.nio.channels.FileChannel;
+
+import android.content.Context;
+import android.os.Environment;
+import android.widget.Toast;
+
+public class BackupAndRestore {
+ public static void importDB(Context context, String dbName) {
+ try {
+ File sd = Environment.getExternalStorageDirectory();
+ if (sd.canWrite()) {
+ File backupDB = context.getDatabasePath(dbName);
+ String backupDBPath = String.format("%s.bak", dbName);
+ File currentDB = new File(sd, backupDBPath);
+
+ FileChannel src = new FileInputStream(currentDB).getChannel();
+ FileChannel dst = new FileOutputStream(backupDB).getChannel();
+ dst.transferFrom(src, 0, src.size());
+ src.close();
+ dst.close();
+
+ // MyApplication.toastSomething(context, "Import Successful!");
+ Toast.makeText(context, "Import Successful!", Toast.LENGTH_SHORT).show();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static void exportDB(Context context, String dbName) {
+ try {
+ File sd = Environment.getExternalStorageDirectory();
+ File data = Environment.getDataDirectory();
+
+ if (sd.canWrite()) {
+ String backupDBPath = String.format("%s.bak", dbName);
+ File currentDB = context.getDatabasePath(dbName);
+ File backupDB = new File(sd, backupDBPath);
+
+ FileChannel src = new FileInputStream(currentDB).getChannel();
+ FileChannel dst = new FileOutputStream(backupDB).getChannel();
+ dst.transferFrom(src, 0, src.size());
+ src.close();
+ dst.close();
+
+ //MyApplication.toastSomething(context, "Backup Successful!");
+ Toast.makeText(context, "Backup Successful!", Toast.LENGTH_SHORT).show();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/com/makinus/db/service/impl/DatabaseHandler.java b/src/main/java/com/makinus/masterkey/db/service/impl/DatabaseHandler.java
similarity index 94%
rename from src/com/makinus/db/service/impl/DatabaseHandler.java
rename to src/main/java/com/makinus/masterkey/db/service/impl/DatabaseHandler.java
index eff5495..ac94100 100644
--- a/src/com/makinus/db/service/impl/DatabaseHandler.java
+++ b/src/main/java/com/makinus/masterkey/db/service/impl/DatabaseHandler.java
@@ -1,9 +1,9 @@
-package com.makinus.db.service.impl;
+package com.makinus.masterkey.db.service.impl;
import java.util.ArrayList;
import java.util.List;
-import com.makinus.model.Card;
+import com.makinus.masterkey.model.Card;
import android.content.ContentValues;
import android.content.Context;
@@ -312,4 +312,12 @@ public boolean isValidMasterKey() {
public void setValidMasterKey(boolean flag) {
isValidMasterKey = true;
}
+
+ public void doBackup(Context context) {
+ BackupAndRestore.exportDB(context, DATABASE_NAME);
+ }
+
+ public void doRestore(Context context) {
+ BackupAndRestore.importDB(context, DATABASE_NAME);
+ }
}
diff --git a/src/com/makinus/model/Card.java b/src/main/java/com/makinus/masterkey/model/Card.java
similarity index 81%
rename from src/com/makinus/model/Card.java
rename to src/main/java/com/makinus/masterkey/model/Card.java
index ba963aa..3021ad4 100644
--- a/src/com/makinus/model/Card.java
+++ b/src/main/java/com/makinus/masterkey/model/Card.java
@@ -1,8 +1,11 @@
-package com.makinus.model;
+package com.makinus.masterkey.model;
+
+import android.support.annotation.NonNull;
import java.io.Serializable;
+import java.util.Comparator;
-public class Card implements Serializable{
+public class Card implements Serializable, Comparable{
/**
*
@@ -102,5 +105,13 @@ public Card setRemindMeDays(int remindMeDays) {
this.remindMeDays = remindMeDays;
return this;
}
-
+
+
+ @Override
+ public int compareTo(@NonNull Card another) {
+ if(another == null)
+ return 0;
+
+ return this.getAccount().compareTo(another.getAccount());
+ }
}
diff --git a/src/com/makinus/masterkey/service/MyScheduleReceiver.java b/src/main/java/com/makinus/masterkey/service/MyScheduleReceiver.java
similarity index 100%
rename from src/com/makinus/masterkey/service/MyScheduleReceiver.java
rename to src/main/java/com/makinus/masterkey/service/MyScheduleReceiver.java
diff --git a/src/com/makinus/masterkey/service/MyStartServiceReceiver.java b/src/main/java/com/makinus/masterkey/service/MyStartServiceReceiver.java
similarity index 100%
rename from src/com/makinus/masterkey/service/MyStartServiceReceiver.java
rename to src/main/java/com/makinus/masterkey/service/MyStartServiceReceiver.java
diff --git a/src/com/makinus/masterkey/service/NotifyService.java b/src/main/java/com/makinus/masterkey/service/NotifyService.java
similarity index 89%
rename from src/com/makinus/masterkey/service/NotifyService.java
rename to src/main/java/com/makinus/masterkey/service/NotifyService.java
index 68fa745..0cb507b 100644
--- a/src/com/makinus/masterkey/service/NotifyService.java
+++ b/src/main/java/com/makinus/masterkey/service/NotifyService.java
@@ -2,11 +2,11 @@
import java.util.List;
-import com.makinus.db.service.impl.DatabaseHandler;
+import com.makinus.masterkey.db.service.impl.DatabaseHandler;
import com.makinus.masterkey.MainActivity;
import com.makinus.masterkey.R;
import com.makinus.masterkey.utils.MasterKeyUtils;
-import com.makinus.model.Card;
+import com.makinus.masterkey.model.Card;
import android.app.NotificationManager;
import android.app.PendingIntent;
@@ -51,7 +51,7 @@ private void showNotification(String cardTitle) {
NotificationCompat.Builder builder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_launcher)
- .setContentTitle("MasterKey - Password Expired for "+cardTitle)
+ .setContentTitle(">MasterKey - Password Expired for "+cardTitle)
.setContentText("Your account "+cardTitle+ "'s password is expired.");
Intent notificationIntent = new Intent(this, MainActivity.class);
diff --git a/src/com/makinus/masterkey/utils/MasterKeyUtils.java b/src/main/java/com/makinus/masterkey/utils/MasterKeyUtils.java
similarity index 94%
rename from src/com/makinus/masterkey/utils/MasterKeyUtils.java
rename to src/main/java/com/makinus/masterkey/utils/MasterKeyUtils.java
index ceba371..575affe 100644
--- a/src/com/makinus/masterkey/utils/MasterKeyUtils.java
+++ b/src/main/java/com/makinus/masterkey/utils/MasterKeyUtils.java
@@ -18,8 +18,6 @@ public class MasterKeyUtils {
private StandardStringDigester digester;
private StandardPBEStringEncryptor encryptor;
- private static Random random = new Random();
-
private MasterKeyUtils(Context context) {
try{
Properties properties = new Properties();
@@ -74,6 +72,7 @@ public int getRGBColorCode(){
public int getHSBColorCode(){
//to get rainbow, pastel colors
float a[] = new float[3];
+ Random random = new Random();
a[0] = random.nextFloat();//hue
a[1] = 0.9f;//1.0 for brilliant, 0.0 for dull
a[2] = 1.0f; //1.0 for brighter, 0.0 for black
diff --git a/src/main/res/drawable-hdpi/circle.xml b/src/main/res/drawable-hdpi/circle.xml
new file mode 100644
index 0000000..8ae64eb
--- /dev/null
+++ b/src/main/res/drawable-hdpi/circle.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
diff --git a/src/main/res/drawable-hdpi/form_quare.xml b/src/main/res/drawable-hdpi/form_quare.xml
new file mode 100644
index 0000000..62d1e4e
--- /dev/null
+++ b/src/main/res/drawable-hdpi/form_quare.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
diff --git a/src/main/res/drawable-hdpi/ic_action_search.png b/src/main/res/drawable-hdpi/ic_action_search.png
new file mode 100644
index 0000000..1b9d714
Binary files /dev/null and b/src/main/res/drawable-hdpi/ic_action_search.png differ
diff --git a/src/main/res/drawable-hdpi/ic_action_sort.png b/src/main/res/drawable-hdpi/ic_action_sort.png
new file mode 100644
index 0000000..2470dbd
Binary files /dev/null and b/src/main/res/drawable-hdpi/ic_action_sort.png differ
diff --git a/src/main/res/drawable-hdpi/ic_action_visibility.png b/src/main/res/drawable-hdpi/ic_action_visibility.png
new file mode 100644
index 0000000..0198e3f
Binary files /dev/null and b/src/main/res/drawable-hdpi/ic_action_visibility.png differ
diff --git a/src/main/res/drawable-hdpi/ic_action_visibility_off.png b/src/main/res/drawable-hdpi/ic_action_visibility_off.png
new file mode 100644
index 0000000..681ac18
Binary files /dev/null and b/src/main/res/drawable-hdpi/ic_action_visibility_off.png differ
diff --git a/res/drawable-hdpi/ic_chevron_right.png b/src/main/res/drawable-hdpi/ic_chevron_right.png
similarity index 100%
rename from res/drawable-hdpi/ic_chevron_right.png
rename to src/main/res/drawable-hdpi/ic_chevron_right.png
diff --git a/res/drawable-hdpi/ic_launcher.png b/src/main/res/drawable-hdpi/ic_launcher.png
similarity index 100%
rename from res/drawable-hdpi/ic_launcher.png
rename to src/main/res/drawable-hdpi/ic_launcher.png
diff --git a/src/main/res/drawable-hdpi/ic_reminder_active.png b/src/main/res/drawable-hdpi/ic_reminder_active.png
new file mode 100644
index 0000000..600aa52
Binary files /dev/null and b/src/main/res/drawable-hdpi/ic_reminder_active.png differ
diff --git a/res/drawable-hdpi/ic_reminder_expired.png b/src/main/res/drawable-hdpi/ic_reminder_expired.png
similarity index 100%
rename from res/drawable-hdpi/ic_reminder_expired.png
rename to src/main/res/drawable-hdpi/ic_reminder_expired.png
diff --git a/res/drawable-hdpi/ic_reminder_inactive.png b/src/main/res/drawable-hdpi/ic_reminder_inactive.png
similarity index 100%
rename from res/drawable-hdpi/ic_reminder_inactive.png
rename to src/main/res/drawable-hdpi/ic_reminder_inactive.png
diff --git a/src/main/res/drawable-hdpi/ic_visibility.png b/src/main/res/drawable-hdpi/ic_visibility.png
new file mode 100644
index 0000000..4f377a2
Binary files /dev/null and b/src/main/res/drawable-hdpi/ic_visibility.png differ
diff --git a/res/drawable-hdpi/list_gradient_bg.xml b/src/main/res/drawable-hdpi/list_gradient_bg.xml
similarity index 100%
rename from res/drawable-hdpi/list_gradient_bg.xml
rename to src/main/res/drawable-hdpi/list_gradient_bg.xml
diff --git a/res/drawable-hdpi/list_gradient_bg_hover.xml b/src/main/res/drawable-hdpi/list_gradient_bg_hover.xml
similarity index 100%
rename from res/drawable-hdpi/list_gradient_bg_hover.xml
rename to src/main/res/drawable-hdpi/list_gradient_bg_hover.xml
diff --git a/src/main/res/drawable-hdpi/list_selector.xml b/src/main/res/drawable-hdpi/list_selector.xml
new file mode 100644
index 0000000..446704f
--- /dev/null
+++ b/src/main/res/drawable-hdpi/list_selector.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
diff --git a/res/drawable-hdpi/rounded_textview.xml b/src/main/res/drawable-hdpi/rounded_textview.xml
similarity index 100%
rename from res/drawable-hdpi/rounded_textview.xml
rename to src/main/res/drawable-hdpi/rounded_textview.xml
diff --git a/src/main/res/drawable-ldpi/ic_action_search.png b/src/main/res/drawable-ldpi/ic_action_search.png
new file mode 100644
index 0000000..aac8b93
Binary files /dev/null and b/src/main/res/drawable-ldpi/ic_action_search.png differ
diff --git a/src/main/res/drawable-ldpi/ic_action_sort.png b/src/main/res/drawable-ldpi/ic_action_sort.png
new file mode 100644
index 0000000..b4bdce9
Binary files /dev/null and b/src/main/res/drawable-ldpi/ic_action_sort.png differ
diff --git a/src/main/res/drawable-ldpi/ic_action_visibility.png b/src/main/res/drawable-ldpi/ic_action_visibility.png
new file mode 100644
index 0000000..fe5548f
Binary files /dev/null and b/src/main/res/drawable-ldpi/ic_action_visibility.png differ
diff --git a/src/main/res/drawable-ldpi/ic_action_visibility_off.png b/src/main/res/drawable-ldpi/ic_action_visibility_off.png
new file mode 100644
index 0000000..e8ebd0f
Binary files /dev/null and b/src/main/res/drawable-ldpi/ic_action_visibility_off.png differ
diff --git a/res/drawable-ldpi/ic_chevron_right.png b/src/main/res/drawable-ldpi/ic_chevron_right.png
similarity index 100%
rename from res/drawable-ldpi/ic_chevron_right.png
rename to src/main/res/drawable-ldpi/ic_chevron_right.png
diff --git a/res/drawable-ldpi/ic_launcher.png b/src/main/res/drawable-ldpi/ic_launcher.png
similarity index 100%
rename from res/drawable-ldpi/ic_launcher.png
rename to src/main/res/drawable-ldpi/ic_launcher.png
diff --git a/src/main/res/drawable-ldpi/ic_reminder_active.png b/src/main/res/drawable-ldpi/ic_reminder_active.png
new file mode 100644
index 0000000..801e45c
Binary files /dev/null and b/src/main/res/drawable-ldpi/ic_reminder_active.png differ
diff --git a/res/drawable-ldpi/ic_reminder_expired.png b/src/main/res/drawable-ldpi/ic_reminder_expired.png
similarity index 100%
rename from res/drawable-ldpi/ic_reminder_expired.png
rename to src/main/res/drawable-ldpi/ic_reminder_expired.png
diff --git a/res/drawable-ldpi/ic_reminder_inactive.png b/src/main/res/drawable-ldpi/ic_reminder_inactive.png
similarity index 100%
rename from res/drawable-ldpi/ic_reminder_inactive.png
rename to src/main/res/drawable-ldpi/ic_reminder_inactive.png
diff --git a/src/main/res/drawable-ldpi/ic_visibility.png b/src/main/res/drawable-ldpi/ic_visibility.png
new file mode 100644
index 0000000..3069551
Binary files /dev/null and b/src/main/res/drawable-ldpi/ic_visibility.png differ
diff --git a/src/main/res/drawable-mdpi/ic_action_search.png b/src/main/res/drawable-mdpi/ic_action_search.png
new file mode 100644
index 0000000..aac8b93
Binary files /dev/null and b/src/main/res/drawable-mdpi/ic_action_search.png differ
diff --git a/src/main/res/drawable-mdpi/ic_action_visibility.png b/src/main/res/drawable-mdpi/ic_action_visibility.png
new file mode 100644
index 0000000..fe5548f
Binary files /dev/null and b/src/main/res/drawable-mdpi/ic_action_visibility.png differ
diff --git a/src/main/res/drawable-mdpi/ic_action_visibility_off.png b/src/main/res/drawable-mdpi/ic_action_visibility_off.png
new file mode 100644
index 0000000..e8ebd0f
Binary files /dev/null and b/src/main/res/drawable-mdpi/ic_action_visibility_off.png differ
diff --git a/res/drawable-mdpi/ic_chevron_right.png b/src/main/res/drawable-mdpi/ic_chevron_right.png
similarity index 100%
rename from res/drawable-mdpi/ic_chevron_right.png
rename to src/main/res/drawable-mdpi/ic_chevron_right.png
diff --git a/res/drawable-mdpi/ic_launcher.png b/src/main/res/drawable-mdpi/ic_launcher.png
similarity index 100%
rename from res/drawable-mdpi/ic_launcher.png
rename to src/main/res/drawable-mdpi/ic_launcher.png
diff --git a/src/main/res/drawable-mdpi/ic_reminder_active.png b/src/main/res/drawable-mdpi/ic_reminder_active.png
new file mode 100644
index 0000000..801e45c
Binary files /dev/null and b/src/main/res/drawable-mdpi/ic_reminder_active.png differ
diff --git a/res/drawable-mdpi/ic_reminder_expired.png b/src/main/res/drawable-mdpi/ic_reminder_expired.png
similarity index 100%
rename from res/drawable-mdpi/ic_reminder_expired.png
rename to src/main/res/drawable-mdpi/ic_reminder_expired.png
diff --git a/res/drawable-mdpi/ic_reminder_inactive.png b/src/main/res/drawable-mdpi/ic_reminder_inactive.png
similarity index 100%
rename from res/drawable-mdpi/ic_reminder_inactive.png
rename to src/main/res/drawable-mdpi/ic_reminder_inactive.png
diff --git a/src/main/res/drawable-mdpi/ic_visibility.png b/src/main/res/drawable-mdpi/ic_visibility.png
new file mode 100644
index 0000000..3069551
Binary files /dev/null and b/src/main/res/drawable-mdpi/ic_visibility.png differ
diff --git a/src/main/res/drawable-xhdpi/ic_action_search.png b/src/main/res/drawable-xhdpi/ic_action_search.png
new file mode 100644
index 0000000..3050d11
Binary files /dev/null and b/src/main/res/drawable-xhdpi/ic_action_search.png differ
diff --git a/src/main/res/drawable-xhdpi/ic_action_sort.png b/src/main/res/drawable-xhdpi/ic_action_sort.png
new file mode 100644
index 0000000..ae9092a
Binary files /dev/null and b/src/main/res/drawable-xhdpi/ic_action_sort.png differ
diff --git a/src/main/res/drawable-xhdpi/ic_action_visibility.png b/src/main/res/drawable-xhdpi/ic_action_visibility.png
new file mode 100644
index 0000000..23ced02
Binary files /dev/null and b/src/main/res/drawable-xhdpi/ic_action_visibility.png differ
diff --git a/src/main/res/drawable-xhdpi/ic_action_visibility_off.png b/src/main/res/drawable-xhdpi/ic_action_visibility_off.png
new file mode 100644
index 0000000..78b0c98
Binary files /dev/null and b/src/main/res/drawable-xhdpi/ic_action_visibility_off.png differ
diff --git a/res/drawable-xhdpi/ic_chevron_right.png b/src/main/res/drawable-xhdpi/ic_chevron_right.png
similarity index 100%
rename from res/drawable-xhdpi/ic_chevron_right.png
rename to src/main/res/drawable-xhdpi/ic_chevron_right.png
diff --git a/res/drawable-xhdpi/ic_launcher.png b/src/main/res/drawable-xhdpi/ic_launcher.png
similarity index 100%
rename from res/drawable-xhdpi/ic_launcher.png
rename to src/main/res/drawable-xhdpi/ic_launcher.png
diff --git a/src/main/res/drawable-xhdpi/ic_reminder_active.png b/src/main/res/drawable-xhdpi/ic_reminder_active.png
new file mode 100644
index 0000000..6f309bc
Binary files /dev/null and b/src/main/res/drawable-xhdpi/ic_reminder_active.png differ
diff --git a/res/drawable-xhdpi/ic_reminder_expired.png b/src/main/res/drawable-xhdpi/ic_reminder_expired.png
similarity index 100%
rename from res/drawable-xhdpi/ic_reminder_expired.png
rename to src/main/res/drawable-xhdpi/ic_reminder_expired.png
diff --git a/res/drawable-xhdpi/ic_reminder_inactive.png b/src/main/res/drawable-xhdpi/ic_reminder_inactive.png
similarity index 100%
rename from res/drawable-xhdpi/ic_reminder_inactive.png
rename to src/main/res/drawable-xhdpi/ic_reminder_inactive.png
diff --git a/src/main/res/drawable-xhdpi/ic_visibility.png b/src/main/res/drawable-xhdpi/ic_visibility.png
new file mode 100644
index 0000000..d938564
Binary files /dev/null and b/src/main/res/drawable-xhdpi/ic_visibility.png differ
diff --git a/src/main/res/drawable/ic_action_search.png b/src/main/res/drawable/ic_action_search.png
new file mode 100644
index 0000000..1b9d714
Binary files /dev/null and b/src/main/res/drawable/ic_action_search.png differ
diff --git a/src/main/res/drawable/ic_action_sort.png b/src/main/res/drawable/ic_action_sort.png
new file mode 100644
index 0000000..2470dbd
Binary files /dev/null and b/src/main/res/drawable/ic_action_sort.png differ
diff --git a/src/main/res/drawable/ic_action_visibility.png b/src/main/res/drawable/ic_action_visibility.png
new file mode 100644
index 0000000..0198e3f
Binary files /dev/null and b/src/main/res/drawable/ic_action_visibility.png differ
diff --git a/src/main/res/drawable/ic_action_visibility_off.png b/src/main/res/drawable/ic_action_visibility_off.png
new file mode 100644
index 0000000..681ac18
Binary files /dev/null and b/src/main/res/drawable/ic_action_visibility_off.png differ
diff --git a/src/main/res/drawable/ic_chevron_right.png b/src/main/res/drawable/ic_chevron_right.png
new file mode 100644
index 0000000..ca7289a
Binary files /dev/null and b/src/main/res/drawable/ic_chevron_right.png differ
diff --git a/src/main/res/drawable/ic_launcher.png b/src/main/res/drawable/ic_launcher.png
new file mode 100644
index 0000000..5a00145
Binary files /dev/null and b/src/main/res/drawable/ic_launcher.png differ
diff --git a/src/main/res/drawable/ic_reminder_active.png b/src/main/res/drawable/ic_reminder_active.png
new file mode 100644
index 0000000..600aa52
Binary files /dev/null and b/src/main/res/drawable/ic_reminder_active.png differ
diff --git a/src/main/res/drawable/ic_reminder_expired.png b/src/main/res/drawable/ic_reminder_expired.png
new file mode 100644
index 0000000..e867683
Binary files /dev/null and b/src/main/res/drawable/ic_reminder_expired.png differ
diff --git a/src/main/res/drawable/ic_reminder_inactive.png b/src/main/res/drawable/ic_reminder_inactive.png
new file mode 100644
index 0000000..f6f1fcf
Binary files /dev/null and b/src/main/res/drawable/ic_reminder_inactive.png differ
diff --git a/src/main/res/drawable/ic_visibility.png b/src/main/res/drawable/ic_visibility.png
new file mode 100644
index 0000000..4f377a2
Binary files /dev/null and b/src/main/res/drawable/ic_visibility.png differ
diff --git a/res/layout/activity_change_masterkey.xml b/src/main/res/layout/activity_change_masterkey.xml
similarity index 80%
rename from res/layout/activity_change_masterkey.xml
rename to src/main/res/layout/activity_change_masterkey.xml
index cef3410..64302c6 100644
--- a/res/layout/activity_change_masterkey.xml
+++ b/src/main/res/layout/activity_change_masterkey.xml
@@ -1,8 +1,17 @@
-
+ android:layout_height="match_parent"
+ android:background="@drawable/form_quare"
+ android:orientation="vertical" >
+
+
+
-
-
-
\ No newline at end of file
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/res/layout/activity_editcard.xml b/src/main/res/layout/activity_editcard.xml
similarity index 95%
rename from res/layout/activity_editcard.xml
rename to src/main/res/layout/activity_editcard.xml
index 4de4620..c7cc869 100644
--- a/res/layout/activity_editcard.xml
+++ b/src/main/res/layout/activity_editcard.xml
@@ -2,13 +2,14 @@
+ android:layout_margin="1dp"
+ android:padding="10dp">
+ android:layout_margin="1dp"
+ android:padding="10dp"
+ android:layout_gravity="center_vertical" >
-
+ android:layout_height="match_parent"
+ android:background="@drawable/form_quare"
+ android:orientation="vertical" >
+
+
-
-
-
-
\ No newline at end of file
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/res/layout/activity_main.xml b/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..61d5317
--- /dev/null
+++ b/src/main/res/layout/activity_main.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/res/layout/activity_masterdialog.xml b/src/main/res/layout/activity_masterdialog.xml
similarity index 83%
rename from res/layout/activity_masterdialog.xml
rename to src/main/res/layout/activity_masterdialog.xml
index a6afc68..2f632b2 100644
--- a/res/layout/activity_masterdialog.xml
+++ b/src/main/res/layout/activity_masterdialog.xml
@@ -3,14 +3,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/form_quare"
- android:layout_margin="10dp" >
+ android:padding="5dp" >
@@ -22,15 +22,15 @@
android:layout_alignParentStart="true"
android:layout_below="@+id/lblMasterKey"
android:digits="abcdefghijklmnopqrstuvwxyz1234567890"
- android:inputType="textVisiblePassword" >
+ android:inputType="textPassword" >
-
-
\ No newline at end of file
diff --git a/res/layout/activity_menu.xml b/src/main/res/layout/activity_menu.xml
similarity index 91%
rename from res/layout/activity_menu.xml
rename to src/main/res/layout/activity_menu.xml
index f645e09..d5c88ba 100644
--- a/res/layout/activity_menu.xml
+++ b/src/main/res/layout/activity_menu.xml
@@ -1,13 +1,14 @@
+ android:layout_height="match_parent"
+ android:background="@drawable/form_quare">
+ android:padding="5dp" >