Skip to content

Commit

Permalink
Merge pull request #101 from OTTAA-Project/hotfix-version-92
Browse files Browse the repository at this point in the history
hotfix version 92
  • Loading branch information
gonojuarez authored Nov 5, 2021
2 parents 77370db + 62daf98 commit b122274
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 26 deletions.
12 changes: 6 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ android {
applicationId "com.stonefacesoft.ottaa"
minSdkVersion 21
targetSdkVersion 31
versionCode 92
versionCode 93
versionName "6.7.3" //
// Enabling multidex support.
multiDexEnabled true
Expand Down Expand Up @@ -208,10 +208,10 @@ dependencies {
implementation platform('com.google.firebase:firebase-bom:28.3.1')
implementation 'com.google.firebase:firebase-auth'
implementation 'com.google.firebase:firebase-config:21.0.1'
implementation 'com.google.firebase:firebase-core:19.0.2'
implementation 'com.google.firebase:firebase-core:20.0.0'
implementation 'com.google.firebase:firebase-database:20.0.2'
implementation 'com.google.firebase:firebase-messaging:22.0.0'
implementation 'com.google.firebase:firebase-inappmessaging-display:20.1.0'
implementation 'com.google.firebase:firebase-messaging:23.0.0'
implementation 'com.google.firebase:firebase-inappmessaging-display:20.1.1'
implementation 'com.google.firebase:firebase-perf:20.0.3'
implementation 'com.google.firebase:firebase-storage:20.0.0'

Expand All @@ -227,8 +227,8 @@ dependencies {
// material library
implementation 'com.google.android.material:material:1.4.0'

implementation 'com.google.firebase:firebase-crashlytics:18.2.3'
implementation 'com.google.firebase:firebase-analytics:19.0.2'
implementation 'com.google.firebase:firebase-crashlytics:18.2.4'
implementation 'com.google.firebase:firebase-analytics:20.0.0'
//Guava library
implementation("com.google.guava:guava:30.1.1-android")
//Facebook
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public class LoginActivity2Step2 extends AppCompatActivity implements View.OnCli
private FirebaseDatabaseRequest databaseRequest;
private AnalyticsFirebase mAnalyticsFirebase;
private FirebaseUtils firebaseUtils;
private DateTextWatcher dateTextWatcher;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -108,7 +109,7 @@ private void bindUI() {
editTextName = findViewById(R.id.editTextName);
editTextName.setInputType(InputType.TYPE_NULL);
editTextBirthday = findViewById(R.id.editTextBirthday);
new DateTextWatcher(editTextBirthday,this);
dateTextWatcher = new DateTextWatcher(editTextBirthday,this);
genderSelector = findViewById(R.id.selectorGender);
genderSelector.setOnItemSelectedListener(this);
databaseRequest = new FirebaseDatabaseRequest(this);
Expand Down Expand Up @@ -232,6 +233,7 @@ public void setUpDateUser(long time){
int year = calendar.get(Calendar.YEAR);
String value =getValue(day)+""+getValue(month)+""+year;
editTextBirthday.setText(value);
dateTextWatcher.validateTextWatcher();
}


Expand Down Expand Up @@ -267,6 +269,7 @@ public void onDateSet(android.widget.DatePicker view, int year, int month, int d
Calendar calendar = Calendar.getInstance();
calendar.set(year, month, dayOfMonth);
editTextBirthday.setText(getValue(dayOfMonth)+""+getValue(month + 1)+""+year);
dateTextWatcher.validateTextWatcher();
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.stonefacesoft.ottaa.utils;

import android.text.Editable;
import android.text.TextWatcher;
import android.view.KeyEvent;
import android.view.inputmethod.EditorInfo;
import android.widget.EditText;
Expand All @@ -11,18 +9,17 @@

import java.util.Calendar;

public class DateTextWatcher implements TextWatcher {
public class DateTextWatcher {
private String current = "";
private String ddmmyyyy = "DDMMYYYY";
private Calendar cal = Calendar.getInstance();
private EditText input;
private CalendarChangeEvent calendarChangeEvent;
private boolean isRunning = true;
private boolean isDeleting = false;


public DateTextWatcher(EditText input, CalendarChangeEvent calendarChangeEvent) {
this.input = input;
// this.input.addTextChangedListener(this);

this.input.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
Expand All @@ -34,21 +31,9 @@ public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
this.calendarChangeEvent = calendarChangeEvent;
}

@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}

@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {

}

@Override
public void afterTextChanged(Editable s) {

}

public void validateText(String s){
private void validateText(String s){
if (!s.toString().equals(current)) {
String clean = s.toString().replaceAll("[^\\d.]|\\.", "");
String cleanC = current.replaceAll("[^\\d.]|\\.", "");
Expand Down Expand Up @@ -91,4 +76,7 @@ public void validateText(String s){
}
}

public void validateTextWatcher(){
validateText(input.getText().toString());
}
}

0 comments on commit b122274

Please sign in to comment.