Compare commits

...

13 Commits

Author SHA1 Message Date
Philipp Crocoll
9be215c295 Merge remote-tracking branch 'origin/master' into feature/scrollable-credential-dialogs 2025-07-29 12:06:22 +02:00
PhilippC
bb97a023de Merge pull request #2964 from PhilippC/v1.13
V1.13 fixes:
* fix QuickUnlock layout
* add an option to disable QuickUnlock blocking for cases where this is explicitly needed
2025-07-29 12:02:58 +02:00
Philipp Crocoll
edb4907bf5 add option to disable QuickUnlock blocking behavior, closes #2960 2025-07-29 10:53:02 +02:00
Philipp Crocoll
a718c7ed7e fix quickunlock layout also when showing the "blocked" message 2025-07-29 10:50:43 +02:00
Philipp Crocoll
4f11789f26 remove no longer used file 2025-07-29 10:22:37 +02:00
Philipp Crocoll
eb15861b13 fix QuickUnlock layout to close #2956 2025-07-29 10:22:18 +02:00
Philipp Crocoll
8c2c8049c8 make credential dialogs scrollable. Closes #2959 2025-07-29 09:49:10 +02:00
PhilippC
2f3761b0a7 Merge pull request #2949 from PhilippC/update/target-sdk-35
Update to .net 9 and Target SDK version 35
2025-07-22 16:01:07 +02:00
Philipp Crocoll
260bc8adb2 adjust layouts and colors for Edge-to-Edge with transparent status bar as is default in Android 35+ 2025-07-22 15:16:28 +02:00
Philipp Crocoll
87e979635b Merge remote-tracking branch 'origin/master' into update/target-sdk-35 2025-07-22 09:51:25 +02:00
PhilippC
0c9c163755 Merge pull request #2954 from PhilippC/ui-improvement/non-cancelable-dialogs
Make dialogs for SFTP, FTP, Mega, WebDav and Nextcloud not cancelable
2025-07-22 09:05:36 +02:00
Philipp Crocoll
c6a5362ecb update to target sdk version 35 2025-07-15 17:16:14 +02:00
Philipp Crocoll
93cf4f790c change TargetFramework to .net9 2025-07-15 13:41:58 +02:00
44 changed files with 283 additions and 167 deletions

View File

@@ -339,7 +339,7 @@ jobs:
with:
name: archive APK ('net' built on ${{ github.job }})
path: |
src/keepass2android-app/bin/Release/net8.0-android/publish/*.apk
src/keepass2android-app/bin/Release/net9.0-android/publish/*.apk
- name: Select the manifest
run: |
@@ -365,5 +365,5 @@ jobs:
with:
name: archive APK ('nonet' built on ${{ github.job }})
path: |
src/keepass2android-app/bin/Release/net8.0-android/publish/*.apk
src/keepass2android-app/bin/Release/net9.0-android/publish/*.apk

View File

@@ -130,8 +130,8 @@ jobs:
name: keepass2android_${{ matrix.target }}_${{ matrix.flavor }}
# the first line is for "apk" target, the second line is for "apk_split" target
path: |
src/keepass2android-app/bin/Release/net8.0-android/publish/*.apk
src/keepass2android-app/bin/Release/net8.0-android/*/publish/*.apk
src/keepass2android-app/bin/Release/net9.0-android/publish/*.apk
src/keepass2android-app/bin/Release/net9.0-android/*/publish/*.apk
- name: List apks
run: find . -type f -name "*.apk"
@@ -142,5 +142,5 @@ jobs:
with:
draft: true
files: |
src/keepass2android-app/bin/Release/net8.0-android/publish/*.apk
src/keepass2android-app/bin/Release/net8.0-android/*/publish/*.apk
src/keepass2android-app/bin/Release/net9.0-android/publish/*.apk
src/keepass2android-app/bin/Release/net9.0-android/*/publish/*.apk

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-android</TargetFramework>
<TargetFramework>net9.0-android</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-android</TargetFramework>
<TargetFramework>net9.0-android</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-android</TargetFramework>
<TargetFramework>net9.0-android</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-android</TargetFramework>
<TargetFramework>net9.0-android</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-android</TargetFramework>
<TargetFramework>net9.0-android</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-android</TargetFramework>
<TargetFramework>net9.0-android</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-android</TargetFramework>
<TargetFramework>net9.0-android</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-android</TargetFramework>
<TargetFramework>net9.0-android</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-android</TargetFramework>
<TargetFramework>net9.0-android</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-android</TargetFramework>
<TargetFramework>net9.0-android</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-android</TargetFramework>
<TargetFramework>net9.0-android</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
@@ -216,4 +219,5 @@
android:layout_marginLeft="5dp"
android:text="Resolve" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>

View File

@@ -1,4 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
@@ -36,4 +39,5 @@
android:hint="@string/hint_pass"
android:importantForAccessibility="no" />
</LinearLayout>
</LinearLayout>
</ScrollView>

View File

@@ -145,12 +145,14 @@ namespace keepass2android
protected override void OnCreate(Bundle savedInstanceState) {
_design.ApplyTheme();
base.OnCreate(savedInstanceState);
SetContentView(Resource.Layout.generate_password);
SetResult(KeePass.ExitNormal);
var prefs = GetPreferences(FileCreationMode.Private);
new Util.InsetListener(FindViewById(Resource.Id.main_container)).Apply();
var prefs = GetPreferences(FileCreationMode.Private);

View File

@@ -43,7 +43,7 @@
</queries>
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="34" />
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="35" />
<permission android:description="@string/permission_desc2" android:icon="@drawable/ic_notify_locked" android:label="KP2A entry search" android:name="keepass2android.keepass2android_debug.permission.KP2aInternalSearch" android:protectionLevel="signature" />
<permission android:description="@string/permission_desc3" android:icon="@drawable/ic_launcher" android:label="KP2A choose autofill dataset" android:name="keepass2android.keepass2android_debug.permission.Kp2aChooseAutofill" android:protectionLevel="signature" />
<application

View File

@@ -42,7 +42,7 @@
<action android:name="android.intent.action.VIEW" />
</intent>
</queries>
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="34" />
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="35" />
<permission android:description="@string/permission_desc2" android:icon="@drawable/ic_launcher" android:label="KP2A entry search" android:name="keepass2android.keepass2android.permission.KP2aInternalSearch" android:protectionLevel="signature" />
<permission android:description="@string/permission_desc3" android:icon="@drawable/ic_launcher" android:label="KP2A choose autofill dataset" android:name="keepass2android.keepass2android.permission.Kp2aChooseAutofill" android:protectionLevel="signature" />

View File

@@ -42,7 +42,7 @@
<action android:name="android.intent.action.VIEW" />
</intent>
</queries>
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="34" />
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="35" />
<permission android:description="@string/permission_desc2" android:icon="@drawable/ic_launcher_offline" android:label="KP2A entry search" android:name="keepass2android.keepass2android_nonet.permission.KP2aInternalSearch" android:protectionLevel="signature" />
<permission android:description="@string/permission_desc3" android:icon="@drawable/ic_launcher_offline" android:label="KP2A choose autofill dataset" android:name="keepass2android.keepass2android_nonet.permission.Kp2aChooseAutofill" android:protectionLevel="signature" />

View File

@@ -15,6 +15,36 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
along with Keepass2Android. If not, see <http://www.gnu.org/licenses/>.
*/
using Android.App;
using Android.Content;
using Android.Content.PM;
using Android.Database;
using Android.Graphics;
using Android.Graphics.Drawables;
using Android.OS;
using Android.Preferences;
using Android.Runtime;
using Android.Text;
using Android.Views;
using Android.Views.InputMethods;
using Android.Widget;
using AndroidX.AppCompat.App;
using AndroidX.CoordinatorLayout.Widget;
using AndroidX.Core.Content;
using AndroidX.Core.View;
using AndroidX.DrawerLayout.Widget;
using Google.Android.Material.AppBar;
using Google.Android.Material.Dialog;
using Java.Lang;
using Java.Net;
using KeeChallenge;
using keepass2android;
using keepass2android.Io;
using keepass2android.Utils;
using Keepass2android.Pluginsdk;
using KeePassLib.Keys;
using KeePassLib.Serialization;
using OtpKeyProv;
using System;
using System.Collections.Generic;
using System.IO;
@@ -23,49 +53,17 @@ using System.Net;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Serialization;
using keepass2android;
using Android.App;
using Android.Content;
using Android.Database;
using Android.Graphics.Drawables;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Views.InputMethods;
using Android.Widget;
using Java.Net;
using Android.Preferences;
using Android.Text;
using Android.Content.PM;
using Android.Graphics;
using AndroidX.AppCompat.App;
using AndroidX.CoordinatorLayout.Widget;
using AndroidX.Core.View;
using AndroidX.DrawerLayout.Widget;
using Google.Android.Material.AppBar;
using Google.Android.Material.Dialog;
using Java.Lang;
using KeePassLib.Keys;
using KeePassLib.Serialization;
using Keepass2android.Pluginsdk;
using OtpKeyProv;
using keepass2android.Io;
using keepass2android.Utils;
using File = Java.IO.File;
using FileNotFoundException = Java.IO.FileNotFoundException;
using Object = Java.Lang.Object;
using Process = Android.OS.Process;
using KeeChallenge;
using static Android.Locations.GpsStatus;
using AlertDialog = Android.App.AlertDialog;
using ClipboardManager = Android.Content.ClipboardManager;
using Enum = System.Enum;
using Exception = System.Exception;
using File = Java.IO.File;
using FileNotFoundException = Java.IO.FileNotFoundException;
using Object = Java.Lang.Object;
using Process = Android.OS.Process;
using String = System.String;
using Toolbar = AndroidX.AppCompat.Widget.Toolbar;
using AndroidX.Core.Content;
namespace keepass2android
{
@@ -651,7 +649,7 @@ namespace keepass2android
_activityDesign.ApplyTheme();
base.OnCreate(savedInstanceState);
_intentReceiver = new PasswordActivityBroadcastReceiver(this);
_intentReceiver = new PasswordActivityBroadcastReceiver(this);
IntentFilter filter = new IntentFilter();
filter.AddAction(Intent.ActionScreenOff);
ContextCompat.RegisterReceiver(this, _intentReceiver, filter, (int)ReceiverFlags.Exported);
@@ -1165,7 +1163,9 @@ namespace keepass2android
changeDbButton.Click += (sender, args) => GoToFileSelectActivity();
Util.MoveBottomBarButtons(Resource.Id.change_db, Resource.Id.pass_ok, Resource.Id.bottom_bar, this);
}
Util.InsetListener.ForBottomElement(FindViewById(Resource.Id.bottom_bar)).Apply();
Util.InsetListener.ForTopElement(FindViewById(Resource.Id.appbar)).Apply();
}
private void OnOk(bool usedFingerprintUnlock = false)
{
@@ -1425,18 +1425,20 @@ namespace keepass2android
App.Kp2a.SetQuickUnlockEnabled(cbQuickUnlock.Checked);
App.Kp2a.ScreenLockWasEnabledWhenOpeningDatabase =
(((KeyguardManager)GetSystemService(Context.KeyguardService)!)!).IsDeviceSecure;
App.Kp2a.QuickUnlockBlockedWhenDeviceNotSecureWhenOpeningDatabase = PreferenceManager.GetDefaultSharedPreferences(this)
.GetBoolean(GetString(Resource.String.QuickUnlockBlockedWhenDeviceNotSecure_key), true);
if ((_loadDbFileTask != null) && (App.Kp2a.OfflineMode != _loadDbTaskOffline))
if ((_loadDbFileTask != null) && (App.Kp2a.OfflineMode != _loadDbTaskOffline))
{
if (App.Kp2a == null)
if (App.Kp2a == null)
throw new NullPointerException("App.Kp2a");
//keep the loading result if we loaded in online-mode (now offline) and the task is completed
if (!App.Kp2a.OfflineMode || !_loadDbFileTask.IsCompleted)
{
//discard the pre-loading task
_loadDbFileTask = null;
_loadDbFileTask = null;
}
}
//avoid password being visible while loading:

View File

@@ -81,8 +81,11 @@ namespace keepass2android
SetContentView(Resource.Layout.QuickUnlock);
Util.InsetListener.ForBottomElement(FindViewById(Resource.Id.bottom_bar)).Apply();
Util.InsetListener.ForTopElement(FindViewById(Resource.Id.appbar)).Apply();
var collapsingToolbar = FindViewById<CollapsingToolbarLayout>(Resource.Id.collapsing_toolbar);
var collapsingToolbar = FindViewById<CollapsingToolbarLayout>(Resource.Id.collapsing_toolbar);
collapsingToolbar.SetTitle(GetString(Resource.String.QuickUnlock_prefs));
SetSupportActionBar(FindViewById<Toolbar>(Resource.Id.toolbar));
@@ -175,7 +178,7 @@ namespace keepass2android
App.Kp2a.Lock(false);
};
if (App.Kp2a.ScreenLockWasEnabledWhenOpeningDatabase == false)
if (App.Kp2a.ScreenLockWasEnabledWhenOpeningDatabase == false && App.Kp2a.QuickUnlockBlockedWhenDeviceNotSecureWhenOpeningDatabase)
{
FindViewById(Resource.Id.QuickUnlockForm).Visibility = ViewStates.Gone;
FindViewById(Resource.Id.QuickUnlockBlocked).Visibility = ViewStates.Visible;

View File

@@ -1,11 +1,11 @@
<?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:app="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fitsSystemWindows="true">
android:fitsSystemWindows="false">
<keepass2android.MeasuringLinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
@@ -17,7 +17,7 @@ android:fitsSystemWindows="true">
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:fitsSystemWindows="true">
android:fitsSystemWindows="false">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
@@ -28,7 +28,7 @@ android:fitsSystemWindows="true">
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
android:fitsSystemWindows="true"
android:fitsSystemWindows="false"
app:expandedTitleMarginStart="16dp"
app:expandedTitleMarginEnd="24dp"
app:expandedTitleMarginBottom="20sp">
@@ -78,11 +78,11 @@ android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="16dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:orientation="vertical"
android:id="@+id/QuickUnlockForm">
<TextView
@@ -94,6 +94,12 @@ android:paddingRight="16dp"
android:textSize="14sp"
/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:inputType="textPassword"
android:layout_width="wrap_content"
@@ -117,8 +123,8 @@ android:paddingRight="16dp"
android:src="@drawable/baseline_fingerprint_24"
android:scaleType="fitXY"
android:background="?android:selectableItemBackground" />
</LinearLayout>
</LinearLayout>

View File

@@ -1,4 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
@@ -75,4 +78,5 @@
/>
</LinearLayout>
</LinearLayout>
</ScrollView>

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main_container"
android:layout_width="fill_parent"
android:background="?android:attr/colorBackground"
android:layout_height="fill_parent">
@@ -322,4 +323,3 @@
</ScrollView>
</RelativeLayout>

View File

@@ -1,4 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
@@ -41,4 +44,5 @@
</LinearLayout>
</LinearLayout>
</ScrollView>

View File

@@ -1,4 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
@@ -27,4 +30,5 @@
android:importantForAccessibility="no"/>
</LinearLayout>
</LinearLayout>
</ScrollView>

View File

@@ -1,4 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
@@ -42,4 +45,5 @@
</LinearLayout>
</LinearLayout>
</ScrollView>

View File

@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<keepass2android.FixedDrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fitsSystemWindows="true">
>
<!-- activity view -->
<keepass2android.MeasuringLinearLayout
android:layout_width="fill_parent"
@@ -17,14 +17,13 @@
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:fitsSystemWindows="true">
android:layout_weight="1">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="@dimen/detail_backdrop_height"
android:fitsSystemWindows="true"
android:fitsSystemWindows="false"
android:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar">
<com.google.android.material.appbar.CollapsingToolbarLayout
@@ -32,14 +31,17 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
android:fitsSystemWindows="true"
app:expandedTitleMarginStart="48dp"
android:fitsSystemWindows="false"
app:collapsedTitleGravity="center"
app:expandedTitleGravity="bottom|left"
app:expandedTitleMarginStart="8dp"
app:expandedTitleMarginEnd="24dp"
app:expandedTitleMarginBottom="20sp">
<RelativeLayout xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:fitsSystemWindows="true"
android:fitsSystemWindows="false"
android:layout_height="fill_parent">
<ImageView
android:id="@+id/backdrop"
@@ -52,7 +54,7 @@
android:layout_alignParentBottom="true"
android:layout_marginBottom="0sp"
android:layout_marginLeft="48dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
@@ -446,4 +448,4 @@
</LinearLayout>
</ScrollView>
</com.google.android.material.navigation.NavigationView>
</keepass2android.FixedDrawerLayout>
</androidx.drawerlayout.widget.DrawerLayout>

View File

@@ -1,61 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="12dip">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/sftp_host"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:inputType="textNoSuggestions"
android:text="144.76.169.229"
android:hint="@string/hint_sftp_host" />
<TextView
android:id="@+id/portsep"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=":" />
<EditText
android:id="@+id/sftp_port"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:inputType="number"
android:text="22"
android:hint="@string/hint_sftp_port" />
</LinearLayout>
<EditText
android:id="@+id/sftp_user"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:text="philipp"
android:hint="@string/hint_username" />
<EditText
android:id="@+id/sftp_password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:singleLine="true"
android:text="l2uientTjVhvyfzNpksa"
android:hint="@string/hint_pass" />
<TextView
android:id="@+id/initial_dir"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dip"
android:layout_marginTop="4dip"
android:text="@string/initial_directory" />
<EditText
android:id="@+id/sftp_initial_dir"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:text="/home/philipp" />
</LinearLayout>

View File

@@ -1,4 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
@@ -197,3 +200,5 @@
/>
</LinearLayout>
</ScrollView>

View File

@@ -1,4 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
@@ -52,4 +55,5 @@
</LinearLayout>
</LinearLayout>
</ScrollView>

View File

@@ -1,7 +1,10 @@
<?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 xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/cred_username"
android:layout_width="fill_parent"
@@ -22,4 +25,5 @@
android:layout_below="@id/cred_password"
android:entries="@array/cred_remember_modes"
android:id="@+id/cred_remember_mode" />
</RelativeLayout>
</RelativeLayout>
</ScrollView>

View File

@@ -0,0 +1,22 @@
<resources>
<style name="Kp2aTheme_ActionBar" parent="AppTheme.Primary">
<item name="android:windowLightStatusBar">false</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
<style name="Kp2aTheme_BlueActionBar" parent="AppTheme.Secondary">
<item name="android:windowLightStatusBar">false</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
<style name="Kp2aTheme_NoActionBar" parent="AppTheme.Primary.NoActionBar">
<item name="android:windowLightStatusBar">false</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
<style name="Kp2aTheme_BlueNoActionBar" parent="AppTheme.Secondary.NoActionBar">
<item name="android:windowLightStatusBar">false</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
</resources>

View File

@@ -0,0 +1,22 @@
<resources>
<style name="Kp2aTheme_ActionBar" parent="AppTheme.Primary">
<item name="android:windowLightStatusBar">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
<style name="Kp2aTheme_BlueActionBar" parent="AppTheme.Secondary">
<item name="android:windowLightStatusBar">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
<style name="Kp2aTheme_NoActionBar" parent="AppTheme.Primary.NoActionBar">
<item name="android:windowLightStatusBar">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
<style name="Kp2aTheme_BlueNoActionBar" parent="AppTheme.Secondary.NoActionBar">
<item name="android:windowLightStatusBar">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
</resources>

View File

@@ -123,6 +123,7 @@
<string name="QuickUnlockLength_default">3</string>
<string name="QuickUnlockIconHidden_key">QuickUnlockIconHidden_key</string>
<string name="QuickUnlockIconHidden16_key">QuickUnlockIconHidden16_key</string>
<string name="QuickUnlockBlockedWhenDeviceNotSecure_key">QuickUnlockBlockedWhenDeviceNotSecure_key</string>
<string name="UsageCount_key">UsageCount</string>
<string name="LastInfoVersionCode_key">LastInfoVersion</string>

View File

@@ -4,7 +4,7 @@
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="detail_backdrop_height">200dp</dimen>
<dimen name="detail_backdrop_height">250dp</dimen>
<dimen name="fab_margin">16dp</dimen>
<dimen name="splash_logo_width">79dp</dimen>

View File

@@ -330,6 +330,8 @@
<string name="QuickUnlockIconHidden_summary">QuickUnlock unfortunately does not work without displaying a notification icon. Select this option to use a transparent icon.</string>
<string name="QuickUnlockIconHidden16_title">Hide QuickUnlock icon</string>
<string name="QuickUnlockIconHidden16_summary">QuickUnlock requires a notification to work properly. Select this option to display a notification without an icon.</string>
<string name="QuickUnlockBlockedWhenDeviceNotSecure_summary">Block entering the QuickUnlock key if the device is not secured by screen lock. This prevents shoulder surfing attacks. Only disable this option if you understand the risk. Note that QuickUnlock can still be used with biometrics.</string>
<string name="QuickUnlockBlockedWhenDeviceNotSecure_title">Block QuickUnlock when device is not secure</string>
<string name="QuickUnlockLength_title">Length of QuickUnlock key</string>
<string name="QuickUnlockLength_summary">Maximum number of characters used as QuickUnlock password.</string>
<string name="QuickUnlockHideLength_title">Hide QuickUnlock length</string>

View File

@@ -253,12 +253,12 @@
<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 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>
<style name="Widget.Kp2a.Toolbar" parent="Widget.Material3.Toolbar.OnSurface" />

View File

@@ -26,6 +26,14 @@
android:defaultValue="false"
android:title="@string/QuickUnlockIconHidden_title"
android:key="@string/QuickUnlockIconHidden_key" />
<CheckBoxPreference
android:enabled="true"
android:persistent="true"
android:summary="@string/QuickUnlockBlockedWhenDeviceNotSecure_summary"
android:defaultValue="true"
android:title="@string/QuickUnlockBlockedWhenDeviceNotSecure_title"
android:key="@string/QuickUnlockBlockedWhenDeviceNotSecure_key" />
<CheckBoxPreference
android:enabled="true"
android:persistent="true"

View File

@@ -35,7 +35,9 @@ using Android.Graphics.Drawables;
using Android.Hardware.Display;
using Android.Util;
using Android.Views.InputMethods;
using AndroidX.Core.View;
using AndroidX.Core.View.InputMethod;
using AndroidX.ViewPager2.Widget;
using Google.Android.Material.Dialog;
using KeePass.Util;
using keepass2android;
@@ -738,7 +740,73 @@ namespace keepass2android
public class InsetListener: Java.Lang.Object, IOnApplyWindowInsetsListener
{
private View _targetView;
private readonly int _insetsType;
private int _initialPaddingLeft;
private int _initialPaddingTop;
private int _initialPaddingRight;
private int _initialPaddingBottom;
public bool EnabledPaddingLeft { get; set; } = true;
public bool EnablePaddingTop { get; set; } = true;
public bool EnablePaddingRight { get; set; } = true;
public bool EnablePaddingBottom { get; set; } = true;
public InsetListener(View targetView, int insetsType)
{
_targetView = targetView;
_insetsType = insetsType;
_initialPaddingLeft = targetView.PaddingLeft;
_initialPaddingTop = targetView.PaddingTop;
_initialPaddingRight = targetView.PaddingRight;
_initialPaddingBottom = targetView.PaddingBottom;
}
public InsetListener(View targetView): this(targetView, WindowInsetsCompat.Type.SystemBars())
{
}
public WindowInsetsCompat OnApplyWindowInsets(View v, WindowInsetsCompat insets)
{
var systemBarsInsets = insets.GetInsets(_insetsType);
_targetView.SetPadding(
_initialPaddingLeft + (EnabledPaddingLeft ? systemBarsInsets.Left : 0),
_initialPaddingTop + (EnablePaddingTop ? systemBarsInsets.Top : 0),
_initialPaddingRight + (EnablePaddingRight ? systemBarsInsets.Right : 0),
_initialPaddingBottom + (EnablePaddingBottom ? systemBarsInsets.Bottom : 0)
);
return insets;
}
public static InsetListener ForBottomElement(View view)
{
return new InsetListener(view, WindowInsetsCompat.Type.Ime() | WindowInsetsCompat.Type.SystemBars() | WindowInsetsCompat.Type.DisplayCutout())
{
EnablePaddingTop = false
};
}
public static InsetListener ForTopElement(View view)
{
return new InsetListener(view, WindowInsetsCompat.Type.SystemBars() | WindowInsetsCompat.Type.DisplayCutout())
{
EnablePaddingBottom = false
};
}
public void Apply()
{
ViewCompat.SetOnApplyWindowInsetsListener(_targetView, this);
}
}
public static void MoveBottomBarButtons(int btn1Id, int btn2Id, int bottomBarId, Activity context)
{

View File

@@ -354,6 +354,7 @@ namespace keepass2android
}
public bool ScreenLockWasEnabledWhenOpeningDatabase { get; set; }
public bool QuickUnlockBlockedWhenDeviceNotSecureWhenOpeningDatabase { get; set; }
public bool QuickUnlockEnabled { get; private set; }

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-android</TargetFramework>
<TargetFramework>net9.0-android</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<RootNamespace>keepass2android</RootNamespace>
<OutputType>Exe</OutputType>

View File

@@ -1217,7 +1217,7 @@ namespace keepass2android
{
_design.ApplyTheme();
base.OnCreate(savedInstanceState);
new Util.InsetListener(FindViewById(Resource.Id.settings)).Apply();
}

View File

@@ -163,6 +163,7 @@ namespace keepass2android
{
_design.ApplyTheme();
base.OnCreate(savedInstanceState);
new Util.InsetListener(FindViewById(Resource.Id.settings)).Apply();
}