Java Code Examples for android.view.View.hasOnClickListeners()

The following are Jave code examples for showing how to use hasOnClickListeners() of the android.view.View class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: SLTableView   File: StickyRecyclerHeadersTouchListener.java   Source Code and License Vote up 7 votes
private void viewClick(ViewGroup view, MotionEvent e ) {
    if (inViewInBounds(view, (int) e.getX(), (int) e.getY()) && view.hasOnClickListeners()) {
        view.callOnClick();
    }
    View child;
    for (int i = 0; i < view.getChildCount(); i++) {
        child = view.getChildAt(i);
        if (child instanceof ViewGroup) {
            viewClick((ViewGroup) child, e);
        } else {
            if (inViewInBounds(child, (int) e.getX(), (int) e.getY()) && child.hasOnClickListeners()) {
                child.callOnClick();
            }
        }
    }
}
 
Example 2
Project: Android-Skin-Loader   File: CommonViewHolder.java   Source Code and License Vote up 5 votes
public CommonViewHolder setOnClickListenr(int viewId, OnClickListener listener){
	View view = mViews.get(viewId);
	
	if(view == null){
		view = mConvertView.findViewById(viewId);
		view.setOnClickListener(listener);
		mViews.put(viewId, view);
	}else if(!view.hasOnClickListeners()){
		view.setOnClickListener(listener);
		mViews.put(viewId, view);
	}
	
	return this;
}
 
Example 3
Project: letv   File: ViewCompatICSMr1.java   Source Code and License Vote up 4 votes
public static boolean hasOnClickListeners(View v) {
    return v.hasOnClickListeners();
}
 
Example 4
Project: boohee_v5.6   File: ViewCompatICSMr1.java   Source Code and License Vote up 4 votes
public static boolean hasOnClickListeners(View v) {
    return v.hasOnClickListeners();
}
 
Example 5
Project: RLibrary   File: UILayoutImpl.java   Source Code and License Vote up 4 votes
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
    int actionMasked = ev.getActionMasked();
    if (actionMasked == MotionEvent.ACTION_DOWN) {
        if (mLastShowViewPattern != null) {
            View view = null;
            if (L.LOG_DEBUG && isMainLayout()) {
                view = ViewGroupExKt.findView((ViewGroup) mLastShowViewPattern.mView, ev.getRawX(), ev.getRawY());
                StringBuilder builder = new StringBuilder("touch on->");
                if (view == null) {
                    builder.append("null");
                } else {
                    view.getGlobalVisibleRect(viewVisibleRectTemp);
                    builder.append(viewVisibleRectTemp);
                    builder.append("#");
                    if (view instanceof TextView) {
                        builder.append(((TextView) view).getText());
                        builder.append("#");
                    }
                    if (view.hasOnClickListeners()) {
                        builder.append("$");
                    }
                    builder.append(view);
                }
                L.d(builder.toString());
            }

            if (mLastShowViewPattern.mIView.hideSoftInputOnTouchDown()) {
                if (view == null && isMainLayout()) {
                    view = ViewGroupExKt.findView((ViewGroup) mLastShowViewPattern.mView, ev.getRawX(), ev.getRawY());
                }
                //L.e("call: onInterceptTouchEvent([ev])-> " + RSoftInputLayout.getSoftKeyboardHeight(this));
                //L.e("call: onInterceptTouchEvent([ev])-> " + view);
                if (view != null) {
                    if (view instanceof EditText || view.getTag() != null) {
                        L.w("touch on EditText or tag not null");

                    } else {
                        hideSoftInput();
                    }
                }
            }
        }
    }
    return super.dispatchTouchEvent(ev);
}