-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Pattern Lock Added #2083
Pattern Lock Added #2083
Conversation
This PR does not consist of the changes made for Issue #2027 |
Thanks for contributing @SD1998 !! i have check a bit this feature and i suggest a couple of improvements:
CC @davigonz |
@jesmrec I will start working on the changes you have suggested. |
ok @SD1998. It is important to set a policy of priorities how the different "locks" are going to be handled for the user (third point of my previous message). Thinking also that other locks can be included in the future (for example, the fingerprint). iOS handles it (touch id) in the following way: passcode is always mandatory if the user wants to enable the touch id. Both are displayed and the user can cancel the touch id to use only the passcode. This is only an example, and we should have an idea to manage the different locks? Which is your idea about? |
@jesmrec Actually the way I have implemented the feature both the type of locks cannot be set at the same time. |
ok, so you have a bug ;) if you enable first passcode, then you can enable pattern as well. So, the policy is that only one lock should be enabled at time. What do you thing @davigonz ? maybe passcode should be always enabled as shortcut? |
Well, for this cases, I think we should follow the same way in which the Android system protects our phone. Android allows us to set a pattern to lock the device without setting a passcode and vice versa, but forces us to set a passcode or pattern when using fingerprint for instance, so passcode and pattern would be different ways to unlock ownCloud app and cannot be enabled at the same time. |
@jesmrec I have made the changes. |
Thanks @SD1998, we will pass code review and QA, and we will let you know if we find some issues. |
Now that this branch is out-of-date with master, please use what I described in #2075 (comment) here as well |
This is ready for QA, isn't it @SD1998? |
@jesmrec Yes I just have to update this branch so that it is up to date with master (of ownCloud). I am doing it now. |
@davigonz Whenever I rebase with master of ownCloud should I create a new PR? |
@SD1998 I don't think so, if you are able to rebase it properly , the PR wouldn't be necessary and you have even created a new branch to implement the feature so 👍 |
49c965d
to
945bbcc
Compare
@davigonz I guess the rebase worked. |
e5948db
to
838cad3
Compare
@SD1998 not yet, but i will take care next days. It will be included in 2.7.0 for sure. |
of course @davigonz, i will be ready for your signal ;) |
838cad3
to
f572574
Compare
AndroidManifest.xml
Outdated
@@ -61,6 +61,8 @@ | |||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | |||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> | |||
<uses-permission android:name="android.permission.WAKE_LOCK" /> | |||
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> |
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.
What are you using this permission and the one just below for?
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.
AndroidManifest.xml
Outdated
</activity> | ||
android:theme="@style/Theme.ownCloud.Fullscreen" /> | ||
<activity android:name=".ui.activity.CapturedFileChecker" /> | ||
<activity android:name=".ui.activity.Camera" /> |
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.
I think that CapturedFileChecker and Camera are unused
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.
Yes I have removed them.
build.gradle
Outdated
compile "com.android.support:appcompat-v7:${supportLibraryVersion}" | ||
compile 'com.getbase:floatingactionbutton:1.10.1' | ||
compile group: 'commons-io', name: 'commons-io', version: '2.5' | ||
|
||
/// dependencies for local unit tests | ||
compile 'com.android.support.constraint:constraint-layout:1.0.2' |
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.
This dependency would be better placed out of the comment /// dependencies for local unit tests
since is not used for that purpose.
res/values/strings.xml
Outdated
@@ -28,6 +28,7 @@ | |||
<string name="drawer_open">Open</string> | |||
<string name="prefs_category_general">General</string> | |||
<string name="prefs_category_more">More</string> | |||
<string name="prefs_category_security"> Security </string> |
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.
You do not need the extra white spaces at the beginning and end in these string resources.
res/values/strings.xml
Outdated
<string name="pattern_enter_pattern"> Please enter your pattern </string> | ||
<string name="pattern_configure_pattern"> Enter your pattern </string> | ||
<string name="pattern_remove_pattern"> Remove your pattern </string> | ||
<string name="pattern_incorrect_pattern"> Incorrect Pattern </string> |
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.
Pattern would better be lowercase
res/values/strings.xml
Outdated
<string name="pattern_reenter_pattern"> Please re-enter your pattern </string> | ||
<string name="pattern_not_same_pattern"> The patterns are not same </string> | ||
<string name="pattern_stored"> Pattern Stored </string> | ||
<string name="pattern_removed"> Pattern Removed </string> |
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.
Removed would better be lowercase
res/values/strings.xml
Outdated
<string name="pattern_not_same_pattern"> The patterns are not same </string> | ||
<string name="pattern_stored"> Pattern Stored </string> | ||
<string name="pattern_removed"> Pattern Removed </string> | ||
<string name="passcode_already_set"> Passcode Already Set </string> |
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.
Already and Set would better be lowercase
res/values/strings.xml
Outdated
<string name="pattern_stored"> Pattern Stored </string> | ||
<string name="pattern_removed"> Pattern Removed </string> | ||
<string name="passcode_already_set"> Passcode Already Set </string> | ||
<string name="pattern_already_set"> Pattern Already Set </string> |
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.
Same here
@@ -46,15 +46,16 @@ dependencies { | |||
compile "com.android.support:design:${supportLibraryVersion}" | |||
compile 'com.jakewharton:disklrucache:2.0.2' | |||
compile 'com.google.android.exoplayer:exoplayer:r2.2.0' | |||
compile 'com.andrognito.patternlockview:patternlockview:1.0.0' |
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.
When we use a third-party library we usually include the information in our THIRD_PARTY.txt file. Could you do the same with this library? You can have a look at the format we followed with other libraries in that file.
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.
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.
Forget this change for the moment, it seems that our THIRD_PARTY.txt is not properly updated, I will ping you when is ready.
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.
@davigonz Then I will commit the other changes. Thanks.
import java.util.Set; | ||
|
||
/** | ||
* Created by shashvatkedia on 21/12/17. |
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.
Given that this is a new class, please delete this line and add a new comment in the top with the authors and copyright information:
/**
* ownCloud Android client application
*
* @author YOUR NAME HERE
* Copyright (C) 2018 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/>.
*
*/
@jesmrec has the QA started? |
9eb02ec
to
d75effb
Compare
@SD1998 let's go for it!! |
IMPROVEMENTSteps:
Current: Message Tested with Nexus 6P v7 |
IMPROVEMENTSteps:
Current: Message This message does not clarify the fact that only one of these methods can be enabled at time. Suggestions:
(any other @davigonz ? ) Tested with Nexus 6P v7 |
IMPROVEMENTNot sure if this one depends on the library you used to develop the feature Steps:
Current: Cancel button is shown at the right of the pattern points Tested with Nexus 6P v7 |
@jesmrec this does not depend on the library I have used. I placed the cancel button to the right of the patternLockView because in landscape orientation the cancel button does not fit properly bellow the patternLockView (i.e due to the margin between the button and the patternLockView the cancel button is not properly visible on my device (Oneplus 3T) hence I placed it beside the patternLockView). |
@SD1998 QA is passed, and i only noticed the suggested improvements. Functionally is working pretty fine (congrats for the work!!), so we can discuss the improvements, and then, after checking them and rebasing the branch, it will be ready to merge. |
Changes tested and all OK. Approved |
Great, merging it... Thanks @SD1998 for this feature |
Fix to Issue #2077
BUGS & IMPROVEMENTS