本文整理汇总了Java中android.view.View.hasOnClickListeners方法的典型用法代码示例。如果您正苦于以下问题:Java View.hasOnClickListeners方法的具体用法?Java View.hasOnClickListeners怎么用?Java View.hasOnClickListeners使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.View
的用法示例。
在下文中一共展示了View.hasOnClickListeners方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: viewClick
import android.view.View; //导入方法依赖的package包/类
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();
}
}
}
}
示例2: setOnClickListenr
import android.view.View; //导入方法依赖的package包/类
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;
}
示例3: dispatchTouchEvent
import android.view.View; //导入方法依赖的package包/类
@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);
}
示例4: hasOnClickListeners
import android.view.View; //导入方法依赖的package包/类
public static boolean hasOnClickListeners(View v) {
return v.hasOnClickListeners();
}