Java Code Examples for android.view.View#setTouchDelegate()

The following examples show how to use android.view.View#setTouchDelegate() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: libcommon   File: ChainedTouchDelegate.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * コンストラクタ
 * @param parent 親View
 * @param target TouchDelegateの対象となるView
 * @param bounds 処理するタッチ領域
 */
public ChainedTouchDelegate(@NonNull final View parent,
	final @NonNull View target, @NonNull  final Rect bounds) {
	super(bounds, target);

	mParentTouchDelegate = parent.getTouchDelegate();
	parent.setTouchDelegate(this);
}
 
Example 2
private void a(View view, View view1)
{
    int i1 = (int)(30F * ChartUtil.getDensity());
    Rect rect = new Rect();
    view1.getHitRect(rect);
    rect.left = rect.left - i1;
    rect.top = rect.top - i1;
    rect.right = i1 + rect.right;
    rect.bottom = i1 + rect.bottom;
    view.setTouchDelegate(new TouchDelegate(rect, view1));
}