Right slide controls overview

RightScrollView right sliding control is to monitor the user right hand gestures, perform gestures with animation, and at the end of the right to provide an interface of the control.Developers can define their own functions in the right sliding interface.Generally applied in the right slide out/up.This control is a container, there is no actual content, so use need to add content to the control.

The right sliding control is introduced

To control the content

You need to add a view to RightScrollView content:

 
setContentView(int);
 
Parameters: the resource ID of the general layout file.
 
setContentView(View);
 
Parameters: the View.
 
setContentView(View, LayoutParams)
 
Parameters: the View, any View;LayoutParams, layout parameters, is used to control the view in the layout of the RightScrollView.

Open/close the right to monitor

You can open/close right at a particular time listening in operation, need to achieve the interaction effects:

 
enableRightScroll();
 
Open the right operation monitoring, will intercept the right operation.
 
disableRightScroll();
 
Close the right to monitor, intercept will no longer slide operation right and handled by system or user processing on its own.

Right listener

Right after the slide, slide controls if right is set to the listener, calls the listener callback method, execute right given by the user logic.

 
OnRightScrollListener
 
Right listener。

Listening to the right event

To listen right slide events you need OnRightScrollListener callback method in the listener: onRightScroll ().Controls can slip on the right after the callback, this method performs logic given by the user.

Right exit application is a typical usage:


public class RightScrollActivity extends Activity implements
        OnRightScrollListener {
    private RightScrollView mView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mView = new RightScrollView(this);
        super.setContentView(mView);
        mView.setOnRightScrollListener(this);
    }

    @Override
    public void setContentView(int layoutResID) {
        mView.setContentView(layoutResID);
    }

    @Override
    public void setContentView(View view) {
        mView.setContentView(view);
    }

    @Override
    public void setContentView(View view, LayoutParams params) {
        mView.setContentView(view, params);
    }

    @Override
    public void onRightScroll() {
        super.onBackPressed();
    }
}

In the example above didn't close right operation requirements, in actual use, may need to close right slide to avoid conflict events or to achieve a more flexible interaction.