Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog/unreleased/4871
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Enhancement: Passcode and pattern screens in landscape mode

Orientation restrictions defined in the manifest have been removed, and support for both
orientations (portrait and landscape) has been added to the passcode and pattern screens.

https://github.com/owncloud/android/pull/4871
2 changes: 0 additions & 2 deletions owncloudApp/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@
<activity
android:name=".presentation.security.passcode.PassCodeActivity"
android:label="@string/passcode_label"
android:screenOrientation="portrait"
android:theme="@style/Theme.ownCloud" />
<activity
android:name=".presentation.conflicts.ConflictsResolveActivity"
Expand Down Expand Up @@ -235,7 +234,6 @@
android:theme="@style/Theme.ownCloud.Toolbar"/>
<activity
android:name=".presentation.security.pattern.PatternActivity"
android:screenOrientation="portrait"
android:label="@string/pattern_label"
android:theme="@style/Theme.ownCloud" />
<activity android:name=".presentation.security.biometric.BiometricActivity" />
Expand Down
101 changes: 101 additions & 0 deletions owncloudApp/src/main/res/layout-land/activity_pattern_lock.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
ownCloud Android client application

Copyright (C) 2026 ownCloud GmbH.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activityPatternLockLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/standard_padding">

<androidx.constraintlayout.widget.Guideline
android:id="@+id/vertical_guide"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.4" />

<com.owncloud.android.presentation.security.passcode.SquareFrameLayout
android:id="@+id/pattern_container"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="@dimen/standard_margin"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/vertical_guide"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent">

<com.andrognito.patternlockview.PatternLockView
android:id="@+id/pattern_lock_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="true"
app:correctStateColor="@color/primary"
app:dotCount="3"
app:normalStateColor="@color/primary"
app:wrongStateColor="@color/primary">

<requestFocus />

</com.andrognito.patternlockview.PatternLockView>

</com.owncloud.android.presentation.security.passcode.SquareFrameLayout>

<TextView
android:id="@+id/header_pattern"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/standard_margin"
android:gravity="center"
android:text="@string/pass_code_enter_pass_code"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The string refers to passcode, and this layout is for pattern. Is that incorrect?

android:textColor="@android:color/black"
android:textSize="16sp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/explanation_pattern"
app:layout_constraintStart_toStartOf="@id/vertical_guide"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintVertical_chainStyle="packed" />

<TextView
android:id="@+id/explanation_pattern"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="@dimen/standard_margin"
android:gravity="center"
android:text="@string/pattern_configure_your_pattern_explanation"
android:textAppearance="@android:style/TextAppearance.Small"
android:textSize="14sp"
app:layout_constraintTop_toBottomOf="@id/header_pattern"
app:layout_constraintBottom_toTopOf="@id/error_pattern"
app:layout_constraintStart_toStartOf="@id/vertical_guide"
app:layout_constraintEnd_toEndOf="parent" />

<TextView
android:id="@+id/error_pattern"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/standard_margin"
android:gravity="center"
android:textColor="@color/warning"
android:textSize="16sp"
app:layout_constraintTop_toBottomOf="@id/explanation_pattern"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@id/vertical_guide"
app:layout_constraintEnd_toEndOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
110 changes: 110 additions & 0 deletions owncloudApp/src/main/res/layout-land/passcodelock.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
ownCloud Android client application

Copyright (C) 2026 ownCloud GmbH.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/passcodeLockLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/passcode_standard_margin"
android:filterTouchesWhenObscured="true">

<TextView
android:id="@+id/header"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds not very descriptive. I'd set something like passcode_header or similar

android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/passcode_standard_margin"
android:gravity="center"
android:text="@string/pass_code_enter_pass_code"
android:textColor="@android:color/black"
android:textSize="16sp"
app:layout_constraintStart_toEndOf="@id/left_guideline"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"/>

<TextView
android:id="@+id/explanation"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd set a more descriptive name as well

android:layout_width="0dp"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/pass_code_configure_your_pass_code_explanation"
android:textAppearance="@android:style/TextAppearance.Small"
android:textSize="14sp"
app:layout_constraintStart_toEndOf="@id/left_guideline"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/header" />

<LinearLayout
android:id="@+id/layout_code"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not descriptive as the others

android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:gravity="center"
android:orientation="horizontal"
app:layout_constraintStart_toEndOf="@id/left_guideline"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/explanation">

<!-- Edit text items will be added here procedurally based on ownBrander settings. -->

</LinearLayout>

<TextView
android:id="@+id/error"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rename as error_passcode because in pattern the id is error_pattern

android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:gravity="center"
android:textColor="@color/warning"
android:textSize="16sp"
app:layout_constraintStart_toEndOf="@id/left_guideline"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/layout_code" />

<TextView
android:id="@+id/lock_time"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:gravity="center"
android:textColor="@android:color/black"
android:textSize="16sp"
android:visibility="invisible"
app:layout_constraintStart_toEndOf="@id/left_guideline"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/error" />

<com.owncloud.android.presentation.security.passcode.NumberKeyboard
android:id="@+id/numberKeyboard"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ids are snakecase in other layouts

android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<androidx.constraintlayout.widget.Guideline
android:id="@+id/left_guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.35" />

</androidx.constraintlayout.widget.ConstraintLayout>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extensible to the complete PR:

Files referring passcode called passcodelock
Files referring pattern called activity_pattern_lock

Shouldn't they follow the same name convention? (that's a regression, not from this PR, but i had to comment it 😄 )

Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,23 @@
android:layout_marginTop="@dimen/standard_margin"
android:textColor="@color/warning"
android:textSize="16sp"
app:layout_constraintBottom_toTopOf="@id/patternContainer"
app:layout_constraintBottom_toTopOf="@id/pattern_container"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/explanation_pattern" />

<com.owncloud.android.presentation.security.passcode.SquareFrameLayout
android:id="@+id/patternContainer"
android:id="@+id/pattern_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/standard_margin"
android:layout_marginVertical="@dimen/standard_margin"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/rightGuideline"
app:layout_constraintEnd_toEndOf="@id/right_guideline"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="@id/leftGuideline"
app:layout_constraintStart_toStartOf="@id/left_guideline"
app:layout_constraintTop_toBottomOf="@id/error_pattern">

<com.andrognito.patternlockview.PatternLockView
Expand All @@ -91,16 +91,16 @@
</com.owncloud.android.presentation.security.passcode.SquareFrameLayout>

<androidx.constraintlayout.widget.Guideline
android:id="@+id/leftGuideline"
android:id="@+id/left_guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.25" />
app:layout_constraintGuide_percent="0.3" />
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: this tiny change (0.25 -> 0.3) is really meaningful? why?


<androidx.constraintlayout.widget.Guideline
android:id="@+id/rightGuideline"
android:id="@+id/right_guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.75" />
app:layout_constraintGuide_percent="0.7" />
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question as above: this tiny change (0.75 -> 0.7) is really meaningful? why?

</androidx.constraintlayout.widget.ConstraintLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -102,20 +102,20 @@
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/passcode_margin_bottom"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/rightGuideline"
app:layout_constraintEnd_toEndOf="@id/right_guideline"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="@id/leftGuideline"
app:layout_constraintStart_toStartOf="@id/left_guideline"
app:layout_constraintTop_toBottomOf="@id/lock_time" />

<androidx.constraintlayout.widget.Guideline
android:id="@+id/leftGuideline"
android:id="@+id/left_guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.3" />

<androidx.constraintlayout.widget.Guideline
android:id="@+id/rightGuideline"
android:id="@+id/right_guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
Expand Down
Loading
Loading