Example usage for android.view View PRESSED_ENABLED_STATE_SET

List of usage examples for android.view View PRESSED_ENABLED_STATE_SET

Introduction

In this page you can find the example usage for android.view View PRESSED_ENABLED_STATE_SET.

Prototype

null PRESSED_ENABLED_STATE_SET

To view the source code for android.view View PRESSED_ENABLED_STATE_SET.

Click Source Link

Document

Indicates the view is pressed and enabled.

Usage

From source file:com.filemanager.free.ui.views.FastScroller.java

public void setPressedHandleColor(int i) {
    handle.setColorFilter(i);/*  w  ww . j ava 2s .  c o  m*/
    StateListDrawable stateListDrawable = new StateListDrawable();
    Drawable drawable = ContextCompat.getDrawable(getContext(), R.drawable.fastscroller_handle_normal);
    Drawable drawable1 = ContextCompat.getDrawable(getContext(), R.drawable.fastscroller_handle_pressed);
    stateListDrawable.addState(View.PRESSED_ENABLED_STATE_SET, new InsetDrawable(drawable1,
            getResources().getDimensionPixelSize(R.dimen.fastscroller_track_padding), 0, 0, 0));
    stateListDrawable.addState(View.EMPTY_STATE_SET, new InsetDrawable(drawable,
            getResources().getDimensionPixelSize(R.dimen.fastscroller_track_padding), 0, 0, 0));
    this.handle.setImageDrawable(stateListDrawable);
}