Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Tweak pin unlock layout for smaller screens (#1340)

Leendert de Borstb00e7c3ac5e5
diff --git a/apps/mobile-app/android/app/src/main/res/layout/activity_pin_unlock.xml b/apps/mobile-app/android/app/src/main/res/layout/activity_pin_unlock.xml
index f8d013fd6..4d0581658 100644
--- a/apps/mobile-app/android/app/src/main/res/layout/activity_pin_unlock.xml
+++ b/apps/mobile-app/android/app/src/main/res/layout/activity_pin_unlock.xml
@@ -28,14 +28,14 @@
<!-- Logo -->
<ImageView
android:id="@+id/logoImageView"
- android:layout_width="80dp"
- android:layout_height="80dp"
+ android:layout_width="70dp"
+ android:layout_height="70dp"
android:src="@mipmap/ic_launcher"
android:contentDescription="@string/aliasvault_icon"
app:layout_constraintTop_toBottomOf="@id/cancelButton"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
- android:layout_marginTop="60dp" />
+ android:layout_marginTop="16dp" />
<!-- Title -->
<TextView
@@ -43,13 +43,13 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pin_unlock_vault"
- android:textSize="24sp"
+ android:textSize="22sp"
android:textStyle="bold"
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintTop_toBottomOf="@id/logoImageView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
- android:layout_marginTop="20dp" />
+ android:layout_marginTop="12dp" />
<!-- Subtitle -->
<TextView
@@ -57,15 +57,15 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/pin_enter_to_unlock"
- android:textSize="16sp"
+ android:textSize="15sp"
android:textColor="?android:attr/textColorSecondary"
android:gravity="center"
app:layout_constraintTop_toBottomOf="@id/titleTextView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
- android:layout_marginTop="8dp"
- android:layout_marginStart="40dp"
- android:layout_marginEnd="40dp" />
+ android:layout_marginTop="6dp"
+ android:layout_marginStart="32dp"
+ android:layout_marginEnd="32dp" />
<!-- PIN Dots Container (for fixed-length PINs) -->
<LinearLayout
@@ -77,16 +77,16 @@
app:layout_constraintTop_toBottomOf="@id/subtitleTextView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
- android:layout_marginTop="32dp"
+ android:layout_marginTop="20dp"
android:visibility="visible" />
<!-- PIN Text View (for variable-length PINs) -->
<TextView
android:id="@+id/pinTextView"
android:layout_width="wrap_content"
- android:layout_height="48dp"
+ android:layout_height="44dp"
android:text="----"
- android:textSize="42sp"
+ android:textSize="38sp"
android:textStyle="bold"
android:textColor="?android:attr/textColorPrimary"
android:letterSpacing="0.2"
@@ -94,7 +94,7 @@
app:layout_constraintTop_toBottomOf="@id/subtitleTextView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
- android:layout_marginTop="32dp"
+ android:layout_marginTop="20dp"
android:visibility="gone" />
<!-- Error Message -->
@@ -102,34 +102,34 @@
android:id="@+id/errorTextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
- android:textSize="14sp"
+ android:textSize="13sp"
android:textColor="@android:color/holo_red_dark"
android:gravity="center"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@id/pinDotsContainer"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
- android:layout_marginTop="12dp"
- android:layout_marginStart="40dp"
- android:layout_marginEnd="40dp" />
+ android:layout_marginTop="10dp"
+ android:layout_marginStart="32dp"
+ android:layout_marginEnd="32dp" />
<!-- Continue Button (for PIN setup) -->
<Button
android:id="@+id/continueButton"
android:layout_width="0dp"
- android:layout_height="56dp"
+ android:layout_height="44dp"
android:text="@string/common_next"
android:textColor="@android:color/white"
- android:textSize="16sp"
+ android:textSize="15sp"
android:textStyle="bold"
android:background="@color/primary"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@id/numpadContainer"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
- android:layout_marginBottom="24dp"
- android:layout_marginStart="40dp"
- android:layout_marginEnd="40dp" />
+ android:layout_marginBottom="16dp"
+ android:layout_marginStart="32dp"
+ android:layout_marginEnd="32dp" />
<!-- Numpad -->
<LinearLayout
@@ -141,17 +141,17 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
- android:layout_marginBottom="40dp"
- android:layout_marginStart="40dp"
- android:layout_marginEnd="40dp">
+ android:layout_marginBottom="32dp"
+ android:layout_marginStart="32dp"
+ android:layout_marginEnd="32dp">
<!-- Row 1: 1-3 -->
<LinearLayout
android:layout_width="match_parent"
- android:layout_height="60dp"
+ android:layout_height="56dp"
android:orientation="horizontal"
android:gravity="center"
- android:layout_marginBottom="12dp">
+ android:layout_marginBottom="10dp">
<Button
android:id="@+id/btn1"
@@ -172,10 +172,10 @@
<!-- Row 2: 4-6 -->
<LinearLayout
android:layout_width="match_parent"
- android:layout_height="60dp"
+ android:layout_height="56dp"
android:orientation="horizontal"
android:gravity="center"
- android:layout_marginBottom="12dp">
+ android:layout_marginBottom="10dp">
<Button
android:id="@+id/btn4"
@@ -196,10 +196,10 @@
<!-- Row 3: 7-9 -->
<LinearLayout
android:layout_width="match_parent"
- android:layout_height="60dp"
+ android:layout_height="56dp"
android:orientation="horizontal"
android:gravity="center"
- android:layout_marginBottom="12dp">
+ android:layout_marginBottom="10dp">
<Button
android:id="@+id/btn7"
@@ -220,14 +220,14 @@
<!-- Row 4: Empty, 0, Backspace -->
<LinearLayout
android:layout_width="match_parent"
- android:layout_height="60dp"
+ android:layout_height="56dp"
android:orientation="horizontal"
android:gravity="center">
<!-- Empty space -->
<View
android:layout_width="0dp"
- android:layout_height="60dp"
+ android:layout_height="56dp"
android:layout_weight="1" />
<Button
diff --git a/apps/mobile-app/android/app/src/main/res/values/styles.xml b/apps/mobile-app/android/app/src/main/res/values/styles.xml
index a0bb80847..a3d383afd 100644
--- a/apps/mobile-app/android/app/src/main/res/values/styles.xml
+++ b/apps/mobile-app/android/app/src/main/res/values/styles.xml
@@ -34,17 +34,17 @@
</style>
<style name="PinNumpadButton" parent="Widget.MaterialComponents.Button">
<item name="android:layout_width">0dp</item>
- <item name="android:layout_height">60dp</item>
+ <item name="android:layout_height">56dp</item>
<item name="android:layout_weight">1</item>
- <item name="android:layout_marginStart">6dp</item>
- <item name="android:layout_marginEnd">6dp</item>
+ <item name="android:layout_marginStart">5dp</item>
+ <item name="android:layout_marginEnd">5dp</item>
<item name="backgroundTint">@color/av_accent_background</item>
- <item name="android:textSize">24sp</item>
+ <item name="android:textSize">22sp</item>
<item name="android:textStyle">bold</item>
<item name="android:textColor">@color/av_text</item>
<item name="cornerRadius">12dp</item>
<item name="android:insetTop">0dp</item>
- <item name="android:insetBottom">3dp</item>
+ <item name="android:insetBottom">2dp</item>
<item name="rippleColor">@color/av_primary</item>
</style>
</resources>
\ No newline at end of file
diff --git a/apps/mobile-app/ios/VaultUI/Auth/PinNumpadView.swift b/apps/mobile-app/ios/VaultUI/Auth/PinNumpadView.swift
index d2ee8e8d7..adb78532c 100644
--- a/apps/mobile-app/ios/VaultUI/Auth/PinNumpadView.swift
+++ b/apps/mobile-app/ios/VaultUI/Auth/PinNumpadView.swift
@@ -17,9 +17,9 @@ public struct PinNumpadView: View {
}
public var body: some View {
- VStack(spacing: 12) {
+ VStack(spacing: 10) {
// Row 1: 1-3
- HStack(spacing: 12) {
+ HStack(spacing: 10) {
ForEach(1...3, id: \.self) { num in
NumpadButton(value: "\(num)", colorScheme: colorScheme) {
onDigit("\(num)")
@@ -28,7 +28,7 @@ public struct PinNumpadView: View {
}
// Row 2: 4-6
- HStack(spacing: 12) {
+ HStack(spacing: 10) {
ForEach(4...6, id: \.self) { num in
NumpadButton(value: "\(num)", colorScheme: colorScheme) {
onDigit("\(num)")
@@ -37,7 +37,7 @@ public struct PinNumpadView: View {
}
// Row 3: 7-9
- HStack(spacing: 12) {
+ HStack(spacing: 10) {
ForEach(7...9, id: \.self) { num in
NumpadButton(value: "\(num)", colorScheme: colorScheme) {
onDigit("\(num)")
@@ -46,10 +46,10 @@ public struct PinNumpadView: View {
}
// Row 4: Empty, 0, Backspace
- HStack(spacing: 12) {
+ HStack(spacing: 10) {
// Empty space
Color.clear
- .frame(height: 60)
+ .frame(height: 56)
// 0 button
NumpadButton(value: "0", colorScheme: colorScheme) {
@@ -62,7 +62,7 @@ public struct PinNumpadView: View {
}
}
}
- .padding(.horizontal, 40)
- .padding(.bottom, 40)
+ .padding(.horizontal, 32)
+ .padding(.bottom, 32)
}
}
diff --git a/apps/mobile-app/ios/VaultUI/Auth/PinSetupView.swift b/apps/mobile-app/ios/VaultUI/Auth/PinSetupView.swift
index 494215d79..51b4cc63f 100644
--- a/apps/mobile-app/ios/VaultUI/Auth/PinSetupView.swift
+++ b/apps/mobile-app/ios/VaultUI/Auth/PinSetupView.swift
@@ -41,22 +41,22 @@ public struct PinSetupView: View {
Image("Logo", bundle: .vaultUI)
.resizable()
.aspectRatio(contentMode: .fit)
- .frame(width: 80, height: 80)
- .padding(.bottom, 20)
+ .frame(width: 70, height: 70)
+ .padding(.bottom, 12)
// Title
Text(viewModel.configuration.title)
- .font(.system(size: 24, weight: .semibold))
+ .font(.system(size: 22, weight: .semibold))
.foregroundColor(colors.text)
- .padding(.bottom, 8)
+ .padding(.bottom, 6)
// Subtitle
Text(viewModel.configuration.subtitle)
- .font(.system(size: 16))
+ .font(.system(size: 15))
.foregroundColor(colors.text.opacity(0.7))
.multilineTextAlignment(.center)
- .padding(.horizontal, 40)
- .padding(.bottom, 32)
+ .padding(.horizontal, 32)
+ .padding(.bottom, 20)
// PIN dots display or text based on step
if let pinLength = viewModel.configuration.pinLength {
@@ -75,29 +75,29 @@ public struct PinSetupView: View {
.frame(width: 16, height: 16)
}
}
- .padding(.bottom, 24)
+ .padding(.bottom, 20)
} else {
// Enter new step: show bullet points for variable length
Text(viewModel.pin.isEmpty ? "----" : String(repeating: "•", count: viewModel.pin.count))
- .font(.system(size: 42, weight: .semibold))
+ .font(.system(size: 38, weight: .semibold))
.foregroundColor(colors.text)
- .kerning(8)
- .frame(minHeight: 48)
- .padding(.bottom, 24)
+ .kerning(6)
+ .frame(minHeight: 44)
+ .padding(.bottom, 20)
}
// Error message
if let error = viewModel.error {
Text(error)
- .font(.system(size: 14))
+ .font(.system(size: 13))
.foregroundColor(.red)
.multilineTextAlignment(.center)
- .padding(.horizontal, 40)
- .padding(.bottom, 12)
+ .padding(.horizontal, 32)
+ .padding(.bottom, 10)
.transition(.opacity)
}
- // Continue/Confirm button (for enter new step with variable length)
+ // Continue/Next button (for enter new step with variable length) - compact version
if viewModel.configuration.step == .enterNew && viewModel.configuration.pinLength == nil {
Button(action: {
Task {
@@ -105,18 +105,18 @@ public struct PinSetupView: View {
}
}) {
Text(String(localized: "next", bundle: locBundle))
- .font(.system(size: 16, weight: .semibold))
+ .font(.system(size: 15, weight: .semibold))
.foregroundColor(.white)
.frame(maxWidth: .infinity)
- .frame(height: 50)
+ .frame(height: 44)
.background(
RoundedRectangle(cornerRadius: 8)
.fill(viewModel.canSubmit ? colors.primary : colors.primary.opacity(0.5))
)
}
.disabled(!viewModel.canSubmit)
- .padding(.horizontal, 40)
- .padding(.bottom, 24)
+ .padding(.horizontal, 32)
+ .padding(.bottom, 16)
}
Spacer()
diff --git a/apps/mobile-app/ios/VaultUI/Auth/PinUnlockView.swift b/apps/mobile-app/ios/VaultUI/Auth/PinUnlockView.swift
index b72bd6a94..9cfcf1426 100644
--- a/apps/mobile-app/ios/VaultUI/Auth/PinUnlockView.swift
+++ b/apps/mobile-app/ios/VaultUI/Auth/PinUnlockView.swift
@@ -42,22 +42,22 @@ public struct PinUnlockView: View {
Image("Logo", bundle: .vaultUI)
.resizable()
.aspectRatio(contentMode: .fit)
- .frame(width: 80, height: 80)
- .padding(.bottom, 20)
+ .frame(width: 70, height: 70)
+ .padding(.bottom, 12)
// Title
Text(String(localized: "unlock_vault", bundle: locBundle))
- .font(.system(size: 24, weight: .semibold))
+ .font(.system(size: 22, weight: .semibold))
.foregroundColor(colors.text)
- .padding(.bottom, 8)
+ .padding(.bottom, 6)
// Subtitle
Text(String(format: String(localized: "enter_pin_to_unlock_vault", bundle: locBundle)))
- .font(.system(size: 16))
+ .font(.system(size: 15))
.foregroundColor(colors.text.opacity(0.7))
.multilineTextAlignment(.center)
- .padding(.horizontal, 40)
- .padding(.bottom, 32)
+ .padding(.horizontal, 32)
+ .padding(.bottom, 20)
// PIN dots display
if let pinLength = viewModel.pinLength {
@@ -75,25 +75,25 @@ public struct PinUnlockView: View {
.frame(width: 16, height: 16)
}
}
- .padding(.bottom, 24)
+ .padding(.bottom, 20)
} else {
// For variable length, show bullet points
Text(viewModel.pin.isEmpty ? "----" : String(repeating: "•", count: viewModel.pin.count))
- .font(.system(size: 42, weight: .semibold))
+ .font(.system(size: 38, weight: .semibold))
.foregroundColor(colors.text)
- .kerning(8)
- .frame(minHeight: 48)
- .padding(.bottom, 24)
+ .kerning(6)
+ .frame(minHeight: 44)
+ .padding(.bottom, 20)
}
// Error message
if let error = viewModel.error {
Text(error)
- .font(.system(size: 14))
+ .font(.system(size: 13))
.foregroundColor(.red)
.multilineTextAlignment(.center)
- .padding(.horizontal, 40)
- .padding(.bottom, 12)
+ .padding(.horizontal, 32)
+ .padding(.bottom, 10)
.transition(.opacity)
}
@@ -181,15 +181,15 @@ struct NumpadButton: View {
if let value = value {
Text(value)
- .font(.system(size: 24, weight: .semibold))
+ .font(.system(size: 22, weight: .semibold))
.foregroundColor(colors.text)
} else if let icon = icon {
Image(systemName: icon)
- .font(.system(size: 24))
+ .font(.system(size: 22))
.foregroundColor(colors.text)
}
}
- .frame(height: 60)
+ .frame(height: 56)
}
.buttonStyle(NumpadButtonStyle(isPressed: $isPressed))
}