package ch.pizzalink.android.view;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Typeface;
import android.text.Editable;
import android.text.InputType;
import android.text.TextWatcher;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.LinearLayout;
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 23.10.2017.
 */

public class PizzalinkDropdown extends LinearLayout{

    private View rootView;
    private TextView hintTextView;
    private TextView textview;
    private Typeface typeFace;
    private String hint;

    public PizzalinkDropdown(Context context) {
        super(context);
        init(context);
    }

    public PizzalinkDropdown(Context context, AttributeSet attrs) {
        super(context, attrs);
        TypedArray a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.PizzalinkDropdown, 0, 0);
        try {
            hint = a.getString(R.styleable.PizzalinkDropdown_dropdownHint);
        } finally {
            a.recycle();
        }
        init(context);
    }

    private void init(Context context) {
        rootView = (View) inflate(context, R.layout.layout_pizzalink_dropdown, this);
        hintTextView = (TextView) rootView.findViewById(R.id.hintTextView);
        textview = (TextView) rootView.findViewById(R.id.textview);
        rootView.setClickable(true);
        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);
    }

    private void onZoneDropdownClicked(View view){
        Log.i("vdknvkd", "vıjıwf");
    }

    private void onCountryDropdownClicked(View view){
        Log.i("vdknvkd", "vıjıwf");
    }
}