eu.ensam.ii.vrpn
Class VrpnPressButton

java.lang.Object
  extended by android.widget.Button
      extended by eu.ensam.ii.vrpn.VrpnPressButton

public class VrpnPressButton
extends Button

A Button connected to a VRPN Button.

This button is linked to a Vrpn button. It sends sends a true update when its status changes to checked and a false update when its status changes to unchecked. The status of the VrpnPressButton changes when it is pushed, and also when it is released, unlike a VrpnToggleButton.

In your res/layout.xml, include the widget in its parent layout :

 <eu.ensam.ii.VrpnPressButton
   android:layout_width="fill_parent" 
   android:layout_height="wrap_content"
   app:vrpnButton="@id/MyButton"
 />
 

The root element of the layout must declare the following line just after the xmlns:android ... line :

   xmlns:app="http://schemas.android.com/apk/res/your.package.name.here"
 

Custom XML attributes :


Constructor Summary
VrpnPressButton(Context context)
           
VrpnPressButton(Context context, AttributeSet attrs)
           
VrpnPressButton(Context context, AttributeSet attrs, int defStyle)
           
 
Method Summary
 boolean onTouch(View v, MotionEvent event)
          Called when a touch event is dispatched to this VrpnPressButton.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VrpnPressButton

public VrpnPressButton(Context context)

VrpnPressButton

public VrpnPressButton(Context context,
                       AttributeSet attrs)

VrpnPressButton

public VrpnPressButton(Context context,
                       AttributeSet attrs,
                       int defStyle)
Method Detail

onTouch

public boolean onTouch(View v,
                       MotionEvent event)
Called when a touch event is dispatched to this VrpnPressButton. This method sends a true update when the button is pressed and a false update when the button is released. when it is released. No event is send while the button is pressed.

See Also:
View.OnTouchListener