changes to implement material design/fix flaws and issues in the major activities. More testing pending.

This commit is contained in:
Philipp Crocoll
2024-12-10 18:35:02 +01:00
parent ed9cd7180c
commit e14cd62e75
22 changed files with 248 additions and 177 deletions

View File

@@ -140,15 +140,13 @@ namespace keepass2android
CreateDatabase(Intent.GetBooleanExtra("MakeCurrent",true));
};
ImageButton btnTogglePassword = (ImageButton)FindViewById(Resource.Id.toggle_password);
Button btnTogglePassword = (Button)FindViewById(Resource.Id.toggle_password);
btnTogglePassword.Click += (sender, e) =>
{
_showPassword = !_showPassword;
MakePasswordMaskedOrVisible();
};
Android.Graphics.PorterDuff.Mode mMode = Android.Graphics.PorterDuff.Mode.SrcAtop;
Android.Graphics.Color color = new Android.Graphics.Color (224, 224, 224);
btnTogglePassword.SetColorFilter (color, mMode);
Util.SetNoPersonalizedLearning(FindViewById(Resource.Id.root));

View File

@@ -1211,10 +1211,13 @@ namespace keepass2android
if (PreferenceManager.GetDefaultSharedPreferences(this).GetBoolean(
"ShowGroupInEntry", false))
{
groupName = Entry.ParentGroup.GetFullPath();
groupName = Entry.ParentGroup?.GetFullPath();
}
PopulateText(viewId, containerViewId, groupName);
_stringViews.Add (key, new StandardStringView (new List<int>{viewId}, containerViewId, this));
PopulateText(viewId, containerViewId, groupName);
_stringViews.Add(key, new StandardStringView(new List<int> { viewId }, containerViewId, this));
}
private void RequiresRefresh()

View File

@@ -52,6 +52,7 @@ using File = System.IO.File;
using Object = Java.Lang.Object;
using Uri = Android.Net.Uri;
using Resource = keepass2android_appSdkStyle.Resource;
using Google.Android.Material.TextField;
namespace keepass2android
{
@@ -260,16 +261,6 @@ namespace keepass2android
SupportActionBar.SetDisplayHomeAsUpEnabled(true);
SupportActionBar.SetHomeButtonEnabled(true);
// Respect mask password setting
MakePasswordVisibleOrHidden();
Button btnTogglePassword = (Button)FindViewById(Resource.Id.toggle_password);
btnTogglePassword.Click += (sender, e) =>
{
State.ShowPassword = !State.ShowPassword;
MakePasswordVisibleOrHidden();
};
Button addButton = (Button) FindViewById(Resource.Id.add_advanced);
addButton.Visibility = ViewStates.Visible;
@@ -437,24 +428,7 @@ namespace keepass2android
;
}
private void MakePasswordVisibleOrHidden()
{
EditText password = (EditText) FindViewById(Resource.Id.entry_password);
TextView confpassword = (TextView) FindViewById(Resource.Id.entry_confpassword);
int selStart = password.SelectionStart, selEnd = password.SelectionEnd;
if (State.ShowPassword)
{
password.InputType = InputTypes.ClassText | InputTypes.TextVariationVisiblePassword;
_passwordFont.ApplyTo(password);
confpassword.Visibility = ViewStates.Gone;
}
else
{
password.InputType = InputTypes.ClassText | InputTypes.TextVariationPassword;
confpassword.Visibility = ViewStates.Visible;
}
password.SetSelection(selStart, selEnd);
}
void SaveEntry()
{
@@ -1092,11 +1066,12 @@ namespace keepass2android
RelativeLayout ees = (RelativeLayout)LayoutInflater.Inflate(Resource.Layout.entry_edit_section, null);
ees.Tag = pair.Key;
var keyView = ((TextView)ees.FindViewById(Resource.Id.extrakey));
var titleView = ((TextView)ees.FindViewById(Resource.Id.title));
keyView.Text = pair.Key;
titleView.Text = title;
((TextView)ees.FindViewById(Resource.Id.value)).Text = pair.Value.ReadString();
((TextView)ees.FindViewById(Resource.Id.value)).TextChanged += (sender, e) => State.EntryModified = true;
((TextInputLayout)ees.FindViewById(Resource.Id.value_container)).Hint = pair.Key;
((TextView)ees.FindViewById(Resource.Id.value)).TextChanged += (sender, e) => State.EntryModified = true;
_passwordFont.ApplyTo(((TextView)ees.FindViewById(Resource.Id.value)));
((CheckBox)ees.FindViewById(Resource.Id.protection)).Checked = pair.Value.IsProtected;
@@ -1346,10 +1321,15 @@ namespace keepass2android
builder.SetPositiveButton(Android.Resource.String.Ok, (o, args) =>
{
CopyFieldFromExtraDialog(sender, o, Resource.Id.title, Resource.Id.extrakey);
CopyFieldFromExtraDialog(sender, o, Resource.Id.title, Resource.Id.title);
CopyFieldFromExtraDialog(sender, o, Resource.Id.value, Resource.Id.value);
CopyCheckboxFromExtraDialog(sender, o, Resource.Id.protection);
});
var sourceFieldTitle = (EditText)((Dialog)o).FindViewById(Resource.Id.title);
var sourceFieldValue = (EditText)((Dialog)o).FindViewById(Resource.Id.value);
var targetField = ((TextView)((View)sender.Parent).FindViewById(Resource.Id.value));
var targetFieldContainer = ((TextInputLayout)((View)sender.Parent).FindViewById(Resource.Id.value_container));
targetField.Text = sourceFieldValue.Text;
targetFieldContainer.Hint = sourceFieldTitle.Text;
});
Dialog dialog = builder.Create();
//setup delete button:
@@ -1410,7 +1390,7 @@ namespace keepass2android
String password = State.Entry.Strings.ReadSafe(PwDefs.PasswordField);
PopulateText(Resource.Id.entry_password, password);
PopulateText(Resource.Id.entry_confpassword, password);
_passwordFont.ApplyTo(FindViewById<EditText>(Resource.Id.entry_password));
@@ -1510,17 +1490,6 @@ namespace keepass2android
return false;
}
if (!State.ShowPassword)
{
// Validate password
String pass = Util.GetEditText(this, Resource.Id.entry_password);
String conf = Util.GetEditText(this, Resource.Id.entry_confpassword);
if (!pass.Equals(conf))
{
Toast.MakeText(this, Resource.String.error_pass_match, ToastLength.Long).Show();
return false;
}
}
// Validate expiry date

View File

@@ -141,6 +141,7 @@ namespace keepass2android
SetContentView(Resource.Layout.generate_password);
SetResult(KeePass.ExitNormal);
var prefs = GetPreferences(FileCreationMode.Private);
@@ -195,6 +196,7 @@ namespace keepass2android
_updateDisabled = true;
PopulateFieldsFromOptions(_profiles.LastUsedSettings);
_updateDisabled = false;
var profileSpinner = UpdateProfileSpinner();
@@ -462,36 +464,51 @@ namespace keepass2android
{
if (_updateDisabled)
return;
String password = GeneratePassword();
EditText txtPassword = (EditText) FindViewById(Resource.Id.password_edit);
txtPassword.Text = password;
var progressBar = FindViewById<ProgressBar>(Resource.Id.pb_password_strength);
var passwordBits = QualityEstimation.EstimatePasswordBits(password.ToCharArray());
progressBar.Progress = (int)passwordBits;
progressBar.Max = 128;
Color color = new Color(196, 63, 49);
if (passwordBits > 40)
{
color = new Color(219, 152, 55);
}
if (passwordBits > 64)
{
color = new Color(96, 138, 38);
}
if (passwordBits > 100)
{
color = new Color(31, 128, 31);
}
progressBar.ProgressDrawable.SetColorFilter(new PorterDuffColorFilter(color, PorterDuff.Mode.SrcIn));
FindViewById<TextView>(Resource.Id.tv_password_strength).Text = " " + passwordBits + " bits";
String password = "";
uint passwordBits = 0;
Task.Run(() =>
{
password = GeneratePassword();
passwordBits = QualityEstimation.EstimatePasswordBits(password.ToCharArray());
RunOnUiThread(() =>
{
EditText txtPassword = (EditText)FindViewById(Resource.Id.password_edit);
txtPassword.Text = password;
UpdateProfileSpinnerSelection();
var progressBar = FindViewById<ProgressBar>(Resource.Id.pb_password_strength);
progressBar.Progress = (int)passwordBits;
progressBar.Max = 128;
Color color = new Color(196, 63, 49);
if (passwordBits > 40)
{
color = new Color(219, 152, 55);
}
if (passwordBits > 64)
{
color = new Color(96, 138, 38);
}
if (passwordBits > 100)
{
color = new Color(31, 128, 31);
}
progressBar.ProgressDrawable.SetColorFilter(new PorterDuffColorFilter(color,
PorterDuff.Mode.SrcIn));
FindViewById<TextView>(Resource.Id.tv_password_strength).Text = " " + passwordBits + " bits";
UpdateProfileSpinnerSelection();
});
});
}
private void UpdateProfileSpinnerSelection()

View File

@@ -27,7 +27,7 @@ using KeePassLib.Utility;
namespace keepass2android
{
[Activity(Label = "@string/app_name")]
[Activity(Label = "@string/app_name", Theme= "@style/Kp2aTheme_Dialog")]
public class GroupEditActivity : LifecycleAwareActivity
{
public const String KeyParent = "parent";

View File

@@ -722,7 +722,7 @@ namespace keepass2android
mDrawerTitle = Title;
var btn = FindViewById<ImageButton>(Resource.Id.fingerprintbtn);
var btn = FindViewById(Resource.Id.fingerprintbtn);
btn.Click += (sender, args) =>
{
if (!string.IsNullOrEmpty((string)btn.Tag))

View File

@@ -0,0 +1,17 @@
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:name="path"
android:pathData="M 10.713 9.311 C 10.059 7.451 8.286 6.118 6.203 6.118 C 3.561 6.118 1.413 8.265 1.413 10.908 C 1.413 13.55 3.561 15.697 6.203 15.697 C 8.286 15.697 10.059 14.364 10.713 12.504 L 14.186 12.504 L 14.186 15.697 C 14.473 15.697 14.039 15.702 14.778 15.702 C 15.441 13.968 16.983 12.833 18.897 12.854 L 19.005 12.859 L 18.975 9.311 Z M 6.203 12.504 C 5.325 12.504 4.606 11.786 4.606 10.908 C 4.606 10.03 5.325 9.311 6.203 9.311 C 7.081 9.311 7.8 10.03 7.8 10.908 C 7.8 11.786 7.081 12.504 6.203 12.504 Z"
android:fillColor="?attr/colorControlNormal"
android:strokeWidth="1"/>
<path
android:name="path_1"
android:pathData="M 19.161 15.207 L 18.389 15.207 L 18.389 16.751 L 16.845 16.751 L 16.845 17.523 L 18.389 17.523 L 18.389 19.066 L 19.161 19.066 L 19.161 17.523 L 20.705 17.523 L 20.705 16.751 L 19.161 16.751 Z M 18.775 13.277 C 16.644 13.277 14.915 15.006 14.915 17.137 C 14.915 19.267 16.644 20.996 18.775 20.996 C 20.906 20.996 22.635 19.267 22.635 17.137 C 22.635 15.006 20.906 13.277 18.775 13.277 Z M 18.775 20.224 C 17.073 20.224 15.687 18.839 15.687 17.137 C 15.687 15.434 17.073 14.049 18.775 14.049 C 20.477 14.049 21.863 15.434 21.863 17.137 C 21.863 18.839 20.477 20.224 18.775 20.224 Z"
android:fillColor="?attr/colorControlNormal"
android:strokeWidth="1"/>
</vector>

View File

@@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Button xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/EditEntryButton"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_marginTop="-4dp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/baseline_add_circle_outline_24" />
style="?attr/materialButtonOutlinedStyle"
app:icon="@drawable/baseline_add_circle_outline_24"
/>

View File

@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Button xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/EditEntryButton"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_marginTop="-4dp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/baseline_delete_24" />
style="?attr/materialButtonOutlinedStyle"
app:icon="@drawable/baseline_delete_24" />

View File

@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="fill_parent"
android:padding="12dp"
android:layout_height="wrap_content">
<EditText
@@ -64,7 +66,9 @@
android:id="@+id/totp_length" />
<Button
android:drawableLeft="@drawable/baseline_camera_alt_24"
style="?attr/materialButtonOutlinedStyle"
app:icon="@drawable/baseline_camera_alt_24"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/totp_scan"

View File

@@ -87,18 +87,23 @@ android:layout_height="wrap_content">
<Button
android:id="@+id/generate_button"
style="?attr/materialIconButtonFilledStyle"
app:icon="@drawable/add_key"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="@string/ellipsis" />
<ImageButton
android:id="@+id/toggle_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/baseline_visibility_24"
android:layout_alignTop="@id/generate_button"
android:layout_toLeftOf="@id/generate_button"
/>
/>
<Button
android:id="@+id/toggle_password"
style="?attr/materialIconButtonFilledStyle"
app:icon="@drawable/baseline_visibility_24"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@id/generate_button"
android:layout_toLeftOf="@id/generate_button"
/>
<EditText
android:id="@+id/entry_password"
style="@style/TextAppearance_EditEntry_Value"

View File

@@ -1,9 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="12dp">
<com.google.android.material.textfield.TextInputLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
style="@style/Widget.MaterialComponents.AutoCompleteTextView.FilledBox"
android:id="@+id/title"
android:singleLine="true"
android:inputType="text"
@@ -12,23 +18,27 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/value"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/title"
android:inputType="textMultiLine"
android:hint="@string/field_value"/>
</com.google.android.material.textfield.TextInputLayout>
<CheckBox
android:id="@+id/protection"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/value"
android:text="@string/protection"/>
<Button
style="?attr/materialButtonOutlinedStyle"
app:icon="@drawable/baseline_delete_24"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/protection"
android:text="@string/delete_extra_string"
android:id="@+id/delete_extra" />
</RelativeLayout>
</LinearLayout>

View File

@@ -48,11 +48,10 @@
<LinearLayout
android:id="@+id/user_section"
style="@style/EntryEditSingleLine_container">
<ImageView
style="@style/EntryEditSingleLine_ImageView"
android:src="@drawable/baseline_account_circle_24" />
<com.google.android.material.textfield.TextInputLayout
style="@style/EntryEditSingleLine_TextInputLayout">
style="@style/EntryEditSingleLine_TextInputLayout"
app:startIconDrawable="@drawable/baseline_account_circle_24"
>
<EditText
style="@style/EntryEditSingleLine_EditText"
android:id="@+id/entry_user_name"
@@ -65,9 +64,6 @@
<LinearLayout
android:id="@+id/password_section"
style="@style/EntryEditSingleLine_container">
<ImageView
style="@style/EntryEditSingleLine_ImageView"
android:src="@drawable/baseline_password_24" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -77,6 +73,8 @@
android:layout_height="wrap_content">
<com.google.android.material.textfield.TextInputLayout
android:layout_weight="1"
app:startIconDrawable="@drawable/baseline_password_24"
app:endIconMode="password_toggle"
style="@style/EntryEditSingleLine_TextInputLayout">
<EditText
android:id="@+id/entry_password"
@@ -89,51 +87,30 @@
</com.google.android.material.textfield.TextInputLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="fill_parent"
android:paddingBottom="12dp"
android:layout_alignParentRight="true"
android:layout_centerVertical ="true"
android:orientation="horizontal">
<Button
style="?attr/materialIconButtonStyle"
android:id="@+id/toggle_password"
android:layout_width="wrap_content"
android:layout_gravity="center_vertical"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:layout_height="fill_parent"
app:icon="@drawable/baseline_visibility_24"
/>
<ImageButton
android:id="@+id/generate_button"
android:layout_gravity="center_vertical"
style="?attr/materialIconButtonFilledStyle"
app:icon="@drawable/add_key"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:src="@drawable/baseline_add_circle_outline_24"
android:layout_height="wrap_content"
/>
</LinearLayout>
</LinearLayout>
<EditText
android:id="@+id/entry_confpassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="0dp"
android:singleLine="true"
android:inputType="textPassword"
android:hint="confirm password"
android:importantForAccessibility="no"/>
</LinearLayout>
</LinearLayout>
<!-- URL -->
<LinearLayout
android:id="@+id/url_section"
style="@style/EntryEditSingleLine_container">
<ImageView
style="@style/EntryEditSingleLine_ImageView"
android:src="@drawable/baseline_link_24" />
<com.google.android.material.textfield.TextInputLayout
app:startIconDrawable="@drawable/baseline_link_24"
style="@style/EntryEditSingleLine_TextInputLayout">
<EditText
style="@style/EntryEditSingleLine_EditText"
@@ -147,10 +124,8 @@
<LinearLayout
android:id="@+id/comments_section"
style="@style/EntryEditSingleLine_container">
<ImageView
style="@style/EntryEditSingleLine_ImageView"
android:src="@drawable/baseline_comment_24" />
<com.google.android.material.textfield.TextInputLayout
app:startIconDrawable="@drawable/baseline_comment_24"
style="@style/EntryEditSingleLine_TextInputLayout">
<EditText
style="@style/EntryEditSingleLine_EditText"
@@ -177,11 +152,9 @@
android:orientation="vertical" />
<Button
android:id="@+id/add_advanced"
android:background="?android:selectableItemBackground"
android:textColor="?android:attr/textColorPrimary"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textAllCaps="true"
android:drawableLeft="@drawable/baseline_add_circle_outline_24"
style="?attr/materialButtonOutlinedStyle"
app:icon="@drawable/baseline_add_24"
android:paddingLeft="8dp"
android:layout_width="match_parent"
android:layout_weight="1"
@@ -228,10 +201,9 @@
<LinearLayout
android:id="@+id/tags_section"
style="@style/EntryEditSingleLine_container">
<ImageView
style="@style/EntryEditSingleLine_ImageView"
android:src="@drawable/baseline_label_24" />
<com.google.android.material.textfield.TextInputLayout
app:startIconDrawable="@drawable/baseline_label_24"
style="@style/EntryEditSingleLine_TextInputLayout">
<EditText
style="@style/EntryEditSingleLine_EditText"
@@ -245,10 +217,8 @@
<LinearLayout
android:id="@+id/entry_override_url_container"
style="@style/EntryEditSingleLine_container">
<ImageView
style="@style/EntryEditSingleLine_ImageView"
android:src="@drawable/baseline_link_24" />
<com.google.android.material.textfield.TextInputLayout
app:startIconDrawable="@drawable/baseline_link_24"
style="@style/EntryEditSingleLine_TextInputLayout">
<EditText
style="@style/EntryEditSingleLine_EditText"

View File

@@ -1,15 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:paddingTop="1dip"
android:gravity="center_vertical"
android:layout_height="wrap_content">
<Button
style="?attr/materialIconButtonStyle"
app:icon="@drawable/baseline_edit_24"
android:id="@+id/edit_extra"
android:text="…"
android:layout_width="40dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginRight="0dip"
@@ -30,20 +32,18 @@
android:layout_marginRight="0dip"
android:visibility="gone" />
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="0dip"
style="@style/EntryFieldHeader"
/>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/value_container"
style="?attr/textInputOutlinedDenseStyle"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/value"
android:hint="@string/field_value"
android:inputType="textMultiLine"
style="@style/EntryEditSingleLine_EditText"
android:layout_marginRight="0dip" />
</com.google.android.material.textfield.TextInputLayout>
>
<CheckBox
android:id="@+id/protection"

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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/entry_table"
android:layout_height="wrap_content"
@@ -33,11 +34,13 @@
android:orientation="horizontal"
android:clickable="true"
android:background="?android:attr/selectableItemBackground">
<ImageView
<Button
style="?attr/materialIconButtonStyle"
app:icon="@drawable/baseline_more_vert_24"
android:id="@+id/group_name_vdots"
android:layout_width="wrap_content"
android:layout_height="15dp"
android:src="@drawable/baseline_more_vert_24"
android:gravity="right|bottom"
android:layout_alignParentRight="true" />
<TextView
@@ -466,9 +469,11 @@
style="@style/EntryItem" />
<Button android:id="@+id/btn_restore_history"
style="?attr/materialButtonOutlinedStyle"
app:icon="@drawable/baseline_history_24"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/baseline_history_24"
android:text="@string/restore_history"
/>
@@ -476,7 +481,9 @@
<Button android:id="@+id/btn_remove_history"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/baseline_delete_24"
style="?attr/materialButtonOutlinedStyle"
app:icon="@drawable/baseline_delete_24"
android:text="@string/remove_history"
/>

View File

@@ -206,36 +206,42 @@
<Button
style="@style/Widget.Material3.Button.TextButton"
android:id="@+id/btn_length6"
android:text="6"
android:layout_height="wrap_content"
android:layout_width="50sp"
/>
<Button
style="@style/Widget.Material3.Button.TextButton"
android:id="@+id/btn_length8"
android:text="8"
android:layout_height="wrap_content"
android:layout_width="50sp"
/>
<Button
style="@style/Widget.Material3.Button.TextButton"
android:id="@+id/btn_length12"
android:text="12"
android:layout_height="wrap_content"
android:layout_width="50sp"
/>
<Button
style="@style/Widget.Material3.Button.TextButton"
android:id="@+id/btn_length16"
android:text="16"
android:layout_height="wrap_content"
android:layout_width="50sp"
/>
<Button
style="@style/Widget.Material3.Button.TextButton"
android:id="@+id/btn_length24"
android:text="24"
android:layout_height="wrap_content"
android:layout_width="50sp"
/>
<Button
style="@style/Widget.Material3.Button.TextButton"
android:id="@+id/btn_length32"
android:text="32"
android:layout_width="50sp"

View File

@@ -1,7 +1,9 @@
<?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">
android:layout_height="fill_parent"
android:padding="16dp"
>
<ImageButton
android:id="@+id/icon_button"
android:layout_width="64dp"
@@ -24,6 +26,8 @@
android:layout_height="wrap_content"
android:layout_below="@id/group_name"
android:minWidth="100sp"
android:layout_marginRight="8dp"
android:layout_marginTop="16dp"
android:text="@android:string/ok" />
<Button
android:id="@+id/cancel"
@@ -31,6 +35,7 @@
android:layout_height="wrap_content"
android:layout_below="@id/group_name"
android:layout_toRightOf="@id/ok"
android:layout_marginTop="16dp"
android:text="@android:string/cancel"
android:minWidth="100sp" />
</RelativeLayout>

View File

@@ -1,5 +1,7 @@
<resources>
<color name="md_theme_primary">#ACE668</color>
<color name="statusbar_color_green">#4B662C</color>
<color name="md_theme_primary">#ACE668</color>
<color name="md_theme_onPrimary">#1E3700</color>
<color name="md_theme_primaryContainer">#84BB43</color>
<color name="md_theme_onPrimaryContainer">#132600</color>

View File

@@ -1,5 +1,7 @@
<resources>
<color name="md_theme_primary">#4B662C</color>
<color name="statusbar_color_green">#4B662C</color>
<color name="md_theme_primary">#4B662C</color>
<color name="md_theme_onPrimary">#FFFFFF</color>
<color name="md_theme_primaryContainer">#CCEDA4</color>
<color name="md_theme_onPrimaryContainer">#0F2000</color>

View File

@@ -91,9 +91,6 @@
</style>
<style name="TextAppearance_SubElement">
<item name="android:textAppearance">?android:attr/textAppearanceMedium</item>
<item name="android:textSize">18sp</item>
<item name="android:textColor">?android:attr/textColorPrimary</item>
<item name="android:gravity">center_vertical</item>
<item name="android:layout_gravity">center_vertical</item>
<item name="android:layout_marginRight">12dip</item>

View File

@@ -197,13 +197,69 @@
<item name="colorSurfaceContainerHigh">@color/md_theme_surfaceContainerHigh</item>
<item name="colorSurfaceContainerHighest">@color/md_theme_surfaceContainerHighest</item>
</style>
<style name="Kp2aTheme_Dialog" parent="Theme.Material3.DayNight.Dialog">
<item name="kp2aToolbarWithCloseButtonStyle">@style/Widget.Kp2a.Toolbar.WithCloseButton</item>
<item name="colorSecondary">@color/md_theme_primary</item>
<item name="colorOnSecondary">@color/md_theme_onPrimary</item>
<item name="colorSecondaryContainer">@color/md_theme_primaryContainer</item>
<item name="colorOnSecondaryContainer">@color/md_theme_onPrimaryContainer</item>
<item name="colorPrimary">@color/md_theme_secondary</item>
<item name="colorOnPrimary">@color/md_theme_onSecondary</item>
<item name="colorPrimaryContainer">@color/md_theme_secondaryContainer</item>
<item name="colorOnPrimaryContainer">@color/md_theme_onSecondaryContainer</item>
<item name="colorTertiary">@color/md_theme_tertiary</item>
<item name="colorOnTertiary">@color/md_theme_onTertiary</item>
<item name="colorTertiaryContainer">@color/md_theme_tertiaryContainer</item>
<item name="colorOnTertiaryContainer">@color/md_theme_onTertiaryContainer</item>
<item name="colorError">@color/md_theme_error</item>
<item name="colorOnError">@color/md_theme_onError</item>
<item name="colorErrorContainer">@color/md_theme_errorContainer</item>
<item name="colorOnErrorContainer">@color/md_theme_onErrorContainer</item>
<item name="android:colorBackground">@color/md_theme_background</item>
<item name="colorOnBackground">@color/md_theme_onBackground</item>
<item name="colorSurface">@color/md_theme_surface</item>
<item name="colorOnSurface">@color/md_theme_onSurface</item>
<item name="colorSurfaceVariant">@color/md_theme_surfaceVariant</item>
<item name="colorOnSurfaceVariant">@color/md_theme_onSurfaceVariant</item>
<item name="colorOutline">@color/md_theme_outline</item>
<item name="colorOutlineVariant">@color/md_theme_outlineVariant</item>
<item name="colorSurfaceInverse">@color/md_theme_inverseSurface</item>
<item name="colorOnSurfaceInverse">@color/md_theme_inverseOnSurface</item>
<item name="colorPrimaryInverse">@color/md_theme_inversePrimary</item>
<item name="colorSecondaryFixed">@color/md_theme_primaryFixed</item>
<item name="colorOnSecondaryFixed">@color/md_theme_onPrimaryFixed</item>
<item name="colorSecondaryFixedDim">@color/md_theme_primaryFixedDim</item>
<item name="colorOnSecondaryFixedVariant">@color/md_theme_onPrimaryFixedVariant</item>
<item name="colorPrimaryFixed">@color/md_theme_secondaryFixed</item>
<item name="colorOnPrimaryFixed">@color/md_theme_onSecondaryFixed</item>
<item name="colorPrimaryFixedDim">@color/md_theme_secondaryFixedDim</item>
<item name="colorOnPrimaryFixedVariant">@color/md_theme_onSecondaryFixedVariant</item>
<item name="colorTertiaryFixed">@color/md_theme_tertiaryFixed</item>
<item name="colorOnTertiaryFixed">@color/md_theme_onTertiaryFixed</item>
<item name="colorTertiaryFixedDim">@color/md_theme_tertiaryFixedDim</item>
<item name="colorOnTertiaryFixedVariant">@color/md_theme_onTertiaryFixedVariant</item>
<item name="colorSurfaceDim">@color/md_theme_surfaceDim</item>
<item name="colorSurfaceBright">@color/md_theme_surfaceBright</item>
<item name="colorSurfaceContainerLowest">@color/md_theme_surfaceContainerLowest</item>
<item name="colorSurfaceContainerLow">@color/md_theme_surfaceContainerLow</item>
<item name="colorSurfaceContainer">@color/md_theme_surfaceContainer</item>
<item name="colorSurfaceContainerHigh">@color/md_theme_surfaceContainerHigh</item>
<item name="colorSurfaceContainerHighest">@color/md_theme_surfaceContainerHighest</item>
</style>
<style name="Kp2aTheme_ActionBar" parent="AppTheme.Primary"></style>
<style name="Kp2aTheme_ActionBar" parent="AppTheme.Primary">
<item name="android:statusBarColor">@color/statusbar_color_green</item></style>
<style name="Kp2aTheme_BlueActionBar" parent="AppTheme.Secondary"></style>
<style name="Kp2aTheme_NoActionBar" parent="AppTheme.Primary.NoActionBar"></style>
<style name="Kp2aTheme_BlueNoActionBar" parent="AppTheme.Secondary.NoActionBar"></style>
<style name="Kp2aTheme_NoActionBar" parent="AppTheme.Primary.NoActionBar">
<item name="android:statusBarColor">@color/statusbar_color_green</item>
</style>
<style name="Kp2aTheme_BlueNoActionBar" parent="AppTheme.Secondary.NoActionBar">
</style>
<style name="Widget.Kp2a.Toolbar" parent="Widget.Material3.Toolbar.OnSurface" />

View File

@@ -107,7 +107,7 @@ namespace keepass2android
public void ApplyDialogTheme()
{
//TODO still needed? _activity.SetTheme(Resource.Style.Base_Dialog);
_activity.SetTheme(Resource.Style.Kp2aTheme_Dialog);
}