Change style and add toolbar

This commit is contained in:
Jeremy
2017-10-27 23:49:21 +02:00
parent 0a6e9f53e7
commit 73a3bafc57
39 changed files with 423 additions and 323 deletions

View File

@@ -106,7 +106,6 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-support" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/reload-dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/restart-dex" />
@@ -121,9 +120,23 @@
</content>
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" scope="TEST" name="__local_jars__:/home/joker/Projects/keepassdroid/app/libs/junit4.jar:unspecified@jar" level="project" />
<orderEntry type="library" exported="" name="com.madgag.spongycastle:core:1.54.0.0@jar" level="project" />
<orderEntry type="library" exported="" name="com.android.support:animated-vector-drawable-25.4.0" level="project" />
<orderEntry type="library" exported="" name="com.android.support:design-25.4.0" level="project" />
<orderEntry type="library" exported="" name="com.android.support:transition-25.4.0" level="project" />
<orderEntry type="library" exported="" name="com.android.support:support-core-ui-25.4.0" level="project" />
<orderEntry type="library" exported="" name="com.android.support:appcompat-v7-25.4.0" level="project" />
<orderEntry type="library" exported="" name="com.android.support:support-compat-25.4.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="__local_jars__:/home/joker/Projects/keepassdroid/app/libs/junit4.jar:unspecified@jar" level="project" />
<orderEntry type="library" exported="" name="com.android.support:preference-v7-25.4.0" level="project" />
<orderEntry type="library" exported="" name="joda-time:joda-time:2.9.9@jar" level="project" />
<orderEntry type="library" exported="" name="com.madgag.spongycastle:prov:1.54.0.0@jar" level="project" />
<orderEntry type="library" exported="" name="joda-time:joda-time:2.9.4@jar" level="project" />
<orderEntry type="library" exported="" name="com.android.support:support-annotations:25.4.0@jar" level="project" />
<orderEntry type="library" exported="" name="com.android.support:support-core-utils-25.4.0" level="project" />
<orderEntry type="library" exported="" name="com.android.support:support-v4-25.4.0" level="project" />
<orderEntry type="library" exported="" name="com.android.support:support-vector-drawable-25.4.0" level="project" />
<orderEntry type="library" exported="" name="com.android.support:support-fragment-25.4.0" level="project" />
<orderEntry type="library" exported="" name="com.android.support:recyclerview-v7-25.4.0" level="project" />
<orderEntry type="library" exported="" name="com.android.support:support-media-compat-25.4.0" level="project" />
</component>
</module>

View File

@@ -6,8 +6,8 @@ android {
defaultConfig {
applicationId = "com.android.keepass"
minSdkVersion 3
targetSdkVersion 12
minSdkVersion 11
targetSdkVersion 25
versionCode = 154
versionName = "2.5.0.0"
@@ -30,9 +30,15 @@ android {
}
}
def supportVersion = "25.4.0"
def spongycastleVersion = "1.54.0.0"
dependencies {
androidTestCompile files('libs/junit4.jar')
compile 'com.madgag.spongycastle:core:1.54.0.0'
compile 'com.madgag.spongycastle:prov:1.54.0.0'
compile 'joda-time:joda-time:2.9.4'
compile "com.android.support:appcompat-v7:$supportVersion"
compile "com.android.support:design:$supportVersion"
compile "com.android.support:preference-v7:$supportVersion"
compile "com.madgag.spongycastle:core:$spongycastleVersion"
compile "com.madgag.spongycastle:prov:$spongycastleVersion"
compile "joda-time:joda-time:2.9.9"
}

View File

@@ -49,8 +49,6 @@ public class GroupEditActivity extends Activity
super.onCreate(savedInstanceState);
setContentView(R.layout.group_edit);
setTitle(R.string.add_group_title);
Util.colorStatusBar(this);
ImageButton iconButton = (ImageButton) findViewById(R.id.icon_button);
iconButton.setOnClickListener(new View.OnClickListener()

View File

@@ -19,12 +19,12 @@
*/
package com.keepassdroid;
import android.app.Activity;
import android.support.v7.app.AppCompatActivity;
import com.keepassdroid.timeout.TimeoutHelper;
import com.keepassdroid.utils.Util;
public abstract class LockingActivity extends Activity {
public abstract class LockingActivity extends AppCompatActivity {
@Override
protected void onPause() {
@@ -37,8 +37,6 @@ public abstract class LockingActivity extends Activity {
protected void onResume() {
super.onResume();
Util.colorStatusBar(this);
TimeoutHelper.resume(this);
}
}

View File

@@ -1,32 +0,0 @@
/*
* Copyright 2017 Brian Pellin, Jeremy Jamet / Kunzisoft.
*
* This file is part of KeePass DX.
*
* KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* KeePass DX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.keepassdroid;
import com.keepassdroid.timeout.TimeoutHelper;
public class LockingClosePreferenceActivity extends LockingPreferenceActivity {
@Override
protected void onResume() {
super.onResume();
TimeoutHelper.checkShutdown(this);
}
}

View File

@@ -1,44 +0,0 @@
/*
* Copyright 2017 Brian Pellin, Jeremy Jamet / Kunzisoft.
*
* This file is part of KeePass DX.
*
* KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* KeePass DX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.keepassdroid;
import android.preference.PreferenceActivity;
import com.keepassdroid.timeout.TimeoutHelper;
import com.keepassdroid.utils.Util;
public abstract class LockingPreferenceActivity extends PreferenceActivity {
@Override
protected void onPause() {
super.onPause();
TimeoutHelper.pause(this);
}
@Override
protected void onResume() {
super.onResume();
Util.colorStatusBar(this);
TimeoutHelper.resume(this);
}
}

View File

@@ -30,6 +30,7 @@ import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.preference.PreferenceManager;
import android.support.v7.widget.Toolbar;
import android.text.InputType;
import android.view.Menu;
import android.view.MenuInflater;
@@ -171,6 +172,13 @@ public class PasswordActivity extends LockingActivity {
mRememberKeyfile = prefs.getBoolean(getString(R.string.keyfile_key), getResources().getBoolean(R.bool.keyfile_default));
setContentView(R.layout.password);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle(getString(R.string.app_name));
setSupportActionBar(toolbar);
assert getSupportActionBar() != null;
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
new InitTask().execute(i);
}
@@ -310,14 +318,18 @@ public class PasswordActivity extends LockingActivity {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch ( item.getItemId() ) {
case R.id.menu_about:
AboutDialog dialog = new AboutDialog(this);
dialog.show();
return true;
case R.id.menu_about:
AboutDialog dialog = new AboutDialog(this);
dialog.show();
return true;
case R.id.menu_app_settings:
AppSettingsActivity.Launch(this);
return true;
case R.id.menu_app_settings:
AppSettingsActivity.Launch(this);
return true;
case android.R.id.home:
finish();
break;
}
return super.onOptionsItemSelected(item);
@@ -446,7 +458,7 @@ public class PasswordActivity extends LockingActivity {
CheckBox defaultCheck = (CheckBox) findViewById(R.id.default_database);
defaultCheck.setOnCheckedChangeListener(new DefaultCheckChange());
ImageButton browse = (ImageButton) findViewById(R.id.browse_button);
View browse = findViewById(R.id.browse_button);
browse.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {

View File

@@ -19,7 +19,6 @@
*/
package com.keepassdroid.fileselect;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.ContentResolver;
import android.content.Intent;
@@ -29,6 +28,8 @@ import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Environment;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.Menu;
@@ -72,7 +73,7 @@ import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URLDecoder;
public class FileSelectActivity extends Activity {
public class FileSelectActivity extends AppCompatActivity {
private ListView mList;
private ListAdapter mAdapter;
@@ -90,8 +91,6 @@ public class FileSelectActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Util.colorStatusBar(this);
fileHistory = App.getFileHistory();
@@ -102,6 +101,10 @@ public class FileSelectActivity extends Activity {
setContentView(R.layout.file_selection_no_recent);
}
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle(getString(R.string.app_name));
setSupportActionBar(toolbar);
mList = (ListView)findViewById(R.id.file_list);
mList.setOnItemClickListener(
@@ -208,7 +211,7 @@ public class FileSelectActivity extends Activity {
});
ImageButton browseButton = (ImageButton) findViewById(R.id.browse_button);
View browseButton = findViewById(R.id.browse_button);
browseButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {

View File

@@ -21,23 +21,36 @@ package com.keepassdroid.settings;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import com.android.keepass.R;
import com.keepassdroid.Database;
import com.keepassdroid.LockingClosePreferenceActivity;
import com.keepassdroid.app.App;
import com.keepassdroid.compat.BackupManagerCompat;
import com.keepassdroid.database.PwEncryptionAlgorithm;
import com.keepassdroid.timeout.TimeoutHelper;
public class AppSettingsActivity extends LockingClosePreferenceActivity {
public class AppSettingsActivity extends AppCompatActivity {
public static boolean KEYFILE_DEFAULT = false;
private BackupManagerCompat backupManager;
private Toolbar toolbar;
@Override
protected void onPause() {
super.onPause();
TimeoutHelper.pause(this);
}
@Override
protected void onResume() {
super.onResume();
TimeoutHelper.resume(this);
TimeoutHelper.checkShutdown(this);
}
public static void Launch(Context ctx) {
Intent i = new Intent(ctx, AppSettingsActivity.class);
@@ -48,65 +61,32 @@ public class AppSettingsActivity extends LockingClosePreferenceActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preferences);
Preference keyFile = findPreference(getString(R.string.keyfile_key));
keyFile.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
public boolean onPreferenceChange(Preference preference, Object newValue) {
Boolean value = (Boolean) newValue;
if ( ! value.booleanValue() ) {
App.getFileHistory().deleteAllKeys();
}
return true;
}
});
Preference recentHistory = findPreference(getString(R.string.recentfile_key));
recentHistory.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
public boolean onPreferenceChange(Preference preference, Object newValue) {
Boolean value = (Boolean) newValue;
if (value == null) {
value = true;
}
if (!value) {
App.getFileHistory().deleteAll();
}
return true;
}
});
Database db = App.getDB();
if ( db.Loaded() && db.pm.appSettingsEnabled() ) {
Preference rounds = findPreference(getString(R.string.rounds_key));
rounds.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
public boolean onPreferenceChange(Preference preference, Object newValue) {
setRounds(App.getDB(), preference);
return true;
}
});
setRounds(db, rounds);
Preference algorithm = findPreference(getString(R.string.algorithm_key));
setAlgorithm(db, algorithm);
} else {
Preference dbSettings = findPreference(getString(R.string.db_key));
dbSettings.setEnabled(false);
}
setContentView(R.layout.activity_toolbar);
toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle(R.string.application_settings);
setSupportActionBar(toolbar);
assert getSupportActionBar() != null;
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getFragmentManager().beginTransaction()
.replace(R.id.fragment_container, new AppSettingsFragment()).commit();
backupManager = new BackupManagerCompat(this);
// TODO NESTED Preference
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch ( item.getItemId() ) {
case android.R.id.home:
finish();
break;
}
return super.onOptionsItemSelected(item);
}
@Override
protected void onStop() {
@@ -115,21 +95,4 @@ public class AppSettingsActivity extends LockingClosePreferenceActivity {
super.onStop();
}
private void setRounds(Database db, Preference rounds) {
rounds.setSummary(Long.toString(db.pm.getNumRounds()));
}
private void setAlgorithm(Database db, Preference algorithm) {
int resId;
if ( db.pm.getEncAlgorithm() == PwEncryptionAlgorithm.Rjindal ) {
resId = R.string.rijndael;
} else {
resId = R.string.twofish;
}
algorithm.setSummary(resId);
}
}

View File

@@ -0,0 +1,107 @@
/*
* Copyright 2017 Jeremy Jamet / Kunzisoft.
*
* This file is part of KeePass DX.
*
* KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* KeePass DX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.keepassdroid.settings;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceFragment;
import com.android.keepass.R;
import com.keepassdroid.Database;
import com.keepassdroid.app.App;
import com.keepassdroid.database.PwEncryptionAlgorithm;
public class AppSettingsFragment extends PreferenceFragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preferences);
Preference keyFile = findPreference(getString(R.string.keyfile_key));
keyFile.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
public boolean onPreferenceChange(Preference preference, Object newValue) {
Boolean value = (Boolean) newValue;
if (!value) {
App.getFileHistory().deleteAllKeys();
}
return true;
}
});
Preference recentHistory = findPreference(getString(R.string.recentfile_key));
recentHistory.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
public boolean onPreferenceChange(Preference preference, Object newValue) {
Boolean value = (Boolean) newValue;
if (value == null) {
value = true;
}
if (!value) {
App.getFileHistory().deleteAll();
}
return true;
}
});
Database db = App.getDB();
if (db.Loaded() && db.pm.appSettingsEnabled()) {
Preference rounds = findPreference(getString(R.string.rounds_key));
rounds.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
public boolean onPreferenceChange(Preference preference, Object newValue) {
setRounds(App.getDB(), preference);
return true;
}
});
setRounds(db, rounds);
Preference algorithm = findPreference(getString(R.string.algorithm_key));
setAlgorithm(db, algorithm);
} else {
Preference dbSettings = findPreference(getString(R.string.db_key));
dbSettings.setEnabled(false);
}
}
private void setRounds(Database db, Preference rounds) {
rounds.setSummary(Long.toString(db.pm.getNumRounds()));
}
private void setAlgorithm(Database db, Preference algorithm) {
int resId;
if ( db.pm.getEncAlgorithm() == PwEncryptionAlgorithm.Rjindal ) {
resId = R.string.rijndael;
} else {
resId = R.string.twofish;
}
algorithm.setSummary(resId);
}
}

View File

@@ -96,13 +96,4 @@ public class Util {
}
}
public static void colorStatusBar(Activity activity) {
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = activity.getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.setStatusBarColor(activity.getResources().getColor(R.color.green_dark));
}
}
}

View File

@@ -22,7 +22,7 @@
android:right="14dp"
android:top="8dp"
android:bottom="12dp"/>
<solid android:color="@color/green"/>
<solid android:color="@color/colorPrimary"/>
</shape>
</item>
</layer-list>

View File

@@ -22,7 +22,7 @@
android:right="14dp"
android:top="4dp"
android:bottom="8dp"/>
<solid android:color="@color/green"/>
<solid android:color="@color/colorPrimary"/>
</shape>
</item>
</layer-list>

View File

@@ -8,7 +8,7 @@
android:right="14dp"
android:top="14dp"
android:bottom="14dp"/>
<solid android:color="@color/green"/>
<solid android:color="@color/colorPrimary"/>
</shape>
</item>
</ripple>

View File

@@ -17,7 +17,7 @@
android:right="14dp"
android:top="8dp"
android:bottom="12dp"/>
<solid android:color="@color/green"/>
<solid android:color="@color/colorPrimary"/>
</shape>
</item>
</layer-list>

View File

@@ -17,7 +17,7 @@
android:right="14dp"
android:top="4dp"
android:bottom="8dp"/>
<solid android:color="@color/green"/>
<solid android:color="@color/colorPrimary"/>
</shape>
</item>
</layer-list>

View File

@@ -5,5 +5,5 @@
android:right="14dp"
android:top="14dp"
android:bottom="14dp"/>
<solid android:color="@color/green"/>
<solid android:color="@color/colorPrimary"/>
</shape>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar_default" />
<FrameLayout
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>

View File

@@ -33,6 +33,7 @@
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_toRightOf="@id/entry_save"
android:layout_toEndOf="@id/entry_save"
android:text="@string/entry_cancel"/>
<View android:id="@+id/entry_divider"
android:layout_above="@id/entry_save"
@@ -55,11 +56,13 @@
android:layout_height="wrap_content"
android:src="@drawable/ic00"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_below="@id/entry_title_label"/>
<EditText android:id="@+id/entry_title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/icon_button"
android:layout_toStartOf="@+id/icon_button"
android:maxLines="1"
android:layout_below="@id/entry_title_label"
android:hint="@string/hint_title"/>
@@ -115,13 +118,15 @@
android:layout_width="wrap_content"
android:text="@string/ellipsis"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"/>
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"/>
<EditText android:id="@+id/entry_password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:maxLines="1"
android:layout_toLeftOf="@id/generate_button"
android:layout_toStartOf="@id/generate_button"
android:hint="@string/hint_pass"
android:layout_alignTop="@id/generate_button"/>
<View android:id="@+id/divider_password"

View File

@@ -27,34 +27,31 @@
android:maxLines="1"
android:inputType="text"
android:hint="@string/field_name"
style="@style/TinyTextStyle"
/>
style="@style/TinyTextStyle" />
<CheckBox android:id="@+id/protection"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/title"
android:text="@string/protection"
/>
android:text="@string/protection" />
<ImageView android:id="@+id/delete"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_below="@id/title"
android:src="@drawable/ic_close_white_24dp"
android:scaleType="centerCrop"
android:onClick="deleteAdvancedString"
/>
android:onClick="deleteAdvancedString" />
<EditText android:id="@+id/value"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/delete"
android:inputType="textMultiLine"
android:hint="@string/field_value"
/>
android:hint="@string/field_value" />
<ImageView android:id="@+id/divider_comment"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/value"
android:scaleType="fitXY"
android:src="@android:drawable/divider_horizontal_dark"/>
android:src="@android:drawable/divider_horizontal_dark" />
</com.keepassdroid.view.EntryEditSection>

View File

@@ -29,16 +29,16 @@
android:padding="2dp"
style="@style/DefaultTextStyle">
<TextView android:id="@+id/entry_title"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="left|center_vertical"
android:layout_gravity="start|center_vertical"
android:layout_weight="1"
android:minHeight="32dp"
style="@style/DefaultTextStyle"/>
<ImageView android:id="@+id/entry_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|center_vertical"
android:layout_gravity="end|center_vertical"
android:scaleType="fitXY"
android:src="@drawable/ic99_blank"
style="@style/DefaultTextStyle"/>
@@ -48,6 +48,7 @@
android:layout_width="100sp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"/>
<ImageView android:id="@+id/entry_divider2"
android:layout_width="fill_parent"

View File

@@ -31,16 +31,16 @@
android:padding="2dp"
style="@style/DefaultTextStyle">
<TextView android:id="@+id/entry_title"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="left|center_vertical"
android:layout_gravity="start|center_vertical"
android:layout_weight="1"
android:minHeight="32dp"
style="@style/DefaultTextStyle"/>
<ImageView android:id="@+id/entry_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|center_vertical"
android:layout_gravity="end|center_vertical"
android:scaleType="fitXY"
android:src="@drawable/ic99_blank"
style="@style/DefaultTextStyle"/>
@@ -50,6 +50,7 @@
android:layout_width="100sp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"/>
<ImageView android:id="@+id/entry_divider2"
android:layout_width="fill_parent"

View File

@@ -21,14 +21,19 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar_default" />
<com.keepassdroid.view.FileNameView android:id="@+id/file_select"
android:layout_marginBottom="@dimen/default_margin"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/file_listtop"
android:layout_marginTop="@dimen/default_margin"
android:layout_marginLeft="@dimen/default_margin"
android:layout_marginStart="@dimen/default_margin"
android:layout_marginRight="@dimen/default_margin"
android:layout_marginEnd="@dimen/default_margin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/TitleTextStyle"

View File

@@ -34,12 +34,17 @@
style="@style/TitleTextStyle"
android:text="@string/enter_filename"/>
<ImageButton android:id="@+id/browse_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_folder_white_24dp"
android:layout_alignParentEnd="true"
android:layout_below="@id/label_open_by_filename" />
<android.support.v7.widget.AppCompatImageView
android:id="@+id/browse_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/file_filename"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_below="@id/label_open_by_filename"
android:padding="6dp"
android:src="@drawable/ic_folder_white_24dp"
android:tint="?attr/colorAccentCompat" />
<EditText
android:id="@+id/file_filename"
@@ -47,6 +52,7 @@
android:layout_height="wrap_content"
android:layout_below="@id/label_open_by_filename"
android:inputType="textUri"
android:layout_toLeftOf="@+id/browse_button"
android:layout_toStartOf="@+id/browse_button"
android:maxLines="1" />
@@ -56,6 +62,7 @@
android:layout_below="@id/file_filename"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_toLeftOf="@+id/create"
android:layout_toStartOf="@+id/create"
android:width="100sp"/>
@@ -65,6 +72,7 @@
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_below="@id/file_filename"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:width="100sp"/>
</RelativeLayout>

View File

@@ -33,7 +33,8 @@
android:layout_width="wrap_content"
android:text="@string/cancel"
android:layout_alignParentBottom="true"
android:layout_toRightOf="@id/accept_button" />
android:layout_toRightOf="@id/accept_button"
android:layout_toEndOf="@id/accept_button" />
<ScrollView android:id="@+id/ScrollView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -61,6 +62,7 @@
<Button android:id="@+id/btn_length16"
android:text="@string/generate_16"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:minWidth="60dp"
@@ -68,6 +70,7 @@
<Button android:id="@+id/btn_length12"
android:text="@string/generate_12"
android:layout_toLeftOf="@id/btn_length16"
android:layout_toStartOf="@id/btn_length16"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:minWidth="60dp"
@@ -75,6 +78,7 @@
<Button android:id="@+id/btn_length8"
android:text="@string/generate_8"
android:layout_toLeftOf="@id/btn_length12"
android:layout_toStartOf="@id/btn_length12"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:minWidth="60dp"
@@ -82,6 +86,7 @@
<Button android:id="@+id/btn_length6"
android:text="@string/generate_6"
android:layout_toLeftOf="@id/btn_length8"
android:layout_toStartOf="@id/btn_length8"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:minWidth="60dp"
@@ -89,6 +94,7 @@
<EditText android:id="@+id/length"
android:layout_width="fill_parent"
android:layout_toLeftOf="@id/btn_length6"
android:layout_toStartOf="@id/btn_length6"
android:layout_height="wrap_content"
android:layout_alignTop="@id/btn_length16"
android:maxLines="1"

View File

@@ -36,13 +36,16 @@
android:src="@drawable/ic_add_white_24dp"
android:layout_margin="24dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:background="@drawable/fab_background"
android:elevation="4dp"
tools:ignore="UnusedAttribute" />
<TextView android:id="@+id/add_entry"
android:layout_marginRight="12dp"
android:layout_marginEnd="12dp"
android:layout_above="@+id/add_button"
android:layout_alignRight="@+id/add_button"
android:layout_alignEnd="@+id/add_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -53,7 +56,9 @@
<TextView android:id="@+id/add_group"
android:layout_marginBottom="24dp"
android:layout_marginRight="12dp"
android:layout_marginEnd="12dp"
android:layout_above="@+id/add_entry"
android:layout_alignRight="@+id/add_button"
android:layout_alignEnd="@+id/add_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

View File

@@ -26,12 +26,15 @@
android:layout_height="wrap_content"
android:src="@drawable/ic00"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"/>
<EditText android:id="@+id/group_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:layout_toLeftOf="@+id/icon_button"
android:layout_toStartOf="@+id/icon_button"
android:maxLines="1"
android:hint="@string/hint_group_name"/>
<Button android:id="@+id/ok"
@@ -48,5 +51,6 @@
android:minWidth="100dp"
android:layout_below="@id/group_name"
android:layout_toRightOf="@id/ok"
android:layout_toEndOf="@id/ok"
android:text="@string/cancel"/>
</RelativeLayout>

View File

@@ -20,7 +20,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/green_transparent"
android:background="?attr/colorBackgroundTransparent"
android:orientation="vertical">
<TextView android:id="@+id/read_only"
android:layout_width="fill_parent"
@@ -39,14 +39,14 @@
<TextView android:id="@+id/group_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="left|center_vertical"
android:layout_gravity="start|center_vertical"
android:layout_weight="1"
android:text="@string/root"
style="@style/DefaultTextStyle" />
<ImageView android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|center_vertical"
android:layout_gravity="end|center_vertical"
android:scaleType="fitXY"
android:src="@drawable/ic99_blank"
style="@style/DefaultTextStyle" />

View File

@@ -28,7 +28,8 @@
android:scaleType="fitXY"
android:src="@drawable/ic99_blank"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true" />
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:id="@+id/entry_text"
android:layout_height="wrap_content"
@@ -36,5 +37,7 @@
style="@style/DefaultTextStyle"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_toRightOf="@+id/entry_icon" />
android:layout_alignParentEnd="true"
android:layout_toRightOf="@+id/entry_icon"
android:layout_toEndOf="@+id/entry_icon" />
</RelativeLayout>

View File

@@ -28,7 +28,8 @@
android:scaleType="fitXY"
android:src="@drawable/ic99_blank"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true" />
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView android:id="@+id/group_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -38,7 +39,9 @@
style="@style/DefaultTextStyle"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/group_label"
android:layout_toRightOf="@+id/group_icon" />
android:layout_toStartOf="@+id/group_label"
android:layout_toRightOf="@+id/group_icon"
android:layout_toEndOf="@+id/group_icon" />
<TextView android:id="@+id/group_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -47,5 +50,6 @@
android:layout_margin="@dimen/default_margin"
style="@style/SecondaryText"
android:layout_centerVertical="true"
android:layout_alignParentRight="true" />
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>

View File

@@ -20,14 +20,20 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/default_margin">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar_default" />
<ScrollView
android:id="@+id/scroll_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/pass_ok"
android:layout_alignParentLeft="true">
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<RelativeLayout
android:layout_width="wrap_content"
@@ -93,6 +99,7 @@
android:layout_height="wrap_content"
android:layout_below="@id/password_label"
android:layout_toRightOf="@+id/password_checkBox"
android:layout_toEndOf="@+id/password_checkBox"
android:hint="@string/hint_login_pass"
android:inputType="textPassword"
android:maxLines="1" />
@@ -103,17 +110,23 @@
android:layout_height="wrap_content"
android:layout_above="@+id/browse_button"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_below="@+id/password_label"
android:src="@drawable/ic_visibility_white_24dp"
android:tint="@android:color/darker_gray" />
<ImageButton
<android.support.v7.widget.AppCompatImageView
android:id="@+id/browse_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_below="@id/password"
android:src="@drawable/ic_folder_white_24dp" />
android:layout_alignParentEnd="true"
android:layout_below="@+id/password"
android:padding="6dp"
android:src="@drawable/ic_folder_white_24dp"
android:tint="?attr/colorAccentCompat"
/>
<CheckBox
android:visibility="gone"
@@ -128,7 +141,9 @@
android:layout_height="wrap_content"
android:layout_below="@id/password"
android:layout_toLeftOf="@id/browse_button"
android:layout_toStartOf="@id/browse_button"
android:layout_toRightOf="@+id/password_checkBox"
android:layout_toEndOf="@+id/password_checkBox"
android:hint="@string/entry_keyfile"
android:maxLines="1" />
</RelativeLayout>
@@ -147,11 +162,14 @@
<Button
android:id="@+id/pass_ok"
android:layout_margin="@dimen/default_margin"
android:layout_marginRight="@dimen/default_margin"
android:layout_marginEnd="@dimen/default_margin"
android:layout_marginTop="@dimen/default_margin"
android:layout_width="100sp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:text="@android:string/ok" />
</RelativeLayout>

View File

@@ -52,5 +52,6 @@
android:layout_height="wrap_content"
android:layout_below="@id/pass_keyfile"
android:layout_toRightOf="@id/ok"
android:layout_toEndOf="@id/ok"
android:text="@string/cancel"/>
</RelativeLayout>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar 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/toolbar"
android:title="@string/app_name"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:theme="?attr/toolbarDark"
android:elevation="4dp"
tools:targetApi="lollipop" />

View File

@@ -1,32 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017 Brian Pellin, Jeremy Jamet / Kunzisoft.
This file is part of KeePass DX.
KeePass DX is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
KeePass DX is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
-->
<resources>
<style name="KeepassoidStyle" parent="android:Theme.Holo">
<item name="android:actionBarStyle">@style/ActionBarStyle</item>
<item name="android:windowBackground">@color/background</item>
<item name="android:buttonStyle">@style/ButtonStyle</item>
<item name="android:imageButtonStyle">@style/ImageButtonStyle</item>
</style>
<style name="ActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">@color/green</item>
</style>
</resources>

View File

@@ -1,38 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017 Brian Pellin, Jeremy Jamet / Kunzisoft.
This file is part of KeePass DX.
KeePass DX is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
KeePass DX is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
-->
<resources>
<style name="KeepassoidStyle" parent="android:Theme.Material">
<item name="android:actionBarStyle">@style/ActionBarStyle</item>
<item name="android:statusBarColor">@color/green_dark</item>
<item name="android:windowBackground">@color/background</item>
<item name="android:buttonStyle">@style/ButtonStyle</item>
<item name="android:imageButtonStyle">@style/ImageButtonStyle</item>
<item name="android:colorPrimary">@color/green</item>
<item name="android:colorPrimaryDark">@color/green_dark</item>
<item name="android:colorAccent">@color/green</item>
<item name="android:navigationBarColor">@color/green_dark</item>
<style name="KeepassoidStyle" parent="AbstractKeepassoidStyle">
<item name="android:statusBarColor">@color/colorPrimaryDark</item>
</style>
<style name="ActionBarStyle" parent="@android:style/Widget.Material.ActionBar">
<item name="android:background">@color/green</item>
</style>
</resources>
</resources>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<attr name="toolbarDark" format="reference" />
<attr name="colorAccentCompat" format="reference" />
<attr name="colorBackgroundTransparent" format="reference" />
</resources>

View File

@@ -20,11 +20,19 @@
<resources>
<color name="transparent">#00ffffff</color>
<color name="white">#ffffff</color>
<color name="green">#43a047</color>
<color name="green_dark">#388e3c</color>
<color name="green_transparent">#50388e3c</color>
<color name="blue_highlight">#0000dd</color>
<color name="background">#303030</color>
<color name="backgroundTransparent">#50388e3c</color>
<color name="icon_background">#555555</color>
<color name="icon_text">#000000</color>
<color name="colorTextPrimary">#388e3c</color>
<color name="colorTextPrimaryInverse">#cccccc</color>
<color name="colorText">#424242</color>
<color name="colorTextInverse">#bdbdbd</color>
<color name="colorPrimary">#43a047</color>
<color name="colorPrimaryInverse">#bdbdbd</color>
<color name="colorPrimaryDark">#388e3c</color>
<color name="colorPrimaryDarkInverse">#9e9e9e</color>
<color name="colorAccent">#fb8c00</color>
</resources>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017 Brian Pellin, Jeremy Jamet / Kunzisoft.
Copyright 2017 Jeremy Jamet / Kunzisoft.
This file is part of KeePass DX.
@@ -18,13 +18,40 @@
along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
-->
<resources>
<style name="KeepassoidStyle" parent="android:Theme.Black">
<!-- No action bar for pre API 11 -->
<item name="android:windowBackground">@color/background</item>
<!-- Base application theme. -->
<style name="AbstractKeepassoidStyle" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<!--<item name="android:windowBackground">@color/background</item>-->
<item name="colorBackgroundTransparent">@color/backgroundTransparent</item>
<item name="android:buttonStyle">@style/ButtonStyle</item>
<item name="android:imageButtonStyle">@style/ImageButtonStyle</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="colorAccentCompat">@color/colorAccent</item>
<item name="colorControlNormal">@android:color/white</item>
<item name="android:textAppearance">@style/KeepassoidStyle.TextAppearance</item>
<item name="android:textAppearanceMedium">@style/KeepassoidStyle.TextAppearance</item>
<item name="android:textColor">@color/colorText</item>
<item name="android:textColorPrimary">@color/colorTextPrimary</item>
<item name="android:textColorPrimaryInverse">@color/colorTextPrimaryInverse</item>
<!-- Toolbar -->
<item name="toolbarDark">@style/KeepassoidStyle.Toolbar.Dark</item>
</style>
<style name="KeepassoidStyle" parent="AbstractKeepassoidStyle">
</style>
<!-- Button Style -->
<style name="ButtonStyle" parent="@android:style/Widget.Button">
<item name="android:textColor">@color/white</item>
<item name="android:background">@drawable/button_background</item>
@@ -38,37 +65,42 @@
<item name="android:background">@drawable/button_background</item>
</style>
<style name="ElementTextTitle" parent="android:TextAppearance">
<item name="@android:textColor">@color/white</item>
<!-- Text Style -->
<style name="KeepassoidStyle.TextAppearance" parent="@android:style/TextAppearance">
<item name="android:textColor">@color/colorText</item>
</style>
<style name="KeepassoidStyle.TextAppearance.Inverse" parent="@android:style/TextAppearance">
<item name="android:textColor">@color/colorTextInverse</item>
</style>
<style name="ElementTextTitle" parent="android:TextAppearance">
<item name="@android:textColor">@color/colorText</item>
</style>
<style name="TinyTextStyle">
<item name="@android:textSize">12sp</item>
</style>
<style name="SmallTextStyle" parent="android:TextAppearance">
<item name="@android:textColor">@color/white</item>
<item name="@android:textColor">@color/colorText</item>
<item name="@android:textSize">15sp</item>
</style>
<style name="DefaultTextStyle" parent="android:TextAppearance">
<item name="@android:textColor">@color/white</item>
<item name="@android:textColor">@color/colorText</item>
<item name="@android:textSize">16sp</item>
</style>
<style name="TitleTextStyle" parent="android:TextAppearance">
<item name="@android:textColor">@color/green</item>
<item name="@android:textColor">@color/colorTextPrimary</item>
<item name="@android:textSize">16sp</item>
</style>
<style name="SecondaryText">
<item name="@android:textSize">14sp</item>
</style>
<style name="WarningTextStyle" parent="android:TextAppearance">
<item name="@android:textColor">@android:color/secondary_text_dark</item>
<item name="@android:textColor">@color/colorAccent</item>
</style>
<style name="LabelTextStyle" parent="android:TextAppearance">
<item name="@android:textSize">12sp</item>
</style>
<style name="EntryItem">
<item name="@android:padding">5sp</item>
</style>
@@ -77,5 +109,17 @@
<item name="android:layout_height">1dp</item>
<item name="android:background">?android:attr/listDivider</item>
</style>
<style name="DividerEntry" parent="Divider"/>
<style name="DividerEntry" parent="Divider"/>
<!-- Toolbar Style -->
<style name="KeepassoidStyle.Toolbar.Dark" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorControlNormal">@android:color/white</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="android:textColorPrimary">@android:color/white</item>
<item name="android:textColorSecondary">@android:color/white</item>
<item name="android:colorBackground">@android:color/white</item>
</style>
</resources>

View File

@@ -2,6 +2,10 @@
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
@@ -11,5 +15,6 @@ buildscript {
allprojects {
repositories {
jcenter()
google()
}
}