-
Notifications
You must be signed in to change notification settings - Fork 122
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
Resolved Issue #76 #81
base: develop
Are you sure you want to change the base?
Resolved Issue #76 #81
Conversation
Improvised the permissions UI as suggested by the mods and changed the function names according to the convention
Added an error whenever the mobile number entered was greater than 10 digits or less than 10 digits. Also the 'I am in ' button is disabled if the number of digits are not 10.
@tavishjain Some countries have phone number length > 10 |
@Bloody-Badboy that can be classified according to the countries code. Since I dont know how to use the country code widget, I added only for india that is 10 digits |
@tavishjain Let's not restrict it to 10 digit, phone numbers are 7 to 13 digits are valid phone numbers. So phone number is invalid if it length than 6 and and greater than 13. Put it in Utils. |
@ritesh-singh changed the conditions for the phone number. The user can now enter a mobile number varying from 7 to 13 digits. Also created a Util class and placed the code in it |
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.
Please, do the required changes.
gradle.properties
Outdated
@@ -12,4 +12,6 @@ org.gradle.jvmargs=-Xmx1536m | |||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects | |||
# org.gradle.parallel=true | |||
|
|||
GOOGLE_MAPS_API_KEY = AIzaSyDeF1mGMsB_qdrh0rjiXrWgmzGgiFfiQR8 |
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.
Remove it from here, put it in gradle.properties file in your system.
|
||
userLoginInfo = new UserLoginInfo(); | ||
|
||
etPhoneNumber = findViewById(R.id.et_phone_number); |
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.
Make use of databinding, we can avoid findViewByID() here.
* Created by tavishjain on 29-04-2018. | ||
*/ | ||
|
||
public class PhoneNumberValidation { |
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.
Why create a new class for PhoneNumberValidation. There is already a util class, just move the logic there. And user the same.
Also make use of Pattern.Phone regex.
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.
@ritesh-singh I dont know about Pattern.Phone regex
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.
@tavishjain Also, take update from upstream first. |
@ritesh-singh my branch is up to date @ritesh-singh Did the changes |
etPhoneNumber = ((ActivityUserLoginBinding) mBinding).etPhoneNumber; | ||
iAmInButton = ((ActivityUserLoginBinding) mBinding).bvIn; | ||
|
||
AppUtil.validatePhoneNumber(etPhoneNumber , iAmInButton); |
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.
Why pass view in validatePhoneNumber? Why not just pass the count and text and have listener here itself.
validatePhoneNumber(int count,String text) -> let this function return true or false based on your validation logic.
@@ -14,4 +18,30 @@ public static void replaceFragmentInActivity(FragmentManager fragmentManager, Fr | |||
int containerId) { | |||
fragmentManager.beginTransaction().replace(containerId, fragment).commit(); | |||
} | |||
|
|||
public static void validatePhoneNumber(EditText phoneNumberView , View iAmInButtonView){ |
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.
Please, don't have listener here, let this function just accept, count and text and make this function return true or false.
Also, move the logic in Util class.
@ritesh-singh I hope no more changes to be done now |
Please review this PR |
? |
Fill out the following while publishing a new pull request.
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
User is now not able to enter mobile number of any length at the Mobile Registration Activity
What is the current behavior? (You can also link to an open issue here)
User is not prompted of wrong number of digits
What is the new behavior (if this is a feature change)?
User is now prompted of wrong number of digits
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
Other information: