当前位置: 首页>>代码示例>>Java>>正文


Java View.performClick方法代码示例

本文整理汇总了Java中android.view.View.performClick方法的典型用法代码示例。如果您正苦于以下问题:Java View.performClick方法的具体用法?Java View.performClick怎么用?Java View.performClick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.view.View的用法示例。


在下文中一共展示了View.performClick方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: clickNoConstraints

import android.view.View; //导入方法依赖的package包/类
static ViewAction clickNoConstraints() {
    return new ViewAction() {
        @Override
        public Matcher<View> getConstraints() {
            return isEnabled(); // No constraints, isEnabled and isClickable are checked
        }

        @Override
        public String getDescription() {
            return "Click a view with no constraints.";
        }

        @Override
        public void perform(UiController uiController, View view) {
            view.performClick();
        }
    };
}
 
开发者ID:dev-labs-bg,项目名称:fullscreen-video-view,代码行数:19,代码来源:CustomChecks.java

示例2: clickChildViewWithId

import android.view.View; //导入方法依赖的package包/类
public static ViewAction clickChildViewWithId(final int id) {
    return new ViewAction() {
        @Override
        public Matcher<View> getConstraints() {
            return null;
        }

        @Override
        public String getDescription() {
            return "Click on a child view with specified id.";
        }

        @Override
        public void perform(UiController uiController, View view) {
            View v = view.findViewById(id);
            v.performClick();
        }
    };
}
 
开发者ID:hernandazevedo,项目名称:starwarsshop,代码行数:20,代码来源:MyViewAction.java

示例3: onTouch

import android.view.View; //导入方法依赖的package包/类
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
    switch (motionEvent.getAction()) {
        case MotionEvent.ACTION_DOWN:
            ObjectAnimator animator = ObjectAnimator.ofFloat(view, "translationZ", 20);
            animator.setDuration(200);
            animator.setInterpolator(new DecelerateInterpolator());
            animator.start();
            view.performClick();
            return true;
        case MotionEvent.ACTION_CANCEL:
        case MotionEvent.ACTION_UP:
            ObjectAnimator animator2 = ObjectAnimator.ofFloat(view, "translationZ", 0);
            animator2.setDuration(200);
            animator2.setInterpolator(new AccelerateInterpolator());
            animator2.start();
            return true;
        default:
            return false;
    }
}
 
开发者ID:coder3101,项目名称:Matrix-Calculator-for-Android,代码行数:22,代码来源:faqs.java

示例4: onTouch

import android.view.View; //导入方法依赖的package包/类
@Override
public boolean onTouch(View v, MotionEvent e) {
	int action = e.getAction() & 255;
	switch (action){
		case MotionEvent.ACTION_DOWN:
			x = e.getX();
			return true;
		case MotionEvent.ACTION_UP:
			if (e.getX()-x > 30.0 * density) {
				LauncherApp.getInstance().getCategoryManager().setCurCategory(LauncherApp.getInstance().getCategoryManager().getPrevCategory());
				appsRef.get().loadFilteredApps();
				appsRef.get().setSpinner();
				return true;
			} else if (x-e.getX() > 30.0 * density) {
				LauncherApp.getInstance().getCategoryManager().setCurCategory(LauncherApp.getInstance().getCategoryManager().getNextCategory());
				appsRef.get().loadFilteredApps();
				appsRef.get().setSpinner();
				return true;
			} else v.performClick();
		default:
			return false;
	}
}
 
开发者ID:HenriDellal,项目名称:emerald,代码行数:24,代码来源:SwipeListener.java

示例5: getMessageLongClickListener

import android.view.View; //导入方法依赖的package包/类
private View.OnLongClickListener getMessageLongClickListener(final Wrapper<MESSAGE> wrapper) {
    return new View.OnLongClickListener() {
        @Override
        public boolean onLongClick(View view) {
            if (selectionListener == null) {
                notifyMessageLongClicked(wrapper.item);
                notifyMessageViewLongClicked(view, wrapper.item);
                return true;
            } else {
                isSelectionModeEnabled = true;
                view.performClick();
                return true;
            }
        }
    };
}
 
开发者ID:sciage,项目名称:FinalProject,代码行数:17,代码来源:MessagesListAdapter.java

示例6: onTouch

import android.view.View; //导入方法依赖的package包/类
@Override
public boolean onTouch(final View view, MotionEvent event) {
	if (event.getAction() == MotionEvent.ACTION_UP) {
		view.requestFocus();
		//MyApplication.hideSoftInputFrom(context, view);
		view.performClick();
	}
	return true;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:SimpleOnTouchListener.java

示例7: selectTab

import android.view.View; //导入方法依赖的package包/类
public void selectTab(int num) {
    if (num < 0 || num >= tabCount) {
        return;
    }
    View tab = tabsContainer.getChildAt(num);
    if (Build.VERSION.SDK_INT >= 15) {
        tab.callOnClick();
    } else {
        tab.performClick();
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:12,代码来源:ScrollSlidingTabStrip.java

示例8: onTouch

import android.view.View; //导入方法依赖的package包/类
private boolean onTouch(View v, MotionEvent event) {
    if (parent.isEmpty()) {
        return false;
    }

    animator.cancel();

    switch (event.getAction()) {
        case MotionEvent.ACTION_DOWN:
            initialTouchX = event.getRawX();
            initialTouchY = event.getRawY();
            startTimeMS = event.getEventTime();
            onMoveStart(v);
            v.setPressed(true);
            return true;
        case MotionEvent.ACTION_MOVE:
            animator.cancel();
            onMove(v, event.getRawX() - initialTouchX, event.getRawY() - initialTouchY);
            return true;
        case MotionEvent.ACTION_UP:
            v.setPressed(false);
            onMoveEnd(v);
            final long downTimeMS = event.getEventTime() - startTimeMS;
            final float halfButtonSize = Math.min(v.getHeight(), v.getWidth()) / 2f;
            final boolean wasClicked = downTimeMS < CLICK_MAX_DURATION_MS
                    && ViewUtil.distance(initialTouchX, initialTouchY, event.getRawX(), event.getRawY()) < halfButtonSize;
            if (wasClicked) {
                v.performClick();
            }
            return true;
        default:
            return true;
    }
}
 
开发者ID:roshakorost,项目名称:Phial,代码行数:35,代码来源:DragHelper.java

示例9: onTouch

import android.view.View; //导入方法依赖的package包/类
@Override
public boolean onTouch(final View view, MotionEvent event) {
    if (event.getAction() == MotionEvent.ACTION_UP) {
        view.requestFocus();
        Utils.hideSoftInputFrom(context, view);
        view.performClick();
    }
    return true;
}
 
开发者ID:davideas,项目名称:AndroidBlueprints,代码行数:10,代码来源:SimpleOnTouchListener.java

示例10: performClick

import android.view.View; //导入方法依赖的package包/类
public void performClick(int adapterPosition) {
    if (listView != null) {
        RecyclerView.ViewHolder holder =
                listView.findViewHolderForLayoutPosition(adapterPosition);
        if (holder != null) {
            View view = holder.itemView;
            if (view != null) {
                view.performClick();
            }
        }
    }
}
 
开发者ID:ccrama,项目名称:Slide-RSS,代码行数:13,代码来源:FeedAdapter.java

示例11: onTouch

import android.view.View; //导入方法依赖的package包/类
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
    view.performClick();
    controller.show();
    return false;
}
 
开发者ID:dev-labs-bg,项目名称:fullscreen-video-view,代码行数:7,代码来源:FullscreenVideoView.java

示例12: perform

import android.view.View; //导入方法依赖的package包/类
@Override
public void perform(UiController uiController, View view) {
    view.performClick();
}
 
开发者ID:jaysondc,项目名称:TripleTap,代码行数:5,代码来源:MultiplayerGameFragmentAndroidTests.java

示例13: performItemClick

import android.view.View; //导入方法依赖的package包/类
public boolean performItemClick(int position){
    View holderView = holders.get(position).itemView;
    return holderView.performClick();
}
 
开发者ID:micromasterandroid,项目名称:androidadvanced,代码行数:5,代码来源:ShadowRecyclerViewAdapter.java

示例14: clickView

import android.view.View; //导入方法依赖的package包/类
/**
 * 单击某个View
 */
public void clickView(View view) {
    if (view != null) {
        view.performClick();
    }
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:9,代码来源:RBaseViewHolder.java

示例15: inflaterOthersView

import android.view.View; //导入方法依赖的package包/类
private View inflaterOthersView() {
    final View othersView = View.inflate(this.context, ResourceUtil.getLayoutResource(this.context, "lepay_cashier_paychannel_other"), null);
    ImageView itemIcon = (ImageView) othersView.findViewById(ResourceUtil.getIdResource(this.context, "lepay_paychannel_item_icon"));
    TextView itemTitle = (TextView) othersView.findViewById(ResourceUtil.getIdResource(this.context, "lepay_paychannel_item_title"));
    final ImageView arrawicon = (ImageView) othersView.findViewById(ResourceUtil.getIdResource(this.context, "lepay_cashier_paytype_other_selector_icon"));
    arrawicon.setImageResource(ResourceUtil.getDrawableResource(this.context, "icon_down"));
    itemIcon.setImageResource(ResourceUtil.getDrawableResource(this.context, "lepay_icon_more"));
    itemTitle.setText(ResourceUtil.getStringResource(this.context, "lepay_ohters_paytype"));
    othersView.setTag(Boolean.FALSE);
    othersView.setOnClickListener(new OnClickListener() {
        public void onClick(View view) {
            int count;
            int i;
            if (((Boolean) view.getTag()).booleanValue()) {
                arrawicon.setImageResource(ResourceUtil.getDrawableResource(CashierAcitivity.this.context, "icon_down"));
                count = CashierAcitivity.this.lepay_cashier_paytype_list.getChildCount();
                for (i = 0; i < count; i++) {
                    View v = CashierAcitivity.this.lepay_cashier_paytype_list.getChildAt(i);
                    CheckBox checkBox = (CheckBox) v.findViewById(ResourceUtil.getIdResource(CashierAcitivity.this, "lepay_paychannel_item_checkbox"));
                    if (checkBox != null) {
                        if (((Boolean) checkBox.getTag()).booleanValue()) {
                            v.setVisibility(8);
                        } else {
                            v.setVisibility(0);
                        }
                    }
                }
                othersView.setTag(Boolean.FALSE);
                return;
            }
            arrawicon.setImageResource(ResourceUtil.getDrawableResource(CashierAcitivity.this.context, "icon_up"));
            count = CashierAcitivity.this.lepay_cashier_paytype_list.getChildCount();
            for (i = 0; i < count; i++) {
                CashierAcitivity.this.lepay_cashier_paytype_list.getChildAt(i).setVisibility(0);
            }
            othersView.setTag(Boolean.TRUE);
        }
    });
    othersView.performClick();
    othersView.performClick();
    return othersView;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:43,代码来源:CashierAcitivity.java


注:本文中的android.view.View.performClick方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。