Example usage for android.widget RelativeLayout setOnDragListener

List of usage examples for android.widget RelativeLayout setOnDragListener

Introduction

In this page you can find the example usage for android.widget RelativeLayout setOnDragListener.

Prototype

public void setOnDragListener(OnDragListener l) 

Source Link

Document

Register a drag event listener callback object for this View.

Usage

From source file:io.cloudmatch.demo.pinchanddrag.PADActivity.java

public void initCloudMatch() {
    // initializes the CloudMatch. In this case we also immediately connect,
    // but it could be done also at a different stage.
    try {/*from   w  w  w. j  ava 2s  . c  om*/
        mPinchView.initCloudMatch(this, new PADServerEventListener(this, mMatchedInterface, mDeliveryInterface),
                new LocationProvider() {
                    @Override
                    public Location getLocation() {
                        if (mGoogleApiClient.isConnected()) {
                            mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
                        }
                        return mLastLocation;
                    }
                }, mPinchDemoSMVI);
        mPinchView.connect();
    } catch (PackageManager.NameNotFoundException e) {
        e.printStackTrace();
    }

    // get the CloudMatchPinchViewHorizontal object from the xml layout and sets the interface on it.
    mRectIV.setOnTouchListener(new ShapeOnTouchListener());
    mCircleIV.setOnTouchListener(new ShapeOnTouchListener());

    // setup gesture detector and areas
    mRightRL.setOnDragListener(new SideAreaDragListener(SideAreas.Right));
    mRightRL.setOnTouchListener(new SideAreaOnTouchListener(SideAreas.Right));

    mLeftRL.setOnDragListener(new SideAreaDragListener(SideAreas.Left));
    mLeftRL.setOnTouchListener(new SideAreaOnTouchListener(SideAreas.Left));

    final RelativeLayout centerRL = (RelativeLayout) findViewById(R.id.center_view);
    centerRL.setOnDragListener(new CenterAreaDragListener());
}