Add toolbar in layouts

This commit is contained in:
Jeremy committed 2017-10-28 18:29:00 +02:00
1 parent 73a3bafc57
commit 2d4d5fc9b0
19 files changed
+327 -315

No files matched your search

Generated
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
@@ -36,6 +36,7 @@ import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.preference.PreferenceManager;
import android.support.v7.widget.Toolbar;
import android.text.SpannableString;
import android.text.method.LinkMovementMethod;
import android.text.method.PasswordTransformationMethod;
@@ -109,7 +110,7 @@ public class EntryActivity extends LockCloseHideActivity {
}
protected void setupEditButtons() {
Button edit = (Button) findViewById(R.id.entry_edit);
View edit = findViewById(R.id.entry_edit);
edit.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
@@ -120,9 +121,6 @@ public class EntryActivity extends LockCloseHideActivity {
if (readOnly) {
edit.setVisibility(View.GONE);
View divider = findViewById(R.id.entry_divider2);
divider.setVisibility(View.GONE);
}
}
@@ -133,6 +131,12 @@ public class EntryActivity extends LockCloseHideActivity {
super.onCreate(savedInstanceState);
setEntryView();
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
assert getSupportActionBar() != null;
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
Context appCtx = getApplicationContext();
dateFormat = android.text.format.DateFormat.getDateFormat(appCtx);
@@ -372,58 +376,60 @@ public class EntryActivity extends LockCloseHideActivity {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch ( item.getItemId() ) {
case R.id.menu_donate:
try {
Util.gotoUrl(this, R.string.donate_url);
} catch (ActivityNotFoundException e) {
Toast.makeText(this, R.string.error_failed_to_launch_link, Toast.LENGTH_LONG).show();
return false;
}
return true;
case R.id.menu_toggle_pass:
if ( mShowPassword ) {
item.setTitle(R.string.menu_showpass);
mShowPassword = false;
} else {
item.setTitle(R.string.menu_hide_password);
mShowPassword = true;
}
setPasswordStyle();
case R.id.menu_donate:
try {
Util.gotoUrl(this, R.string.donate_url);
} catch (ActivityNotFoundException e) {
Toast.makeText(this, R.string.error_failed_to_launch_link, Toast.LENGTH_LONG).show();
return false;
}
return true;
return true;
case R.id.menu_toggle_pass:
if ( mShowPassword ) {
item.setTitle(R.string.menu_showpass);
mShowPassword = false;
} else {
item.setTitle(R.string.menu_hide_password);
mShowPassword = true;
}
setPasswordStyle();
return true;
case R.id.menu_goto_url:
String url;
url = mEntry.getUrl();
case R.id.menu_goto_url:
String url;
url = mEntry.getUrl();
// Default http:// if no protocol specified
if ( ! url.contains("://") ) {
url = "http://" + url;
}
try {
Util.gotoUrl(this, url);
} catch (ActivityNotFoundException e) {
Toast.makeText(this, R.string.no_url_handler, Toast.LENGTH_LONG).show();
}
return true;
// Default http:// if no protocol specified
if ( ! url.contains("://") ) {
url = "http://" + url;
}
case R.id.menu_copy_user:
timeoutCopyToClipboard(mEntry.getUsername(true, App.getDB().pm));
return true;
try {
Util.gotoUrl(this, url);
} catch (ActivityNotFoundException e) {
Toast.makeText(this, R.string.no_url_handler, Toast.LENGTH_LONG).show();
}
return true;
case R.id.menu_copy_pass:
timeoutCopyToClipboard(new String(mEntry.getPassword(true, App.getDB().pm)));
return true;
case R.id.menu_copy_user:
timeoutCopyToClipboard(mEntry.getUsername(true, App.getDB().pm));
return true;
case R.id.menu_copy_pass:
timeoutCopyToClipboard(new String(mEntry.getPassword(true, App.getDB().pm)));
return true;
case R.id.menu_lock:
App.setShutdown();
setResult(KeePass.EXIT_LOCK);
finish();
return true;
}
case R.id.menu_lock:
App.setShutdown();
setResult(KeePass.EXIT_LOCK);
finish();
return true;
case android.R.id.home :
finish(); // close this activity and return to preview activity (if there is any)
}
return super.onOptionsItemSelected(item);
}
@@ -38,7 +38,7 @@ public class EntryActivityV4 extends EntryActivity {
@Override
protected void setEntryView() {
setContentView(R.layout.entry_view_v4);
setContentView(R.layout.entry_view);
}
@Override
@@ -30,6 +30,7 @@ import android.content.SharedPreferences;
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;
@@ -117,6 +118,13 @@ public abstract class EntryEditActivity extends LockCloseHideActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.entry_edit);
setResult(KeePass.EXIT_NORMAL);
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);
// Likely the app has been killed exit the activity
Database db = App.getDB();
@@ -157,7 +165,7 @@ public abstract class EntryEditActivity extends LockCloseHideActivity {
});
// Generate password button
Button generatePassword = (Button) findViewById(R.id.generate_button);
View generatePassword = findViewById(R.id.generate_button);
generatePassword.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
@@ -166,7 +174,7 @@ public abstract class EntryEditActivity extends LockCloseHideActivity {
});
// Save button
Button save = (Button) findViewById(R.id.entry_save);
View save = findViewById(R.id.entry_save);
save.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
@@ -198,17 +206,6 @@ public abstract class EntryEditActivity extends LockCloseHideActivity {
});
// Cancel button
Button cancel = (Button) findViewById(R.id.entry_cancel);
cancel.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
finish();
}
});
// Respect mask password setting
if (mShowPassword) {
EditText pass = (EditText) findViewById(R.id.entry_password);
@@ -219,6 +216,8 @@ public abstract class EntryEditActivity extends LockCloseHideActivity {
}
}
protected boolean validateBeforeSaving() {
// Require title
@@ -313,25 +312,28 @@ public abstract class EntryEditActivity extends LockCloseHideActivity {
public boolean onOptionsItemSelected(MenuItem item) {
switch ( item.getItemId() ) {
case R.id.menu_donate:
try {
Util.gotoUrl(this, R.string.donate_url);
} catch (ActivityNotFoundException e) {
Toast.makeText(this, R.string.error_failed_to_launch_link, Toast.LENGTH_LONG).show();
return false;
}
return true;
case R.id.menu_toggle_pass:
if ( mShowPassword ) {
item.setTitle(R.string.menu_showpass);
mShowPassword = false;
} else {
item.setTitle(R.string.menu_hide_password);
mShowPassword = true;
}
setPasswordStyle();
return true;
case R.id.menu_donate:
try {
Util.gotoUrl(this, R.string.donate_url);
} catch (ActivityNotFoundException e) {
Toast.makeText(this, R.string.error_failed_to_launch_link, Toast.LENGTH_LONG).show();
return false;
}
return true;
case R.id.menu_toggle_pass:
if ( mShowPassword ) {
item.setTitle(R.string.menu_showpass);
mShowPassword = false;
} else {
item.setTitle(R.string.menu_hide_password);
mShowPassword = true;
}
setPasswordStyle();
return true;
case android.R.id.home:
finish();
}
return super.onOptionsItemSelected(item);
@@ -26,6 +26,7 @@ import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.preference.PreferenceManager;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
@@ -144,6 +145,14 @@ public abstract class GroupActivity extends GroupBaseActivity {
} else {
setContentView(new GroupViewOnlyView(this));
}
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);
Log.w(TAG, "Set view");
if ( addGroupEnabled ) {
@@ -230,4 +239,6 @@ public abstract class GroupActivity extends GroupBaseActivity {
}
}
}
}
@@ -126,7 +126,7 @@ public abstract class GroupBaseActivity extends LockCloseListActivity {
}
}
}
protected void setGroupIcon() {
if (mGroup != null) {
ImageView iv = (ImageView) findViewById(R.id.icon);
@@ -2,7 +2,7 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:right="1dp" android:top="5dp">
<shape>
<corners android:radius="3dp" />
<corners android:radius="8dp" />
<solid android:color="#14000000" />
</shape>
</item>
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM20.71,7.04c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-1.83,1.83 3.75,3.75 1.83,-1.83z"/>
</vector>
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M17,3L5,3c-1.11,0 -2,0.9 -2,2v14c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2L21,7l-4,-4zM12,19c-1.66,0 -3,-1.34 -3,-3s1.34,-3 3,-3 3,1.34 3,3 -1.34,3 -3,3zM15,9L5,9L5,5h10v4z"/>
</vector>
+48 -45
View File
@@ -18,37 +18,25 @@
along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_margin="@dimen/default_margin"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<Button android:id="@+id/entry_save"
android:layout_margin="@dimen/button_margin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:text="@string/entry_save"/>
<Button android:id="@+id/entry_cancel"
android:layout_margin="@dimen/button_margin"
android:layout_width="wrap_content"
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"
android:scaleType="fitXY"
style="@style/DividerEntry"/>
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar_default" />
<com.keepassdroid.view.NoFocusScrollView android:id="@+id/entry_scroll"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@id/entry_divider"
android:fillViewport="true">
<RelativeLayout android:layout_width="fill_parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/toolbar"
android:fillViewport="true">
<RelativeLayout
android:padding="@dimen/default_margin"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- Title -->
<!-- Title -->
<TextView android:id="@+id/entry_title_label"
android:layout_width="fill_parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/entry_title" />
<ImageButton android:id="@+id/icon_button"
@@ -58,8 +46,8 @@
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"
<EditText android:id="@+id/entry_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/icon_button"
android:layout_toStartOf="@+id/icon_button"
@@ -77,8 +65,8 @@
android:layout_height="wrap_content"
android:layout_below="@id/divider_title"
android:text="@string/entry_user_name" />
<EditText android:id="@+id/entry_user_name"
android:layout_width="fill_parent"
<EditText android:id="@+id/entry_user_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:inputType="textEmailAddress"
@@ -95,8 +83,8 @@
android:layout_height="wrap_content"
android:layout_below="@id/divider_username"
android:text="@string/entry_url" />
<EditText android:id="@+id/entry_url"
android:layout_width="fill_parent"
<EditText android:id="@+id/entry_url"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:inputType="textUri"
@@ -113,15 +101,17 @@
android:layout_height="wrap_content"
android:layout_below="@id/divider_url"
android:text="@string/entry_password" />
<Button android:id="@+id/generate_button"
<android.support.v7.widget.AppCompatImageView android:id="@+id/generate_button"
android:layout_below="@id/entry_password_label"
android:layout_width="wrap_content"
android:text="@string/ellipsis"
android:src="@drawable/ic_mode_edit_white_24dp"
android:tint="@color/colorAccent"
android:layout_margin="8dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"/>
<EditText android:id="@+id/entry_password"
android:layout_width="fill_parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:maxLines="1"
@@ -141,7 +131,7 @@
android:layout_below="@id/divider_password"
android:text="@string/entry_confpassword" />
<EditText android:id="@+id/entry_confpassword"
android:layout_width="fill_parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:maxLines="1"
@@ -158,9 +148,9 @@
android:layout_height="wrap_content"
android:layout_below="@id/divider_confpassword"
android:text="@string/entry_comment" />
<EditText android:id="@+id/entry_comment"
<EditText android:id="@+id/entry_comment"
android:inputType="textMultiLine"
android:layout_width="fill_parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/entry_comment_label"
android:hint="@string/hint_comment"/>
@@ -169,7 +159,7 @@
android:scaleType="fitXY"
style="@style/DividerEntry"/>
<LinearLayout android:id="@+id/advanced_container"
android:layout_width="fill_parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/divider_comment"
android:orientation="vertical">
@@ -179,10 +169,23 @@
android:layout_height="30sp"
android:layout_below="@id/advanced_container"
android:contentDescription="@string/add_string"
android:src="@android:drawable/ic_input_add"
android:src="@drawable/ic_add_white_24dp"
android:tint="@color/colorAccent"
android:scaleType="centerCrop"
android:visibility="gone"
/>
android:visibility="gone" />
</RelativeLayout>
</com.keepassdroid.view.NoFocusScrollView>
</com.keepassdroid.view.NoFocusScrollView >
<android.support.v7.widget.AppCompatImageButton
android:id="@+id/entry_save"
android:layout_width="56dp"
android:layout_height="56dp"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_margin="24dp"
android:background="@drawable/fab_background"
android:elevation="4dp"
android:src="@drawable/ic_save_white_24dp"
android:text="@string/menu_edit" />
</RelativeLayout>
+34 -33
View File
@@ -18,40 +18,41 @@
along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
-->
<com.keepassdroid.view.EntryEditSection xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_margin="@dimen/default_margin"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
android:layout_margin="@dimen/default_margin"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<EditText android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:inputType="text"
android:hint="@string/field_name"
style="@style/TinyTextStyle" />
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:inputType="text"
android:hint="@string/field_name"
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" />
<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:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/title"
android:text="@string/protection" />
<android.support.v7.widget.AppCompatImageView 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:tint="@color/colorAccent"
android:scaleType="centerCrop"
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" />
<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:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/delete"
android:inputType="textMultiLine"
android:hint="@string/field_value" />
<android.support.v7.widget.AppCompatImageView 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" />
</com.keepassdroid.view.EntryEditSection>
+61 -49
View File
@@ -18,53 +18,65 @@
along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_margin="@dimen/default_margin"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<!-- Title -->
<LinearLayout android:id="@+id/title_block"
android:layout_alignParentTop="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="2dp"
style="@style/DefaultTextStyle">
<TextView android:id="@+id/entry_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
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="end|center_vertical"
android:scaleType="fitXY"
android:src="@drawable/ic99_blank"
style="@style/DefaultTextStyle"/>
</LinearLayout>
<Button android:id="@+id/entry_edit"
android:text="@string/menu_edit"
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"
android:layout_height="wrap_content"
android:layout_above="@id/entry_edit"
android:scaleType="fitXY"
android:src="@android:drawable/divider_horizontal_dark"/>
<ScrollView android:id="@+id/entry_scroll"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@id/entry_divider2"
android:layout_below="@id/title_block"
android:fillViewport="true"
android:scrollbarStyle="insideOverlay">
<com.keepassdroid.view.EntryContentsView android:id="@+id/entry_contents"
android:layout_height="wrap_content"
android:layout_width="fill_parent" />
</ScrollView>
android:layout_width="match_parent"
android:layout_height="match_parent">
<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" >
<LinearLayout android:id="@+id/title_block"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:translationZ="10dp"
style="@style/DefaultTextStyle">
<android.support.v7.widget.AppCompatImageView android:id="@+id/entry_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|center_vertical"
android:scaleType="fitXY"
android:src="@drawable/ic99_blank"/>
<TextView android:id="@+id/entry_title"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="start|center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_gravity="start|center_vertical"
style="@style/KeepassoidStyle.TextAppearance.Inverse" />
</LinearLayout>
</android.support.v7.widget.Toolbar>
<ScrollView android:id="@+id/entry_scroll"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/toolbar"
android:fillViewport="true"
android:scrollbarStyle="insideOverlay">
<com.keepassdroid.view.EntryContentsView android:id="@+id/entry_contents"
android:layout_height="wrap_content"
android:layout_width="fill_parent" />
</ScrollView>
<android.support.v7.widget.AppCompatImageButton android:id="@+id/entry_edit"
android:text="@string/menu_edit"
android:layout_margin="24dp"
android:layout_width="56dp"
android:layout_height="56dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:src="@drawable/ic_mode_edit_white_24dp"
android:background="@drawable/fab_background"
android:elevation="4dp" />
</RelativeLayout>
-73
View File
@@ -1,73 +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/>.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_margin="@dimen/default_margin"
android:id="@+id/parent"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<!-- Title -->
<LinearLayout android:id="@+id/title_block"
android:layout_alignParentTop="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:padding="2dp"
style="@style/DefaultTextStyle">
<TextView android:id="@+id/entry_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
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="end|center_vertical"
android:scaleType="fitXY"
android:src="@drawable/ic99_blank"
style="@style/DefaultTextStyle"/>
</LinearLayout>
<Button android:id="@+id/entry_edit"
android:text="@string/menu_edit"
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"
android:layout_height="wrap_content"
android:layout_above="@id/entry_edit"
android:scaleType="fitXY"
android:src="@android:drawable/divider_horizontal_dark"/>
<ScrollView android:id="@+id/entry_scroll"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@id/entry_divider2"
android:layout_below="@id/title_block"
android:fillViewport="true"
android:scrollbarStyle="insideOverlay"
android:padding="0sp">
<com.keepassdroid.view.EntryContentsView android:id="@+id/entry_contents"
android:layout_height="wrap_content"
android:layout_width="fill_parent" />
</ScrollView>
</RelativeLayout>
@@ -20,9 +20,16 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.keepassdroid.view.FileNameView android:id="@+id/file_select"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<include
android:id="@+id/toolbar"
layout="@layout/toolbar_default" />
<com.keepassdroid.view.FileNameView
android:id="@+id/file_select"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/toolbar" />
<!-- Small hack because I need to include a list since this is a list activity -->
<ListView android:id="@+id/file_list"
android:layout_width="0sp"
+28 -6
View File
@@ -21,15 +21,33 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.keepassdroid.view.GroupHeaderView
android:id="@+id/group_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<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">
<com.keepassdroid.view.GroupHeaderView
android:id="@+id/group_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/toolbar" />
</android.support.v7.widget.Toolbar>
<ListView android:id="@+id/group_list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/group_header"/>
<ImageButton
android:layout_below="@+id/toolbar"/>
<android.support.v7.widget.AppCompatImageButton
android:id="@+id/add_button"
android:layout_width="56dp"
android:layout_height="56dp"
@@ -41,6 +59,7 @@
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"
@@ -52,7 +71,9 @@
android:text="@string/add_entry"
android:visibility="invisible"
android:background="@drawable/button_small_background"
style="@style/SmallTextStyle"
tools:ignore="UnusedAttribute" />
<TextView android:id="@+id/add_group"
android:layout_marginBottom="24dp"
android:layout_marginRight="12dp"
@@ -65,5 +86,6 @@
android:text="@string/add_group"
android:visibility="invisible"
android:background="@drawable/button_small_background"
style="@style/SmallTextStyle"
tools:ignore="UnusedAttribute" />
</RelativeLayout>
+8 -10
View File
@@ -20,7 +20,6 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="?attr/colorBackgroundTransparent"
android:orientation="vertical">
<TextView android:id="@+id/read_only"
android:layout_width="fill_parent"
@@ -28,21 +27,13 @@
android:text="@string/read_only"
android:visibility="gone"
style="@style/WarningTextStyle" />
<LinearLayout
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_marginStart="@dimen/list_margin"
android:layout_marginEnd="@dimen/list_margin"
android:padding="2sp"
style="@style/DefaultTextStyle">
<TextView android:id="@+id/group_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
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"
@@ -50,5 +41,12 @@
android:scaleType="fitXY"
android:src="@drawable/ic99_blank"
style="@style/DefaultTextStyle" />
<TextView android:id="@+id/group_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:layout_weight="1"
android:text="@string/root"
style="@style/DefaultTextStyle" />
</LinearLayout>
</LinearLayout>
@@ -21,10 +21,15 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical">
<ImageView android:id="@+id/entry_icon"
<android.support.v7.widget.AppCompatImageView android:id="@+id/entry_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
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:scaleType="fitXY"
android:src="@drawable/ic99_blank"
android:layout_centerVertical="true"
@@ -21,10 +21,15 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical">
<ImageView android:id="@+id/group_icon"
<android.support.v7.widget.AppCompatImageView android:id="@+id/group_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
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:scaleType="fitXY"
android:src="@drawable/ic99_blank"
android:layout_centerVertical="true"
+1
View File
@@ -79,6 +79,7 @@
<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>