From 15f73257faa7d7b38755bfede25bbe8df6147f82 Mon Sep 17 00:00:00 2001 From: Philipp Crocoll Date: Wed, 12 Aug 2015 06:40:14 +0200 Subject: [PATCH] 0.9.8-pre2 --- .../AndroidFileChooserBinding.csproj | 1 - .../JavaFileStorageBindings.csproj | 1 - .../KP2AKdbLibraryBinding.csproj | 1 - src/KeePass.sln | 32 ++- .../KeePassLib2Android.csproj | 2 +- .../SelectStorageLocationActivityBase.cs | 8 +- src/MasterKeePlugin/MasterKeePlugin.csproj | 1 + src/MaterialTest2/MainActivity.cs | 138 ++++++++++-- src/MaterialTest2/MaterialTest2.csproj | 201 ++++++++++++++++-- .../Properties/AndroidManifest.xml | 6 +- src/MaterialTest2/Resources/layout/Main.axml | 50 ----- .../Resources/layout/toolbar2.xml | 8 +- .../Resources/values-v21/styles.xml | 17 ++ .../Resources/values/Strings.xml | 1 + src/MaterialTest2/Resources/values/styles.xml | 155 +++++++++++++- src/MaterialTest2/packages.config | 5 +- src/PluginSdkBinding/PluginSdkBinding.csproj | 1 - .../JavaFileStorage/bin/javafilestorage.jar | Bin 535545 -> 535545 bytes .../KP2AKdbLibrary/bin/kp2akdblibrary.jar | Bin 374936 -> 374936 bytes .../bin/keepass2androidpluginsdk.jar | Bin 20359 -> 20359 bytes .../LockingPreferenceActivity.cs | 107 +++++++++- .../Properties/AndroidManifest_debug.xml | 2 +- .../Properties/AndroidManifest_net.xml | 4 +- .../Resources/values/strings.xml | 4 +- .../settings/AppSettingsActivity.cs | 1 + .../MonoDroidUnitTesting.csproj | 1 - 26 files changed, 642 insertions(+), 105 deletions(-) delete mode 100644 src/MaterialTest2/Resources/layout/Main.axml diff --git a/src/AndroidFileChooserBinding/AndroidFileChooserBinding.csproj b/src/AndroidFileChooserBinding/AndroidFileChooserBinding.csproj index 7b39d548..737d4c18 100644 --- a/src/AndroidFileChooserBinding/AndroidFileChooserBinding.csproj +++ b/src/AndroidFileChooserBinding/AndroidFileChooserBinding.csproj @@ -10,7 +10,6 @@ AndroidFileChooserBinding AndroidFileChooserBinding 512 - v2.2 true diff --git a/src/JavaFileStorageBindings/JavaFileStorageBindings.csproj b/src/JavaFileStorageBindings/JavaFileStorageBindings.csproj index 12bf66f1..d96be630 100644 --- a/src/JavaFileStorageBindings/JavaFileStorageBindings.csproj +++ b/src/JavaFileStorageBindings/JavaFileStorageBindings.csproj @@ -10,7 +10,6 @@ JavaFileStorageBindings JavaFileStorageBindings 512 - v2.2 true diff --git a/src/KP2AKdbLibraryBinding/KP2AKdbLibraryBinding.csproj b/src/KP2AKdbLibraryBinding/KP2AKdbLibraryBinding.csproj index 2bb393b7..74b84473 100644 --- a/src/KP2AKdbLibraryBinding/KP2AKdbLibraryBinding.csproj +++ b/src/KP2AKdbLibraryBinding/KP2AKdbLibraryBinding.csproj @@ -10,7 +10,6 @@ KP2AKdbLibraryBinding KP2AKdbLibraryBinding 512 - v2.2 true diff --git a/src/KeePass.sln b/src/KeePass.sln index 8a0931b9..9ec7b121 100644 --- a/src/KeePass.sln +++ b/src/KeePass.sln @@ -1,6 +1,8 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 +# Visual Studio 2013 +VisualStudioVersion = 12.0.31101.0 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeePassLib2Android", "KeePassLib2Android\KeePassLib2Android.csproj", "{545B4A6B-8BBA-4FBE-92FC-4AC060122A54}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "keepass2android", "keepass2android\keepass2android.csproj", "{A6CF8A86-37C1-4197-80FE-519DE2C842F5}" @@ -41,6 +43,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MaterialTest", "MaterialTes EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MaterialTest2", "MaterialTest2\MaterialTest2.csproj", "{B7BBC4A2-0301-4DFF-B03C-C88CD4F1F890}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MaterialTest3", "MaterialTest3\MaterialTest3.csproj", "{4512BF32-7443-4BF9-B46B-80E7F2D41B36}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -81,6 +85,7 @@ Global {545B4A6B-8BBA-4FBE-92FC-4AC060122A54}.ReleaseNoNet|x64.ActiveCfg = ReleaseNoNet|Any CPU {A6CF8A86-37C1-4197-80FE-519DE2C842F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A6CF8A86-37C1-4197-80FE-519DE2C842F5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A6CF8A86-37C1-4197-80FE-519DE2C842F5}.Debug|Any CPU.Deploy.0 = Debug|Any CPU {A6CF8A86-37C1-4197-80FE-519DE2C842F5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {A6CF8A86-37C1-4197-80FE-519DE2C842F5}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {A6CF8A86-37C1-4197-80FE-519DE2C842F5}.Debug|Mixed Platforms.Deploy.0 = Debug|Any CPU @@ -434,6 +439,7 @@ Global {83B92CEE-9923-44E6-B0B4-9930D0BFE95E}.ReleaseNoNet|x64.ActiveCfg = Release|Any CPU {B7BBC4A2-0301-4DFF-B03C-C88CD4F1F890}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B7BBC4A2-0301-4DFF-B03C-C88CD4F1F890}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B7BBC4A2-0301-4DFF-B03C-C88CD4F1F890}.Debug|Any CPU.Deploy.0 = Debug|Any CPU {B7BBC4A2-0301-4DFF-B03C-C88CD4F1F890}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {B7BBC4A2-0301-4DFF-B03C-C88CD4F1F890}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {B7BBC4A2-0301-4DFF-B03C-C88CD4F1F890}.Debug|Mixed Platforms.Deploy.0 = Debug|Any CPU @@ -457,6 +463,30 @@ Global {B7BBC4A2-0301-4DFF-B03C-C88CD4F1F890}.ReleaseNoNet|Win32.Build.0 = Release|Any CPU {B7BBC4A2-0301-4DFF-B03C-C88CD4F1F890}.ReleaseNoNet|x64.ActiveCfg = Release|Any CPU {B7BBC4A2-0301-4DFF-B03C-C88CD4F1F890}.ReleaseNoNet|x64.Build.0 = Release|Any CPU + {4512BF32-7443-4BF9-B46B-80E7F2D41B36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4512BF32-7443-4BF9-B46B-80E7F2D41B36}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4512BF32-7443-4BF9-B46B-80E7F2D41B36}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {4512BF32-7443-4BF9-B46B-80E7F2D41B36}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {4512BF32-7443-4BF9-B46B-80E7F2D41B36}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {4512BF32-7443-4BF9-B46B-80E7F2D41B36}.Debug|Mixed Platforms.Deploy.0 = Debug|Any CPU + {4512BF32-7443-4BF9-B46B-80E7F2D41B36}.Debug|Win32.ActiveCfg = Debug|Any CPU + {4512BF32-7443-4BF9-B46B-80E7F2D41B36}.Debug|x64.ActiveCfg = Debug|Any CPU + {4512BF32-7443-4BF9-B46B-80E7F2D41B36}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4512BF32-7443-4BF9-B46B-80E7F2D41B36}.Release|Any CPU.Build.0 = Release|Any CPU + {4512BF32-7443-4BF9-B46B-80E7F2D41B36}.Release|Any CPU.Deploy.0 = Release|Any CPU + {4512BF32-7443-4BF9-B46B-80E7F2D41B36}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {4512BF32-7443-4BF9-B46B-80E7F2D41B36}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {4512BF32-7443-4BF9-B46B-80E7F2D41B36}.Release|Mixed Platforms.Deploy.0 = Release|Any CPU + {4512BF32-7443-4BF9-B46B-80E7F2D41B36}.Release|Win32.ActiveCfg = Release|Any CPU + {4512BF32-7443-4BF9-B46B-80E7F2D41B36}.Release|x64.ActiveCfg = Release|Any CPU + {4512BF32-7443-4BF9-B46B-80E7F2D41B36}.ReleaseNoNet|Any CPU.ActiveCfg = Release|Any CPU + {4512BF32-7443-4BF9-B46B-80E7F2D41B36}.ReleaseNoNet|Any CPU.Build.0 = Release|Any CPU + {4512BF32-7443-4BF9-B46B-80E7F2D41B36}.ReleaseNoNet|Any CPU.Deploy.0 = Release|Any CPU + {4512BF32-7443-4BF9-B46B-80E7F2D41B36}.ReleaseNoNet|Mixed Platforms.ActiveCfg = Release|Any CPU + {4512BF32-7443-4BF9-B46B-80E7F2D41B36}.ReleaseNoNet|Mixed Platforms.Build.0 = Release|Any CPU + {4512BF32-7443-4BF9-B46B-80E7F2D41B36}.ReleaseNoNet|Mixed Platforms.Deploy.0 = Release|Any CPU + {4512BF32-7443-4BF9-B46B-80E7F2D41B36}.ReleaseNoNet|Win32.ActiveCfg = Release|Any CPU + {4512BF32-7443-4BF9-B46B-80E7F2D41B36}.ReleaseNoNet|x64.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/KeePassLib2Android/KeePassLib2Android.csproj b/src/KeePassLib2Android/KeePassLib2Android.csproj index 5518fc46..f70ba567 100644 --- a/src/KeePassLib2Android/KeePassLib2Android.csproj +++ b/src/KeePassLib2Android/KeePassLib2Android.csproj @@ -12,7 +12,7 @@ Resources\Resource.designer.cs Resource KeePassLib2Android - v4.0 + v4.0.3 True diff --git a/src/Kp2aBusinessLogic/SelectStorageLocationActivityBase.cs b/src/Kp2aBusinessLogic/SelectStorageLocationActivityBase.cs index 9e94df4a..c5ce53bc 100644 --- a/src/Kp2aBusinessLogic/SelectStorageLocationActivityBase.cs +++ b/src/Kp2aBusinessLogic/SelectStorageLocationActivityBase.cs @@ -21,10 +21,10 @@ namespace keepass2android WriteDemanded = 2 } - protected const int RequestCodeFileStorageSelectionForPrimarySelect = 983713; - private const int RequestCodeFileStorageSelectionForCopyToWritableLocation = 983714; - private const int RequestCodeFileFileBrowseForWritableLocation = 983715; - private const int RequestCodeFileBrowseForOpen = 983716; + protected const int RequestCodeFileStorageSelectionForPrimarySelect = 33713; + private const int RequestCodeFileStorageSelectionForCopyToWritableLocation = 33714; + private const int RequestCodeFileFileBrowseForWritableLocation = 33715; + private const int RequestCodeFileBrowseForOpen = 33716; protected IOConnectionInfo _selectedIoc; diff --git a/src/MasterKeePlugin/MasterKeePlugin.csproj b/src/MasterKeePlugin/MasterKeePlugin.csproj index 032ef79b..93999f4c 100644 --- a/src/MasterKeePlugin/MasterKeePlugin.csproj +++ b/src/MasterKeePlugin/MasterKeePlugin.csproj @@ -15,6 +15,7 @@ Off True Properties\AndroidManifest.xml + v5.0 true diff --git a/src/MaterialTest2/MainActivity.cs b/src/MaterialTest2/MainActivity.cs index b3f1b877..0405c351 100644 --- a/src/MaterialTest2/MainActivity.cs +++ b/src/MaterialTest2/MainActivity.cs @@ -1,19 +1,72 @@ using System; using Android.App; using Android.Content; +using Android.Graphics; using Android.Runtime; using Android.Support.V4.View; using Android.Support.V4.Widget; using Android.Support.V7.App; + +using Android.Support.Design.Widget; + using Android.Views; using Android.Widget; using Android.OS; - +using Android.Util; using Toolbar = Android.Support.V7.Widget.Toolbar; namespace MaterialTest2 { - [Activity(Theme="@style/MyTheme", Label = "MaterialTest", MainLauncher = true, Icon = "@drawable/icon")] - public class MainActivity : ActionBarActivity + public class MyDrawerLayout : Android.Support.V4.Widget.DrawerLayout + { + private bool _fitsSystemWindows; + + protected MyDrawerLayout(IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer) + { + } + + public MyDrawerLayout(Context context, IAttributeSet attrs, int defStyle) : base(context, attrs, defStyle) + { + } + + public MyDrawerLayout(Context context, IAttributeSet attrs) : base(context, attrs) + { + } + + public MyDrawerLayout(Context context) : base(context) + { + } + + private int[] mInsets = new int[4]; + + protected override bool FitSystemWindows(Rect insets) + { + if (Build.VERSION.SdkInt >= Build.VERSION_CODES.Kitkat) + { + // Intentionally do not modify the bottom inset. For some reason, + // if the bottom inset is modified, window resizing stops working. + // TODO: Figure out why. + + mInsets[0] = insets.Left; + mInsets[1] = insets.Top; + mInsets[2] = insets.Right; + + insets.Left = 0; + insets.Top = 0; + insets.Right = 0; + } + + return base.FitSystemWindows(insets); + + } + public int[] GetInsets() + { + return mInsets; + } + } + + + [Activity(Theme="@style/MyTheme", Label = "MaterialTest", MainLauncher = false, Icon = "@drawable/icon", WindowSoftInputMode = SoftInput.AdjustResize)] + public class MainActivity : AppCompatActivity { int count = 1; @@ -23,6 +76,23 @@ namespace MaterialTest2 private string mDrawerTitle; + public override bool OnCreateOptionsMenu(IMenu menu) + { + MenuInflater.Inflate(Resource.Menu.menu_password, menu); + return true; + } + + public override bool OnOptionsItemSelected(IMenuItem item) + { + switch (item.ItemId) + { + case Android.Resource.Id.Home: + mDrawerLayout.OpenDrawer(Android.Support.V4.View.GravityCompat.Start); + return true; + } + return base.OnOptionsItemSelected(item); + } + protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); @@ -32,7 +102,7 @@ namespace MaterialTest2 mDrawerTitle = this.Title; //mPlanetTitles = this.Resources.GetStringArray (Resource.Array.planets_array); - mDrawerLayout = FindViewById(Resource.Id.drawerLayout); + mDrawerLayout = FindViewById(Resource.Id.drawer_layout); //mDrawerList = FindViewById (Resource.Id.left_drawer); @@ -40,7 +110,7 @@ namespace MaterialTest2 // improve performance by indicating the list if fixed size. //mDrawerList.HasFixedSize = true; //mDrawerList.SetLayoutManager (new LinearLayoutManager (this)); - + NavigationView nv; // set up the drawer's list view with items and click listener //mDrawerList.SetAdapter (new PlanetAdapter (mPlanetTitles, this)); // enable ActionBar app icon to behave as action to toggle nav drawer @@ -59,18 +129,62 @@ namespace MaterialTest2 // and attach an event to it Button button = FindViewById