design part 2
This commit is contained in:
@@ -36,7 +36,6 @@ public class LoginActivity extends BaseActivity {
|
||||
@BindView(R.id.passwordPizzalinkEditText) PizzalinkEditText passwordPizzalinkEditText;
|
||||
@BindView(R.id.loginButton) Button loginButton;
|
||||
@BindView(R.id.forgotPasswordTextView) TextView forgotPasswordTextView;
|
||||
@BindView(R.id.registerTextView) TextView registerTextView;
|
||||
|
||||
@BindString(R.string.forgot_password_hint) String forgotPasswordHintText;
|
||||
@BindString(R.string.reset_password) String resetPasswordText;
|
||||
@@ -51,10 +50,10 @@ public class LoginActivity extends BaseActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_login);
|
||||
ButterKnife.bind(this);
|
||||
initViews();
|
||||
//initViews();
|
||||
}
|
||||
|
||||
@OnClick({R.id.loginButton, R.id.forgotPasswordTextView, R.id.registerTextView})
|
||||
@OnClick({R.id.loginButton, R.id.forgotPasswordTextView, R.id.registerButton})
|
||||
protected void onClick(View view){
|
||||
switch (view.getId()){
|
||||
case R.id.loginButton:
|
||||
@@ -65,33 +64,12 @@ public class LoginActivity extends BaseActivity {
|
||||
case R.id.forgotPasswordTextView:
|
||||
startActivity(new Intent(LoginActivity.this, ForgotPasswordActivity.class));
|
||||
break;
|
||||
case R.id.registerTextView:
|
||||
case R.id.registerButton:
|
||||
startActivity(new Intent(LoginActivity.this, RegisterActivity.class));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void initViews(){
|
||||
initRegisterTextView();
|
||||
initForgotPasswordTextView();
|
||||
/*
|
||||
emailPizzalinkEditText.getEditText().setText("aytaccici@gmail.com");
|
||||
passwordPizzalinkEditText.getEditText().setText("3522625");
|
||||
*/
|
||||
}
|
||||
|
||||
private void initRegisterTextView(){
|
||||
Spannable wordtoSpan = new SpannableString(notHaveAnAccountText + " " + registerText);
|
||||
wordtoSpan.setSpan(new ForegroundColorSpan(ContextCompat.getColor(this, R.color.red)), 23, wordtoSpan.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
registerTextView.setText(wordtoSpan);
|
||||
}
|
||||
|
||||
private void initForgotPasswordTextView(){
|
||||
Spannable wordtoSpan = new SpannableString(forgotPasswordHintText + " " + resetPasswordText);
|
||||
wordtoSpan.setSpan(new ForegroundColorSpan(ContextCompat.getColor(this, R.color.red)), 35, wordtoSpan.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
forgotPasswordTextView.setText(wordtoSpan);
|
||||
}
|
||||
|
||||
private boolean checkFields(){
|
||||
|
||||
if(emailPizzalinkEditText.isEmpty() || passwordPizzalinkEditText.isEmpty()){
|
||||
|
||||
@@ -3,6 +3,7 @@ package ch.pizzalink.android.view;
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Typeface;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.text.Editable;
|
||||
import android.text.InputType;
|
||||
import android.text.TextWatcher;
|
||||
@@ -11,6 +12,7 @@ import android.view.View;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import ch.pizzalink.android.R;
|
||||
@@ -26,10 +28,12 @@ public class PizzalinkEditText extends LinearLayout implements View.OnClickListe
|
||||
private View rootView;
|
||||
private TextView hintTextView;
|
||||
private EditText editText;
|
||||
private RelativeLayout bottomLineLayout;
|
||||
private boolean isPasswordHidden = true;
|
||||
private Typeface typeFace;
|
||||
private String hint;
|
||||
private String inputType;
|
||||
private String edittextTheme;
|
||||
|
||||
/*
|
||||
public PizzalinkEditText(LinearLayout rootView, boolean isLeftIconVisible, int leftIconId,
|
||||
@@ -53,6 +57,7 @@ public class PizzalinkEditText extends LinearLayout implements View.OnClickListe
|
||||
try {
|
||||
hint = a.getString(R.styleable.PizzalinkEditText_hint);
|
||||
inputType = a.getString(R.styleable.PizzalinkEditText_inputType);
|
||||
edittextTheme = a.getString(R.styleable.PizzalinkEditText_edittextTheme);
|
||||
} finally {
|
||||
a.recycle();
|
||||
}
|
||||
@@ -63,7 +68,14 @@ public class PizzalinkEditText extends LinearLayout implements View.OnClickListe
|
||||
rootView = inflate(context, R.layout.layout_pizzalink_edittext, this);
|
||||
hintTextView = (TextView) rootView.findViewById(R.id.hintTextView);
|
||||
editText = (EditText) rootView.findViewById(R.id.editText);
|
||||
bottomLineLayout = (RelativeLayout) rootView.findViewById(R.id.bottomLineLayout);
|
||||
hintTextView.setText(hint);
|
||||
if(edittextTheme != null && edittextTheme.equals("navy")){
|
||||
int navyColor = ContextCompat.getColor(BaseActivity.currentActivity, R.color.navigation_drawer_background);
|
||||
hintTextView.setTextColor(navyColor);
|
||||
editText.setTextColor(navyColor);
|
||||
bottomLineLayout.setBackgroundColor(navyColor);
|
||||
}
|
||||
setInputType();
|
||||
rootView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user