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

The following examples show how to use android.view.View#setTouchDelegate() . 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 check out the related API usage on the sidebar.
Example 1
Source File: ChainedTouchDelegate.java    From libcommon with 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
Source File: DynamicDetailFragment.java    From MiBandDecompiled with Apache License 2.0 5 votes vote down vote up
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));
}