mirror of
https://github.com/moparisthebest/keepass2android
synced 2024-11-28 20:12:21 -05:00
fixed issues in GeneratePassword and CreateDatabaseActivity
This commit is contained in:
parent
6095f32b08
commit
6bb4e69f38
@ -5,6 +5,7 @@ using Android.Content.PM;
|
|||||||
using Android.Graphics.Drawables;
|
using Android.Graphics.Drawables;
|
||||||
using Android.OS;
|
using Android.OS;
|
||||||
using Android.Preferences;
|
using Android.Preferences;
|
||||||
|
using Android.Support.V7.App;
|
||||||
using Android.Text;
|
using Android.Text;
|
||||||
using Android.Views;
|
using Android.Views;
|
||||||
using Android.Widget;
|
using Android.Widget;
|
||||||
@ -20,7 +21,7 @@ namespace keepass2android
|
|||||||
[Activity(Label = "@string/app_name",
|
[Activity(Label = "@string/app_name",
|
||||||
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.KeyboardHidden,
|
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.KeyboardHidden,
|
||||||
Theme = "@style/MyTheme_ActionBar")]
|
Theme = "@style/MyTheme_ActionBar")]
|
||||||
public class CreateDatabaseActivity : Activity
|
public class CreateDatabaseActivity : AppCompatActivity
|
||||||
{
|
{
|
||||||
private IOConnectionInfo _ioc;
|
private IOConnectionInfo _ioc;
|
||||||
private string _keyfileFilename;
|
private string _keyfileFilename;
|
||||||
@ -57,6 +58,9 @@ namespace keepass2android
|
|||||||
base.OnCreate(bundle);
|
base.OnCreate(bundle);
|
||||||
_design.ApplyTheme();
|
_design.ApplyTheme();
|
||||||
|
|
||||||
|
SupportActionBar.SetDisplayHomeAsUpEnabled(true);
|
||||||
|
SupportActionBar.SetHomeButtonEnabled(true);
|
||||||
|
|
||||||
SetContentView(Resource.Layout.create_database);
|
SetContentView(Resource.Layout.create_database);
|
||||||
_appTask = AppTask.GetTaskInOnCreate(bundle, Intent);
|
_appTask = AppTask.GetTaskInOnCreate(bundle, Intent);
|
||||||
|
|
||||||
@ -578,6 +582,15 @@ namespace keepass2android
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public override bool OnOptionsItemSelected(IMenuItem item)
|
||||||
|
{
|
||||||
|
switch (item.ItemId)
|
||||||
|
{
|
||||||
|
case Android.Resource.Id.Home:
|
||||||
|
OnBackPressed();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -26,7 +26,7 @@ using Android.Widget;
|
|||||||
|
|
||||||
namespace keepass2android
|
namespace keepass2android
|
||||||
{
|
{
|
||||||
[Activity(Label = "@string/app_name", Theme = "@style/MyTheme_ActionBar")]
|
[Activity(Label = "@string/app_name", Theme = "@style/MyTheme_ActionBar", WindowSoftInputMode = SoftInput.StateHidden)]
|
||||||
public class GeneratePasswordActivity : LockCloseActivity {
|
public class GeneratePasswordActivity : LockCloseActivity {
|
||||||
private readonly int[] _buttonIds = new[] {Resource.Id.btn_length6, Resource.Id.btn_length8, Resource.Id.btn_length12, Resource.Id.btn_length16};
|
private readonly int[] _buttonIds = new[] {Resource.Id.btn_length6, Resource.Id.btn_length8, Resource.Id.btn_length12, Resource.Id.btn_length16};
|
||||||
|
|
||||||
@ -109,6 +109,9 @@ namespace keepass2android
|
|||||||
EditText txtPasswordToSet = (EditText) FindViewById(Resource.Id.password);
|
EditText txtPasswordToSet = (EditText) FindViewById(Resource.Id.password);
|
||||||
txtPasswordToSet.Text = GeneratePassword();
|
txtPasswordToSet.Text = GeneratePassword();
|
||||||
|
|
||||||
|
SupportActionBar.SetDisplayHomeAsUpEnabled(true);
|
||||||
|
SupportActionBar.SetHomeButtonEnabled(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String GeneratePassword() {
|
public String GeneratePassword() {
|
||||||
@ -157,6 +160,18 @@ namespace keepass2android
|
|||||||
|
|
||||||
return password;
|
return password;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public override bool OnOptionsItemSelected(IMenuItem item)
|
||||||
|
{
|
||||||
|
switch (item.ItemId)
|
||||||
|
{
|
||||||
|
case Android.Resource.Id.Home:
|
||||||
|
OnBackPressed();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,51 +2,53 @@
|
|||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent">
|
android:layout_height="fill_parent">
|
||||||
<LinearLayout
|
|
||||||
|
<RelativeLayout
|
||||||
|
|
||||||
android:id="@+id/bottom_bar"
|
android:id="@+id/bottom_bar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:divider="?android:attr/dividerVertical"
|
|
||||||
android:showDividers="middle"
|
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:dividerPadding="12dp"
|
|
||||||
android:baselineAligned="false">
|
android:baselineAligned="false">
|
||||||
<FrameLayout
|
<Button
|
||||||
android:id="@+id/accept_button"
|
android:id="@+id/cancel_button"
|
||||||
style="?android:attr/actionButtonStyle"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="0dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_alignParentLeft="true"
|
||||||
android:layout_weight="1">
|
android:text="@android:string/cancel"
|
||||||
<TextView
|
android:drawableLeft="@android:drawable/ic_menu_close_clear_cancel"
|
||||||
style="?android:actionBarTabTextStyle"
|
style="@style/BottomBarButton" />
|
||||||
android:layout_width="wrap_content"
|
<Button
|
||||||
android:layout_height="wrap_content"
|
android:id="@+id/accept_button"
|
||||||
android:layout_gravity="center"
|
android:layout_width="wrap_content"
|
||||||
android:paddingRight="20dp"
|
android:layout_height="wrap_content"
|
||||||
android:drawableLeft="?attr/NavigationAcceptDrawable"
|
android:layout_alignParentRight="true"
|
||||||
android:drawablePadding="8dp"
|
android:text="@string/accept"
|
||||||
android:gravity="center_vertical"
|
android:drawableLeft="@drawable/navigation_accept"
|
||||||
android:text="@string/accept" />
|
style="@style/BottomBarButton" />
|
||||||
</FrameLayout>
|
</RelativeLayout>
|
||||||
<FrameLayout
|
|
||||||
|
<!--
|
||||||
|
<Button
|
||||||
|
android:id="@+id/accept_button"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:text="@string/accept"
|
||||||
|
style="@style/BottomBarButton" />
|
||||||
|
|
||||||
|
<Button
|
||||||
android:id="@+id/cancel_button"
|
android:id="@+id/cancel_button"
|
||||||
style="?android:attr/actionButtonStyle"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1">
|
|
||||||
<TextView
|
|
||||||
style="?android:actionBarTabTextStyle"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
|
||||||
android:paddingRight="20dp"
|
|
||||||
android:drawableLeft="?attr/CancelDrawable"
|
android:drawableLeft="?attr/CancelDrawable"
|
||||||
android:drawablePadding="8dp"
|
android:layout_alignParentLeft="true"
|
||||||
android:gravity="center_vertical"
|
android:text="@android:string/cancel"
|
||||||
android:text="@android:string/cancel" />
|
style="@style/BottomBarButton" />
|
||||||
</FrameLayout>
|
-->
|
||||||
</LinearLayout>
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
android:id="@+id/ScrollView"
|
android:id="@+id/ScrollView"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -55,7 +57,8 @@
|
|||||||
android:layout_marginBottom="12dip"
|
android:layout_marginBottom="12dip"
|
||||||
android:layout_marginLeft="12dip"
|
android:layout_marginLeft="12dip"
|
||||||
android:layout_marginRight="12dip"
|
android:layout_marginRight="12dip"
|
||||||
android:layout_marginTop="12dip">
|
android:layout_marginTop="12dip"
|
||||||
|
android:layout_alignParentTop="false">
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/RelativeLayout"
|
android:id="@+id/RelativeLayout"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -77,7 +80,6 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/length_label"
|
android:id="@+id/length_label"
|
||||||
android:text="@string/length"
|
android:text="@string/length"
|
||||||
style="@style/TextAppearance_SmallHeading"
|
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_below="@id/generate_password_button" />
|
android:layout_below="@id/generate_password_button" />
|
||||||
|
Loading…
Reference in New Issue
Block a user