All Downloads are FREE. Search and download functionalities are using the official Maven repository.

butterknife.OnTouch Maven / Gradle / Ivy

There is a newer version: 10.2.3
Show newest version
package butterknife;

import android.support.annotation.IdRes;
import android.view.View;
import butterknife.internal.ListenerClass;
import butterknife.internal.ListenerMethod;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static android.view.View.OnTouchListener;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.CLASS;

/**
 * Bind a method to an {@link OnTouchListener OnTouchListener} on the view for each ID specified.
 * 

 * {@literal @}OnTouch(R.id.example) boolean onTouch() {
 *   Toast.makeText(this, "Touched!", Toast.LENGTH_SHORT).show();
 *   return false;
 * }
 * 
* Any number of parameters from * {@link OnTouchListener#onTouch(android.view.View, android.view.MotionEvent) onTouch} may be used * on the method. * * @see OnTouchListener */ @Target(METHOD) @Retention(CLASS) @ListenerClass( targetType = "android.view.View", setter = "setOnTouchListener", type = "android.view.View.OnTouchListener", method = @ListenerMethod( name = "onTouch", parameters = { "android.view.View", "android.view.MotionEvent" }, returnType = "boolean", defaultReturn = "false" ) ) public @interface OnTouch { /** View IDs to which the method will be bound. */ @IdRes int[] value() default { View.NO_ID }; }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy