private OnTouchListener onTouchListener = new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
changeColor(tabMap.get(v.getTag().toString()), event);
return false;
}
};
public void changeColor(TabView tabView, MotionEvent e){
ViewGroup layout = tabView.getLayout();
switch (e.getAction()) {
case MotionEvent.ACTION_DOWN: //눌렸을 때
layout.setBackgroundResource(R.color.dark_gray);
break;
case MotionEvent.ACTION_UP: //기본
layout.setBackgroundResource(R.drawable.background_tab);
break;
case MotionEvent.ACTION_MOVE: //움직였을 때
layout.setBackgroundResource(R.color.dark_gray);
break;
default:
layout.setBackgroundResource(R.drawable.background_tab);
break;
}
}