address on register
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
package ch.pizzalink.android.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import ch.pizzalink.android.R;
|
||||
|
||||
/**
|
||||
* Created by cimenmus on 26.10.2017.
|
||||
*/
|
||||
|
||||
public class PizzalinkDropdownView extends LinearLayout {
|
||||
|
||||
private View rootView;
|
||||
private TextView hintTextView;
|
||||
private TextView textview;
|
||||
private String hint;
|
||||
|
||||
public PizzalinkDropdownView(Context context) {
|
||||
super(context);
|
||||
init(context);
|
||||
}
|
||||
|
||||
public PizzalinkDropdownView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
||||
TypedArray a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.PizzalinkDropdownView, 0, 0);
|
||||
try {
|
||||
hint = a.getString(R.styleable.PizzalinkDropdownView_dropdownHintView);
|
||||
} finally {
|
||||
a.recycle();
|
||||
}
|
||||
|
||||
init(context);
|
||||
}
|
||||
|
||||
private void init(Context context) {
|
||||
rootView = (View) inflate(context, R.layout.layout_pizzalink_drowdown_view, this);
|
||||
hintTextView = (TextView) rootView.findViewById(R.id.hintTextView);
|
||||
textview = (TextView) rootView.findViewById(R.id.textview);
|
||||
hintTextView.setText(hint);
|
||||
}
|
||||
|
||||
public boolean isEmpty(){
|
||||
return hintTextView.getText().toString().isEmpty();
|
||||
}
|
||||
|
||||
public String getText(){
|
||||
return hintTextView.getText().toString();
|
||||
}
|
||||
|
||||
public void setText(String text){
|
||||
textview.setText(text);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user