-
Notifications
You must be signed in to change notification settings - Fork 3.1k
[FEATURE REQUEST] Allow passcode and pattern screens in landscape mode #4871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
926a221
e77b875
0cb53a7
95cdc6d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 |
| 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" | ||
| 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> | ||
| 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" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This sounds not very descriptive. I'd set something like |
||
| 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" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd rename as |
||
| 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" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Extensible to the complete PR: Files referring passcode called 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 |
|---|---|---|
|
|
@@ -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 | ||
|
|
@@ -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" /> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" /> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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> | ||
There was a problem hiding this comment.
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?