id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
30,000 | uber/NullAway | jar-infer/jar-infer-lib/src/main/java/com/uber/nullaway/jarinfer/DefinitelyDerefedParamsDriver.java | DefinitelyDerefedParamsDriver.getSimpleTypeName | private static String getSimpleTypeName(TypeReference typ) {
final Map<String, String> mapFullTypeName =
ImmutableMap.<String, String>builder()
.put("B", "byte")
.put("C", "char")
.put("D", "double")
.put("F", "float")
.put("I", "int")
... | java | private static String getSimpleTypeName(TypeReference typ) {
final Map<String, String> mapFullTypeName =
ImmutableMap.<String, String>builder()
.put("B", "byte")
.put("C", "char")
.put("D", "double")
.put("F", "float")
.put("I", "int")
... | [
"private",
"static",
"String",
"getSimpleTypeName",
"(",
"TypeReference",
"typ",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"mapFullTypeName",
"=",
"ImmutableMap",
".",
"<",
"String",
",",
"String",
">",
"builder",
"(",
")",
".",
"put",
"... | Get simple unqualified type name.
@param typ Type Reference.
@return String Unqualified type name. | [
"Get",
"simple",
"unqualified",
"type",
"name",
"."
] | c3979b4241f80411dbba6aac3ff653acbb88d00b | https://github.com/uber/NullAway/blob/c3979b4241f80411dbba6aac3ff653acbb88d00b/jar-infer/jar-infer-lib/src/main/java/com/uber/nullaway/jarinfer/DefinitelyDerefedParamsDriver.java#L400-L422 |
30,001 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/GLRenderWrapper.java | GLRenderWrapper.savePixels | private Bitmap savePixels(int x, int y, int w, int h) {
int b[] = new int[w * (y + h)];
int bt[] = new int[w * h];
IntBuffer ib = IntBuffer.wrap(b);
ib.position(0);
GLES20.glReadPixels(x, 0, w, y + h, GLES20.GL_RGBA,
GLES20.GL_UNSIGNED_BYTE, ib);
for (int i = 0, k = 0; i < h; i++, k++) {
// remember... | java | private Bitmap savePixels(int x, int y, int w, int h) {
int b[] = new int[w * (y + h)];
int bt[] = new int[w * h];
IntBuffer ib = IntBuffer.wrap(b);
ib.position(0);
GLES20.glReadPixels(x, 0, w, y + h, GLES20.GL_RGBA,
GLES20.GL_UNSIGNED_BYTE, ib);
for (int i = 0, k = 0; i < h; i++, k++) {
// remember... | [
"private",
"Bitmap",
"savePixels",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"w",
",",
"int",
"h",
")",
"{",
"int",
"b",
"[",
"]",
"=",
"new",
"int",
"[",
"w",
"*",
"(",
"y",
"+",
"h",
")",
"]",
";",
"int",
"bt",
"[",
"]",
"=",
"new",... | Extract the bitmap from OpenGL
@param x the start column
@param y the start line
@param w the width of the bitmap
@param h the height of the bitmap | [
"Extract",
"the",
"bitmap",
"from",
"OpenGL"
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/GLRenderWrapper.java#L128-L150 |
30,002 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Scroller.java | Scroller.drag | public void drag(float fromX, float toX, float fromY, float toY,
int stepCount) {
long downTime = SystemClock.uptimeMillis();
long eventTime = SystemClock.uptimeMillis();
float y = fromY;
float x = fromX;
float yStep = (toY - fromY) / stepCount;
float xStep = (toX - fromX) / stepCount;
MotionEvent even... | java | public void drag(float fromX, float toX, float fromY, float toY,
int stepCount) {
long downTime = SystemClock.uptimeMillis();
long eventTime = SystemClock.uptimeMillis();
float y = fromY;
float x = fromX;
float yStep = (toY - fromY) / stepCount;
float xStep = (toX - fromX) / stepCount;
MotionEvent even... | [
"public",
"void",
"drag",
"(",
"float",
"fromX",
",",
"float",
"toX",
",",
"float",
"fromY",
",",
"float",
"toY",
",",
"int",
"stepCount",
")",
"{",
"long",
"downTime",
"=",
"SystemClock",
".",
"uptimeMillis",
"(",
")",
";",
"long",
"eventTime",
"=",
"... | Simulate touching a specific location and dragging to a new location.
This method was copied from {@code TouchUtils.java} in the Android Open Source Project, and modified here.
@param fromX X coordinate of the initial touch, in screen coordinates
@param toX Xcoordinate of the drag destination, in screen coordinates
@... | [
"Simulate",
"touching",
"a",
"specific",
"location",
"and",
"dragging",
"to",
"a",
"new",
"location",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Scroller.java#L69-L95 |
30,003 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Scroller.java | Scroller.scrollView | public boolean scrollView(final View view, int direction){
if(view == null){
return false;
}
int height = view.getHeight();
height--;
int scrollTo = -1;
if (direction == DOWN) {
scrollTo = height;
}
else if (direction == UP) {
scrollTo = -height;
}
int originalY = view.getScrollY();
f... | java | public boolean scrollView(final View view, int direction){
if(view == null){
return false;
}
int height = view.getHeight();
height--;
int scrollTo = -1;
if (direction == DOWN) {
scrollTo = height;
}
else if (direction == UP) {
scrollTo = -height;
}
int originalY = view.getScrollY();
f... | [
"public",
"boolean",
"scrollView",
"(",
"final",
"View",
"view",
",",
"int",
"direction",
")",
"{",
"if",
"(",
"view",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"int",
"height",
"=",
"view",
".",
"getHeight",
"(",
")",
";",
"height",
"--",... | Scrolls a ScrollView.
@param direction the direction to be scrolled
@return {@code true} if scrolling occurred, false if it did not | [
"Scrolls",
"a",
"ScrollView",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Scroller.java#L105-L136 |
30,004 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Scroller.java | Scroller.scroll | @SuppressWarnings("unchecked")
public boolean scroll(int direction, boolean allTheWay) {
ArrayList<View> viewList = RobotiumUtils.removeInvisibleViews(viewFetcher.getAllViews(true));
ArrayList<View> filteredViews = RobotiumUtils.filterViewsToSet(new Class[] { ListView.class,
ScrollView.class, GridView.class, ... | java | @SuppressWarnings("unchecked")
public boolean scroll(int direction, boolean allTheWay) {
ArrayList<View> viewList = RobotiumUtils.removeInvisibleViews(viewFetcher.getAllViews(true));
ArrayList<View> filteredViews = RobotiumUtils.filterViewsToSet(new Class[] { ListView.class,
ScrollView.class, GridView.class, ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"boolean",
"scroll",
"(",
"int",
"direction",
",",
"boolean",
"allTheWay",
")",
"{",
"ArrayList",
"<",
"View",
">",
"viewList",
"=",
"RobotiumUtils",
".",
"removeInvisibleViews",
"(",
"viewFetcher",
"... | Scrolls up and down.
@param direction the direction in which to scroll
@param allTheWay <code>true</code> if the view should be scrolled to the beginning or end,
<code>false</code> to scroll one page up or down.
@return {@code true} if more scrolling can be done | [
"Scrolls",
"up",
"and",
"down",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Scroller.java#L181-L214 |
30,005 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Scroller.java | Scroller.scrollWebView | public boolean scrollWebView(final WebView webView, int direction, final boolean allTheWay){
if (direction == DOWN) {
inst.runOnMainSync(new Runnable(){
public void run(){
canScroll = webView.pageDown(allTheWay);
}
});
}
if(direction == UP){
inst.runOnMainSync(new Runnable(){
public vo... | java | public boolean scrollWebView(final WebView webView, int direction, final boolean allTheWay){
if (direction == DOWN) {
inst.runOnMainSync(new Runnable(){
public void run(){
canScroll = webView.pageDown(allTheWay);
}
});
}
if(direction == UP){
inst.runOnMainSync(new Runnable(){
public vo... | [
"public",
"boolean",
"scrollWebView",
"(",
"final",
"WebView",
"webView",
",",
"int",
"direction",
",",
"final",
"boolean",
"allTheWay",
")",
"{",
"if",
"(",
"direction",
"==",
"DOWN",
")",
"{",
"inst",
".",
"runOnMainSync",
"(",
"new",
"Runnable",
"(",
")... | Scrolls a WebView.
@param webView the WebView to scroll
@param direction the direction to scroll
@param allTheWay {@code true} to scroll the view all the way up or down, {@code false} to scroll one page up or down or down.
@return {@code true} if more scrolling can be done | [
"Scrolls",
"a",
"WebView",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Scroller.java#L225-L242 |
30,006 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Scroller.java | Scroller.scrollList | public <T extends AbsListView> boolean scrollList(T absListView, int direction, boolean allTheWay) {
if(absListView == null){
return false;
}
if (direction == DOWN) {
int listCount = absListView.getCount();
int lastVisiblePosition = absListView.getLastVisiblePosition();
if (allTheWay) {
scroll... | java | public <T extends AbsListView> boolean scrollList(T absListView, int direction, boolean allTheWay) {
if(absListView == null){
return false;
}
if (direction == DOWN) {
int listCount = absListView.getCount();
int lastVisiblePosition = absListView.getLastVisiblePosition();
if (allTheWay) {
scroll... | [
"public",
"<",
"T",
"extends",
"AbsListView",
">",
"boolean",
"scrollList",
"(",
"T",
"absListView",
",",
"int",
"direction",
",",
"boolean",
"allTheWay",
")",
"{",
"if",
"(",
"absListView",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",... | Scrolls a list.
@param absListView the list to be scrolled
@param direction the direction to be scrolled
@param allTheWay {@code true} to scroll the view all the way up or down, {@code false} to scroll one page up or down
@return {@code true} if more scrolling can be done | [
"Scrolls",
"a",
"list",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Scroller.java#L253-L308 |
30,007 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Scroller.java | Scroller.scrollListToLine | public <T extends AbsListView> void scrollListToLine(final T view, final int line){
if(view == null)
Assert.fail("AbsListView is null!");
final int lineToMoveTo;
if(view instanceof GridView) {
lineToMoveTo = line+1;
}
else {
lineToMoveTo = line;
}
inst.runOnMainSync(new Runnable(){
public vo... | java | public <T extends AbsListView> void scrollListToLine(final T view, final int line){
if(view == null)
Assert.fail("AbsListView is null!");
final int lineToMoveTo;
if(view instanceof GridView) {
lineToMoveTo = line+1;
}
else {
lineToMoveTo = line;
}
inst.runOnMainSync(new Runnable(){
public vo... | [
"public",
"<",
"T",
"extends",
"AbsListView",
">",
"void",
"scrollListToLine",
"(",
"final",
"T",
"view",
",",
"final",
"int",
"line",
")",
"{",
"if",
"(",
"view",
"==",
"null",
")",
"Assert",
".",
"fail",
"(",
"\"AbsListView is null!\"",
")",
";",
"fina... | Scroll the list to a given line
@param view the {@link AbsListView} to scroll
@param line the line to scroll to | [
"Scroll",
"the",
"list",
"to",
"a",
"given",
"line"
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Scroller.java#L318-L335 |
30,008 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Scroller.java | Scroller.scrollViewToSide | public void scrollViewToSide(View view, Side side, float scrollPosition, int stepCount) {
int[] corners = new int[2];
view.getLocationOnScreen(corners);
int viewHeight = view.getHeight();
int viewWidth = view.getWidth();
float x = corners[0] + viewWidth * scrollPosition;
float y = corners[1] + viewHeight / ... | java | public void scrollViewToSide(View view, Side side, float scrollPosition, int stepCount) {
int[] corners = new int[2];
view.getLocationOnScreen(corners);
int viewHeight = view.getHeight();
int viewWidth = view.getWidth();
float x = corners[0] + viewWidth * scrollPosition;
float y = corners[1] + viewHeight / ... | [
"public",
"void",
"scrollViewToSide",
"(",
"View",
"view",
",",
"Side",
"side",
",",
"float",
"scrollPosition",
",",
"int",
"stepCount",
")",
"{",
"int",
"[",
"]",
"corners",
"=",
"new",
"int",
"[",
"2",
"]",
";",
"view",
".",
"getLocationOnScreen",
"(",... | Scrolls view horizontally.
@param view the view to scroll
@param side the side to which to scroll; {@link Side#RIGHT} or {@link Side#LEFT}
@param scrollPosition the position to scroll to, from 0 to 1 where 1 is all the way. Example is: 0.55.
@param stepCount how many move steps to include in the scroll. Less steps res... | [
"Scrolls",
"view",
"horizontally",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Scroller.java#L372-L383 |
30,009 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ScreenshotTaker.java | ScreenshotTaker.getScreenshotView | private View getScreenshotView() {
View decorView = viewFetcher.getRecentDecorView(viewFetcher.getWindowDecorViews());
final long endTime = SystemClock.uptimeMillis() + Timeout.getSmallTimeout();
while (decorView == null) {
final boolean timedOut = SystemClock.uptimeMillis() > endTime;
if (timedOut){
... | java | private View getScreenshotView() {
View decorView = viewFetcher.getRecentDecorView(viewFetcher.getWindowDecorViews());
final long endTime = SystemClock.uptimeMillis() + Timeout.getSmallTimeout();
while (decorView == null) {
final boolean timedOut = SystemClock.uptimeMillis() > endTime;
if (timedOut){
... | [
"private",
"View",
"getScreenshotView",
"(",
")",
"{",
"View",
"decorView",
"=",
"viewFetcher",
".",
"getRecentDecorView",
"(",
"viewFetcher",
".",
"getWindowDecorViews",
"(",
")",
")",
";",
"final",
"long",
"endTime",
"=",
"SystemClock",
".",
"uptimeMillis",
"(... | Gets the proper view to use for a screenshot. | [
"Gets",
"the",
"proper",
"view",
"to",
"use",
"for",
"a",
"screenshot",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ScreenshotTaker.java#L149-L166 |
30,010 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ScreenshotTaker.java | ScreenshotTaker.wrapAllGLViews | private void wrapAllGLViews(View decorView) {
ArrayList<GLSurfaceView> currentViews = viewFetcher.getCurrentViews(GLSurfaceView.class, true, decorView);
final CountDownLatch latch = new CountDownLatch(currentViews.size());
for (GLSurfaceView glView : currentViews) {
Object renderContainer = new Reflect(glView... | java | private void wrapAllGLViews(View decorView) {
ArrayList<GLSurfaceView> currentViews = viewFetcher.getCurrentViews(GLSurfaceView.class, true, decorView);
final CountDownLatch latch = new CountDownLatch(currentViews.size());
for (GLSurfaceView glView : currentViews) {
Object renderContainer = new Reflect(glView... | [
"private",
"void",
"wrapAllGLViews",
"(",
"View",
"decorView",
")",
"{",
"ArrayList",
"<",
"GLSurfaceView",
">",
"currentViews",
"=",
"viewFetcher",
".",
"getCurrentViews",
"(",
"GLSurfaceView",
".",
"class",
",",
"true",
",",
"decorView",
")",
";",
"final",
"... | Extract and wrap the all OpenGL ES Renderer. | [
"Extract",
"and",
"wrap",
"the",
"all",
"OpenGL",
"ES",
"Renderer",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ScreenshotTaker.java#L171-L204 |
30,011 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ScreenshotTaker.java | ScreenshotTaker.getBitmapOfWebView | private Bitmap getBitmapOfWebView(final WebView webView){
Picture picture = webView.capturePicture();
Bitmap b = Bitmap.createBitmap( picture.getWidth(), picture.getHeight(), Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(b);
picture.draw(c);
return b;
} | java | private Bitmap getBitmapOfWebView(final WebView webView){
Picture picture = webView.capturePicture();
Bitmap b = Bitmap.createBitmap( picture.getWidth(), picture.getHeight(), Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(b);
picture.draw(c);
return b;
} | [
"private",
"Bitmap",
"getBitmapOfWebView",
"(",
"final",
"WebView",
"webView",
")",
"{",
"Picture",
"picture",
"=",
"webView",
".",
"capturePicture",
"(",
")",
";",
"Bitmap",
"b",
"=",
"Bitmap",
".",
"createBitmap",
"(",
"picture",
".",
"getWidth",
"(",
")",... | Returns a bitmap of a given WebView.
@param webView the webView to save a bitmap from
@return a bitmap of the given web view | [
"Returns",
"a",
"bitmap",
"of",
"a",
"given",
"WebView",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ScreenshotTaker.java#L215-L221 |
30,012 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ScreenshotTaker.java | ScreenshotTaker.getBitmapOfView | private Bitmap getBitmapOfView(final View view){
view.destroyDrawingCache();
view.buildDrawingCache(false);
Bitmap orig = view.getDrawingCache();
Bitmap.Config config = null;
if(orig == null) {
return null;
}
config = orig.getConfig();
if(config == null) {
config = Bitmap.Config.ARGB_8888;
}
... | java | private Bitmap getBitmapOfView(final View view){
view.destroyDrawingCache();
view.buildDrawingCache(false);
Bitmap orig = view.getDrawingCache();
Bitmap.Config config = null;
if(orig == null) {
return null;
}
config = orig.getConfig();
if(config == null) {
config = Bitmap.Config.ARGB_8888;
}
... | [
"private",
"Bitmap",
"getBitmapOfView",
"(",
"final",
"View",
"view",
")",
"{",
"view",
".",
"destroyDrawingCache",
"(",
")",
";",
"view",
".",
"buildDrawingCache",
"(",
"false",
")",
";",
"Bitmap",
"orig",
"=",
"view",
".",
"getDrawingCache",
"(",
")",
";... | Returns a bitmap of a given View.
@param view the view to save a bitmap from
@return a bitmap of the given view | [
"Returns",
"a",
"bitmap",
"of",
"a",
"given",
"View",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ScreenshotTaker.java#L231-L250 |
30,013 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ScreenshotTaker.java | ScreenshotTaker.getFileName | private String getFileName(final String name){
SimpleDateFormat sdf = new SimpleDateFormat("ddMMyy-hhmmss");
String fileName = null;
if(name == null){
if(config.screenshotFileType == ScreenshotFileType.JPEG){
fileName = sdf.format( new Date()).toString()+ ".jpg";
}
else{
fileName = sdf.format( ne... | java | private String getFileName(final String name){
SimpleDateFormat sdf = new SimpleDateFormat("ddMMyy-hhmmss");
String fileName = null;
if(name == null){
if(config.screenshotFileType == ScreenshotFileType.JPEG){
fileName = sdf.format( new Date()).toString()+ ".jpg";
}
else{
fileName = sdf.format( ne... | [
"private",
"String",
"getFileName",
"(",
"final",
"String",
"name",
")",
"{",
"SimpleDateFormat",
"sdf",
"=",
"new",
"SimpleDateFormat",
"(",
"\"ddMMyy-hhmmss\"",
")",
";",
"String",
"fileName",
"=",
"null",
";",
"if",
"(",
"name",
"==",
"null",
")",
"{",
... | Returns a proper filename depending on if name is given or not.
@param name the given name
@return a proper filename depedning on if a name is given or not | [
"Returns",
"a",
"proper",
"filename",
"depending",
"on",
"if",
"name",
"is",
"given",
"or",
"not",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ScreenshotTaker.java#L260-L280 |
30,014 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ScreenshotTaker.java | ScreenshotTaker.initScreenShotSaver | private void initScreenShotSaver() {
if(screenShotSaverThread == null || screenShotSaver == null) {
screenShotSaverThread = new HandlerThread("ScreenShotSaver");
screenShotSaverThread.start();
screenShotSaver = new ScreenShotSaver(screenShotSaverThread);
}
} | java | private void initScreenShotSaver() {
if(screenShotSaverThread == null || screenShotSaver == null) {
screenShotSaverThread = new HandlerThread("ScreenShotSaver");
screenShotSaverThread.start();
screenShotSaver = new ScreenShotSaver(screenShotSaverThread);
}
} | [
"private",
"void",
"initScreenShotSaver",
"(",
")",
"{",
"if",
"(",
"screenShotSaverThread",
"==",
"null",
"||",
"screenShotSaver",
"==",
"null",
")",
"{",
"screenShotSaverThread",
"=",
"new",
"HandlerThread",
"(",
"\"ScreenShotSaver\"",
")",
";",
"screenShotSaverTh... | This method initializes the aysnc screenshot saving logic | [
"This",
"method",
"initializes",
"the",
"aysnc",
"screenshot",
"saving",
"logic"
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ScreenshotTaker.java#L285-L291 |
30,015 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ActivityUtils.java | ActivityUtils.createStackAndPushStartActivity | private void createStackAndPushStartActivity(){
activityStack = new Stack<WeakReference<Activity>>();
if (activity != null && config.trackActivities){
WeakReference<Activity> weakReference = new WeakReference<Activity>(activity);
activity = null;
activityStack.push(weakReference);
}
} | java | private void createStackAndPushStartActivity(){
activityStack = new Stack<WeakReference<Activity>>();
if (activity != null && config.trackActivities){
WeakReference<Activity> weakReference = new WeakReference<Activity>(activity);
activity = null;
activityStack.push(weakReference);
}
} | [
"private",
"void",
"createStackAndPushStartActivity",
"(",
")",
"{",
"activityStack",
"=",
"new",
"Stack",
"<",
"WeakReference",
"<",
"Activity",
">",
">",
"(",
")",
";",
"if",
"(",
"activity",
"!=",
"null",
"&&",
"config",
".",
"trackActivities",
")",
"{",
... | Creates a new activity stack and pushes the start activity. | [
"Creates",
"a",
"new",
"activity",
"stack",
"and",
"pushes",
"the",
"start",
"activity",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ActivityUtils.java#L69-L76 |
30,016 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ActivityUtils.java | ActivityUtils.setupActivityMonitor | private void setupActivityMonitor() {
if(config.trackActivities){
try {
IntentFilter filter = null;
activityMonitor = inst.addMonitor(filter, null, false);
} catch (Exception e) {
e.printStackTrace();
}
}
} | java | private void setupActivityMonitor() {
if(config.trackActivities){
try {
IntentFilter filter = null;
activityMonitor = inst.addMonitor(filter, null, false);
} catch (Exception e) {
e.printStackTrace();
}
}
} | [
"private",
"void",
"setupActivityMonitor",
"(",
")",
"{",
"if",
"(",
"config",
".",
"trackActivities",
")",
"{",
"try",
"{",
"IntentFilter",
"filter",
"=",
"null",
";",
"activityMonitor",
"=",
"inst",
".",
"addMonitor",
"(",
"filter",
",",
"null",
",",
"fa... | This is were the activityMonitor is set up. The monitor will keep check
for the currently active activity. | [
"This",
"is",
"were",
"the",
"activityMonitor",
"is",
"set",
"up",
".",
"The",
"monitor",
"will",
"keep",
"check",
"for",
"the",
"currently",
"active",
"activity",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ActivityUtils.java#L103-L112 |
30,017 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ActivityUtils.java | ActivityUtils.removeActivityFromStack | private void removeActivityFromStack(Activity activity){
Iterator<WeakReference<Activity>> activityStackIterator = activityStack.iterator();
while(activityStackIterator.hasNext()){
Activity activityFromWeakReference = activityStackIterator.next().get();
if(activityFromWeakReference == null){
activitySta... | java | private void removeActivityFromStack(Activity activity){
Iterator<WeakReference<Activity>> activityStackIterator = activityStack.iterator();
while(activityStackIterator.hasNext()){
Activity activityFromWeakReference = activityStackIterator.next().get();
if(activityFromWeakReference == null){
activitySta... | [
"private",
"void",
"removeActivityFromStack",
"(",
"Activity",
"activity",
")",
"{",
"Iterator",
"<",
"WeakReference",
"<",
"Activity",
">>",
"activityStackIterator",
"=",
"activityStack",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"activityStackIterator",
".",
... | Removes a given activity from the activity stack
@param activity the activity to remove | [
"Removes",
"a",
"given",
"activity",
"from",
"the",
"activity",
"stack"
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ActivityUtils.java#L176-L190 |
30,018 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ActivityUtils.java | ActivityUtils.addActivityToStack | private void addActivityToStack(Activity activity){
activitiesStoredInActivityStack.push(activity.toString());
weakActivityReference = new WeakReference<Activity>(activity);
activity = null;
activityStack.push(weakActivityReference);
} | java | private void addActivityToStack(Activity activity){
activitiesStoredInActivityStack.push(activity.toString());
weakActivityReference = new WeakReference<Activity>(activity);
activity = null;
activityStack.push(weakActivityReference);
} | [
"private",
"void",
"addActivityToStack",
"(",
"Activity",
"activity",
")",
"{",
"activitiesStoredInActivityStack",
".",
"push",
"(",
"activity",
".",
"toString",
"(",
")",
")",
";",
"weakActivityReference",
"=",
"new",
"WeakReference",
"<",
"Activity",
">",
"(",
... | Adds an activity to the stack
@param activity the activity to add | [
"Adds",
"an",
"activity",
"to",
"the",
"stack"
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ActivityUtils.java#L243-L248 |
30,019 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ActivityUtils.java | ActivityUtils.waitForActivityIfNotAvailable | private final void waitForActivityIfNotAvailable(){
if(activityStack.isEmpty() || activityStack.peek().get() == null){
if (activityMonitor != null) {
Activity activity = activityMonitor.getLastActivity();
while (activity == null){
sleeper.sleepMini();
activity = activityMonitor.getLastActivity()... | java | private final void waitForActivityIfNotAvailable(){
if(activityStack.isEmpty() || activityStack.peek().get() == null){
if (activityMonitor != null) {
Activity activity = activityMonitor.getLastActivity();
while (activity == null){
sleeper.sleepMini();
activity = activityMonitor.getLastActivity()... | [
"private",
"final",
"void",
"waitForActivityIfNotAvailable",
"(",
")",
"{",
"if",
"(",
"activityStack",
".",
"isEmpty",
"(",
")",
"||",
"activityStack",
".",
"peek",
"(",
")",
".",
"get",
"(",
")",
"==",
"null",
")",
"{",
"if",
"(",
"activityMonitor",
"!... | Waits for an activity to be started if one is not provided
by the constructor. | [
"Waits",
"for",
"an",
"activity",
"to",
"be",
"started",
"if",
"one",
"is",
"not",
"provided",
"by",
"the",
"constructor",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ActivityUtils.java#L255-L272 |
30,020 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ActivityUtils.java | ActivityUtils.getString | public String getString(int resId)
{
Activity activity = getCurrentActivity(false);
if(activity == null){
return "";
}
return activity.getString(resId);
} | java | public String getString(int resId)
{
Activity activity = getCurrentActivity(false);
if(activity == null){
return "";
}
return activity.getString(resId);
} | [
"public",
"String",
"getString",
"(",
"int",
"resId",
")",
"{",
"Activity",
"activity",
"=",
"getCurrentActivity",
"(",
"false",
")",
";",
"if",
"(",
"activity",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"return",
"activity",
".",
"getString",
... | Returns a localized string.
@param resId the resource ID for the string
@return the localized string | [
"Returns",
"a",
"localized",
"string",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ActivityUtils.java#L361-L368 |
30,021 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ActivityUtils.java | ActivityUtils.stopActivityMonitor | private void stopActivityMonitor(){
try {
// Remove the monitor added during startup
if (activityMonitor != null) {
inst.removeMonitor(activityMonitor);
activityMonitor = null;
}
} catch (Exception ignored) {}
} | java | private void stopActivityMonitor(){
try {
// Remove the monitor added during startup
if (activityMonitor != null) {
inst.removeMonitor(activityMonitor);
activityMonitor = null;
}
} catch (Exception ignored) {}
} | [
"private",
"void",
"stopActivityMonitor",
"(",
")",
"{",
"try",
"{",
"// Remove the monitor added during startup",
"if",
"(",
"activityMonitor",
"!=",
"null",
")",
"{",
"inst",
".",
"removeMonitor",
"(",
"activityMonitor",
")",
";",
"activityMonitor",
"=",
"null",
... | Removes the ActivityMonitor | [
"Removes",
"the",
"ActivityMonitor"
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ActivityUtils.java#L384-L393 |
30,022 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ActivityUtils.java | ActivityUtils.finishOpenedActivities | public void finishOpenedActivities(){
// Stops the activityStack listener
activitySyncTimer.cancel();
if(!config.trackActivities){
useGoBack(3);
return;
}
ArrayList<Activity> activitiesOpened = getAllOpenedActivities();
// Finish all opened activities
for (int i = activitiesOpened.size()-1; i >= 0; ... | java | public void finishOpenedActivities(){
// Stops the activityStack listener
activitySyncTimer.cancel();
if(!config.trackActivities){
useGoBack(3);
return;
}
ArrayList<Activity> activitiesOpened = getAllOpenedActivities();
// Finish all opened activities
for (int i = activitiesOpened.size()-1; i >= 0; ... | [
"public",
"void",
"finishOpenedActivities",
"(",
")",
"{",
"// Stops the activityStack listener",
"activitySyncTimer",
".",
"cancel",
"(",
")",
";",
"if",
"(",
"!",
"config",
".",
"trackActivities",
")",
"{",
"useGoBack",
"(",
"3",
")",
";",
"return",
";",
"}"... | All activites that have been opened are finished. | [
"All",
"activites",
"that",
"have",
"been",
"opened",
"are",
"finished",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ActivityUtils.java#L399-L422 |
30,023 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ActivityUtils.java | ActivityUtils.useGoBack | private void useGoBack(int numberOfTimes){
for(int i = 0; i < numberOfTimes; i++){
try {
inst.sendKeyDownUpSync(KeyEvent.KEYCODE_BACK);
sleeper.sleep(MINISLEEP);
inst.sendKeyDownUpSync(KeyEvent.KEYCODE_BACK);
} catch (Throwable ignored) {
// Guard against lack of INJECT_EVENT permission
}
}... | java | private void useGoBack(int numberOfTimes){
for(int i = 0; i < numberOfTimes; i++){
try {
inst.sendKeyDownUpSync(KeyEvent.KEYCODE_BACK);
sleeper.sleep(MINISLEEP);
inst.sendKeyDownUpSync(KeyEvent.KEYCODE_BACK);
} catch (Throwable ignored) {
// Guard against lack of INJECT_EVENT permission
}
}... | [
"private",
"void",
"useGoBack",
"(",
"int",
"numberOfTimes",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"numberOfTimes",
";",
"i",
"++",
")",
"{",
"try",
"{",
"inst",
".",
"sendKeyDownUpSync",
"(",
"KeyEvent",
".",
"KEYCODE_BACK",
")",
... | Sends the back button command a given number of times
@param numberOfTimes the number of times to press "back" | [
"Sends",
"the",
"back",
"button",
"command",
"a",
"given",
"number",
"of",
"times"
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ActivityUtils.java#L430-L440 |
30,024 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ActivityUtils.java | ActivityUtils.finishActivity | private void finishActivity(Activity activity){
if(activity != null) {
try{
activity.finish();
}catch(Throwable e){
e.printStackTrace();
}
}
} | java | private void finishActivity(Activity activity){
if(activity != null) {
try{
activity.finish();
}catch(Throwable e){
e.printStackTrace();
}
}
} | [
"private",
"void",
"finishActivity",
"(",
"Activity",
"activity",
")",
"{",
"if",
"(",
"activity",
"!=",
"null",
")",
"{",
"try",
"{",
"activity",
".",
"finish",
"(",
")",
";",
"}",
"catch",
"(",
"Throwable",
"e",
")",
"{",
"e",
".",
"printStackTrace",... | Finishes an activity.
@param activity the activity to finish | [
"Finishes",
"an",
"activity",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ActivityUtils.java#L458-L466 |
30,025 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java | ViewFetcher.getScrollOrListParent | public View getScrollOrListParent(View view) {
if (!(view instanceof android.widget.AbsListView) && !(view instanceof android.widget.ScrollView) && !(view instanceof WebView)) {
try{
return getScrollOrListParent((View) view.getParent());
}catch(Exception e){
return null;
}
} else {
return view;... | java | public View getScrollOrListParent(View view) {
if (!(view instanceof android.widget.AbsListView) && !(view instanceof android.widget.ScrollView) && !(view instanceof WebView)) {
try{
return getScrollOrListParent((View) view.getParent());
}catch(Exception e){
return null;
}
} else {
return view;... | [
"public",
"View",
"getScrollOrListParent",
"(",
"View",
"view",
")",
"{",
"if",
"(",
"!",
"(",
"view",
"instanceof",
"android",
".",
"widget",
".",
"AbsListView",
")",
"&&",
"!",
"(",
"view",
"instanceof",
"android",
".",
"widget",
".",
"ScrollView",
")",
... | Returns the scroll or list parent view
@param view the view who's parent should be returned
@return the parent scroll view, list view or null | [
"Returns",
"the",
"scroll",
"or",
"list",
"parent",
"view"
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java#L71-L82 |
30,026 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java | ViewFetcher.getAllViews | public ArrayList<View> getAllViews(boolean onlySufficientlyVisible) {
final View[] views = getWindowDecorViews();
final ArrayList<View> allViews = new ArrayList<View>();
final View[] nonDecorViews = getNonDecorViews(views);
View view = null;
if(nonDecorViews != null){
for(int i = 0; i < nonDecorViews.leng... | java | public ArrayList<View> getAllViews(boolean onlySufficientlyVisible) {
final View[] views = getWindowDecorViews();
final ArrayList<View> allViews = new ArrayList<View>();
final View[] nonDecorViews = getNonDecorViews(views);
View view = null;
if(nonDecorViews != null){
for(int i = 0; i < nonDecorViews.leng... | [
"public",
"ArrayList",
"<",
"View",
">",
"getAllViews",
"(",
"boolean",
"onlySufficientlyVisible",
")",
"{",
"final",
"View",
"[",
"]",
"views",
"=",
"getWindowDecorViews",
"(",
")",
";",
"final",
"ArrayList",
"<",
"View",
">",
"allViews",
"=",
"new",
"Array... | Returns views from the shown DecorViews.
@param onlySufficientlyVisible if only sufficiently visible views should be returned
@return all the views contained in the DecorViews | [
"Returns",
"views",
"from",
"the",
"shown",
"DecorViews",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java#L91-L117 |
30,027 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java | ViewFetcher.getRecentDecorView | public final View getRecentDecorView(View[] views) {
if(views == null)
return null;
final View[] decorViews = new View[views.length];
int i = 0;
View view;
for (int j = 0; j < views.length; j++) {
view = views[j];
if (isDecorView(view)){
decorViews[i] = view;
i++;
}
}
return getRece... | java | public final View getRecentDecorView(View[] views) {
if(views == null)
return null;
final View[] decorViews = new View[views.length];
int i = 0;
View view;
for (int j = 0; j < views.length; j++) {
view = views[j];
if (isDecorView(view)){
decorViews[i] = view;
i++;
}
}
return getRece... | [
"public",
"final",
"View",
"getRecentDecorView",
"(",
"View",
"[",
"]",
"views",
")",
"{",
"if",
"(",
"views",
"==",
"null",
")",
"return",
"null",
";",
"final",
"View",
"[",
"]",
"decorViews",
"=",
"new",
"View",
"[",
"views",
".",
"length",
"]",
";... | Returns the most recent DecorView
@param views the views to check
@return the most recent DecorView | [
"Returns",
"the",
"most",
"recent",
"DecorView"
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java#L126-L142 |
30,028 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java | ViewFetcher.getRecentContainer | private final View getRecentContainer(View[] views) {
View container = null;
long drawingTime = 0;
View view;
for(int i = 0; i < views.length; i++){
view = views[i];
if (view != null && view.isShown() && view.hasWindowFocus() && view.getDrawingTime() > drawingTime) {
container = view;
drawingTime... | java | private final View getRecentContainer(View[] views) {
View container = null;
long drawingTime = 0;
View view;
for(int i = 0; i < views.length; i++){
view = views[i];
if (view != null && view.isShown() && view.hasWindowFocus() && view.getDrawingTime() > drawingTime) {
container = view;
drawingTime... | [
"private",
"final",
"View",
"getRecentContainer",
"(",
"View",
"[",
"]",
"views",
")",
"{",
"View",
"container",
"=",
"null",
";",
"long",
"drawingTime",
"=",
"0",
";",
"View",
"view",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"views",
... | Returns the most recent view container
@param views the views to check
@return the most recent view container | [
"Returns",
"the",
"most",
"recent",
"view",
"container"
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java#L151-L164 |
30,029 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java | ViewFetcher.getNonDecorViews | private final View[] getNonDecorViews(View[] views) {
View[] decorViews = null;
if(views != null) {
decorViews = new View[views.length];
int i = 0;
View view;
for (int j = 0; j < views.length; j++) {
view = views[j];
if (!isDecorView(view)) {
decorViews[i] = view;
i++;
}
}
... | java | private final View[] getNonDecorViews(View[] views) {
View[] decorViews = null;
if(views != null) {
decorViews = new View[views.length];
int i = 0;
View view;
for (int j = 0; j < views.length; j++) {
view = views[j];
if (!isDecorView(view)) {
decorViews[i] = view;
i++;
}
}
... | [
"private",
"final",
"View",
"[",
"]",
"getNonDecorViews",
"(",
"View",
"[",
"]",
"views",
")",
"{",
"View",
"[",
"]",
"decorViews",
"=",
"null",
";",
"if",
"(",
"views",
"!=",
"null",
")",
"{",
"decorViews",
"=",
"new",
"View",
"[",
"views",
".",
"... | Returns all views that are non DecorViews
@param views the views to check
@return the non DecorViews | [
"Returns",
"all",
"views",
"that",
"are",
"non",
"DecorViews"
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java#L173-L191 |
30,030 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java | ViewFetcher.isDecorView | private boolean isDecorView(View view) {
if (view == null) {
return false;
}
final String nameOfClass = view.getClass().getName();
return (nameOfClass.equals("com.android.internal.policy.impl.PhoneWindow$DecorView") ||
nameOfClass.equals("com.android.internal.policy.impl.MultiPhoneWindow$MultiPhoneDecor... | java | private boolean isDecorView(View view) {
if (view == null) {
return false;
}
final String nameOfClass = view.getClass().getName();
return (nameOfClass.equals("com.android.internal.policy.impl.PhoneWindow$DecorView") ||
nameOfClass.equals("com.android.internal.policy.impl.MultiPhoneWindow$MultiPhoneDecor... | [
"private",
"boolean",
"isDecorView",
"(",
"View",
"view",
")",
"{",
"if",
"(",
"view",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"final",
"String",
"nameOfClass",
"=",
"view",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
";",
"retu... | Returns whether a view is a DecorView
@param view
@return true if view is a DecorView, false otherwise | [
"Returns",
"whether",
"a",
"view",
"is",
"a",
"DecorView"
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java#L198-L207 |
30,031 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java | ViewFetcher.getScrollListWindowHeight | @SuppressWarnings("deprecation")
public float getScrollListWindowHeight(View view) {
final int[] xyParent = new int[2];
View parent = getScrollOrListParent(view);
final float windowHeight;
if(parent == null){
WindowManager windowManager = (WindowManager)
instrumentation.getTargetContext().getSystemSe... | java | @SuppressWarnings("deprecation")
public float getScrollListWindowHeight(View view) {
final int[] xyParent = new int[2];
View parent = getScrollOrListParent(view);
final float windowHeight;
if(parent == null){
WindowManager windowManager = (WindowManager)
instrumentation.getTargetContext().getSystemSe... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"float",
"getScrollListWindowHeight",
"(",
"View",
"view",
")",
"{",
"final",
"int",
"[",
"]",
"xyParent",
"=",
"new",
"int",
"[",
"2",
"]",
";",
"View",
"parent",
"=",
"getScrollOrListParent",
... | Returns the height of the scroll or list view parent
@param view the view who's parents height should be returned
@return the height of the scroll or list view parent | [
"Returns",
"the",
"height",
"of",
"the",
"scroll",
"or",
"list",
"view",
"parent"
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java#L304-L323 |
30,032 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java | ViewFetcher.getFreshestView | public final <T extends View> T getFreshestView(ArrayList<T> views){
final int[] locationOnScreen = new int[2];
T viewToReturn = null;
long drawingTime = 0;
if(views == null){
return null;
}
for(T view : views){
if(view != null){
view.getLocationOnScreen(locationOnScreen);
if (location... | java | public final <T extends View> T getFreshestView(ArrayList<T> views){
final int[] locationOnScreen = new int[2];
T viewToReturn = null;
long drawingTime = 0;
if(views == null){
return null;
}
for(T view : views){
if(view != null){
view.getLocationOnScreen(locationOnScreen);
if (location... | [
"public",
"final",
"<",
"T",
"extends",
"View",
">",
"T",
"getFreshestView",
"(",
"ArrayList",
"<",
"T",
">",
"views",
")",
"{",
"final",
"int",
"[",
"]",
"locationOnScreen",
"=",
"new",
"int",
"[",
"2",
"]",
";",
"T",
"viewToReturn",
"=",
"null",
";... | Tries to guess which view is the most likely to be interesting. Returns
the most recently drawn view, which presumably will be the one that the
user was most recently interacting with.
@param views A list of potentially interesting views, likely a collection
of views from a set of types, such as [{@link Button},
{@lin... | [
"Tries",
"to",
"guess",
"which",
"view",
"is",
"the",
"most",
"likely",
"to",
"be",
"interesting",
".",
"Returns",
"the",
"most",
"recently",
"drawn",
"view",
"which",
"presumably",
"will",
"be",
"the",
"one",
"that",
"the",
"user",
"was",
"most",
"recentl... | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java#L377-L406 |
30,033 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java | ViewFetcher.getRecyclerView | public <T extends View> ViewGroup getRecyclerView(int recyclerViewIndex, int timeOut) {
final long endTime = SystemClock.uptimeMillis() + timeOut;
while (SystemClock.uptimeMillis() < endTime) {
View recyclerView = getRecyclerView(true, recyclerViewIndex);
if(recyclerView != null){
return (ViewGroup) recy... | java | public <T extends View> ViewGroup getRecyclerView(int recyclerViewIndex, int timeOut) {
final long endTime = SystemClock.uptimeMillis() + timeOut;
while (SystemClock.uptimeMillis() < endTime) {
View recyclerView = getRecyclerView(true, recyclerViewIndex);
if(recyclerView != null){
return (ViewGroup) recy... | [
"public",
"<",
"T",
"extends",
"View",
">",
"ViewGroup",
"getRecyclerView",
"(",
"int",
"recyclerViewIndex",
",",
"int",
"timeOut",
")",
"{",
"final",
"long",
"endTime",
"=",
"SystemClock",
".",
"uptimeMillis",
"(",
")",
"+",
"timeOut",
";",
"while",
"(",
... | Waits for a RecyclerView and returns it.
@param recyclerViewIndex the index of the RecyclerView
@return {@code ViewGroup} if RecycleView is displayed | [
"Waits",
"for",
"a",
"RecyclerView",
"and",
"returns",
"it",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java#L417-L427 |
30,034 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java | ViewFetcher.getRecyclerView | public View getRecyclerView(boolean shouldSleep, int recyclerViewIndex){
Set<View> uniqueViews = new HashSet<View>();
if(shouldSleep){
sleeper.sleep();
}
@SuppressWarnings("unchecked")
ArrayList<View> views = RobotiumUtils.filterViewsToSet(new Class[] {ViewGroup.class}, getAllViews(false));
views = Robo... | java | public View getRecyclerView(boolean shouldSleep, int recyclerViewIndex){
Set<View> uniqueViews = new HashSet<View>();
if(shouldSleep){
sleeper.sleep();
}
@SuppressWarnings("unchecked")
ArrayList<View> views = RobotiumUtils.filterViewsToSet(new Class[] {ViewGroup.class}, getAllViews(false));
views = Robo... | [
"public",
"View",
"getRecyclerView",
"(",
"boolean",
"shouldSleep",
",",
"int",
"recyclerViewIndex",
")",
"{",
"Set",
"<",
"View",
">",
"uniqueViews",
"=",
"new",
"HashSet",
"<",
"View",
">",
"(",
")",
";",
"if",
"(",
"shouldSleep",
")",
"{",
"sleeper",
... | Returns a RecyclerView or null if none is found
@param viewList the list to check in
@return a RecyclerView | [
"Returns",
"a",
"RecyclerView",
"or",
"null",
"if",
"none",
"is",
"found"
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java#L438-L459 |
30,035 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java | ViewFetcher.getScrollableSupportPackageViews | public List<View> getScrollableSupportPackageViews(boolean shouldSleep){
List <View> viewsToReturn = new ArrayList<View>();
if(shouldSleep){
sleeper.sleep();
}
@SuppressWarnings("unchecked")
ArrayList<View> views = RobotiumUtils.filterViewsToSet(new Class[] {ViewGroup.class}, getAllViews(true));
views =... | java | public List<View> getScrollableSupportPackageViews(boolean shouldSleep){
List <View> viewsToReturn = new ArrayList<View>();
if(shouldSleep){
sleeper.sleep();
}
@SuppressWarnings("unchecked")
ArrayList<View> views = RobotiumUtils.filterViewsToSet(new Class[] {ViewGroup.class}, getAllViews(true));
views =... | [
"public",
"List",
"<",
"View",
">",
"getScrollableSupportPackageViews",
"(",
"boolean",
"shouldSleep",
")",
"{",
"List",
"<",
"View",
">",
"viewsToReturn",
"=",
"new",
"ArrayList",
"<",
"View",
">",
"(",
")",
";",
"if",
"(",
"shouldSleep",
")",
"{",
"sleep... | Returns a Set of all RecyclerView or empty Set if none is found
@return a Set of RecyclerViews | [
"Returns",
"a",
"Set",
"of",
"all",
"RecyclerView",
"or",
"empty",
"Set",
"if",
"none",
"is",
"found"
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java#L468-L487 |
30,036 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java | ViewFetcher.getIdenticalView | public View getIdenticalView(View view) {
if(view == null){
return null;
}
View viewToReturn = null;
List<? extends View> visibleViews = RobotiumUtils.removeInvisibleViews(getCurrentViews(view.getClass(), true));
for(View v : visibleViews){
if(areViewsIdentical(v, view)){
viewToReturn = v;
brea... | java | public View getIdenticalView(View view) {
if(view == null){
return null;
}
View viewToReturn = null;
List<? extends View> visibleViews = RobotiumUtils.removeInvisibleViews(getCurrentViews(view.getClass(), true));
for(View v : visibleViews){
if(areViewsIdentical(v, view)){
viewToReturn = v;
brea... | [
"public",
"View",
"getIdenticalView",
"(",
"View",
"view",
")",
"{",
"if",
"(",
"view",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"View",
"viewToReturn",
"=",
"null",
";",
"List",
"<",
"?",
"extends",
"View",
">",
"visibleViews",
"=",
"Roboti... | Returns an identical View to the one specified.
@param view the view to find
@return identical view of the specified view | [
"Returns",
"an",
"identical",
"View",
"to",
"the",
"one",
"specified",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java#L508-L523 |
30,037 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java | ViewFetcher.getWindowDecorViews | @SuppressWarnings("unchecked")
public View[] getWindowDecorViews()
{
Field viewsField;
Field instanceField;
try {
viewsField = windowManager.getDeclaredField("mViews");
instanceField = windowManager.getDeclaredField(windowManagerString);
viewsField.setAccessible(true);
instanceField.setAccessible(t... | java | @SuppressWarnings("unchecked")
public View[] getWindowDecorViews()
{
Field viewsField;
Field instanceField;
try {
viewsField = windowManager.getDeclaredField("mViews");
instanceField = windowManager.getDeclaredField(windowManagerString);
viewsField.setAccessible(true);
instanceField.setAccessible(t... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"View",
"[",
"]",
"getWindowDecorViews",
"(",
")",
"{",
"Field",
"viewsField",
";",
"Field",
"instanceField",
";",
"try",
"{",
"viewsField",
"=",
"windowManager",
".",
"getDeclaredField",
"(",
"\"mVie... | Returns the WindorDecorViews shown on the screen.
@return the WindorDecorViews shown on the screen | [
"Returns",
"the",
"WindorDecorViews",
"shown",
"on",
"the",
"screen",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java#L572-L595 |
30,038 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java | ViewFetcher.setWindowManagerString | private void setWindowManagerString(){
if (android.os.Build.VERSION.SDK_INT >= 17) {
windowManagerString = "sDefaultWindowManager";
} else if(android.os.Build.VERSION.SDK_INT >= 13) {
windowManagerString = "sWindowManager";
} else {
windowManagerString = "mWindowManager";
}
} | java | private void setWindowManagerString(){
if (android.os.Build.VERSION.SDK_INT >= 17) {
windowManagerString = "sDefaultWindowManager";
} else if(android.os.Build.VERSION.SDK_INT >= 13) {
windowManagerString = "sWindowManager";
} else {
windowManagerString = "mWindowManager";
}
} | [
"private",
"void",
"setWindowManagerString",
"(",
")",
"{",
"if",
"(",
"android",
".",
"os",
".",
"Build",
".",
"VERSION",
".",
"SDK_INT",
">=",
"17",
")",
"{",
"windowManagerString",
"=",
"\"sDefaultWindowManager\"",
";",
"}",
"else",
"if",
"(",
"android",
... | Sets the window manager string. | [
"Sets",
"the",
"window",
"manager",
"string",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java#L600-L611 |
30,039 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/RobotiumUtils.java | RobotiumUtils.removeInvisibleViews | public static <T extends View> ArrayList<T> removeInvisibleViews(Iterable<T> viewList) {
ArrayList<T> tmpViewList = new ArrayList<T>();
for (T view : viewList) {
if (view != null && view.isShown()) {
tmpViewList.add(view);
}
}
return tmpViewList;
} | java | public static <T extends View> ArrayList<T> removeInvisibleViews(Iterable<T> viewList) {
ArrayList<T> tmpViewList = new ArrayList<T>();
for (T view : viewList) {
if (view != null && view.isShown()) {
tmpViewList.add(view);
}
}
return tmpViewList;
} | [
"public",
"static",
"<",
"T",
"extends",
"View",
">",
"ArrayList",
"<",
"T",
">",
"removeInvisibleViews",
"(",
"Iterable",
"<",
"T",
">",
"viewList",
")",
"{",
"ArrayList",
"<",
"T",
">",
"tmpViewList",
"=",
"new",
"ArrayList",
"<",
"T",
">",
"(",
")",... | Removes invisible Views.
@param viewList an Iterable with Views that is being checked for invisible Views
@return a filtered Iterable with no invisible Views | [
"Removes",
"invisible",
"Views",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/RobotiumUtils.java#L32-L40 |
30,040 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/RobotiumUtils.java | RobotiumUtils.filterViews | public static <T> ArrayList<T> filterViews(Class<T> classToFilterBy, Iterable<?> viewList) {
ArrayList<T> filteredViews = new ArrayList<T>();
for (Object view : viewList) {
if (view != null && classToFilterBy.isAssignableFrom(view.getClass())) {
filteredViews.add(classToFilterBy.cast(view));
}
}
viewL... | java | public static <T> ArrayList<T> filterViews(Class<T> classToFilterBy, Iterable<?> viewList) {
ArrayList<T> filteredViews = new ArrayList<T>();
for (Object view : viewList) {
if (view != null && classToFilterBy.isAssignableFrom(view.getClass())) {
filteredViews.add(classToFilterBy.cast(view));
}
}
viewL... | [
"public",
"static",
"<",
"T",
">",
"ArrayList",
"<",
"T",
">",
"filterViews",
"(",
"Class",
"<",
"T",
">",
"classToFilterBy",
",",
"Iterable",
"<",
"?",
">",
"viewList",
")",
"{",
"ArrayList",
"<",
"T",
">",
"filteredViews",
"=",
"new",
"ArrayList",
"<... | Filters Views based on the given class type.
@param classToFilterBy the class to filter
@param viewList the Iterable to filter from
@return an ArrayList with filtered views | [
"Filters",
"Views",
"based",
"on",
"the",
"given",
"class",
"type",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/RobotiumUtils.java#L50-L59 |
30,041 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/RobotiumUtils.java | RobotiumUtils.filterViewsToSet | public static ArrayList<View> filterViewsToSet(Class<View> classSet[], Iterable<View> viewList) {
ArrayList<View> filteredViews = new ArrayList<View>();
for (View view : viewList) {
if (view == null)
continue;
for (Class<View> filter : classSet) {
if (filter.isAssignableFrom(view.getClass())) {
f... | java | public static ArrayList<View> filterViewsToSet(Class<View> classSet[], Iterable<View> viewList) {
ArrayList<View> filteredViews = new ArrayList<View>();
for (View view : viewList) {
if (view == null)
continue;
for (Class<View> filter : classSet) {
if (filter.isAssignableFrom(view.getClass())) {
f... | [
"public",
"static",
"ArrayList",
"<",
"View",
">",
"filterViewsToSet",
"(",
"Class",
"<",
"View",
">",
"classSet",
"[",
"]",
",",
"Iterable",
"<",
"View",
">",
"viewList",
")",
"{",
"ArrayList",
"<",
"View",
">",
"filteredViews",
"=",
"new",
"ArrayList",
... | Filters all Views not within the given set.
@param classSet contains all classes that are ok to pass the filter
@param viewList the Iterable to filter form
@return an ArrayList with filtered views | [
"Filters",
"all",
"Views",
"not",
"within",
"the",
"given",
"set",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/RobotiumUtils.java#L69-L82 |
30,042 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/RobotiumUtils.java | RobotiumUtils.sortViewsByLocationOnScreen | public static void sortViewsByLocationOnScreen(List<? extends View> views, boolean yAxisFirst) {
Collections.sort(views, new ViewLocationComparator(yAxisFirst));
} | java | public static void sortViewsByLocationOnScreen(List<? extends View> views, boolean yAxisFirst) {
Collections.sort(views, new ViewLocationComparator(yAxisFirst));
} | [
"public",
"static",
"void",
"sortViewsByLocationOnScreen",
"(",
"List",
"<",
"?",
"extends",
"View",
">",
"views",
",",
"boolean",
"yAxisFirst",
")",
"{",
"Collections",
".",
"sort",
"(",
"views",
",",
"new",
"ViewLocationComparator",
"(",
"yAxisFirst",
")",
"... | Orders Views by their location on-screen.
@param views The views to sort
@param yAxisFirst Whether the y-axis should be compared before the x-axis
@see ViewLocationComparator | [
"Orders",
"Views",
"by",
"their",
"location",
"on",
"-",
"screen",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/RobotiumUtils.java#L103-L105 |
30,043 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/RobotiumUtils.java | RobotiumUtils.getNumberOfMatches | public static int getNumberOfMatches(String regex, TextView view, Set<TextView> uniqueTextViews){
if(view == null) {
return uniqueTextViews.size();
}
Pattern pattern = null;
try{
pattern = Pattern.compile(regex);
}catch(PatternSyntaxException e){
pattern = Pattern.compile(regex, Pattern.LITERAL);
... | java | public static int getNumberOfMatches(String regex, TextView view, Set<TextView> uniqueTextViews){
if(view == null) {
return uniqueTextViews.size();
}
Pattern pattern = null;
try{
pattern = Pattern.compile(regex);
}catch(PatternSyntaxException e){
pattern = Pattern.compile(regex, Pattern.LITERAL);
... | [
"public",
"static",
"int",
"getNumberOfMatches",
"(",
"String",
"regex",
",",
"TextView",
"view",
",",
"Set",
"<",
"TextView",
">",
"uniqueTextViews",
")",
"{",
"if",
"(",
"view",
"==",
"null",
")",
"{",
"return",
"uniqueTextViews",
".",
"size",
"(",
")",
... | Checks if a View matches a certain string and returns the amount of total matches.
@param regex the regex to match
@param view the view to check
@param uniqueTextViews set of views that have matched
@return number of total matches | [
"Checks",
"if",
"a",
"View",
"matches",
"a",
"certain",
"string",
"and",
"returns",
"the",
"amount",
"of",
"total",
"matches",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/RobotiumUtils.java#L116-L147 |
30,044 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Clicker.java | Clicker.clickOnScreen | public void clickOnScreen(float x, float y, View view) {
boolean successfull = false;
int retry = 0;
SecurityException ex = null;
while(!successfull && retry < 20) {
long downTime = SystemClock.uptimeMillis();
long eventTime = SystemClock.uptimeMillis();
MotionEvent event = MotionEvent.obtain(downTime... | java | public void clickOnScreen(float x, float y, View view) {
boolean successfull = false;
int retry = 0;
SecurityException ex = null;
while(!successfull && retry < 20) {
long downTime = SystemClock.uptimeMillis();
long eventTime = SystemClock.uptimeMillis();
MotionEvent event = MotionEvent.obtain(downTime... | [
"public",
"void",
"clickOnScreen",
"(",
"float",
"x",
",",
"float",
"y",
",",
"View",
"view",
")",
"{",
"boolean",
"successfull",
"=",
"false",
";",
"int",
"retry",
"=",
"0",
";",
"SecurityException",
"ex",
"=",
"null",
";",
"while",
"(",
"!",
"success... | Clicks on a given coordinate on the screen.
@param x the x coordinate
@param y the y coordinate | [
"Clicks",
"on",
"a",
"given",
"coordinate",
"on",
"the",
"screen",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Clicker.java#L79-L111 |
30,045 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Clicker.java | Clicker.clickLongOnScreen | public void clickLongOnScreen(float x, float y, int time, View view) {
boolean successfull = false;
int retry = 0;
SecurityException ex = null;
long downTime = SystemClock.uptimeMillis();
long eventTime = SystemClock.uptimeMillis();
MotionEvent event = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACT... | java | public void clickLongOnScreen(float x, float y, int time, View view) {
boolean successfull = false;
int retry = 0;
SecurityException ex = null;
long downTime = SystemClock.uptimeMillis();
long eventTime = SystemClock.uptimeMillis();
MotionEvent event = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACT... | [
"public",
"void",
"clickLongOnScreen",
"(",
"float",
"x",
",",
"float",
"y",
",",
"int",
"time",
",",
"View",
"view",
")",
"{",
"boolean",
"successfull",
"=",
"false",
";",
"int",
"retry",
"=",
"0",
";",
"SecurityException",
"ex",
"=",
"null",
";",
"lo... | Long clicks a given coordinate on the screen.
@param x the x coordinate
@param y the y coordinate
@param time the amount of time to long click | [
"Long",
"clicks",
"a",
"given",
"coordinate",
"on",
"the",
"screen",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Clicker.java#L121-L163 |
30,046 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Clicker.java | Clicker.clickOnScreen | public void clickOnScreen(View view, boolean longClick, int time) {
if(view == null)
Assert.fail("View is null and can therefore not be clicked!");
float[] xyToClick = getClickCoordinates(view);
float x = xyToClick[0];
float y = xyToClick[1];
if(x == 0 || y == 0){
sleeper.sleepMini();
try {
vie... | java | public void clickOnScreen(View view, boolean longClick, int time) {
if(view == null)
Assert.fail("View is null and can therefore not be clicked!");
float[] xyToClick = getClickCoordinates(view);
float x = xyToClick[0];
float y = xyToClick[1];
if(x == 0 || y == 0){
sleeper.sleepMini();
try {
vie... | [
"public",
"void",
"clickOnScreen",
"(",
"View",
"view",
",",
"boolean",
"longClick",
",",
"int",
"time",
")",
"{",
"if",
"(",
"view",
"==",
"null",
")",
"Assert",
".",
"fail",
"(",
"\"View is null and can therefore not be clicked!\"",
")",
";",
"float",
"[",
... | Private method used to click on a given view.
@param view the view that should be clicked
@param longClick true if the click should be a long click
@param time the amount of time to long click | [
"Private",
"method",
"used",
"to",
"click",
"on",
"a",
"given",
"view",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Clicker.java#L184-L210 |
30,047 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Clicker.java | Clicker.getClickCoordinates | private float[] getClickCoordinates(View view){
int[] xyLocation = new int[2];
float[] xyToClick = new float[2];
int trialCount = 0;
view.getLocationOnScreen(xyLocation);
while(xyLocation[0] == 0 && xyLocation[1] == 0 && trialCount < 10) {
sleeper.sleep(300);
view.getLocationOnScreen(xyLocation);
tr... | java | private float[] getClickCoordinates(View view){
int[] xyLocation = new int[2];
float[] xyToClick = new float[2];
int trialCount = 0;
view.getLocationOnScreen(xyLocation);
while(xyLocation[0] == 0 && xyLocation[1] == 0 && trialCount < 10) {
sleeper.sleep(300);
view.getLocationOnScreen(xyLocation);
tr... | [
"private",
"float",
"[",
"]",
"getClickCoordinates",
"(",
"View",
"view",
")",
"{",
"int",
"[",
"]",
"xyLocation",
"=",
"new",
"int",
"[",
"2",
"]",
";",
"float",
"[",
"]",
"xyToClick",
"=",
"new",
"float",
"[",
"2",
"]",
";",
"int",
"trialCount",
... | Returns click coordinates for the specified view.
@param view the view to get click coordinates from
@return click coordinates for a specified view | [
"Returns",
"click",
"coordinates",
"for",
"the",
"specified",
"view",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Clicker.java#L219-L240 |
30,048 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Clicker.java | Clicker.openMenu | private void openMenu(){
sleeper.sleepMini();
if(!dialogUtils.waitForDialogToOpen(MINI_WAIT, false)) {
try{
sender.sendKeyCode(KeyEvent.KEYCODE_MENU);
dialogUtils.waitForDialogToOpen(WAIT_TIME, true);
}catch(SecurityException e){
Assert.fail("Can not open the menu!");
}
}
} | java | private void openMenu(){
sleeper.sleepMini();
if(!dialogUtils.waitForDialogToOpen(MINI_WAIT, false)) {
try{
sender.sendKeyCode(KeyEvent.KEYCODE_MENU);
dialogUtils.waitForDialogToOpen(WAIT_TIME, true);
}catch(SecurityException e){
Assert.fail("Can not open the menu!");
}
}
} | [
"private",
"void",
"openMenu",
"(",
")",
"{",
"sleeper",
".",
"sleepMini",
"(",
")",
";",
"if",
"(",
"!",
"dialogUtils",
".",
"waitForDialogToOpen",
"(",
"MINI_WAIT",
",",
"false",
")",
")",
"{",
"try",
"{",
"sender",
".",
"sendKeyCode",
"(",
"KeyEvent",... | Opens the menu and waits for it to open. | [
"Opens",
"the",
"menu",
"and",
"waits",
"for",
"it",
"to",
"open",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Clicker.java#L274-L285 |
30,049 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Clicker.java | Clicker.clickOnMenuItem | public void clickOnMenuItem(String text, boolean subMenu)
{
sleeper.sleepMini();
TextView textMore = null;
int [] xy = new int[2];
int x = 0;
int y = 0;
if(!dialogUtils.waitForDialogToOpen(MINI_WAIT, false)) {
try{
sender.sendKeyCode(KeyEvent.KEYCODE_MENU);
dialogUtils.waitForDialogToOpen(WAIT... | java | public void clickOnMenuItem(String text, boolean subMenu)
{
sleeper.sleepMini();
TextView textMore = null;
int [] xy = new int[2];
int x = 0;
int y = 0;
if(!dialogUtils.waitForDialogToOpen(MINI_WAIT, false)) {
try{
sender.sendKeyCode(KeyEvent.KEYCODE_MENU);
dialogUtils.waitForDialogToOpen(WAIT... | [
"public",
"void",
"clickOnMenuItem",
"(",
"String",
"text",
",",
"boolean",
"subMenu",
")",
"{",
"sleeper",
".",
"sleepMini",
"(",
")",
";",
"TextView",
"textMore",
"=",
"null",
";",
"int",
"[",
"]",
"xy",
"=",
"new",
"int",
"[",
"2",
"]",
";",
"int"... | Clicks on a menu item with a given text.
@param text the menu text that should be clicked on. The parameter <strong>will</strong> be interpreted as a regular expression.
@param subMenu true if the menu item could be located in a sub menu | [
"Clicks",
"on",
"a",
"menu",
"item",
"with",
"a",
"given",
"text",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Clicker.java#L306-L339 |
30,050 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Clicker.java | Clicker.clickOnActionBarItem | public void clickOnActionBarItem(int resourceId){
sleeper.sleep();
Activity activity = activityUtils.getCurrentActivity();
if(activity != null){
inst.invokeMenuActionSync(activity, resourceId, 0);
}
} | java | public void clickOnActionBarItem(int resourceId){
sleeper.sleep();
Activity activity = activityUtils.getCurrentActivity();
if(activity != null){
inst.invokeMenuActionSync(activity, resourceId, 0);
}
} | [
"public",
"void",
"clickOnActionBarItem",
"(",
"int",
"resourceId",
")",
"{",
"sleeper",
".",
"sleep",
"(",
")",
";",
"Activity",
"activity",
"=",
"activityUtils",
".",
"getCurrentActivity",
"(",
")",
";",
"if",
"(",
"activity",
"!=",
"null",
")",
"{",
"in... | Clicks on an ActionBar item with a given resource id
@param resourceId the R.id of the ActionBar item | [
"Clicks",
"on",
"an",
"ActionBar",
"item",
"with",
"a",
"given",
"resource",
"id"
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Clicker.java#L347-L353 |
30,051 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Clicker.java | Clicker.clickOnWebElement | public void clickOnWebElement(By by, int match, boolean scroll, boolean useJavaScriptToClick){
WebElement webElement = null;
if(useJavaScriptToClick){
webElement = waiter.waitForWebElement(by, match, Timeout.getSmallTimeout(), false);
if(webElement == null){
Assert.fail("WebElement with " + webUtils.sp... | java | public void clickOnWebElement(By by, int match, boolean scroll, boolean useJavaScriptToClick){
WebElement webElement = null;
if(useJavaScriptToClick){
webElement = waiter.waitForWebElement(by, match, Timeout.getSmallTimeout(), false);
if(webElement == null){
Assert.fail("WebElement with " + webUtils.sp... | [
"public",
"void",
"clickOnWebElement",
"(",
"By",
"by",
",",
"int",
"match",
",",
"boolean",
"scroll",
",",
"boolean",
"useJavaScriptToClick",
")",
"{",
"WebElement",
"webElement",
"=",
"null",
";",
"if",
"(",
"useJavaScriptToClick",
")",
"{",
"webElement",
"=... | Clicks on a web element using the given By method.
@param by the By object e.g. By.id("id");
@param match if multiple objects match, this determines which one will be clicked
@param scroll true if scrolling should be performed
@param useJavaScriptToClick true if click should be perfomed through JavaScript | [
"Clicks",
"on",
"a",
"web",
"element",
"using",
"the",
"given",
"By",
"method",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Clicker.java#L401-L425 |
30,052 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Clicker.java | Clicker.getViewOnAbsListLine | private View getViewOnAbsListLine(AbsListView absListView, int index, int lineIndex){
final long endTime = SystemClock.uptimeMillis() + Timeout.getSmallTimeout();
View view = absListView.getChildAt(lineIndex);
while(view == null){
final boolean timedOut = SystemClock.uptimeMillis() > endTime;
if (timedOut)... | java | private View getViewOnAbsListLine(AbsListView absListView, int index, int lineIndex){
final long endTime = SystemClock.uptimeMillis() + Timeout.getSmallTimeout();
View view = absListView.getChildAt(lineIndex);
while(view == null){
final boolean timedOut = SystemClock.uptimeMillis() > endTime;
if (timedOut)... | [
"private",
"View",
"getViewOnAbsListLine",
"(",
"AbsListView",
"absListView",
",",
"int",
"index",
",",
"int",
"lineIndex",
")",
"{",
"final",
"long",
"endTime",
"=",
"SystemClock",
".",
"uptimeMillis",
"(",
")",
"+",
"Timeout",
".",
"getSmallTimeout",
"(",
")... | Returns the view in the specified list line
@param absListView the ListView to use
@param index the index of the list. E.g. Index 1 if two lists are available
@param lineIndex the line index of the View
@return the View located at a specified list line | [
"Returns",
"the",
"view",
"in",
"the",
"specified",
"list",
"line"
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Clicker.java#L659-L679 |
30,053 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Clicker.java | Clicker.getViewOnRecyclerItemIndex | private View getViewOnRecyclerItemIndex(ViewGroup recyclerView, int recyclerViewIndex, int itemIndex){
final long endTime = SystemClock.uptimeMillis() + Timeout.getSmallTimeout();
View view = recyclerView.getChildAt(itemIndex);
while(view == null){
final boolean timedOut = SystemClock.uptimeMillis() > endTime... | java | private View getViewOnRecyclerItemIndex(ViewGroup recyclerView, int recyclerViewIndex, int itemIndex){
final long endTime = SystemClock.uptimeMillis() + Timeout.getSmallTimeout();
View view = recyclerView.getChildAt(itemIndex);
while(view == null){
final boolean timedOut = SystemClock.uptimeMillis() > endTime... | [
"private",
"View",
"getViewOnRecyclerItemIndex",
"(",
"ViewGroup",
"recyclerView",
",",
"int",
"recyclerViewIndex",
",",
"int",
"itemIndex",
")",
"{",
"final",
"long",
"endTime",
"=",
"SystemClock",
".",
"uptimeMillis",
"(",
")",
"+",
"Timeout",
".",
"getSmallTime... | Returns the view in the specified item index
@param recyclerView the RecyclerView to use
@param itemIndex the item index of the View
@return the View located at a specified item index | [
"Returns",
"the",
"view",
"in",
"the",
"specified",
"item",
"index"
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Clicker.java#L689-L711 |
30,054 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/WebElement.java | WebElement.getAttribute | public String getAttribute(String attributeName) {
if (attributeName != null){
return this.attributes.get(attributeName);
}
return null;
} | java | public String getAttribute(String attributeName) {
if (attributeName != null){
return this.attributes.get(attributeName);
}
return null;
} | [
"public",
"String",
"getAttribute",
"(",
"String",
"attributeName",
")",
"{",
"if",
"(",
"attributeName",
"!=",
"null",
")",
"{",
"return",
"this",
".",
"attributes",
".",
"get",
"(",
"attributeName",
")",
";",
"}",
"return",
"null",
";",
"}"
] | Returns the value for the specified attribute.
@return the value for the specified attribute | [
"Returns",
"the",
"value",
"for",
"the",
"specified",
"attribute",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/WebElement.java#L201-L207 |
30,055 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Asserter.java | Asserter.assertMemoryNotLow | public void assertMemoryNotLow() {
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
((ActivityManager)activityUtils.getCurrentActivity().getSystemService("activity")).getMemoryInfo(mi);
Assert.assertFalse("Low memory available: " + mi.availMem + " bytes!", mi.lowMemory);
} | java | public void assertMemoryNotLow() {
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
((ActivityManager)activityUtils.getCurrentActivity().getSystemService("activity")).getMemoryInfo(mi);
Assert.assertFalse("Low memory available: " + mi.availMem + " bytes!", mi.lowMemory);
} | [
"public",
"void",
"assertMemoryNotLow",
"(",
")",
"{",
"ActivityManager",
".",
"MemoryInfo",
"mi",
"=",
"new",
"ActivityManager",
".",
"MemoryInfo",
"(",
")",
";",
"(",
"(",
"ActivityManager",
")",
"activityUtils",
".",
"getCurrentActivity",
"(",
")",
".",
"ge... | Asserts that the available memory is not considered low by the system. | [
"Asserts",
"that",
"the",
"available",
"memory",
"is",
"not",
"considered",
"low",
"by",
"the",
"system",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Asserter.java#L125-L129 |
30,056 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Setter.java | Setter.setSlidingDrawer | public void setSlidingDrawer(final SlidingDrawer slidingDrawer, final int status){
if(slidingDrawer != null){
Activity activity = activityUtils.getCurrentActivity(false);
if(activity != null){
activity.runOnUiThread(new Runnable()
{
public void run()
{
try{
switch (status) {
... | java | public void setSlidingDrawer(final SlidingDrawer slidingDrawer, final int status){
if(slidingDrawer != null){
Activity activity = activityUtils.getCurrentActivity(false);
if(activity != null){
activity.runOnUiThread(new Runnable()
{
public void run()
{
try{
switch (status) {
... | [
"public",
"void",
"setSlidingDrawer",
"(",
"final",
"SlidingDrawer",
"slidingDrawer",
",",
"final",
"int",
"status",
")",
"{",
"if",
"(",
"slidingDrawer",
"!=",
"null",
")",
"{",
"Activity",
"activity",
"=",
"activityUtils",
".",
"getCurrentActivity",
"(",
"fals... | Sets the status of a given SlidingDrawer. Examples are Solo.CLOSED and Solo.OPENED.
@param slidingDrawer the {@link SlidingDrawer}
@param status the status that the {@link SlidingDrawer} should be set to | [
"Sets",
"the",
"status",
"of",
"a",
"given",
"SlidingDrawer",
".",
"Examples",
"are",
"Solo",
".",
"CLOSED",
"and",
"Solo",
".",
"OPENED",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Setter.java#L130-L152 |
30,057 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Setter.java | Setter.setNavigationDrawer | public void setNavigationDrawer(final int status){
final View homeView = getter.getView("home", 0);
final View leftDrawer = getter.getView("left_drawer", 0);
try{
switch (status) {
case CLOSED:
if(leftDrawer != null && homeView != null && leftDrawer.isShown()){
clicker.clickOnScreen(homeView... | java | public void setNavigationDrawer(final int status){
final View homeView = getter.getView("home", 0);
final View leftDrawer = getter.getView("left_drawer", 0);
try{
switch (status) {
case CLOSED:
if(leftDrawer != null && homeView != null && leftDrawer.isShown()){
clicker.clickOnScreen(homeView... | [
"public",
"void",
"setNavigationDrawer",
"(",
"final",
"int",
"status",
")",
"{",
"final",
"View",
"homeView",
"=",
"getter",
".",
"getView",
"(",
"\"home\"",
",",
"0",
")",
";",
"final",
"View",
"leftDrawer",
"=",
"getter",
".",
"getView",
"(",
"\"left_dr... | Sets the status of the NavigationDrawer. Examples are Solo.CLOSED and Solo.OPENED.
@param status the status that the {@link NavigationDrawer} should be set to | [
"Sets",
"the",
"status",
"of",
"the",
"NavigationDrawer",
".",
"Examples",
"are",
"Solo",
".",
"CLOSED",
"and",
"Solo",
".",
"OPENED",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Setter.java#L160-L189 |
30,058 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/DialogUtils.java | DialogUtils.isDialogOpen | private boolean isDialogOpen(){
final Activity activity = activityUtils.getCurrentActivity(false);
final View[] views = viewFetcher.getWindowDecorViews();
View view = viewFetcher.getRecentDecorView(views);
if(!isDialog(activity, view)){
for(View v : views){
if(isDialog(activity, v)){
return true... | java | private boolean isDialogOpen(){
final Activity activity = activityUtils.getCurrentActivity(false);
final View[] views = viewFetcher.getWindowDecorViews();
View view = viewFetcher.getRecentDecorView(views);
if(!isDialog(activity, view)){
for(View v : views){
if(isDialog(activity, v)){
return true... | [
"private",
"boolean",
"isDialogOpen",
"(",
")",
"{",
"final",
"Activity",
"activity",
"=",
"activityUtils",
".",
"getCurrentActivity",
"(",
"false",
")",
";",
"final",
"View",
"[",
"]",
"views",
"=",
"viewFetcher",
".",
"getWindowDecorViews",
"(",
")",
";",
... | Checks if a dialog is open.
@return true if dialog is open | [
"Checks",
"if",
"a",
"dialog",
"is",
"open",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/DialogUtils.java#L103-L119 |
30,059 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/DialogUtils.java | DialogUtils.isDialog | private boolean isDialog(Activity activity, View decorView){
if(decorView == null || !decorView.isShown() || activity == null){
return false;
}
Context viewContext = null;
if(decorView != null){
viewContext = decorView.getContext();
}
if (viewContext instanceof ContextThemeWrapper) {
ContextThem... | java | private boolean isDialog(Activity activity, View decorView){
if(decorView == null || !decorView.isShown() || activity == null){
return false;
}
Context viewContext = null;
if(decorView != null){
viewContext = decorView.getContext();
}
if (viewContext instanceof ContextThemeWrapper) {
ContextThem... | [
"private",
"boolean",
"isDialog",
"(",
"Activity",
"activity",
",",
"View",
"decorView",
")",
"{",
"if",
"(",
"decorView",
"==",
"null",
"||",
"!",
"decorView",
".",
"isShown",
"(",
")",
"||",
"activity",
"==",
"null",
")",
"{",
"return",
"false",
";",
... | Checks that the specified DecorView and the Activity DecorView are not equal.
@param activity the activity which DecorView is to be compared
@param decorView the DecorView to compare
@return true if not equal | [
"Checks",
"that",
"the",
"specified",
"DecorView",
"and",
"the",
"Activity",
"DecorView",
"are",
"not",
"equal",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/DialogUtils.java#L129-L145 |
30,060 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/DialogUtils.java | DialogUtils.hideSoftKeyboard | public void hideSoftKeyboard(EditText editText, boolean shouldSleepFirst, boolean shouldSleepAfter) {
InputMethodManager inputMethodManager;
Activity activity = activityUtils.getCurrentActivity(shouldSleepFirst);
if(activity == null){
inputMethodManager = (InputMethodManager) instrumentation.getTargetContext(... | java | public void hideSoftKeyboard(EditText editText, boolean shouldSleepFirst, boolean shouldSleepAfter) {
InputMethodManager inputMethodManager;
Activity activity = activityUtils.getCurrentActivity(shouldSleepFirst);
if(activity == null){
inputMethodManager = (InputMethodManager) instrumentation.getTargetContext(... | [
"public",
"void",
"hideSoftKeyboard",
"(",
"EditText",
"editText",
",",
"boolean",
"shouldSleepFirst",
",",
"boolean",
"shouldSleepAfter",
")",
"{",
"InputMethodManager",
"inputMethodManager",
";",
"Activity",
"activity",
"=",
"activityUtils",
".",
"getCurrentActivity",
... | Hides the soft keyboard
@param shouldSleepFirst whether to sleep a default pause first
@param shouldSleepAfter whether to sleep a default pause after | [
"Hides",
"the",
"soft",
"keyboard"
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/DialogUtils.java#L154-L183 |
30,061 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Waiter.java | Waiter.isActivityMatching | private boolean isActivityMatching(Activity currentActivity, String name){
if(currentActivity != null && currentActivity.getClass().getSimpleName().equals(name)) {
return true;
}
return false;
} | java | private boolean isActivityMatching(Activity currentActivity, String name){
if(currentActivity != null && currentActivity.getClass().getSimpleName().equals(name)) {
return true;
}
return false;
} | [
"private",
"boolean",
"isActivityMatching",
"(",
"Activity",
"currentActivity",
",",
"String",
"name",
")",
"{",
"if",
"(",
"currentActivity",
"!=",
"null",
"&&",
"currentActivity",
".",
"getClass",
"(",
")",
".",
"getSimpleName",
"(",
")",
".",
"equals",
"(",... | Compares Activity names.
@param currentActivity the Activity that is currently active
@param name the name to compare
@return true if the Activity names match | [
"Compares",
"Activity",
"names",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Waiter.java#L111-L116 |
30,062 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Waiter.java | Waiter.isActivityMatching | private boolean isActivityMatching(Class<? extends Activity> activityClass, Activity currentActivity){
if(currentActivity != null && currentActivity.getClass().equals(activityClass)) {
return true;
}
return false;
} | java | private boolean isActivityMatching(Class<? extends Activity> activityClass, Activity currentActivity){
if(currentActivity != null && currentActivity.getClass().equals(activityClass)) {
return true;
}
return false;
} | [
"private",
"boolean",
"isActivityMatching",
"(",
"Class",
"<",
"?",
"extends",
"Activity",
">",
"activityClass",
",",
"Activity",
"currentActivity",
")",
"{",
"if",
"(",
"currentActivity",
"!=",
"null",
"&&",
"currentActivity",
".",
"getClass",
"(",
")",
".",
... | Compares Activity classes.
@param activityClass the Activity class to compare
@param currentActivity the Activity that is currently active
@return true if Activity classes match | [
"Compares",
"Activity",
"classes",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Waiter.java#L171-L176 |
30,063 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Waiter.java | Waiter.getActivityMonitor | private ActivityMonitor getActivityMonitor(){
IntentFilter filter = null;
ActivityMonitor activityMonitor = instrumentation.addMonitor(filter, null, false);
return activityMonitor;
} | java | private ActivityMonitor getActivityMonitor(){
IntentFilter filter = null;
ActivityMonitor activityMonitor = instrumentation.addMonitor(filter, null, false);
return activityMonitor;
} | [
"private",
"ActivityMonitor",
"getActivityMonitor",
"(",
")",
"{",
"IntentFilter",
"filter",
"=",
"null",
";",
"ActivityMonitor",
"activityMonitor",
"=",
"instrumentation",
".",
"addMonitor",
"(",
"filter",
",",
"null",
",",
"false",
")",
";",
"return",
"activityM... | Creates a new ActivityMonitor and returns it
@return an ActivityMonitor | [
"Creates",
"a",
"new",
"ActivityMonitor",
"and",
"returns",
"it"
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Waiter.java#L183-L187 |
30,064 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Waiter.java | Waiter.waitForViews | public <T extends View> boolean waitForViews(boolean scrollMethod, Class<? extends T>... classes) {
final long endTime = SystemClock.uptimeMillis() + Timeout.getSmallTimeout();
while (SystemClock.uptimeMillis() < endTime) {
for (Class<? extends T> classToWaitFor : classes) {
if (waitForView(classToWaitFor... | java | public <T extends View> boolean waitForViews(boolean scrollMethod, Class<? extends T>... classes) {
final long endTime = SystemClock.uptimeMillis() + Timeout.getSmallTimeout();
while (SystemClock.uptimeMillis() < endTime) {
for (Class<? extends T> classToWaitFor : classes) {
if (waitForView(classToWaitFor... | [
"public",
"<",
"T",
"extends",
"View",
">",
"boolean",
"waitForViews",
"(",
"boolean",
"scrollMethod",
",",
"Class",
"<",
"?",
"extends",
"T",
">",
"...",
"classes",
")",
"{",
"final",
"long",
"endTime",
"=",
"SystemClock",
".",
"uptimeMillis",
"(",
")",
... | Waits for two views to be shown.
@param scrollMethod {@code true} if it's a method used for scrolling
@param classes the classes to wait for
@return {@code true} if any of the views are shown and {@code false} if none of the views are shown before the timeout | [
"Waits",
"for",
"two",
"views",
"to",
"be",
"shown",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Waiter.java#L273-L292 |
30,065 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Waiter.java | Waiter.waitForView | public boolean waitForView(View view){
View viewToWaitFor = waitForView(view, Timeout.getLargeTimeout(), true, true);
if(viewToWaitFor != null) {
return true;
}
return false;
} | java | public boolean waitForView(View view){
View viewToWaitFor = waitForView(view, Timeout.getLargeTimeout(), true, true);
if(viewToWaitFor != null) {
return true;
}
return false;
} | [
"public",
"boolean",
"waitForView",
"(",
"View",
"view",
")",
"{",
"View",
"viewToWaitFor",
"=",
"waitForView",
"(",
"view",
",",
"Timeout",
".",
"getLargeTimeout",
"(",
")",
",",
"true",
",",
"true",
")",
";",
"if",
"(",
"viewToWaitFor",
"!=",
"null",
"... | Waits for a given view. Default timeout is 20 seconds.
@param view the view to wait for
@return {@code true} if view is shown and {@code false} if it is not shown before the timeout | [
"Waits",
"for",
"a",
"given",
"view",
".",
"Default",
"timeout",
"is",
"20",
"seconds",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Waiter.java#L302-L310 |
30,066 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Waiter.java | Waiter.waitForWebElement | public WebElement waitForWebElement(final By by, int minimumNumberOfMatches, int timeout, boolean scroll){
final long endTime = SystemClock.uptimeMillis() + timeout;
while (true) {
final boolean timedOut = SystemClock.uptimeMillis() > endTime;
if (timedOut){
searcher.logMatchesFound(by.getValue());
... | java | public WebElement waitForWebElement(final By by, int minimumNumberOfMatches, int timeout, boolean scroll){
final long endTime = SystemClock.uptimeMillis() + timeout;
while (true) {
final boolean timedOut = SystemClock.uptimeMillis() > endTime;
if (timedOut){
searcher.logMatchesFound(by.getValue());
... | [
"public",
"WebElement",
"waitForWebElement",
"(",
"final",
"By",
"by",
",",
"int",
"minimumNumberOfMatches",
",",
"int",
"timeout",
",",
"boolean",
"scroll",
")",
"{",
"final",
"long",
"endTime",
"=",
"SystemClock",
".",
"uptimeMillis",
"(",
")",
"+",
"timeout... | Waits for a web element.
@param by the By object. Examples are By.id("id") and By.name("name")
@param minimumNumberOfMatches the minimum number of matches that are expected to be shown. {@code 0} means any number of matches
@param timeout the the amount of time in milliseconds to wait
@param scroll {@code true} if scr... | [
"Waits",
"for",
"a",
"web",
"element",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Waiter.java#L483-L505 |
30,067 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Waiter.java | Waiter.waitForAndGetView | public <T extends View> T waitForAndGetView(int index, Class<T> classToFilterBy){
long endTime = SystemClock.uptimeMillis() + Timeout.getSmallTimeout();
while (SystemClock.uptimeMillis() <= endTime && !waitForView(classToFilterBy, index, true, true));
int numberOfUniqueViews = searcher.getNumberOfUniqueViews();
... | java | public <T extends View> T waitForAndGetView(int index, Class<T> classToFilterBy){
long endTime = SystemClock.uptimeMillis() + Timeout.getSmallTimeout();
while (SystemClock.uptimeMillis() <= endTime && !waitForView(classToFilterBy, index, true, true));
int numberOfUniqueViews = searcher.getNumberOfUniqueViews();
... | [
"public",
"<",
"T",
"extends",
"View",
">",
"T",
"waitForAndGetView",
"(",
"int",
"index",
",",
"Class",
"<",
"T",
">",
"classToFilterBy",
")",
"{",
"long",
"endTime",
"=",
"SystemClock",
".",
"uptimeMillis",
"(",
")",
"+",
"Timeout",
".",
"getSmallTimeout... | Waits for and returns a View.
@param index the index of the view
@param classToFilterby the class to filter
@return the specified View | [
"Waits",
"for",
"and",
"returns",
"a",
"View",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Waiter.java#L645-L671 |
30,068 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Waiter.java | Waiter.waitForFragment | public boolean waitForFragment(String tag, int id, int timeout){
long endTime = SystemClock.uptimeMillis() + timeout;
while (SystemClock.uptimeMillis() <= endTime) {
if(getSupportFragment(tag, id) != null)
return true;
if(getFragment(tag, id) != null)
return true;
}
return false;
} | java | public boolean waitForFragment(String tag, int id, int timeout){
long endTime = SystemClock.uptimeMillis() + timeout;
while (SystemClock.uptimeMillis() <= endTime) {
if(getSupportFragment(tag, id) != null)
return true;
if(getFragment(tag, id) != null)
return true;
}
return false;
} | [
"public",
"boolean",
"waitForFragment",
"(",
"String",
"tag",
",",
"int",
"id",
",",
"int",
"timeout",
")",
"{",
"long",
"endTime",
"=",
"SystemClock",
".",
"uptimeMillis",
"(",
")",
"+",
"timeout",
";",
"while",
"(",
"SystemClock",
".",
"uptimeMillis",
"(... | Waits for a Fragment with a given tag or id to appear.
@param tag the name of the tag or null if no tag
@param id the id of the tag
@param timeout the amount of time in milliseconds to wait
@return true if fragment appears and false if it does not appear before the timeout | [
"Waits",
"for",
"a",
"Fragment",
"with",
"a",
"given",
"tag",
"or",
"id",
"to",
"appear",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Waiter.java#L682-L693 |
30,069 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Waiter.java | Waiter.getSupportFragment | private Fragment getSupportFragment(String tag, int id){
FragmentActivity fragmentActivity = null;
try{
fragmentActivity = (FragmentActivity) activityUtils.getCurrentActivity(false);
}catch (Throwable ignored) {}
if(fragmentActivity != null){
try{
if(tag == null)
return fragmentActivity.getSupp... | java | private Fragment getSupportFragment(String tag, int id){
FragmentActivity fragmentActivity = null;
try{
fragmentActivity = (FragmentActivity) activityUtils.getCurrentActivity(false);
}catch (Throwable ignored) {}
if(fragmentActivity != null){
try{
if(tag == null)
return fragmentActivity.getSupp... | [
"private",
"Fragment",
"getSupportFragment",
"(",
"String",
"tag",
",",
"int",
"id",
")",
"{",
"FragmentActivity",
"fragmentActivity",
"=",
"null",
";",
"try",
"{",
"fragmentActivity",
"=",
"(",
"FragmentActivity",
")",
"activityUtils",
".",
"getCurrentActivity",
... | Returns a SupportFragment with a given tag or id.
@param tag the tag of the SupportFragment or null if no tag
@param id the id of the SupportFragment
@return a SupportFragment with a given tag or id | [
"Returns",
"a",
"SupportFragment",
"with",
"a",
"given",
"tag",
"or",
"id",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Waiter.java#L703-L719 |
30,070 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Waiter.java | Waiter.getLog | private StringBuilder getLog(StringBuilder stringBuilder) {
Process p = null;
BufferedReader reader = null;
String line = null;
try {
// read output from logcat
p = Runtime.getRuntime().exec("logcat -d");
reader = new BufferedReader(
new InputStreamReader(p.getInputStream()));
stringBuil... | java | private StringBuilder getLog(StringBuilder stringBuilder) {
Process p = null;
BufferedReader reader = null;
String line = null;
try {
// read output from logcat
p = Runtime.getRuntime().exec("logcat -d");
reader = new BufferedReader(
new InputStreamReader(p.getInputStream()));
stringBuil... | [
"private",
"StringBuilder",
"getLog",
"(",
"StringBuilder",
"stringBuilder",
")",
"{",
"Process",
"p",
"=",
"null",
";",
"BufferedReader",
"reader",
"=",
"null",
";",
"String",
"line",
"=",
"null",
";",
"try",
"{",
"// read output from logcat",
"p",
"=",
"Runt... | Returns the log in the given stringBuilder.
@param stringBuilder the StringBuilder object to return the log in
@return the log | [
"Returns",
"the",
"log",
"in",
"the",
"given",
"stringBuilder",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Waiter.java#L751-L798 |
30,071 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Waiter.java | Waiter.clearLog | public void clearLog(){
Process p = null;
try {
p = Runtime.getRuntime().exec("logcat -c");
}catch(IOException e){
e.printStackTrace();
}
} | java | public void clearLog(){
Process p = null;
try {
p = Runtime.getRuntime().exec("logcat -c");
}catch(IOException e){
e.printStackTrace();
}
} | [
"public",
"void",
"clearLog",
"(",
")",
"{",
"Process",
"p",
"=",
"null",
";",
"try",
"{",
"p",
"=",
"Runtime",
".",
"getRuntime",
"(",
")",
".",
"exec",
"(",
"\"logcat -c\"",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"e",
".",
"... | Clears the log. | [
"Clears",
"the",
"log",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Waiter.java#L804-L811 |
30,072 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Waiter.java | Waiter.destroy | private void destroy(Process p, BufferedReader reader){
p.destroy();
try {
reader.close();
} catch (IOException e) {
e.printStackTrace();
}
} | java | private void destroy(Process p, BufferedReader reader){
p.destroy();
try {
reader.close();
} catch (IOException e) {
e.printStackTrace();
}
} | [
"private",
"void",
"destroy",
"(",
"Process",
"p",
",",
"BufferedReader",
"reader",
")",
"{",
"p",
".",
"destroy",
"(",
")",
";",
"try",
"{",
"reader",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"e",
".",
"printSt... | Destroys the process and closes the BufferedReader.
@param p the process to destroy
@param reader the BufferedReader to close | [
"Destroys",
"the",
"process",
"and",
"closes",
"the",
"BufferedReader",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Waiter.java#L820-L827 |
30,073 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Waiter.java | Waiter.getFragment | private android.app.Fragment getFragment(String tag, int id){
try{
if(tag == null)
return activityUtils.getCurrentActivity().getFragmentManager().findFragmentById(id);
else
return activityUtils.getCurrentActivity().getFragmentManager().findFragmentByTag(tag);
}catch (Throwable ignored) {}
return n... | java | private android.app.Fragment getFragment(String tag, int id){
try{
if(tag == null)
return activityUtils.getCurrentActivity().getFragmentManager().findFragmentById(id);
else
return activityUtils.getCurrentActivity().getFragmentManager().findFragmentByTag(tag);
}catch (Throwable ignored) {}
return n... | [
"private",
"android",
".",
"app",
".",
"Fragment",
"getFragment",
"(",
"String",
"tag",
",",
"int",
"id",
")",
"{",
"try",
"{",
"if",
"(",
"tag",
"==",
"null",
")",
"return",
"activityUtils",
".",
"getCurrentActivity",
"(",
")",
".",
"getFragmentManager",
... | Returns a Fragment with a given tag or id.
@param tag the tag of the Fragment or null if no tag
@param id the id of the Fragment
@return a SupportFragment with a given tag or id | [
"Returns",
"a",
"Fragment",
"with",
"a",
"given",
"tag",
"or",
"id",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Waiter.java#L837-L847 |
30,074 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/WebUtils.java | WebUtils.createAndReturnTextViewsFromWebElements | private ArrayList <TextView> createAndReturnTextViewsFromWebElements(boolean javaScriptWasExecuted){
ArrayList<TextView> webElementsAsTextViews = new ArrayList<TextView>();
if(javaScriptWasExecuted){
for(WebElement webElement : webElementCreator.getWebElementsFromWebViews()){
if(isWebElementSufficientlyShow... | java | private ArrayList <TextView> createAndReturnTextViewsFromWebElements(boolean javaScriptWasExecuted){
ArrayList<TextView> webElementsAsTextViews = new ArrayList<TextView>();
if(javaScriptWasExecuted){
for(WebElement webElement : webElementCreator.getWebElementsFromWebViews()){
if(isWebElementSufficientlyShow... | [
"private",
"ArrayList",
"<",
"TextView",
">",
"createAndReturnTextViewsFromWebElements",
"(",
"boolean",
"javaScriptWasExecuted",
")",
"{",
"ArrayList",
"<",
"TextView",
">",
"webElementsAsTextViews",
"=",
"new",
"ArrayList",
"<",
"TextView",
">",
"(",
")",
";",
"if... | Creates and returns TextView objects based on WebElements
@return an ArrayList with TextViews | [
"Creates",
"and",
"returns",
"TextView",
"objects",
"based",
"on",
"WebElements"
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/WebUtils.java#L71-L83 |
30,075 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/WebUtils.java | WebUtils.getWebElements | public ArrayList<WebElement> getWebElements(final By by, boolean onlySufficientlyVisbile){
boolean javaScriptWasExecuted = executeJavaScript(by, false);
if(config.useJavaScriptToClickWebElements){
if(!javaScriptWasExecuted){
return new ArrayList<WebElement>();
}
return webElementCreator.getWebElemen... | java | public ArrayList<WebElement> getWebElements(final By by, boolean onlySufficientlyVisbile){
boolean javaScriptWasExecuted = executeJavaScript(by, false);
if(config.useJavaScriptToClickWebElements){
if(!javaScriptWasExecuted){
return new ArrayList<WebElement>();
}
return webElementCreator.getWebElemen... | [
"public",
"ArrayList",
"<",
"WebElement",
">",
"getWebElements",
"(",
"final",
"By",
"by",
",",
"boolean",
"onlySufficientlyVisbile",
")",
"{",
"boolean",
"javaScriptWasExecuted",
"=",
"executeJavaScript",
"(",
"by",
",",
"false",
")",
";",
"if",
"(",
"config",
... | Returns an ArrayList of WebElements of the specified By object currently shown in the active WebView.
@param by the By object. Examples are By.id("id") and By.name("name")
@param onlySufficientlyVisible true if only sufficiently visible {@link WebElement} objects should be returned
@return an {@code ArrayList} of the ... | [
"Returns",
"an",
"ArrayList",
"of",
"WebElements",
"of",
"the",
"specified",
"By",
"object",
"currently",
"shown",
"in",
"the",
"active",
"WebView",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/WebUtils.java#L106-L117 |
30,076 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/WebUtils.java | WebUtils.getWebElements | private ArrayList<WebElement> getWebElements(boolean javaScriptWasExecuted, boolean onlySufficientlyVisbile){
ArrayList<WebElement> webElements = new ArrayList<WebElement>();
if(javaScriptWasExecuted){
for(WebElement webElement : webElementCreator.getWebElementsFromWebViews()){
if(!onlySufficientlyVisbile){... | java | private ArrayList<WebElement> getWebElements(boolean javaScriptWasExecuted, boolean onlySufficientlyVisbile){
ArrayList<WebElement> webElements = new ArrayList<WebElement>();
if(javaScriptWasExecuted){
for(WebElement webElement : webElementCreator.getWebElementsFromWebViews()){
if(!onlySufficientlyVisbile){... | [
"private",
"ArrayList",
"<",
"WebElement",
">",
"getWebElements",
"(",
"boolean",
"javaScriptWasExecuted",
",",
"boolean",
"onlySufficientlyVisbile",
")",
"{",
"ArrayList",
"<",
"WebElement",
">",
"webElements",
"=",
"new",
"ArrayList",
"<",
"WebElement",
">",
"(",
... | Returns the sufficiently shown WebElements
@param javaScriptWasExecuted true if JavaScript was executed
@param onlySufficientlyVisible true if only sufficiently visible {@link WebElement} objects should be returned
@return the sufficiently shown WebElements | [
"Returns",
"the",
"sufficiently",
"shown",
"WebElements"
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/WebUtils.java#L127-L141 |
30,077 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/WebUtils.java | WebUtils.prepareForStartOfJavascriptExecution | private String prepareForStartOfJavascriptExecution(List<WebView> webViews) {
webElementCreator.prepareForStart();
WebChromeClient currentWebChromeClient = getCurrentWebChromeClient();
if(currentWebChromeClient != null && !currentWebChromeClient.getClass().isAssignableFrom(RobotiumWebClient.class)){
original... | java | private String prepareForStartOfJavascriptExecution(List<WebView> webViews) {
webElementCreator.prepareForStart();
WebChromeClient currentWebChromeClient = getCurrentWebChromeClient();
if(currentWebChromeClient != null && !currentWebChromeClient.getClass().isAssignableFrom(RobotiumWebClient.class)){
original... | [
"private",
"String",
"prepareForStartOfJavascriptExecution",
"(",
"List",
"<",
"WebView",
">",
"webViews",
")",
"{",
"webElementCreator",
".",
"prepareForStart",
"(",
")",
";",
"WebChromeClient",
"currentWebChromeClient",
"=",
"getCurrentWebChromeClient",
"(",
")",
";",... | Prepares for start of JavaScript execution
@return the JavaScript as a String | [
"Prepares",
"for",
"start",
"of",
"JavaScript",
"execution"
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/WebUtils.java#L149-L159 |
30,078 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/WebUtils.java | WebUtils.getCurrentWebChromeClient | private WebChromeClient getCurrentWebChromeClient(){
WebChromeClient currentWebChromeClient = null;
Object currentWebView = viewFetcher.getFreshestView(viewFetcher.getCurrentViews(WebView.class, true));
if (android.os.Build.VERSION.SDK_INT >= 16) {
try{
currentWebView = new Reflect(currentWebView).field(... | java | private WebChromeClient getCurrentWebChromeClient(){
WebChromeClient currentWebChromeClient = null;
Object currentWebView = viewFetcher.getFreshestView(viewFetcher.getCurrentViews(WebView.class, true));
if (android.os.Build.VERSION.SDK_INT >= 16) {
try{
currentWebView = new Reflect(currentWebView).field(... | [
"private",
"WebChromeClient",
"getCurrentWebChromeClient",
"(",
")",
"{",
"WebChromeClient",
"currentWebChromeClient",
"=",
"null",
";",
"Object",
"currentWebView",
"=",
"viewFetcher",
".",
"getFreshestView",
"(",
"viewFetcher",
".",
"getCurrentViews",
"(",
"WebView",
"... | Returns the current WebChromeClient through reflection
@return the current WebChromeClient | [
"Returns",
"the",
"current",
"WebChromeClient",
"through",
"reflection"
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/WebUtils.java#L168-L191 |
30,079 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/WebUtils.java | WebUtils.enterTextIntoWebElement | public void enterTextIntoWebElement(final By by, final String text){
if(by instanceof By.Id){
executeJavaScriptFunction("enterTextById(\""+by.getValue()+"\", \""+text+"\");");
}
else if(by instanceof By.Xpath){
executeJavaScriptFunction("enterTextByXpath(\""+by.getValue()+"\", \""+text+"\");");
}
else i... | java | public void enterTextIntoWebElement(final By by, final String text){
if(by instanceof By.Id){
executeJavaScriptFunction("enterTextById(\""+by.getValue()+"\", \""+text+"\");");
}
else if(by instanceof By.Xpath){
executeJavaScriptFunction("enterTextByXpath(\""+by.getValue()+"\", \""+text+"\");");
}
else i... | [
"public",
"void",
"enterTextIntoWebElement",
"(",
"final",
"By",
"by",
",",
"final",
"String",
"text",
")",
"{",
"if",
"(",
"by",
"instanceof",
"By",
".",
"Id",
")",
"{",
"executeJavaScriptFunction",
"(",
"\"enterTextById(\\\"\"",
"+",
"by",
".",
"getValue",
... | Enters text into a web element using the given By method
@param by the By object e.g. By.id("id");
@param text the text to enter | [
"Enters",
"text",
"into",
"a",
"web",
"element",
"using",
"the",
"given",
"By",
"method"
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/WebUtils.java#L200-L222 |
30,080 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/WebUtils.java | WebUtils.executeJavaScript | public boolean executeJavaScript(final By by, boolean shouldClick){
if(by instanceof By.Id){
return executeJavaScriptFunction("id(\""+by.getValue()+"\", \"" + String.valueOf(shouldClick) + "\");");
}
else if(by instanceof By.Xpath){
return executeJavaScriptFunction("xpath(\""+by.getValue()+"\", \"" + String... | java | public boolean executeJavaScript(final By by, boolean shouldClick){
if(by instanceof By.Id){
return executeJavaScriptFunction("id(\""+by.getValue()+"\", \"" + String.valueOf(shouldClick) + "\");");
}
else if(by instanceof By.Xpath){
return executeJavaScriptFunction("xpath(\""+by.getValue()+"\", \"" + String... | [
"public",
"boolean",
"executeJavaScript",
"(",
"final",
"By",
"by",
",",
"boolean",
"shouldClick",
")",
"{",
"if",
"(",
"by",
"instanceof",
"By",
".",
"Id",
")",
"{",
"return",
"executeJavaScriptFunction",
"(",
"\"id(\\\"\"",
"+",
"by",
".",
"getValue",
"(",... | Executes JavaScript determined by the given By object
@param by the By object e.g. By.id("id");
@param shouldClick true if click should be performed
@return true if JavaScript function was executed | [
"Executes",
"JavaScript",
"determined",
"by",
"the",
"given",
"By",
"object"
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/WebUtils.java#L232-L255 |
30,081 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/WebUtils.java | WebUtils.executeJavaScriptFunction | private boolean executeJavaScriptFunction(final String function) {
List<WebView> webViews = viewFetcher.getCurrentViews(WebView.class, true);
final WebView webView = viewFetcher.getFreshestView((ArrayList<WebView>) webViews);
if(webView == null) {
return false;
}
final String javaScript = setWebFrame(p... | java | private boolean executeJavaScriptFunction(final String function) {
List<WebView> webViews = viewFetcher.getCurrentViews(WebView.class, true);
final WebView webView = viewFetcher.getFreshestView((ArrayList<WebView>) webViews);
if(webView == null) {
return false;
}
final String javaScript = setWebFrame(p... | [
"private",
"boolean",
"executeJavaScriptFunction",
"(",
"final",
"String",
"function",
")",
"{",
"List",
"<",
"WebView",
">",
"webViews",
"=",
"viewFetcher",
".",
"getCurrentViews",
"(",
"WebView",
".",
"class",
",",
"true",
")",
";",
"final",
"WebView",
"webV... | Executes the given JavaScript function
@param function the function as a String
@return true if JavaScript function was executed | [
"Executes",
"the",
"given",
"JavaScript",
"function"
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/WebUtils.java#L264-L282 |
30,082 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/WebUtils.java | WebUtils.splitNameByUpperCase | public String splitNameByUpperCase(String name) {
String [] texts = name.split("(?=\\p{Upper})");
StringBuilder stringToReturn = new StringBuilder();
for(String string : texts){
if(stringToReturn.length() > 0) {
stringToReturn.append(" " + string.toLowerCase());
}
else {
stringToReturn.append(s... | java | public String splitNameByUpperCase(String name) {
String [] texts = name.split("(?=\\p{Upper})");
StringBuilder stringToReturn = new StringBuilder();
for(String string : texts){
if(stringToReturn.length() > 0) {
stringToReturn.append(" " + string.toLowerCase());
}
else {
stringToReturn.append(s... | [
"public",
"String",
"splitNameByUpperCase",
"(",
"String",
"name",
")",
"{",
"String",
"[",
"]",
"texts",
"=",
"name",
".",
"split",
"(",
"\"(?=\\\\p{Upper})\"",
")",
";",
"StringBuilder",
"stringToReturn",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
... | Splits a name by upper case.
@param name the name to split
@return a String with the split name | [
"Splits",
"a",
"name",
"by",
"upper",
"case",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/WebUtils.java#L323-L337 |
30,083 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/WebUtils.java | WebUtils.getJavaScriptAsString | private String getJavaScriptAsString() {
InputStream fis = getClass().getResourceAsStream("RobotiumWeb.js");
StringBuffer javaScript = new StringBuffer();
try {
BufferedReader input = new BufferedReader(new InputStreamReader(fis));
String line = null;
while (( line = input.readLine()) != null){
jav... | java | private String getJavaScriptAsString() {
InputStream fis = getClass().getResourceAsStream("RobotiumWeb.js");
StringBuffer javaScript = new StringBuffer();
try {
BufferedReader input = new BufferedReader(new InputStreamReader(fis));
String line = null;
while (( line = input.readLine()) != null){
jav... | [
"private",
"String",
"getJavaScriptAsString",
"(",
")",
"{",
"InputStream",
"fis",
"=",
"getClass",
"(",
")",
".",
"getResourceAsStream",
"(",
"\"RobotiumWeb.js\"",
")",
";",
"StringBuffer",
"javaScript",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"try",
"{",
... | Returns the JavaScript file RobotiumWeb.js as a String
@return the JavaScript file RobotiumWeb.js as a {@code String} | [
"Returns",
"the",
"JavaScript",
"file",
"RobotiumWeb",
".",
"js",
"as",
"a",
"String"
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/WebUtils.java#L345-L361 |
30,084 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Searcher.java | Searcher.searchFor | public <T extends View> boolean searchFor(Set<T> uniqueViews, Class<T> viewClass, final int index) {
ArrayList<T> allViews = RobotiumUtils.removeInvisibleViews(viewFetcher.getCurrentViews(viewClass, true));
int uniqueViewsFound = (getNumberOfUniqueViews(uniqueViews, allViews));
if(uniqueViewsFound > 0 && index ... | java | public <T extends View> boolean searchFor(Set<T> uniqueViews, Class<T> viewClass, final int index) {
ArrayList<T> allViews = RobotiumUtils.removeInvisibleViews(viewFetcher.getCurrentViews(viewClass, true));
int uniqueViewsFound = (getNumberOfUniqueViews(uniqueViews, allViews));
if(uniqueViewsFound > 0 && index ... | [
"public",
"<",
"T",
"extends",
"View",
">",
"boolean",
"searchFor",
"(",
"Set",
"<",
"T",
">",
"uniqueViews",
",",
"Class",
"<",
"T",
">",
"viewClass",
",",
"final",
"int",
"index",
")",
"{",
"ArrayList",
"<",
"T",
">",
"allViews",
"=",
"RobotiumUtils"... | Searches for a view class.
@param uniqueViews the set of unique views
@param viewClass the view class to search for
@param index the index of the view class
@return true if view class if found a given number of times | [
"Searches",
"for",
"a",
"view",
"class",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Searcher.java#L141-L154 |
30,085 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Searcher.java | Searcher.searchFor | public <T extends View> boolean searchFor(View view) {
ArrayList<View> views = viewFetcher.getAllViews(true);
for(View v : views){
if(v.equals(view)){
return true;
}
}
return false;
} | java | public <T extends View> boolean searchFor(View view) {
ArrayList<View> views = viewFetcher.getAllViews(true);
for(View v : views){
if(v.equals(view)){
return true;
}
}
return false;
} | [
"public",
"<",
"T",
"extends",
"View",
">",
"boolean",
"searchFor",
"(",
"View",
"view",
")",
"{",
"ArrayList",
"<",
"View",
">",
"views",
"=",
"viewFetcher",
".",
"getAllViews",
"(",
"true",
")",
";",
"for",
"(",
"View",
"v",
":",
"views",
")",
"{",... | Searches for a given view.
@param view the view to search
@param scroll true if scrolling should be performed
@return true if view is found | [
"Searches",
"for",
"a",
"given",
"view",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Searcher.java#L164-L172 |
30,086 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Searcher.java | Searcher.searchForWebElement | public WebElement searchForWebElement(final By by, int minimumNumberOfMatches){
if(minimumNumberOfMatches < 1){
minimumNumberOfMatches = 1;
}
List<WebElement> viewsFromScreen = webUtils.getWebElements(by, true);
addViewsToList (webElements, viewsFromScreen);
return getViewFromList(webElements, minimumNu... | java | public WebElement searchForWebElement(final By by, int minimumNumberOfMatches){
if(minimumNumberOfMatches < 1){
minimumNumberOfMatches = 1;
}
List<WebElement> viewsFromScreen = webUtils.getWebElements(by, true);
addViewsToList (webElements, viewsFromScreen);
return getViewFromList(webElements, minimumNu... | [
"public",
"WebElement",
"searchForWebElement",
"(",
"final",
"By",
"by",
",",
"int",
"minimumNumberOfMatches",
")",
"{",
"if",
"(",
"minimumNumberOfMatches",
"<",
"1",
")",
"{",
"minimumNumberOfMatches",
"=",
"1",
";",
"}",
"List",
"<",
"WebElement",
">",
"vie... | Searches for a web element.
@param by the By object e.g. By.id("id");
@param minimumNumberOfMatches the minimum number of matches that are expected to be shown. {@code 0} means any number of matches
@return the web element or null if not found | [
"Searches",
"for",
"a",
"web",
"element",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Searcher.java#L231-L241 |
30,087 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Searcher.java | Searcher.addViewsToList | private void addViewsToList(List<WebElement> allWebElements, List<WebElement> webElementsOnScreen){
int[] xyViewFromSet = new int[2];
int[] xyViewFromScreen = new int[2];
for(WebElement textFromScreen : webElementsOnScreen){
boolean foundView = false;
textFromScreen.getLocationOnScreen(xyViewFromScreen);
... | java | private void addViewsToList(List<WebElement> allWebElements, List<WebElement> webElementsOnScreen){
int[] xyViewFromSet = new int[2];
int[] xyViewFromScreen = new int[2];
for(WebElement textFromScreen : webElementsOnScreen){
boolean foundView = false;
textFromScreen.getLocationOnScreen(xyViewFromScreen);
... | [
"private",
"void",
"addViewsToList",
"(",
"List",
"<",
"WebElement",
">",
"allWebElements",
",",
"List",
"<",
"WebElement",
">",
"webElementsOnScreen",
")",
"{",
"int",
"[",
"]",
"xyViewFromSet",
"=",
"new",
"int",
"[",
"2",
"]",
";",
"int",
"[",
"]",
"x... | Adds views to a given list.
@param allWebElements the list of all views
@param webTextViewsOnScreen the list of views shown on screen | [
"Adds",
"views",
"to",
"a",
"given",
"list",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Searcher.java#L250-L272 |
30,088 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Searcher.java | Searcher.getViewFromList | private WebElement getViewFromList(List<WebElement> webElements, int match){
WebElement webElementToReturn = null;
if(webElements.size() >= match){
try{
webElementToReturn = webElements.get(--match);
}catch(Exception ignored){}
}
if(webElementToReturn != null)
webElements.clear();
return webE... | java | private WebElement getViewFromList(List<WebElement> webElements, int match){
WebElement webElementToReturn = null;
if(webElements.size() >= match){
try{
webElementToReturn = webElements.get(--match);
}catch(Exception ignored){}
}
if(webElementToReturn != null)
webElements.clear();
return webE... | [
"private",
"WebElement",
"getViewFromList",
"(",
"List",
"<",
"WebElement",
">",
"webElements",
",",
"int",
"match",
")",
"{",
"WebElement",
"webElementToReturn",
"=",
"null",
";",
"if",
"(",
"webElements",
".",
"size",
"(",
")",
">=",
"match",
")",
"{",
"... | Returns a text view with a given match.
@param webElements the list of views
@param match the match of the view to return
@return the view with a given match | [
"Returns",
"a",
"text",
"view",
"with",
"a",
"given",
"match",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Searcher.java#L282-L296 |
30,089 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Searcher.java | Searcher.getNumberOfUniqueViews | public <T extends View> int getNumberOfUniqueViews(Set<T>uniqueViews, ArrayList<T> views){
for(int i = 0; i < views.size(); i++){
uniqueViews.add(views.get(i));
}
numberOfUniqueViews = uniqueViews.size();
return numberOfUniqueViews;
} | java | public <T extends View> int getNumberOfUniqueViews(Set<T>uniqueViews, ArrayList<T> views){
for(int i = 0; i < views.size(); i++){
uniqueViews.add(views.get(i));
}
numberOfUniqueViews = uniqueViews.size();
return numberOfUniqueViews;
} | [
"public",
"<",
"T",
"extends",
"View",
">",
"int",
"getNumberOfUniqueViews",
"(",
"Set",
"<",
"T",
">",
"uniqueViews",
",",
"ArrayList",
"<",
"T",
">",
"views",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"views",
".",
"size",
"(",
... | Returns the number of unique views.
@param uniqueViews the set of unique views
@param views the list of all views
@return number of unique views | [
"Returns",
"the",
"number",
"of",
"unique",
"views",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Searcher.java#L306-L312 |
30,090 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/SystemUtils.java | SystemUtils.setMobileData | public void setMobileData(Boolean turnedOn){
ConnectivityManager dataManager=(ConnectivityManager)instrumentation.getTargetContext().getSystemService(Context.CONNECTIVITY_SERVICE);
Method dataClass = null;
try {
dataClass = ConnectivityManager.class.getDeclaredMethod("setMobileDataEnabled", boolean.class);
... | java | public void setMobileData(Boolean turnedOn){
ConnectivityManager dataManager=(ConnectivityManager)instrumentation.getTargetContext().getSystemService(Context.CONNECTIVITY_SERVICE);
Method dataClass = null;
try {
dataClass = ConnectivityManager.class.getDeclaredMethod("setMobileDataEnabled", boolean.class);
... | [
"public",
"void",
"setMobileData",
"(",
"Boolean",
"turnedOn",
")",
"{",
"ConnectivityManager",
"dataManager",
"=",
"(",
"ConnectivityManager",
")",
"instrumentation",
".",
"getTargetContext",
"(",
")",
".",
"getSystemService",
"(",
"Context",
".",
"CONNECTIVITY_SERVI... | Sets if mobile data should be turned on or off. Requires android.permission.CHANGE_NETWORK_STATE in the AndroidManifest.xml of the application under test.
@param turnedOn true if mobile data is to be turned on and false if not | [
"Sets",
"if",
"mobile",
"data",
"should",
"be",
"turned",
"on",
"or",
"off",
".",
"Requires",
"android",
".",
"permission",
".",
"CHANGE_NETWORK_STATE",
"in",
"the",
"AndroidManifest",
".",
"xml",
"of",
"the",
"application",
"under",
"test",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/SystemUtils.java#L33-L44 |
30,091 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/SystemUtils.java | SystemUtils.setWiFiData | public void setWiFiData(Boolean turnedOn){
WifiManager wifiManager = (WifiManager)instrumentation.getTargetContext().getSystemService(Context.WIFI_SERVICE);
try{
wifiManager.setWifiEnabled(turnedOn);
}catch(Exception e){
e.printStackTrace();
}
} | java | public void setWiFiData(Boolean turnedOn){
WifiManager wifiManager = (WifiManager)instrumentation.getTargetContext().getSystemService(Context.WIFI_SERVICE);
try{
wifiManager.setWifiEnabled(turnedOn);
}catch(Exception e){
e.printStackTrace();
}
} | [
"public",
"void",
"setWiFiData",
"(",
"Boolean",
"turnedOn",
")",
"{",
"WifiManager",
"wifiManager",
"=",
"(",
"WifiManager",
")",
"instrumentation",
".",
"getTargetContext",
"(",
")",
".",
"getSystemService",
"(",
"Context",
".",
"WIFI_SERVICE",
")",
";",
"try"... | Sets if wifi data should be turned on or off. Requires android.permission.CHANGE_WIFI_STATE in the AndroidManifest.xml of the application under test.
@param turnedOn true if mobile wifi is to be turned on and false if not | [
"Sets",
"if",
"wifi",
"data",
"should",
"be",
"turned",
"on",
"or",
"off",
".",
"Requires",
"android",
".",
"permission",
".",
"CHANGE_WIFI_STATE",
"in",
"the",
"AndroidManifest",
".",
"xml",
"of",
"the",
"application",
"under",
"test",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/SystemUtils.java#L53-L60 |
30,092 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.getActivityMonitor | public ActivityMonitor getActivityMonitor(){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "getActivityMonitor()");
}
return activityUtils.getActivityMonitor();
} | java | public ActivityMonitor getActivityMonitor(){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "getActivityMonitor()");
}
return activityUtils.getActivityMonitor();
} | [
"public",
"ActivityMonitor",
"getActivityMonitor",
"(",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggingTag",
",",
"\"getActivityMonitor()\"",
")",
";",
"}",
"return",
"activityUtils",
".",
"g... | Returns the ActivityMonitor used by Robotium.
@return the ActivityMonitor used by Robotium | [
"Returns",
"the",
"ActivityMonitor",
"used",
"by",
"Robotium",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L297-L303 |
30,093 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.getViews | public ArrayList<View> getViews() {
try {
if(config.commandLogging){
Log.d(config.commandLoggingTag, "getViews()");
}
return viewFetcher.getViews(null, false);
} catch (Exception e) {
e.printStackTrace();
return null;
}
} | java | public ArrayList<View> getViews() {
try {
if(config.commandLogging){
Log.d(config.commandLoggingTag, "getViews()");
}
return viewFetcher.getViews(null, false);
} catch (Exception e) {
e.printStackTrace();
return null;
}
} | [
"public",
"ArrayList",
"<",
"View",
">",
"getViews",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggingTag",
",",
"\"getViews()\"",
")",
";",
"}",
"return",
"viewFetcher",... | Returns an ArrayList of all the View objects located in the focused
Activity or Dialog.
@return an {@code ArrayList} of the {@link View} objects located in the focused window | [
"Returns",
"an",
"ArrayList",
"of",
"all",
"the",
"View",
"objects",
"located",
"in",
"the",
"focused",
"Activity",
"or",
"Dialog",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L326-L337 |
30,094 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.getTopParent | public View getTopParent(View view) {
if(config.commandLogging){
Log.d(config.commandLoggingTag, "getTopParent("+view+")");
}
View topParent = viewFetcher.getTopParent(view);
return topParent;
} | java | public View getTopParent(View view) {
if(config.commandLogging){
Log.d(config.commandLoggingTag, "getTopParent("+view+")");
}
View topParent = viewFetcher.getTopParent(view);
return topParent;
} | [
"public",
"View",
"getTopParent",
"(",
"View",
"view",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggingTag",
",",
"\"getTopParent(\"",
"+",
"view",
"+",
"\")\"",
")",
";",
"}",
"View",
... | Returns the absolute top parent View of the specified View.
@param view the {@link View} whose top parent is requested
@return the top parent {@link View} | [
"Returns",
"the",
"absolute",
"top",
"parent",
"View",
"of",
"the",
"specified",
"View",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L366-L373 |
30,095 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.waitForText | public boolean waitForText(String text, int minimumNumberOfMatches, long timeout, boolean scroll, boolean onlyVisible) {
if(config.commandLogging){
Log.d(config.commandLoggingTag, "waitForText(\""+text+"\", "+minimumNumberOfMatches+", "+timeout+", "+scroll+", "+onlyVisible+")");
}
return (waiter.waitForText... | java | public boolean waitForText(String text, int minimumNumberOfMatches, long timeout, boolean scroll, boolean onlyVisible) {
if(config.commandLogging){
Log.d(config.commandLoggingTag, "waitForText(\""+text+"\", "+minimumNumberOfMatches+", "+timeout+", "+scroll+", "+onlyVisible+")");
}
return (waiter.waitForText... | [
"public",
"boolean",
"waitForText",
"(",
"String",
"text",
",",
"int",
"minimumNumberOfMatches",
",",
"long",
"timeout",
",",
"boolean",
"scroll",
",",
"boolean",
"onlyVisible",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",... | Waits for the specified text to appear.
@param text the text to wait for, specified as a regular expression
@param minimumNumberOfMatches the minimum number of matches that are expected to be found. {@code 0} means any number of matches
@param timeout the the amount of time in milliseconds to wait
@param scroll {@code... | [
"Waits",
"for",
"the",
"specified",
"text",
"to",
"appear",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L436-L442 |
30,096 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.waitForView | public boolean waitForView(int id){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "waitForView("+id+")");
}
return waitForView(id, 0, Timeout.getLargeTimeout(), true);
} | java | public boolean waitForView(int id){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "waitForView("+id+")");
}
return waitForView(id, 0, Timeout.getLargeTimeout(), true);
} | [
"public",
"boolean",
"waitForView",
"(",
"int",
"id",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggingTag",
",",
"\"waitForView(\"",
"+",
"id",
"+",
"\")\"",
")",
";",
"}",
"return",
"... | Waits for a View matching the specified resource id. Default timeout is 20 seconds.
@param id the R.id of the {@link View} to wait for
@return {@code true} if the {@link View} is displayed and {@code false} if it is not displayed before the timeout | [
"Waits",
"for",
"a",
"View",
"matching",
"the",
"specified",
"resource",
"id",
".",
"Default",
"timeout",
"is",
"20",
"seconds",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L451-L457 |
30,097 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.waitForView | public boolean waitForView(Object tag){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "waitForView("+tag+")");
}
return waitForView(tag, 0, Timeout.getLargeTimeout(), true);
} | java | public boolean waitForView(Object tag){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "waitForView("+tag+")");
}
return waitForView(tag, 0, Timeout.getLargeTimeout(), true);
} | [
"public",
"boolean",
"waitForView",
"(",
"Object",
"tag",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggingTag",
",",
"\"waitForView(\"",
"+",
"tag",
"+",
"\")\"",
")",
";",
"}",
"return"... | Waits for a View matching the specified tag. Default timeout is 20 seconds.
@param tag the {@link View#getTag() tag} of the {@link View} to wait for
@return {@code true} if the {@link View} is displayed and {@code false} if it is not displayed before the timeout | [
"Waits",
"for",
"a",
"View",
"matching",
"the",
"specified",
"tag",
".",
"Default",
"timeout",
"is",
"20",
"seconds",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L506-L512 |
30,098 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.waitForView | public boolean waitForView(Object tag, int minimumNumberOfMatches, int timeout){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "waitForView("+tag+", "+minimumNumberOfMatches+", "+timeout+")");
}
return waitForView(tag, minimumNumberOfMatches, timeout, true);
} | java | public boolean waitForView(Object tag, int minimumNumberOfMatches, int timeout){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "waitForView("+tag+", "+minimumNumberOfMatches+", "+timeout+")");
}
return waitForView(tag, minimumNumberOfMatches, timeout, true);
} | [
"public",
"boolean",
"waitForView",
"(",
"Object",
"tag",
",",
"int",
"minimumNumberOfMatches",
",",
"int",
"timeout",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggingTag",
",",
"\"waitForVi... | Waits for a View matching the specified tag.
@param tag the {@link View#getTag() tag} of the {@link View} to wait for
@param minimumNumberOfMatches the minimum number of matches that are expected to be found. {@code 0} means any number of matches
@param timeout the amount of time in milliseconds to wait
@return {@code... | [
"Waits",
"for",
"a",
"View",
"matching",
"the",
"specified",
"tag",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L523-L529 |
30,099 | RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.waitForView | public <T extends View> boolean waitForView(final Class<T> viewClass){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "waitForView("+viewClass+")");
}
return waiter.waitForView(viewClass, 0, Timeout.getLargeTimeout(), true);
} | java | public <T extends View> boolean waitForView(final Class<T> viewClass){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "waitForView("+viewClass+")");
}
return waiter.waitForView(viewClass, 0, Timeout.getLargeTimeout(), true);
} | [
"public",
"<",
"T",
"extends",
"View",
">",
"boolean",
"waitForView",
"(",
"final",
"Class",
"<",
"T",
">",
"viewClass",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggingTag",
",",
"\"w... | Waits for a View matching the specified class. Default timeout is 20 seconds.
@param viewClass the {@link View} class to wait for
@return {@code true} if the {@link View} is displayed and {@code false} if it is not displayed before the timeout | [
"Waits",
"for",
"a",
"View",
"matching",
"the",
"specified",
"class",
".",
"Default",
"timeout",
"is",
"20",
"seconds",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L562-L568 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.