|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
import android.content.Context;
|
|
|
|
|
|
|
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.LayoutInflater;
|
|
|
|
|
|
import android.view.MotionEvent;
|
|
|
import android.view.View;
|
|
|
import android.view.View;
|
|
|
|
|
|
|
|
|
|
|
|
import android.view.View.OnTouchListener;
|
|
|
|
|
|
|
|
|
import android.view.ViewGroup;
|
|
|
import android.view.ViewGroup;
|
|
|
|
|
|
|
|
|
import android.widget.ArrayAdapter;
|
|
|
import android.widget.ArrayAdapter;
|
|
|
|
|
|
|
|
|
ImageView checkBoxView = (ImageView) spinnerItem.findViewById(R.id.spinner_item_checkBox);
|
|
|
ImageView checkBoxView = (ImageView) spinnerItem.findViewById(R.id.spinner_item_checkBox);
|
|
|
|
|
|
|
|
|
textView.setText(getItem(position).toString());
|
|
|
textView.setText(getItem(position).toString());
|
|
|
spinnerItem.setBackgroundColor(getContext().getResources().getColor(R.color.black));
|
|
|
|
|
|
|
|
|
spinnerItem.setBackgroundColor(getContext().getResources().getColor(android.R.color.background_dark));
|
|
|
|
|
|
spinnerItem.setOnTouchListener(new DropDownOnTouchListener());
|
|
|
|
|
|
|
|
|
if (this.parentSpinner.getSelectedItemPosition() == position) {
|
|
|
if (this.parentSpinner.getSelectedItemPosition() == position) {
|
|
|
textView.setFont(getContext(), "fonts/TitilliumWeb-Bold.ttf");
|
|
|
textView.setFont(getContext(), "fonts/TitilliumWeb-Bold.ttf");
|
|
|
|
|
|
|
|
|
return (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
|
|
return (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* @author FC Smilari
|
|
|
|
|
|
*/
|
|
|
|
|
|
class DropDownOnTouchListener implements OnTouchListener {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public boolean onTouch(final View v, final MotionEvent event) {
|
|
|
|
|
|
|
|
|
|
|
|
switch (event.getAction()) {
|
|
|
|
|
|
|
|
|
|
|
|
case MotionEvent.ACTION_DOWN: {
|
|
|
|
|
|
v.setBackgroundColor(getContext().getResources().getColor(R.color.android_blue));
|
|
|
|
|
|
((FontTextView) v.findViewById(R.id.spinner_item_view)).setTextColor(getContext().getResources().getColor(R.color.black));
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
}
|