private static StateListDrawable getStateListDrawable ( int normalColor , int pressedColor ) { StateListDrawable states = new StateListDrawable ( ) ; states . addState ( new int [ ] { android . R . attr . state_pressed } , new ColorDrawable ( pressedColor ) ) ; states . addState ( new int [ ] { android . R . attr . state_focused } , new ColorDrawable ( pressedColor ) ) ; states . addState ( new int [ ] { android . R . attr . state_activated } , new ColorDrawable ( pressedColor ) ) ; states . addState ( new int [ ] { } , new ColorDrawable ( normalColor ) ) ; return states ; }
helper to create an StateListDrawable for the given normal and pressed color