本文整理匯總了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();
}