login and register
This commit is contained in:
@@ -15,6 +15,7 @@ import android.widget.TextView;
|
||||
|
||||
import ch.pizzalink.android.R;
|
||||
import ch.pizzalink.android.activity.BaseActivity;
|
||||
import ch.pizzalink.android.helper.PasswordHelper;
|
||||
|
||||
/**
|
||||
* Created by cimenmus on 28/09/2017.
|
||||
@@ -98,23 +99,33 @@ public class PizzalinkEditText extends LinearLayout implements View.OnClickListe
|
||||
}
|
||||
|
||||
private void hideShowPassword(){
|
||||
|
||||
if(isPasswordHidden)
|
||||
editText.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD);
|
||||
else
|
||||
editText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
|
||||
|
||||
isPasswordHidden = !isPasswordHidden;
|
||||
editText.setTypeface(typeFace);
|
||||
}
|
||||
|
||||
private void focusEditText(){
|
||||
|
||||
editText.requestFocus();
|
||||
InputMethodManager inputMethodManager=(InputMethodManager)BaseActivity.currentActivity.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
inputMethodManager.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);
|
||||
}
|
||||
|
||||
public boolean isEmpty(){
|
||||
return editText.getText().toString().isEmpty();
|
||||
}
|
||||
|
||||
public boolean isEmail(){
|
||||
return PasswordHelper.EMAIL_ADDRESS_PATTERN.matcher(editText.getText()).matches();
|
||||
}
|
||||
|
||||
public String getText(){
|
||||
return editText.getText().toString();
|
||||
}
|
||||
|
||||
|
||||
public TextView getHintTextView() {
|
||||
return hintTextView;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user