first changes to native Holo Light design

This commit is contained in:
PhilippC 2013-04-13 05:28:15 +02:00
parent de0dd676ef
commit a58e89f43b
15 changed files with 1202 additions and 863 deletions

View File

@ -76,7 +76,7 @@ namespace keepass2android
}
protected void setupEditButtons() {
Button edit = (Button) FindViewById(Resource.Id.entry_edit);
View edit = FindViewById(Resource.Id.entry_edit);
edit.Click += (sender, e) => {
EntryEditActivity.Launch(this, mEntry);
};
@ -333,14 +333,19 @@ namespace keepass2android
protected void fillData(bool trimList)
{
ImageView iv = (ImageView)FindViewById(Resource.Id.entry_icon);
App.getDB().drawFactory.assignDrawableTo(iv, Resources, App.getDB().pm, mEntry.IconId, mEntry.CustomIconUuid);
if (iv != null)
{
App.getDB().drawFactory.assignDrawableTo(iv, Resources, App.getDB().pm, mEntry.IconId, mEntry.CustomIconUuid);
}
//populateText(Resource.Id.entry_title, mEntry.Strings.ReadSafe(PwDefs.TitleField));
var button = ((Button)FindViewById(Resource.Id.entry_title));
button.Text = mEntry.Strings.ReadSafe(PwDefs.TitleField);
button.Click += (object sender, EventArgs e) => {
Finish(); };
if (button != null)
{
button.Text = mEntry.Strings.ReadSafe(PwDefs.TitleField);
button.Click += (object sender, EventArgs e) => {
Finish(); };
}
populateText(Resource.Id.entry_user_name, Resource.Id.entry_user_name_label, mEntry.Strings.ReadSafe(PwDefs.UserNameField));
populateText(Resource.Id.entry_url, Resource.Id.entry_url_label, mEntry.Strings.ReadSafe(PwDefs.UrlField));

View File

@ -74,7 +74,7 @@ namespace keepass2android
private ScrollView scroll;
protected override void OnCreate(Bundle savedInstanceState)
protected override void OnCreate(Bundle savedInstanceState)
{
ISharedPreferences prefs = PreferenceManager.GetDefaultSharedPreferences(this);
mShowPassword = ! prefs.GetBoolean(GetString(Resource.String.maskpass_key), Resources.GetBoolean(Resource.Boolean.maskpass_default));
@ -85,23 +85,25 @@ namespace keepass2android
// Likely the app has been killed exit the activity
Database db = App.getDB();
if ( ! db.Open ) {
if (! db.Open)
{
Finish();
return;
}
Intent i = Intent;
String uuidBytes = i.GetStringExtra(KEY_ENTRY);
String uuidBytes = i.GetStringExtra(KEY_ENTRY);
PwUuid entryId = PwUuid.Zero;
if (uuidBytes != null)
entryId = new KeePassLib.PwUuid(MemUtil.HexStringToByteArray(uuidBytes));
PwGroup parentGroup = null;
if ( entryId == PwUuid.Zero ) {
if (entryId == PwUuid.Zero)
{
String groupId = i.GetStringExtra(KEY_PARENT);
parentGroup = db.groups[new PwUuid(MemUtil.HexStringToByteArray(groupId))];
parentGroup = db.groups [new PwUuid(MemUtil.HexStringToByteArray(groupId))];
mEntryInDatabase = new PwEntry(true, true);
mEntryInDatabase.Strings.Set(PwDefs.UserNameField, new ProtectedString(
@ -121,8 +123,8 @@ namespace keepass2android
pwe.ExpiryTime = DateTime.Now.AddDays(nExpireDays);
}*/
if((parentGroup.IconId != PwIcon.Folder) && (parentGroup.IconId != PwIcon.FolderOpen) &&
(parentGroup.IconId != PwIcon.FolderPackage))
if ((parentGroup.IconId != PwIcon.Folder) && (parentGroup.IconId != PwIcon.FolderOpen) &&
(parentGroup.IconId != PwIcon.FolderPackage))
{
mEntryInDatabase.IconId = parentGroup.IconId; // Inherit icon from group
}
@ -149,11 +151,12 @@ namespace keepass2android
mIsNew = true;
mEntryModified = true;
} else {
} else
{
System.Diagnostics.Debug.Assert(entryId != null);
mEntryInDatabase = db.entries[entryId];
mEntryInDatabase = db.entries [entryId];
mIsNew = false;
@ -165,14 +168,14 @@ namespace keepass2android
View scrollView = FindViewById(Resource.Id.entry_scroll);
scrollView.ScrollBarStyle = ScrollbarStyles.InsideInset;
ImageButton iconButton = (ImageButton) FindViewById(Resource.Id.icon_button);
ImageButton iconButton = (ImageButton)FindViewById(Resource.Id.icon_button);
iconButton.Click += (sender, evt) => {
IconPickerActivity.Launch(this);
};
// Generate password button
Button generatePassword = (Button) FindViewById(Resource.Id.generate_button);
Button generatePassword = (Button)FindViewById(Resource.Id.generate_button);
generatePassword.Click += (object sender, EventArgs e) => {
GeneratePasswordActivity.Launch(this);
@ -182,7 +185,20 @@ namespace keepass2android
// Save button
Button save = (Button) FindViewById(Resource.Id.entry_save);
View save = FindViewById(Resource.Id.entry_save);
if (save == null)
{
ActionBar.SetCustomView(Resource.Layout.SaveButton);
ActionBar.SetDisplayShowCustomEnabled(true);
ActionBar.SetDisplayShowTitleEnabled(false);
ActionBar.SetDisplayUseLogoEnabled(false);
ActionBar.SetDisplayShowHomeEnabled(false);
ActionBar.SetDisplayOptions(ActionBarDisplayOptions.ShowCustom,
ActionBarDisplayOptions.ShowCustom);
save = FindViewById(Resource.Id.entry_save);
}
save.Click += (object sender, EventArgs e) =>
{
@ -381,7 +397,8 @@ namespace keepass2android
updateExpires();
mEntryModified = true;
};
}
void addBinaryOrAsk(string filename)

View File

@ -126,11 +126,9 @@ namespace keepass2android
} else {
SetContentView (new GroupViewOnlyView (this));
}
Log.Warn (TAG, "Set view");
if (addGroupEnabled) {
// Add Group button
Button addGroup = (Button)FindViewById (Resource.Id.add_group);
View addGroup = FindViewById (Resource.Id.add_group);
addGroup.Click += (object sender, EventArgs e) => {
GroupEditActivity.Launch (this, mGroup);
};
@ -138,7 +136,7 @@ namespace keepass2android
if (addEntryEnabled) {
// Add Entry button
Button addEntry = (Button)FindViewById (Resource.Id.add_entry);
View addEntry = FindViewById (Resource.Id.add_entry);
addEntry.Click += (object sender, EventArgs e) => {
EntryEditActivity.Launch (this, mGroup);

View File

@ -29,6 +29,7 @@ using Android.Widget;
using KeePassLib;
using Android.Preferences;
using keepass2android.view;
using Android.Graphics.Drawables;
namespace keepass2android
{
@ -115,42 +116,56 @@ namespace keepass2android
protected void setGroupTitle()
{
Button tv = (Button)FindViewById(Resource.Id.group_name);
if (tv == null)
return;
if (mGroup != null)
String name = mGroup.Name;
String titleText;
bool clickable = (mGroup != null) && (mGroup.IsVirtual == false) && (mGroup.ParentGroup != null);
if (!String.IsNullOrEmpty(name))
{
String name = mGroup.Name;
if (!String.IsNullOrEmpty(name))
{
tv.Text = name;
} else
{
tv.Text = GetText(Resource.String.root);
}
}
if ((mGroup != null) && (mGroup.IsVirtual == false) && (mGroup.ParentGroup != null))
{
tv.Click += (object sender, EventArgs e) =>
{
Finish();
};
titleText = name;
} else
{
tv.SetCompoundDrawables(null, null, null, null);
tv.Clickable = false;
titleText = GetText(Resource.String.root);
}
//see if the button for SDK Version < 11 is there
Button tv = (Button)FindViewById(Resource.Id.group_name);
if (tv != null)
{
if (mGroup != null)
{
tv.Text = titleText;
}
if (clickable)
{
tv.Click += (object sender, EventArgs e) =>
{
Finish();
};
} else
{
tv.SetCompoundDrawables(null, null, null, null);
tv.Clickable = false;
}
}
//ICS?
if (ActionBar != null)
{
ActionBar.Title = titleText;
if (clickable)
ActionBar.SetDisplayHomeAsUpEnabled(true);
}
}
protected void setGroupIcon() {
if (mGroup != null) {
Drawable drawable = App.getDB().drawFactory.getIconDrawable(Resources, App.getDB().pm, mGroup.IconId, mGroup.CustomIconUuid);
ImageView iv = (ImageView) FindViewById(Resource.Id.icon);
App.getDB().drawFactory.assignDrawableTo(iv, Resources, App.getDB().pm, mGroup.IconId, mGroup.CustomIconUuid);
if (iv != null)
iv.SetImageDrawable(drawable);
if (ActionBar != null)
ActionBar.SetIcon(drawable);
}
}
@ -240,6 +255,12 @@ namespace keepass2android
Toast.MakeText(this, Resource.String.no_url_handler, ToastLength.Long).Show();
}
return true;
case Android.Resource.Id.Home:
//Currently the action bar only displays the home button when we come from a previous activity.
//So we can simply Finish. See this page for information on how to do this in more general (future?) cases:
//http://developer.android.com/training/implementing-navigation/ancestral.html
Finish();
return true;
}
return base.OnOptionsItemSelected(item);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="?android:actionButtonStyle"
android:id="@+id/entry_save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1">
<TextView
style="?android:actionBarTabTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingRight="20dp"
android:drawableLeft="@drawable/navigation_accept_dark"
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:text="@string/entry_save" />
</FrameLayout>

View File

@ -0,0 +1,212 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ScrollView
android:id="@+id/entry_scroll"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@id/entry_save_header">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<!-- Title -->
<TextView
android:id="@+id/entry_title_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/entry_title"
style="@style/EntryFieldHeader"
/>
<ImageButton
android:id="@+id/icon_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic00"
android:layout_alignParentRight="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:singleLine="true"
android:layout_below="@id/entry_title_label"
android:hint="@string/hint_title" />
<!-- Username -->
<TextView
android:id="@+id/entry_user_name_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/icon_button"
style="@style/EntryFieldHeader"
android:text="@string/entry_user_name" />
<EditText
android:id="@+id/entry_user_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:inputType="textEmailAddress"
android:layout_below="@id/entry_user_name_label"
android:hint="@string/hint_username" />
<!-- URL -->
<TextView
android:id="@+id/entry_url_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry_user_name"
style="@style/EntryFieldHeader"
android:text="@string/entry_url" />
<EditText
android:id="@+id/entry_url"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:inputType="textUri"
android:layout_below="@id/entry_url_label"
android:hint="@string/hint_url" />
<!-- Password -->
<TextView
android:id="@+id/entry_password_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry_url"
style="@style/EntryFieldHeader"
android:text="@string/entry_password" />
<Button
android:id="@+id/generate_button"
android:layout_below="@id/entry_password_label"
android:layout_width="wrap_content"
android:text="@string/ellipsis"
android:layout_height="wrap_content"
android:layout_alignParentRight="true" />
<EditText
android:id="@+id/entry_password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:typeface="monospace"
android:singleLine="true"
android:layout_toLeftOf="@id/generate_button"
android:hint="@string/hint_pass"
android:layout_alignTop="@id/generate_button" />
<!-- Confirm Password -->
<TextView
android:id="@+id/entry_confpassword_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry_password"
android:text="@string/entry_confpassword" />
<EditText
android:id="@+id/entry_confpassword"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:typeface="monospace"
android:singleLine="true"
android:layout_below="@id/entry_confpassword_label"
android:hint="@string/hint_conf_pass" />
<!-- Comment -->
<TextView
android:id="@+id/entry_comment_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry_confpassword"
style="@style/EntryFieldHeader"
android:text="@string/entry_comment" />
<EditText
android:id="@+id/entry_comment"
android:inputType="textMultiLine"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/entry_comment_label"
android:hint="@string/hint_comment" />
<!-- Extra strings -->
<TextView
android:id="@+id/entry_extra_strings_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/entry_comment"
android:text="@string/entry_extra_strings"
style="@style/EntryFieldHeader" />
<LinearLayout
android:id="@+id/advanced_container"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/entry_extra_strings_label"
android:orientation="vertical" />
<Button
android:id="@+id/add_advanced"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/advanced_container"
android:drawableLeft="@android:drawable/ic_menu_add"
android:text="@string/add_extra_string" />
<!-- file attachments -->
<TextView
android:id="@+id/entry_binaries_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/entry_binaries"
android:layout_below="@id/add_advanced"
style="@style/EntryFieldHeader" />
<LinearLayout
android:id="@+id/binaries"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/entry_binaries_label"
android:orientation="vertical" />
<!-- Tags -->
<TextView
android:id="@+id/entry_tags_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/entry_tags"
android:layout_below="@id/binaries"
style="@style/EntryFieldHeader" />
<EditText
android:id="@+id/entry_tags"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:inputType="text"
android:layout_below="@id/entry_tags_label"
android:hint="@string/hint_tags" />
<!-- Override URL -->
<TextView
android:id="@+id/entry_override_url_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry_tags"
style="@style/EntryFieldHeader"
android:text="@string/entry_override_url" />
<EditText
android:id="@+id/entry_override_url"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:inputType="textUri"
android:layout_below="@id/entry_override_url_label"
android:hint="@string/hint_override_url" />
<!-- Expires -->
<TextView
android:id="@+id/entry_expires_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/entry_expires"
style="@style/EntryFieldHeader"
android:layout_below="@id/entry_override_url" />
<CheckBox
android:id="@+id/entry_expires_checkbox"
android:layout_below="@id/entry_expires_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<EditText
android:id="@+id/entry_expires"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/entry_expires_checkbox"
android:layout_below="@id/entry_expires_label" />
</RelativeLayout>
</ScrollView>
</RelativeLayout>

View File

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:id="@+id/top"
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="horizontal" />
<LinearLayout
android:id="@+id/bottom_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:divider="?android:attr/dividerVertical"
android:layout_alignParentBottom="true"
android:dividerPadding="12dp">
<FrameLayout
style="?android:actionButtonStyle"
android:id="@+id/entry_edit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<TextView
style="?android:actionBarTabTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingRight="20dp"
android:drawableLeft="@android:drawable/ic_menu_edit"
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:text="@string/menu_edit" />
</FrameLayout>
</LinearLayout>
<ImageView
android:id="@+id/entry_divider2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="@id/bottom_bar"
android:scaleType="fitXY"
android:tint="@color/blue_highlight"
android:src="@android:drawable/divider_horizontal_bright" />
<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">
<keepass2android.view.EntryContentsView
android:id="@+id/entry_contents"
android:layout_height="wrap_content"
android:layout_width="fill_parent" />
</ScrollView>
</RelativeLayout>

View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:id="@+id/top"
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="horizontal"
> </LinearLayout>
<LinearLayout
android:id="@+id/bottom_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:divider="?android:attr/dividerVertical"
android:showDividers="middle"
android:layout_alignParentBottom="true"
android:dividerPadding="12dp">
<FrameLayout
style="?android:actionButtonStyle"
android:id="@+id/add_group"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<TextView
style="?android:actionBarTabTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingRight="20dp"
android:drawableLeft="@drawable/btn_new_group_dark"
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:text="@string/add_group" />
</FrameLayout>
<FrameLayout
style="?android:actionButtonStyle"
android:id="@+id/add_entry"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<TextView
style="?android:actionBarTabTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingRight="20dp"
android:drawableLeft="@drawable/device_access_new_account_dark"
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:text="@string/add_entry" />
</FrameLayout>
</LinearLayout>
<ImageView
android:id="@+id/divider2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="@id/bottom_bar"
android:scaleType="fitXY"
android:tint="@color/blue_highlight"
android:src="@android:drawable/divider_horizontal_dark" />
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="@id/divider2"
android:layout_below="@id/top"
/>
</RelativeLayout>

View File

@ -2,10 +2,6 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<keepass2android.view.GroupHeaderView
android:id="@+id/group_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<LinearLayout
android:id="@+id/bottom_bar"
android:layout_alignParentBottom="true"
@ -45,6 +41,5 @@
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="@id/divider2"
android:layout_below="@id/group_header" />
android:layout_above="@id/divider2" />
</RelativeLayout>

View File

@ -20,69 +20,32 @@
<style name="NoTitleBar" parent="android:Theme.Holo.Light"></style>
<style name="Dialog" parent="android:Theme.Holo.Light.Dialog"></style>
<style name="GroupTextSmall" parent="android:Theme.Holo.Light">
<item name="@android:textColor">@color/group</item>
<item name="@android:textSize">15sp</item>
</style>
<style name="GroupText" parent="android:Theme.Holo.Light">
<item name="@android:textColor">@color/group</item>
<item name="@android:textSize">20sp</item>
</style>
<style name="GroupTextLarge" parent="android:Theme.Holo.Light">
<item name="@android:textColor">@color/group</item>
<item name="@android:textSize">28sp</item>
</style>
<style name="ElementTextSmall">
<item name="@android:textSize">15sp</item>
</style>
<style name="ElementText">
<item name="@android:textSize">20sp</item>
</style>
<style name="ElementTextLarge">
<item name="@android:textSize">28sp</item>
</style>
<style name="GroupLabel">
<item name="@android:textSize">20sp</item>
</style>
<style name="WhiteOnBlack">
<item name="@android:background">#666666</item>
<item
name="@android:textColor">@android:color/primary_text_dark</item>
<item name="@android:textSize">20sp</item>
</style>
<style name="WhiteOnBlackSmall" parent="WhiteOnBlack">
<item name="@android:textSize">12sp</item>
</style>
<style name="WhiteOnDarkSmall" parent="WhiteOnBlack">
<item name="@android:textSize">12sp</item>
<item name="@android:textColor">@color/group</item>
</style>
<style name="ElementTextTitle" parent="WhiteOnBlack">
<item name="@android:textColor">@color/group</item>
</style>
<style name="EntryItem">
<item name="@android:padding">5sp</item>
<item name="@android:textColor">@color/group</item>
</style>
<style name="EntryFieldHeader" parent="android:Widget.Holo.Light.TextView">
<item name="android:drawableBottom">@drawable/section_header</item>
<item name="android:drawablePadding">1dp</item>
<item name="android:layout_marginBottom">3dp</item>
<item name="android:layout_marginTop">8dp</item>
<item name="android:paddingLeft">4dp</item>
<item name="android:textAllCaps">true</item>
<item name="android:textColor">@color/emphasis</item>
<item name="android:textSize">14sp</item>
<item name="android:textStyle">bold</item>
</style>
<style name="ExtraFieldHeader" parent="android:Widget.Holo.Light.TextView">
<item name="android:drawablePadding">1dp</item>
<item name="android:layout_marginBottom">3dp</item>
<item name="android:layout_marginTop">8dp</item>
<item name="android:paddingLeft">4dp</item>
<item name="android:textAllCaps">true</item>
<item name="android:textColor">@color/emphasis2</item>
<item name="android:textSize">14sp</item>
<item name="android:textStyle">bold</item>
</style>
</resources>

View File

@ -22,79 +22,41 @@
<style name="NoTitleBar" parent="android:Theme.NoTitleBar"></style>
<style name="Dialog" parent="android:Theme.Dialog"></style>
<style name="GroupTextSmall" parent="android:Theme">
<item name="@android:textColor">@color/group</item>
<item name="@android:textSize">15sp</item>
</style>
<style name="GroupText" parent="android:Theme">
<item name="@android:textColor">@color/group</item>
<item name="@android:textSize">20sp</item>
</style>
<style name="GroupTextLarge" parent="android:Theme">
<item name="@android:textColor">@color/group</item>
<item name="@android:textSize">28sp</item>
</style>
<style name="ElementTextSmall">
<item name="@android:textSize">15sp</item>
</style>
<style name="ElementText">
<item name="@android:textSize">20sp</item>
</style>
<style name="ElementTextLarge">
<item name="@android:textSize">28sp</item>
</style>
<style name="GroupLabel">
<item name="@android:textSize">20sp</item>
</style>
<style name="WhiteOnBlack">
<item name="@android:background">#666666</item>
<item name="@android:textColor">@android:color/primary_text_dark</item>
<item name="@android:textSize">20sp</item>
</style>
<style name="GroupAndEntryHeader">
<item name="@android:background">#000066</item>
<item name="@android:textColor">#ffffff</item>
<item name="@android:textSize">20sp</item>
</style>
<style name="WhiteOnBlackSmall" parent="WhiteOnBlack">
<item name="@android:textSize">12sp</item>
</style>
<style name="WhiteOnDarkSmall" parent="WhiteOnBlack">
<item name="@android:textSize">12sp</item>
<item name="@android:background">#222222</item>
</style>
<style name="EntryFieldHeader" parent="WhiteOnDarkSmall">
<item name="@android:textSize">12sp</item>
</style>
<style name="ElementTextTitle" parent="WhiteOnBlack">
<item name="@android:textColor">@color/group</item>
<item name="@android:background">@android:color/transparent</item>
</style>
<style name="EntryItem">
<item name="@android:padding">5sp</item>
</style>
<style name="EntryFieldHeader">
<item name="android:drawableBottom">@drawable/section_header</item>
<item name="android:drawablePadding">1dp</item>
<item name="android:layout_marginBottom">3dp</item>
<item name="android:layout_marginTop">8dp</item>
<item name="android:paddingLeft">4dp</item>
<item name="android:textAllCaps">true</item>
<item name="android:textColor">@color/emphasis</item>
<item name="android:textSize">14sp</item>
<item name="android:textStyle">bold</item>
<item name="@android:background">@android:color/transparent</item>
</style>
<style name="ExtraFieldHeader">
<item name="android:drawablePadding">1dp</item>
<item name="android:layout_marginBottom">3dp</item>
<item name="android:layout_marginTop">8dp</item>
<item name="android:paddingLeft">4dp</item>
<item name="android:textAllCaps">true</item>
<item name="android:textColor">@color/emphasis2</item>
<item name="android:textSize">14sp</item>
<item name="android:textStyle">bold</item>
<item name="@android:background">@android:color/transparent</item>
</style>
</resources>

View File

@ -57,7 +57,7 @@ namespace keepass2android
iv.SetImageDrawable (draw);
}
private Drawable getIconDrawable (Resources res, PwDatabase db, PwIcon icon, PwUuid customIconId)
public Drawable getIconDrawable (Resources res, PwDatabase db, PwIcon icon, PwUuid customIconId)
{
if (customIconId != PwUuid.Zero) {
return getIconDrawable (res, db, customIconId);

View File

@ -580,6 +580,10 @@
<AndroidResource Include="Resources\values-zh-rCN\strings.xml" />
<AndroidResource Include="Resources\values-zh-rTW\strings.xml" />
<AndroidResource Include="Resources\drawable\ic_launcher_gray.png" />
<AndroidResource Include="Resources\layout-v11\group_add_entry.xml" />
<AndroidResource Include="Resources\layout-v11\entry_view.xml" />
<AndroidResource Include="Resources\layout-v11\entry_edit.xml" />
<AndroidResource Include="Resources\layout-v11\SaveButton.xml" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />
<ItemGroup>

View File

@ -62,7 +62,7 @@ namespace keepass2android.view
LayoutInflater inflater = (LayoutInflater) Context.GetSystemService(Context.LayoutInflaterService);
inflater.Inflate(Resource.Layout.group_add_entry, this);
Button addEntry = (Button) FindViewById(Resource.Id.add_entry);
View addEntry = FindViewById(Resource.Id.add_entry);
addEntry.Visibility = ViewStates.Invisible;
}