android.test.TouchUtils#dragQuarterScreenUp ( )源码实例Demo

下面列出了android.test.TouchUtils#dragQuarterScreenUp ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: incubator-weex-playground   文件: TestFlow.java
private void findChildCase(final WXTextView inputView ){
        // handle if the view is INVISIBLE then scrollToBottom
//        int maxStep = 10;
        int scrollCount = 0;
        if(inputView.getVisibility() == View.INVISIBLE){
            while(scrollCount <maxStep){
                TouchUtils.dragQuarterScreenUp(this, this.getActivity());
                sleep(1000);
                scrollCount ++;
            }
        }
//        int topCount = 10;
        if(inputView.getVisibility() == View.INVISIBLE){
            while(topCount>0 && (inputView.getVisibility() == View.INVISIBLE)){
                TouchUtils.dragQuarterScreenDown(this, this.getActivity());
                sleep(1000);
                topCount--;
            }
        }

    }
 
/**
 *
 */
public void setUpToFindComponet(String target, InstrumentationTestCase test){
    int max = 60;
    int count = 0;
    while(mCaseListIndexView.size() == 0){

        if (count < max){
            TouchUtils.dragQuarterScreenUp(test, WXPageActivity.wxPageActivityInstance );
            mViewGroup = (ViewGroup) WXPageActivity.wxPageActivityInstance.findViewById(R.id.container);
            mCaseListIndexView = ViewUtil.findViewWithText(mViewGroup, target);
            count ++;
        }
        else{
            break;
        }

    }
}
 
/**
 *
 */
public void setUpToFindComponet(String target, InstrumentationTestCase test){
    int max = 60;
    int count = 0;
    while(mCaseListIndexView.size() == 0){

        if (count < max){
            TouchUtils.dragQuarterScreenUp(test, WXPageActivity.wxPageActivityInstance );
            mViewGroup = (ViewGroup) WXPageActivity.wxPageActivityInstance.findViewById(R.id.container);
            mCaseListIndexView = ViewUtil.findViewWithText(mViewGroup, target);
            count ++;
        }
        else{
            targetComponetNotFound = true;
        }

    }
}
 
/**
 *
 */
public void setUpToFindComponet(String target, InstrumentationTestCase test){
    int max = 60;
    int count = 0;
    while(mCaseListIndexView.size() == 0){

        if (count < max){
            TouchUtils.dragQuarterScreenUp(test, WXPageActivity.wxPageActivityInstance );
            mViewGroup = (ViewGroup) WXPageActivity.wxPageActivityInstance.findViewById(R.id.container);
            mCaseListIndexView = ViewUtil.findViewWithText(mViewGroup, target);
            count ++;
        }
        else{
            break;
        }

    }
}
 
public void addAllTargetView(String target){
    int max = 6;
    int count =0 ;
    while (count < max){
        TouchUtils.dragQuarterScreenUp(this, this.getActivity());
        mViewGroup = (ViewGroup) waTestPageActivity.findViewById(R.id.container);
        mCaseListIndexView = ViewUtil.findViewWithText(mViewGroup, target);
        mCaseListIndexView.addAll(mCaseListIndexView);
        count ++;
    }
}
 
public void addAllTargetView(String target){
    int max = 6;
    int count =0 ;
    while (count < max){
        TouchUtils.dragQuarterScreenUp(this, this.getActivity());
        mViewGroup = (ViewGroup) waTestPageActivity.findViewById(R.id.container);
        mCaseListIndexView = ViewUtil.findViewWithText(mViewGroup, target);
        mCaseListIndexView.addAll(mCaseListIndexView);
        count ++;
    }
}
 
public void addAllTargetView(String target){
    int max = 6;
    int count =0 ;
    while (count < max){
        TouchUtils.dragQuarterScreenUp(this, this.getActivity());
        mViewGroup = (ViewGroup) waTestPageActivity.findViewById(R.id.container);
        mCaseListIndexView = ViewUtil.findViewWithText(mViewGroup, target);
        mCaseListIndexView.addAll(mCaseListIndexView);
        count ++;
    }
}
 
public void addAllTargetView(String target){
    int max = 6;
    int count =0 ;
    while (count < max){
        TouchUtils.dragQuarterScreenUp(this, this.getActivity());
        mViewGroup = (ViewGroup) waTestPageActivity.findViewById(R.id.container);
        mCaseListIndexView = ViewUtil.findViewWithText(mViewGroup, target);
        mCaseListIndexView.addAll(mCaseListIndexView);
        count ++;
    }
}
 
public void addAllTargetView(String target){
    int max = 6;
    int count =0 ;
    while (count < max){
        TouchUtils.dragQuarterScreenUp(this, this.getActivity());
        mViewGroup = (ViewGroup) waTestPageActivity.findViewById(R.id.container);
        mCaseListIndexView = ViewUtil.findViewWithText(mViewGroup, target);
        mCaseListIndexView.addAll(mCaseListIndexView);
        count ++;
    }
}
 
public void addAllTargetView(String target){
    int max = 6;
    int count =0 ;
    while (count < max){
        TouchUtils.dragQuarterScreenUp(this, this.getActivity());
        mViewGroup = (ViewGroup) waTestPageActivity.findViewById(R.id.container);
        mCaseListIndexView = ViewUtil.findViewWithText(mViewGroup, target);
        mCaseListIndexView.addAll(mCaseListIndexView);
        count ++;
    }
}
 
public void addAllTargetView(String target){
    int max = 6;
    int count =0 ;
    while (count < max){
        TouchUtils.dragQuarterScreenUp(this, this.getActivity());
        mViewGroup = (ViewGroup) waTestPageActivity.findViewById(R.id.container);
        mCaseListIndexView = ViewUtil.findViewWithText(mViewGroup, target);
        mCaseListIndexView.addAll(mCaseListIndexView);
        count ++;
    }
}
 
public void addAllTargetView(String target){
    int max = 6;
    int count =0 ;
    while (count < max){
        TouchUtils.dragQuarterScreenUp(this, this.getActivity());
        mViewGroup = (ViewGroup) waTestPageActivity.findViewById(R.id.container);
        mCaseListIndexView = ViewUtil.findViewWithText(mViewGroup, target);
        mCaseListIndexView.addAll(mCaseListIndexView);
        count ++;
    }
}
 
public void addAllTargetView(String target){
    int max = 6;
    int count =0 ;
    while (count < max){
        TouchUtils.dragQuarterScreenUp(this, this.getActivity());
        mViewGroup = (ViewGroup) waTestPageActivity.findViewById(R.id.container);
        mCaseListIndexView = ViewUtil.findViewWithText(mViewGroup, target);
        mCaseListIndexView.addAll(mCaseListIndexView);
        count ++;
    }
}
 
public void addAllTargetView(String target){
    int max = 6;
    int count =0 ;
    while (count < max){
        TouchUtils.dragQuarterScreenUp(this, this.getActivity());
        mViewGroup = (ViewGroup) waTestPageActivity.findViewById(R.id.container);
        mCaseListIndexView = ViewUtil.findViewWithText(mViewGroup, target);
        mCaseListIndexView.addAll(mCaseListIndexView);
        count ++;
    }
}
 
public void addAllTargetView(String target){
    int max = 6;
    int count =0 ;
    while (count < max){
        TouchUtils.dragQuarterScreenUp(this, this.getActivity());
        mViewGroup = (ViewGroup) waTestPageActivity.findViewById(R.id.container);
        mCaseListIndexView = ViewUtil.findViewWithText(mViewGroup, target);
        mCaseListIndexView.addAll(mCaseListIndexView);
        count ++;
    }
}
 
public void addAllTargetView(String target){
    int max = 6;
    int count =0 ;
    while (count < max){
        TouchUtils.dragQuarterScreenUp(this, this.getActivity());
        mViewGroup = (ViewGroup) waTestPageActivity.findViewById(R.id.container);
        mCaseListIndexView = ViewUtil.findViewWithText(mViewGroup, target);
        mCaseListIndexView.addAll(mCaseListIndexView);
        count ++;
    }
}
 
public void addAllTargetView(String target){
    int max = 6;
    int count =0 ;
    while (count < max){
        TouchUtils.dragQuarterScreenUp(this, this.getActivity());
        mViewGroup = (ViewGroup) waTestPageActivity.findViewById(R.id.container);
        mCaseListIndexView = ViewUtil.findViewWithText(mViewGroup, target);
        mCaseListIndexView.addAll(mCaseListIndexView);
        count ++;
    }
}
 
源代码18 项目: incubator-weex-playground   文件: TestFlow.java
public void addAllTargetView(String target){
    int max = 6;
    int count =0 ;
    while (count < max){
        TouchUtils.dragQuarterScreenUp(this, this.getActivity());
        sleep(500);
        mViewGroup = (ViewGroup) waTestPageActivity.findViewById(R.id.container);
        mCaseListIndexView = ViewUtil.findViewWithText(mViewGroup, target);
        mCaseListIndexView.addAll(mCaseListIndexView);
        count ++;
    }
}
 
public void addAllTargetView(String target){
    int max = 6;
    int count =0 ;
    while (count < max){
        TouchUtils.dragQuarterScreenUp(this, this.getActivity());
        mViewGroup = (ViewGroup) waTestPageActivity.findViewById(R.id.container);
        mCaseListIndexView = ViewUtil.findViewWithText(mViewGroup, target);
        mCaseListIndexView.addAll(mCaseListIndexView);
        count ++;
    }
}
 
源代码20 项目: incubator-weex-playground   文件: ViewUtil.java
public static void dragQuarterScreenUp(InstrumentationTestCase test, Activity activity) {

        TouchUtils.dragQuarterScreenUp(test, activity);
    }