From d31d858372aec2ee64f2d067571c134b2f966902 Mon Sep 17 00:00:00 2001 From: Alexander Beinhundner Date: Thu, 23 Jan 2020 11:37:47 +0100 Subject: [PATCH 01/16] CATROID-265 fix double quotes in project download --- .../catroid/transfers/project/ProjectDownloadService.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/catroid/src/main/java/org/catrobat/catroid/transfers/project/ProjectDownloadService.kt b/catroid/src/main/java/org/catrobat/catroid/transfers/project/ProjectDownloadService.kt index d689cf5a70b..a9e5ceb5bd0 100644 --- a/catroid/src/main/java/org/catrobat/catroid/transfers/project/ProjectDownloadService.kt +++ b/catroid/src/main/java/org/catrobat/catroid/transfers/project/ProjectDownloadService.kt @@ -41,6 +41,7 @@ import org.catrobat.catroid.common.FlavoredConstants import org.catrobat.catroid.io.XstreamSerializer import org.catrobat.catroid.io.ZipArchiver import org.catrobat.catroid.ui.MainMenuActivity +import org.catrobat.catroid.utils.FileMetaDataExtractor import org.catrobat.catroid.utils.ToastUtil import org.catrobat.catroid.utils.notifications.NotificationData import org.catrobat.catroid.utils.notifications.StatusBarNotificationManager @@ -133,7 +134,8 @@ class ProjectDownloadService : IntentService("ProjectDownloadService") { val notificationData = statusBarNotificationManager.createProjectDownloadNotification(this, projectName) try { - val projectDir = File(FlavoredConstants.DEFAULT_ROOT_DIRECTORY, projectName) + val projectNameForFileSystem = FileMetaDataExtractor.encodeSpecialCharsForFileSystem(projectName) + val projectDir = File(FlavoredConstants.DEFAULT_ROOT_DIRECTORY, projectNameForFileSystem) ZipArchiver().unzip(destinationFile, projectDir) XstreamSerializer.renameProject(File(projectDir, Constants.CODE_XML_FILE_NAME), projectName) From 85b6346228b32a4f7fd5f55de4b2b693135080ba Mon Sep 17 00:00:00 2001 From: Patrick Trummer Date: Wed, 5 Feb 2020 01:31:32 +0100 Subject: [PATCH 02/16] CATROID-333 Empty formulas are now displayed correctly with ShowVariable brick --- .../src/main/java/org/catrobat/catroid/common/Constants.java | 1 - .../main/java/org/catrobat/catroid/stage/ShowTextActor.java | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/catroid/src/main/java/org/catrobat/catroid/common/Constants.java b/catroid/src/main/java/org/catrobat/catroid/common/Constants.java index 25e8d58c75c..8df6d379be0 100644 --- a/catroid/src/main/java/org/catrobat/catroid/common/Constants.java +++ b/catroid/src/main/java/org/catrobat/catroid/common/Constants.java @@ -236,7 +236,6 @@ public final class Constants { public static final int Z_INDEX_FIRST_SPRITE = Z_INDEX_BACKGROUND + Z_INDEX_NUMBER_VIRTUAL_LAYERS + 1; public static final String NO_VARIABLE_SELECTED = "No variable set"; - public static final String NO_VALUE_SET = "No value set"; public static final int SAY_BRICK = 0; public static final int THINK_BRICK = 1; public static final int MAX_STRING_LENGTH_BUBBLES = 16; diff --git a/catroid/src/main/java/org/catrobat/catroid/stage/ShowTextActor.java b/catroid/src/main/java/org/catrobat/catroid/stage/ShowTextActor.java index 67621529ff3..88c8e629594 100644 --- a/catroid/src/main/java/org/catrobat/catroid/stage/ShowTextActor.java +++ b/catroid/src/main/java/org/catrobat/catroid/stage/ShowTextActor.java @@ -124,11 +124,12 @@ private void drawVariables(List variableList, Batch batch) { for (UserVariable variable : variableList) { if (variable.getName().equals(variableToShow.getName())) { String variableValue = variable.getValue().toString(); + if (variableValue.isEmpty()) { + continue; + } if (variable.getVisible()) { if (isNumberAndInteger(variableValue)) { drawText(batch, variableValueWithoutDecimal, xPosition, yPosition, color); - } else if (variableValue.isEmpty()) { - drawText(batch, Constants.NO_VALUE_SET, xPosition, yPosition, color); } else { drawText(batch, variableValue, xPosition, yPosition, color); } From b9cb36a8ee8f7915c552171a9ecdf8526bdbb77c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20St=C3=B6glehner?= Date: Sat, 8 Feb 2020 09:35:10 +0100 Subject: [PATCH 03/16] CATROID-452 Add language test for modulo function --- .../formula/testModuloFunction.catrobat | Bin 0 -> 24174 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 catroid/src/androidTest/assets/catrobatTests/formula/testModuloFunction.catrobat diff --git a/catroid/src/androidTest/assets/catrobatTests/formula/testModuloFunction.catrobat b/catroid/src/androidTest/assets/catrobatTests/formula/testModuloFunction.catrobat new file mode 100644 index 0000000000000000000000000000000000000000..0a2f2e4caa0a2c51f62150d584bd350e625752c6 GIT binary patch literal 24174 zcmeHP-E!Nw6?VGaHnZ0|(_4-1DUlQ@iZir!WLs{sb}ZGB(@uAHG9U=bY$Q=7sZ6rZ zu@}AXi}bR4(--JF^cA)TASsdhBS1SNuZK!3k>CMv@Eza-a7dov)fd10`sC%ymnWAO z-wsbQpFhCy2$MOfDNS#NCM0Y&=KhR09(r+d^2;y7tKYw*;$J3thFm3u{&Mb=E{Rr% zeTOtY&ZaMZ{=WTB>l-+#eIP;T`Sa7d(va&lG6xZFJ~^%5jW4B6y%t7j?x3kZC#UsK zB&^rI>3(G`0)G;qS@)}2&AKPZApt#v6SP=NJ&YnK@NDT#of|YGU8}h>c~6ez%!cCR z9hu@QyR(fyElAfP_HweFkzL!$##9^n_&teg=KxDCAG^4f4!i}$nu=u3((4~Q zOjt{Lb0_dUr#8B{s@Y(dsOI`X?PI6?uC39mE5SIY7oMXq8V3H~2#&fgnudT*J~0-Y zLf;56T97vYU@DkTj0IWGzXo;YA?**j(^z6LMG+`9>n6Hd%~eWXAjMJz1EeBpS|Sb4(G1vg1-RJs}`7@8iG){nMkkq>v8uus=uklsMfe zSOQx4v{Wu2Wd4eHll!Qv7$!gu7F;J~r5K>2@oj&6{wft?X<4B^droxURpbtgmbj!i zC6?A&h zOmjNiM=|eNO?Jj=f=j+lJJYonMyd2Fu@=GLJ*|%xfftc_jb=NopCSBy5>UdcuQNcF zsqeq1r7&G6=g^PEm~lrk8zA{gV|jKVtvEtKG-4^ax|pOLc$ig~)q-AuTG_R<5E8vb zfk*qm8O^d)63c=8*^JC1;tZCnft5>3;9}(`Ultt}%PHD!Mk3{F-(Ga(oS_qf9X=;fV%MYU9;));@g4| zOS$aWbXzTN>GCS~soV)icP9|XMg;3bGF-=nboMYMXA$kTti1+M;|L5)6zx zSdajG%V*wXLV{|cyIRIRFXAm)D?J6~<E@U@IpNs>RE`A-7Px5-ct#V6oMXXI zv1yxFmYj|Y%qwfUgbV{oc1uy)ShfxDItVi_+&Zf~3u)(l>i5lfIEVEdA$KbD#d!Cs z6!RWsXFe@NMmf_t*5S?To4e7|U!3#YjpV`U`T0VMZi4dkACbOO-RfJro@LV}#K5Mc zV-scwY=9fYkZnm<9Ybq5L^Ba=D#d&ut`~$+vNXRT6S$H2q4J6V4LP3;OoaaGLhR>k=YS` zlqI{L_$vwg%F+Kk_Yw*Zr9I+iLV#ITOS>X&0YR?)!SiF?LhJDW6T`x{+^*a>Yc~$I zk)n5yF6oAgB@H20GTRO~`jM$QrqYp#h90!yt$4Ru?H0TO^En^fu4p&jZDqcz#qQA` zY-zj1Hrk3RDK3G2NGPurl9Ukc>n($)R_M`j6cOF)x`+P}PZxlP5kMCq? zv>w-y`kWr&RvK#2^On_;7Y6WW@-$#wwKYT4Btv&KN$coXGI6UT*=k2cSe6|XyP`{8 zhhT`LF}?66UKIXn+zh=C-WiShe_uing{SadcyBc7-;Uq0S7}G@`hOYr&&U0XJ+H7r z|6u!YK4wT3J>%QE{=p|cR`20%zvfA&l+una2ykAp@FlN%6~x zNQ%jdN{h>v$x$v3k#fTk~u!lKV<}WA@eNgD>^uGP4t|8GbVx=SFKQ z+haC);~_xdX7k*c*xdj==g?+euz0NF_27@M&wJPJdN)PE4>pS^VXIP>dW5c-v^DEE z&)>2XvKP-PW(zFV*~;1KftC`sQwb|Q*hWbkH{Q|}FpIcRVx7yF5P;9%zcB zZ3k}ea~nm}BxMcq0CNZ#L(mitGDOm*EMu*`ADk8t!@nH*rLh-4UI_OGpuVf?XJ4h_ zf?WjkGLV-9oEvTduuDUov|;ldVGexx(G|zG6tbMSa-&)j(_LLxfG>Dq6$P~fq+Eb< z!dVK;MCTo@kAnWm2cj5+!T@r>#|2&q=n`FbJM0f)$Ag>*Zi1*CbdIbp?tX`qFM8Ic zH}}H(5rl<&+(3nUYEP1PX>8>pA0}Z&b7{FaIxNN|#5>KpjncHu;;p%h$7n*6^MN9> zA>QJ6mg(+@xk71%Y_ipi<5s41rswPWs0I-JlL{n_yYd@3x5Cc13mjcZDCnl literal 0 HcmV?d00001 From a2dbd886ae7d649152272672d209f8a8428fd75c Mon Sep 17 00:00:00 2001 From: Michelle Perkonigg Date: Fri, 1 Nov 2019 07:47:18 +0100 Subject: [PATCH 04/16] CATROID-235 Start running stitch with length 10 --- .../catroid/test/BricksHelpUrlTest.java | 2 + .../content/bricks/BrickCategoryTest.java | 4 +- .../bricks/BrickFormulaDefaultValueTest.java | 2 + .../test/embroidery/RunningStitchTest.java | 133 ++++++++++++++++++ .../embroidery/SimpleRunningStitchTest.java | 93 ++++++++++++ .../catrobat/catroid/common/BrickValues.java | 1 + .../catroid/content/ActionFactory.java | 8 ++ .../org/catrobat/catroid/content/Look.java | 1 + .../org/catrobat/catroid/content/Sprite.java | 5 + .../content/actions/RunningStitchAction.java | 60 ++++++++ .../catroid/content/actions/StitchAction.java | 3 + .../catroid/content/bricks/Brick.java | 2 + .../content/bricks/RunningStitchBrick.java | 58 ++++++++ .../catroid/embroidery/RunningStitch.java | 64 +++++++++ .../catroid/embroidery/RunningStitchType.java | 29 ++++ .../embroidery/SimpleRunningStitch.java | 92 ++++++++++++ .../catroid/io/XstreamSerializer.java | 2 + .../ui/fragment/CategoryBricksFactory.java | 2 + .../brick_running_stitch_with_length.xml | 59 ++++++++ catroid/src/main/res/values/strings.xml | 1 + 20 files changed, 620 insertions(+), 1 deletion(-) create mode 100644 catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/RunningStitchTest.java create mode 100644 catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/SimpleRunningStitchTest.java create mode 100644 catroid/src/main/java/org/catrobat/catroid/content/actions/RunningStitchAction.java create mode 100644 catroid/src/main/java/org/catrobat/catroid/content/bricks/RunningStitchBrick.java create mode 100644 catroid/src/main/java/org/catrobat/catroid/embroidery/RunningStitch.java create mode 100644 catroid/src/main/java/org/catrobat/catroid/embroidery/RunningStitchType.java create mode 100644 catroid/src/main/java/org/catrobat/catroid/embroidery/SimpleRunningStitch.java create mode 100644 catroid/src/main/res/layout/brick_running_stitch_with_length.xml diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/BricksHelpUrlTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/BricksHelpUrlTest.java index 7564dfde1b4..734278d4e9b 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/BricksHelpUrlTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/BricksHelpUrlTest.java @@ -378,6 +378,8 @@ public class BricksHelpUrlTest { "https://wiki.catrobat.org/bin/view/Documentation/Brick%20Documentation/Motion%20Bricks/#MoveNStepsBrick"); brickToHelpUrlMapping.put("org.catrobat.catroid.content.bricks.ShowTextColorSizeAlignmentBrick", "https://wiki.catrobat.org/bin/view/Documentation/Brick%20Documentation/Data%20Bricks/#ShowTextColorSizeAlignmentBrick"); + brickToHelpUrlMapping.put("org.catrobat.catroid.content.bricks.RunningStitchBrick", + "https://wiki.catrobat.org/bin/view/Documentation/Brick%20Documentation/Embroidery%20Bricks/#RunningStitchBrick"); } @Parameterized.Parameters(name = "{0}") diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickCategoryTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickCategoryTest.java index fd731442cf5..772a9d33e9d 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickCategoryTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickCategoryTest.java @@ -128,6 +128,7 @@ import org.catrobat.catroid.content.bricks.RepeatBrick; import org.catrobat.catroid.content.bricks.RepeatUntilBrick; import org.catrobat.catroid.content.bricks.ReplaceItemInUserListBrick; +import org.catrobat.catroid.content.bricks.RunningStitchBrick; import org.catrobat.catroid.content.bricks.SayBubbleBrick; import org.catrobat.catroid.content.bricks.SayForBubbleBrick; import org.catrobat.catroid.content.bricks.SceneStartBrick; @@ -232,7 +233,8 @@ public static Collection data() { SetMassBrick.class, SetBounceBrick.class, SetFrictionBrick.class)}, - {"Embroidery", Arrays.asList(StitchBrick.class)}, + {"Embroidery", Arrays.asList(StitchBrick.class, + RunningStitchBrick.class)}, {"Event", Arrays.asList(WhenStartedBrick.class, WhenBrick.class, WhenTouchDownBrick.class, diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickFormulaDefaultValueTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickFormulaDefaultValueTest.java index d7c9e710a2d..bb5047d13b4 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickFormulaDefaultValueTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickFormulaDefaultValueTest.java @@ -76,6 +76,7 @@ import org.catrobat.catroid.content.bricks.RaspiSendDigitalValueBrick; import org.catrobat.catroid.content.bricks.RepeatBrick; import org.catrobat.catroid.content.bricks.RepeatUntilBrick; +import org.catrobat.catroid.content.bricks.RunningStitchBrick; import org.catrobat.catroid.content.bricks.SayBubbleBrick; import org.catrobat.catroid.content.bricks.SayForBubbleBrick; import org.catrobat.catroid.content.bricks.SetBounceBrick; @@ -205,6 +206,7 @@ public static Collection data() { {"WaitUntilBrick - R.id.brick_wait_until_edit_text", "Control", WaitUntilBrick.class, R.id.brick_wait_until_edit_text, "1 < 2 "}, {"RepeatUntilBrick - R.id.brick_repeat_until_edit_text", "Control", RepeatUntilBrick.class, R.id.brick_repeat_until_edit_text, "1 < 2 "}, {"RepeatUntilBrick - R.id.brick_repeat_edit_text", "Control", RepeatBrick.class, R.id.brick_repeat_edit_text, "10 "}, + {"RunningStitchBrick - R.id.brick_running_stitch_edit_text_steps", "Embroidery", RunningStitchBrick.class, R.id.brick_running_stitch_edit_text_length, "10 "}, }); } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/RunningStitchTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/RunningStitchTest.java new file mode 100644 index 00000000000..6ac5c869e84 --- /dev/null +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/RunningStitchTest.java @@ -0,0 +1,133 @@ +/* + * Catroid: An on-device visual programming system for Android devices + * Copyright (C) 2010-2019 The Catrobat Team + * () + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * An additional term exception under section 7 of the GNU Affero + * General Public License, version 3, is available at + * http://developer.catrobat.org/license_additional_term + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package org.catrobat.catroid.test.embroidery; + +import android.support.test.runner.AndroidJUnit4; + +import org.catrobat.catroid.content.Look; +import org.catrobat.catroid.content.Sprite; +import org.catrobat.catroid.embroidery.RunningStitch; +import org.catrobat.catroid.embroidery.RunningStitchType; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; + +import static org.mockito.ArgumentMatchers.anyFloat; + +@RunWith(AndroidJUnit4.class) +public class RunningStitchTest { + private Sprite sprite; + private Look spriteLook; + private RunningStitch runningStitch; + private RunningStitchType runningStitchType; + + @Before + public void setUp() { + spriteLook = Mockito.mock(Look.class); + sprite = Mockito.mock(Sprite.class); + sprite.look = spriteLook; + runningStitchType = Mockito.mock(RunningStitchType.class); + runningStitch = new RunningStitch(); + } + + @Test + public void testActivateRunningStitch() { + runningStitch.activateStitching(sprite, runningStitchType); + runningStitch.update(); + + Mockito.verify(spriteLook, Mockito.times(1)).getXInUserInterfaceDimensionUnit(); + Mockito.verify(spriteLook, Mockito.times(1)).getYInUserInterfaceDimensionUnit(); + Mockito.verify(runningStitchType, Mockito.times(1)).update(anyFloat(), anyFloat()); + } + + @Test + public void testInvalidRunningTypeActivateRunningStitch() { + runningStitch.activateStitching(sprite, null); + runningStitch.update(); + + Mockito.verify(spriteLook, Mockito.times(0)).getXInUserInterfaceDimensionUnit(); + Mockito.verify(spriteLook, Mockito.times(0)).getYInUserInterfaceDimensionUnit(); + } + + @Test + public void testInvalidSpriteActivateRunningStitch() { + runningStitch.activateStitching(null, runningStitchType); + runningStitch.update(); + + Mockito.verify(runningStitchType, Mockito.times(0)).update(anyFloat(), anyFloat()); + } + + @Test + public void testPauseRunningStitch() { + runningStitch.activateStitching(sprite, runningStitchType); + runningStitch.pause(); + runningStitch.update(); + + Mockito.verify(spriteLook, Mockito.times(0)).getXInUserInterfaceDimensionUnit(); + Mockito.verify(spriteLook, Mockito.times(0)).getYInUserInterfaceDimensionUnit(); + Mockito.verify(runningStitchType, Mockito.times(0)).update(anyFloat(), anyFloat()); + } + + @Test + public void testResumeRunningStitch() { + runningStitch.activateStitching(sprite, runningStitchType); + runningStitch.pause(); + runningStitch.resume(); + runningStitch.update(); + + Mockito.verify(spriteLook, Mockito.times(1)).getXInUserInterfaceDimensionUnit(); + Mockito.verify(spriteLook, Mockito.times(1)).getYInUserInterfaceDimensionUnit(); + Mockito.verify(runningStitchType, Mockito.times(1)).update(anyFloat(), anyFloat()); + } + + @Test + public void testInvalidResumeRunningStitch() { + runningStitch.resume(); + runningStitch.update(); + + Mockito.verify(spriteLook, Mockito.times(0)).getXInUserInterfaceDimensionUnit(); + Mockito.verify(spriteLook, Mockito.times(0)).getYInUserInterfaceDimensionUnit(); + Mockito.verify(runningStitchType, Mockito.times(0)).update(anyFloat(), anyFloat()); + } + + @Test + public void testSetStartCoordinates() { + final float xCoord = 1; + final float yCoord = 2; + runningStitch.activateStitching(sprite, runningStitchType); + runningStitch.setStartCoordinates(xCoord, yCoord); + + Mockito.verify(runningStitchType, Mockito.times(1)).setStartCoordinates(xCoord, yCoord); + } + + @Test + public void testInvalidSetStartCoordinates() { + final float xCoord = 1; + final float yCoord = 2; + runningStitch.setStartCoordinates(xCoord, yCoord); + + Mockito.verify(runningStitchType, Mockito.times(0)).setStartCoordinates(anyFloat(), anyFloat()); + } +} diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/SimpleRunningStitchTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/SimpleRunningStitchTest.java new file mode 100644 index 00000000000..7835d7a44be --- /dev/null +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/SimpleRunningStitchTest.java @@ -0,0 +1,93 @@ +/* + * Catroid: An on-device visual programming system for Android devices + * Copyright (C) 2010-2019 The Catrobat Team + * () + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * An additional term exception under section 7 of the GNU Affero + * General Public License, version 3, is available at + * http://developer.catrobat.org/license_additional_term + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package org.catrobat.catroid.test.embroidery; + +import android.support.test.runner.AndroidJUnit4; + +import org.catrobat.catroid.content.Look; +import org.catrobat.catroid.content.Sprite; +import org.catrobat.catroid.embroidery.EmbroideryPatternManager; +import org.catrobat.catroid.embroidery.SimpleRunningStitch; +import org.catrobat.catroid.stage.StageActivity; +import org.catrobat.catroid.stage.StageListener; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +@RunWith(AndroidJUnit4.class) +public class SimpleRunningStitchTest { + private Sprite sprite; + private Look spriteLook; + private SimpleRunningStitch simpleRunningStitch; + private EmbroideryPatternManager embroideryPatternManager; + + @Before + public void setUp() { + sprite = Mockito.mock(Sprite.class); + spriteLook = Mockito.mock(Look.class); + sprite.look = spriteLook; + embroideryPatternManager = Mockito.mock(EmbroideryPatternManager.class); + StageActivity.stageListener = Mockito.mock(StageListener.class); + StageActivity.stageListener.embroideryPatternManager = embroideryPatternManager; + } + + @After + public void tearDown() { + StageActivity.stageListener = null; + } + + @Test + public void testNoMoveOfRunningStitch() { + final int length = 10; + simpleRunningStitch = new SimpleRunningStitch(sprite, length); + simpleRunningStitch.update(0, 0); + + verify(embroideryPatternManager, times(0)).addStitchCommand(any()); + } + + @Test + public void testSimpleMoveOfRunningStitch() { + final int length = 10; + simpleRunningStitch = new SimpleRunningStitch(sprite, length); + simpleRunningStitch.update(10, 10); + + verify(embroideryPatternManager, times(2)).addStitchCommand(any()); + } + + @Test + public void testSetStartCoordinates() { + final int length = 10; + simpleRunningStitch = new SimpleRunningStitch(sprite, length); + simpleRunningStitch.setStartCoordinates(20, 20); + simpleRunningStitch.update(0, 0); + + verify(embroideryPatternManager, times(3)).addStitchCommand(any()); + } +} diff --git a/catroid/src/main/java/org/catrobat/catroid/common/BrickValues.java b/catroid/src/main/java/org/catrobat/catroid/common/BrickValues.java index c8df2543e83..eb048a55ca8 100644 --- a/catroid/src/main/java/org/catrobat/catroid/common/BrickValues.java +++ b/catroid/src/main/java/org/catrobat/catroid/common/BrickValues.java @@ -174,6 +174,7 @@ public final class BrickValues { //Constants Embroidery public static final float STITCH_SIZE = 3.15f; + public static final int STITCH_LENGTH = 10; private BrickValues() { throw new AssertionError("No."); diff --git a/catroid/src/main/java/org/catrobat/catroid/content/ActionFactory.java b/catroid/src/main/java/org/catrobat/catroid/content/ActionFactory.java index 3df1c622a3f..24a56ca947f 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/ActionFactory.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/ActionFactory.java @@ -123,6 +123,7 @@ import org.catrobat.catroid.content.actions.RepeatAction; import org.catrobat.catroid.content.actions.RepeatUntilAction; import org.catrobat.catroid.content.actions.ReplaceItemInUserListAction; +import org.catrobat.catroid.content.actions.RunningStitchAction; import org.catrobat.catroid.content.actions.SceneStartAction; import org.catrobat.catroid.content.actions.SceneTransitionAction; import org.catrobat.catroid.content.actions.ScriptSequenceAction; @@ -857,6 +858,13 @@ public static Action createStitchAction(Sprite sprite) { return action; } + public Action createRunningStitchAction(Sprite sprite, Formula length) { + RunningStitchAction action = Actions.action(RunningStitchAction.class); + action.setSprite(sprite); + action.setLength(length); + return action; + } + public static Action eventSequence(Script script) { return new ScriptSequenceAction(script); } diff --git a/catroid/src/main/java/org/catrobat/catroid/content/Look.java b/catroid/src/main/java/org/catrobat/catroid/content/Look.java index 34bba0a9c0f..ad16a2603fe 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/Look.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/Look.java @@ -197,6 +197,7 @@ public void draw(Batch batch, float parentAlpha) { public void act(float delta) { scheduler.tick(delta); if (sprite != null) { + sprite.runningStitch.update(); sprite.evaluateConditionScriptTriggers(); } } diff --git a/catroid/src/main/java/org/catrobat/catroid/content/Sprite.java b/catroid/src/main/java/org/catrobat/catroid/content/Sprite.java index 492d6bf91a3..45b75e480ef 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/Sprite.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/Sprite.java @@ -44,6 +44,7 @@ import org.catrobat.catroid.content.bricks.PlaySoundBrick; import org.catrobat.catroid.content.bricks.WhenConditionBrick; import org.catrobat.catroid.content.eventids.EventId; +import org.catrobat.catroid.embroidery.RunningStitch; import org.catrobat.catroid.formulaeditor.Formula; import org.catrobat.catroid.formulaeditor.UserList; import org.catrobat.catroid.formulaeditor.UserVariable; @@ -74,6 +75,7 @@ public class Sprite implements Cloneable, Nameable, Serializable { public transient Look look = new Look(this); public transient PenConfiguration penConfiguration = new PenConfiguration(); + public transient RunningStitch runningStitch = new RunningStitch(); private transient boolean convertToSingleSprite = false; private transient boolean convertToGroupItemSprite = false; private transient Multimap idToEventThreadMap = LinkedHashMultimap.create(); @@ -202,12 +204,14 @@ public void resetSprite() { } penConfiguration = new PenConfiguration(); + runningStitch = new RunningStitch(); } public void invalidate() { idToEventThreadMap = null; conditionScriptTriggers = null; penConfiguration = null; + runningStitch = null; } public void initConditionScriptTriggers() { @@ -266,6 +270,7 @@ public Sprite convert() { convertedSprite.look.setLookData(look.getLookData()); convertedSprite.penConfiguration = penConfiguration; + convertedSprite.runningStitch = runningStitch; convertedSprite.lookList = lookList; convertedSprite.soundList = soundList; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/actions/RunningStitchAction.java b/catroid/src/main/java/org/catrobat/catroid/content/actions/RunningStitchAction.java new file mode 100644 index 00000000000..aefc8f79748 --- /dev/null +++ b/catroid/src/main/java/org/catrobat/catroid/content/actions/RunningStitchAction.java @@ -0,0 +1,60 @@ +/* + * Catroid: An on-device visual programming system for Android devices + * Copyright (C) 2010-2018 The Catrobat Team + * () + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * An additional term exception under section 7 of the GNU Affero + * General Public License, version 3, is available at + * http://developer.catrobat.org/license_additional_term + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package org.catrobat.catroid.content.actions; + +import android.util.Log; + +import com.badlogic.gdx.scenes.scene2d.actions.TemporalAction; + +import org.catrobat.catroid.content.Sprite; +import org.catrobat.catroid.embroidery.SimpleRunningStitch; +import org.catrobat.catroid.formulaeditor.Formula; +import org.catrobat.catroid.formulaeditor.InterpretationException; + +public class RunningStitchAction extends TemporalAction { + + private Sprite sprite; + private Formula length; + + @Override + protected void update(float delta) { + int lengthInterpretation = 0; + try { + if (length != null) { + lengthInterpretation = length.interpretInteger(sprite); + } + } catch (InterpretationException interpretationException) { + lengthInterpretation = 0; + Log.d(getClass().getSimpleName(), "Formula interpretation for this specific Brick failed.", interpretationException); + } + this.sprite.runningStitch.activateStitching(sprite, new SimpleRunningStitch(sprite, lengthInterpretation)); + } + + public void setSprite(Sprite sprite) { + this.sprite = sprite; + } + + public void setLength(Formula length) { + this.length = length; + } +} diff --git a/catroid/src/main/java/org/catrobat/catroid/content/actions/StitchAction.java b/catroid/src/main/java/org/catrobat/catroid/content/actions/StitchAction.java index 532db462036..747592617d6 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/actions/StitchAction.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/actions/StitchAction.java @@ -34,10 +34,13 @@ public class StitchAction extends TemporalAction { @Override protected void update(float delta) { + sprite.runningStitch.pause(); float x = sprite.look.getXInUserInterfaceDimensionUnit(); float y = sprite.look.getYInUserInterfaceDimensionUnit(); StageActivity.stageListener.embroideryPatternManager.addStitchCommand(new DSTStitchCommand(x, y, sprite.look.getZIndex(), sprite)); + sprite.runningStitch.setStartCoordinates(x, y); + sprite.runningStitch.resume(); } public void setSprite(Sprite sprite) { diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/Brick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/Brick.java index 733a36bcb64..99f7e65a010 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/Brick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/Brick.java @@ -72,6 +72,8 @@ enum BrickField { RASPI_DIGITAL_PIN_VALUE, RASPI_DIGITAL_PIN_NUMBER, RASPI_PWM_PERCENTAGE, RASPI_PWM_FREQUENCY, + EMBROIDERY_LENGTH, + ASSERT_EQUALS_EXPECTED, ASSERT_EQUALS_ACTUAL; public static final BrickField[] EXPECTS_STRING_VALUE = {VARIABLE, NOTE, SPEAK, STRING, ASK_QUESTION, diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/RunningStitchBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/RunningStitchBrick.java new file mode 100644 index 00000000000..84ba7bc1164 --- /dev/null +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/RunningStitchBrick.java @@ -0,0 +1,58 @@ +/* + * Catroid: An on-device visual programming system for Android devices + * Copyright (C) 2010-2018 The Catrobat Team + * () + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * An additional term exception under section 7 of the GNU Affero + * General Public License, version 3, is available at + * http://developer.catrobat.org/license_additional_term + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package org.catrobat.catroid.content.bricks; + +import org.catrobat.catroid.R; +import org.catrobat.catroid.content.Sprite; +import org.catrobat.catroid.content.actions.ScriptSequenceAction; +import org.catrobat.catroid.formulaeditor.Formula; + +public class RunningStitchBrick extends FormulaBrick { + + private static final long serialVersionUID = 1L; + + public RunningStitchBrick() { + addAllowedBrickField(BrickField.EMBROIDERY_LENGTH, R.id.brick_running_stitch_edit_text_length); + } + + public RunningStitchBrick(Formula length) { + this(); + setFormulaWithBrickField(BrickField.EMBROIDERY_LENGTH, length); + } + + @Override + public BrickField getDefaultBrickField() { + return BrickField.EMBROIDERY_LENGTH; + } + + @Override + public int getViewResource() { + return R.layout.brick_running_stitch_with_length; + } + + @Override + public void addActionToSequence(Sprite sprite, ScriptSequenceAction sequence) { + sequence.addAction(sprite.getActionFactory().createRunningStitchAction(sprite, + getFormulaWithBrickField(BrickField.EMBROIDERY_LENGTH))); + } +} diff --git a/catroid/src/main/java/org/catrobat/catroid/embroidery/RunningStitch.java b/catroid/src/main/java/org/catrobat/catroid/embroidery/RunningStitch.java new file mode 100644 index 00000000000..29eb5cdce71 --- /dev/null +++ b/catroid/src/main/java/org/catrobat/catroid/embroidery/RunningStitch.java @@ -0,0 +1,64 @@ +/* + * Catroid: An on-device visual programming system for Android devices + * Copyright (C) 2010-2019 The Catrobat Team + * () + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * An additional term exception under section 7 of the GNU Affero + * General Public License, version 3, is available at + * http://developer.catrobat.org/license_additional_term + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package org.catrobat.catroid.embroidery; + +import org.catrobat.catroid.content.Sprite; + +public class RunningStitch { + private Sprite sprite; + private boolean isRunning = false; + private RunningStitchType type; + + public void activateStitching(Sprite sprite, RunningStitchType type) { + if (sprite != null && type != null) { + this.sprite = sprite; + this.type = type; + isRunning = true; + } + } + + public void update() { + if (isRunning) { + float currentX = sprite.look.getXInUserInterfaceDimensionUnit(); + float currentY = sprite.look.getYInUserInterfaceDimensionUnit(); + type.update(currentX, currentY); + } + } + + public void setStartCoordinates(float xStart, float yStart) { + if (type != null) { + type.setStartCoordinates(xStart, yStart); + } + } + + public void pause() { + isRunning = false; + } + + public void resume() { + if (type != null) { + isRunning = true; + } + } +} diff --git a/catroid/src/main/java/org/catrobat/catroid/embroidery/RunningStitchType.java b/catroid/src/main/java/org/catrobat/catroid/embroidery/RunningStitchType.java new file mode 100644 index 00000000000..9b469386eb5 --- /dev/null +++ b/catroid/src/main/java/org/catrobat/catroid/embroidery/RunningStitchType.java @@ -0,0 +1,29 @@ +/* + * Catroid: An on-device visual programming system for Android devices + * Copyright (C) 2010-2019 The Catrobat Team + * () + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * An additional term exception under section 7 of the GNU Affero + * General Public License, version 3, is available at + * http://developer.catrobat.org/license_additional_term + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package org.catrobat.catroid.embroidery; + +public interface RunningStitchType { + void setStartCoordinates(float x, float y); + void update(float currentX, float currentY); +} diff --git a/catroid/src/main/java/org/catrobat/catroid/embroidery/SimpleRunningStitch.java b/catroid/src/main/java/org/catrobat/catroid/embroidery/SimpleRunningStitch.java new file mode 100644 index 00000000000..88e8b9e5b42 --- /dev/null +++ b/catroid/src/main/java/org/catrobat/catroid/embroidery/SimpleRunningStitch.java @@ -0,0 +1,92 @@ +/* + * Catroid: An on-device visual programming system for Android devices + * Copyright (C) 2010-2019 The Catrobat Team + * () + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * An additional term exception under section 7 of the GNU Affero + * General Public License, version 3, is available at + * http://developer.catrobat.org/license_additional_term + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package org.catrobat.catroid.embroidery; + +import org.catrobat.catroid.content.Sprite; +import org.catrobat.catroid.stage.StageActivity; + +public class SimpleRunningStitch implements RunningStitchType { + private Sprite sprite; + private int length; + private boolean first; + private float firstX = 0; + private float firstY = 0; + + public SimpleRunningStitch(Sprite sprite, int length) { + this.sprite = sprite; + this.length = length; + first = true; + setStartCoordinates(sprite.look.getXInUserInterfaceDimensionUnit(), + sprite.look.getYInUserInterfaceDimensionUnit()); + } + + @Override + public void setStartCoordinates(float x, float y) { + this.firstX = x; + this.firstY = y; + } + + @Override + public void update(float currentX, float currentY) { + float distance = getDistanceToPoint(currentX, currentY); + if (distance >= length) { + float surplusPercentage = ((distance - (distance % length)) / distance); + currentX = firstX + (surplusPercentage * (currentX - firstX)); + currentY = firstY + (surplusPercentage * (currentY - firstY)); + distance -= distance % length; + + int interpolationCount = (int) (Math.floor(distance / length)); + interpolateStitches(interpolationCount, currentX, currentY); + setStartCoordinates(currentX, currentY); + } + } + + private void interpolateStitches(int interpolationCount, float currentX, float currentY) { + if (first) { + first = false; + StageActivity.stageListener.embroideryPatternManager.addStitchCommand(new DSTStitchCommand(firstX, firstY, + sprite.look.getZIndex(), sprite)); + } + + for (int count = 1; count <= interpolationCount; count++) { + float splitFactor = (float) count / interpolationCount; + float x = interpolate(currentX, firstX, splitFactor); + float y = interpolate(currentY, firstY, splitFactor); + StageActivity.stageListener.embroideryPatternManager.addStitchCommand(new DSTStitchCommand(x, y, + sprite.look.getZIndex(), sprite)); + } + } + + private float interpolate(float endValue, float startValue, float percentage) { + float value = Math.round(startValue + percentage * (endValue - startValue)); + return value; + } + + private float getDistanceToPoint(float currentX, float currentY) { + double xDistance = Math.pow(currentX - firstX, 2); + double yDistance = Math.pow(currentY - firstY, 2); + double difference = Math.sqrt(xDistance + yDistance); + return (float) difference; + } +} diff --git a/catroid/src/main/java/org/catrobat/catroid/io/XstreamSerializer.java b/catroid/src/main/java/org/catrobat/catroid/io/XstreamSerializer.java index 5e01728676e..80a0578fcdb 100644 --- a/catroid/src/main/java/org/catrobat/catroid/io/XstreamSerializer.java +++ b/catroid/src/main/java/org/catrobat/catroid/io/XstreamSerializer.java @@ -164,6 +164,7 @@ import org.catrobat.catroid.content.bricks.RepeatBrick; import org.catrobat.catroid.content.bricks.RepeatUntilBrick; import org.catrobat.catroid.content.bricks.ReplaceItemInUserListBrick; +import org.catrobat.catroid.content.bricks.RunningStitchBrick; import org.catrobat.catroid.content.bricks.SayBubbleBrick; import org.catrobat.catroid.content.bricks.SayForBubbleBrick; import org.catrobat.catroid.content.bricks.SceneStartBrick; @@ -509,6 +510,7 @@ private void prepareXstream(Class projectClass, Class sceneClass) { xstream.alias("brick", SetTextBrick.class); xstream.alias("brick", ShowTextColorSizeAlignmentBrick.class); xstream.alias("brick", StitchBrick.class); + xstream.alias("brick", RunningStitchBrick.class); xstream.alias("brick", WaitTillIdleBrick.class); xstream.alias("brick", WhenRaspiPinChangedBrick.class); xstream.alias("brick", WhenTouchDownBrick.class); diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/CategoryBricksFactory.java b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/CategoryBricksFactory.java index 7021e44a010..11f75c69900 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/CategoryBricksFactory.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/CategoryBricksFactory.java @@ -137,6 +137,7 @@ import org.catrobat.catroid.content.bricks.RepeatBrick; import org.catrobat.catroid.content.bricks.RepeatUntilBrick; import org.catrobat.catroid.content.bricks.ReplaceItemInUserListBrick; +import org.catrobat.catroid.content.bricks.RunningStitchBrick; import org.catrobat.catroid.content.bricks.SayBubbleBrick; import org.catrobat.catroid.content.bricks.SayForBubbleBrick; import org.catrobat.catroid.content.bricks.SceneStartBrick; @@ -646,6 +647,7 @@ private List setupRaspiCategoryList() { private List setupEmbroideryCategoryList() { List embroideryBrickList = new ArrayList<>(); embroideryBrickList.add(new StitchBrick()); + embroideryBrickList.add(new RunningStitchBrick(new Formula(BrickValues.STITCH_LENGTH))); return embroideryBrickList; } diff --git a/catroid/src/main/res/layout/brick_running_stitch_with_length.xml b/catroid/src/main/res/layout/brick_running_stitch_with_length.xml new file mode 100644 index 00000000000..d8968273f22 --- /dev/null +++ b/catroid/src/main/res/layout/brick_running_stitch_with_length.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/catroid/src/main/res/values/strings.xml b/catroid/src/main/res/values/strings.xml index bcc1d93c25b..81601ceeb60 100644 --- a/catroid/src/main/res/values/strings.xml +++ b/catroid/src/main/res/values/strings.xml @@ -1172,6 +1172,7 @@ Stitch + Start running stitch with length From 5e7558b85b956a2882aef77d71122b86e14657cf Mon Sep 17 00:00:00 2001 From: Thomas Hirsch <84n4n4@gmail.com> Date: Wed, 29 Jan 2020 12:30:57 +0100 Subject: [PATCH 05/16] CATROID-449 move end2end tests against share to nightly runs --- Jenkinsfile | 2 +- Jenkinsfile.OutgoingNetworkCallsTests | 52 +++++++++++++++++++ ...nTests.java => DroneBricksActionTest.java} | 4 +- ...ernTokenFunctionWithOneParameterTest.java} | 2 +- ...rnTokenFunctionWithTwoParametersTest.java} | 2 +- .../ScratchServerCallsTest.java | 3 ++ .../testsuites/LocalHeadlessTestSuite.java | 36 +++++++++++++ 7 files changed, 96 insertions(+), 5 deletions(-) create mode 100644 Jenkinsfile.OutgoingNetworkCallsTests rename catroid/src/androidTest/java/org/catrobat/catroid/test/drone/{DroneBricksActionTests.java => DroneBricksActionTest.java} (98%) rename catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/{SelectInternTokenTestFunctionWithOneParameter.java => SelectInternTokenFunctionWithOneParameterTest.java} (98%) rename catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/{SelectInternTokenTestFunctionWithTwoParameters.java => SelectInternTokenFunctionWithTwoParametersTest.java} (99%) create mode 100644 catroid/src/androidTest/java/org/catrobat/catroid/testsuites/LocalHeadlessTestSuite.java diff --git a/Jenkinsfile b/Jenkinsfile index 9bfc8db600e..5bfc9d58828 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -151,7 +151,7 @@ pipeline { catchError(buildResult: 'FAILURE' ,stageResult: 'FAILURE') { sh '''./gradlew -PenableCoverage -PlogcatFile=instrumented_unit_logcat.txt -Pemulator=android28 \ startEmulator createCatroidDebugAndroidTestCoverageReport \ - -Pandroid.testInstrumentationRunnerArguments.package=org.catrobat.catroid.test''' + -Pandroid.testInstrumentationRunnerArguments.class=org.catrobat.catroid.testsuites.LocalHeadlessTestSuite''' } } diff --git a/Jenkinsfile.OutgoingNetworkCallsTests b/Jenkinsfile.OutgoingNetworkCallsTests new file mode 100644 index 00000000000..2db180e2f5f --- /dev/null +++ b/Jenkinsfile.OutgoingNetworkCallsTests @@ -0,0 +1,52 @@ +#!groovy + +pipeline { + agent { + dockerfile { + filename 'Dockerfile.jenkins' + // 'docker build' would normally copy the whole build-dir to the container, changing the + // docker build directory avoids that overhead + dir 'docker' + // Pass the uid and the gid of the current user (jenkins-user) to the Dockerfile, so a + // corresponding user can be added. This is needed to provide the jenkins user inside + // the container for the ssh-agent to work. + // Another way would be to simply map the passwd file, but would spoil additional information + // Also hand in the group id of kvm to allow using /dev/kvm. + additionalBuildArgs '--build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) --build-arg KVM_GROUP_ID=$(getent group kvm | cut -d: -f3)' + args '--device /dev/kvm:/dev/kvm -v /var/local/container_shared/gradle_cache/$EXECUTOR_NUMBER:/home/user/.gradle -m=6.5G' + label 'LimitedEmulator' + } + } + + options { + timeout(time: 2, unit: 'HOURS') + timestamps() + } + + stages { + stage('End to end tests requiring share authentication') { + steps { + sh '''./gradlew -PenableCoverage -Pemulator=android28 \ + startEmulator createCatroidDebugAndroidTestCoverageReport \ + -Pandroid.testInstrumentationRunnerArguments.class=org.catrobat.catroid.testsuites.OutgoingNetworkCallsTestSuite''' + } + post { + always { + junit '**/*TEST*.xml' + + sh './gradlew stopEmulator clearAvdStore' + archiveArtifacts 'logcat.txt' + } + } + } + } + + post { + always { + step([$class: 'LogParserPublisher', failBuildOnError: true, projectRulePath: 'buildScripts/log_parser_rules', unstableOnWarning: true, useProjectRule: true]) + } + unsuccessful { + notifyChat(['#s2cc', '#catroweb-deployment']) + } + } +} diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/drone/DroneBricksActionTests.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/drone/DroneBricksActionTest.java similarity index 98% rename from catroid/src/androidTest/java/org/catrobat/catroid/test/drone/DroneBricksActionTests.java rename to catroid/src/androidTest/java/org/catrobat/catroid/test/drone/DroneBricksActionTest.java index 31026efdb6b..13144084d58 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/drone/DroneBricksActionTests.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/drone/DroneBricksActionTest.java @@ -55,7 +55,7 @@ import static org.mockito.Mockito.when; @RunWith(AndroidJUnit4.class) -public class DroneBricksActionTests { +public class DroneBricksActionTest { private DroneControlService droneControlService; private DroneConfig droneConfig; @@ -66,7 +66,7 @@ public class DroneBricksActionTests { private int powerInPercent; private int durationInSeconds; - public DroneBricksActionTests() { + public DroneBricksActionTest() { powerInPercent = 20; durationInSeconds = 2; } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/SelectInternTokenTestFunctionWithOneParameter.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/SelectInternTokenFunctionWithOneParameterTest.java similarity index 98% rename from catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/SelectInternTokenTestFunctionWithOneParameter.java rename to catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/SelectInternTokenFunctionWithOneParameterTest.java index db1cd02884e..7e38daec0d5 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/SelectInternTokenTestFunctionWithOneParameter.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/SelectInternTokenFunctionWithOneParameterTest.java @@ -43,7 +43,7 @@ import static org.catrobat.catroid.formulaeditor.InternTokenType.FUNCTION_NAME; @RunWith(Parameterized.class) -public class SelectInternTokenTestFunctionWithOneParameter { +public class SelectInternTokenFunctionWithOneParameterTest { @Parameterized.Parameters(name = "{0}") public static Iterable data() { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/SelectInternTokenTestFunctionWithTwoParameters.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/SelectInternTokenFunctionWithTwoParametersTest.java similarity index 99% rename from catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/SelectInternTokenTestFunctionWithTwoParameters.java rename to catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/SelectInternTokenFunctionWithTwoParametersTest.java index 8edbf32fa2a..3291580ec62 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/SelectInternTokenTestFunctionWithTwoParameters.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/SelectInternTokenFunctionWithTwoParametersTest.java @@ -43,7 +43,7 @@ import static org.catrobat.catroid.formulaeditor.InternTokenType.FUNCTION_NAME; @RunWith(Parameterized.class) -public class SelectInternTokenTestFunctionWithTwoParameters { +public class SelectInternTokenFunctionWithTwoParametersTest { @Parameterized.Parameters(name = "{0}") public static Iterable data() { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/ScratchServerCallsTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/ScratchServerCallsTest.java index 74cb253b059..1820450adce 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/ScratchServerCallsTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/ScratchServerCallsTest.java @@ -27,6 +27,7 @@ import org.catrobat.catroid.common.Constants; import org.catrobat.catroid.common.ScratchProgramData; import org.catrobat.catroid.common.ScratchSearchResult; +import org.catrobat.catroid.testsuites.annotations.Cat; import org.catrobat.catroid.web.CatrobatWebClient; import org.catrobat.catroid.web.ServerCalls; import org.catrobat.catroid.web.WebScratchProgramException; @@ -34,6 +35,7 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import java.io.InterruptedIOException; @@ -51,6 +53,7 @@ import static org.hamcrest.Matchers.not; import static org.junit.Assert.assertThat; +@Category(Cat.OutgoingNetworkTests.class) @RunWith(AndroidJUnit4.class) public class ScratchServerCallsTest { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/testsuites/LocalHeadlessTestSuite.java b/catroid/src/androidTest/java/org/catrobat/catroid/testsuites/LocalHeadlessTestSuite.java new file mode 100644 index 00000000000..d3f3fcbfc99 --- /dev/null +++ b/catroid/src/androidTest/java/org/catrobat/catroid/testsuites/LocalHeadlessTestSuite.java @@ -0,0 +1,36 @@ +/* + * Catroid: An on-device visual programming system for Android devices + * Copyright (C) 2010-2018 The Catrobat Team + * () + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * An additional term exception under section 7 of the GNU Affero + * General Public License, version 3, is available at + * http://developer.catrobat.org/license_additional_term + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package org.catrobat.catroid.testsuites; + +import org.catrobat.catroid.testsuites.annotations.Cat; +import org.junit.experimental.categories.Categories; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +@RunWith(Categories.class) +@Categories.ExcludeCategory({Cat.OutgoingNetworkTests.class}) + +@Suite.SuiteClasses(AllHeadlessTestsSuite.class) +public class LocalHeadlessTestSuite { +} From 5448bb036f90d4f713591d73b04cc78e85efacbc Mon Sep 17 00:00:00 2001 From: Michelle Perkonigg Date: Sat, 2 Nov 2019 15:01:58 +0100 Subject: [PATCH 06/16] CATROID-395 Stop current stitch --- .../catroid/test/BricksHelpUrlTest.java | 2 + .../content/bricks/BrickCategoryTest.java | 4 +- .../test/embroidery/RunningStitchTest.java | 15 +++++ .../catroid/content/ActionFactory.java | 7 +++ .../actions/StopRunningStitchAction.java | 41 ++++++++++++++ .../bricks/StopRunningStitchBrick.java | 43 ++++++++++++++ .../catroid/embroidery/RunningStitch.java | 6 ++ .../catroid/io/XstreamSerializer.java | 2 + .../ui/fragment/CategoryBricksFactory.java | 2 + .../res/layout/brick_stop_running_stitch.xml | 56 +++++++++++++++++++ catroid/src/main/res/values/strings.xml | 1 + 11 files changed, 178 insertions(+), 1 deletion(-) create mode 100644 catroid/src/main/java/org/catrobat/catroid/content/actions/StopRunningStitchAction.java create mode 100644 catroid/src/main/java/org/catrobat/catroid/content/bricks/StopRunningStitchBrick.java create mode 100644 catroid/src/main/res/layout/brick_stop_running_stitch.xml diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/BricksHelpUrlTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/BricksHelpUrlTest.java index 734278d4e9b..d0163ed9691 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/BricksHelpUrlTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/BricksHelpUrlTest.java @@ -380,6 +380,8 @@ public class BricksHelpUrlTest { "https://wiki.catrobat.org/bin/view/Documentation/Brick%20Documentation/Data%20Bricks/#ShowTextColorSizeAlignmentBrick"); brickToHelpUrlMapping.put("org.catrobat.catroid.content.bricks.RunningStitchBrick", "https://wiki.catrobat.org/bin/view/Documentation/Brick%20Documentation/Embroidery%20Bricks/#RunningStitchBrick"); + brickToHelpUrlMapping.put("org.catrobat.catroid.content.bricks.StopRunningStitchBrick", + "https://wiki.catrobat.org/bin/view/Documentation/Brick%20Documentation/Embroidery%20Bricks/#StopRunningStitchBrick"); } @Parameterized.Parameters(name = "{0}") diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickCategoryTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickCategoryTest.java index 772a9d33e9d..ec383e5e73c 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickCategoryTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickCategoryTest.java @@ -164,6 +164,7 @@ import org.catrobat.catroid.content.bricks.StampBrick; import org.catrobat.catroid.content.bricks.StitchBrick; import org.catrobat.catroid.content.bricks.StopAllSoundsBrick; +import org.catrobat.catroid.content.bricks.StopRunningStitchBrick; import org.catrobat.catroid.content.bricks.StopScriptBrick; import org.catrobat.catroid.content.bricks.TapAtBrick; import org.catrobat.catroid.content.bricks.ThinkBubbleBrick; @@ -234,7 +235,8 @@ public static Collection data() { SetBounceBrick.class, SetFrictionBrick.class)}, {"Embroidery", Arrays.asList(StitchBrick.class, - RunningStitchBrick.class)}, + RunningStitchBrick.class, + StopRunningStitchBrick.class)}, {"Event", Arrays.asList(WhenStartedBrick.class, WhenBrick.class, WhenTouchDownBrick.class, diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/RunningStitchTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/RunningStitchTest.java index 6ac5c869e84..39ca1400983 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/RunningStitchTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/RunningStitchTest.java @@ -130,4 +130,19 @@ public void testInvalidSetStartCoordinates() { Mockito.verify(runningStitchType, Mockito.times(0)).setStartCoordinates(anyFloat(), anyFloat()); } + + @Test + public void testDeactivateRunningStitch() { + runningStitch.activateStitching(sprite, runningStitchType); + runningStitch.deactivate(); + final float xCoord = 1; + final float yCoord = 2; + runningStitch.setStartCoordinates(xCoord, yCoord); + runningStitch.update(); + + Mockito.verify(runningStitchType, Mockito.times(0)).setStartCoordinates(xCoord, yCoord); + Mockito.verify(spriteLook, Mockito.times(0)).getXInUserInterfaceDimensionUnit(); + Mockito.verify(spriteLook, Mockito.times(0)).getYInUserInterfaceDimensionUnit(); + Mockito.verify(runningStitchType, Mockito.times(0)).update(anyFloat(), anyFloat()); + } } diff --git a/catroid/src/main/java/org/catrobat/catroid/content/ActionFactory.java b/catroid/src/main/java/org/catrobat/catroid/content/ActionFactory.java index 24a56ca947f..2bb9d9b343f 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/ActionFactory.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/ActionFactory.java @@ -153,6 +153,7 @@ import org.catrobat.catroid.content.actions.StopAllScriptsAction; import org.catrobat.catroid.content.actions.StopAllSoundsAction; import org.catrobat.catroid.content.actions.StopOtherScriptsAction; +import org.catrobat.catroid.content.actions.StopRunningStitchAction; import org.catrobat.catroid.content.actions.StopThisScriptAction; import org.catrobat.catroid.content.actions.TapAtAction; import org.catrobat.catroid.content.actions.ThinkSayBubbleAction; @@ -865,6 +866,12 @@ public Action createRunningStitchAction(Sprite sprite, Formula length) { return action; } + public static Action createStopRunningStitchAction(Sprite sprite) { + StopRunningStitchAction action = Actions.action(StopRunningStitchAction.class); + action.setSprite(sprite); + return action; + } + public static Action eventSequence(Script script) { return new ScriptSequenceAction(script); } diff --git a/catroid/src/main/java/org/catrobat/catroid/content/actions/StopRunningStitchAction.java b/catroid/src/main/java/org/catrobat/catroid/content/actions/StopRunningStitchAction.java new file mode 100644 index 00000000000..5d16a8bf174 --- /dev/null +++ b/catroid/src/main/java/org/catrobat/catroid/content/actions/StopRunningStitchAction.java @@ -0,0 +1,41 @@ +/* + * Catroid: An on-device visual programming system for Android devices + * Copyright (C) 2010-2018 The Catrobat Team + * () + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * An additional term exception under section 7 of the GNU Affero + * General Public License, version 3, is available at + * http://developer.catrobat.org/license_additional_term + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package org.catrobat.catroid.content.actions; + +import com.badlogic.gdx.scenes.scene2d.actions.TemporalAction; + +import org.catrobat.catroid.content.Sprite; + +public class StopRunningStitchAction extends TemporalAction { + + private Sprite sprite; + + @Override + protected void update(float delta) { + sprite.runningStitch.deactivate(); + } + + public void setSprite(Sprite sprite) { + this.sprite = sprite; + } +} diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/StopRunningStitchBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/StopRunningStitchBrick.java new file mode 100644 index 00000000000..2d50d72c62a --- /dev/null +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/StopRunningStitchBrick.java @@ -0,0 +1,43 @@ +/* + * Catroid: An on-device visual programming system for Android devices + * Copyright (C) 2010-2018 The Catrobat Team + * () +* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * An additional term exception under section 7 of the GNU Affero + * General Public License, version 3, is available at + * http://developer.catrobat.org/license_additional_term + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package org.catrobat.catroid.content.bricks; + +import org.catrobat.catroid.R; +import org.catrobat.catroid.content.ActionFactory; +import org.catrobat.catroid.content.Sprite; +import org.catrobat.catroid.content.actions.ScriptSequenceAction; + +public class StopRunningStitchBrick extends BrickBaseType { + + private static final long serialVersionUID = 1L; + + @Override + public int getViewResource() { + return R.layout.brick_stop_running_stitch; + } + + @Override + public void addActionToSequence(Sprite sprite, ScriptSequenceAction sequence) { + sequence.addAction(ActionFactory.createStopRunningStitchAction(sprite)); + } +} diff --git a/catroid/src/main/java/org/catrobat/catroid/embroidery/RunningStitch.java b/catroid/src/main/java/org/catrobat/catroid/embroidery/RunningStitch.java index 29eb5cdce71..3431d5baacf 100644 --- a/catroid/src/main/java/org/catrobat/catroid/embroidery/RunningStitch.java +++ b/catroid/src/main/java/org/catrobat/catroid/embroidery/RunningStitch.java @@ -61,4 +61,10 @@ public void resume() { isRunning = true; } } + + public void deactivate() { + isRunning = false; + type = null; + sprite = null; + } } diff --git a/catroid/src/main/java/org/catrobat/catroid/io/XstreamSerializer.java b/catroid/src/main/java/org/catrobat/catroid/io/XstreamSerializer.java index 80a0578fcdb..ee4813d15b4 100644 --- a/catroid/src/main/java/org/catrobat/catroid/io/XstreamSerializer.java +++ b/catroid/src/main/java/org/catrobat/catroid/io/XstreamSerializer.java @@ -202,6 +202,7 @@ import org.catrobat.catroid.content.bricks.StampBrick; import org.catrobat.catroid.content.bricks.StitchBrick; import org.catrobat.catroid.content.bricks.StopAllSoundsBrick; +import org.catrobat.catroid.content.bricks.StopRunningStitchBrick; import org.catrobat.catroid.content.bricks.StopScriptBrick; import org.catrobat.catroid.content.bricks.TapAtBrick; import org.catrobat.catroid.content.bricks.ThinkBubbleBrick; @@ -510,6 +511,7 @@ private void prepareXstream(Class projectClass, Class sceneClass) { xstream.alias("brick", SetTextBrick.class); xstream.alias("brick", ShowTextColorSizeAlignmentBrick.class); xstream.alias("brick", StitchBrick.class); + xstream.alias("brick", StopRunningStitchBrick.class); xstream.alias("brick", RunningStitchBrick.class); xstream.alias("brick", WaitTillIdleBrick.class); xstream.alias("brick", WhenRaspiPinChangedBrick.class); diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/CategoryBricksFactory.java b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/CategoryBricksFactory.java index 11f75c69900..a44c69540b9 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/CategoryBricksFactory.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/CategoryBricksFactory.java @@ -174,6 +174,7 @@ import org.catrobat.catroid.content.bricks.StampBrick; import org.catrobat.catroid.content.bricks.StitchBrick; import org.catrobat.catroid.content.bricks.StopAllSoundsBrick; +import org.catrobat.catroid.content.bricks.StopRunningStitchBrick; import org.catrobat.catroid.content.bricks.StopScriptBrick; import org.catrobat.catroid.content.bricks.TapAtBrick; import org.catrobat.catroid.content.bricks.ThinkBubbleBrick; @@ -648,6 +649,7 @@ private List setupEmbroideryCategoryList() { List embroideryBrickList = new ArrayList<>(); embroideryBrickList.add(new StitchBrick()); embroideryBrickList.add(new RunningStitchBrick(new Formula(BrickValues.STITCH_LENGTH))); + embroideryBrickList.add(new StopRunningStitchBrick()); return embroideryBrickList; } diff --git a/catroid/src/main/res/layout/brick_stop_running_stitch.xml b/catroid/src/main/res/layout/brick_stop_running_stitch.xml new file mode 100644 index 00000000000..aecfff02b13 --- /dev/null +++ b/catroid/src/main/res/layout/brick_stop_running_stitch.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/catroid/src/main/res/values/strings.xml b/catroid/src/main/res/values/strings.xml index 81601ceeb60..fa4ed03aae8 100644 --- a/catroid/src/main/res/values/strings.xml +++ b/catroid/src/main/res/values/strings.xml @@ -1173,6 +1173,7 @@ Stitch Start running stitch with length + Stop current stitch From 5ff73e85b48dbb47973e51240f36919888eed07a Mon Sep 17 00:00:00 2001 From: Stefan Simon Date: Wed, 1 Jan 2020 07:11:22 +0100 Subject: [PATCH 07/16] AndroidX - automatic conversion --- catroid/build.gradle | 26 ++++++++-------- .../CatrobatTestRunner.java | 10 ++++++- .../CatrobatTestRunnerTest.java | 2 +- .../bluetooth/ConnectionDataLogger.java | 2 +- .../catroid/runner/UiTestApplicationRunner.kt | 2 +- .../catroid/ScreenshotsForAppStore.java | 30 +++++++++---------- .../lunaandcat/ScreenshotsForAppStore.java | 22 +++++++------- .../catroid/test/ProjectManagerTest.java | 2 +- .../common/DefaultProjectHandlerTest.java | 2 +- .../catroid/test/common/LookDataTest.java | 2 +- .../test/common/ServiceProviderTest.java | 2 +- .../actions/GoToTouchPositionActionTest.java | 2 +- .../content/actions/PlaySoundActionTest.java | 2 +- .../content/actions/SetNfcTagActionTest.java | 2 +- .../actions/SetRotationStyleActionTest.java | 2 +- .../content/actions/StitchActionTest.java | 2 +- .../actions/StopAllSoundsActionTest.java | 2 +- .../controller/LookControllerTest.java | 2 +- .../controller/SceneControllerTest.java | 2 +- .../controller/SoundControllerTest.java | 2 +- .../controller/SpriteControllerTest.java | 2 +- .../MessageContainerSaveStateTest.java | 2 +- .../MessageContainerTest.java | 2 +- .../test/content/script/WhenScriptTest.java | 2 +- .../script/WhenTouchDownScriptTest.java | 2 +- .../catroid/test/content/sprite/LookTest.java | 2 +- .../test/content/sprite/SpriteTest.java | 2 +- .../test/devices/arduino/ArduinoImplTest.java | 2 +- .../devices/arduino/ArduinoSettingsTest.java | 2 +- .../mindstorms/ev3/LegoEV3ImplTest.java | 2 +- .../mindstorms/ev3/LegoEV3MotorTest.java | 2 +- .../mindstorms/ev3/LegoEV3SensorTest.java | 2 +- .../mindstorms/nxt/LegoNXTImplTest.java | 2 +- .../nxt/MindstormsConnectionTest.java | 2 +- .../devices/mindstorms/nxt/MotorTest.java | 2 +- .../nxt/NXTI2CUltraSonicSensorTest.java | 2 +- .../test/devices/phiro/PhiroImplTest.java | 2 +- .../test/devices/phiro/PhiroSettingsTest.java | 2 +- .../test/drone/DroneBricksActionTest.java | 2 +- .../catroid/test/drone/DroneDemoTest.java | 2 +- .../test/embroidery/DSTFileConstantsTest.java | 2 +- .../test/embroidery/DSTFileGeneratorTest.java | 2 +- .../test/embroidery/DSTHeaderTest.java | 2 +- .../embroidery/DSTPatternManagerTest.java | 2 +- .../test/embroidery/DSTStitchCommandTest.java | 2 +- .../test/embroidery/DSTStitchPointTest.java | 2 +- .../test/embroidery/DSTStreamTest.java | 2 +- .../test/embroidery/DSTWorkSpaceTest.java | 2 +- .../EmbroideryFileExporterTest.java | 4 +-- .../FaceDetectionHandlerTest.java | 2 +- .../test/facedetection/FaceDetectorTest.java | 2 +- .../facedetection/IcsFaceDetectorTest.java | 4 +-- .../SlowFaceDetectorCameraTest.java | 4 +-- .../facedetection/SlowFaceDetectorTest.java | 4 +-- .../test/formulaeditor/InternFormulaTest.java | 2 +- .../InternTokenInsertTokenTest.java | 2 +- .../test/formulaeditor/ParserTestSensors.java | 6 ++-- .../test/io/CatroidFieldKeySorterTest.java | 2 +- .../DefaultChromeCastProgramLoadingTest.java | 2 +- .../io/DefaultDroneProgramLoadingTest.java | 2 +- .../DefaultJumpingSumoProgramLoadingTest.java | 2 +- .../catroid/test/io/ResourceImporterTest.java | 2 +- .../catroid/test/io/SoundManagerTest.java | 2 +- .../catroid/test/io/StageAudioFocusTest.java | 2 +- .../test/io/XstreamSerializerTest.java | 2 +- .../asynctask/InvalidProjectSaveTaskTest.java | 2 +- .../io/asynctask/ProjectExportTaskTest.java | 4 +-- .../io/asynctask/ProjectRenameTaskTest.java | 2 +- .../ProjectUnzipAndImportTaskTest.java | 2 +- ...eviceUserListAccessorCleanRoutineTest.java | 2 +- .../DeviceUserListAccessorNullValueTest.java | 2 +- ...eviceVariableAccessorCleanRoutineTest.java | 2 +- .../DeviceVariableAccessorNullValueTest.java | 2 +- .../io/filepicker/ListProjectFilesTest.java | 2 +- .../UnzipProjectFromAssetsTest.java | 2 +- .../test/io/ziparchiver/ZipFolderTest.java | 2 +- .../io/ziparchiver/ZipSingleFileTest.java | 2 +- .../physics/PhysicsActiveStageAreaTest.java | 2 +- .../test/physics/PhysicsBoundaryBoxTest.java | 2 +- .../physics/PhysicsCollisionBetweenTest.java | 2 +- .../physics/PhysicsObjectCollisionTest.java | 2 +- .../test/physics/PhysicsObjectTest.java | 2 +- .../test/physics/PhysicsShapeBuilderTest.java | 2 +- .../physics/PhysicsShapeScaleUtilsTest.java | 2 +- .../test/physics/PhysicsSpriteCloneTest.java | 2 +- .../test/physics/PhysicsWorldTest.java | 2 +- .../IfOnEdgeBouncePhysicsActionTest.java | 2 +- .../actions/PhysicsObjectStateTest.java | 2 +- .../actions/SetBounceFactorActionTest.java | 2 +- .../actions/SetFrictionActionTest.java | 2 +- .../physics/actions/SetGravityActionTest.java | 2 +- .../physics/actions/SetLookActionTest.java | 2 +- .../physics/actions/SetMassActionTest.java | 2 +- .../SetPhysicsObjectTypeActionTest.java | 2 +- .../physics/actions/SetSizeToActionTest.java | 2 +- .../actions/SetVelocityActionTest.java | 2 +- .../actions/TurnLeftRightSpeedActionTest.java | 2 +- .../actions/TurnLeftSpeedActionTest.java | 2 +- .../actions/TurnRightSpeedActionTest.java | 2 +- .../HideActionAndCollisionTest.java | 2 +- .../CollisionDetectionAdvancedTest.java | 2 +- ...CollisionDetectionPolygonCreationTest.java | 2 +- .../CollisionFormulaConversionTest.java | 2 +- .../collision/CollisionInformationTest.java | 2 +- .../physics/look/PhysicsLookDataTest.java | 2 +- .../look/PhysicsLookPositionAndAngleTest.java | 2 +- .../note/midi/MidiToProjectConverterTest.java | 4 +-- .../note/midi/ProjectToMidiConverterTest.java | 4 +-- .../ScratchServerCallsTest.java | 2 +- .../scratchconverter/WebSocketClientTest.java | 2 +- .../JobHandlerSuccessfulOnJobMessageTest.java | 2 +- .../WebSocketMessageListenerTest.java | 2 +- ...ollisionInformationBubblePositionTest.java | 4 +-- .../catroid/test/sensing/TouchesEdgeTest.java | 2 +- .../test/sensing/TouchesFingerTest.java | 2 +- .../catroid/test/stage/DrawAxesTest.java | 2 +- .../test/stage/InvalidSaveScreenshotTest.java | 2 +- .../test/ui/BaseExceptionHandlerTest.java | 2 +- .../test/ui/RequiresPermissionTaskTest.java | 2 +- .../DefaultProjectComparatorTest.java | 2 +- .../test/utiltests/ImageEditingTest.java | 2 +- .../test/utiltests/MD5ChecksumTest.java | 2 +- .../utiltests/reflection/ReflectionTest.java | 2 +- .../test/web/AuthenticationCallsTest.java | 2 +- .../uiespresso/annotations/FlakyTestTest.java | 2 +- .../app/BroadcastBrickMessageUpdateTest.java | 2 +- .../content/brick/app/ChangeVariableTest.java | 14 ++++----- .../app/DeleteItemOfUserListBrickTest.java | 14 ++++----- .../brick/app/InsertItemToUserListTest.java | 8 ++--- .../brick/app/PhiroColorBrickFormulaTest.java | 8 ++--- .../brick/app/PhiroColorBrickNumberTest.java | 12 ++++---- .../content/brick/app/PlaceAtBrickTest.java | 16 +++++----- .../brick/app/PlaySoundAndWaitBrickTest.java | 30 +++++++++---------- .../content/brick/app/PlaySoundBrickTest.java | 26 ++++++++-------- .../brick/app/PointToBrickAdditionalTest.java | 28 ++++++++--------- .../brick/app/ReplaceItemInUserListTest.java | 16 +++++----- .../content/brick/app/SceneBricksTest.java | 8 ++--- .../brick/app/SetBackgroundBrickTest.java | 18 +++++------ .../content/brick/app/SetLookBrickTest.java | 18 +++++------ .../app/SetPenColorBrickFormulaTest.java | 8 ++--- .../brick/app/SetPenColorBrickNumberTest.java | 12 ++++---- .../brick/app/SetVariableBrickTest.java | 24 +++++++-------- .../ShowTextColorSizeAlignmentBrickTest.java | 12 ++++---- .../content/brick/app/VariableBrickTest.java | 10 +++---- .../content/brick/rtl/RtlBrickTest.java | 16 +++++----- .../brick/stage/AskBrickStageTest.java | 14 ++++----- .../brick/stage/CameraResourceTest.java | 14 ++++----- .../brick/stage/FlashBrickStageTest.java | 8 ++--- .../stage/InsertItemToUserListStageTest.java | 6 ++-- .../brick/stage/PlaySoundBrickStageTest.java | 8 ++--- .../brick/stage/SayBubbleBrickStageTest.java | 2 +- .../stage/SayForBubbleBrickStageTest.java | 8 ++--- .../stage/SceneTransitionBrickStageTest.java | 2 +- ...eneTransitionTouchEventRegressionTest.java | 8 ++--- .../stage/ThinkBubbleBrickStageTest.java | 2 +- .../stage/ThinkForBubbleBrickStageTest.java | 8 ++--- .../brick/stage/VibrationBrickStageTest.java | 6 ++-- .../stage/WhenNfcBrickHardwareStageTest.java | 8 ++--- .../WhenNfcBrickStageFromScriptTest.java | 12 ++++---- .../brick/utils/BrickCoordinatesProvider.java | 2 +- .../utils/BrickDataInteractionWrapper.java | 26 ++++++++-------- ...FormulaEditTextDataInteractionWrapper.java | 8 ++--- .../BrickSpinnerDataInteractionWrapper.java | 12 ++++---- ...VariableSpinnerDataInteractionWrapper.java | 22 +++++++------- .../utils/ColorPickerInteractionWrapper.java | 12 ++++---- .../brick/utils/CustomSwipeAction.java | 14 ++++----- .../brick/utils/DragNDropBrickAction.java | 12 ++++---- .../content/brick/utils/UiNFCTestUtils.java | 20 ++++++------- ...dcastAndWaitBrickMessageContainerTest.java | 10 +++---- .../BroadcastMessageBrickUtils.java | 2 +- ...dcastReceiveBrickMessageContainerTest.java | 10 +++---- ...roadcastSendBrickMessageContainerTest.java | 10 +++---- ...tectionFormulaEditorComputeDialogTest.java | 12 ++++---- .../FaceDetectionResourceStartedTest.java | 10 +++---- .../FormulaEditorAddVariableTest.java | 8 ++--- .../FormulaEditorBrickViewOnClickTest.java | 16 +++++----- .../FormulaEditorDeleteVariableTest.java | 10 +++---- .../FormulaEditorDiscardChangesTest.java | 16 +++++----- .../FormulaEditorEditTextTest.java | 22 +++++++------- .../FormulaEditorFragmentTest.java | 16 +++++----- .../FormulaEditorFunctionListTest.java | 6 ++-- .../FormulaEditorKeyboardTest.java | 12 ++++---- .../FormulaEditorMovementPropertiesTest.java | 14 ++++----- .../FormulaEditorRenameVariableTest.java | 6 ++-- .../formulaeditor/FormulaEditorTest.java | 8 ++--- .../FormularEditorVariableScopeTest.java | 10 +++---- .../FormulaEditorCategoryListWrapper.java | 8 ++--- .../utils/FormulaEditorDataListWrapper.java | 20 ++++++------- ...ormulaEditorLocaleVariableComputeTest.java | 14 ++++----- .../utils/FormulaEditorWrapper.java | 16 +++++----- .../UserDataItemRVInteractionWrapper.java | 16 +++++----- .../UserListDataItemRVInteractionWrapper.java | 4 +-- ...rVariableDataItemRVInteractionWrapper.java | 6 ++-- .../LookFromGalleryIntentDismissTest.java | 22 +++++++------- .../gallery/LookFromGalleryIntentTest.java | 26 ++++++++-------- .../SpriteFromGalleryIntentDismissTest.java | 26 ++++++++-------- .../gallery/SpriteFromGalleryIntentTest.java | 28 ++++++++--------- .../PocketPaintEditLookIntentTest.java | 22 +++++++------- .../PocketPaintNewLookDiscardIntentTest.java | 20 ++++++------- .../PocketPaintNewLookIntentTest.java | 24 +++++++-------- ...PocketPaintNewSpriteDiscardIntentTest.java | 20 ++++++------- .../PocketPaintNewSpriteIntentTest.java | 26 ++++++++-------- .../SoundFromGalleryIntentDismissTest.java | 22 +++++++------- .../gallery/SoundFromGalleryIntentTest.java | 26 ++++++++-------- .../SpriteActivityVisualPlacementTest.java | 24 +++++++-------- .../VisualPlacementActivityTest.java | 14 ++++----- .../CameraPermissionSpriteActivityTest.java | 20 ++++++------- .../pocketmusic/PocketMusicActivityTest.java | 26 ++++++++-------- .../pocketmusic/RecyclerViewMatcher.java | 2 +- ...AndWaitForDeletedClonesRegressionTest.java | 2 +- .../BroadcastForClonesRegressionTest.java | 10 +++---- ...oadcastForDeletedClonesRegressionTest.java | 2 +- .../BroadcastReceiverRegressionTest.java | 10 +++---- .../DisabledBrickInClonesRegressionTest.java | 2 +- .../stage/MultipleBroadcastsTest.java | 2 +- .../uiespresso/stage/ObjectVariableTest.java | 2 +- .../uiespresso/stage/StagePausedTest.java | 12 ++++---- .../stage/StageResourceFailedTest.java | 12 ++++---- .../uiespresso/stage/StageSimpleTest.java | 8 ++--- .../uiespresso/stage/StartStageTouchTest.java | 6 ++-- .../stage/utils/StageTestTouchUtils.java | 8 ++--- .../ActionBarFormulaEditorTitleTest.java | 10 +++---- ...itingFormulaEditorOneSceneProjectTest.java | 10 +++---- ...tingFormulaEditorTwoScenesProjectTest.java | 10 +++---- .../ActionModeDataFragmentTitleTest.java | 10 +++---- .../ui/actionbar/ActionModeMergeTest.java | 18 +++++------ .../ui/actionbar/utils/ActionBarWrapper.java | 16 +++++----- .../ui/actionbar/utils/ActionModeWrapper.java | 12 ++++---- .../ui/activity/OpenFromShareLinkTest.java | 8 ++--- .../activity/PrivacyPolicyDisclaimerTest.java | 12 ++++---- ...tActivityNumberOfBricksRegressionTest.java | 12 ++++---- .../ui/activity/ProjectActivityTest.java | 20 ++++++------- .../ui/activity/ProjectListActivityTest.java | 2 +- .../ProjectUploadRatingDialogTest.java | 16 +++++----- .../ui/activity/SettingsFragmentTest.java | 20 ++++++------- ...berAtShowDetailsAtProjectActivityTest.java | 12 ++++---- .../ui/activity/rtl/LanguagePickerTest.java | 12 ++++---- .../ui/activity/rtl/RTLMainMenuTest.java | 2 +- .../uiespresso/ui/dialog/AboutDialogTest.java | 16 +++++----- .../ui/dialog/DeleteLookDialogTest.java | 20 ++++++------- .../ui/dialog/DeleteSoundDialogTest.java | 20 ++++++------- .../ui/dialog/DeleteSpriteDialogTest.java | 20 ++++++------- .../FormulaEditorComputeDialogTest.java | 26 ++++++++-------- .../LegoSensorPortConfigDialogTest.java | 12 ++++---- .../ui/dialog/OrientationDialogTest.java | 20 ++++++------- .../ui/dialog/PlaySceneDialogTest.java | 14 ++++----- .../ui/dialog/TermsOfUseDialogTest.java | 18 +++++------ .../LegoSensorPortConfigDialogWrapper.java | 16 +++++----- .../ui/fragment/AddUserbrickTest.java | 12 ++++---- .../uiespresso/ui/fragment/CopyLookTest.java | 16 +++++----- .../ui/fragment/CopyProjectTest.java | 16 +++++----- .../uiespresso/ui/fragment/CopySceneTest.java | 16 +++++----- .../uiespresso/ui/fragment/CopySoundTest.java | 16 +++++----- .../ui/fragment/DeleteAllScenesTest.java | 20 ++++++------- .../ui/fragment/DeleteFirstSceneTest.java | 20 ++++++------- .../ui/fragment/DeleteLookTest.java | 20 ++++++------- .../ui/fragment/DeleteProjectTest.java | 20 ++++++------- .../ui/fragment/DeleteSoundTest.java | 20 ++++++------- .../ui/fragment/MergeProjectDialogTest.java | 18 +++++------ .../ui/fragment/MergeProjectNameTest.java | 22 +++++++------- .../ui/fragment/RenameLookTest.java | 24 +++++++-------- .../ui/fragment/RenameProjectTest.java | 24 +++++++-------- .../ui/fragment/RenameSceneTest.java | 22 +++++++------- .../ui/fragment/RenameSoundTest.java | 24 +++++++-------- .../ui/fragment/RenameSpriteTest.java | 26 ++++++++-------- .../ui/fragment/ScriptFragmentTest.java | 26 ++++++++-------- ...ntExplanationTextNoObjectsProjectTest.java | 14 ++++----- ...tExplanationTextProjectWithObjectTest.java | 16 +++++----- .../RecyclerViewInteractionWrapper.java | 12 ++++---- .../RecyclerViewItemInteractionWrapper.java | 6 ++-- .../rvutils/RecyclerViewItemMatcher.java | 2 +- .../fragment/rvutils/RecyclerViewMatcher.java | 2 +- .../hints/Android9SnackbarRegressionTest.java | 14 ++++----- ...ragmentActivityRecreateRegressionTest.java | 18 +++++------ ...ialogActivityRecreationRegressionTest.java | 4 +-- ...ragmentActivityRecreateRegressionTest.java | 18 +++++------ ...ragemtnActivityRecreateRegressionTest.java | 24 +++++++-------- ...eDialogActivityRecreateRegressionTest.java | 14 ++++----- ...ectListActivityRecreateRegressionTest.java | 24 +++++++-------- ...ragmentActivityRecreateRegressionTest.java | 18 +++++------ ...ragmentActivityRecreateRegressionTest.java | 16 +++++----- ...ragmentActivityRecreateRegressionTest.java | 18 +++++------ ...ragmentActivityRecreateRegressionTest.java | 18 +++++------ .../catroid/uiespresso/util/UiTestUtils.java | 10 +++---- .../util/UserVariableAssertions.java | 4 +-- .../util/actions/CustomActions.java | 6 ++-- .../FormulaEditorCategoryListMatchers.java | 2 +- .../FormulaEditorDataListMatchers.java | 2 +- .../util/matchers/StageMatchers.java | 2 +- .../util/matchers/SuperToastMatchers.java | 2 +- .../util/rules/BaseActivityTestRule.java | 2 +- .../util/wrappers/DataInteractionWrapper.java | 12 ++++---- .../util/wrappers/ViewInteractionWrapper.java | 10 +++---- catroid/src/main/AndroidManifest.xml | 2 +- .../catrobat/catroid/CatroidApplication.java | 2 +- .../org/catrobat/catroid/ProjectManager.java | 2 +- .../ConnectBluetoothDeviceActivity.java | 2 +- .../catroid/camera/CameraManager.java | 2 +- .../catrobat/catroid/cast/CastManager.java | 8 ++--- .../catrobat/catroid/common/Constants.java | 2 +- .../org/catrobat/catroid/common/LookData.java | 4 +-- .../catrobat/catroid/common/SoundInfo.java | 2 +- .../catroid/common/ThreadScheduler.java | 2 +- .../content/ConditionScriptTrigger.java | 2 +- .../catroid/content/EventWrapper.java | 2 +- .../org/catrobat/catroid/content/Look.java | 4 +-- .../org/catrobat/catroid/content/Scene.java | 2 +- .../catroid/content/actions/EventThread.java | 2 +- .../content/actions/NextLookAction.java | 2 +- .../content/actions/ScriptSequenceAction.java | 2 +- .../content/actions/WebRequestAction.java | 4 +-- .../catroid/content/bricks/Brick.java | 2 +- .../catroid/content/bricks/BrickBaseType.java | 8 ++--- .../content/bricks/BroadcastMessageBrick.java | 6 ++-- .../catroid/content/bricks/CloneBrick.java | 2 +- .../catroid/content/bricks/ForeverBrick.java | 2 +- .../catroid/content/bricks/FormulaBrick.java | 4 +-- .../catroid/content/bricks/GoToBrick.java | 2 +- .../content/bricks/IfLogicBeginBrick.java | 2 +- .../content/bricks/IfThenLogicBeginBrick.java | 2 +- .../bricks/PhiroIfLogicBeginBrick.java | 2 +- .../content/bricks/PhiroRGBLightBrick.java | 2 +- .../catroid/content/bricks/PlaceAtBrick.java | 4 +-- .../content/bricks/PlaySoundBrick.java | 4 +-- .../catroid/content/bricks/PointToBrick.java | 4 +-- .../catroid/content/bricks/RepeatBrick.java | 2 +- .../content/bricks/RepeatUntilBrick.java | 2 +- .../content/bricks/SceneStartBrick.java | 4 +-- .../content/bricks/SceneTransitionBrick.java | 4 +-- .../content/bricks/SetBackgroundBrick.java | 4 +-- .../catroid/content/bricks/SetLookBrick.java | 4 +-- .../content/bricks/SetNfcTagBrick.java | 2 +- .../content/bricks/SetPenColorBrick.java | 2 +- .../bricks/SetPhysicsObjectTypeBrick.java | 2 +- .../content/bricks/SetRotationStyleBrick.java | 2 +- .../ShowTextColorSizeAlignmentBrick.java | 4 +-- .../catroid/content/bricks/UserListBrick.java | 6 ++-- .../content/bricks/UserVariableBrick.java | 6 ++-- .../bricks/UserVariableBrickWithFormula.java | 6 ++-- .../bricks/WhenBackgroundChangesBrick.java | 6 ++-- .../content/bricks/WhenBounceOffBrick.java | 2 +- .../catroid/content/bricks/WhenBrick.java | 2 +- .../bricks/WhenGamepadButtonBrick.java | 4 +-- .../catroid/content/bricks/WhenNfcBrick.java | 4 +-- .../bricks/brickspinner/BrickSpinner.java | 6 ++-- ...erVariableBrickTextInputDialogBuilder.java | 2 +- .../catroid/content/eventids/EventId.java | 2 +- .../catroid/content/eventids/NfcEventId.java | 2 +- .../ShowColorPickerFormulaEditorStrategy.java | 10 +++---- .../devices/mindstorms/nxt/NXTReply.java | 2 +- .../mindstorms/nxt/sensors/NXTI2CSensor.java | 2 +- .../nxt/sensors/NXTI2CUltraSonicSensor.java | 2 +- .../mindstorms/nxt/sensors/NXTSensor.java | 2 +- .../drone/ardrone/DroneController.java | 6 ++-- .../drone/ardrone/DroneInitializer.java | 4 +-- .../jumpingsumo/JumpingSumoDiscoverer.java | 4 +-- .../jumpingsumo/JumpingSumoInitializer.java | 6 ++-- .../drone/jumpingsumo/SDCardModule.java | 4 +-- .../facedetection/FaceDetectionHandler.java | 2 +- .../catroid/facedetection/FaceDetector.java | 2 +- .../facedetection/SlowFaceDetector.java | 2 +- .../ExternInternRepresentationMapping.java | 2 +- .../catroid/formulaeditor/InternFormula.java | 2 +- .../catroid/formulaeditor/SensorHandler.java | 2 +- .../catroid/formulaeditor/SensorLoudness.java | 2 +- .../catroid/io/DeviceUserDataAccessor.java | 2 +- .../org/catrobat/catroid/io/SoundManager.java | 2 +- .../catroid/io/XstreamSerializer.java | 2 +- .../io/asynctask/ProjectExportTask.java | 2 +- .../merge/NewProjectNameTextWatcher.java | 2 +- .../catroid/physics/PhysicsObject.java | 2 +- .../shapebuilder/PhysicsShapeScaleUtils.java | 2 +- .../pocketmusic/PocketMusicActivity.java | 2 +- .../catroid/pocketmusic/TactViewHolder.java | 2 +- .../fastscroller/FastScroller.java | 6 ++-- .../RecyclerViewScrollListener.java | 2 +- .../DefaultScrollerViewProvider.java | 2 +- .../viewprovider/ScrollerViewProvider.java | 2 +- .../VisibilityAnimationManager.java | 2 +- .../catroid/pocketmusic/note/NoteLength.java | 2 +- .../catroid/pocketmusic/note/Track.java | 2 +- .../pocketmusic/note/trackgrid/GridRow.java | 2 +- .../pocketmusic/note/trackgrid/TrackGrid.java | 2 +- .../trackgrid/TrackGridToTrackConverter.java | 2 +- .../trackgrid/TrackToTrackGridConverter.java | 2 +- .../catroid/pocketmusic/ui/NoteView.java | 2 +- .../catroid/pocketmusic/ui/PianoView.java | 2 +- .../ui/TactScrollRecyclerView.java | 6 ++-- .../catroid/pocketmusic/ui/TrackRowView.java | 2 +- .../catroid/scratchconverter/Client.java | 2 +- .../scratchconverter/ConversionManager.java | 2 +- .../ScratchConversionManager.java | 8 ++--- .../scratchconverter/protocol/JobHandler.java | 2 +- .../protocol/message/base/BaseMessage.java | 2 +- .../protocol/message/job/JobMessage.java | 2 +- .../message/job/JobOutputMessage.java | 2 +- .../catroid/sensing/CollisionInformation.java | 4 +-- .../soundrecorder/SoundRecorderActivity.java | 6 ++-- .../catroid/stage/ShowBubbleActor.java | 4 +-- .../catrobat/catroid/stage/StageActivity.java | 2 +- .../catrobat/catroid/stage/StageListener.java | 2 +- .../catroid/stage/StageResourceHolder.java | 2 +- .../catroid/stage/TextToSpeechHolder.java | 2 +- .../transfers/CheckOAuthTokenTask.java | 2 +- .../catroid/transfers/DeleteTestUserTask.java | 2 +- .../transfers/GoogleExchangeCodeTask.java | 2 +- .../catroid/transfers/GoogleLogInTask.java | 2 +- .../catroid/transfers/GoogleLoginHandler.java | 5 +++- .../transfers/project/ProjectUploadService.kt | 2 +- .../org/catrobat/catroid/ui/BaseActivity.java | 4 +-- .../catrobat/catroid/ui/ExportLaunchers.kt | 2 +- .../catrobat/catroid/ui/ImportLaunchers.kt | 4 +-- .../catrobat/catroid/ui/MainMenuActivity.java | 2 +- .../catroid/ui/MarketingActivity.java | 2 +- .../catrobat/catroid/ui/ProjectActivity.java | 8 ++--- .../catroid/ui/ProjectListActivity.java | 2 +- .../catroid/ui/ProjectUploadActivity.java | 4 +-- .../catroid/ui/ScratchConverterActivity.java | 8 ++--- .../ui/ScratchProgramDetailsActivity.java | 6 ++-- .../catrobat/catroid/ui/SettingsActivity.java | 2 +- .../catrobat/catroid/ui/SpriteActivity.java | 6 ++-- .../catroid/ui/SpriteAttributesActivity.java | 10 +++---- .../java/org/catrobat/catroid/ui/UiUtils.java | 4 +-- .../catrobat/catroid/ui/WebViewActivity.java | 4 +-- .../ui/adapter/CastDevicesAdapter.java | 2 +- .../dialogs/FormulaEditorComputeDialog.java | 2 +- .../dialogs/LegoSensorConfigInfoDialog.java | 4 +-- .../dialogs/LegoSensorPortConfigDialog.java | 6 ++-- .../ui/dialogs/ScratchReconvertDialog.java | 4 +-- .../catroid/ui/dialogs/SelectCastDialog.java | 6 ++-- .../ui/dialogs/TermsOfUseDialogFragment.java | 4 +-- .../catroid/ui/dragndrop/BrickListView.java | 4 +-- .../ui/filepicker/FilePickerActivity.java | 4 +-- .../ui/filepicker/FilePickerAdapter.java | 4 +-- .../catroid/ui/fragment/AddBrickFragment.java | 10 +++---- .../ui/fragment/AddUserBrickFragment.java | 4 +-- .../ui/fragment/BrickCategoryFragment.java | 8 ++--- .../ui/fragment/FormulaEditorFragment.java | 14 ++++----- .../ui/fragment/ProjectDetailsFragment.java | 2 +- .../catroid/ui/recyclerview/RVButton.java | 2 +- .../ui/recyclerview/adapter/BrickAdapter.java | 2 +- .../recyclerview/adapter/ButtonAdapter.java | 4 +-- .../adapter/CategoryListRVAdapter.java | 10 +++---- .../recyclerview/adapter/DataListAdapter.java | 8 ++--- .../adapter/MultiViewSpriteAdapter.java | 2 +- .../ui/recyclerview/adapter/RVAdapter.java | 4 +-- .../draganddrop/TouchHelperCallback.java | 4 +-- .../backpack/BackpackActivity.java | 4 +-- .../backpack/BackpackLookFragment.java | 2 +- .../BackpackRecyclerViewFragment.java | 12 ++++---- .../backpack/BackpackSceneFragment.java | 2 +- .../backpack/BackpackScriptFragment.java | 2 +- .../backpack/BackpackSoundFragment.java | 2 +- .../backpack/BackpackSpriteFragment.java | 2 +- .../controller/BrickController.java | 2 +- .../dialog/AboutDialogFragment.java | 4 +-- .../dialog/NewProjectDialogFragment.java | 2 +- .../dialog/OrientationDialogFragment.java | 6 ++-- .../recyclerview/dialog/PlaySceneDialog.java | 4 +-- .../dialog/PrivacyPolicyDialogFragment.java | 6 ++-- .../ReplaceExistingProjectDialogFragment.java | 10 +++---- .../recyclerview/dialog/TextInputDialog.java | 8 ++--- .../dialog/login/LoginDialogFragment.java | 6 ++-- .../login/OAuthUsernameDialogFragment.java | 6 ++-- .../login/RegistrationDialogFragment.java | 6 ++-- .../textwatcher/DialogInputWatcher.java | 2 +- .../textwatcher/NewItemTextWatcher.java | 2 +- .../NonEmptyStringTextWatcher.java | 2 +- .../textwatcher/RenameItemTextWatcher.java | 2 +- .../textwatcher/UniqueStringTextWatcher.java | 2 +- .../fragment/CategoryListFragment.java | 10 +++---- .../fragment/DataListFragment.java | 10 +++---- .../fragment/LookListFragment.java | 2 +- .../fragment/MainMenuFragment.java | 12 ++++---- .../fragment/NfcTagListFragment.java | 2 +- .../fragment/ProjectListFragment.java | 4 +-- .../fragment/RecyclerViewFragment.java | 16 +++++----- .../fragment/SceneListFragment.java | 4 +-- .../recyclerview/fragment/ScriptFragment.java | 10 +++---- .../fragment/SoundListFragment.java | 2 +- .../fragment/SpriteListFragment.java | 10 +++---- .../ScratchProgramsFragment.java | 8 ++--- .../ScratchSearchResultsFragment.java | 8 ++--- .../recyclerview/viewholder/ViewHolder.java | 2 +- .../PermissionRequestActivityExtension.java | 2 +- .../RequiresPermissionTask.java | 6 ++-- .../ui/scratchconverter/JobViewListener.java | 2 +- .../AccessibilityProfile.java | 2 +- .../AccessibilityProfilesFragment.java | 6 ++-- .../AccessibilitySettingsFragment.java | 4 +-- .../Ev3SensorsSettingsFragment.java | 4 +-- .../NXTSensorsSettingsFragment.java | 4 +-- .../ParrotARDroneSettingsFragment.java | 4 +-- .../ParrotJumpingSumoSettingsFragment.java | 4 +-- .../RaspberryPiSettingsFragment.java | 4 +-- .../settingsfragments/SettingsFragment.java | 2 +- .../catrobat/catroid/utils/CrashReporter.java | 2 +- .../catrobat/catroid/utils/SnackbarUtil.java | 8 ++--- .../org/catrobat/catroid/utils/ToastUtil.java | 2 +- .../BooleanInitiallyBusyIdlingResource.java | 4 +-- .../utils/notifications/NotificationData.kt | 2 +- .../StatusBarNotificationManager.java | 4 +-- .../VisualPlacementActivity.java | 4 +-- .../catrobat/catroid/web/ProjectDownloader.kt | 4 +-- .../catroid/web/ServerAuthenticator.kt | 2 +- .../catroid/web/WebConnectionHolder.java | 2 +- .../main/res/layout/activity_file_picker.xml | 2 +- .../activity_scratch_project_details.xml | 2 +- .../res/layout/activity_sprite_attributes.xml | 4 +-- .../src/main/res/layout/activity_upload.xml | 12 ++++---- catroid/src/main/res/layout/dialog_login.xml | 12 ++++---- .../main/res/layout/dialog_new_project.xml | 6 ++-- .../main/res/layout/dialog_new_user_data.xml | 6 ++-- .../res/layout/dialog_overwrite_project.xml | 6 ++-- .../src/main/res/layout/dialog_register.xml | 24 +++++++-------- .../layout/dialog_sign_in_oauth_username.xml | 6 ++-- catroid/src/main/res/layout/dialog_stage.xml | 2 +- .../src/main/res/layout/dialog_text_input.xml | 6 ++-- .../main/res/layout/fragment_list_view.xml | 4 +-- .../res/layout/fragment_scratch_programs.xml | 4 +-- .../res/layout/fragment_scratch_results.xml | 2 +- catroid/src/main/res/layout/toolbar.xml | 2 +- .../res/layout/visual_placement_layout.xml | 2 +- .../sprite/LookBreakDownCatroidAngleTest.java | 2 +- .../LookCatroidAngleToStageAngleTest.java | 2 +- .../content/sprite/LookDirectionTest.java | 2 +- .../LookStageAngleToCatroidAngleTest.java | 2 +- .../trackgrid/GridRowTestDataFactory.java | 2 +- .../trackgrid/TrackGridTestDataFactory.java | 2 +- .../bricks/BrickAddCategoryTest.java | 2 +- .../bricks/BrickSingleFormulaFieldTest.java | 4 +-- .../robolectric/bricks/BrickSpinnerTest.java | 4 +-- .../bricks/BrickStringSpinnerTest.java | 4 +-- .../bricks/BroadcastBrickTest.java | 2 +- .../FormulaEditorEditTextGenericTest.java | 2 +- .../test/transfers/ProjectDownloaderTest.java | 4 +-- .../test/ui/HighlightBrickPartsTest.java | 2 +- .../test/utiltests/NumberFormatsTest.java | 2 +- gradle.properties | 2 ++ 539 files changed, 1789 insertions(+), 1778 deletions(-) diff --git a/catroid/build.gradle b/catroid/build.gradle index 0b56cb66d30..d32cb2ff302 100644 --- a/catroid/build.gradle +++ b/catroid/build.gradle @@ -318,16 +318,14 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" // Support libraries - implementation "com.android.support:appcompat-v7:$supportLibraryVersion" - implementation "com.android.support:mediarouter-v7:$supportLibraryVersion" - implementation "com.android.support:cardview-v7:$supportLibraryVersion" - implementation "com.android.support:design:$supportLibraryVersion" - implementation "com.android.support:customtabs:$supportLibraryVersion" - implementation "com.android.support:exifinterface:$supportLibraryVersion" - implementation "com.android.support:support-v4:$supportLibraryVersion" + implementation 'androidx.appcompat:appcompat:1.0.0' + implementation 'androidx.mediarouter:mediarouter:1.0.0' + implementation 'androidx.cardview:cardview:1.0.0' + implementation 'com.google.android.material:material:1.0.0' + implementation 'androidx.browser:browser:1.0.0' - implementation "com.android.support.test.espresso:espresso-idling-resource:$espressoVersion" - implementation 'com.android.support:multidex:1.0.3' + implementation 'androidx.test.espresso:espresso-idling-resource:3.1.0' + implementation 'androidx.multidex:multidex:2.0.0' // Dagger implementation 'com.google.dagger:dagger:2.21' @@ -386,7 +384,7 @@ dependencies { androidTestImplementation ('tools.fastlane:screengrab:1.1.0'){ exclude group: 'com.android.support' } - androidTestImplementation ("com.android.support.test.espresso:espresso-web:$espressoVersion") { + androidTestImplementation ('androidx.test.espresso:espresso-web:3.1.0') { exclude group: 'com.android.support' } @@ -411,10 +409,10 @@ dependencies { androidTestImplementation 'com.linkedin.dexmaker:dexmaker-mockito:2.2.0' androidTestImplementation "org.mockito:mockito-core:$mockitoVersion" - androidTestImplementation 'com.android.support.test:runner:1.0.1' - androidTestImplementation "com.android.support.test.espresso:espresso-core:$espressoVersion" - androidTestImplementation "com.android.support.test.espresso:espresso-contrib:$espressoVersion" - androidTestImplementation "com.android.support.test.espresso:espresso-intents:$espressoVersion" + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' + androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.1.0' + androidTestImplementation 'androidx.test.espresso:espresso-intents:3.1.0' androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0' } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/catrobattestrunner/CatrobatTestRunner.java b/catroid/src/androidTest/java/org/catrobat/catroid/catrobattestrunner/CatrobatTestRunner.java index da374bc83b3..07882c44adb 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/catrobattestrunner/CatrobatTestRunner.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/catrobattestrunner/CatrobatTestRunner.java @@ -24,7 +24,10 @@ import android.app.Instrumentation; import android.support.test.InstrumentationRegistry; -import android.support.test.rule.ActivityTestRule; +import androidx.test.espresso.UiController; +import androidx.test.espresso.ViewAction; +import androidx.test.rule.ActivityTestRule; +import android.view.View; import org.catrobat.catroid.common.Constants; import org.catrobat.catroid.io.StorageOperations; @@ -45,6 +48,11 @@ import java.util.ArrayList; import java.util.List; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.isRoot; + +import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.fail; import static junit.framework.TestCase.assertTrue; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/catrobattestrunner/CatrobatTestRunnerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/catrobattestrunner/CatrobatTestRunnerTest.java index 079450e4ffa..042d7a86353 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/catrobattestrunner/CatrobatTestRunnerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/catrobattestrunner/CatrobatTestRunnerTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.catrobattestrunner; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Rule; import org.junit.Test; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/common/bluetooth/ConnectionDataLogger.java b/catroid/src/androidTest/java/org/catrobat/catroid/common/bluetooth/ConnectionDataLogger.java index 0f92db6f39e..fd850661ead 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/common/bluetooth/ConnectionDataLogger.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/common/bluetooth/ConnectionDataLogger.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.common.bluetooth; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import com.google.common.base.Stopwatch; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/runner/UiTestApplicationRunner.kt b/catroid/src/androidTest/java/org/catrobat/catroid/runner/UiTestApplicationRunner.kt index 863c667a0ba..4dd332616da 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/runner/UiTestApplicationRunner.kt +++ b/catroid/src/androidTest/java/org/catrobat/catroid/runner/UiTestApplicationRunner.kt @@ -27,7 +27,7 @@ import android.app.Application import android.content.Context import android.os.Bundle import android.os.StrictMode -import android.support.test.runner.AndroidJUnitRunner +import androidx.test.runner.AndroidJUnitRunner import org.catrobat.catroid.UiTestCatroidApplication class UiTestApplicationRunner : AndroidJUnitRunner() { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/screenshots/catroid/ScreenshotsForAppStore.java b/catroid/src/androidTest/java/org/catrobat/catroid/screenshots/catroid/ScreenshotsForAppStore.java index 02673e7cd03..1c0f71bc6fb 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/screenshots/catroid/ScreenshotsForAppStore.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/screenshots/catroid/ScreenshotsForAppStore.java @@ -25,10 +25,10 @@ import android.preference.PreferenceManager; import android.support.test.InstrumentationRegistry; -import android.support.test.espresso.contrib.RecyclerViewActions; -import android.support.test.espresso.web.webdriver.Locator; -import android.support.test.rule.ActivityTestRule; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.contrib.RecyclerViewActions; +import androidx.test.espresso.web.webdriver.Locator; +import androidx.test.rule.ActivityTestRule; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.ui.MainMenuActivity; @@ -43,17 +43,17 @@ import tools.fastlane.screengrab.UiAutomatorScreenshotStrategy; import tools.fastlane.screengrab.locale.LocaleTestRule; -import static android.support.test.espresso.Espresso.onData; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.isRoot; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; -import static android.support.test.espresso.web.sugar.Web.onWebView; -import static android.support.test.espresso.web.webdriver.DriverAtoms.findElement; -import static android.support.test.espresso.web.webdriver.DriverAtoms.webClick; +import static androidx.test.espresso.Espresso.onData; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.isRoot; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.web.sugar.Web.onWebView; +import static androidx.test.espresso.web.webdriver.DriverAtoms.findElement; +import static androidx.test.espresso.web.webdriver.DriverAtoms.webClick; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.FORMULA_EDITOR_TEXT_FIELD_MATCHER; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/screenshots/lunaandcat/ScreenshotsForAppStore.java b/catroid/src/androidTest/java/org/catrobat/catroid/screenshots/lunaandcat/ScreenshotsForAppStore.java index ea07a3af38e..7b3b4b4593d 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/screenshots/lunaandcat/ScreenshotsForAppStore.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/screenshots/lunaandcat/ScreenshotsForAppStore.java @@ -25,9 +25,9 @@ import android.preference.PreferenceManager; import android.support.test.InstrumentationRegistry; -import android.support.test.espresso.contrib.RecyclerViewActions; -import android.support.test.rule.ActivityTestRule; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.contrib.RecyclerViewActions; +import androidx.test.rule.ActivityTestRule; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.ui.MainMenuActivity; @@ -42,14 +42,14 @@ import tools.fastlane.screengrab.UiAutomatorScreenshotStrategy; import tools.fastlane.screengrab.locale.LocaleTestRule; -import static android.support.test.espresso.Espresso.onData; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.isRoot; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onData; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.isRoot; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.FORMULA_EDITOR_TEXT_FIELD_MATCHER; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/ProjectManagerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/ProjectManagerTest.java index 6e553537e61..7ee9341da59 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/ProjectManagerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/ProjectManagerTest.java @@ -24,7 +24,7 @@ import android.content.Context; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.UiTestCatroidApplication; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/common/DefaultProjectHandlerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/common/DefaultProjectHandlerTest.java index 51dd0499071..60e427a77bc 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/common/DefaultProjectHandlerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/common/DefaultProjectHandlerTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.common; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.common.DefaultProjectHandler; import org.catrobat.catroid.content.Project; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/common/LookDataTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/common/LookDataTest.java index 4184b3a1197..253be8413ab 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/common/LookDataTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/common/LookDataTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.test.common; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.common.Constants; import org.catrobat.catroid.common.LookData; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/common/ServiceProviderTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/common/ServiceProviderTest.java index b4f7d4d2ddc..f2e43cbfdb6 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/common/ServiceProviderTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/common/ServiceProviderTest.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.test.common; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.bluetooth.base.BluetoothDeviceService; import org.catrobat.catroid.common.CatroidService; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/GoToTouchPositionActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/GoToTouchPositionActionTest.java index dc0de1f40a4..b1d6b186505 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/GoToTouchPositionActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/GoToTouchPositionActionTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.content.actions; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.scenes.scene2d.Action; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/PlaySoundActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/PlaySoundActionTest.java index 541dc75accb..d77d6e5918d 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/PlaySoundActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/PlaySoundActionTest.java @@ -24,7 +24,7 @@ import android.media.MediaPlayer; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.scenes.scene2d.Action; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/SetNfcTagActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/SetNfcTagActionTest.java index 84661f7f795..6f0c1ab4eaf 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/SetNfcTagActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/SetNfcTagActionTest.java @@ -25,7 +25,7 @@ import android.nfc.FormatException; import android.nfc.NdefMessage; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.common.BrickValues; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/SetRotationStyleActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/SetRotationStyleActionTest.java index 7d8b2ff99e5..225253e6203 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/SetRotationStyleActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/SetRotationStyleActionTest.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.test.content.actions; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.scenes.scene2d.Action; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/StitchActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/StitchActionTest.java index 22b4ec53032..9d2f2d42109 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/StitchActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/StitchActionTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.test.content.actions; import android.graphics.PointF; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.ActionFactory; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/StopAllSoundsActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/StopAllSoundsActionTest.java index 5faab123b4e..8c88ac5a96b 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/StopAllSoundsActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/StopAllSoundsActionTest.java @@ -24,7 +24,7 @@ import android.media.MediaPlayer; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.scenes.scene2d.Action; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/LookControllerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/LookControllerTest.java index 57b6e0b1bc4..14980ba3f93 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/LookControllerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/LookControllerTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.test.content.controller; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.common.LookData; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/SceneControllerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/SceneControllerTest.java index 4577a09dac1..669662f9c9f 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/SceneControllerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/SceneControllerTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.test.content.controller; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.common.Constants; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/SoundControllerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/SoundControllerTest.java index 1724c1c6e79..3156a1a85cd 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/SoundControllerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/SoundControllerTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.test.content.controller; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.common.SoundInfo; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/SpriteControllerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/SpriteControllerTest.java index 4e6c9760d38..84e1be7a3bd 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/SpriteControllerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/SpriteControllerTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.test.content.controller; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.common.LookData; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/messagecontainer/MessageContainerSaveStateTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/messagecontainer/MessageContainerSaveStateTest.java index e8d9f206132..8fe37f0ebb7 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/messagecontainer/MessageContainerSaveStateTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/messagecontainer/MessageContainerSaveStateTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.content.messagecontainer; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.common.FlavoredConstants; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/messagecontainer/MessageContainerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/messagecontainer/MessageContainerTest.java index ca4bca2c560..509587ae823 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/messagecontainer/MessageContainerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/messagecontainer/MessageContainerTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.content.messagecontainer; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.common.FlavoredConstants; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/script/WhenScriptTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/script/WhenScriptTest.java index 8629d3882cb..1b16af5be33 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/script/WhenScriptTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/script/WhenScriptTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.test.content.script; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.graphics.Color; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/script/WhenTouchDownScriptTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/script/WhenTouchDownScriptTest.java index 49970637437..9046b86426b 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/script/WhenTouchDownScriptTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/script/WhenTouchDownScriptTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.test.content.script; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/sprite/LookTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/sprite/LookTest.java index c05d1c4897e..6203bc52ce8 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/sprite/LookTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/sprite/LookTest.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.test.content.sprite; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Pixmap; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/sprite/SpriteTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/sprite/SpriteTest.java index d0c204201a4..f4cead8689d 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/sprite/SpriteTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/sprite/SpriteTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.content.sprite; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.ActionFactory; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/arduino/ArduinoImplTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/arduino/ArduinoImplTest.java index b0a26c18adb..66e00026212 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/arduino/ArduinoImplTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/arduino/ArduinoImplTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.devices.arduino; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.common.bluetooth.ConnectionDataLogger; import org.catrobat.catroid.common.firmata.FirmataMessage; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/arduino/ArduinoSettingsTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/arduino/ArduinoSettingsTest.java index 41ac67fc40a..3ee4df90f3e 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/arduino/ArduinoSettingsTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/arduino/ArduinoSettingsTest.java @@ -25,7 +25,7 @@ import android.content.Context; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.common.FlavoredConstants; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/ev3/LegoEV3ImplTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/ev3/LegoEV3ImplTest.java index 3fd471f6063..47ba72206ec 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/ev3/LegoEV3ImplTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/ev3/LegoEV3ImplTest.java @@ -24,7 +24,7 @@ import android.content.Context; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.common.bluetooth.ConnectionDataLogger; import org.catrobat.catroid.devices.mindstorms.MindstormsException; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/ev3/LegoEV3MotorTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/ev3/LegoEV3MotorTest.java index 1148128b2bd..c25d27f3933 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/ev3/LegoEV3MotorTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/ev3/LegoEV3MotorTest.java @@ -25,7 +25,7 @@ import android.content.Context; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.common.bluetooth.ConnectionDataLogger; import org.catrobat.catroid.devices.mindstorms.MindstormsException; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/ev3/LegoEV3SensorTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/ev3/LegoEV3SensorTest.java index 4e8fc70d58d..898294bdecd 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/ev3/LegoEV3SensorTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/ev3/LegoEV3SensorTest.java @@ -25,7 +25,7 @@ import android.content.Context; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.common.bluetooth.ConnectionDataLogger; import org.catrobat.catroid.devices.mindstorms.MindstormsException; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/LegoNXTImplTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/LegoNXTImplTest.java index c982129b7c6..acab395f75b 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/LegoNXTImplTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/LegoNXTImplTest.java @@ -26,7 +26,7 @@ import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.common.bluetooth.ConnectionDataLogger; import org.catrobat.catroid.devices.mindstorms.MindstormsException; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/MindstormsConnectionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/MindstormsConnectionTest.java index 131ec3e7164..59d694f03dc 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/MindstormsConnectionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/MindstormsConnectionTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.devices.mindstorms.nxt; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.devices.mindstorms.MindstormsConnectionImpl; import org.catrobat.catroid.devices.mindstorms.nxt.Command; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/MotorTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/MotorTest.java index 86f79a12039..716a3933c66 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/MotorTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/MotorTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.devices.mindstorms.nxt; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.common.bluetooth.ConnectionDataLogger; import org.catrobat.catroid.devices.mindstorms.MindstormsConnection; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/NXTI2CUltraSonicSensorTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/NXTI2CUltraSonicSensorTest.java index 7b0c5273234..c27a5e325a8 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/NXTI2CUltraSonicSensorTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/NXTI2CUltraSonicSensorTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.devices.mindstorms.nxt; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.devices.mindstorms.MindstormsConnection; import org.catrobat.catroid.devices.mindstorms.MindstormsException; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/phiro/PhiroImplTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/phiro/PhiroImplTest.java index 29488eac9cc..ecb8c42141a 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/phiro/PhiroImplTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/phiro/PhiroImplTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.devices.phiro; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.google.common.base.Stopwatch; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/phiro/PhiroSettingsTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/phiro/PhiroSettingsTest.java index 5f47134a4db..d5b6a6dd438 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/phiro/PhiroSettingsTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/phiro/PhiroSettingsTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.test.devices.phiro; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.common.FlavoredConstants; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/drone/DroneBricksActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/drone/DroneBricksActionTest.java index 13144084d58..904cd6dbce5 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/drone/DroneBricksActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/drone/DroneBricksActionTest.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.test.drone; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.scenes.scene2d.Action; import com.badlogic.gdx.scenes.scene2d.actions.TemporalAction; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/drone/DroneDemoTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/drone/DroneDemoTest.java index 223ceab58b1..bbde3119966 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/drone/DroneDemoTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/drone/DroneDemoTest.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.test.drone; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.parrot.freeflight.drone.DroneProxy; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTFileConstantsTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTFileConstantsTest.java index d0369ae8a4b..a8dd6de20ad 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTFileConstantsTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTFileConstantsTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.embroidery; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTFileGeneratorTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTFileGeneratorTest.java index c985aa83a5a..edab5f18fc9 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTFileGeneratorTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTFileGeneratorTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.test.embroidery; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.android.dex.util.FileUtils; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTHeaderTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTHeaderTest.java index ce142e8e9e8..0466f1e8512 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTHeaderTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTHeaderTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.test.embroidery; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTPatternManagerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTPatternManagerTest.java index a710931c810..0d019888267 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTPatternManagerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTPatternManagerTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.embroidery; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.content.Sprite; import org.catrobat.catroid.embroidery.DSTPatternManager; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTStitchCommandTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTStitchCommandTest.java index 87c8f56e591..31571f7d833 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTStitchCommandTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTStitchCommandTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.embroidery; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.content.Sprite; import org.catrobat.catroid.embroidery.DSTStitchCommand; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTStitchPointTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTStitchPointTest.java index d3ff1057484..c5335125c33 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTStitchPointTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTStitchPointTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.embroidery; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.embroidery.DSTStitchPoint; import org.catrobat.catroid.embroidery.StitchPoint; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTStreamTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTStreamTest.java index ef0204f1520..0d059a23928 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTStreamTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTStreamTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.embroidery; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.embroidery.DSTHeader; import org.catrobat.catroid.embroidery.DSTStitchPoint; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTWorkSpaceTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTWorkSpaceTest.java index 1bac13e0562..fa5558a1d25 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTWorkSpaceTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTWorkSpaceTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.embroidery; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.content.Sprite; import org.catrobat.catroid.embroidery.DSTWorkSpace; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/EmbroideryFileExporterTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/EmbroideryFileExporterTest.java index 573ec5461e5..7c341111313 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/EmbroideryFileExporterTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/EmbroideryFileExporterTest.java @@ -26,8 +26,8 @@ import android.content.Intent; import android.net.Uri; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; -import android.support.v4.content.FileProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.core.content.FileProvider; import org.catrobat.catroid.common.Constants; import org.catrobat.catroid.stage.StageActivity; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/FaceDetectionHandlerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/FaceDetectionHandlerTest.java index 92873f4bd1f..e2b2b6129fe 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/FaceDetectionHandlerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/FaceDetectionHandlerTest.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.test.facedetection; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.camera.CameraManager; import org.catrobat.catroid.facedetection.FaceDetectionHandler; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/FaceDetectorTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/FaceDetectorTest.java index c1f89e98fff..e2d53476865 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/FaceDetectorTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/FaceDetectorTest.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.test.facedetection; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.facedetection.FaceDetector; import org.catrobat.catroid.formulaeditor.SensorCustomEvent; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/IcsFaceDetectorTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/IcsFaceDetectorTest.java index 2ea5a2025f7..864a11a4b6a 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/IcsFaceDetectorTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/IcsFaceDetectorTest.java @@ -25,8 +25,8 @@ import android.graphics.Rect; import android.hardware.Camera; import android.hardware.Camera.Face; -import android.support.test.rule.GrantPermissionRule; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.rule.GrantPermissionRule; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.camera.CameraManager; import org.catrobat.catroid.common.ScreenValues; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/SlowFaceDetectorCameraTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/SlowFaceDetectorCameraTest.java index 2f8a20ae28e..2ffc43dba2b 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/SlowFaceDetectorCameraTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/SlowFaceDetectorCameraTest.java @@ -23,8 +23,8 @@ package org.catrobat.catroid.test.facedetection; import android.hardware.Camera; -import android.support.test.rule.GrantPermissionRule; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.rule.GrantPermissionRule; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.camera.CameraManager; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/SlowFaceDetectorTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/SlowFaceDetectorTest.java index 13cbbba16bb..11cd709e6cc 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/SlowFaceDetectorTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/SlowFaceDetectorTest.java @@ -23,8 +23,8 @@ package org.catrobat.catroid.test.facedetection; import android.graphics.PointF; -import android.support.test.rule.GrantPermissionRule; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.rule.GrantPermissionRule; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.camera.CameraManager; import org.catrobat.catroid.common.ScreenValues; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/InternFormulaTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/InternFormulaTest.java index 7decd81d567..e644ad1bf69 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/InternFormulaTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/InternFormulaTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.test.formulaeditor; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.formulaeditor.ExternInternRepresentationMapping; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/InternTokenInsertTokenTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/InternTokenInsertTokenTest.java index e38637069c9..c5bca1aefa1 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/InternTokenInsertTokenTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/InternTokenInsertTokenTest.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.test.formulaeditor; -import android.support.annotation.IdRes; +import androidx.annotation.IdRes; import android.support.test.InstrumentationRegistry; import org.catrobat.catroid.R; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/ParserTestSensors.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/ParserTestSensors.java index 2ccf4d9bddc..661b8d5a2b3 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/ParserTestSensors.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/ParserTestSensors.java @@ -25,9 +25,9 @@ import android.Manifest; import android.graphics.Point; import android.support.test.InstrumentationRegistry; -import android.support.test.annotation.UiThreadTest; -import android.support.test.rule.GrantPermissionRule; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.annotation.UiThreadTest; +import androidx.test.rule.GrantPermissionRule; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.camera.CameraManager; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/CatroidFieldKeySorterTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/CatroidFieldKeySorterTest.java index 83056fbf8cb..3783016b57c 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/CatroidFieldKeySorterTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/CatroidFieldKeySorterTest.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.test.io; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.thoughtworks.xstream.XStream; import com.thoughtworks.xstream.annotations.XStreamAlias; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/DefaultChromeCastProgramLoadingTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/DefaultChromeCastProgramLoadingTest.java index 2c183e77656..9f6ebba727a 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/DefaultChromeCastProgramLoadingTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/DefaultChromeCastProgramLoadingTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.test.io; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/DefaultDroneProgramLoadingTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/DefaultDroneProgramLoadingTest.java index 56f1009f7ef..cc6c3f6d3c0 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/DefaultDroneProgramLoadingTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/DefaultDroneProgramLoadingTest.java @@ -25,7 +25,7 @@ import android.content.Context; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/DefaultJumpingSumoProgramLoadingTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/DefaultJumpingSumoProgramLoadingTest.java index b27e24565b5..ff26f0ea3da 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/DefaultJumpingSumoProgramLoadingTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/DefaultJumpingSumoProgramLoadingTest.java @@ -25,7 +25,7 @@ import android.content.Context; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ResourceImporterTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ResourceImporterTest.java index e5f2a677714..593a010fc06 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ResourceImporterTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ResourceImporterTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.test.io; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.common.FlavoredConstants; import org.catrobat.catroid.io.ResourceImporter; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/SoundManagerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/SoundManagerTest.java index f35cf5db0ae..fecea1e72d1 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/SoundManagerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/SoundManagerTest.java @@ -24,7 +24,7 @@ import android.media.MediaPlayer; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/StageAudioFocusTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/StageAudioFocusTest.java index 4e2e7f0e37f..97e50959662 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/StageAudioFocusTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/StageAudioFocusTest.java @@ -24,7 +24,7 @@ import android.media.AudioManager; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.io.StageAudioFocus; import org.junit.After; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/XstreamSerializerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/XstreamSerializerTest.java index 9c2bbb1ed9f..e105be354fe 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/XstreamSerializerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/XstreamSerializerTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.io; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.google.common.base.Charsets; import com.google.common.io.Files; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/InvalidProjectSaveTaskTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/InvalidProjectSaveTaskTest.java index fb7a4509cb7..da8cb58d67f 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/InvalidProjectSaveTaskTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/InvalidProjectSaveTaskTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.test.io.asynctask; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.io.asynctask.ProjectSaveTask; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/ProjectExportTaskTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/ProjectExportTaskTest.java index 8b26741a7b9..92db5975535 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/ProjectExportTaskTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/ProjectExportTaskTest.java @@ -27,8 +27,8 @@ import android.app.NotificationManager; import android.content.Context; import android.support.test.InstrumentationRegistry; -import android.support.test.rule.GrantPermissionRule; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.rule.GrantPermissionRule; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/ProjectRenameTaskTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/ProjectRenameTaskTest.java index 82bcd70d476..6993e648ced 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/ProjectRenameTaskTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/ProjectRenameTaskTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.test.io.asynctask; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.common.DefaultProjectHandler; import org.catrobat.catroid.content.Project; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/ProjectUnzipAndImportTaskTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/ProjectUnzipAndImportTaskTest.java index 238a2d9eecd..6f4c3a66a28 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/ProjectUnzipAndImportTaskTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/ProjectUnzipAndImportTaskTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.test.io.asynctask; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.content.backwardcompatibility.ProjectMetaDataParser; import org.catrobat.catroid.io.StorageOperations; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicelistaccessor/DeviceUserListAccessorCleanRoutineTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicelistaccessor/DeviceUserListAccessorCleanRoutineTest.java index 76a42d6feb5..1b8d5ae4c1a 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicelistaccessor/DeviceUserListAccessorCleanRoutineTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicelistaccessor/DeviceUserListAccessorCleanRoutineTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.io.devicelistaccessor; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.content.Project; import org.catrobat.catroid.content.Scene; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicelistaccessor/DeviceUserListAccessorNullValueTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicelistaccessor/DeviceUserListAccessorNullValueTest.java index c630ff0b875..f6b18e51334 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicelistaccessor/DeviceUserListAccessorNullValueTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicelistaccessor/DeviceUserListAccessorNullValueTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.io.devicelistaccessor; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.formulaeditor.UserList; import org.catrobat.catroid.io.DeviceListAccessor; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicevariableaccessor/DeviceVariableAccessorCleanRoutineTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicevariableaccessor/DeviceVariableAccessorCleanRoutineTest.java index ccc674113d4..89c9500d748 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicevariableaccessor/DeviceVariableAccessorCleanRoutineTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicevariableaccessor/DeviceVariableAccessorCleanRoutineTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.io.devicevariableaccessor; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.content.Project; import org.catrobat.catroid.content.Scene; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicevariableaccessor/DeviceVariableAccessorNullValueTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicevariableaccessor/DeviceVariableAccessorNullValueTest.java index 6be67b6e656..7017469da1c 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicevariableaccessor/DeviceVariableAccessorNullValueTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicevariableaccessor/DeviceVariableAccessorNullValueTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.io.devicevariableaccessor; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.formulaeditor.UserVariable; import org.catrobat.catroid.io.DeviceVariableAccessor; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/filepicker/ListProjectFilesTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/filepicker/ListProjectFilesTest.java index 66a9d0b591c..c85453160c5 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/filepicker/ListProjectFilesTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/filepicker/ListProjectFilesTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.test.io.filepicker; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.io.StorageOperations; import org.catrobat.catroid.ui.filepicker.ListProjectFilesTask; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ziparchiver/UnzipProjectFromAssetsTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ziparchiver/UnzipProjectFromAssetsTest.java index 26555910351..2631e81f184 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ziparchiver/UnzipProjectFromAssetsTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ziparchiver/UnzipProjectFromAssetsTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.test.io.ziparchiver; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.io.StorageOperations; import org.catrobat.catroid.io.ZipArchiver; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ziparchiver/ZipFolderTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ziparchiver/ZipFolderTest.java index a81de98f59c..d586d2eac05 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ziparchiver/ZipFolderTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ziparchiver/ZipFolderTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.test.io.ziparchiver; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.common.FlavoredConstants; import org.catrobat.catroid.io.StorageOperations; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ziparchiver/ZipSingleFileTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ziparchiver/ZipSingleFileTest.java index d15be5d52d0..5f4a8bb27dc 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ziparchiver/ZipSingleFileTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ziparchiver/ZipSingleFileTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.io.ziparchiver; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.common.FlavoredConstants; import org.catrobat.catroid.io.StorageOperations; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsActiveStageAreaTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsActiveStageAreaTest.java index 09b71dc1386..ba8ffa053d2 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsActiveStageAreaTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsActiveStageAreaTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.test.physics; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.common.LookData; import org.catrobat.catroid.content.Project; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsBoundaryBoxTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsBoundaryBoxTest.java index cfb542d63a6..c78b6cb430c 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsBoundaryBoxTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsBoundaryBoxTest.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.test.physics; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.physics.box2d.Body; import com.badlogic.gdx.physics.box2d.BodyDef.BodyType; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsCollisionBetweenTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsCollisionBetweenTest.java index 01d6159f832..3f95e5f045a 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsCollisionBetweenTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsCollisionBetweenTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.physics; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.physics.box2d.Contact; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsObjectCollisionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsObjectCollisionTest.java index d220ef6e0b8..3a5ee084f21 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsObjectCollisionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsObjectCollisionTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.physics; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.physics.box2d.Body; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsObjectTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsObjectTest.java index 74fe8ecbfce..d942cd08749 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsObjectTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsObjectTest.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.test.physics; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.physics.box2d.Body; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsShapeBuilderTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsShapeBuilderTest.java index 86054188faa..54d0aaa4cbb 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsShapeBuilderTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsShapeBuilderTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.physics; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.physics.box2d.PolygonShape; import com.badlogic.gdx.physics.box2d.Shape; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsShapeScaleUtilsTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsShapeScaleUtilsTest.java index 30e42eb63f5..26d162de5fd 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsShapeScaleUtilsTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsShapeScaleUtilsTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.physics; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.math.Vector2; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsSpriteCloneTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsSpriteCloneTest.java index 48708a6b00e..b37ea6939f2 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsSpriteCloneTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsSpriteCloneTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.physics; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.common.LookData; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsWorldTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsWorldTest.java index d3149da73a3..5264248f64f 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsWorldTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsWorldTest.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.test.physics; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.physics.box2d.World; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/IfOnEdgeBouncePhysicsActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/IfOnEdgeBouncePhysicsActionTest.java index 726f347c632..a33818eee51 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/IfOnEdgeBouncePhysicsActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/IfOnEdgeBouncePhysicsActionTest.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.test.physics.actions; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.scenes.scene2d.Action; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/PhysicsObjectStateTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/PhysicsObjectStateTest.java index d10bd341cef..2ab42142076 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/PhysicsObjectStateTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/PhysicsObjectStateTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.physics.actions; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.scenes.scene2d.Action; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetBounceFactorActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetBounceFactorActionTest.java index c57c355ff95..d61194c97ac 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetBounceFactorActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetBounceFactorActionTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.physics.actions; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.scenes.scene2d.Action; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetFrictionActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetFrictionActionTest.java index ae0c0daeb54..d08cd3ae365 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetFrictionActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetFrictionActionTest.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.test.physics.actions; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.scenes.scene2d.Action; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetGravityActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetGravityActionTest.java index ad04667395d..103a431b7ab 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetGravityActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetGravityActionTest.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.test.physics.actions; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.physics.box2d.World; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetLookActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetLookActionTest.java index 5ff1f033dac..c6016d386d4 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetLookActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetLookActionTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.test.physics.actions; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.scenes.scene2d.Action; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetMassActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetMassActionTest.java index e5a8e3dee61..c752b7dafa6 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetMassActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetMassActionTest.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.test.physics.actions; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.scenes.scene2d.Action; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetPhysicsObjectTypeActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetPhysicsObjectTypeActionTest.java index c295ddda046..893cf26fae7 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetPhysicsObjectTypeActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetPhysicsObjectTypeActionTest.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.test.physics.actions; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.scenes.scene2d.Action; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetSizeToActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetSizeToActionTest.java index 4f2a3cba2d3..9bca62332c2 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetSizeToActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetSizeToActionTest.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.test.physics.actions; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.math.Vector2; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetVelocityActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetVelocityActionTest.java index 1226968899a..1de917d1cba 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetVelocityActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetVelocityActionTest.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.test.physics.actions; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.scenes.scene2d.Action; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/TurnLeftRightSpeedActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/TurnLeftRightSpeedActionTest.java index 795e4196fbf..6dd1df289ce 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/TurnLeftRightSpeedActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/TurnLeftRightSpeedActionTest.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.test.physics.actions; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.content.Sprite; import org.catrobat.catroid.physics.PhysicsObject; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/TurnLeftSpeedActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/TurnLeftSpeedActionTest.java index c574e62a766..a087c36df28 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/TurnLeftSpeedActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/TurnLeftSpeedActionTest.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.test.physics.actions; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.scenes.scene2d.Action; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/TurnRightSpeedActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/TurnRightSpeedActionTest.java index 7333486e778..cab6c19febe 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/TurnRightSpeedActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/TurnRightSpeedActionTest.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.test.physics.actions; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.scenes.scene2d.Action; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/conditional/HideActionAndCollisionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/conditional/HideActionAndCollisionTest.java index eeb5cbd55e4..fac9da4da8b 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/conditional/HideActionAndCollisionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/conditional/HideActionAndCollisionTest.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.test.physics.actions.conditional; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.scenes.scene2d.Action; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionDetectionAdvancedTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionDetectionAdvancedTest.java index 501c2d12865..50c7a82bad8 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionDetectionAdvancedTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionDetectionAdvancedTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.test.physics.collision; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.math.Polygon; import com.badlogic.gdx.scenes.scene2d.Action; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionDetectionPolygonCreationTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionDetectionPolygonCreationTest.java index 436e2d14614..5e4b1da6b4c 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionDetectionPolygonCreationTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionDetectionPolygonCreationTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.test.physics.collision; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.common.LookData; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionFormulaConversionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionFormulaConversionTest.java index 5039a752816..08042dd10a6 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionFormulaConversionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionFormulaConversionTest.java @@ -27,7 +27,7 @@ import android.content.res.Configuration; import android.content.res.Resources; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.CatroidApplication; import org.catrobat.catroid.ProjectManager; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionInformationTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionInformationTest.java index 84cf22c7f20..213f75a05bf 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionInformationTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionInformationTest.java @@ -25,7 +25,7 @@ import android.graphics.Bitmap; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.math.Polygon; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/look/PhysicsLookDataTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/look/PhysicsLookDataTest.java index 776804ae2b1..e1dbdd324b7 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/look/PhysicsLookDataTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/look/PhysicsLookDataTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.physics.look; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.math.Vector2; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/look/PhysicsLookPositionAndAngleTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/look/PhysicsLookPositionAndAngleTest.java index 65927c6b8fe..34da838ab29 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/look/PhysicsLookPositionAndAngleTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/look/PhysicsLookPositionAndAngleTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.physics.look; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.math.Vector2; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/pocketmusic/note/midi/MidiToProjectConverterTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/pocketmusic/note/midi/MidiToProjectConverterTest.java index 4553c6b6d5c..7b5bf28c7d1 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/pocketmusic/note/midi/MidiToProjectConverterTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/pocketmusic/note/midi/MidiToProjectConverterTest.java @@ -23,8 +23,8 @@ package org.catrobat.catroid.test.pocketmusic.note.midi; import android.Manifest; -import android.support.test.rule.GrantPermissionRule; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.rule.GrantPermissionRule; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.pocketmusic.note.MusicalInstrument; import org.catrobat.catroid.pocketmusic.note.Project; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/pocketmusic/note/midi/ProjectToMidiConverterTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/pocketmusic/note/midi/ProjectToMidiConverterTest.java index 9e3feacec48..0dae58813b8 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/pocketmusic/note/midi/ProjectToMidiConverterTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/pocketmusic/note/midi/ProjectToMidiConverterTest.java @@ -24,8 +24,8 @@ import android.Manifest; import android.support.test.InstrumentationRegistry; -import android.support.test.rule.GrantPermissionRule; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.rule.GrantPermissionRule; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.pocketmusic.note.Project; import org.catrobat.catroid.pocketmusic.note.midi.MidiException; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/ScratchServerCallsTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/ScratchServerCallsTest.java index 1820450adce..88754e59cc6 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/ScratchServerCallsTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/ScratchServerCallsTest.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.test.scratchconverter; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.common.Constants; import org.catrobat.catroid.common.ScratchProgramData; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/WebSocketClientTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/WebSocketClientTest.java index bf8141625f2..f3ca288bab6 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/WebSocketClientTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/WebSocketClientTest.java @@ -25,7 +25,7 @@ import android.net.Uri; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.google.android.gms.common.images.WebImage; import com.koushikdutta.async.callback.CompletedCallback; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/protocol/JobHandlerSuccessfulOnJobMessageTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/protocol/JobHandlerSuccessfulOnJobMessageTest.java index fa61a4bcf70..05140e4f771 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/protocol/JobHandlerSuccessfulOnJobMessageTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/protocol/JobHandlerSuccessfulOnJobMessageTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.scratchconverter.protocol; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.google.android.gms.common.images.WebImage; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/protocol/WebSocketMessageListenerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/protocol/WebSocketMessageListenerTest.java index 19486513660..e46819ba958 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/protocol/WebSocketMessageListenerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/protocol/WebSocketMessageListenerTest.java @@ -25,7 +25,7 @@ import android.net.Uri; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.google.android.gms.common.images.WebImage; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/sensing/CollisionInformationBubblePositionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/sensing/CollisionInformationBubblePositionTest.java index 4b7ab97416d..b187a134ddb 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/sensing/CollisionInformationBubblePositionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/sensing/CollisionInformationBubblePositionTest.java @@ -27,8 +27,8 @@ import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; -import android.support.test.runner.AndroidJUnit4; -import android.support.v4.util.Pair; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.core.util.Pair; import org.catrobat.catroid.common.LookData; import org.catrobat.catroid.sensing.CollisionInformation; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/sensing/TouchesEdgeTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/sensing/TouchesEdgeTest.java index 6c25840ae0a..a2e43d6e1da 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/sensing/TouchesEdgeTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/sensing/TouchesEdgeTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.test.sensing; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/sensing/TouchesFingerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/sensing/TouchesFingerTest.java index dadc96c4a40..3ab54a04b64 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/sensing/TouchesFingerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/sensing/TouchesFingerTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.test.sensing; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/stage/DrawAxesTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/stage/DrawAxesTest.java index 0aabdf8cc79..4ca3a2aea65 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/stage/DrawAxesTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/stage/DrawAxesTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.stage; -import android.support.annotation.IdRes; +import androidx.annotation.IdRes; import android.support.test.InstrumentationRegistry; import com.badlogic.gdx.graphics.g2d.BitmapFont; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/stage/InvalidSaveScreenshotTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/stage/InvalidSaveScreenshotTest.java index 42217e707bd..36720f64342 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/stage/InvalidSaveScreenshotTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/stage/InvalidSaveScreenshotTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.stage; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.stage.StageListener; import org.junit.Before; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/ui/BaseExceptionHandlerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/ui/BaseExceptionHandlerTest.java index 5e55092a1c5..057a5c1a999 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/ui/BaseExceptionHandlerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/ui/BaseExceptionHandlerTest.java @@ -27,7 +27,7 @@ import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ui.BaseExceptionHandler; import org.catrobat.catroid.ui.settingsfragments.SettingsFragment; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/ui/RequiresPermissionTaskTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/ui/RequiresPermissionTaskTest.java index 773c3dc5ff4..478cb177207 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/ui/RequiresPermissionTaskTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/ui/RequiresPermissionTaskTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.test.ui; import android.app.Activity; -import android.support.v7.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatActivity; import org.catrobat.catroid.ui.runtimepermissions.RequiresPermissionTask; import org.junit.Before; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/DefaultProjectComparatorTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/DefaultProjectComparatorTest.java index 120e60c535c..31413a1432f 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/DefaultProjectComparatorTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/DefaultProjectComparatorTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.test.utiltests; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.common.DefaultProjectHandler; import org.catrobat.catroid.common.ScreenValues; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/ImageEditingTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/ImageEditingTest.java index cb9a9db62dd..8bed7a1b384 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/ImageEditingTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/ImageEditingTest.java @@ -26,7 +26,7 @@ import android.graphics.Bitmap; import android.graphics.Bitmap.CompressFormat; import android.graphics.BitmapFactory; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.common.Constants; import org.catrobat.catroid.common.FlavoredConstants; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/MD5ChecksumTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/MD5ChecksumTest.java index 3e64bd7632e..3542c0f525a 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/MD5ChecksumTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/MD5ChecksumTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.test.utiltests; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.io.StorageOperations; import org.catrobat.catroid.utils.Utils; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/reflection/ReflectionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/reflection/ReflectionTest.java index 5bcb2f33646..f3d29b0b89c 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/reflection/ReflectionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/reflection/ReflectionTest.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.test.utiltests.reflection; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.test.utils.Reflection; import org.catrobat.catroid.test.utils.Reflection.Parameter; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/web/AuthenticationCallsTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/web/AuthenticationCallsTest.java index 0a0dd767601..eb6cb34ff88 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/web/AuthenticationCallsTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/web/AuthenticationCallsTest.java @@ -25,7 +25,7 @@ import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.common.Constants; import org.catrobat.catroid.runner.Flaky; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/annotations/FlakyTestTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/annotations/FlakyTestTest.java index c30735ce8c6..2d746720a94 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/annotations/FlakyTestTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/annotations/FlakyTestTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.annotations; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.rules.FlakyTestRule; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/BroadcastBrickMessageUpdateTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/BroadcastBrickMessageUpdateTest.java index dd31243198a..605ff355494 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/BroadcastBrickMessageUpdateTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/BroadcastBrickMessageUpdateTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.content.brick.app; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/ChangeVariableTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/ChangeVariableTest.java index 84281aa20aa..2d9dbc82faf 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/ChangeVariableTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/ChangeVariableTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.content.brick.app; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; @@ -39,12 +39,12 @@ import java.util.Arrays; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.pressBack; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; -import static android.support.test.espresso.matcher.ViewMatchers.hasSibling; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.pressBack; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.matcher.ViewMatchers.hasSibling; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorDataListWrapper.onDataList; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/DeleteItemOfUserListBrickTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/DeleteItemOfUserListBrickTest.java index 094b3391094..8143169643f 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/DeleteItemOfUserListBrickTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/DeleteItemOfUserListBrickTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.content.brick.app; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.content.bricks.DeleteItemOfUserListBrick; @@ -42,12 +42,12 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static junit.framework.Assert.assertEquals; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/InsertItemToUserListTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/InsertItemToUserListTest.java index 825e9be92c2..a41fe593d01 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/InsertItemToUserListTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/InsertItemToUserListTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.content.brick.app; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -41,9 +41,9 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static junit.framework.Assert.assertEquals; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PhiroColorBrickFormulaTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PhiroColorBrickFormulaTest.java index d1c1904f4e8..afe2b02cd2c 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PhiroColorBrickFormulaTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PhiroColorBrickFormulaTest.java @@ -41,10 +41,10 @@ import java.util.Arrays; import java.util.Collection; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.formulaeditor.FormulaElement.ElementType.NUMBER; import static org.catrobat.catroid.formulaeditor.FormulaElement.ElementType.OPERATOR; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PhiroColorBrickNumberTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PhiroColorBrickNumberTest.java index e55f6cf5f12..16cb0e9ba9e 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PhiroColorBrickNumberTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PhiroColorBrickNumberTest.java @@ -40,12 +40,12 @@ import java.util.Arrays; import java.util.Collection; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.content.brick.utils.ColorPickerInteractionWrapper.onColorPickerPresetButton; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PlaceAtBrickTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PlaceAtBrickTest.java index 63662e01692..203cd5c1b4e 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PlaceAtBrickTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PlaceAtBrickTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.content.brick.app; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.content.bricks.PlaceAtBrick; @@ -39,13 +39,13 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.pressBack; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.pressBack; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickTestUtils.createProjectAndGetStartScript; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PlaySoundAndWaitBrickTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PlaySoundAndWaitBrickTest.java index 33fb076defe..2e176300e36 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PlaySoundAndWaitBrickTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PlaySoundAndWaitBrickTest.java @@ -25,8 +25,8 @@ import android.Manifest; import android.support.test.InstrumentationRegistry; -import android.support.test.rule.GrantPermissionRule; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.rule.GrantPermissionRule; +import androidx.test.ext.junit.runners.AndroidJUnit4; import android.widget.EditText; import org.catrobat.catroid.ProjectManager; @@ -59,19 +59,19 @@ import java.util.List; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.closeSoftKeyboard; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.Espresso.pressBack; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.action.ViewActions.replaceText; -import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.RootMatchers.isDialog; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.isRoot; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.closeSoftKeyboard; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.Espresso.pressBack; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.action.ViewActions.replaceText; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.RootMatchers.isDialog; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.isRoot; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PlaySoundBrickTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PlaySoundBrickTest.java index 2b29f5869c2..1910f6a0153 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PlaySoundBrickTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PlaySoundBrickTest.java @@ -25,8 +25,8 @@ import android.Manifest; import android.support.test.InstrumentationRegistry; -import android.support.test.rule.GrantPermissionRule; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.rule.GrantPermissionRule; +import androidx.test.ext.junit.runners.AndroidJUnit4; import android.widget.EditText; import org.catrobat.catroid.ProjectManager; @@ -55,17 +55,17 @@ import java.util.List; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.Espresso.pressBack; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard; -import static android.support.test.espresso.action.ViewActions.replaceText; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.isRoot; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.Espresso.pressBack; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard; +import static androidx.test.espresso.action.ViewActions.replaceText; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.isRoot; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PointToBrickAdditionalTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PointToBrickAdditionalTest.java index 9591e1f4f46..09a5bf3675c 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PointToBrickAdditionalTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PointToBrickAdditionalTest.java @@ -30,9 +30,9 @@ import android.net.Uri; import android.os.Environment; import android.support.test.InstrumentationRegistry; -import android.support.test.espresso.intent.Intents; -import android.support.test.rule.GrantPermissionRule; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.intent.Intents; +import androidx.test.rule.GrantPermissionRule; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -59,17 +59,17 @@ import java.util.ArrayList; import java.util.List; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.intent.Intents.intended; -import static android.support.test.espresso.intent.Intents.intending; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasAction; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasExtras; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasType; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.intent.Intents.intended; +import static androidx.test.espresso.intent.Intents.intending; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasAction; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasExtras; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasType; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasExtraIntent; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/ReplaceItemInUserListTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/ReplaceItemInUserListTest.java index 3b369cd0fdc..8c91332494c 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/ReplaceItemInUserListTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/ReplaceItemInUserListTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.content.brick.app; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.content.bricks.ReplaceItemInUserListBrick; @@ -39,13 +39,13 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorDataListWrapper.onDataList; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SceneBricksTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SceneBricksTest.java index 8e1adfea947..f961dae0fc5 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SceneBricksTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SceneBricksTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.content.brick.app; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -46,9 +46,9 @@ import java.util.ArrayList; import java.util.List; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetBackgroundBrickTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetBackgroundBrickTest.java index c2ac5392bab..585e4a431b4 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetBackgroundBrickTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetBackgroundBrickTest.java @@ -23,8 +23,8 @@ package org.catrobat.catroid.uiespresso.content.brick.app; -import android.support.test.espresso.intent.Intents; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.intent.Intents; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.content.bricks.SetBackgroundBrick; @@ -40,13 +40,13 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.intent.Intents.intended; -import static android.support.test.espresso.intent.matcher.BundleMatchers.hasEntry; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasComponent; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasExtras; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.intent.Intents.intended; +import static androidx.test.espresso.intent.matcher.BundleMatchers.hasEntry; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasExtras; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.catrobat.catroid.common.FlavoredConstants.LIBRARY_BACKGROUNDS_URL_PORTRAIT; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetLookBrickTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetLookBrickTest.java index 7eab59cb975..1ceb79305a8 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetLookBrickTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetLookBrickTest.java @@ -23,8 +23,8 @@ package org.catrobat.catroid.uiespresso.content.brick.app; -import android.support.test.espresso.intent.Intents; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.intent.Intents; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.content.bricks.SetLookBrick; @@ -40,13 +40,13 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.intent.Intents.intended; -import static android.support.test.espresso.intent.matcher.BundleMatchers.hasEntry; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasComponent; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasExtras; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.intent.Intents.intended; +import static androidx.test.espresso.intent.matcher.BundleMatchers.hasEntry; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasExtras; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.catrobat.catroid.common.FlavoredConstants.LIBRARY_LOOKS_URL; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetPenColorBrickFormulaTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetPenColorBrickFormulaTest.java index 2fb09f4a68c..9595ac0384f 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetPenColorBrickFormulaTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetPenColorBrickFormulaTest.java @@ -39,10 +39,10 @@ import java.util.Arrays; import java.util.Collection; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.formulaeditor.FormulaElement.ElementType.NUMBER; import static org.catrobat.catroid.formulaeditor.FormulaElement.ElementType.OPERATOR; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetPenColorBrickNumberTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetPenColorBrickNumberTest.java index 782721a59d1..11e18a34502 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetPenColorBrickNumberTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetPenColorBrickNumberTest.java @@ -38,12 +38,12 @@ import java.util.Arrays; import java.util.Collection; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickTestUtils.createProjectAndGetStartScript; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetVariableBrickTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetVariableBrickTest.java index 150c8d25901..75d68989179 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetVariableBrickTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetVariableBrickTest.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.uiespresso.content.brick.app; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; @@ -41,17 +41,17 @@ import java.util.Arrays; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.pressBack; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard; -import static android.support.test.espresso.action.ViewActions.typeText; -import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withChild; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.pressBack; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard; +import static androidx.test.espresso.action.ViewActions.typeText; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withChild; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorDataListWrapper.onDataList; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/ShowTextColorSizeAlignmentBrickTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/ShowTextColorSizeAlignmentBrickTest.java index a6a2ad9a230..ccd2dfdfa23 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/ShowTextColorSizeAlignmentBrickTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/ShowTextColorSizeAlignmentBrickTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.content.brick.app; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.content.bricks.ShowTextColorSizeAlignmentBrick; @@ -37,11 +37,11 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickTestUtils.createProjectAndGetStartScript; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/VariableBrickTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/VariableBrickTest.java index c7e05030bfc..5e47a453fe8 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/VariableBrickTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/VariableBrickTest.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.uiespresso.content.brick.app; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; @@ -41,10 +41,10 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.closeSoftKeyboard; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.closeSoftKeyboard; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/rtl/RtlBrickTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/rtl/RtlBrickTest.java index 215da94b43c..46ff023c4ce 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/rtl/RtlBrickTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/rtl/RtlBrickTest.java @@ -26,7 +26,7 @@ import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -191,13 +191,13 @@ import java.util.Locale; import static android.support.test.InstrumentationRegistry.getTargetContext; -import static android.support.test.espresso.Espresso.onData; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.hasChildCount; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withParent; +import static androidx.test.espresso.Espresso.onData; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.hasChildCount; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withParent; import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertTrue; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/AskBrickStageTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/AskBrickStageTest.java index fb277b4aeb9..584788fad4f 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/AskBrickStageTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/AskBrickStageTest.java @@ -25,8 +25,8 @@ import android.Manifest; import android.support.test.InstrumentationRegistry; -import android.support.test.rule.GrantPermissionRule; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.rule.GrantPermissionRule; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -48,11 +48,11 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.action.ViewActions.typeText; -import static android.support.test.espresso.matcher.ViewMatchers.withClassName; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.action.ViewActions.typeText; +import static androidx.test.espresso.matcher.ViewMatchers.withClassName; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.util.UiTestUtils.getResourcesString; import static org.catrobat.catroid.uiespresso.util.UserVariableAssertions.assertUserVariableEqualsWithTimeout; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/CameraResourceTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/CameraResourceTest.java index b15ac40148e..6281870ff99 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/CameraResourceTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/CameraResourceTest.java @@ -22,8 +22,8 @@ */ package org.catrobat.catroid.uiespresso.content.brick.stage; -import android.support.test.rule.GrantPermissionRule; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.rule.GrantPermissionRule; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.camera.CameraManager; @@ -45,11 +45,11 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.pressBack; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.matcher.ViewMatchers.isRoot; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.pressBack; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.isRoot; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertTrue; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/FlashBrickStageTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/FlashBrickStageTest.java index 7ad480aff0f..3d8f4b3b1b9 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/FlashBrickStageTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/FlashBrickStageTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.content.brick.stage; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.content.bricks.FlashBrick; @@ -38,9 +38,9 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickTestUtils.createProjectAndGetStartScript; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/InsertItemToUserListStageTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/InsertItemToUserListStageTest.java index 9fda9d0858e..5b7be5b2b4b 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/InsertItemToUserListStageTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/InsertItemToUserListStageTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.content.brick.stage; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.content.bricks.InsertItemIntoUserListBrick; import org.catrobat.catroid.formulaeditor.Formula; @@ -37,8 +37,8 @@ import org.junit.Test; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.matcher.ViewMatchers.isRoot; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.matcher.ViewMatchers.isRoot; import static org.junit.Assert.assertEquals; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/PlaySoundBrickStageTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/PlaySoundBrickStageTest.java index 0635b61bd5d..42222ebc055 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/PlaySoundBrickStageTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/PlaySoundBrickStageTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.content.brick.stage; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -52,9 +52,9 @@ import java.io.IOException; import java.util.List; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SayBubbleBrickStageTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SayBubbleBrickStageTest.java index 1c4c8cacf22..4b9e0d103ab 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SayBubbleBrickStageTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SayBubbleBrickStageTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.content.brick.stage; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SayForBubbleBrickStageTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SayForBubbleBrickStageTest.java index 81bafe82d29..12f20dacc2a 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SayForBubbleBrickStageTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SayForBubbleBrickStageTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.content.brick.stage; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; @@ -46,9 +46,9 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.matcher.ViewMatchers.isFocusable; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.isFocusable; import static junit.framework.Assert.assertNotNull; import static junit.framework.Assert.assertNull; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SceneTransitionBrickStageTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SceneTransitionBrickStageTest.java index 8808e878dc0..b007f875b3b 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SceneTransitionBrickStageTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SceneTransitionBrickStageTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.content.brick.stage; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SceneTransitionTouchEventRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SceneTransitionTouchEventRegressionTest.java index 7ae12f3cc55..ce448b57e83 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SceneTransitionTouchEventRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SceneTransitionTouchEventRegressionTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.content.brick.stage; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; @@ -48,9 +48,9 @@ import org.junit.Test; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.matcher.ViewMatchers.isFocusable; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.isFocusable; @RunWith(AndroidJUnit4.class) public class SceneTransitionTouchEventRegressionTest { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/ThinkBubbleBrickStageTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/ThinkBubbleBrickStageTest.java index 40c901dacf9..e7def692d6f 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/ThinkBubbleBrickStageTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/ThinkBubbleBrickStageTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.content.brick.stage; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/ThinkForBubbleBrickStageTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/ThinkForBubbleBrickStageTest.java index 748c24ab19a..fb882a845b9 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/ThinkForBubbleBrickStageTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/ThinkForBubbleBrickStageTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.content.brick.stage; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; @@ -46,9 +46,9 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.matcher.ViewMatchers.isFocusable; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.isFocusable; import static junit.framework.Assert.assertNotNull; import static junit.framework.Assert.assertNull; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/VibrationBrickStageTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/VibrationBrickStageTest.java index 625da37924e..5e413f270dd 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/VibrationBrickStageTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/VibrationBrickStageTest.java @@ -37,9 +37,9 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/WhenNfcBrickHardwareStageTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/WhenNfcBrickHardwareStageTest.java index c3204f1de68..ccafca27d2b 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/WhenNfcBrickHardwareStageTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/WhenNfcBrickHardwareStageTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.content.brick.stage; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -49,9 +49,9 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.content.brick.utils.UiNFCTestUtils.NUM_DETECTED_TAGS; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/WhenNfcBrickStageFromScriptTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/WhenNfcBrickStageFromScriptTest.java index d310d1ddf38..7af1401533c 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/WhenNfcBrickStageFromScriptTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/WhenNfcBrickStageFromScriptTest.java @@ -25,7 +25,7 @@ import android.nfc.NdefMessage; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -54,11 +54,11 @@ import java.util.List; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.pressBack; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.pressBack; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static junit.framework.Assert.assertEquals; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickCoordinatesProvider.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickCoordinatesProvider.java index ff9173a2599..ea6a28e7e58 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickCoordinatesProvider.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickCoordinatesProvider.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.content.brick.utils; -import android.support.test.espresso.action.CoordinatesProvider; +import androidx.test.espresso.action.CoordinatesProvider; import android.util.Log; import android.view.View; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickDataInteractionWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickDataInteractionWrapper.java index a9b53f368af..afd2cc500cc 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickDataInteractionWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickDataInteractionWrapper.java @@ -23,12 +23,12 @@ package org.catrobat.catroid.uiespresso.content.brick.utils; -import android.support.test.espresso.DataInteraction; -import android.support.test.espresso.action.CoordinatesProvider; -import android.support.test.espresso.action.GeneralClickAction; -import android.support.test.espresso.action.Press; -import android.support.test.espresso.action.Swipe; -import android.support.test.espresso.action.Tap; +import androidx.test.espresso.DataInteraction; +import androidx.test.espresso.action.CoordinatesProvider; +import androidx.test.espresso.action.GeneralClickAction; +import androidx.test.espresso.action.Press; +import androidx.test.espresso.action.Swipe; +import androidx.test.espresso.action.Tap; import android.widget.Spinner; import android.widget.TextView; @@ -37,13 +37,13 @@ import org.catrobat.catroid.uiespresso.util.matchers.ScriptListMatchers; import org.catrobat.catroid.uiespresso.util.wrappers.DataInteractionWrapper; -import static android.support.test.espresso.Espresso.onData; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onData; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.core.AnyOf.anyOf; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickFormulaEditTextDataInteractionWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickFormulaEditTextDataInteractionWrapper.java index 2bbb7df79a4..0e0322a0d70 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickFormulaEditTextDataInteractionWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickFormulaEditTextDataInteractionWrapper.java @@ -23,13 +23,13 @@ package org.catrobat.catroid.uiespresso.content.brick.utils; -import android.support.test.espresso.DataInteraction; +import androidx.test.espresso.DataInteraction; import org.catrobat.catroid.uiespresso.util.wrappers.DataInteractionWrapper; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickSpinnerDataInteractionWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickSpinnerDataInteractionWrapper.java index 44c21013ce0..0c32d724e74 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickSpinnerDataInteractionWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickSpinnerDataInteractionWrapper.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.content.brick.utils; -import android.support.test.espresso.DataInteraction; +import androidx.test.espresso.DataInteraction; import org.catrobat.catroid.common.Nameable; import org.catrobat.catroid.uiespresso.util.UiTestUtils; @@ -34,11 +34,11 @@ import java.util.ArrayList; import java.util.List; -import static android.support.test.espresso.Espresso.onData; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onData; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.instanceOf; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickVariableSpinnerDataInteractionWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickVariableSpinnerDataInteractionWrapper.java index 8bacdac02ee..3cfba041a59 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickVariableSpinnerDataInteractionWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickVariableSpinnerDataInteractionWrapper.java @@ -23,23 +23,23 @@ package org.catrobat.catroid.uiespresso.content.brick.utils; -import android.support.test.espresso.DataInteraction; +import androidx.test.espresso.DataInteraction; import org.catrobat.catroid.R; import org.catrobat.catroid.formulaeditor.UserVariable; import java.util.List; -import static android.support.test.espresso.Espresso.onData; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard; -import static android.support.test.espresso.action.ViewActions.pressBack; -import static android.support.test.espresso.action.ViewActions.typeText; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onData; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard; +import static androidx.test.espresso.action.ViewActions.pressBack; +import static androidx.test.espresso.action.ViewActions.typeText; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.util.matchers.UserDataItemMatchers.withUserVariableName; import static org.hamcrest.CoreMatchers.instanceOf; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/ColorPickerInteractionWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/ColorPickerInteractionWrapper.java index 106e45cfe22..5f0d198b127 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/ColorPickerInteractionWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/ColorPickerInteractionWrapper.java @@ -23,17 +23,17 @@ package org.catrobat.catroid.uiespresso.content.brick.utils; -import android.support.test.espresso.ViewInteraction; +import androidx.test.espresso.ViewInteraction; import android.widget.TableRow; import org.catrobat.catroid.uiespresso.util.wrappers.ViewInteractionWrapper; import org.catrobat.paintroid.colorpicker.PresetSelectorView; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.matcher.ViewMatchers.isAssignableFrom; -import static android.support.test.espresso.matcher.ViewMatchers.isDescendantOfA; -import static android.support.test.espresso.matcher.ViewMatchers.withParent; -import static android.support.test.espresso.matcher.ViewMatchers.withParentIndex; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.matcher.ViewMatchers.isAssignableFrom; +import static androidx.test.espresso.matcher.ViewMatchers.isDescendantOfA; +import static androidx.test.espresso.matcher.ViewMatchers.withParent; +import static androidx.test.espresso.matcher.ViewMatchers.withParentIndex; import static org.hamcrest.Matchers.allOf; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/CustomSwipeAction.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/CustomSwipeAction.java index 712a11b3fb8..a421f25233b 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/CustomSwipeAction.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/CustomSwipeAction.java @@ -23,18 +23,18 @@ package org.catrobat.catroid.uiespresso.content.brick.utils; import android.graphics.Point; -import android.support.test.espresso.PerformException; -import android.support.test.espresso.UiController; -import android.support.test.espresso.ViewAction; -import android.support.test.espresso.action.PrecisionDescriber; -import android.support.test.espresso.action.Swiper; -import android.support.test.espresso.util.HumanReadables; +import androidx.test.espresso.PerformException; +import androidx.test.espresso.UiController; +import androidx.test.espresso.ViewAction; +import androidx.test.espresso.action.PrecisionDescriber; +import androidx.test.espresso.action.Swiper; +import androidx.test.espresso.util.HumanReadables; import android.view.View; import android.view.ViewConfiguration; import org.hamcrest.Matcher; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayingAtLeast; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayingAtLeast; public final class CustomSwipeAction implements ViewAction { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/DragNDropBrickAction.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/DragNDropBrickAction.java index 5eefaa63611..4a038f5aa52 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/DragNDropBrickAction.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/DragNDropBrickAction.java @@ -23,12 +23,12 @@ package org.catrobat.catroid.uiespresso.content.brick.utils; -import android.support.test.espresso.UiController; -import android.support.test.espresso.ViewAction; -import android.support.test.espresso.action.CoordinatesProvider; -import android.support.test.espresso.action.PrecisionDescriber; -import android.support.test.espresso.action.Swiper; -import android.support.test.espresso.matcher.ViewMatchers; +import androidx.test.espresso.UiController; +import androidx.test.espresso.ViewAction; +import androidx.test.espresso.action.CoordinatesProvider; +import androidx.test.espresso.action.PrecisionDescriber; +import androidx.test.espresso.action.Swiper; +import androidx.test.espresso.matcher.ViewMatchers; import android.view.View; import android.view.ViewConfiguration; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/UiNFCTestUtils.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/UiNFCTestUtils.java index 872cf5ce163..b36d547e5fc 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/UiNFCTestUtils.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/UiNFCTestUtils.java @@ -29,7 +29,7 @@ import android.nfc.NdefMessage; import android.nfc.NfcAdapter; import android.nfc.Tag; -import android.support.test.espresso.DataInteraction; +import androidx.test.espresso.DataInteraction; import android.util.Log; import android.widget.Spinner; @@ -39,15 +39,15 @@ import java.util.List; -import static android.support.test.espresso.Espresso.onData; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.pressBack; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onData; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.pressBack; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.hamcrest.Matchers.instanceOf; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastAndWaitBrickMessageContainerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastAndWaitBrickMessageContainerTest.java index 574ddaa2368..6284622a7d5 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastAndWaitBrickMessageContainerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastAndWaitBrickMessageContainerTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.content.messagecontainer; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -50,10 +50,10 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static junit.framework.TestCase.assertTrue; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastMessageBrickUtils.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastMessageBrickUtils.java index 3f97d2d18fe..58f9bcb96e4 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastMessageBrickUtils.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastMessageBrickUtils.java @@ -25,7 +25,7 @@ import android.content.DialogInterface; import android.support.test.InstrumentationRegistry; -import android.support.v7.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatActivity; import org.catrobat.catroid.content.bricks.BroadcastMessageBrick; import org.catrobat.catroid.ui.SpriteActivity; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastReceiveBrickMessageContainerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastReceiveBrickMessageContainerTest.java index 0e3bf3a8472..89dfa477a56 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastReceiveBrickMessageContainerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastReceiveBrickMessageContainerTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.content.messagecontainer; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -51,10 +51,10 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static junit.framework.TestCase.assertTrue; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastSendBrickMessageContainerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastSendBrickMessageContainerTest.java index d4e640fde2a..6c37a05e75b 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastSendBrickMessageContainerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastSendBrickMessageContainerTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.content.messagecontainer; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -50,10 +50,10 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static junit.framework.TestCase.assertTrue; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/facedetection/FaceDetectionFormulaEditorComputeDialogTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/facedetection/FaceDetectionFormulaEditorComputeDialogTest.java index 29398925275..7e4bc96df74 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/facedetection/FaceDetectionFormulaEditorComputeDialogTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/facedetection/FaceDetectionFormulaEditorComputeDialogTest.java @@ -24,8 +24,8 @@ import android.Manifest; import android.support.test.InstrumentationRegistry; -import android.support.test.rule.GrantPermissionRule; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.rule.GrantPermissionRule; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -50,10 +50,10 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.pressBack; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.pressBack; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/facedetection/FaceDetectionResourceStartedTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/facedetection/FaceDetectionResourceStartedTest.java index 55ed5968532..29868c7451d 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/facedetection/FaceDetectionResourceStartedTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/facedetection/FaceDetectionResourceStartedTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.facedetection; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -49,10 +49,10 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.pressBack; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.pressBack; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorAddVariableTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorAddVariableTest.java index 2046745b01a..4e92b994f75 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorAddVariableTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorAddVariableTest.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.uiespresso.formulaeditor; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; @@ -39,9 +39,9 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorDataListWrapper.onDataList; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorBrickViewOnClickTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorBrickViewOnClickTest.java index c63111c406c..326ac8b919f 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorBrickViewOnClickTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorBrickViewOnClickTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.formulaeditor; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; @@ -39,13 +39,13 @@ import org.junit.Test; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isClickable; -import static android.support.test.espresso.matcher.ViewMatchers.isEnabled; -import static android.support.test.espresso.matcher.ViewMatchers.isFocusable; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isClickable; +import static androidx.test.espresso.matcher.ViewMatchers.isEnabled; +import static androidx.test.espresso.matcher.ViewMatchers.isFocusable; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorDeleteVariableTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorDeleteVariableTest.java index 81bb46a31e0..79575dd7a13 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorDeleteVariableTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorDeleteVariableTest.java @@ -37,11 +37,11 @@ import org.junit.experimental.categories.Category; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.matcher.RootMatchers.isPlatformPopup; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.RootMatchers.isPlatformPopup; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorDataListWrapper.onDataList; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorDiscardChangesTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorDiscardChangesTest.java index 5907d4dfcc6..cfa8f34a1a5 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorDiscardChangesTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorDiscardChangesTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.formulaeditor; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; @@ -41,13 +41,13 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.pressBack; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.pressBack; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorEditTextTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorEditTextTest.java index 8f17baee9e4..97a800430db 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorEditTextTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorEditTextTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.formulaeditor; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; @@ -41,16 +41,16 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.pressBack; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.action.ViewActions.doubleClick; -import static android.support.test.espresso.action.ViewActions.longClick; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.isRoot; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.pressBack; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.action.ViewActions.doubleClick; +import static androidx.test.espresso.action.ViewActions.longClick; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.isRoot; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.Category.FUNCTIONS; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorFragmentTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorFragmentTest.java index 5c6f58dd8a8..eed1c498ae6 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorFragmentTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorFragmentTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.formulaeditor; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -48,13 +48,13 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.pressBack; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.pressBack; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorFunctionListTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorFunctionListTest.java index e49167959ed..8536d159ec5 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorFunctionListTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorFunctionListTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.formulaeditor; -import android.support.annotation.StringRes; +import androidx.annotation.StringRes; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; @@ -44,8 +44,8 @@ import java.util.Arrays; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorKeyboardTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorKeyboardTest.java index bd0ba3addbd..798fb11de62 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorKeyboardTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorKeyboardTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.formulaeditor; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -45,11 +45,11 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorMovementPropertiesTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorMovementPropertiesTest.java index 07ee7ea5d4e..a7ded7bd102 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorMovementPropertiesTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorMovementPropertiesTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.formulaeditor; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; @@ -38,12 +38,12 @@ import org.junit.Test; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.pressBack; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.pressBack; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorRenameVariableTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorRenameVariableTest.java index c7c956385ca..d1a0ce94034 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorRenameVariableTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorRenameVariableTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.formulaeditor; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; @@ -40,8 +40,8 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorDataListWrapper.onDataList; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorTest.java index c238f624468..d03ec869baa 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.formulaeditor; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -44,9 +44,9 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormularEditorVariableScopeTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormularEditorVariableScopeTest.java index 27bfeabfb8e..e65a9960182 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormularEditorVariableScopeTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormularEditorVariableScopeTest.java @@ -37,11 +37,11 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorDataListWrapper.onDataList; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/FormulaEditorCategoryListWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/FormulaEditorCategoryListWrapper.java index d8b5a9802b5..bef6a8b7cf1 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/FormulaEditorCategoryListWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/FormulaEditorCategoryListWrapper.java @@ -27,10 +27,10 @@ import org.catrobat.catroid.uiespresso.util.UiTestUtils; import org.catrobat.catroid.uiespresso.util.matchers.FormulaEditorCategoryListMatchers; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; public final class FormulaEditorCategoryListWrapper extends RecyclerViewInteractionWrapper { private FormulaEditorCategoryListWrapper() { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/FormulaEditorDataListWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/FormulaEditorDataListWrapper.java index 2760b1f19d4..d14eb5b5376 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/FormulaEditorDataListWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/FormulaEditorDataListWrapper.java @@ -25,16 +25,16 @@ import org.catrobat.catroid.R; import org.catrobat.catroid.uiespresso.util.wrappers.ViewInteractionWrapper; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.pressBack; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard; -import static android.support.test.espresso.action.ViewActions.typeText; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isChecked; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.isNotChecked; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.pressBack; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard; +import static androidx.test.espresso.action.ViewActions.typeText; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isChecked; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.isNotChecked; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; import static org.catrobat.catroid.uiespresso.util.matchers.FormulaEditorDataListMatchers.isDataListView; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/FormulaEditorLocaleVariableComputeTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/FormulaEditorLocaleVariableComputeTest.java index 6554ec252df..f8e12bd2d2e 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/FormulaEditorLocaleVariableComputeTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/FormulaEditorLocaleVariableComputeTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.formulaeditor.utils; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -46,12 +46,12 @@ import org.junit.Test; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.pressBack; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.pressBack; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/FormulaEditorWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/FormulaEditorWrapper.java index 7ce0a431877..0ccc29fba85 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/FormulaEditorWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/FormulaEditorWrapper.java @@ -34,14 +34,14 @@ import java.util.HashMap; import java.util.Map; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.clearText; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.action.ViewActions.typeText; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.clearText; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.action.ViewActions.typeText; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorCategoryListWrapper.onCategoryList; import static org.hamcrest.Matchers.equalToIgnoringWhiteSpace; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/UserDataItemRVInteractionWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/UserDataItemRVInteractionWrapper.java index efeb470cfb5..c72e099dda1 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/UserDataItemRVInteractionWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/UserDataItemRVInteractionWrapper.java @@ -27,14 +27,14 @@ import org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewItemInteractionWrapper; import org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewItemMatcher; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard; -import static android.support.test.espresso.action.ViewActions.longClick; -import static android.support.test.espresso.action.ViewActions.replaceText; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard; +import static androidx.test.espresso.action.ViewActions.longClick; +import static androidx.test.espresso.action.ViewActions.replaceText; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; public abstract class UserDataItemRVInteractionWrapper> extends RecyclerViewItemInteractionWrapper { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/UserListDataItemRVInteractionWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/UserListDataItemRVInteractionWrapper.java index cf58fd70261..1ed631abbb8 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/UserListDataItemRVInteractionWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/UserListDataItemRVInteractionWrapper.java @@ -25,8 +25,8 @@ import org.catrobat.catroid.R; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/UserVariableDataItemRVInteractionWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/UserVariableDataItemRVInteractionWrapper.java index 2c70c8bd2c1..1887b04c48e 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/UserVariableDataItemRVInteractionWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/UserVariableDataItemRVInteractionWrapper.java @@ -25,9 +25,9 @@ import org.catrobat.catroid.R; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/LookFromGalleryIntentDismissTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/LookFromGalleryIntentDismissTest.java index e14e475e1db..c4d71e4ade6 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/LookFromGalleryIntentDismissTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/LookFromGalleryIntentDismissTest.java @@ -28,9 +28,9 @@ import android.app.Instrumentation; import android.content.Intent; import android.support.test.InstrumentationRegistry; -import android.support.test.espresso.intent.Intents; -import android.support.test.rule.GrantPermissionRule; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.intent.Intents; +import androidx.test.rule.GrantPermissionRule; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -50,14 +50,14 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.intent.Intents.intended; -import static android.support.test.espresso.intent.Intents.intending; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasAction; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasExtras; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasType; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.intent.Intents.intended; +import static androidx.test.espresso.intent.Intents.intending; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasAction; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasExtras; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasType; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasExtraIntent; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/LookFromGalleryIntentTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/LookFromGalleryIntentTest.java index e63f6ae3d55..37db29d571f 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/LookFromGalleryIntentTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/LookFromGalleryIntentTest.java @@ -30,9 +30,9 @@ import android.net.Uri; import android.os.Environment; import android.support.test.InstrumentationRegistry; -import android.support.test.espresso.intent.Intents; -import android.support.test.rule.GrantPermissionRule; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.intent.Intents; +import androidx.test.rule.GrantPermissionRule; +import androidx.test.ext.junit.runners.AndroidJUnit4; import android.util.Log; import org.catrobat.catroid.ProjectManager; @@ -58,16 +58,16 @@ import java.io.File; import java.io.IOException; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.intent.Intents.intended; -import static android.support.test.espresso.intent.Intents.intending; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasAction; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasExtras; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasType; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.intent.Intents.intended; +import static androidx.test.espresso.intent.Intents.intending; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasAction; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasExtras; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasType; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.common.FlavoredConstants.DEFAULT_ROOT_DIRECTORY; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/SpriteFromGalleryIntentDismissTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/SpriteFromGalleryIntentDismissTest.java index c3cb83542e0..82dc0dd90da 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/SpriteFromGalleryIntentDismissTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/SpriteFromGalleryIntentDismissTest.java @@ -28,9 +28,9 @@ import android.app.Instrumentation; import android.content.Intent; import android.support.test.InstrumentationRegistry; -import android.support.test.espresso.intent.Intents; -import android.support.test.rule.GrantPermissionRule; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.intent.Intents; +import androidx.test.rule.GrantPermissionRule; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -49,16 +49,16 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; -import static android.support.test.espresso.intent.Intents.intended; -import static android.support.test.espresso.intent.Intents.intending; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasAction; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasExtras; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasType; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.intent.Intents.intended; +import static androidx.test.espresso.intent.Intents.intending; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasAction; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasExtras; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasType; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasExtraIntent; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/SpriteFromGalleryIntentTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/SpriteFromGalleryIntentTest.java index d5093694b56..ef468b46fd0 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/SpriteFromGalleryIntentTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/SpriteFromGalleryIntentTest.java @@ -30,9 +30,9 @@ import android.net.Uri; import android.os.Environment; import android.support.test.InstrumentationRegistry; -import android.support.test.espresso.intent.Intents; -import android.support.test.rule.GrantPermissionRule; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.intent.Intents; +import androidx.test.rule.GrantPermissionRule; +import androidx.test.ext.junit.runners.AndroidJUnit4; import android.util.Log; import org.catrobat.catroid.ProjectManager; @@ -57,17 +57,17 @@ import java.io.File; import java.io.IOException; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.intent.Intents.intended; -import static android.support.test.espresso.intent.Intents.intending; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasAction; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasExtras; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasType; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.intent.Intents.intended; +import static androidx.test.espresso.intent.Intents.intending; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasAction; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasExtras; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasType; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.common.FlavoredConstants.DEFAULT_ROOT_DIRECTORY; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintEditLookIntentTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintEditLookIntentTest.java index 874ff598150..309bb4bd67b 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintEditLookIntentTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintEditLookIntentTest.java @@ -27,8 +27,8 @@ import android.app.Instrumentation; import android.content.Intent; import android.support.test.InstrumentationRegistry; -import android.support.test.espresso.intent.Intents; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.intent.Intents; +import androidx.test.ext.junit.runners.AndroidJUnit4; import android.util.Log; import org.catrobat.catroid.ProjectManager; @@ -57,15 +57,15 @@ import java.io.IOException; import java.util.List; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.intent.Intents.intended; -import static android.support.test.espresso.intent.Intents.intending; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasAction; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasCategories; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasComponent; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasExtras; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.intent.Intents.intended; +import static androidx.test.espresso.intent.Intents.intending; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasAction; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasCategories; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasExtras; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; import static org.catrobat.catroid.common.FlavoredConstants.DEFAULT_ROOT_DIRECTORY; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewLookDiscardIntentTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewLookDiscardIntentTest.java index ee4d45ce935..acccf42488e 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewLookDiscardIntentTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewLookDiscardIntentTest.java @@ -27,8 +27,8 @@ import android.app.Instrumentation; import android.content.Intent; import android.support.test.InstrumentationRegistry; -import android.support.test.espresso.intent.Intents; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.intent.Intents; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -47,14 +47,14 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.intent.Intents.intended; -import static android.support.test.espresso.intent.Intents.intending; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasAction; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasCategories; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasComponent; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.intent.Intents.intended; +import static androidx.test.espresso.intent.Intents.intending; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasAction; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasCategories; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; import static org.hamcrest.Matchers.equalTo; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewLookIntentTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewLookIntentTest.java index 71584e397cc..cad2024e1e1 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewLookIntentTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewLookIntentTest.java @@ -26,8 +26,8 @@ import android.app.Activity; import android.app.Instrumentation; import android.support.test.InstrumentationRegistry; -import android.support.test.espresso.intent.Intents; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.intent.Intents; +import androidx.test.ext.junit.runners.AndroidJUnit4; import android.util.Log; import org.catrobat.catroid.ProjectManager; @@ -52,16 +52,16 @@ import java.io.File; import java.io.IOException; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.intent.Intents.intended; -import static android.support.test.espresso.intent.Intents.intending; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasAction; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasCategories; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasComponent; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.intent.Intents.intended; +import static androidx.test.espresso.intent.Intents.intending; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasAction; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasCategories; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.common.FlavoredConstants.DEFAULT_ROOT_DIRECTORY; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewSpriteDiscardIntentTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewSpriteDiscardIntentTest.java index ac2487a224f..8f2dcce22eb 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewSpriteDiscardIntentTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewSpriteDiscardIntentTest.java @@ -27,8 +27,8 @@ import android.app.Instrumentation; import android.content.Intent; import android.support.test.InstrumentationRegistry; -import android.support.test.espresso.intent.Intents; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.intent.Intents; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -46,14 +46,14 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.intent.Intents.intended; -import static android.support.test.espresso.intent.Intents.intending; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasAction; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasCategories; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasComponent; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.intent.Intents.intended; +import static androidx.test.espresso.intent.Intents.intending; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasAction; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasCategories; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; import static org.hamcrest.Matchers.equalTo; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewSpriteIntentTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewSpriteIntentTest.java index d85a0c0fd52..9b499d12e43 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewSpriteIntentTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewSpriteIntentTest.java @@ -26,8 +26,8 @@ import android.app.Activity; import android.app.Instrumentation; import android.support.test.InstrumentationRegistry; -import android.support.test.espresso.intent.Intents; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.intent.Intents; +import androidx.test.ext.junit.runners.AndroidJUnit4; import android.util.Log; import org.catrobat.catroid.ProjectManager; @@ -54,17 +54,17 @@ import java.io.File; import java.io.IOException; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.intent.Intents.intended; -import static android.support.test.espresso.intent.Intents.intending; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasAction; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasCategories; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasComponent; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.intent.Intents.intended; +import static androidx.test.espresso.intent.Intents.intending; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasAction; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasCategories; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.common.FlavoredConstants.DEFAULT_ROOT_DIRECTORY; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/sounds/gallery/SoundFromGalleryIntentDismissTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/sounds/gallery/SoundFromGalleryIntentDismissTest.java index 2633eb044f8..c3887b31d0d 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/sounds/gallery/SoundFromGalleryIntentDismissTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/sounds/gallery/SoundFromGalleryIntentDismissTest.java @@ -28,9 +28,9 @@ import android.app.Instrumentation; import android.content.Intent; import android.support.test.InstrumentationRegistry; -import android.support.test.espresso.intent.Intents; -import android.support.test.rule.GrantPermissionRule; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.intent.Intents; +import androidx.test.rule.GrantPermissionRule; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -52,14 +52,14 @@ import java.io.IOException; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.intent.Intents.intended; -import static android.support.test.espresso.intent.Intents.intending; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasAction; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasExtras; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasType; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.intent.Intents.intended; +import static androidx.test.espresso.intent.Intents.intending; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasAction; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasExtras; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasType; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasExtraIntent; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/sounds/gallery/SoundFromGalleryIntentTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/sounds/gallery/SoundFromGalleryIntentTest.java index 52376d9c9b3..7fc7d1aad91 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/sounds/gallery/SoundFromGalleryIntentTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/sounds/gallery/SoundFromGalleryIntentTest.java @@ -30,9 +30,9 @@ import android.net.Uri; import android.os.Environment; import android.support.test.InstrumentationRegistry; -import android.support.test.espresso.intent.Intents; -import android.support.test.rule.GrantPermissionRule; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.intent.Intents; +import androidx.test.rule.GrantPermissionRule; +import androidx.test.ext.junit.runners.AndroidJUnit4; import android.util.Log; import org.catrobat.catroid.ProjectManager; @@ -58,16 +58,16 @@ import java.io.File; import java.io.IOException; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.intent.Intents.intended; -import static android.support.test.espresso.intent.Intents.intending; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasAction; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasExtras; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasType; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.intent.Intents.intended; +import static androidx.test.espresso.intent.Intents.intending; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasAction; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasExtras; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasType; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.common.FlavoredConstants.DEFAULT_ROOT_DIRECTORY; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/visualplacement/SpriteActivityVisualPlacementTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/visualplacement/SpriteActivityVisualPlacementTest.java index f8c1ecadcd4..8a64f13b59a 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/visualplacement/SpriteActivityVisualPlacementTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/visualplacement/SpriteActivityVisualPlacementTest.java @@ -26,8 +26,8 @@ import android.app.Activity; import android.app.Instrumentation; import android.content.Intent; -import android.support.test.espresso.intent.Intents; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.intent.Intents; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.content.bricks.PlaceAtBrick; @@ -42,16 +42,16 @@ import org.junit.Test; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.intent.Intents.intended; -import static android.support.test.espresso.intent.Intents.intending; -import static android.support.test.espresso.intent.matcher.IntentMatchers.anyIntent; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasComponent; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasExtra; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.intent.Intents.intended; +import static androidx.test.espresso.intent.Intents.intending; +import static androidx.test.espresso.intent.matcher.IntentMatchers.anyIntent; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasExtra; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.content.bricks.Brick.BrickField.X_POSITION; import static org.catrobat.catroid.ui.SpriteActivity.EXTRA_BRICK_HASH; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/visualplacement/VisualPlacementActivityTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/visualplacement/VisualPlacementActivityTest.java index a537e13221a..b9d6b5b9164 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/visualplacement/VisualPlacementActivityTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/visualplacement/VisualPlacementActivityTest.java @@ -24,9 +24,9 @@ package org.catrobat.catroid.uiespresso.intents.visualplacement; import android.content.Intent; -import android.support.test.espresso.Espresso; -import android.support.test.espresso.intent.rule.IntentsTestRule; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.Espresso; +import androidx.test.espresso.intent.rule.IntentsTestRule; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.test.utils.TestUtils; @@ -38,10 +38,10 @@ import org.junit.Test; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.ui.SpriteActivity.EXTRA_X_TRANSFORM; import static org.catrobat.catroid.ui.SpriteActivity.EXTRA_Y_TRANSFORM; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/permissions/CameraPermissionSpriteActivityTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/permissions/CameraPermissionSpriteActivityTest.java index 685209e81b4..5e57f7bd5a9 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/permissions/CameraPermissionSpriteActivityTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/permissions/CameraPermissionSpriteActivityTest.java @@ -27,8 +27,8 @@ import android.app.Instrumentation; import android.content.Intent; import android.support.test.InstrumentationRegistry; -import android.support.test.espresso.intent.Intents; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.intent.Intents; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -57,14 +57,14 @@ import androidx.test.uiautomator.UiSelector; import static android.Manifest.permission.CAMERA; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.intent.Intents.intended; -import static android.support.test.espresso.intent.Intents.intending; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasAction; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasExtras; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasPackage; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.intent.Intents.intended; +import static androidx.test.espresso.intent.Intents.intending; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasAction; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasExtras; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasPackage; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static junit.framework.Assert.assertTrue; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/pocketmusic/PocketMusicActivityTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/pocketmusic/PocketMusicActivityTest.java index 3ece581b9a2..dc1dbef397d 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/pocketmusic/PocketMusicActivityTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/pocketmusic/PocketMusicActivityTest.java @@ -24,11 +24,11 @@ import android.content.Intent; import android.support.test.InstrumentationRegistry; -import android.support.test.espresso.UiController; -import android.support.test.espresso.ViewAction; -import android.support.test.espresso.contrib.RecyclerViewActions; -import android.support.test.espresso.matcher.BoundedMatcher; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.UiController; +import androidx.test.espresso.ViewAction; +import androidx.test.espresso.contrib.RecyclerViewActions; +import androidx.test.espresso.matcher.BoundedMatcher; +import androidx.test.ext.junit.runners.AndroidJUnit4; import android.view.View; import org.catrobat.catroid.ProjectManager; @@ -59,14 +59,14 @@ import java.util.Locale; import java.util.Random; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.action.ViewActions.swipeLeft; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.contrib.RecyclerViewActions.actionOnItemAtPosition; -import static android.support.test.espresso.contrib.RecyclerViewActions.scrollToPosition; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.action.ViewActions.swipeLeft; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.contrib.RecyclerViewActions.actionOnItemAtPosition; +import static androidx.test.espresso.contrib.RecyclerViewActions.scrollToPosition; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/pocketmusic/RecyclerViewMatcher.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/pocketmusic/RecyclerViewMatcher.java index 1cac7712d14..d880d3b0c48 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/pocketmusic/RecyclerViewMatcher.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/pocketmusic/RecyclerViewMatcher.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.pocketmusic; import android.content.res.Resources; -import android.support.v7.widget.RecyclerView; +import androidx.recyclerview.widget.RecyclerView; import android.view.View; import org.hamcrest.Description; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastAndWaitForDeletedClonesRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastAndWaitForDeletedClonesRegressionTest.java index 9be50c49ed2..ca298705a86 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastAndWaitForDeletedClonesRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastAndWaitForDeletedClonesRegressionTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.stage; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.BroadcastScript; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastForClonesRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastForClonesRegressionTest.java index 12cac2e8acd..5527378d624 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastForClonesRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastForClonesRegressionTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.stage; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -48,10 +48,10 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.pressBack; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.pressBack; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.catrobat.catroid.uiespresso.util.UserVariableAssertions.assertUserVariableEqualsWithTimeout; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastForDeletedClonesRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastForDeletedClonesRegressionTest.java index 256bd34addc..3c7678c5f81 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastForDeletedClonesRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastForDeletedClonesRegressionTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.stage; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.BroadcastScript; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastReceiverRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastReceiverRegressionTest.java index 47f976ecdcf..e3d9cd13d7c 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastReceiverRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastReceiverRegressionTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.stage; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.content.BroadcastScript; @@ -51,10 +51,10 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.pressBack; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.pressBack; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.catrobat.catroid.uiespresso.util.UserVariableAssertions.assertUserVariableEqualsWithTimeout; import static org.catrobat.catroid.uiespresso.util.UserVariableAssertions.assertUserVariableIsGreaterThanWithTimeout; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/DisabledBrickInClonesRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/DisabledBrickInClonesRegressionTest.java index 10e3c1ce6db..c30a6e60ce2 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/DisabledBrickInClonesRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/DisabledBrickInClonesRegressionTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.stage; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/MultipleBroadcastsTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/MultipleBroadcastsTest.java index b0319edbb40..ba413e27d12 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/MultipleBroadcastsTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/MultipleBroadcastsTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.stage; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.content.Project; import org.catrobat.catroid.content.Script; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/ObjectVariableTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/ObjectVariableTest.java index 9514cf5f50f..b4d825c0680 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/ObjectVariableTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/ObjectVariableTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.stage; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StagePausedTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StagePausedTest.java index 926b584623e..74efd027dfc 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StagePausedTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StagePausedTest.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.uiespresso.stage; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.scenes.scene2d.InputEvent; import com.badlogic.gdx.scenes.scene2d.InputListener; @@ -39,11 +39,11 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.pressBack; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.matcher.ViewMatchers.isRoot; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.pressBack; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.isRoot; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StageResourceFailedTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StageResourceFailedTest.java index 5c71935b87e..ff59cfcfcd5 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StageResourceFailedTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StageResourceFailedTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.stage; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -48,11 +48,11 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.isRoot; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.isRoot; +import static androidx.test.espresso.matcher.ViewMatchers.withText; @RunWith(AndroidJUnit4.class) public class StageResourceFailedTest { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StageSimpleTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StageSimpleTest.java index 442be4f9532..8dba9bd7837 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StageSimpleTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StageSimpleTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.stage; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.common.LookData; @@ -50,9 +50,9 @@ import java.io.File; import java.io.IOException; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isFocusable; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isFocusable; import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StartStageTouchTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StartStageTouchTest.java index d6b6fbf51e6..5f516c46210 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StartStageTouchTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StartStageTouchTest.java @@ -56,9 +56,9 @@ import java.util.LinkedList; import java.util.List; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.matcher.ViewMatchers.isFocusable; -import static android.support.test.espresso.matcher.ViewMatchers.isRoot; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.matcher.ViewMatchers.isFocusable; +import static androidx.test.espresso.matcher.ViewMatchers.isRoot; import static org.catrobat.catroid.uiespresso.util.UserVariableAssertions.assertUserVariableEqualsWithTimeout; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/utils/StageTestTouchUtils.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/utils/StageTestTouchUtils.java index 9bc79359c00..a921778e069 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/utils/StageTestTouchUtils.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/utils/StageTestTouchUtils.java @@ -23,15 +23,15 @@ package org.catrobat.catroid.uiespresso.stage.utils; -import android.support.test.espresso.UiController; -import android.support.test.espresso.ViewAction; -import android.support.test.espresso.action.MotionEvents; +import androidx.test.espresso.UiController; +import androidx.test.espresso.ViewAction; +import androidx.test.espresso.action.MotionEvents; import android.view.MotionEvent; import android.view.View; import org.hamcrest.Matcher; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; public final class StageTestTouchUtils { private StageTestTouchUtils() { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionBarFormulaEditorTitleTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionBarFormulaEditorTitleTest.java index 459b5366040..f8c357c7d90 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionBarFormulaEditorTitleTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionBarFormulaEditorTitleTest.java @@ -37,11 +37,11 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openContextualActionModeOverflowMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openContextualActionModeOverflowMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorDataListWrapper.onDataList; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionBarScriptTitleAfterExitingFormulaEditorOneSceneProjectTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionBarScriptTitleAfterExitingFormulaEditorOneSceneProjectTest.java index 79dd20041f5..5259bcda343 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionBarScriptTitleAfterExitingFormulaEditorOneSceneProjectTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionBarScriptTitleAfterExitingFormulaEditorOneSceneProjectTest.java @@ -23,8 +23,8 @@ package org.catrobat.catroid.uiespresso.ui.actionbar; -import android.support.test.espresso.Espresso; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.Espresso; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -41,9 +41,9 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.catrobat.catroid.uiespresso.ui.actionbar.utils.ActionBarWrapper.onActionBar; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionBarScriptTitleAfterExitingFormulaEditorTwoScenesProjectTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionBarScriptTitleAfterExitingFormulaEditorTwoScenesProjectTest.java index 8d92ff0c492..0dc09f163a3 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionBarScriptTitleAfterExitingFormulaEditorTwoScenesProjectTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionBarScriptTitleAfterExitingFormulaEditorTwoScenesProjectTest.java @@ -24,8 +24,8 @@ package org.catrobat.catroid.uiespresso.ui.actionbar; import android.support.test.InstrumentationRegistry; -import android.support.test.espresso.Espresso; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.Espresso; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -42,9 +42,9 @@ import org.junit.Test; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.catrobat.catroid.uiespresso.ui.actionbar.utils.ActionBarWrapper.onActionBar; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionModeDataFragmentTitleTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionModeDataFragmentTitleTest.java index 0a8acc6c9a8..20ebc7ad1da 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionModeDataFragmentTitleTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionModeDataFragmentTitleTest.java @@ -41,11 +41,11 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openContextualActionModeOverflowMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openContextualActionModeOverflowMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorDataListWrapper.onDataList; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionModeMergeTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionModeMergeTest.java index 325161dcdfc..b33cd182c9e 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionModeMergeTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionModeMergeTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.ui.actionbar; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.common.BrickValues; @@ -48,14 +48,14 @@ import org.junit.runner.RunWith; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isChecked; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.isNotChecked; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isChecked; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.isNotChecked; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.ui.actionbar.utils.ActionModeWrapper.onActionMode; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/utils/ActionBarWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/utils/ActionBarWrapper.java index acbed712d3a..be1297f1242 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/utils/ActionBarWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/utils/ActionBarWrapper.java @@ -31,14 +31,14 @@ import org.catrobat.catroid.uiespresso.util.UiTestUtils; import org.hamcrest.Matcher; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withContentDescription; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withParent; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withContentDescription; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withParent; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.instanceOf; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/utils/ActionModeWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/utils/ActionModeWrapper.java index 93187891a7f..9f9a8b9ed9f 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/utils/ActionModeWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/utils/ActionModeWrapper.java @@ -28,12 +28,12 @@ import org.catrobat.catroid.R; import org.hamcrest.Matcher; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; public final class ActionModeWrapper { public static final Matcher TITLE_MATCHER = withId(R.id.action_bar_title); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/OpenFromShareLinkTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/OpenFromShareLinkTest.java index 8164934e234..41b41ab3cfe 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/OpenFromShareLinkTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/OpenFromShareLinkTest.java @@ -29,7 +29,7 @@ import android.net.Uri; import android.preference.PreferenceManager; import android.support.test.InstrumentationRegistry; -import android.support.test.espresso.intent.Intents; +import androidx.test.espresso.intent.Intents; import org.catrobat.catroid.R; import org.catrobat.catroid.testsuites.annotations.Cat; @@ -49,9 +49,9 @@ import java.util.Arrays; -import static android.support.test.espresso.intent.Intents.intended; -import static android.support.test.espresso.intent.Intents.intending; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasExtras; +import static androidx.test.espresso.intent.Intents.intended; +import static androidx.test.espresso.intent.Intents.intending; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasExtras; import static org.catrobat.catroid.common.SharedPreferenceKeys.AGREED_TO_PRIVACY_POLICY_VERSION; import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasMatchingString; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/PrivacyPolicyDisclaimerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/PrivacyPolicyDisclaimerTest.java index c3ef075a335..64bd9299479 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/PrivacyPolicyDisclaimerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/PrivacyPolicyDisclaimerTest.java @@ -26,7 +26,7 @@ import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.ui.MainMenuActivity; @@ -38,11 +38,11 @@ import org.junit.Test; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.common.SharedPreferenceKeys.AGREED_TO_PRIVACY_POLICY_VERSION; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectActivityNumberOfBricksRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectActivityNumberOfBricksRegressionTest.java index e4730d6a569..4ff5c831644 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectActivityNumberOfBricksRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectActivityNumberOfBricksRegressionTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.ui.activity; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -52,11 +52,11 @@ import java.util.Locale; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectActivityTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectActivityTest.java index bd93ca96daa..a7325c8253e 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectActivityTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectActivityTest.java @@ -29,8 +29,8 @@ import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.support.test.InstrumentationRegistry; -import android.support.test.espresso.intent.Intents; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.intent.Intents; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -53,14 +53,14 @@ import org.junit.runner.RunWith; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.intent.Intents.intended; -import static android.support.test.espresso.intent.Intents.intending; -import static android.support.test.espresso.intent.matcher.IntentMatchers.anyIntent; -import static android.support.test.espresso.intent.matcher.IntentMatchers.hasComponent; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.intent.Intents.intended; +import static androidx.test.espresso.intent.Intents.intending; +import static androidx.test.espresso.intent.matcher.IntentMatchers.anyIntent; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.hamcrest.core.AllOf.allOf; import static org.junit.Assert.assertEquals; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectListActivityTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectListActivityTest.java index a1676c9def2..3e37fd80357 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectListActivityTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectListActivityTest.java @@ -27,7 +27,7 @@ import android.content.res.AssetManager; import android.preference.PreferenceManager; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.io.StorageOperations; import org.catrobat.catroid.testsuites.annotations.Cat; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectUploadRatingDialogTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectUploadRatingDialogTest.java index f1707421b25..9eeba1cae58 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectUploadRatingDialogTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectUploadRatingDialogTest.java @@ -29,7 +29,7 @@ import android.os.Bundle; import android.preference.PreferenceManager; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Project; @@ -46,13 +46,13 @@ import org.junit.Test; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.common.Constants.UPLOAD_RESULT_RECEIVER_RESULT_CODE; import static org.catrobat.catroid.ui.ProjectUploadActivity.NUMBER_OF_UPLOADED_PROJECTS; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/SettingsFragmentTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/SettingsFragmentTest.java index e94a32bb172..ce7df4a955e 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/SettingsFragmentTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/SettingsFragmentTest.java @@ -26,8 +26,8 @@ import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.support.test.InstrumentationRegistry; -import android.support.test.espresso.matcher.PreferenceMatchers; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.matcher.PreferenceMatchers; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.testsuites.annotations.Cat; @@ -48,14 +48,14 @@ import java.util.Locale; import java.util.Map; -import static android.support.test.espresso.Espresso.onData; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withParent; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onData; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withParent; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/rtl/HindiNumberAtShowDetailsAtProjectActivityTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/rtl/HindiNumberAtShowDetailsAtProjectActivityTest.java index c9c197b9077..397861fe97e 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/rtl/HindiNumberAtShowDetailsAtProjectActivityTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/rtl/HindiNumberAtShowDetailsAtProjectActivityTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.ui.activity.rtl; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -54,11 +54,11 @@ import java.util.Locale; import static android.support.test.InstrumentationRegistry.getTargetContext; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openContextualActionModeOverflowMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openContextualActionModeOverflowMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertTrue; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/rtl/LanguagePickerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/rtl/LanguagePickerTest.java index a3070af7d03..82d40b992ad 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/rtl/LanguagePickerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/rtl/LanguagePickerTest.java @@ -26,8 +26,8 @@ import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.support.test.InstrumentationRegistry; -import android.support.test.espresso.matcher.PreferenceMatchers; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.matcher.PreferenceMatchers; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.testsuites.annotations.Cat; @@ -45,10 +45,10 @@ import java.util.Locale; -import static android.support.test.espresso.Espresso.onData; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.Espresso.onData; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; import static org.catrobat.catroid.common.SharedPreferenceKeys.AGREED_TO_PRIVACY_POLICY_VERSION; import static org.hamcrest.Matchers.hasToString; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/rtl/RTLMainMenuTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/rtl/RTLMainMenuTest.java index 4083aabb6c8..dfd2fc17274 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/rtl/RTLMainMenuTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/rtl/RTLMainMenuTest.java @@ -27,7 +27,7 @@ import android.content.res.Configuration; import android.preference.PreferenceManager; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import android.view.View; import org.catrobat.catroid.R; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/AboutDialogTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/AboutDialogTest.java index a1fc5ea5c19..e2194237eae 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/AboutDialogTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/AboutDialogTest.java @@ -25,7 +25,7 @@ import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.testsuites.annotations.Cat; @@ -40,13 +40,13 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.common.SharedPreferenceKeys.AGREED_TO_PRIVACY_POLICY_VERSION; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/DeleteLookDialogTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/DeleteLookDialogTest.java index df41e71497d..1b6d0b226ea 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/DeleteLookDialogTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/DeleteLookDialogTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.ui.dialog; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -50,15 +50,15 @@ import java.util.List; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.RootMatchers.isDialog; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.RootMatchers.isDialog; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/DeleteSoundDialogTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/DeleteSoundDialogTest.java index 9eeecf23b2c..9dc22dfb6a4 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/DeleteSoundDialogTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/DeleteSoundDialogTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.ui.dialog; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -50,15 +50,15 @@ import java.util.List; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.RootMatchers.isDialog; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.RootMatchers.isDialog; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/DeleteSpriteDialogTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/DeleteSpriteDialogTest.java index 9b4fa597a08..e5bf85d3d55 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/DeleteSpriteDialogTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/DeleteSpriteDialogTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.ui.dialog; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -43,15 +43,15 @@ import org.junit.runner.RunWith; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.RootMatchers.isDialog; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.RootMatchers.isDialog; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; import static org.hamcrest.Matchers.allOf; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/FormulaEditorComputeDialogTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/FormulaEditorComputeDialogTest.java index f2921a7d718..36eb2d84b41 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/FormulaEditorComputeDialogTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/FormulaEditorComputeDialogTest.java @@ -23,12 +23,12 @@ package org.catrobat.catroid.uiespresso.ui.dialog; import android.support.test.InstrumentationRegistry; -import android.support.test.espresso.ViewAction; -import android.support.test.espresso.action.CoordinatesProvider; -import android.support.test.espresso.action.GeneralClickAction; -import android.support.test.espresso.action.Press; -import android.support.test.espresso.action.Tap; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.ViewAction; +import androidx.test.espresso.action.CoordinatesProvider; +import androidx.test.espresso.action.GeneralClickAction; +import androidx.test.espresso.action.Press; +import androidx.test.espresso.action.Tap; +import androidx.test.ext.junit.runners.AndroidJUnit4; import android.view.View; import org.catrobat.catroid.ProjectManager; @@ -50,13 +50,13 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.pressBack; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.pressBack; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/LegoSensorPortConfigDialogTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/LegoSensorPortConfigDialogTest.java index 19b5719e4a4..697c7646e4b 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/LegoSensorPortConfigDialogTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/LegoSensorPortConfigDialogTest.java @@ -48,12 +48,12 @@ import java.io.IOException; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isEnabled; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isEnabled; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/OrientationDialogTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/OrientationDialogTest.java index 0bca88e25a0..c4f802ae48c 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/OrientationDialogTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/OrientationDialogTest.java @@ -26,7 +26,7 @@ import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.testsuites.annotations.Cat; @@ -42,15 +42,15 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard; -import static android.support.test.espresso.action.ViewActions.replaceText; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.isEnabled; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard; +import static androidx.test.espresso.action.ViewActions.replaceText; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.isEnabled; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.common.SharedPreferenceKeys.AGREED_TO_PRIVACY_POLICY_VERSION; import static org.catrobat.catroid.ui.settingsfragments.SettingsFragment.SETTINGS_CAST_GLOBALLY_ENABLED; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/PlaySceneDialogTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/PlaySceneDialogTest.java index 849a818d57f..67ea3bb668f 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/PlaySceneDialogTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/PlaySceneDialogTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.ui.dialog; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -41,12 +41,12 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isChecked; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isChecked; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static junit.framework.Assert.assertEquals; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/TermsOfUseDialogTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/TermsOfUseDialogTest.java index c4dc097ddd6..9009d009c58 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/TermsOfUseDialogTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/TermsOfUseDialogTest.java @@ -25,7 +25,7 @@ import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.testsuites.annotations.Cat; @@ -41,14 +41,14 @@ import org.junit.runner.RunWith; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.common.SharedPreferenceKeys.AGREED_TO_PRIVACY_POLICY_VERSION; import static org.hamcrest.Matchers.allOf; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/utils/LegoSensorPortConfigDialogWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/utils/LegoSensorPortConfigDialogWrapper.java index 9f40b2b5092..67488d67f5f 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/utils/LegoSensorPortConfigDialogWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/utils/LegoSensorPortConfigDialogWrapper.java @@ -23,8 +23,8 @@ package org.catrobat.catroid.uiespresso.ui.dialog.utils; -import android.support.annotation.IntDef; -import android.support.test.espresso.ViewInteraction; +import androidx.annotation.IntDef; +import androidx.test.espresso.ViewInteraction; import org.catrobat.catroid.R; import org.catrobat.catroid.uiespresso.util.UiTestUtils; @@ -32,12 +32,12 @@ import java.lang.annotation.Retention; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.RootMatchers.isDialog; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.RootMatchers.isDialog; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static java.lang.annotation.RetentionPolicy.SOURCE; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/AddUserbrickTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/AddUserbrickTest.java index 46c3cedff81..dfcaceed81d 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/AddUserbrickTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/AddUserbrickTest.java @@ -39,12 +39,12 @@ import java.io.IOException; -import static android.support.test.espresso.Espresso.onData; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.Espresso.onData; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.instanceOf; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopyLookTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopyLookTest.java index a069a4c5f1a..97e45437128 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopyLookTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopyLookTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.ui.fragment; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -49,13 +49,13 @@ import java.util.List; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopyProjectTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopyProjectTest.java index fced8d0ba75..6b6fcfc26c4 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopyProjectTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopyProjectTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.ui.fragment; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -57,13 +57,13 @@ import java.util.List; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopySceneTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopySceneTest.java index 1eda0415e79..f2f3945863d 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopySceneTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopySceneTest.java @@ -25,7 +25,7 @@ import android.content.Context; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -57,13 +57,13 @@ import java.io.File; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static junit.framework.TestCase.assertEquals; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopySoundTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopySoundTest.java index e4fa52ffd78..cca0ccbf9fc 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopySoundTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopySoundTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.ui.fragment; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -49,13 +49,13 @@ import java.util.List; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteAllScenesTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteAllScenesTest.java index a1268d6a8dc..1d43c27de10 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteAllScenesTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteAllScenesTest.java @@ -25,7 +25,7 @@ import android.content.Context; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -46,15 +46,15 @@ import org.junit.runner.RunWith; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.RootMatchers.isDialog; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.RootMatchers.isDialog; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.hamcrest.Matchers.allOf; import static org.junit.Assert.assertEquals; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteFirstSceneTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteFirstSceneTest.java index a5442e232b3..61cf7b8c4f4 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteFirstSceneTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteFirstSceneTest.java @@ -25,7 +25,7 @@ import android.content.Context; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -50,15 +50,15 @@ import org.junit.runner.RunWith; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.RootMatchers.isDialog; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.RootMatchers.isDialog; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; import static org.hamcrest.Matchers.allOf; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteLookTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteLookTest.java index 35b06c03c8f..686789f47be 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteLookTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteLookTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.ui.fragment; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -50,15 +50,15 @@ import java.util.List; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.RootMatchers.isDialog; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.RootMatchers.isDialog; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteProjectTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteProjectTest.java index 2e5f296452e..0f928732425 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteProjectTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteProjectTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.ui.fragment; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.common.BrickValues; @@ -48,15 +48,15 @@ import org.junit.runner.RunWith; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.RootMatchers.isDialog; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.RootMatchers.isDialog; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; import static org.hamcrest.Matchers.allOf; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteSoundTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteSoundTest.java index bf7e6242048..54c45ae44ee 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteSoundTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteSoundTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.ui.fragment; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -50,15 +50,15 @@ import java.util.List; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.RootMatchers.isDialog; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.RootMatchers.isDialog; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/MergeProjectDialogTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/MergeProjectDialogTest.java index 8ab8ded07b6..6aa61b2786f 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/MergeProjectDialogTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/MergeProjectDialogTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.ui.fragment; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.common.BrickValues; @@ -47,14 +47,14 @@ import org.junit.runner.RunWith; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.RootMatchers.isDialog; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.RootMatchers.isDialog; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; import static org.hamcrest.core.AllOf.allOf; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/MergeProjectNameTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/MergeProjectNameTest.java index e12d6c69522..ccc615811d9 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/MergeProjectNameTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/MergeProjectNameTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.ui.fragment; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import android.widget.EditText; import org.catrobat.catroid.R; @@ -48,16 +48,16 @@ import org.junit.runner.RunWith; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.closeSoftKeyboard; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.action.ViewActions.replaceText; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.isEnabled; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.closeSoftKeyboard; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.action.ViewActions.replaceText; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.isEnabled; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; import static org.hamcrest.Matchers.allOf; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameLookTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameLookTest.java index f8f175c7972..41e208e54cb 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameLookTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameLookTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.ui.fragment; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import android.widget.EditText; import org.catrobat.catroid.ProjectManager; @@ -51,17 +51,17 @@ import java.util.List; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.closeSoftKeyboard; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.action.ViewActions.replaceText; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.RootMatchers.isDialog; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.isEnabled; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.closeSoftKeyboard; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.action.ViewActions.replaceText; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.RootMatchers.isDialog; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.isEnabled; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameProjectTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameProjectTest.java index a265540ffed..a742a6063d0 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameProjectTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameProjectTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.ui.fragment; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import android.widget.EditText; import org.catrobat.catroid.R; @@ -48,17 +48,17 @@ import org.junit.runner.RunWith; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.closeSoftKeyboard; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.action.ViewActions.replaceText; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.RootMatchers.isDialog; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.isEnabled; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.closeSoftKeyboard; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.action.ViewActions.replaceText; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.RootMatchers.isDialog; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.isEnabled; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; import static org.hamcrest.Matchers.allOf; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameSceneTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameSceneTest.java index 07c9297cf17..0799c32917e 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameSceneTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameSceneTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.ui.fragment; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import android.widget.EditText; import org.catrobat.catroid.ProjectManager; @@ -45,16 +45,16 @@ import org.junit.runner.RunWith; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.closeSoftKeyboard; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.action.ViewActions.replaceText; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.RootMatchers.isDialog; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.closeSoftKeyboard; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.action.ViewActions.replaceText; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.RootMatchers.isDialog; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static junit.framework.Assert.assertEquals; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameSoundTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameSoundTest.java index 2f5b7e61641..01cb0f29755 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameSoundTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameSoundTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.ui.fragment; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import android.widget.EditText; import org.catrobat.catroid.ProjectManager; @@ -51,17 +51,17 @@ import java.util.List; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.closeSoftKeyboard; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.action.ViewActions.replaceText; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.RootMatchers.isDialog; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.isEnabled; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.closeSoftKeyboard; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.action.ViewActions.replaceText; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.RootMatchers.isDialog; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.isEnabled; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameSpriteTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameSpriteTest.java index e96e3276652..754bb9a327e 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameSpriteTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameSpriteTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.ui.fragment; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import android.widget.EditText; import org.catrobat.catroid.ProjectManager; @@ -45,18 +45,18 @@ import org.junit.runner.RunWith; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.closeSoftKeyboard; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.action.ViewActions.replaceText; -import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.RootMatchers.isDialog; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.isEnabled; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.closeSoftKeyboard; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.action.ViewActions.replaceText; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.RootMatchers.isDialog; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.isEnabled; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; import static org.hamcrest.Matchers.allOf; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/ScriptFragmentTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/ScriptFragmentTest.java index e6887ff5a8d..de8cd1ac883 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/ScriptFragmentTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/ScriptFragmentTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.ui.fragment; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -49,18 +49,18 @@ import org.junit.Test; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onData; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openContextualActionModeOverflowMenu; -import static android.support.test.espresso.Espresso.pressBack; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isChecked; -import static android.support.test.espresso.matcher.ViewMatchers.isEnabled; -import static android.support.test.espresso.matcher.ViewMatchers.withContentDescription; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onData; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openContextualActionModeOverflowMenu; +import static androidx.test.espresso.Espresso.pressBack; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isChecked; +import static androidx.test.espresso.matcher.ViewMatchers.isEnabled; +import static androidx.test.espresso.matcher.ViewMatchers.withContentDescription; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static junit.framework.TestCase.assertTrue; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/SpriteListFragmentExplanationTextNoObjectsProjectTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/SpriteListFragmentExplanationTextNoObjectsProjectTest.java index 56608eca3c1..92e90c5f3eb 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/SpriteListFragmentExplanationTextNoObjectsProjectTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/SpriteListFragmentExplanationTextNoObjectsProjectTest.java @@ -25,7 +25,7 @@ import android.app.Activity; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -37,12 +37,12 @@ import org.junit.Test; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.hamcrest.core.AllOf.allOf; import static org.hamcrest.core.IsNot.not; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/SpriteListFragmentExplanationTextProjectWithObjectTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/SpriteListFragmentExplanationTextProjectWithObjectTest.java index cd0a48ec97c..33bc0680006 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/SpriteListFragmentExplanationTextProjectWithObjectTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/SpriteListFragmentExplanationTextProjectWithObjectTest.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.ui.fragment; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.ui.ProjectActivity; @@ -35,13 +35,13 @@ import org.junit.runner.RunWith; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; import static org.hamcrest.Matchers.allOf; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewInteractionWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewInteractionWrapper.java index 85206d03893..8bf8a302911 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewInteractionWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewInteractionWrapper.java @@ -23,18 +23,18 @@ package org.catrobat.catroid.uiespresso.ui.fragment.rvutils; -import android.support.test.espresso.ViewAction; -import android.support.test.espresso.ViewInteraction; +import androidx.test.espresso.ViewAction; +import androidx.test.espresso.ViewInteraction; import android.view.View; import org.catrobat.catroid.R; import org.catrobat.catroid.uiespresso.util.wrappers.ViewInteractionWrapper; import org.hamcrest.Matcher; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.contrib.RecyclerViewActions.actionOnHolderItem; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.contrib.RecyclerViewActions.actionOnHolderItem; +import static androidx.test.espresso.matcher.ViewMatchers.withId; public class RecyclerViewInteractionWrapper extends ViewInteractionWrapper { private static int recyclerViewId = R.id.recycler_view; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewItemInteractionWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewItemInteractionWrapper.java index 1a2aab30bc4..b59ca7f00cc 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewItemInteractionWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewItemInteractionWrapper.java @@ -23,13 +23,13 @@ package org.catrobat.catroid.uiespresso.ui.fragment.rvutils; -import android.support.test.espresso.ViewInteraction; +import androidx.test.espresso.ViewInteraction; import org.catrobat.catroid.R; import org.catrobat.catroid.uiespresso.util.wrappers.ViewInteractionWrapper; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; public class RecyclerViewItemInteractionWrapper extends ViewInteractionWrapper { protected static int recyclerViewId = R.id.recycler_view; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewItemMatcher.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewItemMatcher.java index cf9cd7b913e..9a323ed0583 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewItemMatcher.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewItemMatcher.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.ui.fragment.rvutils; -import android.support.v7.widget.RecyclerView; +import androidx.recyclerview.widget.RecyclerView; import android.view.View; import org.hamcrest.Description; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewMatcher.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewMatcher.java index a09e5227278..1e1a2a672e0 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewMatcher.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewMatcher.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.ui.fragment.rvutils; -import android.support.v7.widget.RecyclerView; +import androidx.recyclerview.widget.RecyclerView; import android.view.View; import org.hamcrest.Description; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/hints/Android9SnackbarRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/hints/Android9SnackbarRegressionTest.java index 68531a87de3..b437f020db9 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/hints/Android9SnackbarRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/hints/Android9SnackbarRegressionTest.java @@ -26,7 +26,7 @@ import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -48,12 +48,12 @@ import java.util.HashSet; import java.util.Set; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.isRoot; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.isRoot; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.hamcrest.core.AllOf.allOf; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/FormulaEditorFragmentActivityRecreateRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/FormulaEditorFragmentActivityRecreateRegressionTest.java index 8105188ab48..7b6ff0d5020 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/FormulaEditorFragmentActivityRecreateRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/FormulaEditorFragmentActivityRecreateRegressionTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.ui.regression.activitydestroy; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; @@ -43,14 +43,14 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.RootMatchers.isDialog; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.RootMatchers.isDialog; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.FORMULA_EDITOR_KEYBOARD_MATCHER; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/LegoConfigDialogActivityRecreationRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/LegoConfigDialogActivityRecreationRegressionTest.java index fc6ae353e69..d2b906792b8 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/LegoConfigDialogActivityRecreationRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/LegoConfigDialogActivityRecreationRegressionTest.java @@ -48,8 +48,8 @@ import java.io.IOException; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/LookFragmentActivityRecreateRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/LookFragmentActivityRecreateRegressionTest.java index 8faf7b2522e..07c1f2aa635 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/LookFragmentActivityRecreateRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/LookFragmentActivityRecreateRegressionTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.ui.regression.activitydestroy; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -51,14 +51,14 @@ import java.util.List; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.RootMatchers.isDialog; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.RootMatchers.isDialog; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/MainMenuFragemtnActivityRecreateRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/MainMenuFragemtnActivityRecreateRegressionTest.java index d4b57bf1425..2062baf6008 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/MainMenuFragemtnActivityRecreateRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/MainMenuFragemtnActivityRecreateRegressionTest.java @@ -25,7 +25,7 @@ import android.preference.PreferenceManager; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.rules.FlakyTestRule; @@ -42,17 +42,17 @@ import org.junit.runner.RunWith; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard; -import static android.support.test.espresso.action.ViewActions.typeText; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.RootMatchers.isDialog; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withClassName; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard; +import static androidx.test.espresso.action.ViewActions.typeText; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.RootMatchers.isDialog; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withClassName; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.hamcrest.Matchers.is; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/NewMessageDialogActivityRecreateRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/NewMessageDialogActivityRecreateRegressionTest.java index ec4e1de18fc..91a2f6b391d 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/NewMessageDialogActivityRecreateRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/NewMessageDialogActivityRecreateRegressionTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.ui.regression.activitydestroy; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; @@ -42,12 +42,12 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.RootMatchers.isDialog; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.RootMatchers.isDialog; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/ProjectListActivityRecreateRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/ProjectListActivityRecreateRegressionTest.java index c1ce2a5f0be..40ef8581fe2 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/ProjectListActivityRecreateRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/ProjectListActivityRecreateRegressionTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.ui.regression.activitydestroy; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -50,17 +50,17 @@ import org.junit.runner.RunWith; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard; -import static android.support.test.espresso.action.ViewActions.typeText; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.RootMatchers.isDialog; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withClassName; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard; +import static androidx.test.espresso.action.ViewActions.typeText; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.RootMatchers.isDialog; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withClassName; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; import static org.hamcrest.Matchers.is; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/SceneFragmentActivityRecreateRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/SceneFragmentActivityRecreateRegressionTest.java index 810ffa3a108..38ed9caff07 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/SceneFragmentActivityRecreateRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/SceneFragmentActivityRecreateRegressionTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.ui.regression.activitydestroy; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -43,14 +43,14 @@ import org.junit.runner.RunWith; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.RootMatchers.isDialog; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.RootMatchers.isDialog; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/ScriptFragmentActivityRecreateRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/ScriptFragmentActivityRecreateRegressionTest.java index dd868b3b87b..d0a0545041f 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/ScriptFragmentActivityRecreateRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/ScriptFragmentActivityRecreateRegressionTest.java @@ -24,10 +24,10 @@ package org.catrobat.catroid.uiespresso.ui.regression.activitydestroy; import android.support.test.InstrumentationRegistry; -import android.support.test.espresso.action.GeneralClickAction; -import android.support.test.espresso.action.Press; -import android.support.test.espresso.action.Tap; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.action.GeneralClickAction; +import androidx.test.espresso.action.Press; +import androidx.test.espresso.action.Tap; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; @@ -46,10 +46,10 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/SoundFragmentActivityRecreateRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/SoundFragmentActivityRecreateRegressionTest.java index 83b466b5004..03d914f7bcd 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/SoundFragmentActivityRecreateRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/SoundFragmentActivityRecreateRegressionTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.ui.regression.activitydestroy; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -51,14 +51,14 @@ import java.util.List; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.RootMatchers.isDialog; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.RootMatchers.isDialog; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/SpriteListFragmentActivityRecreateRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/SpriteListFragmentActivityRecreateRegressionTest.java index 72ced7edcb5..4f7644c8582 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/SpriteListFragmentActivityRecreateRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/SpriteListFragmentActivityRecreateRegressionTest.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.uiespresso.ui.regression.activitydestroy; import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -43,14 +43,14 @@ import org.junit.runner.RunWith; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.assertion.ViewAssertions.matches; -import static android.support.test.espresso.matcher.RootMatchers.isDialog; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.RootMatchers.isDialog; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/UiTestUtils.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/UiTestUtils.java index fccc8421116..c1b6e9e454a 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/UiTestUtils.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/UiTestUtils.java @@ -25,8 +25,8 @@ import android.app.Activity; import android.content.res.Resources; import android.support.test.InstrumentationRegistry; -import android.support.test.espresso.ViewInteraction; -import android.support.test.runner.lifecycle.ActivityLifecycleMonitorRegistry; +import androidx.test.espresso.ViewInteraction; +import androidx.test.runner.lifecycle.ActivityLifecycleMonitorRegistry; import android.view.View; import org.catrobat.catroid.ProjectManager; @@ -39,9 +39,9 @@ import java.util.Collection; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.matcher.ViewMatchers.assertThat; -import static android.support.test.runner.lifecycle.Stage.RESUMED; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.matcher.ViewMatchers.assertThat; +import static androidx.test.runner.lifecycle.Stage.RESUMED; import static org.catrobat.catroid.uiespresso.util.matchers.SuperToastMatchers.isToast; import static org.hamcrest.CoreMatchers.instanceOf; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/UserVariableAssertions.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/UserVariableAssertions.java index 0fe68017368..87d9d96a010 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/UserVariableAssertions.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/UserVariableAssertions.java @@ -26,8 +26,8 @@ import org.catrobat.catroid.formulaeditor.UserVariable; import org.catrobat.catroid.uiespresso.util.actions.CustomActions; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.matcher.ViewMatchers.isRoot; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.matcher.ViewMatchers.isRoot; import static junit.framework.Assert.assertEquals; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/actions/CustomActions.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/actions/CustomActions.java index 9d75bf7be8e..ff85f3fc726 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/actions/CustomActions.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/actions/CustomActions.java @@ -22,13 +22,13 @@ */ package org.catrobat.catroid.uiespresso.util.actions; -import android.support.test.espresso.UiController; -import android.support.test.espresso.ViewAction; +import androidx.test.espresso.UiController; +import androidx.test.espresso.ViewAction; import android.view.View; import org.hamcrest.Matcher; -import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; public final class CustomActions { // Suppress default constructor for noninstantiability diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/FormulaEditorCategoryListMatchers.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/FormulaEditorCategoryListMatchers.java index 2cff90ad024..34c97fd730a 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/FormulaEditorCategoryListMatchers.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/FormulaEditorCategoryListMatchers.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.util.matchers; -import android.support.v7.widget.RecyclerView; +import androidx.recyclerview.widget.RecyclerView; import android.view.View; import org.catrobat.catroid.ui.recyclerview.adapter.CategoryListRVAdapter; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/FormulaEditorDataListMatchers.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/FormulaEditorDataListMatchers.java index 2a933b68170..5ecb2172389 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/FormulaEditorDataListMatchers.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/FormulaEditorDataListMatchers.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.util.matchers; -import android.support.v7.widget.RecyclerView; +import androidx.recyclerview.widget.RecyclerView; import android.view.View; import org.catrobat.catroid.ui.recyclerview.adapter.DataListAdapter; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/StageMatchers.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/StageMatchers.java index 9d1bfcba0f5..e6e0420fdff 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/StageMatchers.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/StageMatchers.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.util.matchers; -import android.support.test.espresso.matcher.BoundedMatcher; +import androidx.test.espresso.matcher.BoundedMatcher; import android.view.View; import com.badlogic.gdx.backends.android.surfaceview.GLSurfaceView20; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/SuperToastMatchers.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/SuperToastMatchers.java index 9c4a23687f8..70f4d080243 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/SuperToastMatchers.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/SuperToastMatchers.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.util.matchers; -import android.support.test.espresso.Root; +import androidx.test.espresso.Root; import android.view.WindowManager; import org.hamcrest.Description; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/rules/BaseActivityTestRule.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/rules/BaseActivityTestRule.java index 59315141183..eaabc8ff54e 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/rules/BaseActivityTestRule.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/rules/BaseActivityTestRule.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.uiespresso.util.rules; import android.app.Activity; -import android.support.test.rule.ActivityTestRule; +import androidx.test.rule.ActivityTestRule; import android.util.Log; import org.catrobat.catroid.common.FlavoredConstants; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/wrappers/DataInteractionWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/wrappers/DataInteractionWrapper.java index 0ac592967aa..ee6e4034931 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/wrappers/DataInteractionWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/wrappers/DataInteractionWrapper.java @@ -23,12 +23,12 @@ package org.catrobat.catroid.uiespresso.util.wrappers; -import android.support.test.espresso.DataInteraction; -import android.support.test.espresso.Root; -import android.support.test.espresso.ViewAction; -import android.support.test.espresso.ViewAssertion; -import android.support.test.espresso.ViewInteraction; -import android.support.test.espresso.action.AdapterViewProtocol; +import androidx.test.espresso.DataInteraction; +import androidx.test.espresso.Root; +import androidx.test.espresso.ViewAction; +import androidx.test.espresso.ViewAssertion; +import androidx.test.espresso.ViewInteraction; +import androidx.test.espresso.action.AdapterViewProtocol; import android.view.View; import org.hamcrest.Matcher; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/wrappers/ViewInteractionWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/wrappers/ViewInteractionWrapper.java index 65d464ca04f..0bcb38f2ad4 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/wrappers/ViewInteractionWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/wrappers/ViewInteractionWrapper.java @@ -23,11 +23,11 @@ package org.catrobat.catroid.uiespresso.util.wrappers; -import android.support.test.espresso.FailureHandler; -import android.support.test.espresso.Root; -import android.support.test.espresso.ViewAction; -import android.support.test.espresso.ViewAssertion; -import android.support.test.espresso.ViewInteraction; +import androidx.test.espresso.FailureHandler; +import androidx.test.espresso.Root; +import androidx.test.espresso.ViewAction; +import androidx.test.espresso.ViewAssertion; +import androidx.test.espresso.ViewInteraction; import org.hamcrest.Matcher; diff --git a/catroid/src/main/AndroidManifest.xml b/catroid/src/main/AndroidManifest.xml index 7f0d0e66fa6..fdb6b7ba038 100644 --- a/catroid/src/main/AndroidManifest.xml +++ b/catroid/src/main/AndroidManifest.xml @@ -223,7 +223,7 @@ diff --git a/catroid/src/main/java/org/catrobat/catroid/CatroidApplication.java b/catroid/src/main/java/org/catrobat/catroid/CatroidApplication.java index c33a736442c..0311e47fabd 100644 --- a/catroid/src/main/java/org/catrobat/catroid/CatroidApplication.java +++ b/catroid/src/main/java/org/catrobat/catroid/CatroidApplication.java @@ -28,7 +28,7 @@ import android.content.Context; import android.os.Build; import android.os.StrictMode; -import android.support.multidex.MultiDex; +import androidx.multidex.MultiDex; import android.util.Log; import com.google.android.gms.analytics.GoogleAnalytics; diff --git a/catroid/src/main/java/org/catrobat/catroid/ProjectManager.java b/catroid/src/main/java/org/catrobat/catroid/ProjectManager.java index 2da9602a0e9..c983d9343c7 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ProjectManager.java +++ b/catroid/src/main/java/org/catrobat/catroid/ProjectManager.java @@ -23,7 +23,7 @@ package org.catrobat.catroid; import android.content.Context; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import android.util.Log; import org.catrobat.catroid.common.DefaultProjectHandler; diff --git a/catroid/src/main/java/org/catrobat/catroid/bluetooth/ConnectBluetoothDeviceActivity.java b/catroid/src/main/java/org/catrobat/catroid/bluetooth/ConnectBluetoothDeviceActivity.java index 47a2bff668a..8634d87103b 100644 --- a/catroid/src/main/java/org/catrobat/catroid/bluetooth/ConnectBluetoothDeviceActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/bluetooth/ConnectBluetoothDeviceActivity.java @@ -30,7 +30,7 @@ import android.content.IntentFilter; import android.os.AsyncTask; import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatActivity; import android.util.Log; import android.util.Pair; import android.view.View; diff --git a/catroid/src/main/java/org/catrobat/catroid/camera/CameraManager.java b/catroid/src/main/java/org/catrobat/catroid/camera/CameraManager.java index 04be926bc8e..5e96ef85889 100644 --- a/catroid/src/main/java/org/catrobat/catroid/camera/CameraManager.java +++ b/catroid/src/main/java/org/catrobat/catroid/camera/CameraManager.java @@ -27,7 +27,7 @@ import android.graphics.YuvImage; import android.hardware.Camera; import android.hardware.Camera.Parameters; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import android.util.Log; import android.view.ViewGroup; import android.view.ViewParent; diff --git a/catroid/src/main/java/org/catrobat/catroid/cast/CastManager.java b/catroid/src/main/java/org/catrobat/catroid/cast/CastManager.java index 4cc7d8d345f..42d2f858b65 100644 --- a/catroid/src/main/java/org/catrobat/catroid/cast/CastManager.java +++ b/catroid/src/main/java/org/catrobat/catroid/cast/CastManager.java @@ -29,10 +29,10 @@ import android.graphics.drawable.AnimationDrawable; import android.graphics.drawable.Drawable; import android.os.Handler; -import android.support.v4.content.ContextCompat; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.media.MediaRouteSelector; -import android.support.v7.media.MediaRouter; +import androidx.core.content.ContextCompat; +import androidx.appcompat.app.AppCompatActivity; +import androidx.mediarouter.media.MediaRouteSelector; +import androidx.mediarouter.media.MediaRouter; import android.view.HapticFeedbackConstants; import android.view.LayoutInflater; import android.view.MenuItem; diff --git a/catroid/src/main/java/org/catrobat/catroid/common/Constants.java b/catroid/src/main/java/org/catrobat/catroid/common/Constants.java index 8df6d379be0..fe87482c2ec 100644 --- a/catroid/src/main/java/org/catrobat/catroid/common/Constants.java +++ b/catroid/src/main/java/org/catrobat/catroid/common/Constants.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.common; import android.os.Environment; -import android.support.annotation.IntDef; +import androidx.annotation.IntDef; import org.catrobat.catroid.BuildConfig; import org.catrobat.catroid.CatroidApplication; diff --git a/catroid/src/main/java/org/catrobat/catroid/common/LookData.java b/catroid/src/main/java/org/catrobat/catroid/common/LookData.java index fea97d1f22e..57e9ba5d553 100644 --- a/catroid/src/main/java/org/catrobat/catroid/common/LookData.java +++ b/catroid/src/main/java/org/catrobat/catroid/common/LookData.java @@ -24,8 +24,8 @@ import android.graphics.Bitmap; import android.graphics.BitmapFactory; -import android.support.annotation.NonNull; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.NonNull; +import androidx.annotation.VisibleForTesting; import android.util.Log; import com.badlogic.gdx.Gdx; diff --git a/catroid/src/main/java/org/catrobat/catroid/common/SoundInfo.java b/catroid/src/main/java/org/catrobat/catroid/common/SoundInfo.java index 88941a7bdd9..15bb22d17db 100644 --- a/catroid/src/main/java/org/catrobat/catroid/common/SoundInfo.java +++ b/catroid/src/main/java/org/catrobat/catroid/common/SoundInfo.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.common; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.thoughtworks.xstream.annotations.XStreamAsAttribute; diff --git a/catroid/src/main/java/org/catrobat/catroid/common/ThreadScheduler.java b/catroid/src/main/java/org/catrobat/catroid/common/ThreadScheduler.java index 001459ceadd..7dceeec0f3a 100644 --- a/catroid/src/main/java/org/catrobat/catroid/common/ThreadScheduler.java +++ b/catroid/src/main/java/org/catrobat/catroid/common/ThreadScheduler.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.common; -import android.support.annotation.IntDef; +import androidx.annotation.IntDef; import com.badlogic.gdx.scenes.scene2d.Action; import com.badlogic.gdx.scenes.scene2d.Actor; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/ConditionScriptTrigger.java b/catroid/src/main/java/org/catrobat/catroid/content/ConditionScriptTrigger.java index 65e19c90c5f..a8f57be36e8 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/ConditionScriptTrigger.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/ConditionScriptTrigger.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.content; -import android.support.annotation.IntDef; +import androidx.annotation.IntDef; import android.util.Log; import org.catrobat.catroid.content.eventids.WhenConditionEventId; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/EventWrapper.java b/catroid/src/main/java/org/catrobat/catroid/content/EventWrapper.java index d54f1d0d86c..a3ef23ef01a 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/EventWrapper.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/EventWrapper.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.content; -import android.support.annotation.IntDef; +import androidx.annotation.IntDef; import com.badlogic.gdx.scenes.scene2d.Event; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/Look.java b/catroid/src/main/java/org/catrobat/catroid/content/Look.java index ad16a2603fe..108c8684826 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/Look.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/Look.java @@ -23,8 +23,8 @@ package org.catrobat.catroid.content; import android.graphics.PointF; -import android.support.annotation.IntDef; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.IntDef; +import androidx.annotation.VisibleForTesting; import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.graphics.g2d.Batch; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/Scene.java b/catroid/src/main/java/org/catrobat/catroid/content/Scene.java index 53993fafdc0..e3d940f79e7 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/Scene.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/Scene.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.content; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.thoughtworks.xstream.annotations.XStreamAlias; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/actions/EventThread.java b/catroid/src/main/java/org/catrobat/catroid/content/actions/EventThread.java index b239ce989ee..8ed001b2b0b 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/actions/EventThread.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/actions/EventThread.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.content.actions; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.badlogic.gdx.scenes.scene2d.Action; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/actions/NextLookAction.java b/catroid/src/main/java/org/catrobat/catroid/content/actions/NextLookAction.java index 7de3987903d..5ccb3668a02 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/actions/NextLookAction.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/actions/NextLookAction.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.content.actions; -import android.support.annotation.IntDef; +import androidx.annotation.IntDef; import com.badlogic.gdx.scenes.scene2d.actions.TemporalAction; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/actions/ScriptSequenceAction.java b/catroid/src/main/java/org/catrobat/catroid/content/actions/ScriptSequenceAction.java index cf30e139e33..216f6d22501 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/actions/ScriptSequenceAction.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/actions/ScriptSequenceAction.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.content.actions; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.badlogic.gdx.scenes.scene2d.Action; import com.badlogic.gdx.scenes.scene2d.actions.SequenceAction; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/actions/WebRequestAction.java b/catroid/src/main/java/org/catrobat/catroid/content/actions/WebRequestAction.java index c2d459f56c2..51d370e7482 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/actions/WebRequestAction.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/actions/WebRequestAction.java @@ -22,8 +22,8 @@ */ package org.catrobat.catroid.content.actions; -import android.support.annotation.IntDef; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.IntDef; +import androidx.annotation.VisibleForTesting; import android.util.Log; import com.badlogic.gdx.scenes.scene2d.Action; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/Brick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/Brick.java index 99f7e65a010..3c41af85d45 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/Brick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/Brick.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import android.support.annotation.IntDef; +import androidx.annotation.IntDef; import android.view.View; import android.widget.CheckBox; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/BrickBaseType.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/BrickBaseType.java index e6d9886cf6c..1d37b1639b6 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/BrickBaseType.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/BrickBaseType.java @@ -23,10 +23,10 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import android.support.annotation.CallSuper; -import android.support.annotation.LayoutRes; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.CallSuper; +import androidx.annotation.LayoutRes; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/BroadcastMessageBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/BroadcastMessageBrick.java index 02b6f29fd46..535336565cc 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/BroadcastMessageBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/BroadcastMessageBrick.java @@ -24,9 +24,9 @@ import android.content.Context; import android.content.DialogInterface; -import android.support.annotation.Nullable; -import android.support.annotation.VisibleForTesting; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.Nullable; +import androidx.annotation.VisibleForTesting; +import androidx.appcompat.app.AppCompatActivity; import android.view.View; import org.catrobat.catroid.ProjectManager; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/CloneBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/CloneBrick.java index 3daf7b46ced..ee53c57169a 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/CloneBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/CloneBrick.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import android.view.View; import org.catrobat.catroid.ProjectManager; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/ForeverBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/ForeverBrick.java index 9b5d9e31fe4..7f4fb382609 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/ForeverBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/ForeverBrick.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.content.bricks; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import com.badlogic.gdx.scenes.scene2d.Action; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/FormulaBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/FormulaBrick.java index 16f40a69e4f..e898389a8c4 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/FormulaBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/FormulaBrick.java @@ -24,8 +24,8 @@ import android.content.Context; import android.graphics.PorterDuff; -import android.support.annotation.CallSuper; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.CallSuper; +import androidx.annotation.VisibleForTesting; import android.util.Log; import android.view.View; import android.widget.TextView; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/GoToBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/GoToBrick.java index 6160f004ae9..d78c559acad 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/GoToBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/GoToBrick.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import android.view.View; import org.catrobat.catroid.ProjectManager; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/IfLogicBeginBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/IfLogicBeginBrick.java index 189681ddbf5..f4eb651ca47 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/IfLogicBeginBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/IfLogicBeginBrick.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import android.view.View; import com.badlogic.gdx.scenes.scene2d.Action; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/IfThenLogicBeginBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/IfThenLogicBeginBrick.java index 8eef80ef892..92fd5bb6037 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/IfThenLogicBeginBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/IfThenLogicBeginBrick.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import android.view.View; import com.badlogic.gdx.scenes.scene2d.Action; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/PhiroIfLogicBeginBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/PhiroIfLogicBeginBrick.java index fe5c05e9b21..13608a31f74 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/PhiroIfLogicBeginBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/PhiroIfLogicBeginBrick.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/PhiroRGBLightBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/PhiroRGBLightBrick.java index d9122806eca..3a289d3c7c1 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/PhiroRGBLightBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/PhiroRGBLightBrick.java @@ -24,7 +24,7 @@ import android.content.Context; import android.graphics.Color; -import android.support.v7.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatActivity; import android.view.View; import android.widget.AdapterView; import android.widget.AdapterView.OnItemSelectedListener; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/PlaceAtBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/PlaceAtBrick.java index 51b0ce19a81..93e51875367 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/PlaceAtBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/PlaceAtBrick.java @@ -25,8 +25,8 @@ import android.app.AlertDialog; import android.content.Context; import android.content.Intent; -import android.support.v4.app.Fragment; -import android.support.v7.app.AppCompatActivity; +import androidx.fragment.app.Fragment; +import androidx.appcompat.app.AppCompatActivity; import android.view.View; import org.catrobat.catroid.ProjectManager; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/PlaySoundBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/PlaySoundBrick.java index e70ce299dd0..1de52ef2a3d 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/PlaySoundBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/PlaySoundBrick.java @@ -23,8 +23,8 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; import android.view.View; import org.catrobat.catroid.ProjectManager; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/PointToBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/PointToBrick.java index f1a5157ae15..5e5d8dfe44a 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/PointToBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/PointToBrick.java @@ -23,8 +23,8 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; import android.view.View; import org.catrobat.catroid.ProjectManager; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/RepeatBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/RepeatBrick.java index 7e431c1e477..6da1cf12201 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/RepeatBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/RepeatBrick.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import android.util.Log; import android.view.View; import android.widget.TextView; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/RepeatUntilBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/RepeatUntilBrick.java index 02669649d77..d184ccad26d 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/RepeatUntilBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/RepeatUntilBrick.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.content.bricks; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import com.badlogic.gdx.scenes.scene2d.Action; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SceneStartBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SceneStartBrick.java index 8f9a0b63ae8..b29bb2ed869 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SceneStartBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SceneStartBrick.java @@ -23,8 +23,8 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; import android.view.View; import org.catrobat.catroid.ProjectManager; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SceneTransitionBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SceneTransitionBrick.java index 48c73177db6..b2db9c89f1d 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SceneTransitionBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SceneTransitionBrick.java @@ -23,8 +23,8 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; import android.view.View; import org.catrobat.catroid.ProjectManager; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetBackgroundBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetBackgroundBrick.java index 03f97ed5c65..a344932a1f6 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetBackgroundBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetBackgroundBrick.java @@ -24,8 +24,8 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; import android.view.View; import org.catrobat.catroid.ProjectManager; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetLookBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetLookBrick.java index 8b6eea762dd..067133b137d 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetLookBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetLookBrick.java @@ -23,8 +23,8 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; import android.view.View; import org.catrobat.catroid.ProjectManager; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetNfcTagBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetNfcTagBrick.java index f53183d9ac8..405df6d3bc0 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetNfcTagBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetNfcTagBrick.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import android.view.View; import org.catrobat.catroid.R; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetPenColorBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetPenColorBrick.java index 487939c8451..3ff1a560724 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetPenColorBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetPenColorBrick.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.content.bricks; import android.graphics.Color; -import android.support.v7.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatActivity; import android.view.View; import org.catrobat.catroid.R; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetPhysicsObjectTypeBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetPhysicsObjectTypeBrick.java index a3799ba5a58..9baa8ee6780 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetPhysicsObjectTypeBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetPhysicsObjectTypeBrick.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import android.view.View; import android.widget.AdapterView; import android.widget.AdapterView.OnItemSelectedListener; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetRotationStyleBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetRotationStyleBrick.java index da1a2299b7b..649f0cf0c79 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetRotationStyleBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetRotationStyleBrick.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import android.view.View; import org.catrobat.catroid.R; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/ShowTextColorSizeAlignmentBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/ShowTextColorSizeAlignmentBrick.java index 3e1f8a8079a..f34a4dadc6d 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/ShowTextColorSizeAlignmentBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/ShowTextColorSizeAlignmentBrick.java @@ -24,8 +24,8 @@ import android.content.Context; import android.graphics.Color; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; import android.view.View; import org.catrobat.catroid.R; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/UserListBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/UserListBrick.java index c6902a085c9..a489fa82098 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/UserListBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/UserListBrick.java @@ -26,9 +26,9 @@ import android.app.Dialog; import android.content.Context; import android.content.DialogInterface; -import android.support.annotation.IdRes; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.IdRes; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; import android.view.View; import android.widget.RadioButton; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/UserVariableBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/UserVariableBrick.java index 4b069f946a2..1f983641c7c 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/UserVariableBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/UserVariableBrick.java @@ -24,9 +24,9 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import android.support.annotation.IdRes; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.IdRes; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; import android.view.View; import org.catrobat.catroid.ProjectManager; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/UserVariableBrickWithFormula.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/UserVariableBrickWithFormula.java index 5369cda56f2..602b65b1b2f 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/UserVariableBrickWithFormula.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/UserVariableBrickWithFormula.java @@ -24,9 +24,9 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import android.support.annotation.IdRes; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.IdRes; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; import android.view.View; import org.catrobat.catroid.ProjectManager; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenBackgroundChangesBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenBackgroundChangesBrick.java index 8536d76b90a..c3f7cd8415f 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenBackgroundChangesBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenBackgroundChangesBrick.java @@ -23,9 +23,9 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; import android.view.View; import org.catrobat.catroid.ProjectManager; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenBounceOffBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenBounceOffBrick.java index 73d1b5c3aae..721be3f3903 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenBounceOffBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenBounceOffBrick.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import android.view.View; import org.catrobat.catroid.ProjectManager; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenBrick.java index e2d17899071..14c2488794d 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenBrick.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.content.bricks; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenGamepadButtonBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenGamepadButtonBrick.java index 9708d5f725e..ffc34e013b5 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenGamepadButtonBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenGamepadButtonBrick.java @@ -23,8 +23,8 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import android.view.View; import org.catrobat.catroid.R; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenNfcBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenNfcBrick.java index 1c3d1be1886..cd2f84d96e0 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenNfcBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenNfcBrick.java @@ -23,8 +23,8 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import android.view.View; import org.catrobat.catroid.ProjectManager; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/brickspinner/BrickSpinner.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/brickspinner/BrickSpinner.java index 509b344d6f7..d20bdb70843 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/brickspinner/BrickSpinner.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/brickspinner/BrickSpinner.java @@ -24,9 +24,9 @@ package org.catrobat.catroid.content.bricks.brickspinner; import android.content.Context; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.VisibleForTesting; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/brickspinner/UserVariableBrickTextInputDialogBuilder.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/brickspinner/UserVariableBrickTextInputDialogBuilder.java index c947e0f1a95..041e015443e 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/brickspinner/UserVariableBrickTextInputDialogBuilder.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/brickspinner/UserVariableBrickTextInputDialogBuilder.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.content.bricks.brickspinner; import android.app.Dialog; -import android.support.v7.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatActivity; import android.widget.RadioButton; import org.catrobat.catroid.R; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/eventids/EventId.java b/catroid/src/main/java/org/catrobat/catroid/content/eventids/EventId.java index 4625a4b5d5c..fd6d64df213 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/eventids/EventId.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/eventids/EventId.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.content.eventids; -import android.support.annotation.IntDef; +import androidx.annotation.IntDef; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/eventids/NfcEventId.java b/catroid/src/main/java/org/catrobat/catroid/content/eventids/NfcEventId.java index 2d73ae81c59..ba68659d591 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/eventids/NfcEventId.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/eventids/NfcEventId.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.content.eventids; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.google.common.base.Objects; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/strategy/ShowColorPickerFormulaEditorStrategy.java b/catroid/src/main/java/org/catrobat/catroid/content/strategy/ShowColorPickerFormulaEditorStrategy.java index 85787d62b45..a71de01e27b 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/strategy/ShowColorPickerFormulaEditorStrategy.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/strategy/ShowColorPickerFormulaEditorStrategy.java @@ -23,10 +23,10 @@ package org.catrobat.catroid.content.strategy; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v7.app.AlertDialog; -import android.support.v7.app.AppCompatActivity; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AppCompatActivity; import android.view.View; import org.catrobat.catroid.R; @@ -34,7 +34,7 @@ import org.catrobat.catroid.ui.recyclerview.fragment.ScriptFragment; import org.catrobat.paintroid.colorpicker.ColorPickerDialog; -import static android.support.v4.app.DialogFragment.STYLE_NORMAL; +import static androidx.fragment.app.DialogFragment.STYLE_NORMAL; public class ShowColorPickerFormulaEditorStrategy implements ShowFormulaEditorStrategy { private static final int OPTION_PICK_COLOR = 0; diff --git a/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/NXTReply.java b/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/NXTReply.java index 61dad3e3ed3..22425036843 100644 --- a/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/NXTReply.java +++ b/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/NXTReply.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.devices.mindstorms.nxt; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import org.catrobat.catroid.devices.mindstorms.MindstormsReply; diff --git a/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/sensors/NXTI2CSensor.java b/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/sensors/NXTI2CSensor.java index 2272ff77549..e84f98e46e9 100644 --- a/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/sensors/NXTI2CSensor.java +++ b/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/sensors/NXTI2CSensor.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.devices.mindstorms.nxt.sensors; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import android.util.Log; import org.catrobat.catroid.devices.mindstorms.MindstormsConnection; diff --git a/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/sensors/NXTI2CUltraSonicSensor.java b/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/sensors/NXTI2CUltraSonicSensor.java index 6bb144da90d..5fc294bc0e3 100644 --- a/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/sensors/NXTI2CUltraSonicSensor.java +++ b/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/sensors/NXTI2CUltraSonicSensor.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.devices.mindstorms.nxt.sensors; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import org.catrobat.catroid.devices.mindstorms.MindstormsConnection; import org.catrobat.catroid.devices.mindstorms.MindstormsException; diff --git a/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/sensors/NXTSensor.java b/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/sensors/NXTSensor.java index 746a8deeb06..1e1a8677e8b 100644 --- a/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/sensors/NXTSensor.java +++ b/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/sensors/NXTSensor.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.devices.mindstorms.nxt.sensors; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import android.util.Log; import org.catrobat.catroid.devices.mindstorms.LegoSensor; diff --git a/catroid/src/main/java/org/catrobat/catroid/drone/ardrone/DroneController.java b/catroid/src/main/java/org/catrobat/catroid/drone/ardrone/DroneController.java index 213ff86a494..4154ecf7f2d 100644 --- a/catroid/src/main/java/org/catrobat/catroid/drone/ardrone/DroneController.java +++ b/catroid/src/main/java/org/catrobat/catroid/drone/ardrone/DroneController.java @@ -29,9 +29,9 @@ import android.content.IntentFilter; import android.content.ServiceConnection; import android.os.IBinder; -import android.support.annotation.IntDef; -import android.support.v4.content.LocalBroadcastManager; -import android.support.v7.app.AlertDialog; +import androidx.annotation.IntDef; +import androidx.localbroadcastmanager.content.LocalBroadcastManager; +import androidx.appcompat.app.AlertDialog; import android.util.Log; import com.parrot.freeflight.drone.NavData; diff --git a/catroid/src/main/java/org/catrobat/catroid/drone/ardrone/DroneInitializer.java b/catroid/src/main/java/org/catrobat/catroid/drone/ardrone/DroneInitializer.java index 651864ce7d6..371905339a3 100644 --- a/catroid/src/main/java/org/catrobat/catroid/drone/ardrone/DroneInitializer.java +++ b/catroid/src/main/java/org/catrobat/catroid/drone/ardrone/DroneInitializer.java @@ -31,8 +31,8 @@ import android.content.ServiceConnection; import android.os.AsyncTask.Status; import android.os.IBinder; -import android.support.v4.content.LocalBroadcastManager; -import android.support.v7.app.AlertDialog; +import androidx.localbroadcastmanager.content.LocalBroadcastManager; +import androidx.appcompat.app.AlertDialog; import com.parrot.freeflight.receivers.DroneAvailabilityDelegate; import com.parrot.freeflight.receivers.DroneAvailabilityReceiver; diff --git a/catroid/src/main/java/org/catrobat/catroid/drone/jumpingsumo/JumpingSumoDiscoverer.java b/catroid/src/main/java/org/catrobat/catroid/drone/jumpingsumo/JumpingSumoDiscoverer.java index f6b2bb364d9..94abb2403de 100644 --- a/catroid/src/main/java/org/catrobat/catroid/drone/jumpingsumo/JumpingSumoDiscoverer.java +++ b/catroid/src/main/java/org/catrobat/catroid/drone/jumpingsumo/JumpingSumoDiscoverer.java @@ -29,8 +29,8 @@ import android.content.ServiceConnection; import android.os.Handler; import android.os.IBinder; -import android.support.annotation.NonNull; -import android.support.v4.content.LocalBroadcastManager; +import androidx.annotation.NonNull; +import androidx.localbroadcastmanager.content.LocalBroadcastManager; import android.util.Log; import com.parrot.arsdk.ardiscovery.ARDiscoveryDeviceNetService; diff --git a/catroid/src/main/java/org/catrobat/catroid/drone/jumpingsumo/JumpingSumoInitializer.java b/catroid/src/main/java/org/catrobat/catroid/drone/jumpingsumo/JumpingSumoInitializer.java index f35421a0fb4..e05a5c0ea70 100644 --- a/catroid/src/main/java/org/catrobat/catroid/drone/jumpingsumo/JumpingSumoInitializer.java +++ b/catroid/src/main/java/org/catrobat/catroid/drone/jumpingsumo/JumpingSumoInitializer.java @@ -28,9 +28,9 @@ import android.net.Uri; import android.os.Environment; import android.os.Handler; -import android.support.annotation.NonNull; -import android.support.v7.app.AlertDialog; -import android.support.v7.app.AlertDialog.Builder; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AlertDialog.Builder; import android.util.Log; import com.parrot.arsdk.arcontroller.ARCONTROLLER_DEVICE_STATE_ENUM; diff --git a/catroid/src/main/java/org/catrobat/catroid/drone/jumpingsumo/SDCardModule.java b/catroid/src/main/java/org/catrobat/catroid/drone/jumpingsumo/SDCardModule.java index a42dd436ea7..51c85b105bd 100644 --- a/catroid/src/main/java/org/catrobat/catroid/drone/jumpingsumo/SDCardModule.java +++ b/catroid/src/main/java/org/catrobat/catroid/drone/jumpingsumo/SDCardModule.java @@ -23,8 +23,8 @@ package org.catrobat.catroid.drone.jumpingsumo; import android.os.Environment; -import android.support.annotation.NonNull; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; import android.util.Log; import com.parrot.arsdk.ardatatransfer.ARDATATRANSFER_ERROR_ENUM; diff --git a/catroid/src/main/java/org/catrobat/catroid/facedetection/FaceDetectionHandler.java b/catroid/src/main/java/org/catrobat/catroid/facedetection/FaceDetectionHandler.java index 34b53fa2f42..d67193bb313 100644 --- a/catroid/src/main/java/org/catrobat/catroid/facedetection/FaceDetectionHandler.java +++ b/catroid/src/main/java/org/catrobat/catroid/facedetection/FaceDetectionHandler.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.facedetection; import android.hardware.Camera; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import android.util.Log; import org.catrobat.catroid.camera.CameraManager; diff --git a/catroid/src/main/java/org/catrobat/catroid/facedetection/FaceDetector.java b/catroid/src/main/java/org/catrobat/catroid/facedetection/FaceDetector.java index 0294b77d158..1c9a7762b3a 100644 --- a/catroid/src/main/java/org/catrobat/catroid/facedetection/FaceDetector.java +++ b/catroid/src/main/java/org/catrobat/catroid/facedetection/FaceDetector.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.facedetection; import android.graphics.Point; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import org.catrobat.catroid.camera.CameraManager; import org.catrobat.catroid.common.ScreenValues; diff --git a/catroid/src/main/java/org/catrobat/catroid/facedetection/SlowFaceDetector.java b/catroid/src/main/java/org/catrobat/catroid/facedetection/SlowFaceDetector.java index f48265a5221..a11f760b8d4 100644 --- a/catroid/src/main/java/org/catrobat/catroid/facedetection/SlowFaceDetector.java +++ b/catroid/src/main/java/org/catrobat/catroid/facedetection/SlowFaceDetector.java @@ -32,7 +32,7 @@ import android.graphics.PointF; import android.media.FaceDetector; import android.media.FaceDetector.Face; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import org.catrobat.catroid.camera.CameraManager; import org.catrobat.catroid.camera.JpgPreviewCallback; diff --git a/catroid/src/main/java/org/catrobat/catroid/formulaeditor/ExternInternRepresentationMapping.java b/catroid/src/main/java/org/catrobat/catroid/formulaeditor/ExternInternRepresentationMapping.java index 1b72cbb4d1f..6a06d424e19 100644 --- a/catroid/src/main/java/org/catrobat/catroid/formulaeditor/ExternInternRepresentationMapping.java +++ b/catroid/src/main/java/org/catrobat/catroid/formulaeditor/ExternInternRepresentationMapping.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.formulaeditor; -import android.support.v4.util.SparseArrayCompat; +import androidx.collection.SparseArrayCompat; public class ExternInternRepresentationMapping { diff --git a/catroid/src/main/java/org/catrobat/catroid/formulaeditor/InternFormula.java b/catroid/src/main/java/org/catrobat/catroid/formulaeditor/InternFormula.java index 0181121fb06..3ffc6c9a7ff 100644 --- a/catroid/src/main/java/org/catrobat/catroid/formulaeditor/InternFormula.java +++ b/catroid/src/main/java/org/catrobat/catroid/formulaeditor/InternFormula.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.formulaeditor; import android.content.Context; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import android.util.Log; import org.catrobat.catroid.R; diff --git a/catroid/src/main/java/org/catrobat/catroid/formulaeditor/SensorHandler.java b/catroid/src/main/java/org/catrobat/catroid/formulaeditor/SensorHandler.java index 377c4c1f645..5ba4b6abfc6 100644 --- a/catroid/src/main/java/org/catrobat/catroid/formulaeditor/SensorHandler.java +++ b/catroid/src/main/java/org/catrobat/catroid/formulaeditor/SensorHandler.java @@ -33,7 +33,7 @@ import android.location.LocationManager; import android.os.Bundle; import android.os.SystemClock; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import android.util.Log; import android.view.Surface; import android.view.WindowManager; diff --git a/catroid/src/main/java/org/catrobat/catroid/formulaeditor/SensorLoudness.java b/catroid/src/main/java/org/catrobat/catroid/formulaeditor/SensorLoudness.java index e454d1bc995..bd6be93c0fb 100644 --- a/catroid/src/main/java/org/catrobat/catroid/formulaeditor/SensorLoudness.java +++ b/catroid/src/main/java/org/catrobat/catroid/formulaeditor/SensorLoudness.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.formulaeditor; import android.os.Handler; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import android.util.Log; import org.catrobat.catroid.soundrecorder.SoundRecorder; diff --git a/catroid/src/main/java/org/catrobat/catroid/io/DeviceUserDataAccessor.java b/catroid/src/main/java/org/catrobat/catroid/io/DeviceUserDataAccessor.java index 5c26a21e235..08b3af1752f 100644 --- a/catroid/src/main/java/org/catrobat/catroid/io/DeviceUserDataAccessor.java +++ b/catroid/src/main/java/org/catrobat/catroid/io/DeviceUserDataAccessor.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.io; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import android.util.Log; import com.google.gson.Gson; diff --git a/catroid/src/main/java/org/catrobat/catroid/io/SoundManager.java b/catroid/src/main/java/org/catrobat/catroid/io/SoundManager.java index be3e017201b..d48ddbdaa37 100644 --- a/catroid/src/main/java/org/catrobat/catroid/io/SoundManager.java +++ b/catroid/src/main/java/org/catrobat/catroid/io/SoundManager.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.io; import android.media.MediaPlayer; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import android.util.Log; import java.util.ArrayList; diff --git a/catroid/src/main/java/org/catrobat/catroid/io/XstreamSerializer.java b/catroid/src/main/java/org/catrobat/catroid/io/XstreamSerializer.java index ee4813d15b4..e6d8e6803ad 100644 --- a/catroid/src/main/java/org/catrobat/catroid/io/XstreamSerializer.java +++ b/catroid/src/main/java/org/catrobat/catroid/io/XstreamSerializer.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.io; import android.content.Context; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import android.util.Log; import com.google.common.base.Charsets; diff --git a/catroid/src/main/java/org/catrobat/catroid/io/asynctask/ProjectExportTask.java b/catroid/src/main/java/org/catrobat/catroid/io/asynctask/ProjectExportTask.java index e1fea4e7f76..a2188f93dc2 100644 --- a/catroid/src/main/java/org/catrobat/catroid/io/asynctask/ProjectExportTask.java +++ b/catroid/src/main/java/org/catrobat/catroid/io/asynctask/ProjectExportTask.java @@ -25,7 +25,7 @@ import android.content.Context; import android.os.AsyncTask; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import android.util.Log; import org.catrobat.catroid.R; diff --git a/catroid/src/main/java/org/catrobat/catroid/merge/NewProjectNameTextWatcher.java b/catroid/src/main/java/org/catrobat/catroid/merge/NewProjectNameTextWatcher.java index 1b341886da1..538743038b4 100644 --- a/catroid/src/main/java/org/catrobat/catroid/merge/NewProjectNameTextWatcher.java +++ b/catroid/src/main/java/org/catrobat/catroid/merge/NewProjectNameTextWatcher.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.merge; import android.content.Context; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import org.catrobat.catroid.R; import org.catrobat.catroid.common.Nameable; diff --git a/catroid/src/main/java/org/catrobat/catroid/physics/PhysicsObject.java b/catroid/src/main/java/org/catrobat/catroid/physics/PhysicsObject.java index 1d32e8bd36a..6cd64c1befa 100644 --- a/catroid/src/main/java/org/catrobat/catroid/physics/PhysicsObject.java +++ b/catroid/src/main/java/org/catrobat/catroid/physics/PhysicsObject.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.physics; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.physics.box2d.Body; diff --git a/catroid/src/main/java/org/catrobat/catroid/physics/shapebuilder/PhysicsShapeScaleUtils.java b/catroid/src/main/java/org/catrobat/catroid/physics/shapebuilder/PhysicsShapeScaleUtils.java index e56e6e364b7..9814a4c2eab 100644 --- a/catroid/src/main/java/org/catrobat/catroid/physics/shapebuilder/PhysicsShapeScaleUtils.java +++ b/catroid/src/main/java/org/catrobat/catroid/physics/shapebuilder/PhysicsShapeScaleUtils.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.physics.shapebuilder; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.physics.box2d.PolygonShape; diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/PocketMusicActivity.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/PocketMusicActivity.java index be684522145..957337a143c 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/PocketMusicActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/PocketMusicActivity.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.pocketmusic; import android.os.Bundle; -import android.support.v7.widget.Toolbar; +import androidx.appcompat.widget.Toolbar; import android.util.Log; import android.view.ViewGroup; diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/TactViewHolder.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/TactViewHolder.java index 0b48f27a9e9..f25d5c34464 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/TactViewHolder.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/TactViewHolder.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.pocketmusic; -import android.support.v7.widget.RecyclerView; +import androidx.recyclerview.widget.RecyclerView; import android.view.View; public class TactViewHolder extends RecyclerView.ViewHolder { diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/FastScroller.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/FastScroller.java index 9785c458c4f..fb0d895b5a9 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/FastScroller.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/FastScroller.java @@ -26,9 +26,9 @@ import android.content.Context; import android.content.res.TypedArray; import android.graphics.drawable.Drawable; -import android.support.v4.graphics.drawable.DrawableCompat; -import android.support.v4.widget.TextViewCompat; -import android.support.v7.widget.LinearLayoutManager; +import androidx.core.graphics.drawable.DrawableCompat; +import androidx.core.widget.TextViewCompat; +import androidx.recyclerview.widget.LinearLayoutManager; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/RecyclerViewScrollListener.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/RecyclerViewScrollListener.java index 16a770a04a4..a1b8954f3d7 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/RecyclerViewScrollListener.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/RecyclerViewScrollListener.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.pocketmusic.fastscroller; -import android.support.v7.widget.RecyclerView; +import androidx.recyclerview.widget.RecyclerView; public class RecyclerViewScrollListener extends RecyclerView.OnScrollListener { diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/viewprovider/DefaultScrollerViewProvider.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/viewprovider/DefaultScrollerViewProvider.java index 725d46d5450..ecb629c5f95 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/viewprovider/DefaultScrollerViewProvider.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/viewprovider/DefaultScrollerViewProvider.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.pocketmusic.fastscroller.viewprovider; import android.graphics.drawable.InsetDrawable; -import android.support.v4.content.ContextCompat; +import androidx.core.content.ContextCompat; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/viewprovider/ScrollerViewProvider.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/viewprovider/ScrollerViewProvider.java index b875f1641e5..83d03f59e96 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/viewprovider/ScrollerViewProvider.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/viewprovider/ScrollerViewProvider.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.pocketmusic.fastscroller.viewprovider; import android.content.Context; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/viewprovider/VisibilityAnimationManager.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/viewprovider/VisibilityAnimationManager.java index 0292e56f5c9..7b1d647b773 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/viewprovider/VisibilityAnimationManager.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/viewprovider/VisibilityAnimationManager.java @@ -27,7 +27,7 @@ import android.animation.AnimatorInflater; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; -import android.support.annotation.AnimatorRes; +import androidx.annotation.AnimatorRes; import android.view.View; import org.catrobat.catroid.R; diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/NoteLength.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/NoteLength.java index d33f91d67e6..7a78459f511 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/NoteLength.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/NoteLength.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.pocketmusic.note; -import android.support.v4.util.SparseArrayCompat; +import androidx.collection.SparseArrayCompat; public enum NoteLength { WHOLE_DOT(4f + 2f), WHOLE(4f), HALF_DOT(2f + 1f), HALF(2f), QUARTER_DOT(1f + 1 / 2f), diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/Track.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/Track.java index a8a262e481f..3ecf1c322ba 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/Track.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/Track.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.pocketmusic.note; -import android.support.v4.util.LongSparseArray; +import androidx.collection.LongSparseArray; import java.io.Serializable; import java.util.Collections; diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/GridRow.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/GridRow.java index 7540e12708c..eab00245138 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/GridRow.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/GridRow.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.pocketmusic.note.trackgrid; -import android.support.v4.util.SparseArrayCompat; +import androidx.collection.SparseArrayCompat; import org.catrobat.catroid.pocketmusic.note.NoteName; diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/TrackGrid.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/TrackGrid.java index 0dd15603c03..fb3f0496266 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/TrackGrid.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/TrackGrid.java @@ -25,7 +25,7 @@ import android.os.Handler; import android.os.Looper; import android.os.SystemClock; -import android.support.v4.util.SparseArrayCompat; +import androidx.collection.SparseArrayCompat; import android.util.Log; import org.catrobat.catroid.pocketmusic.mididriver.MidiNotePlayer; diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/TrackGridToTrackConverter.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/TrackGridToTrackConverter.java index 90ca85e6c62..1b64cbdb534 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/TrackGridToTrackConverter.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/TrackGridToTrackConverter.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.pocketmusic.note.trackgrid; -import android.support.v4.util.SparseArrayCompat; +import androidx.collection.SparseArrayCompat; import org.catrobat.catroid.pocketmusic.note.NoteEvent; import org.catrobat.catroid.pocketmusic.note.Track; diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/TrackToTrackGridConverter.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/TrackToTrackGridConverter.java index a2e72bf5796..c54ca54c67d 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/TrackToTrackGridConverter.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/TrackToTrackGridConverter.java @@ -22,7 +22,7 @@ */ package org.catrobat.catroid.pocketmusic.note.trackgrid; -import android.support.v4.util.SparseArrayCompat; +import androidx.collection.SparseArrayCompat; import org.catrobat.catroid.pocketmusic.note.MusicalBeat; import org.catrobat.catroid.pocketmusic.note.NoteEvent; diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/NoteView.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/NoteView.java index af6d74f6d31..927d9e4bd45 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/NoteView.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/NoteView.java @@ -26,7 +26,7 @@ import android.content.Context; import android.graphics.PorterDuff; import android.graphics.drawable.Drawable; -import android.support.v4.content.ContextCompat; +import androidx.core.content.ContextCompat; import android.view.View; import android.widget.ImageView; diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/PianoView.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/PianoView.java index b3eb5c6918b..600a5ebdfee 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/PianoView.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/PianoView.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.pocketmusic.ui; import android.content.Context; -import android.support.v4.content.ContextCompat; +import androidx.core.content.ContextCompat; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/TactScrollRecyclerView.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/TactScrollRecyclerView.java index 7ee87eb397c..1f14a31eb5d 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/TactScrollRecyclerView.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/TactScrollRecyclerView.java @@ -24,9 +24,9 @@ package org.catrobat.catroid.pocketmusic.ui; import android.content.Context; -import android.support.annotation.Nullable; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; +import androidx.annotation.Nullable; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; import android.util.AttributeSet; import android.util.Log; import android.view.LayoutInflater; diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/TrackRowView.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/TrackRowView.java index 04eb1418b29..16c0389e8a1 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/TrackRowView.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/TrackRowView.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.pocketmusic.ui; import android.content.Context; -import android.support.v4.content.ContextCompat; +import androidx.core.content.ContextCompat; import android.widget.TableRow; import org.catrobat.catroid.R; diff --git a/catroid/src/main/java/org/catrobat/catroid/scratchconverter/Client.java b/catroid/src/main/java/org/catrobat/catroid/scratchconverter/Client.java index d1f76e6f06d..f4b8c7f8767 100644 --- a/catroid/src/main/java/org/catrobat/catroid/scratchconverter/Client.java +++ b/catroid/src/main/java/org/catrobat/catroid/scratchconverter/Client.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.scratchconverter; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import com.google.android.gms.common.images.WebImage; diff --git a/catroid/src/main/java/org/catrobat/catroid/scratchconverter/ConversionManager.java b/catroid/src/main/java/org/catrobat/catroid/scratchconverter/ConversionManager.java index 4bea039b654..3f4cc253cd9 100644 --- a/catroid/src/main/java/org/catrobat/catroid/scratchconverter/ConversionManager.java +++ b/catroid/src/main/java/org/catrobat/catroid/scratchconverter/ConversionManager.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.scratchconverter; -import android.support.v7.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatActivity; import com.google.android.gms.common.images.WebImage; diff --git a/catroid/src/main/java/org/catrobat/catroid/scratchconverter/ScratchConversionManager.java b/catroid/src/main/java/org/catrobat/catroid/scratchconverter/ScratchConversionManager.java index e03becae9a3..fca479e9397 100644 --- a/catroid/src/main/java/org/catrobat/catroid/scratchconverter/ScratchConversionManager.java +++ b/catroid/src/main/java/org/catrobat/catroid/scratchconverter/ScratchConversionManager.java @@ -29,10 +29,10 @@ import android.content.SharedPreferences; import android.content.res.Resources; import android.preference.PreferenceManager; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v7.app.AlertDialog; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AppCompatActivity; import android.util.Log; import com.google.android.gms.common.images.WebImage; diff --git a/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/JobHandler.java b/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/JobHandler.java index 897382454a3..4e2ec80638c 100644 --- a/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/JobHandler.java +++ b/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/JobHandler.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.scratchconverter.protocol; import android.net.Uri; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import android.util.Log; import com.google.android.gms.common.images.WebImage; diff --git a/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/message/base/BaseMessage.java b/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/message/base/BaseMessage.java index 1f29372e561..103cee715fa 100644 --- a/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/message/base/BaseMessage.java +++ b/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/message/base/BaseMessage.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.scratchconverter.protocol.message.base; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import android.util.SparseArray; import org.catrobat.catroid.scratchconverter.protocol.Job; diff --git a/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/message/job/JobMessage.java b/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/message/job/JobMessage.java index 82adab948c0..b549a926f12 100644 --- a/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/message/job/JobMessage.java +++ b/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/message/job/JobMessage.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.scratchconverter.protocol.message.job; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import android.util.Log; import android.util.SparseArray; diff --git a/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/message/job/JobOutputMessage.java b/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/message/job/JobOutputMessage.java index 1ed5287a1c5..07e2c36b2d7 100644 --- a/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/message/job/JobOutputMessage.java +++ b/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/message/job/JobOutputMessage.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.scratchconverter.protocol.message.job; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import java.util.Arrays; diff --git a/catroid/src/main/java/org/catrobat/catroid/sensing/CollisionInformation.java b/catroid/src/main/java/org/catrobat/catroid/sensing/CollisionInformation.java index b84f5a4f1c0..5268e18ae2b 100644 --- a/catroid/src/main/java/org/catrobat/catroid/sensing/CollisionInformation.java +++ b/catroid/src/main/java/org/catrobat/catroid/sensing/CollisionInformation.java @@ -27,8 +27,8 @@ import android.graphics.BitmapFactory; import android.graphics.Matrix; import android.graphics.PointF; -import android.support.annotation.VisibleForTesting; -import android.support.v4.util.Pair; +import androidx.annotation.VisibleForTesting; +import androidx.core.util.Pair; import android.util.Log; import com.badlogic.gdx.math.Polygon; diff --git a/catroid/src/main/java/org/catrobat/catroid/soundrecorder/SoundRecorderActivity.java b/catroid/src/main/java/org/catrobat/catroid/soundrecorder/SoundRecorderActivity.java index 1beafd15545..6caa8f82c45 100644 --- a/catroid/src/main/java/org/catrobat/catroid/soundrecorder/SoundRecorderActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/soundrecorder/SoundRecorderActivity.java @@ -26,9 +26,9 @@ import android.net.Uri; import android.os.Bundle; import android.os.SystemClock; -import android.support.v4.content.FileProvider; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; +import androidx.core.content.FileProvider; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; import android.util.Log; import android.view.MenuItem; import android.view.View; diff --git a/catroid/src/main/java/org/catrobat/catroid/stage/ShowBubbleActor.java b/catroid/src/main/java/org/catrobat/catroid/stage/ShowBubbleActor.java index e142ef2dc62..8ddfdd499b8 100644 --- a/catroid/src/main/java/org/catrobat/catroid/stage/ShowBubbleActor.java +++ b/catroid/src/main/java/org/catrobat/catroid/stage/ShowBubbleActor.java @@ -30,8 +30,8 @@ import android.graphics.Path; import android.graphics.Rect; import android.graphics.RectF; -import android.support.annotation.VisibleForTesting; -import android.support.v4.util.Pair; +import androidx.annotation.VisibleForTesting; +import androidx.core.util.Pair; import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.graphics.Texture; diff --git a/catroid/src/main/java/org/catrobat/catroid/stage/StageActivity.java b/catroid/src/main/java/org/catrobat/catroid/stage/StageActivity.java index 85b436736cf..90a367e8dd5 100644 --- a/catroid/src/main/java/org/catrobat/catroid/stage/StageActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/stage/StageActivity.java @@ -35,7 +35,7 @@ import android.os.Looper; import android.os.Message; import android.speech.RecognizerIntent; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import android.util.Log; import android.util.SparseArray; import android.view.ContextThemeWrapper; diff --git a/catroid/src/main/java/org/catrobat/catroid/stage/StageListener.java b/catroid/src/main/java/org/catrobat/catroid/stage/StageListener.java index 3ce3e1a5b0a..93c27955cf9 100644 --- a/catroid/src/main/java/org/catrobat/catroid/stage/StageListener.java +++ b/catroid/src/main/java/org/catrobat/catroid/stage/StageListener.java @@ -26,7 +26,7 @@ import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.os.SystemClock; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import android.util.DisplayMetrics; import com.badlogic.gdx.ApplicationListener; diff --git a/catroid/src/main/java/org/catrobat/catroid/stage/StageResourceHolder.java b/catroid/src/main/java/org/catrobat/catroid/stage/StageResourceHolder.java index 8d8a84cd12f..716b3a11865 100644 --- a/catroid/src/main/java/org/catrobat/catroid/stage/StageResourceHolder.java +++ b/catroid/src/main/java/org/catrobat/catroid/stage/StageResourceHolder.java @@ -33,7 +33,7 @@ import android.os.Vibrator; import android.preference.PreferenceManager; import android.provider.Settings; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import android.text.Html; import android.util.Log; import android.view.View; diff --git a/catroid/src/main/java/org/catrobat/catroid/stage/TextToSpeechHolder.java b/catroid/src/main/java/org/catrobat/catroid/stage/TextToSpeechHolder.java index 9e78a40cf55..b82ad1ad66f 100644 --- a/catroid/src/main/java/org/catrobat/catroid/stage/TextToSpeechHolder.java +++ b/catroid/src/main/java/org/catrobat/catroid/stage/TextToSpeechHolder.java @@ -26,7 +26,7 @@ import android.content.DialogInterface; import android.content.Intent; import android.speech.tts.TextToSpeech; -import android.support.v7.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.util.Log; import org.catrobat.catroid.R; diff --git a/catroid/src/main/java/org/catrobat/catroid/transfers/CheckOAuthTokenTask.java b/catroid/src/main/java/org/catrobat/catroid/transfers/CheckOAuthTokenTask.java index ea63771493b..a769089e4ea 100644 --- a/catroid/src/main/java/org/catrobat/catroid/transfers/CheckOAuthTokenTask.java +++ b/catroid/src/main/java/org/catrobat/catroid/transfers/CheckOAuthTokenTask.java @@ -25,7 +25,7 @@ import android.app.Activity; import android.app.ProgressDialog; import android.os.AsyncTask; -import android.support.v7.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.util.Log; import org.catrobat.catroid.R; diff --git a/catroid/src/main/java/org/catrobat/catroid/transfers/DeleteTestUserTask.java b/catroid/src/main/java/org/catrobat/catroid/transfers/DeleteTestUserTask.java index c7e5f75e7a7..8c94206fc26 100644 --- a/catroid/src/main/java/org/catrobat/catroid/transfers/DeleteTestUserTask.java +++ b/catroid/src/main/java/org/catrobat/catroid/transfers/DeleteTestUserTask.java @@ -24,7 +24,7 @@ import android.content.Context; import android.os.AsyncTask; -import android.support.v7.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.util.Log; import org.catrobat.catroid.R; diff --git a/catroid/src/main/java/org/catrobat/catroid/transfers/GoogleExchangeCodeTask.java b/catroid/src/main/java/org/catrobat/catroid/transfers/GoogleExchangeCodeTask.java index 1bb6b59ca6d..82030ff43ff 100644 --- a/catroid/src/main/java/org/catrobat/catroid/transfers/GoogleExchangeCodeTask.java +++ b/catroid/src/main/java/org/catrobat/catroid/transfers/GoogleExchangeCodeTask.java @@ -26,7 +26,7 @@ import android.app.ProgressDialog; import android.content.Context; import android.os.AsyncTask; -import android.support.v7.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.util.Log; import org.catrobat.catroid.R; diff --git a/catroid/src/main/java/org/catrobat/catroid/transfers/GoogleLogInTask.java b/catroid/src/main/java/org/catrobat/catroid/transfers/GoogleLogInTask.java index 8cb34e045ed..cea12f9b369 100644 --- a/catroid/src/main/java/org/catrobat/catroid/transfers/GoogleLogInTask.java +++ b/catroid/src/main/java/org/catrobat/catroid/transfers/GoogleLogInTask.java @@ -26,7 +26,7 @@ import android.app.ProgressDialog; import android.content.Context; import android.os.AsyncTask; -import android.support.v7.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.util.Log; import org.catrobat.catroid.R; diff --git a/catroid/src/main/java/org/catrobat/catroid/transfers/GoogleLoginHandler.java b/catroid/src/main/java/org/catrobat/catroid/transfers/GoogleLoginHandler.java index d9dcca8a60b..d3608d9330f 100644 --- a/catroid/src/main/java/org/catrobat/catroid/transfers/GoogleLoginHandler.java +++ b/catroid/src/main/java/org/catrobat/catroid/transfers/GoogleLoginHandler.java @@ -27,7 +27,10 @@ import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AppCompatActivity; import com.google.android.gms.auth.api.signin.GoogleSignInAccount; import com.google.android.gms.auth.api.signin.GoogleSignInClient; diff --git a/catroid/src/main/java/org/catrobat/catroid/transfers/project/ProjectUploadService.kt b/catroid/src/main/java/org/catrobat/catroid/transfers/project/ProjectUploadService.kt index ec7a3ef0b86..6465f993cbc 100644 --- a/catroid/src/main/java/org/catrobat/catroid/transfers/project/ProjectUploadService.kt +++ b/catroid/src/main/java/org/catrobat/catroid/transfers/project/ProjectUploadService.kt @@ -32,7 +32,7 @@ import android.content.Intent import android.os.Bundle import android.os.ResultReceiver import android.preference.PreferenceManager -import android.support.v4.app.NotificationCompat +import androidx.core.app.NotificationCompat import android.util.Log import org.catrobat.catroid.R import org.catrobat.catroid.common.Constants diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/BaseActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/BaseActivity.java index 5e71f3798fb..c5a7afe325f 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/BaseActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/BaseActivity.java @@ -26,8 +26,8 @@ import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; -import android.support.annotation.NonNull; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; import android.util.Log; import android.view.MenuItem; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/ExportLaunchers.kt b/catroid/src/main/java/org/catrobat/catroid/ui/ExportLaunchers.kt index f3254844e1c..2e853bda156 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/ExportLaunchers.kt +++ b/catroid/src/main/java/org/catrobat/catroid/ui/ExportLaunchers.kt @@ -24,7 +24,7 @@ package org.catrobat.catroid.ui import android.content.Intent -import android.support.v4.content.FileProvider +import androidx.core.content.FileProvider import org.catrobat.catroid.stage.StageActivity import java.io.File diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/ImportLaunchers.kt b/catroid/src/main/java/org/catrobat/catroid/ui/ImportLaunchers.kt index 3bdc4c2df38..fc0dbff8f8a 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/ImportLaunchers.kt +++ b/catroid/src/main/java/org/catrobat/catroid/ui/ImportLaunchers.kt @@ -31,8 +31,8 @@ import android.net.Uri import android.os.Bundle import android.provider.MediaStore import android.provider.MediaStore.ACTION_IMAGE_CAPTURE -import android.support.v4.content.FileProvider -import android.support.v7.app.AppCompatActivity +import androidx.core.content.FileProvider +import androidx.appcompat.app.AppCompatActivity import org.catrobat.catroid.ProjectManager import org.catrobat.catroid.R import org.catrobat.catroid.common.Constants.CAMERA_CACHE_DIR diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/MainMenuActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/MainMenuActivity.java index 18bb3f22b5e..8a92eecfbfc 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/MainMenuActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/MainMenuActivity.java @@ -27,7 +27,7 @@ import android.net.Uri; import android.os.Bundle; import android.preference.PreferenceManager; -import android.support.v7.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.text.Html; import android.text.Spannable; import android.text.SpannableString; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/MarketingActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/MarketingActivity.java index 44953d9dc41..cf76cc82b9c 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/MarketingActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/MarketingActivity.java @@ -30,7 +30,7 @@ import android.graphics.BitmapFactory; import android.net.Uri; import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.view.Window; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/ProjectActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/ProjectActivity.java index 4e17103c659..8ebd94bad41 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/ProjectActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/ProjectActivity.java @@ -29,10 +29,10 @@ import android.net.Uri; import android.os.Bundle; import android.preference.PreferenceManager; -import android.support.v4.app.DialogFragment; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentTransaction; -import android.support.v7.app.AlertDialog; +import androidx.fragment.app.DialogFragment; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentTransaction; +import androidx.appcompat.app.AlertDialog; import android.util.Log; import android.view.Menu; import android.view.MenuItem; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/ProjectListActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/ProjectListActivity.java index 0e3072bc894..07cf6aa254c 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/ProjectListActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/ProjectListActivity.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.ui; import android.os.Bundle; -import android.support.v4.app.Fragment; +import androidx.fragment.app.Fragment; import android.view.Menu; import android.view.View; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/ProjectUploadActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/ProjectUploadActivity.java index a90ea4a7b5d..af6691dda81 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/ProjectUploadActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/ProjectUploadActivity.java @@ -32,8 +32,8 @@ import android.os.Bundle; import android.os.Handler; import android.preference.PreferenceManager; -import android.support.design.widget.TextInputLayout; -import android.support.v7.app.AlertDialog; +import com.google.android.material.textfield.TextInputLayout; +import androidx.appcompat.app.AlertDialog; import android.text.Editable; import android.text.TextWatcher; import android.util.Log; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/ScratchConverterActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/ScratchConverterActivity.java index 70d3603d7e4..040a31799e4 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/ScratchConverterActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/ScratchConverterActivity.java @@ -25,10 +25,10 @@ import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; -import android.support.annotation.IntDef; -import android.support.annotation.NonNull; -import android.support.v4.app.FragmentTransaction; -import android.support.v7.widget.Toolbar; +import androidx.annotation.IntDef; +import androidx.annotation.NonNull; +import androidx.fragment.app.FragmentTransaction; +import androidx.appcompat.widget.Toolbar; import android.text.Spannable; import android.text.SpannableString; import android.text.style.ForegroundColorSpan; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/ScratchProgramDetailsActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/ScratchProgramDetailsActivity.java index 9c97147b50a..659a03ce1c4 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/ScratchProgramDetailsActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/ScratchProgramDetailsActivity.java @@ -28,9 +28,9 @@ import android.os.AsyncTask; import android.os.Bundle; import android.os.Parcelable; -import android.support.annotation.NonNull; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.text.Spannable; import android.text.SpannableString; import android.text.style.ForegroundColorSpan; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/SettingsActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/SettingsActivity.java index 3881c941d86..c7463d98ed7 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/SettingsActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/SettingsActivity.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.ui; import android.os.Bundle; -import android.support.v7.widget.Toolbar; +import androidx.appcompat.widget.Toolbar; import org.catrobat.catroid.R; import org.catrobat.catroid.ui.settingsfragments.AccessibilitySettingsFragment; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/SpriteActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/SpriteActivity.java index 1b566139a04..5b4cdfc7cab 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/SpriteActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/SpriteActivity.java @@ -25,9 +25,9 @@ import android.content.Intent; import android.net.Uri; import android.os.Bundle; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentTransaction; -import android.support.v7.app.AlertDialog; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentTransaction; +import androidx.appcompat.app.AlertDialog; import android.util.Log; import android.view.Menu; import android.view.MenuItem; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/SpriteAttributesActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/SpriteAttributesActivity.java index 60846dbd46e..6d3ef393c94 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/SpriteAttributesActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/SpriteAttributesActivity.java @@ -27,11 +27,11 @@ import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; -import android.support.annotation.IntDef; -import android.support.v4.content.ContextCompat; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.IntDef; +import androidx.core.content.ContextCompat; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import android.view.View; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/UiUtils.java b/catroid/src/main/java/org/catrobat/catroid/ui/UiUtils.java index 9c92985c906..b849ac3e310 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/UiUtils.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/UiUtils.java @@ -25,8 +25,8 @@ import android.content.Context; import android.content.ContextWrapper; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; import android.view.View; public final class UiUtils { diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/WebViewActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/WebViewActivity.java index 38d9f04eeea..d940853e06e 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/WebViewActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/WebViewActivity.java @@ -32,8 +32,8 @@ import android.net.Uri; import android.os.Bundle; import android.os.Environment; -import android.support.v4.content.res.ResourcesCompat; -import android.support.v7.app.AppCompatActivity; +import androidx.core.content.res.ResourcesCompat; +import androidx.appcompat.app.AppCompatActivity; import android.util.Log; import android.view.KeyEvent; import android.webkit.CookieManager; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/adapter/CastDevicesAdapter.java b/catroid/src/main/java/org/catrobat/catroid/ui/adapter/CastDevicesAdapter.java index daa33e6ac12..20a98797b5a 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/adapter/CastDevicesAdapter.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/adapter/CastDevicesAdapter.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.ui.adapter; import android.content.Context; -import android.support.v7.media.MediaRouter; +import androidx.mediarouter.media.MediaRouter; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/FormulaEditorComputeDialog.java b/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/FormulaEditorComputeDialog.java index 374ff660c35..10677c06a48 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/FormulaEditorComputeDialog.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/FormulaEditorComputeDialog.java @@ -27,7 +27,7 @@ import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.os.Bundle; -import android.support.v7.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.view.MotionEvent; import android.view.ViewGroup; import android.widget.TextView; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/LegoSensorConfigInfoDialog.java b/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/LegoSensorConfigInfoDialog.java index 8d2f1d9d1d4..70ac297b960 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/LegoSensorConfigInfoDialog.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/LegoSensorConfigInfoDialog.java @@ -27,8 +27,8 @@ import android.content.DialogInterface; import android.os.Bundle; import android.preference.PreferenceManager; -import android.support.v4.app.DialogFragment; -import android.support.v7.app.AlertDialog; +import androidx.fragment.app.DialogFragment; +import androidx.appcompat.app.AlertDialog; import android.view.View; import android.widget.CheckBox; import android.widget.TextView; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/LegoSensorPortConfigDialog.java b/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/LegoSensorPortConfigDialog.java index fb8b9a23515..2a4adfbd601 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/LegoSensorPortConfigDialog.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/LegoSensorPortConfigDialog.java @@ -24,9 +24,9 @@ import android.content.Context; import android.content.DialogInterface; -import android.support.annotation.NonNull; -import android.support.annotation.StringRes; -import android.support.v7.app.AlertDialog; +import androidx.annotation.NonNull; +import androidx.annotation.StringRes; +import androidx.appcompat.app.AlertDialog; import com.google.common.collect.ImmutableMap; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/ScratchReconvertDialog.java b/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/ScratchReconvertDialog.java index 36d2ca0a938..edb971bfa65 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/ScratchReconvertDialog.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/ScratchReconvertDialog.java @@ -27,8 +27,8 @@ import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; -import android.support.v4.app.DialogFragment; -import android.support.v7.app.AlertDialog; +import androidx.fragment.app.DialogFragment; +import androidx.appcompat.app.AlertDialog; import android.util.Log; import android.view.KeyEvent; import android.view.View; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/SelectCastDialog.java b/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/SelectCastDialog.java index 1867e0b0f54..9b125476408 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/SelectCastDialog.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/SelectCastDialog.java @@ -26,9 +26,9 @@ import android.content.DialogInterface; import android.os.Bundle; import android.os.Handler; -import android.support.v4.app.DialogFragment; -import android.support.v7.app.AlertDialog; -import android.support.v7.media.MediaRouter; +import androidx.fragment.app.DialogFragment; +import androidx.appcompat.app.AlertDialog; +import androidx.mediarouter.media.MediaRouter; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/TermsOfUseDialogFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/TermsOfUseDialogFragment.java index 86eff0d31ba..95ef9f07b79 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/TermsOfUseDialogFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/TermsOfUseDialogFragment.java @@ -25,8 +25,8 @@ import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; -import android.support.v4.app.DialogFragment; -import android.support.v7.app.AlertDialog; +import androidx.fragment.app.DialogFragment; +import androidx.appcompat.app.AlertDialog; import android.text.Html; import android.text.method.LinkMovementMethod; import android.view.View; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/dragndrop/BrickListView.java b/catroid/src/main/java/org/catrobat/catroid/ui/dragndrop/BrickListView.java index a2794447256..10bb63318c5 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/dragndrop/BrickListView.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/dragndrop/BrickListView.java @@ -30,8 +30,8 @@ import android.graphics.Color; import android.graphics.Rect; import android.graphics.drawable.BitmapDrawable; -import android.support.annotation.NonNull; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.NonNull; +import androidx.annotation.VisibleForTesting; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/filepicker/FilePickerActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/filepicker/FilePickerActivity.java index 2b4bb628233..0afe93f95b3 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/filepicker/FilePickerActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/filepicker/FilePickerActivity.java @@ -26,8 +26,8 @@ import android.content.Intent; import android.net.Uri; import android.os.Bundle; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.View; import org.catrobat.catroid.R; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/filepicker/FilePickerAdapter.java b/catroid/src/main/java/org/catrobat/catroid/ui/filepicker/FilePickerAdapter.java index 85cad84ec3f..2b09611ccca 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/filepicker/FilePickerAdapter.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/filepicker/FilePickerAdapter.java @@ -23,8 +23,8 @@ package org.catrobat.catroid.ui.filepicker; -import android.support.annotation.NonNull; -import android.support.v7.widget.RecyclerView; +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/AddBrickFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/AddBrickFragment.java index 482ed8a8600..9a1e5b0ba80 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/AddBrickFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/AddBrickFragment.java @@ -25,11 +25,11 @@ import android.content.Context; import android.os.Bundle; import android.preference.PreferenceManager; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentTransaction; -import android.support.v4.app.ListFragment; -import android.support.v7.app.ActionBar; -import android.support.v7.app.AppCompatActivity; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentTransaction; +import androidx.fragment.app.ListFragment; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/AddUserBrickFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/AddUserBrickFragment.java index 97ef30788c6..b34581c3aa5 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/AddUserBrickFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/AddUserBrickFragment.java @@ -24,8 +24,8 @@ package org.catrobat.catroid.ui.fragment; import android.os.Bundle; -import android.support.v4.app.ListFragment; -import android.support.v7.app.AppCompatActivity; +import androidx.fragment.app.ListFragment; +import androidx.appcompat.app.AppCompatActivity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/BrickCategoryFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/BrickCategoryFragment.java index 6732b018807..e4dafa6af92 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/BrickCategoryFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/BrickCategoryFragment.java @@ -24,10 +24,10 @@ import android.os.Bundle; import android.preference.PreferenceManager; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.ListFragment; -import android.support.v7.app.ActionBar; -import android.support.v7.app.AppCompatActivity; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.ListFragment; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; import android.view.LayoutInflater; import android.view.Menu; import android.view.View; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/FormulaEditorFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/FormulaEditorFragment.java index 0c384590e93..dd90d889a1f 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/FormulaEditorFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/FormulaEditorFragment.java @@ -30,13 +30,13 @@ import android.os.Bundle; import android.os.Handler; import android.provider.Settings; -import android.support.annotation.NonNull; -import android.support.annotation.VisibleForTesting; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v7.app.ActionBar; -import android.support.v7.app.AlertDialog; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.NonNull; +import androidx.annotation.VisibleForTesting; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AppCompatActivity; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/ProjectDetailsFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/ProjectDetailsFragment.java index 4b7d217273c..54c0c1687b1 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/ProjectDetailsFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/ProjectDetailsFragment.java @@ -24,7 +24,7 @@ import android.content.DialogInterface; import android.os.Bundle; -import android.support.v4.app.Fragment; +import androidx.fragment.app.Fragment; import android.text.format.DateFormat; import android.text.format.DateUtils; import android.util.Log; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/RVButton.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/RVButton.java index 8757453d623..e7898751c4e 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/RVButton.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/RVButton.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.ui.recyclerview; import android.graphics.drawable.Drawable; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; public class RVButton { diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/BrickAdapter.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/BrickAdapter.java index dd3c80290ea..e43fc5367c2 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/BrickAdapter.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/BrickAdapter.java @@ -26,7 +26,7 @@ import android.graphics.ColorMatrix; import android.graphics.ColorMatrixColorFilter; import android.graphics.drawable.Drawable; -import android.support.annotation.IntDef; +import androidx.annotation.IntDef; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/ButtonAdapter.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/ButtonAdapter.java index 455fd6b5f08..a4926e02c01 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/ButtonAdapter.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/ButtonAdapter.java @@ -23,8 +23,8 @@ package org.catrobat.catroid.ui.recyclerview.adapter; -import android.support.annotation.NonNull; -import android.support.v7.widget.RecyclerView; +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/CategoryListRVAdapter.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/CategoryListRVAdapter.java index 1afbdd58bd0..0d484eadc43 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/CategoryListRVAdapter.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/CategoryListRVAdapter.java @@ -23,11 +23,11 @@ package org.catrobat.catroid.ui.recyclerview.adapter; -import android.support.annotation.IntDef; -import android.support.annotation.LayoutRes; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v7.widget.RecyclerView; +import androidx.annotation.IntDef; +import androidx.annotation.LayoutRes; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/DataListAdapter.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/DataListAdapter.java index c5041407296..17845d17336 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/DataListAdapter.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/DataListAdapter.java @@ -23,10 +23,10 @@ package org.catrobat.catroid.ui.recyclerview.adapter; -import android.support.annotation.IntDef; -import android.support.annotation.LayoutRes; -import android.support.annotation.NonNull; -import android.support.v7.widget.RecyclerView; +import androidx.annotation.IntDef; +import androidx.annotation.LayoutRes; +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; import android.view.ViewGroup; import android.widget.TextView; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/MultiViewSpriteAdapter.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/MultiViewSpriteAdapter.java index b0cc5c62a2f..fa4004ddede 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/MultiViewSpriteAdapter.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/MultiViewSpriteAdapter.java @@ -26,7 +26,7 @@ import android.content.Context; import android.graphics.Bitmap; import android.graphics.drawable.Drawable; -import android.support.annotation.IntDef; +import androidx.annotation.IntDef; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/RVAdapter.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/RVAdapter.java index 1c630ee7828..e487e231172 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/RVAdapter.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/RVAdapter.java @@ -23,8 +23,8 @@ package org.catrobat.catroid.ui.recyclerview.adapter; -import android.support.annotation.IntDef; -import android.support.v7.widget.RecyclerView; +import androidx.annotation.IntDef; +import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/draganddrop/TouchHelperCallback.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/draganddrop/TouchHelperCallback.java index 44620573118..670ea0d02f3 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/draganddrop/TouchHelperCallback.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/draganddrop/TouchHelperCallback.java @@ -23,8 +23,8 @@ package org.catrobat.catroid.ui.recyclerview.adapter.draganddrop; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.helper.ItemTouchHelper; +import androidx.recyclerview.widget.RecyclerView; +import androidx.recyclerview.widget.ItemTouchHelper; import org.catrobat.catroid.R; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackActivity.java index 2f5dcbe0033..c087cffb1db 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackActivity.java @@ -26,8 +26,8 @@ import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.Bundle; -import android.support.v4.app.FragmentTransaction; -import android.support.v7.widget.Toolbar; +import androidx.fragment.app.FragmentTransaction; +import androidx.appcompat.widget.Toolbar; import android.view.Menu; import org.catrobat.catroid.R; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackLookFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackLookFragment.java index 942bf6882d9..6a2c53e94a5 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackLookFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackLookFragment.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.ui.recyclerview.backpack; -import android.support.annotation.PluralsRes; +import androidx.annotation.PluralsRes; import android.util.Log; import org.catrobat.catroid.ProjectManager; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackRecyclerViewFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackRecyclerViewFragment.java index 901a318c4d3..63cda0d92fd 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackRecyclerViewFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackRecyclerViewFragment.java @@ -26,12 +26,12 @@ import android.content.DialogInterface; import android.os.Bundle; import android.preference.PreferenceManager; -import android.support.annotation.IntDef; -import android.support.annotation.PluralsRes; -import android.support.v4.app.Fragment; -import android.support.v7.app.AlertDialog; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.helper.ItemTouchHelper; +import androidx.annotation.IntDef; +import androidx.annotation.PluralsRes; +import androidx.fragment.app.Fragment; +import androidx.appcompat.app.AlertDialog; +import androidx.recyclerview.widget.RecyclerView; +import androidx.recyclerview.widget.ItemTouchHelper; import android.view.ActionMode; import android.view.LayoutInflater; import android.view.Menu; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackSceneFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackSceneFragment.java index 65a8dfc7468..b0dc4ac1fae 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackSceneFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackSceneFragment.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.ui.recyclerview.backpack; -import android.support.annotation.PluralsRes; +import androidx.annotation.PluralsRes; import android.util.Log; import org.catrobat.catroid.ProjectManager; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackScriptFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackScriptFragment.java index 7cae3ff962e..d2e35e2377b 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackScriptFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackScriptFragment.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.ui.recyclerview.backpack; -import android.support.annotation.PluralsRes; +import androidx.annotation.PluralsRes; import android.util.Log; import org.catrobat.catroid.ProjectManager; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackSoundFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackSoundFragment.java index 12f0e9d9028..77d262ce6f9 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackSoundFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackSoundFragment.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.ui.recyclerview.backpack; -import android.support.annotation.PluralsRes; +import androidx.annotation.PluralsRes; import android.util.Log; import org.catrobat.catroid.ProjectManager; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackSpriteFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackSpriteFragment.java index 48875efddc1..3ebbe6bb734 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackSpriteFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackSpriteFragment.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.ui.recyclerview.backpack; -import android.support.annotation.PluralsRes; +import androidx.annotation.PluralsRes; import android.util.Log; import org.catrobat.catroid.ProjectManager; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/controller/BrickController.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/controller/BrickController.java index 5b8ab98e175..4fcf0ce96ec 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/controller/BrickController.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/controller/BrickController.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.ui.recyclerview.controller; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import android.util.Log; import org.catrobat.catroid.content.Script; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/AboutDialogFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/AboutDialogFragment.java index 2434ff62c84..7256296e2f9 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/AboutDialogFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/AboutDialogFragment.java @@ -24,8 +24,8 @@ import android.app.Dialog; import android.os.Bundle; -import android.support.v4.app.DialogFragment; -import android.support.v7.app.AlertDialog; +import androidx.fragment.app.DialogFragment; +import androidx.appcompat.app.AlertDialog; import android.text.Html; import android.text.method.LinkMovementMethod; import android.view.View; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/NewProjectDialogFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/NewProjectDialogFragment.java index 8680c0b3cae..06b3ad2412f 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/NewProjectDialogFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/NewProjectDialogFragment.java @@ -25,7 +25,7 @@ import android.app.Dialog; import android.content.Intent; import android.os.Bundle; -import android.support.v4.app.DialogFragment; +import androidx.fragment.app.DialogFragment; import android.view.View; import android.widget.RadioGroup; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/OrientationDialogFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/OrientationDialogFragment.java index 854d6ac2885..48435c45a10 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/OrientationDialogFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/OrientationDialogFragment.java @@ -26,9 +26,9 @@ import android.app.Dialog; import android.content.Intent; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v4.app.DialogFragment; -import android.support.v7.app.AlertDialog; +import androidx.annotation.Nullable; +import androidx.fragment.app.DialogFragment; +import androidx.appcompat.app.AlertDialog; import android.view.View; import android.widget.RadioGroup; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/PlaySceneDialog.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/PlaySceneDialog.java index b2abd41b3c1..3495dc1bcec 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/PlaySceneDialog.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/PlaySceneDialog.java @@ -25,8 +25,8 @@ import android.content.Context; import android.content.DialogInterface; -import android.support.annotation.NonNull; -import android.support.v7.app.AlertDialog; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AlertDialog; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/PrivacyPolicyDialogFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/PrivacyPolicyDialogFragment.java index 6363bda6c60..b66ebe9e848 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/PrivacyPolicyDialogFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/PrivacyPolicyDialogFragment.java @@ -27,9 +27,9 @@ import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.v4.app.DialogFragment; -import android.support.v7.app.AlertDialog; +import androidx.annotation.NonNull; +import androidx.fragment.app.DialogFragment; +import androidx.appcompat.app.AlertDialog; import android.view.View; import org.catrobat.catroid.R; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/ReplaceExistingProjectDialogFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/ReplaceExistingProjectDialogFragment.java index 7dc01f613fc..5fe020c506a 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/ReplaceExistingProjectDialogFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/ReplaceExistingProjectDialogFragment.java @@ -26,11 +26,11 @@ import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; -import android.support.annotation.IdRes; -import android.support.annotation.Nullable; -import android.support.design.widget.TextInputLayout; -import android.support.v4.app.DialogFragment; -import android.support.v7.app.AlertDialog; +import androidx.annotation.IdRes; +import androidx.annotation.Nullable; +import com.google.android.material.textfield.TextInputLayout; +import androidx.fragment.app.DialogFragment; +import androidx.appcompat.app.AlertDialog; import android.view.View; import android.widget.RadioGroup; import android.widget.TextView; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/TextInputDialog.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/TextInputDialog.java index 47ad6646700..51c0f363ccb 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/TextInputDialog.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/TextInputDialog.java @@ -26,10 +26,10 @@ import android.app.Dialog; import android.content.Context; import android.content.DialogInterface; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.design.widget.TextInputLayout; -import android.support.v7.app.AlertDialog; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import com.google.android.material.textfield.TextInputLayout; +import androidx.appcompat.app.AlertDialog; import android.text.Editable; import org.catrobat.catroid.R; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/login/LoginDialogFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/login/LoginDialogFragment.java index 4fa18daa98c..6d81054bfa6 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/login/LoginDialogFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/login/LoginDialogFragment.java @@ -26,9 +26,9 @@ import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; -import android.support.design.widget.TextInputLayout; -import android.support.v4.app.DialogFragment; -import android.support.v7.app.AlertDialog; +import com.google.android.material.textfield.TextInputLayout; +import androidx.fragment.app.DialogFragment; +import androidx.appcompat.app.AlertDialog; import android.text.Editable; import android.text.InputType; import android.text.TextWatcher; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/login/OAuthUsernameDialogFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/login/OAuthUsernameDialogFragment.java index 512a6f406e1..ec17f864a92 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/login/OAuthUsernameDialogFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/login/OAuthUsernameDialogFragment.java @@ -27,9 +27,9 @@ import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; -import android.support.design.widget.TextInputLayout; -import android.support.v4.app.DialogFragment; -import android.support.v7.app.AlertDialog; +import com.google.android.material.textfield.TextInputLayout; +import androidx.fragment.app.DialogFragment; +import androidx.appcompat.app.AlertDialog; import android.view.View; import android.widget.Button; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/login/RegistrationDialogFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/login/RegistrationDialogFragment.java index 2f79687bf08..b23922d397c 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/login/RegistrationDialogFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/login/RegistrationDialogFragment.java @@ -26,9 +26,9 @@ import android.content.DialogInterface; import android.content.DialogInterface.OnShowListener; import android.os.Bundle; -import android.support.design.widget.TextInputLayout; -import android.support.v4.app.DialogFragment; -import android.support.v7.app.AlertDialog; +import com.google.android.material.textfield.TextInputLayout; +import androidx.fragment.app.DialogFragment; +import androidx.appcompat.app.AlertDialog; import android.text.Editable; import android.text.InputType; import android.text.TextWatcher; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/DialogInputWatcher.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/DialogInputWatcher.java index 52a09e5b9b4..d564e43956b 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/DialogInputWatcher.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/DialogInputWatcher.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.ui.recyclerview.dialog.textwatcher; -import android.support.design.widget.TextInputLayout; +import com.google.android.material.textfield.TextInputLayout; import android.text.Editable; import android.text.TextWatcher; import android.widget.Button; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/NewItemTextWatcher.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/NewItemTextWatcher.java index d50dbef13aa..5e7c50f91dc 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/NewItemTextWatcher.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/NewItemTextWatcher.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.ui.recyclerview.dialog.textwatcher; import android.content.Context; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import org.catrobat.catroid.R; import org.catrobat.catroid.common.Nameable; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/NonEmptyStringTextWatcher.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/NonEmptyStringTextWatcher.java index 579e07f498f..4ee3dd17cd6 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/NonEmptyStringTextWatcher.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/NonEmptyStringTextWatcher.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.ui.recyclerview.dialog.textwatcher; import android.content.Context; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import org.catrobat.catroid.R; import org.catrobat.catroid.ui.recyclerview.dialog.TextInputDialog; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/RenameItemTextWatcher.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/RenameItemTextWatcher.java index 3a7fc59555c..dcc69bc8f9c 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/RenameItemTextWatcher.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/RenameItemTextWatcher.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.ui.recyclerview.dialog.textwatcher; import android.content.Context; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import org.catrobat.catroid.R; import org.catrobat.catroid.common.Nameable; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/UniqueStringTextWatcher.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/UniqueStringTextWatcher.java index b6919482d7d..88dacbb7c44 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/UniqueStringTextWatcher.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/UniqueStringTextWatcher.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.ui.recyclerview.dialog.textwatcher; import android.content.Context; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import org.catrobat.catroid.R; import org.catrobat.catroid.ui.recyclerview.dialog.TextInputDialog; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/CategoryListFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/CategoryListFragment.java index 60d1834ae53..2818bf9dcf1 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/CategoryListFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/CategoryListFragment.java @@ -26,11 +26,11 @@ import android.content.DialogInterface; import android.content.res.TypedArray; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v7.app.AlertDialog; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.RecyclerView; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.Menu; import android.view.View; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/DataListFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/DataListFragment.java index 495b901f135..96525e91a80 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/DataListFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/DataListFragment.java @@ -25,11 +25,11 @@ import android.content.DialogInterface; import android.os.Bundle; -import android.support.annotation.IntDef; -import android.support.v4.app.Fragment; -import android.support.v7.app.AlertDialog; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.RecyclerView; +import androidx.annotation.IntDef; +import androidx.fragment.app.Fragment; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.RecyclerView; import android.view.ActionMode; import android.view.LayoutInflater; import android.view.Menu; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/LookListFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/LookListFragment.java index e560e82dd57..0f08cb6390e 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/LookListFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/LookListFragment.java @@ -26,7 +26,7 @@ import android.content.ComponentName; import android.content.Intent; import android.os.Bundle; -import android.support.annotation.PluralsRes; +import androidx.annotation.PluralsRes; import android.util.Log; import org.catrobat.catroid.ProjectManager; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/MainMenuFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/MainMenuFragment.java index 0a728933fde..5f5ad139c19 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/MainMenuFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/MainMenuFragment.java @@ -26,12 +26,12 @@ import android.content.Intent; import android.net.Uri; import android.os.Bundle; -import android.support.annotation.IntDef; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v4.content.ContextCompat; -import android.support.v7.widget.RecyclerView; +import androidx.annotation.IntDef; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.core.content.ContextCompat; +import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/NfcTagListFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/NfcTagListFragment.java index feb2da8f216..be1571e4d4f 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/NfcTagListFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/NfcTagListFragment.java @@ -28,7 +28,7 @@ import android.nfc.NfcAdapter; import android.os.Bundle; import android.provider.Settings; -import android.support.annotation.PluralsRes; +import androidx.annotation.PluralsRes; import android.util.Log; import android.view.Menu; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/ProjectListFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/ProjectListFragment.java index 06fe724f16e..3c08e77721f 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/ProjectListFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/ProjectListFragment.java @@ -27,8 +27,8 @@ import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; -import android.support.annotation.PluralsRes; -import android.support.v7.app.AlertDialog; +import androidx.annotation.PluralsRes; +import androidx.appcompat.app.AlertDialog; import android.util.Log; import android.view.MenuItem; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/RecyclerViewFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/RecyclerViewFragment.java index a3c71389911..cd460cc070e 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/RecyclerViewFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/RecyclerViewFragment.java @@ -26,14 +26,14 @@ import android.content.Context; import android.os.Bundle; import android.preference.PreferenceManager; -import android.support.annotation.IntDef; -import android.support.annotation.NonNull; -import android.support.annotation.PluralsRes; -import android.support.annotation.StringRes; -import android.support.v4.app.Fragment; -import android.support.v7.app.AlertDialog; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.helper.ItemTouchHelper; +import androidx.annotation.IntDef; +import androidx.annotation.NonNull; +import androidx.annotation.PluralsRes; +import androidx.annotation.StringRes; +import androidx.fragment.app.Fragment; +import androidx.appcompat.app.AlertDialog; +import androidx.recyclerview.widget.RecyclerView; +import androidx.recyclerview.widget.ItemTouchHelper; import android.view.ActionMode; import android.view.LayoutInflater; import android.view.Menu; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/SceneListFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/SceneListFragment.java index 7f18b03b72f..857877b6ddc 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/SceneListFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/SceneListFragment.java @@ -24,8 +24,8 @@ package org.catrobat.catroid.ui.recyclerview.fragment; import android.content.Intent; -import android.support.annotation.PluralsRes; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.PluralsRes; +import androidx.appcompat.app.AppCompatActivity; import android.util.Log; import android.view.Menu; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/ScriptFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/ScriptFragment.java index 70bdf160a1b..2cec8b4803b 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/ScriptFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/ScriptFragment.java @@ -26,11 +26,11 @@ import android.net.Uri; import android.os.Bundle; import android.os.Parcelable; -import android.support.annotation.IntDef; -import android.support.v4.app.ListFragment; -import android.support.v7.app.ActionBar; -import android.support.v7.app.AlertDialog; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.IntDef; +import androidx.fragment.app.ListFragment; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AppCompatActivity; import android.util.Log; import android.view.ActionMode; import android.view.LayoutInflater; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/SoundListFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/SoundListFragment.java index b93a17b9627..e96e0fb7e9f 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/SoundListFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/SoundListFragment.java @@ -24,7 +24,7 @@ package org.catrobat.catroid.ui.recyclerview.fragment; import android.content.Intent; -import android.support.annotation.PluralsRes; +import androidx.annotation.PluralsRes; import android.util.Log; import org.catrobat.catroid.BuildConfig; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/SpriteListFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/SpriteListFragment.java index 9c05dad0fb8..33c22cabe13 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/SpriteListFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/SpriteListFragment.java @@ -25,11 +25,11 @@ import android.content.DialogInterface; import android.content.Intent; -import android.support.annotation.PluralsRes; -import android.support.v7.app.AlertDialog; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.helper.ItemTouchHelper; +import androidx.annotation.PluralsRes; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.RecyclerView; +import androidx.recyclerview.widget.ItemTouchHelper; import android.util.Log; import android.view.Menu; import android.view.MenuItem; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/scratchconverter/ScratchProgramsFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/scratchconverter/ScratchProgramsFragment.java index 2f09e894cb8..03fd21af88e 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/scratchconverter/ScratchProgramsFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/scratchconverter/ScratchProgramsFragment.java @@ -25,10 +25,10 @@ import android.content.Intent; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v7.app.AlertDialog; -import android.support.v7.widget.RecyclerView; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.appcompat.app.AlertDialog; +import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/scratchconverter/ScratchSearchResultsFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/scratchconverter/ScratchSearchResultsFragment.java index 0c264e110eb..906533c0551 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/scratchconverter/ScratchSearchResultsFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/scratchconverter/ScratchSearchResultsFragment.java @@ -29,10 +29,10 @@ import android.os.Bundle; import android.os.Parcelable; import android.preference.PreferenceManager; -import android.support.annotation.IntDef; -import android.support.v4.app.Fragment; -import android.support.v7.app.AlertDialog; -import android.support.v7.widget.RecyclerView; +import androidx.annotation.IntDef; +import androidx.fragment.app.Fragment; +import androidx.appcompat.app.AlertDialog; +import androidx.recyclerview.widget.RecyclerView; import android.view.ActionMode; import android.view.LayoutInflater; import android.view.Menu; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/viewholder/ViewHolder.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/viewholder/ViewHolder.java index 9a2292ad46a..fc6b15da947 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/viewholder/ViewHolder.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/viewholder/ViewHolder.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.ui.recyclerview.viewholder; -import android.support.v7.widget.RecyclerView; +import androidx.recyclerview.widget.RecyclerView; import android.view.View; import android.widget.TextView; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/runtimepermissions/PermissionRequestActivityExtension.java b/catroid/src/main/java/org/catrobat/catroid/ui/runtimepermissions/PermissionRequestActivityExtension.java index 60d24dfec05..753d04a4ba1 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/runtimepermissions/PermissionRequestActivityExtension.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/runtimepermissions/PermissionRequestActivityExtension.java @@ -28,7 +28,7 @@ import android.content.DialogInterface; import android.content.pm.PackageManager; import android.os.Build; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import org.catrobat.catroid.R; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/runtimepermissions/RequiresPermissionTask.java b/catroid/src/main/java/org/catrobat/catroid/ui/runtimepermissions/RequiresPermissionTask.java index 8d430015bf0..f5200b06984 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/runtimepermissions/RequiresPermissionTask.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/runtimepermissions/RequiresPermissionTask.java @@ -25,9 +25,9 @@ import android.app.Activity; import android.content.pm.PackageManager; -import android.support.annotation.StringRes; -import android.support.v4.app.ActivityCompat; -import android.support.v4.content.ContextCompat; +import androidx.annotation.StringRes; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; import android.util.Log; import java.util.List; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/scratchconverter/JobViewListener.java b/catroid/src/main/java/org/catrobat/catroid/ui/scratchconverter/JobViewListener.java index 3d7a67c81fb..cfdbe298d5d 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/scratchconverter/JobViewListener.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/scratchconverter/JobViewListener.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.ui.scratchconverter; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import org.catrobat.catroid.scratchconverter.protocol.Job; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/AccessibilityProfile.java b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/AccessibilityProfile.java index d2bdcd23faf..d589f4b74d9 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/AccessibilityProfile.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/AccessibilityProfile.java @@ -25,7 +25,7 @@ import android.content.SharedPreferences; import android.content.res.Resources; -import android.support.annotation.StringDef; +import androidx.annotation.StringDef; import org.catrobat.catroid.R; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/AccessibilityProfilesFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/AccessibilityProfilesFragment.java index fcd5dc0730a..330ac4328b4 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/AccessibilityProfilesFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/AccessibilityProfilesFragment.java @@ -28,9 +28,9 @@ import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; -import android.support.annotation.Nullable; -import android.support.v4.content.ContextCompat; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.Nullable; +import androidx.core.content.ContextCompat; +import androidx.appcompat.app.AppCompatActivity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/AccessibilitySettingsFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/AccessibilitySettingsFragment.java index b7afec4fbc8..5523ad93c15 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/AccessibilitySettingsFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/AccessibilitySettingsFragment.java @@ -29,8 +29,8 @@ import android.preference.Preference; import android.preference.PreferenceFragment; import android.preference.PreferenceScreen; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; import org.catrobat.catroid.R; import org.catrobat.catroid.ui.MainMenuActivity; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/Ev3SensorsSettingsFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/Ev3SensorsSettingsFragment.java index 01a6412e16c..3f34f9f68fa 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/Ev3SensorsSettingsFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/Ev3SensorsSettingsFragment.java @@ -29,8 +29,8 @@ import android.preference.Preference; import android.preference.PreferenceCategory; import android.preference.PreferenceFragment; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; import org.catrobat.catroid.BuildConfig; import org.catrobat.catroid.R; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/NXTSensorsSettingsFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/NXTSensorsSettingsFragment.java index d879c683382..a076b096838 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/NXTSensorsSettingsFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/NXTSensorsSettingsFragment.java @@ -30,8 +30,8 @@ import android.preference.PreferenceCategory; import android.preference.PreferenceFragment; import android.preference.PreferenceScreen; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; import org.catrobat.catroid.BuildConfig; import org.catrobat.catroid.R; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/ParrotARDroneSettingsFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/ParrotARDroneSettingsFragment.java index 3be54827ad4..b04b0538520 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/ParrotARDroneSettingsFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/ParrotARDroneSettingsFragment.java @@ -30,8 +30,8 @@ import android.preference.PreferenceCategory; import android.preference.PreferenceFragment; import android.preference.PreferenceScreen; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; import org.catrobat.catroid.BuildConfig; import org.catrobat.catroid.R; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/ParrotJumpingSumoSettingsFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/ParrotJumpingSumoSettingsFragment.java index 3ecd6bd6c98..293ec8f79a2 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/ParrotJumpingSumoSettingsFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/ParrotJumpingSumoSettingsFragment.java @@ -26,8 +26,8 @@ import android.os.Bundle; import android.preference.PreferenceFragment; import android.preference.PreferenceScreen; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; import org.catrobat.catroid.BuildConfig; import org.catrobat.catroid.R; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/RaspberryPiSettingsFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/RaspberryPiSettingsFragment.java index ccee844c9e8..3714ba41b16 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/RaspberryPiSettingsFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/RaspberryPiSettingsFragment.java @@ -32,8 +32,8 @@ import android.preference.PreferenceFragment; import android.preference.PreferenceManager; import android.preference.PreferenceScreen; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; import org.catrobat.catroid.BuildConfig; import org.catrobat.catroid.R; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/SettingsFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/SettingsFragment.java index 353c3907ebf..fd331f727b6 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/SettingsFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/SettingsFragment.java @@ -35,7 +35,7 @@ import android.preference.PreferenceFragment; import android.preference.PreferenceManager; import android.preference.PreferenceScreen; -import android.support.v7.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatActivity; import android.util.DisplayMetrics; import org.catrobat.catroid.BuildConfig; diff --git a/catroid/src/main/java/org/catrobat/catroid/utils/CrashReporter.java b/catroid/src/main/java/org/catrobat/catroid/utils/CrashReporter.java index e3fe677346f..9d27dec99e9 100644 --- a/catroid/src/main/java/org/catrobat/catroid/utils/CrashReporter.java +++ b/catroid/src/main/java/org/catrobat/catroid/utils/CrashReporter.java @@ -26,7 +26,7 @@ import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import android.util.Log; import com.google.gson.Gson; diff --git a/catroid/src/main/java/org/catrobat/catroid/utils/SnackbarUtil.java b/catroid/src/main/java/org/catrobat/catroid/utils/SnackbarUtil.java index 8e68d268055..241131a88c1 100644 --- a/catroid/src/main/java/org/catrobat/catroid/utils/SnackbarUtil.java +++ b/catroid/src/main/java/org/catrobat/catroid/utils/SnackbarUtil.java @@ -26,9 +26,9 @@ import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; -import android.support.annotation.StringRes; -import android.support.design.widget.Snackbar; -import android.support.v4.content.ContextCompat; +import androidx.annotation.StringRes; +import com.google.android.material.snackbar.Snackbar; +import androidx.core.content.ContextCompat; import android.view.View; import android.widget.TextView; @@ -66,7 +66,7 @@ public void onClick(View v) { }); snackbar.setActionTextColor(ContextCompat.getColor(activity, R.color.solid_black)); View snackbarView = snackbar.getView(); - TextView textView = snackbarView.findViewById(android.support.design.R.id.snackbar_text); + TextView textView = snackbarView.findViewById(com.google.android.material.R.id.snackbar_text); textView.setMaxLines(MAX_LINES); textView.setTextColor(ContextCompat.getColor(activity, R.color.solid_white)); snackbarView.setBackgroundColor(ContextCompat.getColor(activity, R.color.snackbar)); diff --git a/catroid/src/main/java/org/catrobat/catroid/utils/ToastUtil.java b/catroid/src/main/java/org/catrobat/catroid/utils/ToastUtil.java index 46a1b9865db..e661307db34 100644 --- a/catroid/src/main/java/org/catrobat/catroid/utils/ToastUtil.java +++ b/catroid/src/main/java/org/catrobat/catroid/utils/ToastUtil.java @@ -24,7 +24,7 @@ import android.app.Activity; import android.content.Context; -import android.support.annotation.StringRes; +import androidx.annotation.StringRes; import android.view.View; import android.widget.Toast; diff --git a/catroid/src/main/java/org/catrobat/catroid/utils/idlingresources/BooleanInitiallyBusyIdlingResource.java b/catroid/src/main/java/org/catrobat/catroid/utils/idlingresources/BooleanInitiallyBusyIdlingResource.java index 95543e08c49..7716daab94d 100644 --- a/catroid/src/main/java/org/catrobat/catroid/utils/idlingresources/BooleanInitiallyBusyIdlingResource.java +++ b/catroid/src/main/java/org/catrobat/catroid/utils/idlingresources/BooleanInitiallyBusyIdlingResource.java @@ -22,8 +22,8 @@ */ package org.catrobat.catroid.utils.idlingresources; -import android.support.annotation.Nullable; -import android.support.test.espresso.IdlingResource; +import androidx.annotation.Nullable; +import androidx.test.espresso.IdlingResource; import java.util.concurrent.atomic.AtomicBoolean; diff --git a/catroid/src/main/java/org/catrobat/catroid/utils/notifications/NotificationData.kt b/catroid/src/main/java/org/catrobat/catroid/utils/notifications/NotificationData.kt index 98f460aa374..553ada4d4a8 100644 --- a/catroid/src/main/java/org/catrobat/catroid/utils/notifications/NotificationData.kt +++ b/catroid/src/main/java/org/catrobat/catroid/utils/notifications/NotificationData.kt @@ -26,7 +26,7 @@ package org.catrobat.catroid.utils.notifications import android.app.Notification import android.app.PendingIntent import android.content.Context -import android.support.v4.app.NotificationCompat +import androidx.core.app.NotificationCompat import java.io.Serializable data class NotificationData( diff --git a/catroid/src/main/java/org/catrobat/catroid/utils/notifications/StatusBarNotificationManager.java b/catroid/src/main/java/org/catrobat/catroid/utils/notifications/StatusBarNotificationManager.java index 771fa5c1e92..f3ccc21883c 100644 --- a/catroid/src/main/java/org/catrobat/catroid/utils/notifications/StatusBarNotificationManager.java +++ b/catroid/src/main/java/org/catrobat/catroid/utils/notifications/StatusBarNotificationManager.java @@ -34,8 +34,8 @@ import android.os.Build; import android.os.Bundle; import android.os.ResultReceiver; -import android.support.annotation.StringRes; -import android.support.v4.app.NotificationCompat; +import androidx.annotation.StringRes; +import androidx.core.app.NotificationCompat; import android.util.Log; import org.catrobat.catroid.R; diff --git a/catroid/src/main/java/org/catrobat/catroid/visualplacement/VisualPlacementActivity.java b/catroid/src/main/java/org/catrobat/catroid/visualplacement/VisualPlacementActivity.java index 761ef21e0e9..c49756d1c8f 100644 --- a/catroid/src/main/java/org/catrobat/catroid/visualplacement/VisualPlacementActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/visualplacement/VisualPlacementActivity.java @@ -35,8 +35,8 @@ import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v7.widget.Toolbar; +import androidx.annotation.Nullable; +import androidx.appcompat.widget.Toolbar; import android.view.Gravity; import android.view.Menu; import android.view.MenuItem; diff --git a/catroid/src/main/java/org/catrobat/catroid/web/ProjectDownloader.kt b/catroid/src/main/java/org/catrobat/catroid/web/ProjectDownloader.kt index 1216bbeef7d..f93122ae4a0 100644 --- a/catroid/src/main/java/org/catrobat/catroid/web/ProjectDownloader.kt +++ b/catroid/src/main/java/org/catrobat/catroid/web/ProjectDownloader.kt @@ -29,8 +29,8 @@ import android.os.Build import android.os.Bundle import android.os.Handler import android.os.ResultReceiver -import android.support.annotation.VisibleForTesting -import android.support.v7.app.AppCompatActivity +import androidx.annotation.VisibleForTesting +import androidx.appcompat.app.AppCompatActivity import android.util.Log import org.catrobat.catroid.R import org.catrobat.catroid.scratchconverter.Client.ProjectDownloadCallback diff --git a/catroid/src/main/java/org/catrobat/catroid/web/ServerAuthenticator.kt b/catroid/src/main/java/org/catrobat/catroid/web/ServerAuthenticator.kt index 79cbe3515fd..35c74330d6e 100644 --- a/catroid/src/main/java/org/catrobat/catroid/web/ServerAuthenticator.kt +++ b/catroid/src/main/java/org/catrobat/catroid/web/ServerAuthenticator.kt @@ -24,7 +24,7 @@ package org.catrobat.catroid.web import android.content.SharedPreferences -import android.support.annotation.VisibleForTesting +import androidx.annotation.VisibleForTesting import android.util.Log import okhttp3.OkHttpClient import org.catrobat.catroid.common.Constants diff --git a/catroid/src/main/java/org/catrobat/catroid/web/WebConnectionHolder.java b/catroid/src/main/java/org/catrobat/catroid/web/WebConnectionHolder.java index a616f35c3d4..05c18334725 100644 --- a/catroid/src/main/java/org/catrobat/catroid/web/WebConnectionHolder.java +++ b/catroid/src/main/java/org/catrobat/catroid/web/WebConnectionHolder.java @@ -23,7 +23,7 @@ package org.catrobat.catroid.web; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.VisibleForTesting; import com.google.common.collect.ImmutableList; diff --git a/catroid/src/main/res/layout/activity_file_picker.xml b/catroid/src/main/res/layout/activity_file_picker.xml index 401fa0b9e95..5a474f7e44a 100644 --- a/catroid/src/main/res/layout/activity_file_picker.xml +++ b/catroid/src/main/res/layout/activity_file_picker.xml @@ -43,7 +43,7 @@ android:textAlignment="center" android:visibility="gone" /> - - - - + diff --git a/catroid/src/main/res/layout/activity_upload.xml b/catroid/src/main/res/layout/activity_upload.xml index b9c0c2a528c..ea6570ce7b5 100644 --- a/catroid/src/main/res/layout/activity_upload.xml +++ b/catroid/src/main/res/layout/activity_upload.xml @@ -71,7 +71,7 @@ android:paddingBottom="@dimen/details_spacing"/> - - - + - - - + diff --git a/catroid/src/main/res/layout/dialog_login.xml b/catroid/src/main/res/layout/dialog_login.xml index 7f33c7140ab..2df57321c93 100644 --- a/catroid/src/main/res/layout/dialog_login.xml +++ b/catroid/src/main/res/layout/dialog_login.xml @@ -34,7 +34,7 @@ android:layout_height="wrap_content" android:orientation="vertical"> - - - + - - - + - - - + - - - + - - - + diff --git a/catroid/src/main/res/layout/dialog_register.xml b/catroid/src/main/res/layout/dialog_register.xml index f76de6d0c12..38e0064bb32 100644 --- a/catroid/src/main/res/layout/dialog_register.xml +++ b/catroid/src/main/res/layout/dialog_register.xml @@ -34,7 +34,7 @@ android:layout_height="wrap_content" android:orientation="vertical"> - - - + - - - + - - - + - - - + - - - + - - - - + diff --git a/catroid/src/main/res/layout/fragment_list_view.xml b/catroid/src/main/res/layout/fragment_list_view.xml index 2b7cd79f468..4b04e3ecab1 100644 --- a/catroid/src/main/res/layout/fragment_list_view.xml +++ b/catroid/src/main/res/layout/fragment_list_view.xml @@ -39,11 +39,11 @@ android:textAlignment="center" android:visibility="gone" /> - - + \ No newline at end of file diff --git a/catroid/src/main/res/layout/fragment_scratch_programs.xml b/catroid/src/main/res/layout/fragment_scratch_programs.xml index d0679b970c2..f1918de6a30 100644 --- a/catroid/src/main/res/layout/fragment_scratch_programs.xml +++ b/catroid/src/main/res/layout/fragment_scratch_programs.xml @@ -50,7 +50,7 @@ android:padding="@dimen/material_design_spacing_large" android:text="@string/scratch_programs_in_progress_title" /> - - - . --> - - Date: Wed, 1 Jan 2020 14:43:12 +0100 Subject: [PATCH 08/16] AndroidX - automatic optimize imports --- catroid/gradle/standalone_apk_tasks.gradle | 1 - .../CatrobatTestRunnerTest.java | 4 ++-- .../bluetooth/ConnectionDataLogger.java | 4 ++-- .../test/common/ServiceProviderTest.java | 4 ++-- .../actions/GoToTouchPositionActionTest.java | 4 ++-- .../actions/SetRotationStyleActionTest.java | 4 ++-- .../catroid/test/content/sprite/LookTest.java | 4 ++-- .../test/devices/arduino/ArduinoImplTest.java | 3 +-- .../nxt/MindstormsConnectionTest.java | 4 ++-- .../devices/mindstorms/nxt/MotorTest.java | 4 ++-- .../nxt/NXTI2CUltraSonicSensorTest.java | 4 ++-- .../test/devices/phiro/PhiroImplTest.java | 4 ++-- .../test/drone/DroneBricksActionTest.java | 4 ++-- .../catroid/test/drone/DroneDemoTest.java | 4 ++-- .../test/embroidery/DSTFileConstantsTest.java | 4 ++-- .../embroidery/DSTPatternManagerTest.java | 4 ++-- .../test/embroidery/DSTStitchCommandTest.java | 4 ++-- .../test/embroidery/DSTStitchPointTest.java | 4 ++-- .../test/embroidery/DSTStreamTest.java | 4 ++-- .../test/embroidery/DSTWorkSpaceTest.java | 4 ++-- .../FaceDetectionHandlerTest.java | 4 ++-- .../test/facedetection/FaceDetectorTest.java | 4 ++-- .../facedetection/IcsFaceDetectorTest.java | 5 ++-- .../SlowFaceDetectorCameraTest.java | 5 ++-- .../facedetection/SlowFaceDetectorTest.java | 5 ++-- .../test/io/CatroidFieldKeySorterTest.java | 4 ++-- .../io/ziparchiver/ZipSingleFileTest.java | 4 ++-- .../test/physics/PhysicsBoundaryBoxTest.java | 4 ++-- .../physics/PhysicsCollisionBetweenTest.java | 4 ++-- .../physics/PhysicsObjectCollisionTest.java | 4 ++-- .../test/physics/PhysicsObjectTest.java | 4 ++-- .../test/physics/PhysicsWorldTest.java | 4 ++-- .../IfOnEdgeBouncePhysicsActionTest.java | 4 ++-- .../actions/PhysicsObjectStateTest.java | 4 ++-- .../actions/SetBounceFactorActionTest.java | 4 ++-- .../actions/SetFrictionActionTest.java | 4 ++-- .../physics/actions/SetGravityActionTest.java | 4 ++-- .../physics/actions/SetMassActionTest.java | 4 ++-- .../SetPhysicsObjectTypeActionTest.java | 4 ++-- .../physics/actions/SetSizeToActionTest.java | 4 ++-- .../actions/SetVelocityActionTest.java | 4 ++-- .../actions/TurnLeftRightSpeedActionTest.java | 4 ++-- .../actions/TurnLeftSpeedActionTest.java | 4 ++-- .../actions/TurnRightSpeedActionTest.java | 4 ++-- .../HideActionAndCollisionTest.java | 4 ++-- .../look/PhysicsLookPositionAndAngleTest.java | 4 ++-- .../note/midi/MidiToProjectConverterTest.java | 5 ++-- .../ScratchServerCallsTest.java | 4 ++-- .../JobHandlerSuccessfulOnJobMessageTest.java | 4 ++-- ...ollisionInformationBubblePositionTest.java | 5 ++-- .../test/stage/InvalidSaveScreenshotTest.java | 4 ++-- .../test/ui/RequiresPermissionTaskTest.java | 3 ++- .../test/utiltests/ImageEditingTest.java | 3 ++- .../test/utiltests/MD5ChecksumTest.java | 4 ++-- .../utiltests/reflection/ReflectionTest.java | 4 ++-- .../uiespresso/annotations/FlakyTestTest.java | 4 ++-- .../content/brick/app/ChangeVariableTest.java | 14 +++++------ .../app/DeleteItemOfUserListBrickTest.java | 16 ++++++------- .../brick/app/InsertItemToUserListTest.java | 10 ++++---- .../brick/app/PhiroColorBrickFormulaTest.java | 10 ++++---- .../brick/app/PhiroColorBrickNumberTest.java | 8 +++---- .../content/brick/app/PlaceAtBrickTest.java | 12 +++++----- .../brick/app/ReplaceItemInUserListTest.java | 12 +++++----- .../brick/app/SetBackgroundBrickTest.java | 16 ++++++------- .../content/brick/app/SetLookBrickTest.java | 16 ++++++------- .../app/SetPenColorBrickFormulaTest.java | 10 ++++---- .../brick/app/SetPenColorBrickNumberTest.java | 10 ++++---- .../brick/app/SetVariableBrickTest.java | 14 +++++------ .../ShowTextColorSizeAlignmentBrickTest.java | 14 +++++------ .../content/brick/app/VariableBrickTest.java | 8 +++---- .../brick/stage/CameraResourceTest.java | 12 +++++----- .../brick/stage/FlashBrickStageTest.java | 10 ++++---- .../stage/InsertItemToUserListStageTest.java | 8 +++---- .../brick/stage/VibrationBrickStageTest.java | 4 ++-- .../brick/utils/BrickCoordinatesProvider.java | 3 ++- .../utils/BrickDataInteractionWrapper.java | 19 ++++++++------- ...FormulaEditTextDataInteractionWrapper.java | 6 ++--- .../BrickSpinnerDataInteractionWrapper.java | 12 +++++----- ...VariableSpinnerDataInteractionWrapper.java | 14 +++++------ .../utils/ColorPickerInteractionWrapper.java | 7 +++--- .../brick/utils/CustomSwipeAction.java | 9 +++---- .../brick/utils/DragNDropBrickAction.java | 11 +++++---- .../content/brick/utils/UiNFCTestUtils.java | 7 +++--- .../FormulaEditorAddVariableTest.java | 10 ++++---- .../FormulaEditorDiscardChangesTest.java | 14 +++++------ .../FormulaEditorEditTextTest.java | 24 +++++++++---------- .../FormulaEditorFunctionListTest.java | 8 +++---- .../FormulaEditorMovementPropertiesTest.java | 10 ++++---- .../FormulaEditorRenameVariableTest.java | 8 +++---- .../FormularEditorVariableScopeTest.java | 8 +++---- .../utils/FormulaEditorDataListWrapper.java | 6 ++--- .../utils/FormulaEditorWrapper.java | 6 ++--- .../UserListDataItemRVInteractionWrapper.java | 4 ++-- ...rVariableDataItemRVInteractionWrapper.java | 4 ++-- .../SpriteActivityVisualPlacementTest.java | 23 +++++++++--------- .../VisualPlacementActivityTest.java | 15 ++++++------ .../pocketmusic/RecyclerViewMatcher.java | 3 ++- .../BroadcastReceiverRegressionTest.java | 10 ++++---- .../stage/MultipleBroadcastsTest.java | 4 ++-- .../uiespresso/stage/StagePausedTest.java | 14 +++++------ .../stage/utils/StageTestTouchUtils.java | 7 +++--- .../ActionBarFormulaEditorTitleTest.java | 10 ++++---- ...itingFormulaEditorOneSceneProjectTest.java | 10 ++++---- .../ActionModeDataFragmentTitleTest.java | 8 +++---- .../ui/actionbar/utils/ActionBarWrapper.java | 6 ++--- .../LegoSensorPortConfigDialogWrapper.java | 10 ++++---- .../RecyclerViewInteractionWrapper.java | 5 ++-- .../RecyclerViewItemInteractionWrapper.java | 4 ++-- .../rvutils/RecyclerViewItemMatcher.java | 3 ++- .../fragment/rvutils/RecyclerViewMatcher.java | 3 ++- .../util/UserVariableAssertions.java | 6 ++--- .../util/actions/CustomActions.java | 5 ++-- .../FormulaEditorCategoryListMatchers.java | 3 ++- .../FormulaEditorDataListMatchers.java | 3 ++- .../util/matchers/StageMatchers.java | 3 ++- .../util/matchers/SuperToastMatchers.java | 3 ++- .../util/rules/BaseActivityTestRule.java | 3 ++- .../util/wrappers/DataInteractionWrapper.java | 7 +++--- .../util/wrappers/ViewInteractionWrapper.java | 4 ++-- .../catrobat/catroid/CatroidApplication.java | 2 +- .../org/catrobat/catroid/ProjectManager.java | 3 ++- .../ConnectBluetoothDeviceActivity.java | 3 ++- .../catroid/camera/CameraManager.java | 3 ++- .../catrobat/catroid/cast/CastManager.java | 9 +++---- .../catrobat/catroid/common/Constants.java | 3 ++- .../org/catrobat/catroid/common/LookData.java | 5 ++-- .../catrobat/catroid/common/SoundInfo.java | 4 ++-- .../catroid/common/ThreadScheduler.java | 4 ++-- .../content/ConditionScriptTrigger.java | 3 ++- .../catroid/content/EventWrapper.java | 4 ++-- .../org/catrobat/catroid/content/Look.java | 5 ++-- .../org/catrobat/catroid/content/Scene.java | 4 ++-- .../catroid/content/actions/EventThread.java | 4 ++-- .../content/actions/NextLookAction.java | 4 ++-- .../content/actions/ScriptSequenceAction.java | 4 ++-- .../content/actions/WebRequestAction.java | 5 ++-- .../catroid/content/bricks/Brick.java | 3 ++- .../catroid/content/bricks/BrickBaseType.java | 9 +++---- .../content/bricks/BroadcastMessageBrick.java | 7 +++--- .../catroid/content/bricks/CloneBrick.java | 3 ++- .../catroid/content/bricks/ForeverBrick.java | 4 ++-- .../catroid/content/bricks/FormulaBrick.java | 5 ++-- .../catroid/content/bricks/GoToBrick.java | 3 ++- .../content/bricks/IfLogicBeginBrick.java | 3 ++- .../content/bricks/IfThenLogicBeginBrick.java | 3 ++- .../bricks/PhiroIfLogicBeginBrick.java | 3 ++- .../content/bricks/PhiroRGBLightBrick.java | 3 ++- .../catroid/content/bricks/PlaceAtBrick.java | 5 ++-- .../content/bricks/PlaySoundBrick.java | 5 ++-- .../catroid/content/bricks/PointToBrick.java | 5 ++-- .../catroid/content/bricks/RepeatBrick.java | 3 ++- .../content/bricks/RepeatUntilBrick.java | 4 ++-- .../content/bricks/SceneStartBrick.java | 5 ++-- .../content/bricks/SceneTransitionBrick.java | 5 ++-- .../content/bricks/SetBackgroundBrick.java | 5 ++-- .../catroid/content/bricks/SetLookBrick.java | 5 ++-- .../content/bricks/SetNfcTagBrick.java | 3 ++- .../content/bricks/SetPenColorBrick.java | 3 ++- .../bricks/SetPhysicsObjectTypeBrick.java | 3 ++- .../content/bricks/SetRotationStyleBrick.java | 3 ++- .../ShowTextColorSizeAlignmentBrick.java | 5 ++-- .../catroid/content/bricks/UserListBrick.java | 7 +++--- .../content/bricks/UserVariableBrick.java | 7 +++--- .../bricks/UserVariableBrickWithFormula.java | 7 +++--- .../bricks/WhenBackgroundChangesBrick.java | 7 +++--- .../content/bricks/WhenBounceOffBrick.java | 3 ++- .../catroid/content/bricks/WhenBrick.java | 4 ++-- .../bricks/WhenGamepadButtonBrick.java | 5 ++-- .../catroid/content/bricks/WhenNfcBrick.java | 5 ++-- .../bricks/brickspinner/BrickSpinner.java | 7 +++--- ...erVariableBrickTextInputDialogBuilder.java | 3 ++- .../catroid/content/eventids/EventId.java | 4 ++-- .../catroid/content/eventids/NfcEventId.java | 4 ++-- .../ShowColorPickerFormulaEditorStrategy.java | 9 +++---- .../devices/mindstorms/nxt/NXTReply.java | 4 ++-- .../mindstorms/nxt/sensors/NXTI2CSensor.java | 3 ++- .../nxt/sensors/NXTI2CUltraSonicSensor.java | 4 ++-- .../mindstorms/nxt/sensors/NXTSensor.java | 3 ++- .../drone/ardrone/DroneController.java | 7 +++--- .../drone/ardrone/DroneInitializer.java | 5 ++-- .../jumpingsumo/JumpingSumoDiscoverer.java | 5 ++-- .../jumpingsumo/JumpingSumoInitializer.java | 7 +++--- .../drone/jumpingsumo/SDCardModule.java | 5 ++-- .../facedetection/FaceDetectionHandler.java | 3 ++- .../catroid/facedetection/FaceDetector.java | 3 ++- .../facedetection/SlowFaceDetector.java | 3 ++- .../catroid/formulaeditor/InternFormula.java | 3 ++- .../catroid/formulaeditor/SensorHandler.java | 3 ++- .../catroid/formulaeditor/SensorLoudness.java | 3 ++- .../catroid/io/DeviceUserDataAccessor.java | 3 ++- .../org/catrobat/catroid/io/SoundManager.java | 3 ++- .../catroid/io/XstreamSerializer.java | 3 ++- .../io/asynctask/ProjectExportTask.java | 3 ++- .../merge/NewProjectNameTextWatcher.java | 3 ++- .../catroid/physics/PhysicsObject.java | 4 ++-- .../shapebuilder/PhysicsShapeScaleUtils.java | 4 ++-- .../pocketmusic/PocketMusicActivity.java | 3 ++- .../catroid/pocketmusic/TactViewHolder.java | 3 ++- .../fastscroller/FastScroller.java | 7 +++--- .../DefaultScrollerViewProvider.java | 3 ++- .../viewprovider/ScrollerViewProvider.java | 3 ++- .../VisibilityAnimationManager.java | 3 ++- .../catroid/pocketmusic/note/Track.java | 4 ++-- .../pocketmusic/note/trackgrid/GridRow.java | 4 ++-- .../pocketmusic/note/trackgrid/TrackGrid.java | 3 ++- .../trackgrid/TrackGridToTrackConverter.java | 4 ++-- .../trackgrid/TrackToTrackGridConverter.java | 4 ++-- .../catroid/pocketmusic/ui/NoteView.java | 3 ++- .../catroid/pocketmusic/ui/PianoView.java | 3 ++- .../ui/TactScrollRecyclerView.java | 7 +++--- .../catroid/pocketmusic/ui/TrackRowView.java | 3 ++- .../catroid/scratchconverter/Client.java | 4 ++-- .../scratchconverter/ConversionManager.java | 4 ++-- .../ScratchConversionManager.java | 9 +++---- .../scratchconverter/protocol/JobHandler.java | 3 ++- .../protocol/message/base/BaseMessage.java | 3 ++- .../protocol/message/job/JobMessage.java | 3 ++- .../message/job/JobOutputMessage.java | 4 ++-- .../catroid/sensing/CollisionInformation.java | 4 ++-- .../soundrecorder/SoundRecorderActivity.java | 7 +++--- .../catroid/stage/ShowBubbleActor.java | 5 ++-- .../catrobat/catroid/stage/StageActivity.java | 3 ++- .../catrobat/catroid/stage/StageListener.java | 3 ++- .../catroid/stage/StageResourceHolder.java | 3 ++- .../catroid/stage/TextToSpeechHolder.java | 3 ++- .../transfers/CheckOAuthTokenTask.java | 3 ++- .../catroid/transfers/DeleteTestUserTask.java | 3 ++- .../transfers/GoogleExchangeCodeTask.java | 3 ++- .../catroid/transfers/GoogleLogInTask.java | 3 ++- .../transfers/project/ProjectUploadService.kt | 2 +- .../org/catrobat/catroid/ui/BaseActivity.java | 5 ++-- .../catrobat/catroid/ui/ImportLaunchers.kt | 2 +- .../catrobat/catroid/ui/MainMenuActivity.java | 2 +- .../catroid/ui/MarketingActivity.java | 3 ++- .../catrobat/catroid/ui/ProjectActivity.java | 9 +++---- .../catroid/ui/ProjectListActivity.java | 3 ++- .../catroid/ui/ProjectUploadActivity.java | 6 +++-- .../catroid/ui/ScratchConverterActivity.java | 9 +++---- .../ui/ScratchProgramDetailsActivity.java | 7 +++--- .../catrobat/catroid/ui/SettingsActivity.java | 3 ++- .../catrobat/catroid/ui/SpriteActivity.java | 7 +++--- .../catroid/ui/SpriteAttributesActivity.java | 11 +++++---- .../java/org/catrobat/catroid/ui/UiUtils.java | 3 ++- .../catrobat/catroid/ui/WebViewActivity.java | 5 ++-- .../ui/adapter/CastDevicesAdapter.java | 3 ++- .../dialogs/FormulaEditorComputeDialog.java | 3 ++- .../dialogs/LegoSensorConfigInfoDialog.java | 5 ++-- .../dialogs/LegoSensorPortConfigDialog.java | 7 +++--- .../ui/dialogs/ScratchReconvertDialog.java | 5 ++-- .../catroid/ui/dialogs/SelectCastDialog.java | 7 +++--- .../ui/dialogs/TermsOfUseDialogFragment.java | 5 ++-- .../catroid/ui/dragndrop/BrickListView.java | 5 ++-- .../ui/filepicker/FilePickerActivity.java | 5 ++-- .../ui/filepicker/FilePickerAdapter.java | 5 ++-- .../catroid/ui/fragment/AddBrickFragment.java | 11 +++++---- .../ui/fragment/AddUserBrickFragment.java | 5 ++-- .../ui/fragment/BrickCategoryFragment.java | 9 +++---- .../ui/fragment/FormulaEditorFragment.java | 15 ++++++------ .../ui/fragment/ProjectDetailsFragment.java | 3 ++- .../catroid/ui/recyclerview/RVButton.java | 1 + .../ui/recyclerview/adapter/BrickAdapter.java | 3 ++- .../recyclerview/adapter/ButtonAdapter.java | 5 ++-- .../adapter/CategoryListRVAdapter.java | 11 +++++---- .../recyclerview/adapter/DataListAdapter.java | 9 +++---- .../adapter/MultiViewSpriteAdapter.java | 3 ++- .../ui/recyclerview/adapter/RVAdapter.java | 5 ++-- .../draganddrop/TouchHelperCallback.java | 6 ++--- .../backpack/BackpackActivity.java | 5 ++-- .../backpack/BackpackLookFragment.java | 3 ++- .../BackpackRecyclerViewFragment.java | 13 +++++----- .../backpack/BackpackSceneFragment.java | 3 ++- .../backpack/BackpackScriptFragment.java | 3 ++- .../backpack/BackpackSoundFragment.java | 3 ++- .../backpack/BackpackSpriteFragment.java | 3 ++- .../controller/BrickController.java | 3 ++- .../dialog/AboutDialogFragment.java | 5 ++-- .../dialog/NewProjectDialogFragment.java | 3 ++- .../dialog/OrientationDialogFragment.java | 7 +++--- .../recyclerview/dialog/PlaySceneDialog.java | 5 ++-- .../dialog/PrivacyPolicyDialogFragment.java | 7 +++--- .../ReplaceExistingProjectDialogFragment.java | 12 ++++++---- .../recyclerview/dialog/TextInputDialog.java | 10 ++++---- .../dialog/login/LoginDialogFragment.java | 8 ++++--- .../login/OAuthUsernameDialogFragment.java | 8 ++++--- .../login/RegistrationDialogFragment.java | 8 ++++--- .../textwatcher/DialogInputWatcher.java | 3 ++- .../textwatcher/NewItemTextWatcher.java | 3 ++- .../NonEmptyStringTextWatcher.java | 3 ++- .../textwatcher/RenameItemTextWatcher.java | 3 ++- .../textwatcher/UniqueStringTextWatcher.java | 3 ++- .../fragment/CategoryListFragment.java | 11 +++++---- .../fragment/DataListFragment.java | 11 +++++---- .../fragment/LookListFragment.java | 3 ++- .../fragment/MainMenuFragment.java | 13 +++++----- .../fragment/NfcTagListFragment.java | 3 ++- .../fragment/ProjectListFragment.java | 5 ++-- .../fragment/RecyclerViewFragment.java | 17 ++++++------- .../fragment/SceneListFragment.java | 5 ++-- .../recyclerview/fragment/ScriptFragment.java | 11 +++++---- .../fragment/SoundListFragment.java | 3 ++- .../fragment/SpriteListFragment.java | 11 +++++---- .../ScratchProgramsFragment.java | 9 +++---- .../ScratchSearchResultsFragment.java | 9 +++---- .../recyclerview/viewholder/ViewHolder.java | 3 ++- .../PermissionRequestActivityExtension.java | 3 ++- .../RequiresPermissionTask.java | 7 +++--- .../ui/scratchconverter/JobViewListener.java | 4 ++-- .../AccessibilityProfile.java | 3 ++- .../AccessibilityProfilesFragment.java | 7 +++--- .../AccessibilitySettingsFragment.java | 5 ++-- .../Ev3SensorsSettingsFragment.java | 5 ++-- .../NXTSensorsSettingsFragment.java | 5 ++-- .../ParrotARDroneSettingsFragment.java | 5 ++-- .../ParrotJumpingSumoSettingsFragment.java | 5 ++-- .../RaspberryPiSettingsFragment.java | 5 ++-- .../settingsfragments/SettingsFragment.java | 3 ++- .../catrobat/catroid/utils/CrashReporter.java | 3 ++- .../catrobat/catroid/utils/SnackbarUtil.java | 8 ++++--- .../org/catrobat/catroid/utils/ToastUtil.java | 3 ++- .../org/catrobat/catroid/utils/Utils.java | 3 ++- .../BooleanInitiallyBusyIdlingResource.java | 4 ++-- .../StatusBarNotificationManager.java | 4 ++-- .../VisualPlacementActivity.java | 5 ++-- .../catrobat/catroid/web/ProjectDownloader.kt | 2 +- .../catroid/web/ServerAuthenticator.kt | 2 +- .../catroid/web/WebConnectionHolder.java | 3 +-- .../sprite/LookBreakDownCatroidAngleTest.java | 4 ++-- .../LookCatroidAngleToStageAngleTest.java | 4 ++-- .../content/sprite/LookDirectionTest.java | 4 ++-- .../LookStageAngleToCatroidAngleTest.java | 4 ++-- .../trackgrid/GridRowTestDataFactory.java | 4 ++-- .../trackgrid/TrackGridTestDataFactory.java | 4 ++-- .../bricks/BrickAddCategoryTest.java | 3 ++- .../bricks/BrickSingleFormulaFieldTest.java | 5 ++-- .../robolectric/bricks/BrickSpinnerTest.java | 5 ++-- .../bricks/BrickStringSpinnerTest.java | 5 ++-- .../bricks/BroadcastBrickTest.java | 3 ++- .../FormulaEditorEditTextGenericTest.java | 3 ++- .../test/transfers/ProjectDownloaderTest.java | 5 ++-- .../test/transfers/ProjectUploadTest.kt | 6 ++--- .../test/ui/HighlightBrickPartsTest.java | 3 ++- .../test/utiltests/NumberFormatsTest.java | 4 ++-- 342 files changed, 1034 insertions(+), 823 deletions(-) diff --git a/catroid/gradle/standalone_apk_tasks.gradle b/catroid/gradle/standalone_apk_tasks.gradle index c2860b8147b..af5472ef93b 100644 --- a/catroid/gradle/standalone_apk_tasks.gradle +++ b/catroid/gradle/standalone_apk_tasks.gradle @@ -22,7 +22,6 @@ */ import groovy.json.StringEscapeUtils -import groovy.xml.StreamingMarkupBuilder import groovy.xml.XmlUtil import java.nio.file.Files diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/catrobattestrunner/CatrobatTestRunnerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/catrobattestrunner/CatrobatTestRunnerTest.java index 042d7a86353..3b04293ae41 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/catrobattestrunner/CatrobatTestRunnerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/catrobattestrunner/CatrobatTestRunnerTest.java @@ -23,13 +23,13 @@ package org.catrobat.catroid.catrobattestrunner; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + @RunWith(AndroidJUnit4.class) public class CatrobatTestRunnerTest { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/common/bluetooth/ConnectionDataLogger.java b/catroid/src/androidTest/java/org/catrobat/catroid/common/bluetooth/ConnectionDataLogger.java index fd850661ead..6d0a4868b41 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/common/bluetooth/ConnectionDataLogger.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/common/bluetooth/ConnectionDataLogger.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.common.bluetooth; -import androidx.annotation.VisibleForTesting; - import com.google.common.base.Stopwatch; import org.catrobat.catroid.bluetooth.base.BluetoothConnection; @@ -33,6 +31,8 @@ import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; +import androidx.annotation.VisibleForTesting; + public final class ConnectionDataLogger { private BlockingQueue sentMessages = new LinkedBlockingQueue(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/common/ServiceProviderTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/common/ServiceProviderTest.java index f2e43cbfdb6..f08cbddecd5 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/common/ServiceProviderTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/common/ServiceProviderTest.java @@ -22,14 +22,14 @@ */ package org.catrobat.catroid.test.common; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.bluetooth.base.BluetoothDeviceService; import org.catrobat.catroid.common.CatroidService; import org.catrobat.catroid.common.ServiceProvider; import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertNotNull; import static junit.framework.Assert.assertNull; import static junit.framework.Assert.assertTrue; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/GoToTouchPositionActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/GoToTouchPositionActionTest.java index b1d6b186505..1df942b5a9d 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/GoToTouchPositionActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/GoToTouchPositionActionTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.content.actions; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.badlogic.gdx.scenes.scene2d.Action; import org.catrobat.catroid.common.BrickValues; @@ -37,6 +35,8 @@ import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; @RunWith(AndroidJUnit4.class) diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/SetRotationStyleActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/SetRotationStyleActionTest.java index 225253e6203..d69fe25594a 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/SetRotationStyleActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/SetRotationStyleActionTest.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.test.content.actions; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.badlogic.gdx.scenes.scene2d.Action; import org.catrobat.catroid.content.ActionFactory; @@ -37,6 +35,8 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; @RunWith(AndroidJUnit4.class) diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/sprite/LookTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/sprite/LookTest.java index 6203bc52ce8..cdbbac10003 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/sprite/LookTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/sprite/LookTest.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.test.content.sprite; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.scenes.scene2d.Group; @@ -36,6 +34,8 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/arduino/ArduinoImplTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/arduino/ArduinoImplTest.java index 66e00026212..2ab74d5beda 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/arduino/ArduinoImplTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/arduino/ArduinoImplTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.devices.arduino; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.common.bluetooth.ConnectionDataLogger; import org.catrobat.catroid.common.firmata.FirmataMessage; import org.catrobat.catroid.common.firmata.FirmataUtils; @@ -36,6 +34,7 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; import name.antonsmirnov.firmata.message.SetPinModeMessage; import name.antonsmirnov.firmata.writer.AnalogMessageWriter; import name.antonsmirnov.firmata.writer.DigitalMessageWriter; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/MindstormsConnectionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/MindstormsConnectionTest.java index 59d694f03dc..290719ad4cc 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/MindstormsConnectionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/MindstormsConnectionTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.devices.mindstorms.nxt; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.devices.mindstorms.MindstormsConnectionImpl; import org.catrobat.catroid.devices.mindstorms.nxt.Command; import org.catrobat.catroid.devices.mindstorms.nxt.CommandByte; @@ -37,6 +35,8 @@ import java.io.ByteArrayOutputStream; import java.io.DataInputStream; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; @RunWith(AndroidJUnit4.class) diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/MotorTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/MotorTest.java index 716a3933c66..27a98b0a60d 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/MotorTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/MotorTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.devices.mindstorms.nxt; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.common.bluetooth.ConnectionDataLogger; import org.catrobat.catroid.devices.mindstorms.MindstormsConnection; import org.catrobat.catroid.devices.mindstorms.MindstormsConnectionImpl; @@ -36,6 +34,8 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; @RunWith(AndroidJUnit4.class) diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/NXTI2CUltraSonicSensorTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/NXTI2CUltraSonicSensorTest.java index c27a5e325a8..ba259840a93 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/NXTI2CUltraSonicSensorTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/NXTI2CUltraSonicSensorTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.devices.mindstorms.nxt; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.devices.mindstorms.MindstormsConnection; import org.catrobat.catroid.devices.mindstorms.MindstormsException; import org.catrobat.catroid.devices.mindstorms.nxt.Command; @@ -40,6 +38,8 @@ import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static org.catrobat.catroid.devices.mindstorms.nxt.CommandByte.LS_READ; import static org.catrobat.catroid.devices.mindstorms.nxt.CommandType.REPLY_COMMAND; import static org.catrobat.catroid.devices.mindstorms.nxt.NXTReply.INSUFFICIENT_REPLY_LENGTH_EXCEPTION_MESSAGE; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/phiro/PhiroImplTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/phiro/PhiroImplTest.java index ecb8c42141a..6c0b2b19abb 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/phiro/PhiroImplTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/phiro/PhiroImplTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.devices.phiro; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.google.common.base.Stopwatch; import org.catrobat.catroid.common.bluetooth.ConnectionDataLogger; @@ -39,6 +37,8 @@ import java.util.concurrent.TimeUnit; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; @RunWith(AndroidJUnit4.class) diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/drone/DroneBricksActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/drone/DroneBricksActionTest.java index 904cd6dbce5..70920c9bc95 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/drone/DroneBricksActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/drone/DroneBricksActionTest.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.test.drone; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.badlogic.gdx.scenes.scene2d.Action; import com.badlogic.gdx.scenes.scene2d.actions.TemporalAction; import com.badlogic.gdx.utils.Array; @@ -52,6 +50,8 @@ import org.junit.runner.RunWith; import org.mockito.Mockito; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static org.mockito.Mockito.when; @RunWith(AndroidJUnit4.class) diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/drone/DroneDemoTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/drone/DroneDemoTest.java index bbde3119966..a438daf1eb3 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/drone/DroneDemoTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/drone/DroneDemoTest.java @@ -22,14 +22,14 @@ */ package org.catrobat.catroid.test.drone; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.parrot.freeflight.drone.DroneProxy; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mockito; +import androidx.test.ext.junit.runners.AndroidJUnit4; + @RunWith(AndroidJUnit4.class) public class DroneDemoTest { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTFileConstantsTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTFileConstantsTest.java index a8dd6de20ad..22ede7f7bb5 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTFileConstantsTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTFileConstantsTest.java @@ -23,11 +23,11 @@ package org.catrobat.catroid.test.embroidery; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static org.catrobat.catroid.embroidery.DSTFileConstants.CONVERSION_TABLE; import static org.catrobat.catroid.embroidery.DSTFileConstants.getMaxDistanceBetweenPoints; import static org.catrobat.catroid.embroidery.DSTFileConstants.toEmbroideryUnit; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTPatternManagerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTPatternManagerTest.java index 0d019888267..0c4c2b8f9a0 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTPatternManagerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTPatternManagerTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.embroidery; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.content.Sprite; import org.catrobat.catroid.embroidery.DSTPatternManager; import org.catrobat.catroid.embroidery.DSTStitchCommand; @@ -38,6 +36,8 @@ import org.junit.runner.RunWith; import org.mockito.Mockito; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTStitchCommandTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTStitchCommandTest.java index 31571f7d833..38d7c5e96a3 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTStitchCommandTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTStitchCommandTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.embroidery; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.content.Sprite; import org.catrobat.catroid.embroidery.DSTStitchCommand; import org.catrobat.catroid.embroidery.DSTStream; @@ -41,6 +39,8 @@ import java.util.ArrayList; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; import static org.mockito.ArgumentMatchers.anyFloat; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTStitchPointTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTStitchPointTest.java index c5335125c33..bb80a9a00a0 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTStitchPointTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTStitchPointTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.embroidery; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.embroidery.DSTStitchPoint; import org.catrobat.catroid.embroidery.StitchPoint; import org.junit.Before; @@ -35,6 +33,8 @@ import java.io.FileOutputStream; import java.io.IOException; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotEquals; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTStreamTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTStreamTest.java index 0d059a23928..235c2b355b9 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTStreamTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTStreamTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.embroidery; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.embroidery.DSTHeader; import org.catrobat.catroid.embroidery.DSTStitchPoint; import org.catrobat.catroid.embroidery.DSTStream; @@ -38,6 +36,8 @@ import java.util.ArrayList; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.anyFloat; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTWorkSpaceTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTWorkSpaceTest.java index fa5558a1d25..9cf4f4e0372 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTWorkSpaceTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTWorkSpaceTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.embroidery; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.content.Sprite; import org.catrobat.catroid.embroidery.DSTWorkSpace; import org.catrobat.catroid.embroidery.EmbroideryWorkSpace; @@ -32,6 +30,8 @@ import org.junit.runner.RunWith; import org.mockito.Mockito; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static org.junit.Assert.assertEquals; @RunWith(AndroidJUnit4.class) diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/FaceDetectionHandlerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/FaceDetectionHandlerTest.java index e2b2b6129fe..a3fd139b3ab 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/FaceDetectionHandlerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/FaceDetectionHandlerTest.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.test.facedetection; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.camera.CameraManager; import org.catrobat.catroid.facedetection.FaceDetectionHandler; import org.catrobat.catroid.facedetection.FaceDetector; @@ -33,6 +31,8 @@ import org.mockito.InOrder; import org.mockito.Mockito; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static org.mockito.Mockito.inOrder; import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/FaceDetectorTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/FaceDetectorTest.java index e2d53476865..027dabf1b2d 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/FaceDetectorTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/FaceDetectorTest.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.test.facedetection; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.facedetection.FaceDetector; import org.catrobat.catroid.formulaeditor.SensorCustomEvent; import org.catrobat.catroid.formulaeditor.SensorCustomEventListener; @@ -36,6 +34,8 @@ import org.mockito.junit.MockitoJUnit; import org.mockito.junit.MockitoRule; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; import static org.mockito.Mockito.times; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/IcsFaceDetectorTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/IcsFaceDetectorTest.java index 864a11a4b6a..c6adbbb2d9b 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/IcsFaceDetectorTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/IcsFaceDetectorTest.java @@ -25,8 +25,6 @@ import android.graphics.Rect; import android.hardware.Camera; import android.hardware.Camera.Face; -import androidx.test.rule.GrantPermissionRule; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.camera.CameraManager; import org.catrobat.catroid.common.ScreenValues; @@ -48,6 +46,9 @@ import java.util.List; import java.util.Random; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.rule.GrantPermissionRule; + import static junit.framework.Assert.assertEquals; import static org.hamcrest.Matchers.allOf; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/SlowFaceDetectorCameraTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/SlowFaceDetectorCameraTest.java index 2ffc43dba2b..6c11cfe9b7e 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/SlowFaceDetectorCameraTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/SlowFaceDetectorCameraTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.facedetection; import android.hardware.Camera; -import androidx.test.rule.GrantPermissionRule; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.camera.CameraManager; @@ -37,6 +35,9 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.rule.GrantPermissionRule; + import static junit.framework.Assert.assertNotNull; import static junit.framework.Assert.assertTrue; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/SlowFaceDetectorTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/SlowFaceDetectorTest.java index 11cd709e6cc..ec32f458931 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/SlowFaceDetectorTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/facedetection/SlowFaceDetectorTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.facedetection; import android.graphics.PointF; -import androidx.test.rule.GrantPermissionRule; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.camera.CameraManager; import org.catrobat.catroid.common.ScreenValues; @@ -46,6 +44,9 @@ import java.util.List; import java.util.Random; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.rule.GrantPermissionRule; + import static junit.framework.Assert.assertEquals; import static org.hamcrest.Matchers.allOf; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/CatroidFieldKeySorterTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/CatroidFieldKeySorterTest.java index 3783016b57c..c3914f94ec0 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/CatroidFieldKeySorterTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/CatroidFieldKeySorterTest.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.test.io; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.thoughtworks.xstream.XStream; import com.thoughtworks.xstream.annotations.XStreamAlias; import com.thoughtworks.xstream.converters.ConversionException; @@ -46,6 +44,8 @@ import java.util.List; import java.util.Map; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; import static org.junit.Assert.assertArrayEquals; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ziparchiver/ZipSingleFileTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ziparchiver/ZipSingleFileTest.java index 5f4a8bb27dc..bf27d235def 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ziparchiver/ZipSingleFileTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ziparchiver/ZipSingleFileTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.io.ziparchiver; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.common.FlavoredConstants; import org.catrobat.catroid.io.StorageOperations; import org.catrobat.catroid.io.ZipArchiver; @@ -36,6 +34,8 @@ import java.io.File; import java.io.IOException; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertTrue; @RunWith(AndroidJUnit4.class) diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsBoundaryBoxTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsBoundaryBoxTest.java index c78b6cb430c..c8888078f22 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsBoundaryBoxTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsBoundaryBoxTest.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.test.physics; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.badlogic.gdx.physics.box2d.Body; import com.badlogic.gdx.physics.box2d.BodyDef.BodyType; import com.badlogic.gdx.physics.box2d.Filter; @@ -38,6 +36,8 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; @RunWith(AndroidJUnit4.class) diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsCollisionBetweenTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsCollisionBetweenTest.java index 3f95e5f045a..7f1fbc90149 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsCollisionBetweenTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsCollisionBetweenTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.physics; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.physics.box2d.Contact; @@ -45,6 +43,8 @@ import java.util.Map; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertTrue; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsObjectCollisionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsObjectCollisionTest.java index 3a5ee084f21..2fe713dd5cc 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsObjectCollisionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsObjectCollisionTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.physics; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.physics.box2d.Body; import com.badlogic.gdx.physics.box2d.Contact; @@ -42,6 +40,8 @@ import java.util.HashSet; import java.util.List; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsObjectTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsObjectTest.java index d942cd08749..55e2cf8dcc5 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsObjectTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsObjectTest.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.test.physics; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.physics.box2d.Body; import com.badlogic.gdx.physics.box2d.BodyDef.BodyType; @@ -50,6 +48,8 @@ import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertNotSame; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsWorldTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsWorldTest.java index 5264248f64f..63cf0016820 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsWorldTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsWorldTest.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.test.physics; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.physics.box2d.World; import com.badlogic.gdx.utils.GdxNativesLoader; @@ -44,6 +42,8 @@ import java.util.Map; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertNotNull; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/IfOnEdgeBouncePhysicsActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/IfOnEdgeBouncePhysicsActionTest.java index a33818eee51..19d98ef5d34 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/IfOnEdgeBouncePhysicsActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/IfOnEdgeBouncePhysicsActionTest.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.test.physics.actions; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.badlogic.gdx.scenes.scene2d.Action; import org.catrobat.catroid.common.ScreenValues; @@ -46,6 +44,8 @@ import java.util.ArrayList; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertNotNull; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/PhysicsObjectStateTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/PhysicsObjectStateTest.java index 2ab42142076..8897cf24f30 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/PhysicsObjectStateTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/PhysicsObjectStateTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.physics.actions; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.badlogic.gdx.scenes.scene2d.Action; import org.catrobat.catroid.content.Sprite; @@ -43,6 +41,8 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetBounceFactorActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetBounceFactorActionTest.java index d61194c97ac..761bfe2a416 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetBounceFactorActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetBounceFactorActionTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.physics.actions; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.scenes.scene2d.Action; @@ -39,6 +37,8 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; import static org.hamcrest.Matchers.is; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetFrictionActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetFrictionActionTest.java index d08cd3ae365..9c0df0b4d8e 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetFrictionActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetFrictionActionTest.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.test.physics.actions; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.badlogic.gdx.scenes.scene2d.Action; import org.catrobat.catroid.content.Sprite; @@ -36,6 +34,8 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; @RunWith(AndroidJUnit4.class) diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetGravityActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetGravityActionTest.java index 103a431b7ab..37bb8e9c850 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetGravityActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetGravityActionTest.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.test.physics.actions; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.physics.box2d.World; import com.badlogic.gdx.scenes.scene2d.Action; @@ -38,6 +36,8 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; @RunWith(AndroidJUnit4.class) diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetMassActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetMassActionTest.java index c752b7dafa6..53c55504a46 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetMassActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetMassActionTest.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.test.physics.actions; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.badlogic.gdx.scenes.scene2d.Action; import org.catrobat.catroid.content.Sprite; @@ -36,6 +34,8 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; import static org.hamcrest.Matchers.greaterThan; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetPhysicsObjectTypeActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetPhysicsObjectTypeActionTest.java index 893cf26fae7..62d93b7745a 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetPhysicsObjectTypeActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetPhysicsObjectTypeActionTest.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.test.physics.actions; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.badlogic.gdx.scenes.scene2d.Action; import org.catrobat.catroid.content.Sprite; @@ -35,6 +33,8 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; @RunWith(AndroidJUnit4.class) diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetSizeToActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetSizeToActionTest.java index 9bca62332c2..8738209a1f5 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetSizeToActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetSizeToActionTest.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.test.physics.actions; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.badlogic.gdx.math.Vector2; import org.catrobat.catroid.content.Sprite; @@ -38,6 +36,8 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; @RunWith(AndroidJUnit4.class) diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetVelocityActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetVelocityActionTest.java index 1de917d1cba..0abfccd5387 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetVelocityActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetVelocityActionTest.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.test.physics.actions; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.scenes.scene2d.Action; @@ -37,6 +35,8 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; @RunWith(AndroidJUnit4.class) diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/TurnLeftRightSpeedActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/TurnLeftRightSpeedActionTest.java index 6dd1df289ce..bc4e4660a41 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/TurnLeftRightSpeedActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/TurnLeftRightSpeedActionTest.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.test.physics.actions; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.content.Sprite; import org.catrobat.catroid.physics.PhysicsObject; import org.catrobat.catroid.physics.PhysicsWorld; @@ -34,6 +32,8 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; import static org.hamcrest.Matchers.is; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/TurnLeftSpeedActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/TurnLeftSpeedActionTest.java index a087c36df28..1be3ae6c9cc 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/TurnLeftSpeedActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/TurnLeftSpeedActionTest.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.test.physics.actions; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.badlogic.gdx.scenes.scene2d.Action; import org.catrobat.catroid.content.Sprite; @@ -36,6 +34,8 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; @RunWith(AndroidJUnit4.class) diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/TurnRightSpeedActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/TurnRightSpeedActionTest.java index cab6c19febe..4be6b0eceee 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/TurnRightSpeedActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/TurnRightSpeedActionTest.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.test.physics.actions; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.badlogic.gdx.scenes.scene2d.Action; import org.catrobat.catroid.content.Sprite; @@ -36,6 +34,8 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; @RunWith(AndroidJUnit4.class) diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/conditional/HideActionAndCollisionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/conditional/HideActionAndCollisionTest.java index fac9da4da8b..b4b6283fbfa 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/conditional/HideActionAndCollisionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/conditional/HideActionAndCollisionTest.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.test.physics.actions.conditional; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.scenes.scene2d.Action; @@ -37,6 +35,8 @@ import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/look/PhysicsLookPositionAndAngleTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/look/PhysicsLookPositionAndAngleTest.java index 34da838ab29..57b1c9ff41b 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/look/PhysicsLookPositionAndAngleTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/look/PhysicsLookPositionAndAngleTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.physics.look; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.badlogic.gdx.math.Vector2; import org.catrobat.catroid.content.Sprite; @@ -36,6 +34,8 @@ import org.junit.runner.RunWith; import org.mockito.Mockito; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; import static org.mockito.ArgumentMatchers.eq; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/pocketmusic/note/midi/MidiToProjectConverterTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/pocketmusic/note/midi/MidiToProjectConverterTest.java index 7b5bf28c7d1..1206dda2515 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/pocketmusic/note/midi/MidiToProjectConverterTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/pocketmusic/note/midi/MidiToProjectConverterTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.pocketmusic.note.midi; import android.Manifest; -import androidx.test.rule.GrantPermissionRule; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.pocketmusic.note.MusicalInstrument; import org.catrobat.catroid.pocketmusic.note.Project; @@ -42,6 +40,9 @@ import java.io.File; import java.io.IOException; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.rule.GrantPermissionRule; + import static junit.framework.Assert.assertEquals; @RunWith(AndroidJUnit4.class) diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/ScratchServerCallsTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/ScratchServerCallsTest.java index 88754e59cc6..8ef7fe1a166 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/ScratchServerCallsTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/ScratchServerCallsTest.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.test.scratchconverter; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.common.Constants; import org.catrobat.catroid.common.ScratchProgramData; import org.catrobat.catroid.common.ScratchSearchResult; @@ -41,6 +39,8 @@ import java.io.InterruptedIOException; import java.util.List; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertNotNull; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/protocol/JobHandlerSuccessfulOnJobMessageTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/protocol/JobHandlerSuccessfulOnJobMessageTest.java index 05140e4f771..1e03d769d74 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/protocol/JobHandlerSuccessfulOnJobMessageTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/protocol/JobHandlerSuccessfulOnJobMessageTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.scratchconverter.protocol; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.google.android.gms.common.images.WebImage; import org.catrobat.catroid.common.Constants; @@ -47,6 +45,8 @@ import java.util.Date; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; import static org.mockito.ArgumentMatchers.eq; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/sensing/CollisionInformationBubblePositionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/sensing/CollisionInformationBubblePositionTest.java index b187a134ddb..d7a99cd7efe 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/sensing/CollisionInformationBubblePositionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/sensing/CollisionInformationBubblePositionTest.java @@ -27,8 +27,6 @@ import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; -import androidx.test.ext.junit.runners.AndroidJUnit4; -import androidx.core.util.Pair; import org.catrobat.catroid.common.LookData; import org.catrobat.catroid.sensing.CollisionInformation; @@ -36,6 +34,9 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.core.util.Pair; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; import static org.mockito.Mockito.mock; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/stage/InvalidSaveScreenshotTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/stage/InvalidSaveScreenshotTest.java index 36720f64342..4fef895d99c 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/stage/InvalidSaveScreenshotTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/stage/InvalidSaveScreenshotTest.java @@ -23,13 +23,13 @@ package org.catrobat.catroid.test.stage; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.stage.StageListener; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static org.catrobat.catroid.stage.StageListener.SCREENSHOT_AUTOMATIC_FILE_NAME; import static org.junit.Assert.assertFalse; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/ui/RequiresPermissionTaskTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/ui/RequiresPermissionTaskTest.java index 478cb177207..05796ead89f 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/ui/RequiresPermissionTaskTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/ui/RequiresPermissionTaskTest.java @@ -24,7 +24,6 @@ package org.catrobat.catroid.test.ui; import android.app.Activity; -import androidx.appcompat.app.AppCompatActivity; import org.catrobat.catroid.ui.runtimepermissions.RequiresPermissionTask; import org.junit.Before; @@ -35,6 +34,8 @@ import java.util.ArrayList; import java.util.List; +import androidx.appcompat.app.AppCompatActivity; + import static android.content.pm.PackageManager.PERMISSION_GRANTED; import static org.junit.Assert.assertTrue; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/ImageEditingTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/ImageEditingTest.java index 8bed7a1b384..14c37faff96 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/ImageEditingTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/ImageEditingTest.java @@ -26,7 +26,6 @@ import android.graphics.Bitmap; import android.graphics.Bitmap.CompressFormat; import android.graphics.BitmapFactory; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.common.Constants; import org.catrobat.catroid.common.FlavoredConstants; @@ -42,6 +41,8 @@ import java.io.FileOutputStream; import java.io.IOException; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; import static org.hamcrest.Matchers.equalTo; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/MD5ChecksumTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/MD5ChecksumTest.java index 3542c0f525a..997d6af63a2 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/MD5ChecksumTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/MD5ChecksumTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.utiltests; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.io.StorageOperations; import org.catrobat.catroid.utils.Utils; import org.junit.Test; @@ -35,6 +33,8 @@ import java.io.PrintWriter; import java.util.Locale; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; import static org.catrobat.catroid.common.Constants.TMP_PATH; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/reflection/ReflectionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/reflection/ReflectionTest.java index f3d29b0b89c..b7e45ff4f39 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/reflection/ReflectionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/reflection/ReflectionTest.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.test.utiltests.reflection; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.test.utils.Reflection; import org.catrobat.catroid.test.utils.Reflection.Parameter; import org.catrobat.catroid.test.utils.Reflection.ParameterList; @@ -32,6 +30,8 @@ import java.util.Arrays; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertNotNull; import static junit.framework.Assert.assertNull; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/annotations/FlakyTestTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/annotations/FlakyTestTest.java index 2d746720a94..29e6cde4bf6 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/annotations/FlakyTestTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/annotations/FlakyTestTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.uiespresso.annotations; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.R; import org.catrobat.catroid.rules.FlakyTestRule; import org.catrobat.catroid.runner.Flaky; @@ -37,6 +35,8 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/ChangeVariableTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/ChangeVariableTest.java index 2d9dbc82faf..d8dbf09d799 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/ChangeVariableTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/ChangeVariableTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.uiespresso.content.brick.app; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; import org.catrobat.catroid.content.bricks.ChangeVariableBrick; @@ -39,6 +37,13 @@ import java.util.Arrays; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorDataListWrapper.onDataList; +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; +import static org.hamcrest.Matchers.allOf; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.pressBack; import static androidx.test.espresso.action.ViewActions.click; @@ -46,11 +51,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.hasSibling; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorDataListWrapper.onDataList; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; -import static org.hamcrest.Matchers.allOf; - @RunWith(AndroidJUnit4.class) public class ChangeVariableTest { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/DeleteItemOfUserListBrickTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/DeleteItemOfUserListBrickTest.java index 8143169643f..72d9a4b891b 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/DeleteItemOfUserListBrickTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/DeleteItemOfUserListBrickTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.uiespresso.content.brick.app; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.R; import org.catrobat.catroid.content.bricks.DeleteItemOfUserListBrick; import org.catrobat.catroid.formulaeditor.UserList; @@ -42,12 +40,7 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; -import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; -import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static androidx.test.espresso.matcher.ViewMatchers.withText; +import androidx.test.ext.junit.runners.AndroidJUnit4; import static junit.framework.Assert.assertEquals; @@ -57,6 +50,13 @@ import static org.hamcrest.Matchers.allOf; import static org.junit.Assert.assertNotNull; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; + @RunWith(AndroidJUnit4.class) public class DeleteItemOfUserListBrickTest { private static int brickPosition; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/InsertItemToUserListTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/InsertItemToUserListTest.java index a41fe593d01..a8f4992552f 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/InsertItemToUserListTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/InsertItemToUserListTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.uiespresso.content.brick.app; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.content.bricks.InsertItemIntoUserListBrick; @@ -41,9 +39,7 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.matcher.ViewMatchers.withId; +import androidx.test.ext.junit.runners.AndroidJUnit4; import static junit.framework.Assert.assertEquals; @@ -51,6 +47,10 @@ import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorDataListWrapper.onDataList; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; + @RunWith(AndroidJUnit4.class) public class InsertItemToUserListTest { @Rule diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PhiroColorBrickFormulaTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PhiroColorBrickFormulaTest.java index afe2b02cd2c..8f0d9d89bdf 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PhiroColorBrickFormulaTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PhiroColorBrickFormulaTest.java @@ -41,16 +41,16 @@ import java.util.Arrays; import java.util.Collection; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.assertion.ViewAssertions.matches; -import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; -import static androidx.test.espresso.matcher.ViewMatchers.withText; - import static org.catrobat.catroid.formulaeditor.FormulaElement.ElementType.NUMBER; import static org.catrobat.catroid.formulaeditor.FormulaElement.ElementType.OPERATOR; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withText; + @RunWith(Parameterized.class) public class PhiroColorBrickFormulaTest { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PhiroColorBrickNumberTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PhiroColorBrickNumberTest.java index 16cb0e9ba9e..27d3ff612cb 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PhiroColorBrickNumberTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PhiroColorBrickNumberTest.java @@ -40,6 +40,10 @@ import java.util.Arrays; import java.util.Collection; +import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; +import static org.catrobat.catroid.uiespresso.content.brick.utils.ColorPickerInteractionWrapper.onColorPickerPresetButton; +import static org.hamcrest.Matchers.containsString; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.matches; @@ -47,10 +51,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; -import static org.catrobat.catroid.uiespresso.content.brick.utils.ColorPickerInteractionWrapper.onColorPickerPresetButton; -import static org.hamcrest.Matchers.containsString; - @RunWith(Parameterized.class) public class PhiroColorBrickNumberTest { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PlaceAtBrickTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PlaceAtBrickTest.java index 203cd5c1b4e..8f9b098a914 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PlaceAtBrickTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PlaceAtBrickTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.uiespresso.content.brick.app; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.R; import org.catrobat.catroid.content.bricks.PlaceAtBrick; import org.catrobat.catroid.test.utils.TestUtils; @@ -39,6 +37,12 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; +import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickTestUtils.createProjectAndGetStartScript; +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.pressBack; import static androidx.test.espresso.action.ViewActions.click; @@ -47,10 +51,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; -import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickTestUtils.createProjectAndGetStartScript; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; - @RunWith(AndroidJUnit4.class) public class PlaceAtBrickTest { private int brickPosition; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/ReplaceItemInUserListTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/ReplaceItemInUserListTest.java index 8c91332494c..0c86d35bc38 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/ReplaceItemInUserListTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/ReplaceItemInUserListTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.uiespresso.content.brick.app; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.R; import org.catrobat.catroid.content.bricks.ReplaceItemInUserListBrick; import org.catrobat.catroid.testsuites.annotations.Cat; @@ -39,6 +37,12 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorDataListWrapper.onDataList; +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; @@ -47,10 +51,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorDataListWrapper.onDataList; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; - @RunWith(AndroidJUnit4.class) public class ReplaceItemInUserListTest { private int brickPosition; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetBackgroundBrickTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetBackgroundBrickTest.java index 585e4a431b4..577b680e84c 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetBackgroundBrickTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetBackgroundBrickTest.java @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.content.brick.app; -import androidx.test.espresso.intent.Intents; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.R; import org.catrobat.catroid.content.bricks.SetBackgroundBrick; import org.catrobat.catroid.testsuites.annotations.Cat; @@ -40,6 +37,14 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.espresso.intent.Intents; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.common.FlavoredConstants.LIBRARY_BACKGROUNDS_URL_PORTRAIT; +import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.core.AllOf.allOf; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.intent.Intents.intended; @@ -48,11 +53,6 @@ import static androidx.test.espresso.intent.matcher.IntentMatchers.hasExtras; import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static org.catrobat.catroid.common.FlavoredConstants.LIBRARY_BACKGROUNDS_URL_PORTRAIT; -import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.core.AllOf.allOf; - @RunWith(AndroidJUnit4.class) public class SetBackgroundBrickTest { private int brickPosition; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetLookBrickTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetLookBrickTest.java index 1ceb79305a8..a1536b4371f 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetLookBrickTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetLookBrickTest.java @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.content.brick.app; -import androidx.test.espresso.intent.Intents; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.R; import org.catrobat.catroid.content.bricks.SetLookBrick; import org.catrobat.catroid.testsuites.annotations.Cat; @@ -40,6 +37,14 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.espresso.intent.Intents; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.common.FlavoredConstants.LIBRARY_LOOKS_URL; +import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.core.AllOf.allOf; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.intent.Intents.intended; @@ -48,11 +53,6 @@ import static androidx.test.espresso.intent.matcher.IntentMatchers.hasExtras; import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static org.catrobat.catroid.common.FlavoredConstants.LIBRARY_LOOKS_URL; -import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.core.AllOf.allOf; - @RunWith(AndroidJUnit4.class) public class SetLookBrickTest { private int brickPosition; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetPenColorBrickFormulaTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetPenColorBrickFormulaTest.java index 9595ac0384f..f3272a6fd29 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetPenColorBrickFormulaTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetPenColorBrickFormulaTest.java @@ -39,17 +39,17 @@ import java.util.Arrays; import java.util.Collection; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.assertion.ViewAssertions.matches; -import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; -import static androidx.test.espresso.matcher.ViewMatchers.withText; - import static org.catrobat.catroid.formulaeditor.FormulaElement.ElementType.NUMBER; import static org.catrobat.catroid.formulaeditor.FormulaElement.ElementType.OPERATOR; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickTestUtils.createProjectAndGetStartScript; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withText; + @RunWith(Parameterized.class) public class SetPenColorBrickFormulaTest { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetPenColorBrickNumberTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetPenColorBrickNumberTest.java index 11e18a34502..d0c211cb196 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetPenColorBrickNumberTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetPenColorBrickNumberTest.java @@ -38,6 +38,11 @@ import java.util.Arrays; import java.util.Collection; +import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; +import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickTestUtils.createProjectAndGetStartScript; +import static org.catrobat.catroid.uiespresso.content.brick.utils.ColorPickerInteractionWrapper.onColorPickerPresetButton; +import static org.hamcrest.Matchers.containsString; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.matches; @@ -45,11 +50,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; -import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickTestUtils.createProjectAndGetStartScript; -import static org.catrobat.catroid.uiespresso.content.brick.utils.ColorPickerInteractionWrapper.onColorPickerPresetButton; -import static org.hamcrest.Matchers.containsString; - @RunWith(Parameterized.class) public class SetPenColorBrickNumberTest { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetVariableBrickTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetVariableBrickTest.java index 75d68989179..91ea9a07986 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetVariableBrickTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SetVariableBrickTest.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.uiespresso.content.brick.app; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; import org.catrobat.catroid.content.bricks.SetVariableBrick; @@ -41,6 +39,13 @@ import java.util.Arrays; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorDataListWrapper.onDataList; +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; +import static org.hamcrest.Matchers.allOf; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.pressBack; import static androidx.test.espresso.action.ViewActions.click; @@ -53,11 +58,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorDataListWrapper.onDataList; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; -import static org.hamcrest.Matchers.allOf; - @RunWith(AndroidJUnit4.class) public class SetVariableBrickTest { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/ShowTextColorSizeAlignmentBrickTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/ShowTextColorSizeAlignmentBrickTest.java index ccd2dfdfa23..4cc45621c6c 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/ShowTextColorSizeAlignmentBrickTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/ShowTextColorSizeAlignmentBrickTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.uiespresso.content.brick.app; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.R; import org.catrobat.catroid.content.bricks.ShowTextColorSizeAlignmentBrick; import org.catrobat.catroid.testsuites.annotations.Cat; @@ -37,17 +35,19 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.assertion.ViewAssertions.matches; -import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static androidx.test.espresso.matcher.ViewMatchers.withText; +import androidx.test.ext.junit.runners.AndroidJUnit4; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickTestUtils.createProjectAndGetStartScript; import static org.catrobat.catroid.uiespresso.content.brick.utils.ColorPickerInteractionWrapper.onColorPickerPresetButton; import static org.hamcrest.Matchers.containsString; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; + @RunWith(AndroidJUnit4.class) public class ShowTextColorSizeAlignmentBrickTest { private int brickPosition; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/VariableBrickTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/VariableBrickTest.java index 5e47a453fe8..967cc216bd4 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/VariableBrickTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/VariableBrickTest.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.uiespresso.content.brick.app; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; import org.catrobat.catroid.content.bricks.ChangeVariableBrick; @@ -41,13 +39,15 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; + import static androidx.test.espresso.Espresso.closeSoftKeyboard; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; - @RunWith(AndroidJUnit4.class) public class VariableBrickTest { private int setBrickPosition; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/CameraResourceTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/CameraResourceTest.java index 6281870ff99..e86351bf417 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/CameraResourceTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/CameraResourceTest.java @@ -22,9 +22,6 @@ */ package org.catrobat.catroid.uiespresso.content.brick.stage; -import androidx.test.rule.GrantPermissionRule; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.R; import org.catrobat.catroid.camera.CameraManager; import org.catrobat.catroid.content.Script; @@ -45,15 +42,18 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.rule.GrantPermissionRule; + +import static junit.framework.Assert.assertEquals; +import static junit.framework.Assert.assertTrue; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.pressBack; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.matcher.ViewMatchers.isRoot; import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static junit.framework.Assert.assertEquals; -import static junit.framework.Assert.assertTrue; - @RunWith(AndroidJUnit4.class) public class CameraResourceTest { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/FlashBrickStageTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/FlashBrickStageTest.java index 3d8f4b3b1b9..233868ecf14 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/FlashBrickStageTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/FlashBrickStageTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.uiespresso.content.brick.stage; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.R; import org.catrobat.catroid.content.bricks.FlashBrick; import org.catrobat.catroid.testsuites.annotations.Cat; @@ -38,13 +36,15 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.matcher.ViewMatchers.withId; +import androidx.test.ext.junit.runners.AndroidJUnit4; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickTestUtils.createProjectAndGetStartScript; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; + @RunWith(AndroidJUnit4.class) public class FlashBrickStageTest { private int flashBrickPosition; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/InsertItemToUserListStageTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/InsertItemToUserListStageTest.java index 5b7be5b2b4b..b8724144d16 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/InsertItemToUserListStageTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/InsertItemToUserListStageTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.uiespresso.content.brick.stage; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.content.bricks.InsertItemIntoUserListBrick; import org.catrobat.catroid.formulaeditor.Formula; import org.catrobat.catroid.formulaeditor.UserList; @@ -37,11 +35,13 @@ import org.junit.Test; import org.junit.runner.RunWith; -import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.matcher.ViewMatchers.isRoot; +import androidx.test.ext.junit.runners.AndroidJUnit4; import static org.junit.Assert.assertEquals; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.matcher.ViewMatchers.isRoot; + @RunWith(AndroidJUnit4.class) public class InsertItemToUserListStageTest { @Rule diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/VibrationBrickStageTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/VibrationBrickStageTest.java index 5e413f270dd..ffd9f0b5950 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/VibrationBrickStageTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/VibrationBrickStageTest.java @@ -37,12 +37,12 @@ import org.junit.Test; import org.junit.experimental.categories.Category; +import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; - public class VibrationBrickStageTest { private int vibrationBrickPosition; private int timeoutMS = 2500; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickCoordinatesProvider.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickCoordinatesProvider.java index ea6a28e7e58..5ddb5f1ae2f 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickCoordinatesProvider.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickCoordinatesProvider.java @@ -23,10 +23,11 @@ package org.catrobat.catroid.uiespresso.content.brick.utils; -import androidx.test.espresso.action.CoordinatesProvider; import android.util.Log; import android.view.View; +import androidx.test.espresso.action.CoordinatesProvider; + public enum BrickCoordinatesProvider implements CoordinatesProvider{ UPPER_LEFT_CORNER { @Override diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickDataInteractionWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickDataInteractionWrapper.java index afd2cc500cc..bf20229a74f 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickDataInteractionWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickDataInteractionWrapper.java @@ -23,12 +23,6 @@ package org.catrobat.catroid.uiespresso.content.brick.utils; -import androidx.test.espresso.DataInteraction; -import androidx.test.espresso.action.CoordinatesProvider; -import androidx.test.espresso.action.GeneralClickAction; -import androidx.test.espresso.action.Press; -import androidx.test.espresso.action.Swipe; -import androidx.test.espresso.action.Tap; import android.widget.Spinner; import android.widget.TextView; @@ -37,6 +31,16 @@ import org.catrobat.catroid.uiespresso.util.matchers.ScriptListMatchers; import org.catrobat.catroid.uiespresso.util.wrappers.DataInteractionWrapper; +import androidx.test.espresso.DataInteraction; +import androidx.test.espresso.action.CoordinatesProvider; +import androidx.test.espresso.action.GeneralClickAction; +import androidx.test.espresso.action.Press; +import androidx.test.espresso.action.Swipe; +import androidx.test.espresso.action.Tap; + +import static org.hamcrest.Matchers.instanceOf; +import static org.hamcrest.core.AnyOf.anyOf; + import static androidx.test.espresso.Espresso.onData; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; @@ -45,9 +49,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.hamcrest.Matchers.instanceOf; -import static org.hamcrest.core.AnyOf.anyOf; - public class BrickDataInteractionWrapper extends DataInteractionWrapper { public BrickDataInteractionWrapper(DataInteraction dataInteraction) { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickFormulaEditTextDataInteractionWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickFormulaEditTextDataInteractionWrapper.java index 0e0322a0d70..e7e7af72fc7 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickFormulaEditTextDataInteractionWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickFormulaEditTextDataInteractionWrapper.java @@ -23,16 +23,16 @@ package org.catrobat.catroid.uiespresso.content.brick.utils; +import org.catrobat.catroid.uiespresso.util.wrappers.DataInteractionWrapper; + import androidx.test.espresso.DataInteraction; -import org.catrobat.catroid.uiespresso.util.wrappers.DataInteractionWrapper; +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.matches; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; - public class BrickFormulaEditTextDataInteractionWrapper extends DataInteractionWrapper { public BrickFormulaEditTextDataInteractionWrapper(DataInteraction dataInteraction) { super(dataInteraction); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickSpinnerDataInteractionWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickSpinnerDataInteractionWrapper.java index 0c32d724e74..4aeb1646f02 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickSpinnerDataInteractionWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickSpinnerDataInteractionWrapper.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.uiespresso.content.brick.utils; -import androidx.test.espresso.DataInteraction; - import org.catrobat.catroid.common.Nameable; import org.catrobat.catroid.uiespresso.util.UiTestUtils; import org.catrobat.catroid.uiespresso.util.matchers.BrickSpinnerMatchers; @@ -34,16 +32,18 @@ import java.util.ArrayList; import java.util.List; +import androidx.test.espresso.DataInteraction; + +import static org.hamcrest.Matchers.allOf; +import static org.hamcrest.Matchers.instanceOf; +import static org.hamcrest.core.Is.is; + import static androidx.test.espresso.Espresso.onData; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.matches; import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.hamcrest.Matchers.allOf; -import static org.hamcrest.Matchers.instanceOf; -import static org.hamcrest.core.Is.is; - public class BrickSpinnerDataInteractionWrapper extends DataInteractionWrapper { public BrickSpinnerDataInteractionWrapper(DataInteraction dataInteraction) { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickVariableSpinnerDataInteractionWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickVariableSpinnerDataInteractionWrapper.java index 3cfba041a59..04594bffba8 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickVariableSpinnerDataInteractionWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickVariableSpinnerDataInteractionWrapper.java @@ -23,13 +23,18 @@ package org.catrobat.catroid.uiespresso.content.brick.utils; -import androidx.test.espresso.DataInteraction; - import org.catrobat.catroid.R; import org.catrobat.catroid.formulaeditor.UserVariable; import java.util.List; +import androidx.test.espresso.DataInteraction; + +import static org.catrobat.catroid.uiespresso.util.matchers.UserDataItemMatchers.withUserVariableName; +import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.core.AllOf.allOf; + import static androidx.test.espresso.Espresso.onData; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; @@ -41,11 +46,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.util.matchers.UserDataItemMatchers.withUserVariableName; -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.core.AllOf.allOf; - public class BrickVariableSpinnerDataInteractionWrapper extends BrickSpinnerDataInteractionWrapper { public BrickVariableSpinnerDataInteractionWrapper(DataInteraction dataInteraction) { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/ColorPickerInteractionWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/ColorPickerInteractionWrapper.java index 5f0d198b127..16b5f6e41af 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/ColorPickerInteractionWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/ColorPickerInteractionWrapper.java @@ -23,20 +23,21 @@ package org.catrobat.catroid.uiespresso.content.brick.utils; -import androidx.test.espresso.ViewInteraction; import android.widget.TableRow; import org.catrobat.catroid.uiespresso.util.wrappers.ViewInteractionWrapper; import org.catrobat.paintroid.colorpicker.PresetSelectorView; +import androidx.test.espresso.ViewInteraction; + +import static org.hamcrest.Matchers.allOf; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.matcher.ViewMatchers.isAssignableFrom; import static androidx.test.espresso.matcher.ViewMatchers.isDescendantOfA; import static androidx.test.espresso.matcher.ViewMatchers.withParent; import static androidx.test.espresso.matcher.ViewMatchers.withParentIndex; -import static org.hamcrest.Matchers.allOf; - public final class ColorPickerInteractionWrapper extends ViewInteractionWrapper { private ColorPickerInteractionWrapper(ViewInteraction viewInteraction) { super(viewInteraction); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/CustomSwipeAction.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/CustomSwipeAction.java index a421f25233b..7a0f5d193e4 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/CustomSwipeAction.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/CustomSwipeAction.java @@ -23,16 +23,17 @@ package org.catrobat.catroid.uiespresso.content.brick.utils; import android.graphics.Point; +import android.view.View; +import android.view.ViewConfiguration; + +import org.hamcrest.Matcher; + import androidx.test.espresso.PerformException; import androidx.test.espresso.UiController; import androidx.test.espresso.ViewAction; import androidx.test.espresso.action.PrecisionDescriber; import androidx.test.espresso.action.Swiper; import androidx.test.espresso.util.HumanReadables; -import android.view.View; -import android.view.ViewConfiguration; - -import org.hamcrest.Matcher; import static androidx.test.espresso.matcher.ViewMatchers.isDisplayingAtLeast; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/DragNDropBrickAction.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/DragNDropBrickAction.java index 4a038f5aa52..ec1aee063db 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/DragNDropBrickAction.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/DragNDropBrickAction.java @@ -23,17 +23,18 @@ package org.catrobat.catroid.uiespresso.content.brick.utils; +import android.view.View; +import android.view.ViewConfiguration; + +import org.catrobat.catroid.uiespresso.util.matchers.ScriptListMatchers; +import org.hamcrest.Matcher; + import androidx.test.espresso.UiController; import androidx.test.espresso.ViewAction; import androidx.test.espresso.action.CoordinatesProvider; import androidx.test.espresso.action.PrecisionDescriber; import androidx.test.espresso.action.Swiper; import androidx.test.espresso.matcher.ViewMatchers; -import android.view.View; -import android.view.ViewConfiguration; - -import org.catrobat.catroid.uiespresso.util.matchers.ScriptListMatchers; -import org.hamcrest.Matcher; public class DragNDropBrickAction implements ViewAction { private Swiper swiper; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/UiNFCTestUtils.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/UiNFCTestUtils.java index b36d547e5fc..43ec98b3920 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/UiNFCTestUtils.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/UiNFCTestUtils.java @@ -29,7 +29,6 @@ import android.nfc.NdefMessage; import android.nfc.NfcAdapter; import android.nfc.Tag; -import androidx.test.espresso.DataInteraction; import android.util.Log; import android.widget.Spinner; @@ -39,6 +38,10 @@ import java.util.List; +import androidx.test.espresso.DataInteraction; + +import static org.hamcrest.Matchers.instanceOf; + import static androidx.test.espresso.Espresso.onData; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.pressBack; @@ -49,8 +52,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.hamcrest.Matchers.instanceOf; - public final class UiNFCTestUtils { private UiNFCTestUtils() { throw new AssertionError(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorAddVariableTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorAddVariableTest.java index 4e92b994f75..8d4cf4d477c 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorAddVariableTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorAddVariableTest.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.uiespresso.formulaeditor; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; import org.catrobat.catroid.content.bricks.ChangeSizeByNBrick; @@ -39,13 +37,15 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.matcher.ViewMatchers.withId; +import androidx.test.ext.junit.runners.AndroidJUnit4; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorDataListWrapper.onDataList; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; + @RunWith(AndroidJUnit4.class) public class FormulaEditorAddVariableTest { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorDiscardChangesTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorDiscardChangesTest.java index cfa8f34a1a5..80fe440a1dd 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorDiscardChangesTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorDiscardChangesTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.uiespresso.formulaeditor; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; import org.catrobat.catroid.content.bricks.PlaceAtBrick; @@ -41,6 +39,13 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; +import static org.catrobat.catroid.uiespresso.util.UiTestUtils.getResourcesString; +import static org.catrobat.catroid.uiespresso.util.UiTestUtils.onToast; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.pressBack; import static androidx.test.espresso.action.ViewActions.click; @@ -49,11 +54,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; -import static org.catrobat.catroid.uiespresso.util.UiTestUtils.getResourcesString; -import static org.catrobat.catroid.uiespresso.util.UiTestUtils.onToast; - @RunWith(AndroidJUnit4.class) public class FormulaEditorDiscardChangesTest { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorEditTextTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorEditTextTest.java index 97a800430db..1599c187358 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorEditTextTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorEditTextTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.uiespresso.formulaeditor; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; import org.catrobat.catroid.content.bricks.ChangeSizeByNBrick; @@ -41,16 +39,7 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.Espresso.pressBack; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.action.ViewActions.doubleClick; -import static androidx.test.espresso.action.ViewActions.longClick; -import static androidx.test.espresso.assertion.ViewAssertions.matches; -import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; -import static androidx.test.espresso.matcher.ViewMatchers.isRoot; -import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static androidx.test.espresso.matcher.ViewMatchers.withText; +import androidx.test.ext.junit.runners.AndroidJUnit4; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.Category.FUNCTIONS; @@ -62,6 +51,17 @@ import static org.catrobat.catroid.uiespresso.util.UiTestUtils.getResourcesString; import static org.catrobat.catroid.uiespresso.util.UiTestUtils.onToast; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.pressBack; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.action.ViewActions.doubleClick; +import static androidx.test.espresso.action.ViewActions.longClick; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.isRoot; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; + @RunWith(AndroidJUnit4.class) public class FormulaEditorEditTextTest { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorFunctionListTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorFunctionListTest.java index 8536d159ec5..c4e581015d3 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorFunctionListTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorFunctionListTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.uiespresso.formulaeditor; -import androidx.annotation.StringRes; - import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; import org.catrobat.catroid.content.bricks.ChangeSizeByNBrick; @@ -44,14 +42,16 @@ import java.util.Arrays; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.matcher.ViewMatchers.withId; +import androidx.annotation.StringRes; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; import static org.junit.runners.Parameterized.Parameter; import static org.junit.runners.Parameterized.Parameters; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; + @Category({Cat.AppUi.class, Level.Smoke.class}) @RunWith(Parameterized.class) public class FormulaEditorFunctionListTest { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorMovementPropertiesTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorMovementPropertiesTest.java index a7ded7bd102..406b345e759 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorMovementPropertiesTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorMovementPropertiesTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.uiespresso.formulaeditor; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; import org.catrobat.catroid.content.bricks.ChangeSizeByNBrick; @@ -38,6 +36,11 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.pressBack; import static androidx.test.espresso.action.ViewActions.click; @@ -45,9 +48,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; - @RunWith(AndroidJUnit4.class) public class FormulaEditorMovementPropertiesTest { @Rule diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorRenameVariableTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorRenameVariableTest.java index d1a0ce94034..758563b0239 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorRenameVariableTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorRenameVariableTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.uiespresso.formulaeditor; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; import org.catrobat.catroid.content.bricks.ChangeSizeByNBrick; @@ -40,13 +38,15 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.matcher.ViewMatchers.withId; +import androidx.test.ext.junit.runners.AndroidJUnit4; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorDataListWrapper.onDataList; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; + @RunWith(AndroidJUnit4.class) public class FormulaEditorRenameVariableTest { @Rule diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormularEditorVariableScopeTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormularEditorVariableScopeTest.java index e65a9960182..aec701b6426 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormularEditorVariableScopeTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormularEditorVariableScopeTest.java @@ -37,16 +37,16 @@ import org.junit.Test; import org.junit.experimental.categories.Category; +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorDataListWrapper.onDataList; +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.matches; import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorDataListWrapper.onDataList; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; - public class FormularEditorVariableScopeTest { @Rule diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/FormulaEditorDataListWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/FormulaEditorDataListWrapper.java index d14eb5b5376..d82eee9d168 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/FormulaEditorDataListWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/FormulaEditorDataListWrapper.java @@ -25,6 +25,9 @@ import org.catrobat.catroid.R; import org.catrobat.catroid.uiespresso.util.wrappers.ViewInteractionWrapper; +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; +import static org.catrobat.catroid.uiespresso.util.matchers.FormulaEditorDataListMatchers.isDataListView; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.pressBack; import static androidx.test.espresso.action.ViewActions.click; @@ -36,9 +39,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.isNotChecked; import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; -import static org.catrobat.catroid.uiespresso.util.matchers.FormulaEditorDataListMatchers.isDataListView; - public final class FormulaEditorDataListWrapper extends ViewInteractionWrapper { public enum ItemScope { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/FormulaEditorWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/FormulaEditorWrapper.java index 0ccc29fba85..94e35894c7a 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/FormulaEditorWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/FormulaEditorWrapper.java @@ -34,6 +34,9 @@ import java.util.HashMap; import java.util.Map; +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorCategoryListWrapper.onCategoryList; +import static org.hamcrest.Matchers.equalToIgnoringWhiteSpace; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.clearText; import static androidx.test.espresso.action.ViewActions.click; @@ -43,9 +46,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorCategoryListWrapper.onCategoryList; -import static org.hamcrest.Matchers.equalToIgnoringWhiteSpace; - public final class FormulaEditorWrapper extends ViewInteractionWrapper { public static final Matcher FORMULA_EDITOR_KEYBOARD_MATCHER = withId(R.id.formula_editor_keyboardview); public static final Matcher FORMULA_EDITOR_TEXT_FIELD_MATCHER = withId(R.id.formula_editor_edit_field); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/UserListDataItemRVInteractionWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/UserListDataItemRVInteractionWrapper.java index 1ed631abbb8..9b4f37187bc 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/UserListDataItemRVInteractionWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/UserListDataItemRVInteractionWrapper.java @@ -25,11 +25,11 @@ import org.catrobat.catroid.R; +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; + import static androidx.test.espresso.assertion.ViewAssertions.matches; import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; - public final class UserListDataItemRVInteractionWrapper extends UserDataItemRVInteractionWrapper { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/UserVariableDataItemRVInteractionWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/UserVariableDataItemRVInteractionWrapper.java index 1887b04c48e..5c9dd9023c3 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/UserVariableDataItemRVInteractionWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/UserVariableDataItemRVInteractionWrapper.java @@ -25,12 +25,12 @@ import org.catrobat.catroid.R; +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; + import static androidx.test.espresso.assertion.ViewAssertions.matches; import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; - public final class UserVariableDataItemRVInteractionWrapper extends UserDataItemRVInteractionWrapper { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/visualplacement/SpriteActivityVisualPlacementTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/visualplacement/SpriteActivityVisualPlacementTest.java index 8a64f13b59a..5e7d721baab 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/visualplacement/SpriteActivityVisualPlacementTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/visualplacement/SpriteActivityVisualPlacementTest.java @@ -26,8 +26,6 @@ import android.app.Activity; import android.app.Instrumentation; import android.content.Intent; -import androidx.test.espresso.intent.Intents; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.content.bricks.PlaceAtBrick; @@ -42,6 +40,18 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.espresso.intent.Intents; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.content.bricks.Brick.BrickField.X_POSITION; +import static org.catrobat.catroid.ui.SpriteActivity.EXTRA_BRICK_HASH; +import static org.catrobat.catroid.ui.SpriteActivity.EXTRA_X_TRANSFORM; +import static org.catrobat.catroid.ui.SpriteActivity.EXTRA_Y_TRANSFORM; +import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickTestUtils.createProjectAndGetStartScript; +import static org.catrobat.catroid.visualplacement.VisualPlacementActivity.X_COORDINATE_BUNDLE_ARGUMENT; +import static org.catrobat.catroid.visualplacement.VisualPlacementActivity.Y_COORDINATE_BUNDLE_ARGUMENT; +import static org.hamcrest.core.AllOf.allOf; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.matches; @@ -53,15 +63,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.content.bricks.Brick.BrickField.X_POSITION; -import static org.catrobat.catroid.ui.SpriteActivity.EXTRA_BRICK_HASH; -import static org.catrobat.catroid.ui.SpriteActivity.EXTRA_X_TRANSFORM; -import static org.catrobat.catroid.ui.SpriteActivity.EXTRA_Y_TRANSFORM; -import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickTestUtils.createProjectAndGetStartScript; -import static org.catrobat.catroid.visualplacement.VisualPlacementActivity.X_COORDINATE_BUNDLE_ARGUMENT; -import static org.catrobat.catroid.visualplacement.VisualPlacementActivity.Y_COORDINATE_BUNDLE_ARGUMENT; -import static org.hamcrest.core.AllOf.allOf; - @RunWith(AndroidJUnit4.class) public class SpriteActivityVisualPlacementTest { private static final int XPOS = -200; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/visualplacement/VisualPlacementActivityTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/visualplacement/VisualPlacementActivityTest.java index b9d6b5b9164..831559977ba 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/visualplacement/VisualPlacementActivityTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/visualplacement/VisualPlacementActivityTest.java @@ -24,9 +24,6 @@ package org.catrobat.catroid.uiespresso.intents.visualplacement; import android.content.Intent; -import androidx.test.espresso.Espresso; -import androidx.test.espresso.intent.rule.IntentsTestRule; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.test.utils.TestUtils; @@ -38,10 +35,9 @@ import org.junit.Test; import org.junit.runner.RunWith; -import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static androidx.test.espresso.matcher.ViewMatchers.withText; +import androidx.test.espresso.Espresso; +import androidx.test.espresso.intent.rule.IntentsTestRule; +import androidx.test.ext.junit.runners.AndroidJUnit4; import static org.catrobat.catroid.ui.SpriteActivity.EXTRA_X_TRANSFORM; import static org.catrobat.catroid.ui.SpriteActivity.EXTRA_Y_TRANSFORM; @@ -49,6 +45,11 @@ import static org.catrobat.catroid.visualplacement.VisualPlacementActivity.X_COORDINATE_BUNDLE_ARGUMENT; import static org.catrobat.catroid.visualplacement.VisualPlacementActivity.Y_COORDINATE_BUNDLE_ARGUMENT; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; + @RunWith(AndroidJUnit4.class) public class VisualPlacementActivityTest { private static final int XPOS = -200; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/pocketmusic/RecyclerViewMatcher.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/pocketmusic/RecyclerViewMatcher.java index d880d3b0c48..90f07d5c61b 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/pocketmusic/RecyclerViewMatcher.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/pocketmusic/RecyclerViewMatcher.java @@ -24,13 +24,14 @@ package org.catrobat.catroid.uiespresso.pocketmusic; import android.content.res.Resources; -import androidx.recyclerview.widget.RecyclerView; import android.view.View; import org.hamcrest.Description; import org.hamcrest.Matcher; import org.hamcrest.TypeSafeMatcher; +import androidx.recyclerview.widget.RecyclerView; + public class RecyclerViewMatcher { private final int recyclerViewId; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastReceiverRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastReceiverRegressionTest.java index e3d9cd13d7c..09500e39475 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastReceiverRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastReceiverRegressionTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.uiespresso.stage; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.R; import org.catrobat.catroid.content.BroadcastScript; import org.catrobat.catroid.content.Project; @@ -51,14 +49,16 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.uiespresso.util.UserVariableAssertions.assertUserVariableEqualsWithTimeout; +import static org.catrobat.catroid.uiespresso.util.UserVariableAssertions.assertUserVariableIsGreaterThanWithTimeout; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.pressBack; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static org.catrobat.catroid.uiespresso.util.UserVariableAssertions.assertUserVariableEqualsWithTimeout; -import static org.catrobat.catroid.uiespresso.util.UserVariableAssertions.assertUserVariableIsGreaterThanWithTimeout; - @RunWith(AndroidJUnit4.class) public class BroadcastReceiverRegressionTest { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/MultipleBroadcastsTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/MultipleBroadcastsTest.java index ba413e27d12..22b279a8fed 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/MultipleBroadcastsTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/MultipleBroadcastsTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.uiespresso.stage; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.content.Project; import org.catrobat.catroid.content.Script; import org.catrobat.catroid.content.SingleSprite; @@ -46,6 +44,8 @@ import java.util.ArrayList; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static org.catrobat.catroid.uiespresso.util.UserVariableAssertions.assertUserVariableEqualsWithTimeout; @RunWith(AndroidJUnit4.class) diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StagePausedTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StagePausedTest.java index 74efd027dfc..f6330d83189 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StagePausedTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StagePausedTest.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.uiespresso.stage; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.badlogic.gdx.scenes.scene2d.InputEvent; import com.badlogic.gdx.scenes.scene2d.InputListener; @@ -39,17 +37,19 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.Espresso.pressBack; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.matcher.ViewMatchers.isRoot; -import static androidx.test.espresso.matcher.ViewMatchers.withId; +import androidx.test.ext.junit.runners.AndroidJUnit4; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; import static org.catrobat.catroid.uiespresso.util.UiTestUtils.createEmptyProject; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.pressBack; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.isRoot; +import static androidx.test.espresso.matcher.ViewMatchers.withId; + @RunWith(AndroidJUnit4.class) public class StagePausedTest { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/utils/StageTestTouchUtils.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/utils/StageTestTouchUtils.java index a921778e069..b91b76eb319 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/utils/StageTestTouchUtils.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/utils/StageTestTouchUtils.java @@ -23,14 +23,15 @@ package org.catrobat.catroid.uiespresso.stage.utils; -import androidx.test.espresso.UiController; -import androidx.test.espresso.ViewAction; -import androidx.test.espresso.action.MotionEvents; import android.view.MotionEvent; import android.view.View; import org.hamcrest.Matcher; +import androidx.test.espresso.UiController; +import androidx.test.espresso.ViewAction; +import androidx.test.espresso.action.MotionEvents; + import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; public final class StageTestTouchUtils { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionBarFormulaEditorTitleTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionBarFormulaEditorTitleTest.java index f8c357c7d90..365546705df 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionBarFormulaEditorTitleTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionBarFormulaEditorTitleTest.java @@ -37,17 +37,17 @@ import org.junit.Test; import org.junit.experimental.categories.Category; +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorDataListWrapper.onDataList; +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; +import static org.catrobat.catroid.uiespresso.ui.actionbar.utils.ActionBarWrapper.onActionBar; +import static org.catrobat.catroid.uiespresso.ui.actionbar.utils.ActionModeWrapper.onActionMode; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openContextualActionModeOverflowMenu; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorDataListWrapper.onDataList; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; -import static org.catrobat.catroid.uiespresso.ui.actionbar.utils.ActionBarWrapper.onActionBar; -import static org.catrobat.catroid.uiespresso.ui.actionbar.utils.ActionModeWrapper.onActionMode; - public class ActionBarFormulaEditorTitleTest { @Rule public FragmentActivityTestRule baseActivityTestRule = new diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionBarScriptTitleAfterExitingFormulaEditorOneSceneProjectTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionBarScriptTitleAfterExitingFormulaEditorOneSceneProjectTest.java index 5259bcda343..c850f4e1a9d 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionBarScriptTitleAfterExitingFormulaEditorOneSceneProjectTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionBarScriptTitleAfterExitingFormulaEditorOneSceneProjectTest.java @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.actionbar; -import androidx.test.espresso.Espresso; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; @@ -41,12 +38,15 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.espresso.Espresso; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.uiespresso.ui.actionbar.utils.ActionBarWrapper.onActionBar; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static org.catrobat.catroid.uiespresso.ui.actionbar.utils.ActionBarWrapper.onActionBar; - @RunWith(AndroidJUnit4.class) public class ActionBarScriptTitleAfterExitingFormulaEditorOneSceneProjectTest { @Rule diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionModeDataFragmentTitleTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionModeDataFragmentTitleTest.java index 20ebc7ad1da..1ee4beec5b8 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionModeDataFragmentTitleTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionModeDataFragmentTitleTest.java @@ -41,16 +41,16 @@ import org.junit.Test; import org.junit.experimental.categories.Category; +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorDataListWrapper.onDataList; +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; +import static org.catrobat.catroid.uiespresso.ui.actionbar.utils.ActionModeWrapper.onActionMode; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openContextualActionModeOverflowMenu; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorDataListWrapper.onDataList; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; -import static org.catrobat.catroid.uiespresso.ui.actionbar.utils.ActionModeWrapper.onActionMode; - public class ActionModeDataFragmentTitleTest { @Rule public FragmentActivityTestRule baseActivityTestRule = new diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/utils/ActionBarWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/utils/ActionBarWrapper.java index be1297f1242..1768ac6dbb4 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/utils/ActionBarWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/utils/ActionBarWrapper.java @@ -31,6 +31,9 @@ import org.catrobat.catroid.uiespresso.util.UiTestUtils; import org.hamcrest.Matcher; +import static org.hamcrest.Matchers.allOf; +import static org.hamcrest.Matchers.instanceOf; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.matches; @@ -40,9 +43,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withParent; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.hamcrest.Matchers.allOf; -import static org.hamcrest.Matchers.instanceOf; - public final class ActionBarWrapper { public static final Matcher TOOLBAR_MATCHER = withId(R.id.toolbar); public static final Matcher TITLE_MATCHER = allOf(withParent(TOOLBAR_MATCHER), instanceOf(TextView.class)); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/utils/LegoSensorPortConfigDialogWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/utils/LegoSensorPortConfigDialogWrapper.java index 67488d67f5f..2fb5ebff5ae 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/utils/LegoSensorPortConfigDialogWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/utils/LegoSensorPortConfigDialogWrapper.java @@ -23,15 +23,17 @@ package org.catrobat.catroid.uiespresso.ui.dialog.utils; -import androidx.annotation.IntDef; -import androidx.test.espresso.ViewInteraction; - import org.catrobat.catroid.R; import org.catrobat.catroid.uiespresso.util.UiTestUtils; import org.catrobat.catroid.uiespresso.util.wrappers.ViewInteractionWrapper; import java.lang.annotation.Retention; +import androidx.annotation.IntDef; +import androidx.test.espresso.ViewInteraction; + +import static java.lang.annotation.RetentionPolicy.SOURCE; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.matches; @@ -39,8 +41,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static java.lang.annotation.RetentionPolicy.SOURCE; - public final class LegoSensorPortConfigDialogWrapper extends ViewInteractionWrapper { @Retention(SOURCE) diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewInteractionWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewInteractionWrapper.java index 8bf8a302911..30b2fe96b45 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewInteractionWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewInteractionWrapper.java @@ -23,14 +23,15 @@ package org.catrobat.catroid.uiespresso.ui.fragment.rvutils; -import androidx.test.espresso.ViewAction; -import androidx.test.espresso.ViewInteraction; import android.view.View; import org.catrobat.catroid.R; import org.catrobat.catroid.uiespresso.util.wrappers.ViewInteractionWrapper; import org.hamcrest.Matcher; +import androidx.test.espresso.ViewAction; +import androidx.test.espresso.ViewInteraction; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.assertion.ViewAssertions.matches; import static androidx.test.espresso.contrib.RecyclerViewActions.actionOnHolderItem; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewItemInteractionWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewItemInteractionWrapper.java index b59ca7f00cc..995df099b39 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewItemInteractionWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewItemInteractionWrapper.java @@ -23,11 +23,11 @@ package org.catrobat.catroid.uiespresso.ui.fragment.rvutils; -import androidx.test.espresso.ViewInteraction; - import org.catrobat.catroid.R; import org.catrobat.catroid.uiespresso.util.wrappers.ViewInteractionWrapper; +import androidx.test.espresso.ViewInteraction; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewItemMatcher.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewItemMatcher.java index 9a323ed0583..e80520efea3 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewItemMatcher.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewItemMatcher.java @@ -23,13 +23,14 @@ package org.catrobat.catroid.uiespresso.ui.fragment.rvutils; -import androidx.recyclerview.widget.RecyclerView; import android.view.View; import org.hamcrest.Description; import org.hamcrest.Matcher; import org.hamcrest.TypeSafeMatcher; +import androidx.recyclerview.widget.RecyclerView; + public class RecyclerViewItemMatcher { private final int recyclerViewId; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewMatcher.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewMatcher.java index 1e1a2a672e0..29605234d9c 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewMatcher.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/rvutils/RecyclerViewMatcher.java @@ -23,13 +23,14 @@ package org.catrobat.catroid.uiespresso.ui.fragment.rvutils; -import androidx.recyclerview.widget.RecyclerView; import android.view.View; import org.hamcrest.Description; import org.hamcrest.Matcher; import org.hamcrest.TypeSafeMatcher; +import androidx.recyclerview.widget.RecyclerView; + public class RecyclerViewMatcher { private final int recyclerViewId; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/UserVariableAssertions.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/UserVariableAssertions.java index 87d9d96a010..fcd9de7db98 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/UserVariableAssertions.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/UserVariableAssertions.java @@ -26,9 +26,6 @@ import org.catrobat.catroid.formulaeditor.UserVariable; import org.catrobat.catroid.uiespresso.util.actions.CustomActions; -import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.matcher.ViewMatchers.isRoot; - import static junit.framework.Assert.assertEquals; import static org.hamcrest.MatcherAssert.assertThat; @@ -38,6 +35,9 @@ import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.not; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.matcher.ViewMatchers.isRoot; + public final class UserVariableAssertions { private static final double EPSILON = 0.001; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/actions/CustomActions.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/actions/CustomActions.java index ff85f3fc726..527e7c4a413 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/actions/CustomActions.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/actions/CustomActions.java @@ -22,12 +22,13 @@ */ package org.catrobat.catroid.uiespresso.util.actions; -import androidx.test.espresso.UiController; -import androidx.test.espresso.ViewAction; import android.view.View; import org.hamcrest.Matcher; +import androidx.test.espresso.UiController; +import androidx.test.espresso.ViewAction; + import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; public final class CustomActions { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/FormulaEditorCategoryListMatchers.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/FormulaEditorCategoryListMatchers.java index 34c97fd730a..f681ee96729 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/FormulaEditorCategoryListMatchers.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/FormulaEditorCategoryListMatchers.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.uiespresso.util.matchers; -import androidx.recyclerview.widget.RecyclerView; import android.view.View; import org.catrobat.catroid.ui.recyclerview.adapter.CategoryListRVAdapter; @@ -31,6 +30,8 @@ import org.hamcrest.Matcher; import org.hamcrest.TypeSafeMatcher; +import androidx.recyclerview.widget.RecyclerView; + public final class FormulaEditorCategoryListMatchers { private FormulaEditorCategoryListMatchers() { throw new AssertionError(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/FormulaEditorDataListMatchers.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/FormulaEditorDataListMatchers.java index 5ecb2172389..20f9e5ab4d9 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/FormulaEditorDataListMatchers.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/FormulaEditorDataListMatchers.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.uiespresso.util.matchers; -import androidx.recyclerview.widget.RecyclerView; import android.view.View; import org.catrobat.catroid.ui.recyclerview.adapter.DataListAdapter; @@ -31,6 +30,8 @@ import org.hamcrest.Matcher; import org.hamcrest.TypeSafeMatcher; +import androidx.recyclerview.widget.RecyclerView; + public final class FormulaEditorDataListMatchers { private FormulaEditorDataListMatchers() { throw new AssertionError(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/StageMatchers.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/StageMatchers.java index e6e0420fdff..5c5546748d9 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/StageMatchers.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/StageMatchers.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.uiespresso.util.matchers; -import androidx.test.espresso.matcher.BoundedMatcher; import android.view.View; import com.badlogic.gdx.backends.android.surfaceview.GLSurfaceView20; @@ -32,6 +31,8 @@ import org.hamcrest.Description; import org.hamcrest.Matcher; +import androidx.test.espresso.matcher.BoundedMatcher; + public final class StageMatchers { // Suppress default constructor for noninstantiability private StageMatchers() { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/SuperToastMatchers.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/SuperToastMatchers.java index 70f4d080243..152f45cb35d 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/SuperToastMatchers.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/matchers/SuperToastMatchers.java @@ -23,13 +23,14 @@ package org.catrobat.catroid.uiespresso.util.matchers; -import androidx.test.espresso.Root; import android.view.WindowManager; import org.hamcrest.Description; import org.hamcrest.Matcher; import org.hamcrest.TypeSafeMatcher; +import androidx.test.espresso.Root; + public final class SuperToastMatchers { private SuperToastMatchers() { throw new AssertionError(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/rules/BaseActivityTestRule.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/rules/BaseActivityTestRule.java index eaabc8ff54e..acc894c4c98 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/rules/BaseActivityTestRule.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/rules/BaseActivityTestRule.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.uiespresso.util.rules; import android.app.Activity; -import androidx.test.rule.ActivityTestRule; import android.util.Log; import org.catrobat.catroid.common.FlavoredConstants; @@ -31,6 +30,8 @@ import java.io.File; import java.io.IOException; +import androidx.test.rule.ActivityTestRule; + import static org.catrobat.catroid.io.StorageOperations.deleteDir; public class BaseActivityTestRule extends ActivityTestRule { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/wrappers/DataInteractionWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/wrappers/DataInteractionWrapper.java index ee6e4034931..86a0a439cb3 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/wrappers/DataInteractionWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/wrappers/DataInteractionWrapper.java @@ -23,15 +23,16 @@ package org.catrobat.catroid.uiespresso.util.wrappers; +import android.view.View; + +import org.hamcrest.Matcher; + import androidx.test.espresso.DataInteraction; import androidx.test.espresso.Root; import androidx.test.espresso.ViewAction; import androidx.test.espresso.ViewAssertion; import androidx.test.espresso.ViewInteraction; import androidx.test.espresso.action.AdapterViewProtocol; -import android.view.View; - -import org.hamcrest.Matcher; public abstract class DataInteractionWrapper { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/wrappers/ViewInteractionWrapper.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/wrappers/ViewInteractionWrapper.java index 0bcb38f2ad4..deb482f3941 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/wrappers/ViewInteractionWrapper.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/wrappers/ViewInteractionWrapper.java @@ -23,14 +23,14 @@ package org.catrobat.catroid.uiespresso.util.wrappers; +import org.hamcrest.Matcher; + import androidx.test.espresso.FailureHandler; import androidx.test.espresso.Root; import androidx.test.espresso.ViewAction; import androidx.test.espresso.ViewAssertion; import androidx.test.espresso.ViewInteraction; -import org.hamcrest.Matcher; - public abstract class ViewInteractionWrapper { protected ViewInteraction viewInteraction; diff --git a/catroid/src/main/java/org/catrobat/catroid/CatroidApplication.java b/catroid/src/main/java/org/catrobat/catroid/CatroidApplication.java index 0311e47fabd..bea4ca68aac 100644 --- a/catroid/src/main/java/org/catrobat/catroid/CatroidApplication.java +++ b/catroid/src/main/java/org/catrobat/catroid/CatroidApplication.java @@ -28,7 +28,6 @@ import android.content.Context; import android.os.Build; import android.os.StrictMode; -import androidx.multidex.MultiDex; import android.util.Log; import com.google.android.gms.analytics.GoogleAnalytics; @@ -43,6 +42,7 @@ import javax.inject.Inject; +import androidx.multidex.MultiDex; import dagger.android.AndroidInjector; import dagger.android.DispatchingAndroidInjector; import dagger.android.HasActivityInjector; diff --git a/catroid/src/main/java/org/catrobat/catroid/ProjectManager.java b/catroid/src/main/java/org/catrobat/catroid/ProjectManager.java index c983d9343c7..4fd8b658142 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ProjectManager.java +++ b/catroid/src/main/java/org/catrobat/catroid/ProjectManager.java @@ -23,7 +23,6 @@ package org.catrobat.catroid; import android.content.Context; -import androidx.annotation.VisibleForTesting; import android.util.Log; import org.catrobat.catroid.common.DefaultProjectHandler; @@ -64,6 +63,8 @@ import java.util.Iterator; import java.util.List; +import androidx.annotation.VisibleForTesting; + import static org.catrobat.catroid.common.Constants.CURRENT_CATROBAT_LANGUAGE_VERSION; import static org.catrobat.catroid.common.Constants.PERMISSIONS_FILE_NAME; diff --git a/catroid/src/main/java/org/catrobat/catroid/bluetooth/ConnectBluetoothDeviceActivity.java b/catroid/src/main/java/org/catrobat/catroid/bluetooth/ConnectBluetoothDeviceActivity.java index 8634d87103b..86f0e34bd66 100644 --- a/catroid/src/main/java/org/catrobat/catroid/bluetooth/ConnectBluetoothDeviceActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/bluetooth/ConnectBluetoothDeviceActivity.java @@ -30,7 +30,6 @@ import android.content.IntentFilter; import android.os.AsyncTask; import android.os.Bundle; -import androidx.appcompat.app.AppCompatActivity; import android.util.Log; import android.util.Pair; import android.view.View; @@ -57,6 +56,8 @@ import java.util.ArrayList; import java.util.Set; +import androidx.appcompat.app.AppCompatActivity; + import static android.bluetooth.BluetoothDevice.DEVICE_TYPE_CLASSIC; import static android.bluetooth.BluetoothDevice.DEVICE_TYPE_DUAL; import static android.bluetooth.BluetoothDevice.DEVICE_TYPE_LE; diff --git a/catroid/src/main/java/org/catrobat/catroid/camera/CameraManager.java b/catroid/src/main/java/org/catrobat/catroid/camera/CameraManager.java index 5e96ef85889..93d524823e4 100644 --- a/catroid/src/main/java/org/catrobat/catroid/camera/CameraManager.java +++ b/catroid/src/main/java/org/catrobat/catroid/camera/CameraManager.java @@ -27,7 +27,6 @@ import android.graphics.YuvImage; import android.hardware.Camera; import android.hardware.Camera.Parameters; -import androidx.annotation.VisibleForTesting; import android.util.Log; import android.view.ViewGroup; import android.view.ViewParent; @@ -45,6 +44,8 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.VisibleForTesting; + public final class CameraManager implements DeviceCameraControl, Camera.PreviewCallback { public class CameraInformation { diff --git a/catroid/src/main/java/org/catrobat/catroid/cast/CastManager.java b/catroid/src/main/java/org/catrobat/catroid/cast/CastManager.java index 42d2f858b65..d4fd2ec1779 100644 --- a/catroid/src/main/java/org/catrobat/catroid/cast/CastManager.java +++ b/catroid/src/main/java/org/catrobat/catroid/cast/CastManager.java @@ -29,10 +29,6 @@ import android.graphics.drawable.AnimationDrawable; import android.graphics.drawable.Drawable; import android.os.Handler; -import androidx.core.content.ContextCompat; -import androidx.appcompat.app.AppCompatActivity; -import androidx.mediarouter.media.MediaRouteSelector; -import androidx.mediarouter.media.MediaRouter; import android.view.HapticFeedbackConstants; import android.view.LayoutInflater; import android.view.MenuItem; @@ -65,6 +61,11 @@ import java.util.ArrayList; import java.util.EnumMap; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.content.ContextCompat; +import androidx.mediarouter.media.MediaRouteSelector; +import androidx.mediarouter.media.MediaRouter; + import static org.catrobat.catroid.common.Constants.CAST_IDLE_BACKGROUND_COLOR; public final class CastManager { diff --git a/catroid/src/main/java/org/catrobat/catroid/common/Constants.java b/catroid/src/main/java/org/catrobat/catroid/common/Constants.java index fe87482c2ec..bc4e4a076e3 100644 --- a/catroid/src/main/java/org/catrobat/catroid/common/Constants.java +++ b/catroid/src/main/java/org/catrobat/catroid/common/Constants.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.common; import android.os.Environment; -import androidx.annotation.IntDef; import org.catrobat.catroid.BuildConfig; import org.catrobat.catroid.CatroidApplication; @@ -33,6 +32,8 @@ import java.lang.annotation.RetentionPolicy; import java.util.Calendar; +import androidx.annotation.IntDef; + import static org.catrobat.catroid.common.FlavoredConstants.BASE_URL_HTTPS; public final class Constants { diff --git a/catroid/src/main/java/org/catrobat/catroid/common/LookData.java b/catroid/src/main/java/org/catrobat/catroid/common/LookData.java index 57e9ba5d553..1bf7470fd34 100644 --- a/catroid/src/main/java/org/catrobat/catroid/common/LookData.java +++ b/catroid/src/main/java/org/catrobat/catroid/common/LookData.java @@ -24,8 +24,6 @@ import android.graphics.Bitmap; import android.graphics.BitmapFactory; -import androidx.annotation.NonNull; -import androidx.annotation.VisibleForTesting; import android.util.Log; import com.badlogic.gdx.Gdx; @@ -46,6 +44,9 @@ import java.io.IOException; import java.io.Serializable; +import androidx.annotation.NonNull; +import androidx.annotation.VisibleForTesting; + public class LookData implements Cloneable, Nameable, Serializable { private static final long serialVersionUID = 1L; diff --git a/catroid/src/main/java/org/catrobat/catroid/common/SoundInfo.java b/catroid/src/main/java/org/catrobat/catroid/common/SoundInfo.java index 15bb22d17db..357cf487028 100644 --- a/catroid/src/main/java/org/catrobat/catroid/common/SoundInfo.java +++ b/catroid/src/main/java/org/catrobat/catroid/common/SoundInfo.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.common; -import androidx.annotation.NonNull; - import com.thoughtworks.xstream.annotations.XStreamAsAttribute; import org.catrobat.catroid.io.StorageOperations; @@ -32,6 +30,8 @@ import java.io.IOException; import java.io.Serializable; +import androidx.annotation.NonNull; + public class SoundInfo implements Cloneable, Nameable, Serializable { private static final long serialVersionUID = 1L; diff --git a/catroid/src/main/java/org/catrobat/catroid/common/ThreadScheduler.java b/catroid/src/main/java/org/catrobat/catroid/common/ThreadScheduler.java index 7dceeec0f3a..444e0c92e91 100644 --- a/catroid/src/main/java/org/catrobat/catroid/common/ThreadScheduler.java +++ b/catroid/src/main/java/org/catrobat/catroid/common/ThreadScheduler.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.common; -import androidx.annotation.IntDef; - import com.badlogic.gdx.scenes.scene2d.Action; import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.utils.Array; @@ -36,6 +34,8 @@ import java.lang.annotation.RetentionPolicy; import java.util.Iterator; +import androidx.annotation.IntDef; + public class ThreadScheduler { @Retention(RetentionPolicy.SOURCE) @IntDef({RUNNING, SUSPENDED}) diff --git a/catroid/src/main/java/org/catrobat/catroid/content/ConditionScriptTrigger.java b/catroid/src/main/java/org/catrobat/catroid/content/ConditionScriptTrigger.java index a8f57be36e8..df881f7c668 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/ConditionScriptTrigger.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/ConditionScriptTrigger.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.content; -import androidx.annotation.IntDef; import android.util.Log; import org.catrobat.catroid.content.eventids.WhenConditionEventId; @@ -33,6 +32,8 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; +import androidx.annotation.IntDef; + public class ConditionScriptTrigger { @Retention(RetentionPolicy.SOURCE) @IntDef({TRIGGER_NOW, ALREADY_TRIGGERED}) diff --git a/catroid/src/main/java/org/catrobat/catroid/content/EventWrapper.java b/catroid/src/main/java/org/catrobat/catroid/content/EventWrapper.java index a3ef23ef01a..dd5333585fe 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/EventWrapper.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/EventWrapper.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.content; -import androidx.annotation.IntDef; - import com.badlogic.gdx.scenes.scene2d.Event; import org.catrobat.catroid.content.eventids.EventId; @@ -33,6 +31,8 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.IntDef; + import static java.lang.annotation.RetentionPolicy.SOURCE; public class EventWrapper extends Event { diff --git a/catroid/src/main/java/org/catrobat/catroid/content/Look.java b/catroid/src/main/java/org/catrobat/catroid/content/Look.java index 108c8684826..1084cfc3a48 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/Look.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/Look.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.content; import android.graphics.PointF; -import androidx.annotation.IntDef; -import androidx.annotation.VisibleForTesting; import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.graphics.g2d.Batch; @@ -52,6 +50,9 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; +import androidx.annotation.IntDef; +import androidx.annotation.VisibleForTesting; + public class Look extends Image { @Retention(RetentionPolicy.SOURCE) diff --git a/catroid/src/main/java/org/catrobat/catroid/content/Scene.java b/catroid/src/main/java/org/catrobat/catroid/content/Scene.java index e3d940f79e7..cf27e547528 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/Scene.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/Scene.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.content; -import androidx.annotation.NonNull; - import com.thoughtworks.xstream.annotations.XStreamAlias; import org.catrobat.catroid.common.Nameable; @@ -42,6 +40,8 @@ import java.util.List; import java.util.Set; +import androidx.annotation.NonNull; + @XStreamAlias("scene") @XStreamFieldKeyOrder({ "name", diff --git a/catroid/src/main/java/org/catrobat/catroid/content/actions/EventThread.java b/catroid/src/main/java/org/catrobat/catroid/content/actions/EventThread.java index 8ed001b2b0b..c234b35b57d 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/actions/EventThread.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/actions/EventThread.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.content.actions; -import androidx.annotation.NonNull; - import com.badlogic.gdx.scenes.scene2d.Action; import org.catrobat.catroid.content.ActionFactory; @@ -32,6 +30,8 @@ import org.catrobat.catroid.content.Script; import org.catrobat.catroid.content.Sprite; +import androidx.annotation.NonNull; + public class EventThread extends ScriptSequenceAction { private NotifyEventWaiterAction notifyAction; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/actions/NextLookAction.java b/catroid/src/main/java/org/catrobat/catroid/content/actions/NextLookAction.java index 5ccb3668a02..dea0ada3ba0 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/actions/NextLookAction.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/actions/NextLookAction.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.content.actions; -import androidx.annotation.IntDef; - import com.badlogic.gdx.scenes.scene2d.actions.TemporalAction; import org.catrobat.catroid.ProjectManager; @@ -36,6 +34,8 @@ import java.lang.annotation.RetentionPolicy; import java.util.List; +import androidx.annotation.IntDef; + public class NextLookAction extends TemporalAction { @Retention(RetentionPolicy.SOURCE) diff --git a/catroid/src/main/java/org/catrobat/catroid/content/actions/ScriptSequenceAction.java b/catroid/src/main/java/org/catrobat/catroid/content/actions/ScriptSequenceAction.java index 216f6d22501..495321861df 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/actions/ScriptSequenceAction.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/actions/ScriptSequenceAction.java @@ -23,14 +23,14 @@ package org.catrobat.catroid.content.actions; -import androidx.annotation.NonNull; - import com.badlogic.gdx.scenes.scene2d.Action; import com.badlogic.gdx.scenes.scene2d.actions.SequenceAction; import org.catrobat.catroid.content.ActionFactory; import org.catrobat.catroid.content.Script; +import androidx.annotation.NonNull; + public class ScriptSequenceAction extends SequenceAction { protected final Script script; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/actions/WebRequestAction.java b/catroid/src/main/java/org/catrobat/catroid/content/actions/WebRequestAction.java index 51d370e7482..bbcfe2dd250 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/actions/WebRequestAction.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/actions/WebRequestAction.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.content.actions; -import androidx.annotation.IntDef; -import androidx.annotation.VisibleForTesting; import android.util.Log; import com.badlogic.gdx.scenes.scene2d.Action; @@ -39,6 +37,9 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; +import androidx.annotation.IntDef; +import androidx.annotation.VisibleForTesting; + public class WebRequestAction extends Action implements WebConnection.WebRequestListener { private static final Double ERROR_TOO_MANY_REQUESTS = 429d; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/Brick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/Brick.java index 3c41af85d45..019433e5526 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/Brick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/Brick.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import androidx.annotation.IntDef; import android.view.View; import android.widget.CheckBox; @@ -37,6 +36,8 @@ import java.util.HashSet; import java.util.List; +import androidx.annotation.IntDef; + public interface Brick extends Serializable, Cloneable { enum BrickField { diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/BrickBaseType.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/BrickBaseType.java index 1d37b1639b6..24d3eec5493 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/BrickBaseType.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/BrickBaseType.java @@ -23,10 +23,6 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import androidx.annotation.CallSuper; -import androidx.annotation.LayoutRes; -import androidx.annotation.Nullable; -import androidx.appcompat.app.AppCompatActivity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -40,6 +36,11 @@ import java.util.Collections; import java.util.List; +import androidx.annotation.CallSuper; +import androidx.annotation.LayoutRes; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; + public abstract class BrickBaseType implements Brick { private static final long serialVersionUID = 1L; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/BroadcastMessageBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/BroadcastMessageBrick.java index 535336565cc..6721f6aaefc 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/BroadcastMessageBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/BroadcastMessageBrick.java @@ -24,9 +24,6 @@ import android.content.Context; import android.content.DialogInterface; -import androidx.annotation.Nullable; -import androidx.annotation.VisibleForTesting; -import androidx.appcompat.app.AppCompatActivity; import android.view.View; import org.catrobat.catroid.ProjectManager; @@ -43,6 +40,10 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.Nullable; +import androidx.annotation.VisibleForTesting; +import androidx.appcompat.app.AppCompatActivity; + public abstract class BroadcastMessageBrick extends BrickBaseType implements BrickSpinner.OnItemSelectedListener { diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/CloneBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/CloneBrick.java index ee53c57169a..c0a0410291d 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/CloneBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/CloneBrick.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import androidx.annotation.Nullable; import android.view.View; import org.catrobat.catroid.ProjectManager; @@ -37,6 +36,8 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.Nullable; + public class CloneBrick extends BrickBaseType implements BrickSpinner.OnItemSelectedListener { private static final long serialVersionUID = 1L; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/ForeverBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/ForeverBrick.java index 7f4fb382609..b8816c9d15d 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/ForeverBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/ForeverBrick.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.content.bricks; -import androidx.annotation.VisibleForTesting; - import com.badlogic.gdx.scenes.scene2d.Action; import org.catrobat.catroid.R; @@ -35,6 +33,8 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.VisibleForTesting; + public class ForeverBrick extends BrickBaseType implements CompositeBrick { private transient EndBrick endBrick = new EndBrick(this); diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/FormulaBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/FormulaBrick.java index e898389a8c4..88a650096c1 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/FormulaBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/FormulaBrick.java @@ -24,8 +24,6 @@ import android.content.Context; import android.graphics.PorterDuff; -import androidx.annotation.CallSuper; -import androidx.annotation.VisibleForTesting; import android.util.Log; import android.view.View; import android.widget.TextView; @@ -45,6 +43,9 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.CallSuper; +import androidx.annotation.VisibleForTesting; + public abstract class FormulaBrick extends BrickBaseType implements View.OnClickListener { @XStreamAlias("formulaList") diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/GoToBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/GoToBrick.java index d78c559acad..2fbeb5d291c 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/GoToBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/GoToBrick.java @@ -24,7 +24,6 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import androidx.annotation.Nullable; import android.view.View; import org.catrobat.catroid.ProjectManager; @@ -39,6 +38,8 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.Nullable; + public class GoToBrick extends BrickBaseType implements BrickSpinner.OnItemSelectedListener { private static final long serialVersionUID = 1L; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/IfLogicBeginBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/IfLogicBeginBrick.java index f4eb651ca47..60d89a808d2 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/IfLogicBeginBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/IfLogicBeginBrick.java @@ -24,7 +24,6 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import androidx.annotation.VisibleForTesting; import android.view.View; import com.badlogic.gdx.scenes.scene2d.Action; @@ -38,6 +37,8 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.VisibleForTesting; + public class IfLogicBeginBrick extends FormulaBrick implements CompositeBrick { private static final long serialVersionUID = 1L; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/IfThenLogicBeginBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/IfThenLogicBeginBrick.java index 92fd5bb6037..2ebe6f8e134 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/IfThenLogicBeginBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/IfThenLogicBeginBrick.java @@ -24,7 +24,6 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import androidx.annotation.VisibleForTesting; import android.view.View; import com.badlogic.gdx.scenes.scene2d.Action; @@ -38,6 +37,8 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.VisibleForTesting; + public class IfThenLogicBeginBrick extends FormulaBrick implements CompositeBrick { private static final long serialVersionUID = 1L; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/PhiroIfLogicBeginBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/PhiroIfLogicBeginBrick.java index 13608a31f74..9fc4a940096 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/PhiroIfLogicBeginBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/PhiroIfLogicBeginBrick.java @@ -24,7 +24,6 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import androidx.annotation.VisibleForTesting; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; @@ -40,6 +39,8 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.VisibleForTesting; + public class PhiroIfLogicBeginBrick extends BrickBaseType implements CompositeBrick { private static final long serialVersionUID = 1L; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/PhiroRGBLightBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/PhiroRGBLightBrick.java index 3a289d3c7c1..6d5f57a10ed 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/PhiroRGBLightBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/PhiroRGBLightBrick.java @@ -24,7 +24,6 @@ import android.content.Context; import android.graphics.Color; -import androidx.appcompat.app.AppCompatActivity; import android.view.View; import android.widget.AdapterView; import android.widget.AdapterView.OnItemSelectedListener; @@ -40,6 +39,8 @@ import org.catrobat.catroid.formulaeditor.InterpretationException; import org.catrobat.catroid.ui.UiUtils; +import androidx.appcompat.app.AppCompatActivity; + public class PhiroRGBLightBrick extends FormulaBrick { private static final long serialVersionUID = 1L; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/PlaceAtBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/PlaceAtBrick.java index 93e51875367..4dae53e239e 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/PlaceAtBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/PlaceAtBrick.java @@ -25,8 +25,6 @@ import android.app.AlertDialog; import android.content.Context; import android.content.Intent; -import androidx.fragment.app.Fragment; -import androidx.appcompat.app.AppCompatActivity; import android.view.View; import org.catrobat.catroid.ProjectManager; @@ -40,6 +38,9 @@ import org.catrobat.catroid.ui.recyclerview.fragment.ScriptFragment; import org.catrobat.catroid.visualplacement.VisualPlacementActivity; +import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.Fragment; + import static org.catrobat.catroid.content.bricks.Brick.BrickField.X_POSITION; import static org.catrobat.catroid.content.bricks.Brick.BrickField.Y_POSITION; import static org.catrobat.catroid.ui.SpriteActivity.EXTRA_BRICK_HASH; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/PlaySoundBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/PlaySoundBrick.java index 1de52ef2a3d..033d29aa377 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/PlaySoundBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/PlaySoundBrick.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import androidx.annotation.Nullable; -import androidx.appcompat.app.AppCompatActivity; import android.view.View; import org.catrobat.catroid.ProjectManager; @@ -42,6 +40,9 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; + public class PlaySoundBrick extends BrickBaseType implements BrickSpinner.OnItemSelectedListener, NewItemInterface { diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/PointToBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/PointToBrick.java index 5e5d8dfe44a..5284cceb5b7 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/PointToBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/PointToBrick.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import androidx.annotation.Nullable; -import androidx.appcompat.app.AppCompatActivity; import android.view.View; import org.catrobat.catroid.ProjectManager; @@ -41,6 +39,9 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; + public class PointToBrick extends BrickBaseType implements BrickSpinner.OnItemSelectedListener, NewItemInterface { diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/RepeatBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/RepeatBrick.java index 6da1cf12201..042aff8dbae 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/RepeatBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/RepeatBrick.java @@ -24,7 +24,6 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import androidx.annotation.VisibleForTesting; import android.util.Log; import android.view.View; import android.widget.TextView; @@ -43,6 +42,8 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.VisibleForTesting; + public class RepeatBrick extends FormulaBrick implements CompositeBrick { private transient EndBrick endBrick = new EndBrick(this); diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/RepeatUntilBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/RepeatUntilBrick.java index d184ccad26d..30b520493b0 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/RepeatUntilBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/RepeatUntilBrick.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.content.bricks; -import androidx.annotation.VisibleForTesting; - import com.badlogic.gdx.scenes.scene2d.Action; import org.catrobat.catroid.R; @@ -36,6 +34,8 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.VisibleForTesting; + public class RepeatUntilBrick extends FormulaBrick implements CompositeBrick { private transient EndBrick endBrick = new EndBrick(this); diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SceneStartBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SceneStartBrick.java index b29bb2ed869..03f402039e5 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SceneStartBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SceneStartBrick.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import androidx.annotation.Nullable; -import androidx.appcompat.app.AppCompatActivity; import android.view.View; import org.catrobat.catroid.ProjectManager; @@ -44,6 +42,9 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; + public class SceneStartBrick extends BrickBaseType implements BrickSpinner.OnItemSelectedListener { private static final long serialVersionUID = 1L; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SceneTransitionBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SceneTransitionBrick.java index b2db9c89f1d..4071e8c565e 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SceneTransitionBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SceneTransitionBrick.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import androidx.annotation.Nullable; -import androidx.appcompat.app.AppCompatActivity; import android.view.View; import org.catrobat.catroid.ProjectManager; @@ -44,6 +42,9 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; + public class SceneTransitionBrick extends BrickBaseType implements BrickSpinner.OnItemSelectedListener { private static final long serialVersionUID = 1L; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetBackgroundBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetBackgroundBrick.java index a344932a1f6..ee1b82ecd2c 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetBackgroundBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetBackgroundBrick.java @@ -24,8 +24,6 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import androidx.annotation.Nullable; -import androidx.appcompat.app.AppCompatActivity; import android.view.View; import org.catrobat.catroid.ProjectManager; @@ -44,6 +42,9 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; + public class SetBackgroundBrick extends BrickBaseType implements BrickSpinner.OnItemSelectedListener, NewItemInterface { diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetLookBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetLookBrick.java index 067133b137d..ab2997893c9 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetLookBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetLookBrick.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import androidx.annotation.Nullable; -import androidx.appcompat.app.AppCompatActivity; import android.view.View; import org.catrobat.catroid.ProjectManager; @@ -43,6 +41,9 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; + public class SetLookBrick extends BrickBaseType implements BrickSpinner.OnItemSelectedListener, NewItemInterface { diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetNfcTagBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetNfcTagBrick.java index 405df6d3bc0..8fdf78ed566 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetNfcTagBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetNfcTagBrick.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import androidx.annotation.Nullable; import android.view.View; import org.catrobat.catroid.R; @@ -37,6 +36,8 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.Nullable; + public class SetNfcTagBrick extends FormulaBrick implements BrickSpinner.OnItemSelectedListener { diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetPenColorBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetPenColorBrick.java index 3ff1a560724..caa093736de 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetPenColorBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetPenColorBrick.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.content.bricks; import android.graphics.Color; -import androidx.appcompat.app.AppCompatActivity; import android.view.View; import org.catrobat.catroid.R; @@ -35,6 +34,8 @@ import org.catrobat.catroid.formulaeditor.InterpretationException; import org.catrobat.catroid.ui.UiUtils; +import androidx.appcompat.app.AppCompatActivity; + public class SetPenColorBrick extends FormulaBrick { private static final long serialVersionUID = 1L; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetPhysicsObjectTypeBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetPhysicsObjectTypeBrick.java index 9baa8ee6780..296a78a80e6 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetPhysicsObjectTypeBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetPhysicsObjectTypeBrick.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import androidx.annotation.VisibleForTesting; import android.view.View; import android.widget.AdapterView; import android.widget.AdapterView.OnItemSelectedListener; @@ -35,6 +34,8 @@ import org.catrobat.catroid.content.actions.ScriptSequenceAction; import org.catrobat.catroid.physics.PhysicsObject; +import androidx.annotation.VisibleForTesting; + public class SetPhysicsObjectTypeBrick extends BrickBaseType { private static final long serialVersionUID = 1L; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetRotationStyleBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetRotationStyleBrick.java index 649f0cf0c79..dac84712a03 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetRotationStyleBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/SetRotationStyleBrick.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import androidx.annotation.Nullable; import android.view.View; import org.catrobat.catroid.R; @@ -36,6 +35,8 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.Nullable; + import static org.catrobat.catroid.content.Look.ROTATION_STYLE_LEFT_RIGHT_ONLY; public class SetRotationStyleBrick extends BrickBaseType implements diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/ShowTextColorSizeAlignmentBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/ShowTextColorSizeAlignmentBrick.java index f34a4dadc6d..1acaf32cc8a 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/ShowTextColorSizeAlignmentBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/ShowTextColorSizeAlignmentBrick.java @@ -24,8 +24,6 @@ import android.content.Context; import android.graphics.Color; -import androidx.annotation.Nullable; -import androidx.appcompat.app.AppCompatActivity; import android.view.View; import org.catrobat.catroid.R; @@ -44,6 +42,9 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; + public class ShowTextColorSizeAlignmentBrick extends UserVariableBrickWithFormula { private static final long serialVersionUID = 1L; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/UserListBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/UserListBrick.java index a489fa82098..5e61e40bd99 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/UserListBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/UserListBrick.java @@ -26,9 +26,6 @@ import android.app.Dialog; import android.content.Context; import android.content.DialogInterface; -import androidx.annotation.IdRes; -import androidx.annotation.Nullable; -import androidx.appcompat.app.AppCompatActivity; import android.view.View; import android.widget.RadioButton; @@ -48,6 +45,10 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.IdRes; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; + public abstract class UserListBrick extends FormulaBrick implements BrickSpinner.OnItemSelectedListener { protected UserList userList; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/UserVariableBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/UserVariableBrick.java index 1f983641c7c..85721667556 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/UserVariableBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/UserVariableBrick.java @@ -24,9 +24,6 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import androidx.annotation.IdRes; -import androidx.annotation.Nullable; -import androidx.appcompat.app.AppCompatActivity; import android.view.View; import org.catrobat.catroid.ProjectManager; @@ -43,6 +40,10 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.IdRes; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; + public abstract class UserVariableBrick extends BrickBaseType implements UserVariableBrickInterface { protected UserVariable userVariable; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/UserVariableBrickWithFormula.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/UserVariableBrickWithFormula.java index 602b65b1b2f..3dc985c1c9d 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/UserVariableBrickWithFormula.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/UserVariableBrickWithFormula.java @@ -24,9 +24,6 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import androidx.annotation.IdRes; -import androidx.annotation.Nullable; -import androidx.appcompat.app.AppCompatActivity; import android.view.View; import org.catrobat.catroid.ProjectManager; @@ -43,6 +40,10 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.IdRes; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; + public abstract class UserVariableBrickWithFormula extends FormulaBrick implements UserVariableBrickInterface { protected UserVariable userVariable; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenBackgroundChangesBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenBackgroundChangesBrick.java index c3f7cd8415f..dfbeb0c4485 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenBackgroundChangesBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenBackgroundChangesBrick.java @@ -23,9 +23,6 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.appcompat.app.AppCompatActivity; import android.view.View; import org.catrobat.catroid.ProjectManager; @@ -45,6 +42,10 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; + public class WhenBackgroundChangesBrick extends BrickBaseType implements ScriptBrick, BrickSpinner.OnItemSelectedListener, NewItemInterface { diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenBounceOffBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenBounceOffBrick.java index 721be3f3903..d14e355a90b 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenBounceOffBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenBounceOffBrick.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import androidx.annotation.Nullable; import android.view.View; import org.catrobat.catroid.ProjectManager; @@ -39,6 +38,8 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.Nullable; + public class WhenBounceOffBrick extends ScriptBrickBaseType implements BrickSpinner.OnItemSelectedListener { private static final long serialVersionUID = 1L; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenBrick.java index 14c2488794d..1127916eb61 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenBrick.java @@ -22,14 +22,14 @@ */ package org.catrobat.catroid.content.bricks; -import androidx.annotation.NonNull; - import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; import org.catrobat.catroid.content.Sprite; import org.catrobat.catroid.content.WhenScript; import org.catrobat.catroid.content.actions.ScriptSequenceAction; +import androidx.annotation.NonNull; + public class WhenBrick extends ScriptBrickBaseType { private static final long serialVersionUID = 1L; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenGamepadButtonBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenGamepadButtonBrick.java index ffc34e013b5..1ac80ccc635 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenGamepadButtonBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenGamepadButtonBrick.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; import android.view.View; import org.catrobat.catroid.R; @@ -39,6 +37,9 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + public class WhenGamepadButtonBrick extends ScriptBrickBaseType implements BrickSpinner.OnItemSelectedListener { private static final long serialVersionUID = 1L; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenNfcBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenNfcBrick.java index cd2f84d96e0..5b341828e9f 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenNfcBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/WhenNfcBrick.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.content.bricks; import android.content.Context; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; import android.view.View; import org.catrobat.catroid.ProjectManager; @@ -42,6 +40,9 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + public class WhenNfcBrick extends ScriptBrickBaseType implements BrickSpinner.OnItemSelectedListener { private static final long serialVersionUID = 1L; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/brickspinner/BrickSpinner.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/brickspinner/BrickSpinner.java index d20bdb70843..aa04cc2ee0b 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/brickspinner/BrickSpinner.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/brickspinner/BrickSpinner.java @@ -24,9 +24,6 @@ package org.catrobat.catroid.content.bricks.brickspinner; import android.content.Context; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.annotation.VisibleForTesting; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; @@ -40,6 +37,10 @@ import java.util.List; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.VisibleForTesting; + public class BrickSpinner implements AdapterView.OnItemSelectedListener { private Spinner spinner; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/brickspinner/UserVariableBrickTextInputDialogBuilder.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/brickspinner/UserVariableBrickTextInputDialogBuilder.java index 041e015443e..36895e89380 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/brickspinner/UserVariableBrickTextInputDialogBuilder.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/brickspinner/UserVariableBrickTextInputDialogBuilder.java @@ -24,7 +24,6 @@ package org.catrobat.catroid.content.bricks.brickspinner; import android.app.Dialog; -import androidx.appcompat.app.AppCompatActivity; import android.widget.RadioButton; import org.catrobat.catroid.R; @@ -35,6 +34,8 @@ import org.catrobat.catroid.ui.recyclerview.dialog.textwatcher.NewItemTextWatcher; import org.catrobat.catroid.ui.recyclerview.fragment.ScriptFragment; +import androidx.appcompat.app.AppCompatActivity; + public class UserVariableBrickTextInputDialogBuilder extends TextInputDialog.Builder { public UserVariableBrickTextInputDialogBuilder(Project project, Sprite sprite, UserVariable currentUserVariable, diff --git a/catroid/src/main/java/org/catrobat/catroid/content/eventids/EventId.java b/catroid/src/main/java/org/catrobat/catroid/content/eventids/EventId.java index fd6d64df213..9d8337372b5 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/eventids/EventId.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/eventids/EventId.java @@ -22,11 +22,11 @@ */ package org.catrobat.catroid.content.eventids; -import androidx.annotation.IntDef; - import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; +import androidx.annotation.IntDef; + public class EventId { @Retention(RetentionPolicy.SOURCE) @IntDef({TAP, TAP_BACKGROUND, START, START_AS_CLONE, ANY_NFC, OTHER}) diff --git a/catroid/src/main/java/org/catrobat/catroid/content/eventids/NfcEventId.java b/catroid/src/main/java/org/catrobat/catroid/content/eventids/NfcEventId.java index ba68659d591..f01dd27fa30 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/eventids/NfcEventId.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/eventids/NfcEventId.java @@ -23,10 +23,10 @@ package org.catrobat.catroid.content.eventids; -import androidx.annotation.NonNull; - import com.google.common.base.Objects; +import androidx.annotation.NonNull; + public class NfcEventId extends EventId { final String tag; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/strategy/ShowColorPickerFormulaEditorStrategy.java b/catroid/src/main/java/org/catrobat/catroid/content/strategy/ShowColorPickerFormulaEditorStrategy.java index a71de01e27b..374e7107172 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/strategy/ShowColorPickerFormulaEditorStrategy.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/strategy/ShowColorPickerFormulaEditorStrategy.java @@ -23,10 +23,6 @@ package org.catrobat.catroid.content.strategy; -import androidx.fragment.app.Fragment; -import androidx.fragment.app.FragmentManager; -import androidx.appcompat.app.AlertDialog; -import androidx.appcompat.app.AppCompatActivity; import android.view.View; import org.catrobat.catroid.R; @@ -34,6 +30,11 @@ import org.catrobat.catroid.ui.recyclerview.fragment.ScriptFragment; import org.catrobat.paintroid.colorpicker.ColorPickerDialog; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; + import static androidx.fragment.app.DialogFragment.STYLE_NORMAL; public class ShowColorPickerFormulaEditorStrategy implements ShowFormulaEditorStrategy { diff --git a/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/NXTReply.java b/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/NXTReply.java index 22425036843..1d887134f9a 100644 --- a/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/NXTReply.java +++ b/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/NXTReply.java @@ -22,10 +22,10 @@ */ package org.catrobat.catroid.devices.mindstorms.nxt; -import androidx.annotation.VisibleForTesting; - import org.catrobat.catroid.devices.mindstorms.MindstormsReply; +import androidx.annotation.VisibleForTesting; + public class NXTReply extends MindstormsReply { public static final byte NO_ERROR = 0X0; diff --git a/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/sensors/NXTI2CSensor.java b/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/sensors/NXTI2CSensor.java index e84f98e46e9..19de28f7859 100644 --- a/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/sensors/NXTI2CSensor.java +++ b/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/sensors/NXTI2CSensor.java @@ -22,7 +22,6 @@ */ package org.catrobat.catroid.devices.mindstorms.nxt.sensors; -import androidx.annotation.VisibleForTesting; import android.util.Log; import org.catrobat.catroid.devices.mindstorms.MindstormsConnection; @@ -35,6 +34,8 @@ import org.catrobat.catroid.devices.mindstorms.nxt.NXTReply; import org.catrobat.catroid.utils.Stopwatch; +import androidx.annotation.VisibleForTesting; + public abstract class NXTI2CSensor extends NXTSensor { private byte address; diff --git a/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/sensors/NXTI2CUltraSonicSensor.java b/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/sensors/NXTI2CUltraSonicSensor.java index 5fc294bc0e3..d879dfb4aa2 100644 --- a/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/sensors/NXTI2CUltraSonicSensor.java +++ b/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/sensors/NXTI2CUltraSonicSensor.java @@ -22,13 +22,13 @@ */ package org.catrobat.catroid.devices.mindstorms.nxt.sensors; -import androidx.annotation.VisibleForTesting; - import org.catrobat.catroid.devices.mindstorms.MindstormsConnection; import org.catrobat.catroid.devices.mindstorms.MindstormsException; import java.util.Locale; +import androidx.annotation.VisibleForTesting; + public class NXTI2CUltraSonicSensor extends NXTI2CSensor { @VisibleForTesting diff --git a/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/sensors/NXTSensor.java b/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/sensors/NXTSensor.java index 1e1a8677e8b..accbb0684b1 100644 --- a/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/sensors/NXTSensor.java +++ b/catroid/src/main/java/org/catrobat/catroid/devices/mindstorms/nxt/sensors/NXTSensor.java @@ -22,7 +22,6 @@ */ package org.catrobat.catroid.devices.mindstorms.nxt.sensors; -import androidx.annotation.VisibleForTesting; import android.util.Log; import org.catrobat.catroid.devices.mindstorms.LegoSensor; @@ -36,6 +35,8 @@ import java.util.Locale; +import androidx.annotation.VisibleForTesting; + public abstract class NXTSensor implements LegoSensor { public enum Sensor { diff --git a/catroid/src/main/java/org/catrobat/catroid/drone/ardrone/DroneController.java b/catroid/src/main/java/org/catrobat/catroid/drone/ardrone/DroneController.java index 4154ecf7f2d..581358035ac 100644 --- a/catroid/src/main/java/org/catrobat/catroid/drone/ardrone/DroneController.java +++ b/catroid/src/main/java/org/catrobat/catroid/drone/ardrone/DroneController.java @@ -29,9 +29,6 @@ import android.content.IntentFilter; import android.content.ServiceConnection; import android.os.IBinder; -import androidx.annotation.IntDef; -import androidx.localbroadcastmanager.content.LocalBroadcastManager; -import androidx.appcompat.app.AlertDialog; import android.util.Log; import com.parrot.freeflight.drone.NavData; @@ -50,6 +47,10 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; +import androidx.annotation.IntDef; +import androidx.appcompat.app.AlertDialog; +import androidx.localbroadcastmanager.content.LocalBroadcastManager; + public class DroneController implements DroneConnectionChangeReceiverDelegate, DroneBatteryChangedReceiverDelegate, DroneEmergencyChangeReceiverDelegate { diff --git a/catroid/src/main/java/org/catrobat/catroid/drone/ardrone/DroneInitializer.java b/catroid/src/main/java/org/catrobat/catroid/drone/ardrone/DroneInitializer.java index 371905339a3..b156377a8b9 100644 --- a/catroid/src/main/java/org/catrobat/catroid/drone/ardrone/DroneInitializer.java +++ b/catroid/src/main/java/org/catrobat/catroid/drone/ardrone/DroneInitializer.java @@ -31,8 +31,6 @@ import android.content.ServiceConnection; import android.os.AsyncTask.Status; import android.os.IBinder; -import androidx.localbroadcastmanager.content.LocalBroadcastManager; -import androidx.appcompat.app.AlertDialog; import com.parrot.freeflight.receivers.DroneAvailabilityDelegate; import com.parrot.freeflight.receivers.DroneAvailabilityReceiver; @@ -48,6 +46,9 @@ import org.catrobat.catroid.stage.StageActivity; import org.catrobat.catroid.stage.StageResourceHolder; +import androidx.appcompat.app.AlertDialog; +import androidx.localbroadcastmanager.content.LocalBroadcastManager; + import static org.catrobat.catroid.CatroidApplication.getAppContext; import static org.catrobat.catroid.ui.settingsfragments.SettingsFragment.getDronePreferenceMapping; diff --git a/catroid/src/main/java/org/catrobat/catroid/drone/jumpingsumo/JumpingSumoDiscoverer.java b/catroid/src/main/java/org/catrobat/catroid/drone/jumpingsumo/JumpingSumoDiscoverer.java index 94abb2403de..e698d213c41 100644 --- a/catroid/src/main/java/org/catrobat/catroid/drone/jumpingsumo/JumpingSumoDiscoverer.java +++ b/catroid/src/main/java/org/catrobat/catroid/drone/jumpingsumo/JumpingSumoDiscoverer.java @@ -29,8 +29,6 @@ import android.content.ServiceConnection; import android.os.Handler; import android.os.IBinder; -import androidx.annotation.NonNull; -import androidx.localbroadcastmanager.content.LocalBroadcastManager; import android.util.Log; import com.parrot.arsdk.ardiscovery.ARDiscoveryDeviceNetService; @@ -45,6 +43,9 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.NonNull; +import androidx.localbroadcastmanager.content.LocalBroadcastManager; + import static org.catrobat.catroid.CatroidApplication.getAppContext; public class JumpingSumoDiscoverer { diff --git a/catroid/src/main/java/org/catrobat/catroid/drone/jumpingsumo/JumpingSumoInitializer.java b/catroid/src/main/java/org/catrobat/catroid/drone/jumpingsumo/JumpingSumoInitializer.java index e05a5c0ea70..85a797b5171 100644 --- a/catroid/src/main/java/org/catrobat/catroid/drone/jumpingsumo/JumpingSumoInitializer.java +++ b/catroid/src/main/java/org/catrobat/catroid/drone/jumpingsumo/JumpingSumoInitializer.java @@ -28,9 +28,6 @@ import android.net.Uri; import android.os.Environment; import android.os.Handler; -import androidx.annotation.NonNull; -import androidx.appcompat.app.AlertDialog; -import androidx.appcompat.app.AlertDialog.Builder; import android.util.Log; import com.parrot.arsdk.arcontroller.ARCONTROLLER_DEVICE_STATE_ENUM; @@ -61,6 +58,10 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AlertDialog.Builder; + import static org.catrobat.catroid.CatroidApplication.getAppContext; public final class JumpingSumoInitializer { diff --git a/catroid/src/main/java/org/catrobat/catroid/drone/jumpingsumo/SDCardModule.java b/catroid/src/main/java/org/catrobat/catroid/drone/jumpingsumo/SDCardModule.java index 51c85b105bd..4995d3bd33a 100644 --- a/catroid/src/main/java/org/catrobat/catroid/drone/jumpingsumo/SDCardModule.java +++ b/catroid/src/main/java/org/catrobat/catroid/drone/jumpingsumo/SDCardModule.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.drone.jumpingsumo; import android.os.Environment; -import androidx.annotation.NonNull; -import androidx.appcompat.app.AppCompatActivity; import android.util.Log; import com.parrot.arsdk.ardatatransfer.ARDATATRANSFER_ERROR_ENUM; @@ -40,6 +38,9 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; + public class SDCardModule extends AppCompatActivity{ private static final String TAG = "SDCardModule"; diff --git a/catroid/src/main/java/org/catrobat/catroid/facedetection/FaceDetectionHandler.java b/catroid/src/main/java/org/catrobat/catroid/facedetection/FaceDetectionHandler.java index d67193bb313..283b42253ec 100644 --- a/catroid/src/main/java/org/catrobat/catroid/facedetection/FaceDetectionHandler.java +++ b/catroid/src/main/java/org/catrobat/catroid/facedetection/FaceDetectionHandler.java @@ -23,12 +23,13 @@ package org.catrobat.catroid.facedetection; import android.hardware.Camera; -import androidx.annotation.VisibleForTesting; import android.util.Log; import org.catrobat.catroid.camera.CameraManager; import org.catrobat.catroid.formulaeditor.SensorCustomEventListener; +import androidx.annotation.VisibleForTesting; + public final class FaceDetectionHandler { private static final String TAG = FaceDetectionHandler.class.getSimpleName(); diff --git a/catroid/src/main/java/org/catrobat/catroid/facedetection/FaceDetector.java b/catroid/src/main/java/org/catrobat/catroid/facedetection/FaceDetector.java index 1c9a7762b3a..e049d2fbd55 100644 --- a/catroid/src/main/java/org/catrobat/catroid/facedetection/FaceDetector.java +++ b/catroid/src/main/java/org/catrobat/catroid/facedetection/FaceDetector.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.facedetection; import android.graphics.Point; -import androidx.annotation.VisibleForTesting; import org.catrobat.catroid.camera.CameraManager; import org.catrobat.catroid.common.ScreenValues; @@ -34,6 +33,8 @@ import java.util.LinkedList; import java.util.List; +import androidx.annotation.VisibleForTesting; + public abstract class FaceDetector { private List faceDetectedListeners = new LinkedList(); diff --git a/catroid/src/main/java/org/catrobat/catroid/facedetection/SlowFaceDetector.java b/catroid/src/main/java/org/catrobat/catroid/facedetection/SlowFaceDetector.java index a11f760b8d4..9eea38e07c1 100644 --- a/catroid/src/main/java/org/catrobat/catroid/facedetection/SlowFaceDetector.java +++ b/catroid/src/main/java/org/catrobat/catroid/facedetection/SlowFaceDetector.java @@ -32,11 +32,12 @@ import android.graphics.PointF; import android.media.FaceDetector; import android.media.FaceDetector.Face; -import androidx.annotation.VisibleForTesting; import org.catrobat.catroid.camera.CameraManager; import org.catrobat.catroid.camera.JpgPreviewCallback; +import androidx.annotation.VisibleForTesting; + public class SlowFaceDetector extends org.catrobat.catroid.facedetection.FaceDetector implements JpgPreviewCallback { private static final int NUMBER_OF_FACES = 1; diff --git a/catroid/src/main/java/org/catrobat/catroid/formulaeditor/InternFormula.java b/catroid/src/main/java/org/catrobat/catroid/formulaeditor/InternFormula.java index 3ffc6c9a7ff..494b7b80759 100644 --- a/catroid/src/main/java/org/catrobat/catroid/formulaeditor/InternFormula.java +++ b/catroid/src/main/java/org/catrobat/catroid/formulaeditor/InternFormula.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.formulaeditor; import android.content.Context; -import androidx.annotation.VisibleForTesting; import android.util.Log; import org.catrobat.catroid.R; @@ -31,6 +30,8 @@ import java.util.LinkedList; import java.util.List; +import androidx.annotation.VisibleForTesting; + public class InternFormula { private static final String TAG = InternFormula.class.getSimpleName(); diff --git a/catroid/src/main/java/org/catrobat/catroid/formulaeditor/SensorHandler.java b/catroid/src/main/java/org/catrobat/catroid/formulaeditor/SensorHandler.java index 5ba4b6abfc6..c9efdbd50df 100644 --- a/catroid/src/main/java/org/catrobat/catroid/formulaeditor/SensorHandler.java +++ b/catroid/src/main/java/org/catrobat/catroid/formulaeditor/SensorHandler.java @@ -33,7 +33,6 @@ import android.location.LocationManager; import android.os.Bundle; import android.os.SystemClock; -import androidx.annotation.VisibleForTesting; import android.util.Log; import android.view.Surface; import android.view.WindowManager; @@ -58,6 +57,8 @@ import java.util.Calendar; +import androidx.annotation.VisibleForTesting; + public final class SensorHandler implements SensorEventListener, SensorCustomEventListener, LocationListener, GpsStatus.Listener { private static final float RADIAN_TO_DEGREE_CONST = 180f / (float) Math.PI; diff --git a/catroid/src/main/java/org/catrobat/catroid/formulaeditor/SensorLoudness.java b/catroid/src/main/java/org/catrobat/catroid/formulaeditor/SensorLoudness.java index bd6be93c0fb..72e2017d9cc 100644 --- a/catroid/src/main/java/org/catrobat/catroid/formulaeditor/SensorLoudness.java +++ b/catroid/src/main/java/org/catrobat/catroid/formulaeditor/SensorLoudness.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.formulaeditor; import android.os.Handler; -import androidx.annotation.VisibleForTesting; import android.util.Log; import org.catrobat.catroid.soundrecorder.SoundRecorder; @@ -31,6 +30,8 @@ import java.io.IOException; import java.util.ArrayList; +import androidx.annotation.VisibleForTesting; + public class SensorLoudness { private static final int UPDATE_INTERVAL = 50; diff --git a/catroid/src/main/java/org/catrobat/catroid/io/DeviceUserDataAccessor.java b/catroid/src/main/java/org/catrobat/catroid/io/DeviceUserDataAccessor.java index 08b3af1752f..0fce09fdf18 100644 --- a/catroid/src/main/java/org/catrobat/catroid/io/DeviceUserDataAccessor.java +++ b/catroid/src/main/java/org/catrobat/catroid/io/DeviceUserDataAccessor.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.io; -import androidx.annotation.VisibleForTesting; import android.util.Log; import com.google.gson.Gson; @@ -49,6 +48,8 @@ import java.util.Set; import java.util.UUID; +import androidx.annotation.VisibleForTesting; + public abstract class DeviceUserDataAccessor { public static final String TAG = DeviceUserDataAccessor.class.getSimpleName(); diff --git a/catroid/src/main/java/org/catrobat/catroid/io/SoundManager.java b/catroid/src/main/java/org/catrobat/catroid/io/SoundManager.java index d48ddbdaa37..e6f24c9abf2 100644 --- a/catroid/src/main/java/org/catrobat/catroid/io/SoundManager.java +++ b/catroid/src/main/java/org/catrobat/catroid/io/SoundManager.java @@ -23,12 +23,13 @@ package org.catrobat.catroid.io; import android.media.MediaPlayer; -import androidx.annotation.VisibleForTesting; import android.util.Log; import java.util.ArrayList; import java.util.List; +import androidx.annotation.VisibleForTesting; + /** * As long as both OpenGL render() and StageDialog access the SoundManager, the public methods have to stay * synchronized. diff --git a/catroid/src/main/java/org/catrobat/catroid/io/XstreamSerializer.java b/catroid/src/main/java/org/catrobat/catroid/io/XstreamSerializer.java index e6d8e6803ad..27cde680ccc 100644 --- a/catroid/src/main/java/org/catrobat/catroid/io/XstreamSerializer.java +++ b/catroid/src/main/java/org/catrobat/catroid/io/XstreamSerializer.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.io; import android.content.Context; -import androidx.annotation.VisibleForTesting; import android.util.Log; import com.google.common.base.Charsets; @@ -242,6 +241,8 @@ import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; +import androidx.annotation.VisibleForTesting; + import static org.catrobat.catroid.common.Constants.CODE_XML_FILE_NAME; import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; diff --git a/catroid/src/main/java/org/catrobat/catroid/io/asynctask/ProjectExportTask.java b/catroid/src/main/java/org/catrobat/catroid/io/asynctask/ProjectExportTask.java index a2188f93dc2..30cc2f068d1 100644 --- a/catroid/src/main/java/org/catrobat/catroid/io/asynctask/ProjectExportTask.java +++ b/catroid/src/main/java/org/catrobat/catroid/io/asynctask/ProjectExportTask.java @@ -25,7 +25,6 @@ import android.content.Context; import android.os.AsyncTask; -import androidx.annotation.VisibleForTesting; import android.util.Log; import org.catrobat.catroid.R; @@ -37,6 +36,8 @@ import java.io.IOException; import java.lang.ref.WeakReference; +import androidx.annotation.VisibleForTesting; + import static org.catrobat.catroid.common.Constants.CATROBAT_EXTENSION; import static org.catrobat.catroid.common.Constants.EXTERNAL_STORAGE_ROOT_EXPORT_DIRECTORY; diff --git a/catroid/src/main/java/org/catrobat/catroid/merge/NewProjectNameTextWatcher.java b/catroid/src/main/java/org/catrobat/catroid/merge/NewProjectNameTextWatcher.java index 538743038b4..706909d6520 100644 --- a/catroid/src/main/java/org/catrobat/catroid/merge/NewProjectNameTextWatcher.java +++ b/catroid/src/main/java/org/catrobat/catroid/merge/NewProjectNameTextWatcher.java @@ -23,13 +23,14 @@ package org.catrobat.catroid.merge; import android.content.Context; -import androidx.annotation.Nullable; import org.catrobat.catroid.R; import org.catrobat.catroid.common.Nameable; import org.catrobat.catroid.ui.recyclerview.dialog.ReplaceExistingProjectDialogFragment; import org.catrobat.catroid.ui.recyclerview.dialog.TextInputDialog; +import androidx.annotation.Nullable; + public class NewProjectNameTextWatcher extends TextInputDialog.TextWatcher { @Nullable diff --git a/catroid/src/main/java/org/catrobat/catroid/physics/PhysicsObject.java b/catroid/src/main/java/org/catrobat/catroid/physics/PhysicsObject.java index 6cd64c1befa..677242fd717 100644 --- a/catroid/src/main/java/org/catrobat/catroid/physics/PhysicsObject.java +++ b/catroid/src/main/java/org/catrobat/catroid/physics/PhysicsObject.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.physics; -import androidx.annotation.VisibleForTesting; - import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.physics.box2d.Body; import com.badlogic.gdx.physics.box2d.BodyDef.BodyType; @@ -40,6 +38,8 @@ import java.util.Arrays; +import androidx.annotation.VisibleForTesting; + public class PhysicsObject { public enum Type { diff --git a/catroid/src/main/java/org/catrobat/catroid/physics/shapebuilder/PhysicsShapeScaleUtils.java b/catroid/src/main/java/org/catrobat/catroid/physics/shapebuilder/PhysicsShapeScaleUtils.java index 9814a4c2eab..d32b2a003f8 100644 --- a/catroid/src/main/java/org/catrobat/catroid/physics/shapebuilder/PhysicsShapeScaleUtils.java +++ b/catroid/src/main/java/org/catrobat/catroid/physics/shapebuilder/PhysicsShapeScaleUtils.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.physics.shapebuilder; -import androidx.annotation.VisibleForTesting; - import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.physics.box2d.PolygonShape; import com.badlogic.gdx.physics.box2d.Shape; @@ -32,6 +30,8 @@ import java.util.LinkedList; import java.util.List; +import androidx.annotation.VisibleForTesting; + public final class PhysicsShapeScaleUtils { public static final float COORDINATE_SCALING_DECIMAL_ACCURACY = 100.0f; diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/PocketMusicActivity.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/PocketMusicActivity.java index 957337a143c..31bf9cb8916 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/PocketMusicActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/PocketMusicActivity.java @@ -24,7 +24,6 @@ package org.catrobat.catroid.pocketmusic; import android.os.Bundle; -import androidx.appcompat.widget.Toolbar; import android.util.Log; import android.view.ViewGroup; @@ -49,6 +48,8 @@ import java.io.IOException; import java.util.Random; +import androidx.appcompat.widget.Toolbar; + import static org.catrobat.catroid.pocketmusic.note.midi.ProjectToMidiConverter.MIDI_FOLDER; public class PocketMusicActivity extends BaseActivity { diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/TactViewHolder.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/TactViewHolder.java index f25d5c34464..8f24f463267 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/TactViewHolder.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/TactViewHolder.java @@ -23,9 +23,10 @@ package org.catrobat.catroid.pocketmusic; -import androidx.recyclerview.widget.RecyclerView; import android.view.View; +import androidx.recyclerview.widget.RecyclerView; + public class TactViewHolder extends RecyclerView.ViewHolder { public TactViewHolder(View itemView) { super(itemView); diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/FastScroller.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/FastScroller.java index fb0d895b5a9..6c585ee00c6 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/FastScroller.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/FastScroller.java @@ -26,9 +26,6 @@ import android.content.Context; import android.content.res.TypedArray; import android.graphics.drawable.Drawable; -import androidx.core.graphics.drawable.DrawableCompat; -import androidx.core.widget.TextViewCompat; -import androidx.recyclerview.widget.LinearLayoutManager; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; @@ -40,6 +37,10 @@ import org.catrobat.catroid.pocketmusic.fastscroller.viewprovider.ScrollerViewProvider; import org.catrobat.catroid.pocketmusic.ui.TactScrollRecyclerView; +import androidx.core.graphics.drawable.DrawableCompat; +import androidx.core.widget.TextViewCompat; +import androidx.recyclerview.widget.LinearLayoutManager; + public class FastScroller extends LinearLayout { private static final int STYLE_NONE = -1; diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/viewprovider/DefaultScrollerViewProvider.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/viewprovider/DefaultScrollerViewProvider.java index ecb629c5f95..0a3e4f7a981 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/viewprovider/DefaultScrollerViewProvider.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/viewprovider/DefaultScrollerViewProvider.java @@ -24,7 +24,6 @@ package org.catrobat.catroid.pocketmusic.fastscroller.viewprovider; import android.graphics.drawable.InsetDrawable; -import androidx.core.content.ContextCompat; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -32,6 +31,8 @@ import org.catrobat.catroid.R; +import androidx.core.content.ContextCompat; + public class DefaultScrollerViewProvider extends ScrollerViewProvider { private View bubble; diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/viewprovider/ScrollerViewProvider.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/viewprovider/ScrollerViewProvider.java index 83d03f59e96..460c75306d4 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/viewprovider/ScrollerViewProvider.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/viewprovider/ScrollerViewProvider.java @@ -24,13 +24,14 @@ package org.catrobat.catroid.pocketmusic.fastscroller.viewprovider; import android.content.Context; -import androidx.annotation.Nullable; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import org.catrobat.catroid.pocketmusic.fastscroller.FastScroller; +import androidx.annotation.Nullable; + public abstract class ScrollerViewProvider { private FastScroller scroller; diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/viewprovider/VisibilityAnimationManager.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/viewprovider/VisibilityAnimationManager.java index 7b1d647b773..aa243ade3a6 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/viewprovider/VisibilityAnimationManager.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/fastscroller/viewprovider/VisibilityAnimationManager.java @@ -27,11 +27,12 @@ import android.animation.AnimatorInflater; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; -import androidx.annotation.AnimatorRes; import android.view.View; import org.catrobat.catroid.R; +import androidx.annotation.AnimatorRes; + public class VisibilityAnimationManager { protected final View view; diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/Track.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/Track.java index 3ecf1c322ba..d3db8bb80e1 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/Track.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/Track.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.pocketmusic.note; -import androidx.collection.LongSparseArray; - import java.io.Serializable; import java.util.Collections; import java.util.Comparator; @@ -32,6 +30,8 @@ import java.util.Set; import java.util.TreeSet; +import androidx.collection.LongSparseArray; + public class Track implements Serializable { private static final long serialVersionUID = 7483021689872527955L; diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/GridRow.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/GridRow.java index eab00245138..5135ff8fa7a 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/GridRow.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/GridRow.java @@ -22,12 +22,12 @@ */ package org.catrobat.catroid.pocketmusic.note.trackgrid; -import androidx.collection.SparseArrayCompat; - import org.catrobat.catroid.pocketmusic.note.NoteName; import java.util.List; +import androidx.collection.SparseArrayCompat; + public class GridRow { private final NoteName noteName; diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/TrackGrid.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/TrackGrid.java index fb3f0496266..d718c80fa74 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/TrackGrid.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/TrackGrid.java @@ -25,7 +25,6 @@ import android.os.Handler; import android.os.Looper; import android.os.SystemClock; -import androidx.collection.SparseArrayCompat; import android.util.Log; import org.catrobat.catroid.pocketmusic.mididriver.MidiNotePlayer; @@ -43,6 +42,8 @@ import java.util.ArrayList; import java.util.List; +import androidx.collection.SparseArrayCompat; + public class TrackGrid { private static final int INDEX_TO_COUNT_OFFSET = 1; diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/TrackGridToTrackConverter.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/TrackGridToTrackConverter.java index 1b64cbdb534..aa15ff55bb4 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/TrackGridToTrackConverter.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/TrackGridToTrackConverter.java @@ -22,13 +22,13 @@ */ package org.catrobat.catroid.pocketmusic.note.trackgrid; -import androidx.collection.SparseArrayCompat; - import org.catrobat.catroid.pocketmusic.note.NoteEvent; import org.catrobat.catroid.pocketmusic.note.Track; import java.util.List; +import androidx.collection.SparseArrayCompat; + public final class TrackGridToTrackConverter { private TrackGridToTrackConverter() { diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/TrackToTrackGridConverter.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/TrackToTrackGridConverter.java index c54ca54c67d..15a7c726b6e 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/TrackToTrackGridConverter.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/note/trackgrid/TrackToTrackGridConverter.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.pocketmusic.note.trackgrid; -import androidx.collection.SparseArrayCompat; - import org.catrobat.catroid.pocketmusic.note.MusicalBeat; import org.catrobat.catroid.pocketmusic.note.NoteEvent; import org.catrobat.catroid.pocketmusic.note.NoteLength; @@ -35,6 +33,8 @@ import java.util.List; import java.util.Map; +import androidx.collection.SparseArrayCompat; + public final class TrackToTrackGridConverter { private TrackToTrackGridConverter() { diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/NoteView.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/NoteView.java index 927d9e4bd45..40a8ff627c8 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/NoteView.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/NoteView.java @@ -26,13 +26,14 @@ import android.content.Context; import android.graphics.PorterDuff; import android.graphics.drawable.Drawable; -import androidx.core.content.ContextCompat; import android.view.View; import android.widget.ImageView; import org.catrobat.catroid.R; import org.catrobat.catroid.pocketmusic.note.NoteLength; +import androidx.core.content.ContextCompat; + @SuppressLint("AppCompatCustomView") public class NoteView extends ImageView implements View.OnClickListener { diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/PianoView.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/PianoView.java index 600a5ebdfee..1de85f894a4 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/PianoView.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/PianoView.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.pocketmusic.ui; import android.content.Context; -import androidx.core.content.ContextCompat; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; @@ -34,6 +33,8 @@ import java.util.ArrayList; import java.util.List; +import androidx.core.content.ContextCompat; + public class PianoView extends ViewGroup { private List whitePianoKeys = new ArrayList<>(); diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/TactScrollRecyclerView.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/TactScrollRecyclerView.java index 1f14a31eb5d..c24794861f7 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/TactScrollRecyclerView.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/TactScrollRecyclerView.java @@ -24,9 +24,6 @@ package org.catrobat.catroid.pocketmusic.ui; import android.content.Context; -import androidx.annotation.Nullable; -import androidx.recyclerview.widget.LinearLayoutManager; -import androidx.recyclerview.widget.RecyclerView; import android.util.AttributeSet; import android.util.Log; import android.view.LayoutInflater; @@ -47,6 +44,10 @@ import java.util.ArrayList; +import androidx.annotation.Nullable; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + public class TactScrollRecyclerView extends RecyclerView { private static final int TACTS_PER_SCREEN = 2; diff --git a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/TrackRowView.java b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/TrackRowView.java index 16c0389e8a1..1b3af8af6fa 100644 --- a/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/TrackRowView.java +++ b/catroid/src/main/java/org/catrobat/catroid/pocketmusic/ui/TrackRowView.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.pocketmusic.ui; import android.content.Context; -import androidx.core.content.ContextCompat; import android.widget.TableRow; import org.catrobat.catroid.R; @@ -37,6 +36,8 @@ import java.util.ArrayList; import java.util.List; +import androidx.core.content.ContextCompat; + public class TrackRowView extends TableRow { public static final int QUARTER_COUNT = 4; diff --git a/catroid/src/main/java/org/catrobat/catroid/scratchconverter/Client.java b/catroid/src/main/java/org/catrobat/catroid/scratchconverter/Client.java index f4b8c7f8767..096d73c94b1 100644 --- a/catroid/src/main/java/org/catrobat/catroid/scratchconverter/Client.java +++ b/catroid/src/main/java/org/catrobat/catroid/scratchconverter/Client.java @@ -23,14 +23,14 @@ package org.catrobat.catroid.scratchconverter; -import androidx.annotation.Nullable; - import com.google.android.gms.common.images.WebImage; import org.catrobat.catroid.scratchconverter.protocol.Job; import java.util.Date; +import androidx.annotation.Nullable; + public interface Client { enum State { diff --git a/catroid/src/main/java/org/catrobat/catroid/scratchconverter/ConversionManager.java b/catroid/src/main/java/org/catrobat/catroid/scratchconverter/ConversionManager.java index 3f4cc253cd9..1cda36443eb 100644 --- a/catroid/src/main/java/org/catrobat/catroid/scratchconverter/ConversionManager.java +++ b/catroid/src/main/java/org/catrobat/catroid/scratchconverter/ConversionManager.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.scratchconverter; -import androidx.appcompat.app.AppCompatActivity; - import com.google.android.gms.common.images.WebImage; import org.catrobat.catroid.scratchconverter.Client.ConnectAuthCallback; @@ -33,6 +31,8 @@ import org.catrobat.catroid.ui.scratchconverter.BaseInfoViewListener; import org.catrobat.catroid.ui.scratchconverter.JobViewListener; +import androidx.appcompat.app.AppCompatActivity; + public interface ConversionManager extends ConnectAuthCallback, ConvertCallback, ProjectDownloadCallback { void setCurrentActivity(AppCompatActivity activity); diff --git a/catroid/src/main/java/org/catrobat/catroid/scratchconverter/ScratchConversionManager.java b/catroid/src/main/java/org/catrobat/catroid/scratchconverter/ScratchConversionManager.java index fca479e9397..75d9465ca66 100644 --- a/catroid/src/main/java/org/catrobat/catroid/scratchconverter/ScratchConversionManager.java +++ b/catroid/src/main/java/org/catrobat/catroid/scratchconverter/ScratchConversionManager.java @@ -29,10 +29,6 @@ import android.content.SharedPreferences; import android.content.res.Resources; import android.preference.PreferenceManager; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.appcompat.app.AlertDialog; -import androidx.appcompat.app.AppCompatActivity; import android.util.Log; import com.google.android.gms.common.images.WebImage; @@ -60,6 +56,11 @@ import java.util.Map; import java.util.Set; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AppCompatActivity; + import static org.catrobat.catroid.common.SharedPreferenceKeys.SCRATCH_CONVERTER_CLIENT_ID_PREFERENCE_KEY; import static org.catrobat.catroid.common.SharedPreferenceKeys.SCRATCH_CONVERTER_DOWNLOAD_STATE_PREFERENCE_KEY; diff --git a/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/JobHandler.java b/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/JobHandler.java index 4e2ec80638c..6487b119376 100644 --- a/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/JobHandler.java +++ b/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/JobHandler.java @@ -24,7 +24,6 @@ package org.catrobat.catroid.scratchconverter.protocol; import android.net.Uri; -import androidx.annotation.NonNull; import android.util.Log; import com.google.android.gms.common.images.WebImage; @@ -43,6 +42,8 @@ import org.catrobat.catroid.scratchconverter.protocol.message.job.JobReadyMessage; import org.catrobat.catroid.scratchconverter.protocol.message.job.JobRunningMessage; +import androidx.annotation.NonNull; + public class JobHandler implements Client.ProjectDownloadCallback { private static final String TAG = JobHandler.class.getSimpleName(); diff --git a/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/message/base/BaseMessage.java b/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/message/base/BaseMessage.java index 103cee715fa..705639e246d 100644 --- a/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/message/base/BaseMessage.java +++ b/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/message/base/BaseMessage.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.scratchconverter.protocol.message.base; -import androidx.annotation.Nullable; import android.util.SparseArray; import org.catrobat.catroid.scratchconverter.protocol.Job; @@ -37,6 +36,8 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.Nullable; + public abstract class BaseMessage extends Message { public enum Type { diff --git a/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/message/job/JobMessage.java b/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/message/job/JobMessage.java index b549a926f12..de73c5b1201 100644 --- a/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/message/job/JobMessage.java +++ b/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/message/job/JobMessage.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.scratchconverter.protocol.message.job; -import androidx.annotation.Nullable; import android.util.Log; import android.util.SparseArray; @@ -44,6 +43,8 @@ import java.util.Locale; import java.util.TimeZone; +import androidx.annotation.Nullable; + public abstract class JobMessage extends Message { private static final String TAG = JobMessage.class.getSimpleName(); diff --git a/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/message/job/JobOutputMessage.java b/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/message/job/JobOutputMessage.java index 07e2c36b2d7..3fb743570ff 100644 --- a/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/message/job/JobOutputMessage.java +++ b/catroid/src/main/java/org/catrobat/catroid/scratchconverter/protocol/message/job/JobOutputMessage.java @@ -23,10 +23,10 @@ package org.catrobat.catroid.scratchconverter.protocol.message.job; -import androidx.annotation.NonNull; - import java.util.Arrays; +import androidx.annotation.NonNull; + public class JobOutputMessage extends JobMessage { private final String[] lines; diff --git a/catroid/src/main/java/org/catrobat/catroid/sensing/CollisionInformation.java b/catroid/src/main/java/org/catrobat/catroid/sensing/CollisionInformation.java index 5268e18ae2b..d3c116b3f7f 100644 --- a/catroid/src/main/java/org/catrobat/catroid/sensing/CollisionInformation.java +++ b/catroid/src/main/java/org/catrobat/catroid/sensing/CollisionInformation.java @@ -27,8 +27,6 @@ import android.graphics.BitmapFactory; import android.graphics.Matrix; import android.graphics.PointF; -import androidx.annotation.VisibleForTesting; -import androidx.core.util.Pair; import android.util.Log; import com.badlogic.gdx.math.Polygon; @@ -43,6 +41,8 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; +import androidx.annotation.VisibleForTesting; +import androidx.core.util.Pair; import ar.com.hjg.pngj.PngjInputException; public class CollisionInformation { diff --git a/catroid/src/main/java/org/catrobat/catroid/soundrecorder/SoundRecorderActivity.java b/catroid/src/main/java/org/catrobat/catroid/soundrecorder/SoundRecorderActivity.java index 6caa8f82c45..706c0e6cc82 100644 --- a/catroid/src/main/java/org/catrobat/catroid/soundrecorder/SoundRecorderActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/soundrecorder/SoundRecorderActivity.java @@ -26,9 +26,6 @@ import android.net.Uri; import android.os.Bundle; import android.os.SystemClock; -import androidx.core.content.FileProvider; -import androidx.appcompat.app.AppCompatActivity; -import androidx.appcompat.widget.Toolbar; import android.util.Log; import android.view.MenuItem; import android.view.View; @@ -44,6 +41,10 @@ import java.io.IOException; import java.util.Arrays; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; +import androidx.core.content.FileProvider; + import static android.Manifest.permission.RECORD_AUDIO; import static org.catrobat.catroid.common.Constants.SOUND_RECORDER_CACHE_DIR; diff --git a/catroid/src/main/java/org/catrobat/catroid/stage/ShowBubbleActor.java b/catroid/src/main/java/org/catrobat/catroid/stage/ShowBubbleActor.java index 8ddfdd499b8..960120904e0 100644 --- a/catroid/src/main/java/org/catrobat/catroid/stage/ShowBubbleActor.java +++ b/catroid/src/main/java/org/catrobat/catroid/stage/ShowBubbleActor.java @@ -30,8 +30,6 @@ import android.graphics.Path; import android.graphics.Rect; import android.graphics.RectF; -import androidx.annotation.VisibleForTesting; -import androidx.core.util.Pair; import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.graphics.Texture; @@ -50,6 +48,9 @@ import java.util.ArrayList; import java.util.Arrays; +import androidx.annotation.VisibleForTesting; +import androidx.core.util.Pair; + public class ShowBubbleActor extends Actor { ArrayList bubbleValue; private Sprite sprite; diff --git a/catroid/src/main/java/org/catrobat/catroid/stage/StageActivity.java b/catroid/src/main/java/org/catrobat/catroid/stage/StageActivity.java index 90a367e8dd5..b3706bc02dc 100644 --- a/catroid/src/main/java/org/catrobat/catroid/stage/StageActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/stage/StageActivity.java @@ -35,7 +35,6 @@ import android.os.Looper; import android.os.Message; import android.speech.RecognizerIntent; -import androidx.annotation.NonNull; import android.util.Log; import android.util.SparseArray; import android.view.ContextThemeWrapper; @@ -77,6 +76,8 @@ import java.util.List; import java.util.Random; +import androidx.annotation.NonNull; + import static org.catrobat.catroid.stage.StageListener.SCREENSHOT_AUTOMATIC_FILE_NAME; import static org.catrobat.catroid.stage.TestResult.TEST_RESULT_MESSAGE; diff --git a/catroid/src/main/java/org/catrobat/catroid/stage/StageListener.java b/catroid/src/main/java/org/catrobat/catroid/stage/StageListener.java index 93c27955cf9..2c21ff8aa0a 100644 --- a/catroid/src/main/java/org/catrobat/catroid/stage/StageListener.java +++ b/catroid/src/main/java/org/catrobat/catroid/stage/StageListener.java @@ -26,7 +26,6 @@ import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.os.SystemClock; -import androidx.annotation.VisibleForTesting; import android.util.DisplayMetrics; import com.badlogic.gdx.ApplicationListener; @@ -94,6 +93,8 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; +import androidx.annotation.VisibleForTesting; + import static org.catrobat.catroid.common.Constants.DEFAULT_IMAGE_EXTENSION; import static org.catrobat.catroid.common.ScreenValues.SCREEN_HEIGHT; import static org.catrobat.catroid.common.ScreenValues.SCREEN_WIDTH; diff --git a/catroid/src/main/java/org/catrobat/catroid/stage/StageResourceHolder.java b/catroid/src/main/java/org/catrobat/catroid/stage/StageResourceHolder.java index 716b3a11865..f4e6a56105e 100644 --- a/catroid/src/main/java/org/catrobat/catroid/stage/StageResourceHolder.java +++ b/catroid/src/main/java/org/catrobat/catroid/stage/StageResourceHolder.java @@ -33,7 +33,6 @@ import android.os.Vibrator; import android.preference.PreferenceManager; import android.provider.Settings; -import androidx.annotation.VisibleForTesting; import android.text.Html; import android.util.Log; import android.view.View; @@ -76,6 +75,8 @@ import java.util.List; import java.util.Set; +import androidx.annotation.VisibleForTesting; + import static android.app.Activity.RESULT_CANCELED; import static android.app.Activity.RESULT_OK; import static android.content.Context.VIBRATOR_SERVICE; diff --git a/catroid/src/main/java/org/catrobat/catroid/stage/TextToSpeechHolder.java b/catroid/src/main/java/org/catrobat/catroid/stage/TextToSpeechHolder.java index b82ad1ad66f..531257dbb2c 100644 --- a/catroid/src/main/java/org/catrobat/catroid/stage/TextToSpeechHolder.java +++ b/catroid/src/main/java/org/catrobat/catroid/stage/TextToSpeechHolder.java @@ -26,7 +26,6 @@ import android.content.DialogInterface; import android.content.Intent; import android.speech.tts.TextToSpeech; -import androidx.appcompat.app.AlertDialog; import android.util.Log; import org.catrobat.catroid.R; @@ -36,6 +35,8 @@ import java.io.File; import java.util.HashMap; +import androidx.appcompat.app.AlertDialog; + public final class TextToSpeechHolder { private static final String TAG = TextToSpeechHolder.class.getSimpleName(); diff --git a/catroid/src/main/java/org/catrobat/catroid/transfers/CheckOAuthTokenTask.java b/catroid/src/main/java/org/catrobat/catroid/transfers/CheckOAuthTokenTask.java index a769089e4ea..231f13b871a 100644 --- a/catroid/src/main/java/org/catrobat/catroid/transfers/CheckOAuthTokenTask.java +++ b/catroid/src/main/java/org/catrobat/catroid/transfers/CheckOAuthTokenTask.java @@ -25,7 +25,6 @@ import android.app.Activity; import android.app.ProgressDialog; import android.os.AsyncTask; -import androidx.appcompat.app.AlertDialog; import android.util.Log; import org.catrobat.catroid.R; @@ -33,6 +32,8 @@ import org.catrobat.catroid.web.CatrobatServerCalls; import org.catrobat.catroid.web.WebconnectionException; +import androidx.appcompat.app.AlertDialog; + public class CheckOAuthTokenTask extends AsyncTask { private static final String TAG = CheckOAuthTokenTask.class.getSimpleName(); diff --git a/catroid/src/main/java/org/catrobat/catroid/transfers/DeleteTestUserTask.java b/catroid/src/main/java/org/catrobat/catroid/transfers/DeleteTestUserTask.java index 8c94206fc26..52a156a1544 100644 --- a/catroid/src/main/java/org/catrobat/catroid/transfers/DeleteTestUserTask.java +++ b/catroid/src/main/java/org/catrobat/catroid/transfers/DeleteTestUserTask.java @@ -24,7 +24,6 @@ import android.content.Context; import android.os.AsyncTask; -import androidx.appcompat.app.AlertDialog; import android.util.Log; import org.catrobat.catroid.R; @@ -32,6 +31,8 @@ import org.catrobat.catroid.web.CatrobatServerCalls; import org.catrobat.catroid.web.WebconnectionException; +import androidx.appcompat.app.AlertDialog; + public class DeleteTestUserTask extends AsyncTask { private static final String TAG = DeleteTestUserTask.class.getSimpleName(); diff --git a/catroid/src/main/java/org/catrobat/catroid/transfers/GoogleExchangeCodeTask.java b/catroid/src/main/java/org/catrobat/catroid/transfers/GoogleExchangeCodeTask.java index 82030ff43ff..f933e43fce3 100644 --- a/catroid/src/main/java/org/catrobat/catroid/transfers/GoogleExchangeCodeTask.java +++ b/catroid/src/main/java/org/catrobat/catroid/transfers/GoogleExchangeCodeTask.java @@ -26,7 +26,6 @@ import android.app.ProgressDialog; import android.content.Context; import android.os.AsyncTask; -import androidx.appcompat.app.AlertDialog; import android.util.Log; import org.catrobat.catroid.R; @@ -35,6 +34,8 @@ import org.catrobat.catroid.web.ServerCalls; import org.catrobat.catroid.web.WebconnectionException; +import androidx.appcompat.app.AlertDialog; + public class GoogleExchangeCodeTask extends AsyncTask { private static final String TAG = GoogleExchangeCodeTask.class.getSimpleName(); diff --git a/catroid/src/main/java/org/catrobat/catroid/transfers/GoogleLogInTask.java b/catroid/src/main/java/org/catrobat/catroid/transfers/GoogleLogInTask.java index cea12f9b369..44cc7cdd50e 100644 --- a/catroid/src/main/java/org/catrobat/catroid/transfers/GoogleLogInTask.java +++ b/catroid/src/main/java/org/catrobat/catroid/transfers/GoogleLogInTask.java @@ -26,7 +26,6 @@ import android.app.ProgressDialog; import android.content.Context; import android.os.AsyncTask; -import androidx.appcompat.app.AlertDialog; import android.util.Log; import org.catrobat.catroid.R; @@ -36,6 +35,8 @@ import org.catrobat.catroid.web.ServerCalls; import org.catrobat.catroid.web.WebconnectionException; +import androidx.appcompat.app.AlertDialog; + public class GoogleLogInTask extends AsyncTask { private static final String TAG = GoogleLogInTask.class.getSimpleName(); diff --git a/catroid/src/main/java/org/catrobat/catroid/transfers/project/ProjectUploadService.kt b/catroid/src/main/java/org/catrobat/catroid/transfers/project/ProjectUploadService.kt index 6465f993cbc..1517a23e6e2 100644 --- a/catroid/src/main/java/org/catrobat/catroid/transfers/project/ProjectUploadService.kt +++ b/catroid/src/main/java/org/catrobat/catroid/transfers/project/ProjectUploadService.kt @@ -32,8 +32,8 @@ import android.content.Intent import android.os.Bundle import android.os.ResultReceiver import android.preference.PreferenceManager -import androidx.core.app.NotificationCompat import android.util.Log +import androidx.core.app.NotificationCompat import org.catrobat.catroid.R import org.catrobat.catroid.common.Constants import org.catrobat.catroid.common.Constants.CATROBAT_EXTENSION diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/BaseActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/BaseActivity.java index c5a7afe325f..1d64e9fcb2c 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/BaseActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/BaseActivity.java @@ -26,8 +26,6 @@ import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; -import androidx.annotation.NonNull; -import androidx.appcompat.app.AppCompatActivity; import android.util.Log; import android.view.MenuItem; @@ -43,6 +41,9 @@ import org.catrobat.catroid.ui.settingsfragments.SettingsFragment; import org.catrobat.catroid.utils.CrashReporter; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; + public abstract class BaseActivity extends AppCompatActivity implements PermissionHandlingActivity { private static boolean savedInstanceStateExpected; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/ImportLaunchers.kt b/catroid/src/main/java/org/catrobat/catroid/ui/ImportLaunchers.kt index fc0dbff8f8a..6edd11494fe 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/ImportLaunchers.kt +++ b/catroid/src/main/java/org/catrobat/catroid/ui/ImportLaunchers.kt @@ -31,8 +31,8 @@ import android.net.Uri import android.os.Bundle import android.provider.MediaStore import android.provider.MediaStore.ACTION_IMAGE_CAPTURE -import androidx.core.content.FileProvider import androidx.appcompat.app.AppCompatActivity +import androidx.core.content.FileProvider import org.catrobat.catroid.ProjectManager import org.catrobat.catroid.R import org.catrobat.catroid.common.Constants.CAMERA_CACHE_DIR diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/MainMenuActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/MainMenuActivity.java index 8a92eecfbfc..206c5ae85bb 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/MainMenuActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/MainMenuActivity.java @@ -27,7 +27,6 @@ import android.net.Uri; import android.os.Bundle; import android.preference.PreferenceManager; -import androidx.appcompat.app.AlertDialog; import android.text.Html; import android.text.Spannable; import android.text.SpannableString; @@ -64,6 +63,7 @@ import javax.inject.Inject; +import androidx.appcompat.app.AlertDialog; import dagger.android.AndroidInjection; import static org.catrobat.catroid.common.FlavoredConstants.DEFAULT_ROOT_DIRECTORY; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/MarketingActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/MarketingActivity.java index cf76cc82b9c..c2af3a4544c 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/MarketingActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/MarketingActivity.java @@ -30,7 +30,6 @@ import android.graphics.BitmapFactory; import android.net.Uri; import android.os.Bundle; -import androidx.appcompat.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.view.Window; @@ -47,6 +46,8 @@ import java.util.List; +import androidx.appcompat.app.AppCompatActivity; + import static org.catrobat.catroid.common.Constants.MAIN_URL_HTTPS; @SuppressLint("SetJavaScriptEnabled") diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/ProjectActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/ProjectActivity.java index 8ebd94bad41..ddf20d813b0 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/ProjectActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/ProjectActivity.java @@ -29,10 +29,6 @@ import android.net.Uri; import android.os.Bundle; import android.preference.PreferenceManager; -import androidx.fragment.app.DialogFragment; -import androidx.fragment.app.Fragment; -import androidx.fragment.app.FragmentTransaction; -import androidx.appcompat.app.AlertDialog; import android.util.Log; import android.view.Menu; import android.view.MenuItem; @@ -64,6 +60,11 @@ import java.io.File; import java.io.IOException; +import androidx.appcompat.app.AlertDialog; +import androidx.fragment.app.DialogFragment; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentTransaction; + import static org.catrobat.catroid.common.Constants.DEFAULT_IMAGE_EXTENSION; import static org.catrobat.catroid.common.Constants.EV3; import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/ProjectListActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/ProjectListActivity.java index 07cf6aa254c..63949e38829 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/ProjectListActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/ProjectListActivity.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.ui; import android.os.Bundle; -import androidx.fragment.app.Fragment; import android.view.Menu; import android.view.View; @@ -32,6 +31,8 @@ import org.catrobat.catroid.ui.recyclerview.dialog.NewProjectDialogFragment; import org.catrobat.catroid.ui.recyclerview.fragment.ProjectListFragment; +import androidx.fragment.app.Fragment; + public class ProjectListActivity extends BaseCastActivity { @Override diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/ProjectUploadActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/ProjectUploadActivity.java index af6691dda81..3f86d4f19cc 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/ProjectUploadActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/ProjectUploadActivity.java @@ -32,8 +32,6 @@ import android.os.Bundle; import android.os.Handler; import android.preference.PreferenceManager; -import com.google.android.material.textfield.TextInputLayout; -import androidx.appcompat.app.AlertDialog; import android.text.Editable; import android.text.TextWatcher; import android.util.Log; @@ -44,6 +42,8 @@ import android.widget.ImageView; import android.widget.TextView; +import com.google.android.material.textfield.TextInputLayout; + import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.common.Constants; @@ -67,6 +67,8 @@ import java.util.ArrayList; import java.util.List; +import androidx.appcompat.app.AlertDialog; + import static org.catrobat.catroid.common.Constants.EXTRA_PROJECT_ID; import static org.catrobat.catroid.common.Constants.PLAY_STORE_PAGE_LINK; import static org.catrobat.catroid.common.Constants.SHARE_PROGRAM_URL; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/ScratchConverterActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/ScratchConverterActivity.java index 040a31799e4..3bb2fd96d04 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/ScratchConverterActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/ScratchConverterActivity.java @@ -25,10 +25,6 @@ import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; -import androidx.annotation.IntDef; -import androidx.annotation.NonNull; -import androidx.fragment.app.FragmentTransaction; -import androidx.appcompat.widget.Toolbar; import android.text.Spannable; import android.text.SpannableString; import android.text.style.ForegroundColorSpan; @@ -54,6 +50,11 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.IntDef; +import androidx.annotation.NonNull; +import androidx.appcompat.widget.Toolbar; +import androidx.fragment.app.FragmentTransaction; + import static org.catrobat.catroid.common.SharedPreferenceKeys.SCRATCH_CONVERTER_CLIENT_ID_PREFERENCE_KEY; public class ScratchConverterActivity extends BaseActivity implements diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/ScratchProgramDetailsActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/ScratchProgramDetailsActivity.java index 659a03ce1c4..bd0e78140fa 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/ScratchProgramDetailsActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/ScratchProgramDetailsActivity.java @@ -28,9 +28,6 @@ import android.os.AsyncTask; import android.os.Bundle; import android.os.Parcelable; -import androidx.annotation.NonNull; -import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; import android.text.Spannable; import android.text.SpannableString; import android.text.style.ForegroundColorSpan; @@ -65,6 +62,10 @@ import java.util.ArrayList; import java.util.Locale; +import androidx.annotation.NonNull; +import androidx.appcompat.widget.Toolbar; +import androidx.recyclerview.widget.RecyclerView; + import static org.catrobat.catroid.utils.NumberFormats.humanFriendlyFormattedShortNumber; public class ScratchProgramDetailsActivity extends BaseActivity implements diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/SettingsActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/SettingsActivity.java index c7463d98ed7..9f123224e14 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/SettingsActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/SettingsActivity.java @@ -24,12 +24,13 @@ package org.catrobat.catroid.ui; import android.os.Bundle; -import androidx.appcompat.widget.Toolbar; import org.catrobat.catroid.R; import org.catrobat.catroid.ui.settingsfragments.AccessibilitySettingsFragment; import org.catrobat.catroid.ui.settingsfragments.SettingsFragment; +import androidx.appcompat.widget.Toolbar; + import static org.catrobat.catroid.ui.settingsfragments.AccessibilityProfilesFragment.SETTINGS_FRAGMENT_INTENT_KEY; public class SettingsActivity extends BaseActivity { diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/SpriteActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/SpriteActivity.java index 5b4cdfc7cab..7218dbd9204 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/SpriteActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/SpriteActivity.java @@ -25,9 +25,6 @@ import android.content.Intent; import android.net.Uri; import android.os.Bundle; -import androidx.fragment.app.Fragment; -import androidx.fragment.app.FragmentTransaction; -import androidx.appcompat.app.AlertDialog; import android.util.Log; import android.view.Menu; import android.view.MenuItem; @@ -71,6 +68,10 @@ import java.util.ArrayList; import java.util.List; +import androidx.appcompat.app.AlertDialog; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentTransaction; + import static org.catrobat.catroid.common.Constants.DEFAULT_IMAGE_EXTENSION; import static org.catrobat.catroid.common.Constants.DEFAULT_SOUND_EXTENSION; import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/SpriteAttributesActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/SpriteAttributesActivity.java index 6d3ef393c94..56694750bea 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/SpriteAttributesActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/SpriteAttributesActivity.java @@ -27,11 +27,6 @@ import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; -import androidx.annotation.IntDef; -import androidx.core.content.ContextCompat; -import androidx.recyclerview.widget.DividerItemDecoration; -import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import android.view.View; @@ -53,6 +48,12 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.IntDef; +import androidx.appcompat.widget.Toolbar; +import androidx.core.content.ContextCompat; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.RecyclerView; + public class SpriteAttributesActivity extends BaseActivity implements ButtonAdapter.OnItemClickListener { @Retention(RetentionPolicy.SOURCE) diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/UiUtils.java b/catroid/src/main/java/org/catrobat/catroid/ui/UiUtils.java index b849ac3e310..124014e4bba 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/UiUtils.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/UiUtils.java @@ -25,9 +25,10 @@ import android.content.Context; import android.content.ContextWrapper; +import android.view.View; + import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; -import android.view.View; public final class UiUtils { diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/WebViewActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/WebViewActivity.java index d940853e06e..c5309da5939 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/WebViewActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/WebViewActivity.java @@ -32,8 +32,6 @@ import android.net.Uri; import android.os.Bundle; import android.os.Environment; -import androidx.core.content.res.ResourcesCompat; -import androidx.appcompat.app.AppCompatActivity; import android.util.Log; import android.view.KeyEvent; import android.webkit.CookieManager; @@ -53,6 +51,9 @@ import java.io.File; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.content.res.ResourcesCompat; + import static org.catrobat.catroid.common.Constants.CATROBAT_HELP_URL; import static org.catrobat.catroid.common.Constants.MAIN_URL_HTTPS; import static org.catrobat.catroid.common.Constants.MEDIA_LIBRARY_CACHE_DIR; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/adapter/CastDevicesAdapter.java b/catroid/src/main/java/org/catrobat/catroid/ui/adapter/CastDevicesAdapter.java index 20a98797b5a..662aa680fac 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/adapter/CastDevicesAdapter.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/adapter/CastDevicesAdapter.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.ui.adapter; import android.content.Context; -import androidx.mediarouter.media.MediaRouter; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -35,6 +34,8 @@ import java.util.List; +import androidx.mediarouter.media.MediaRouter; + public class CastDevicesAdapter extends ArrayAdapter { public CastDevicesAdapter(Context context, int resource, List items) { diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/FormulaEditorComputeDialog.java b/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/FormulaEditorComputeDialog.java index 10677c06a48..50fe79f879a 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/FormulaEditorComputeDialog.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/FormulaEditorComputeDialog.java @@ -27,7 +27,6 @@ import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.os.Bundle; -import androidx.appcompat.app.AlertDialog; import android.view.MotionEvent; import android.view.ViewGroup; import android.widget.TextView; @@ -46,6 +45,8 @@ import org.catrobat.catroid.formulaeditor.SensorHandler; import org.catrobat.catroid.formulaeditor.SensorLoudness; +import androidx.appcompat.app.AlertDialog; + import static org.catrobat.catroid.utils.NumberFormats.stringWithoutTrailingZero; public class FormulaEditorComputeDialog extends AlertDialog implements SensorEventListener { diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/LegoSensorConfigInfoDialog.java b/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/LegoSensorConfigInfoDialog.java index 70ac297b960..13eb64d9ea7 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/LegoSensorConfigInfoDialog.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/LegoSensorConfigInfoDialog.java @@ -27,8 +27,6 @@ import android.content.DialogInterface; import android.os.Bundle; import android.preference.PreferenceManager; -import androidx.fragment.app.DialogFragment; -import androidx.appcompat.app.AlertDialog; import android.view.View; import android.widget.CheckBox; import android.widget.TextView; @@ -38,6 +36,9 @@ import org.catrobat.catroid.common.Constants.LegoSensorType; import org.catrobat.catroid.ui.settingsfragments.SettingsFragment; +import androidx.appcompat.app.AlertDialog; +import androidx.fragment.app.DialogFragment; + import static org.catrobat.catroid.ui.settingsfragments.SettingsFragment.SETTINGS_MINDSTORMS_EV3_SHOW_SENSOR_INFO_BOX_DISABLED; import static org.catrobat.catroid.ui.settingsfragments.SettingsFragment.SETTINGS_MINDSTORMS_NXT_SHOW_SENSOR_INFO_BOX_DISABLED; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/LegoSensorPortConfigDialog.java b/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/LegoSensorPortConfigDialog.java index 2a4adfbd601..e3be5d9b800 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/LegoSensorPortConfigDialog.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/LegoSensorPortConfigDialog.java @@ -24,9 +24,6 @@ import android.content.Context; import android.content.DialogInterface; -import androidx.annotation.NonNull; -import androidx.annotation.StringRes; -import androidx.appcompat.app.AlertDialog; import com.google.common.collect.ImmutableMap; @@ -38,6 +35,10 @@ import java.util.Map; +import androidx.annotation.NonNull; +import androidx.annotation.StringRes; +import androidx.appcompat.app.AlertDialog; + public final class LegoSensorPortConfigDialog extends AlertDialog { private LegoSensorPortConfigDialog(@NonNull Context context) { diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/ScratchReconvertDialog.java b/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/ScratchReconvertDialog.java index edb971bfa65..6a2c9e668a0 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/ScratchReconvertDialog.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/ScratchReconvertDialog.java @@ -27,8 +27,6 @@ import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; -import androidx.fragment.app.DialogFragment; -import androidx.appcompat.app.AlertDialog; import android.util.Log; import android.view.KeyEvent; import android.view.View; @@ -41,6 +39,9 @@ import java.util.Date; import java.util.concurrent.TimeUnit; +import androidx.appcompat.app.AlertDialog; +import androidx.fragment.app.DialogFragment; + public class ScratchReconvertDialog extends DialogFragment { public interface ReconvertDialogCallback { void onDownloadExistingProgram(); diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/SelectCastDialog.java b/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/SelectCastDialog.java index 9b125476408..895c6ddebd7 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/SelectCastDialog.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/SelectCastDialog.java @@ -26,9 +26,6 @@ import android.content.DialogInterface; import android.os.Bundle; import android.os.Handler; -import androidx.fragment.app.DialogFragment; -import androidx.appcompat.app.AlertDialog; -import androidx.mediarouter.media.MediaRouter; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; @@ -39,6 +36,10 @@ import org.catrobat.catroid.cast.CastManager; import org.catrobat.catroid.common.Constants; +import androidx.appcompat.app.AlertDialog; +import androidx.fragment.app.DialogFragment; +import androidx.mediarouter.media.MediaRouter; + public class SelectCastDialog extends DialogFragment { public static final String TAG = SelectCastDialog.class.getSimpleName(); diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/TermsOfUseDialogFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/TermsOfUseDialogFragment.java index 95ef9f07b79..72348fc5d72 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/TermsOfUseDialogFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/dialogs/TermsOfUseDialogFragment.java @@ -25,8 +25,6 @@ import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; -import androidx.fragment.app.DialogFragment; -import androidx.appcompat.app.AlertDialog; import android.text.Html; import android.text.method.LinkMovementMethod; import android.view.View; @@ -35,6 +33,9 @@ import org.catrobat.catroid.R; import org.catrobat.catroid.common.Constants; +import androidx.appcompat.app.AlertDialog; +import androidx.fragment.app.DialogFragment; + public class TermsOfUseDialogFragment extends DialogFragment { public static final String TAG = TermsOfUseDialogFragment.class.getSimpleName(); diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/dragndrop/BrickListView.java b/catroid/src/main/java/org/catrobat/catroid/ui/dragndrop/BrickListView.java index 10bb63318c5..c549bcacbbc 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/dragndrop/BrickListView.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/dragndrop/BrickListView.java @@ -30,8 +30,6 @@ import android.graphics.Color; import android.graphics.Rect; import android.graphics.drawable.BitmapDrawable; -import androidx.annotation.NonNull; -import androidx.annotation.VisibleForTesting; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; @@ -43,6 +41,9 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.NonNull; +import androidx.annotation.VisibleForTesting; + import static android.animation.ValueAnimator.REVERSE; import static android.view.MotionEvent.ACTION_CANCEL; import static android.view.MotionEvent.ACTION_DOWN; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/filepicker/FilePickerActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/filepicker/FilePickerActivity.java index 0afe93f95b3..fce97ed660f 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/filepicker/FilePickerActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/filepicker/FilePickerActivity.java @@ -26,8 +26,6 @@ import android.content.Intent; import android.net.Uri; import android.os.Bundle; -import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; import android.view.View; import org.catrobat.catroid.R; @@ -40,6 +38,9 @@ import java.util.Arrays; import java.util.List; +import androidx.appcompat.widget.Toolbar; +import androidx.recyclerview.widget.RecyclerView; + import static android.Manifest.permission.READ_EXTERNAL_STORAGE; public class FilePickerActivity extends BaseActivity implements ListProjectFilesTask.OnListProjectFilesListener { diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/filepicker/FilePickerAdapter.java b/catroid/src/main/java/org/catrobat/catroid/ui/filepicker/FilePickerAdapter.java index 2b09611ccca..819aba1e156 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/filepicker/FilePickerAdapter.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/filepicker/FilePickerAdapter.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.ui.filepicker; -import androidx.annotation.NonNull; -import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -34,6 +32,9 @@ import java.io.File; import java.util.List; +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + public class FilePickerAdapter extends RecyclerView.Adapter { private List items; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/AddBrickFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/AddBrickFragment.java index 9a1e5b0ba80..281409925b1 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/AddBrickFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/AddBrickFragment.java @@ -25,11 +25,6 @@ import android.content.Context; import android.os.Bundle; import android.preference.PreferenceManager; -import androidx.fragment.app.Fragment; -import androidx.fragment.app.FragmentTransaction; -import androidx.fragment.app.ListFragment; -import androidx.appcompat.app.ActionBar; -import androidx.appcompat.app.AppCompatActivity; import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; @@ -50,6 +45,12 @@ import java.util.List; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentTransaction; +import androidx.fragment.app.ListFragment; + import static org.catrobat.catroid.ui.settingsfragments.AccessibilityProfile.BEGINNER_BRICKS; public class AddBrickFragment extends ListFragment { diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/AddUserBrickFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/AddUserBrickFragment.java index b34581c3aa5..87a0457a2c0 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/AddUserBrickFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/AddUserBrickFragment.java @@ -24,14 +24,15 @@ package org.catrobat.catroid.ui.fragment; import android.os.Bundle; -import androidx.fragment.app.ListFragment; -import androidx.appcompat.app.AppCompatActivity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import org.catrobat.catroid.R; +import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.ListFragment; + public class AddUserBrickFragment extends ListFragment { public static final String ADD_USER_BRICK_FRAGMENT_TAG = AddBrickFragment.class.getSimpleName(); diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/BrickCategoryFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/BrickCategoryFragment.java index e4dafa6af92..62126ff20d8 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/BrickCategoryFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/BrickCategoryFragment.java @@ -24,10 +24,6 @@ import android.os.Bundle; import android.preference.PreferenceManager; -import androidx.fragment.app.FragmentManager; -import androidx.fragment.app.ListFragment; -import androidx.appcompat.app.ActionBar; -import androidx.appcompat.app.AppCompatActivity; import android.view.LayoutInflater; import android.view.Menu; import android.view.View; @@ -49,6 +45,11 @@ import java.util.List; import java.util.concurrent.locks.Lock; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.ListFragment; + import static org.catrobat.catroid.ui.settingsfragments.AccessibilityProfile.BEGINNER_BRICKS; public class BrickCategoryFragment extends ListFragment { diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/FormulaEditorFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/FormulaEditorFragment.java index dd90d889a1f..21db8d3e236 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/FormulaEditorFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/FormulaEditorFragment.java @@ -30,13 +30,6 @@ import android.os.Bundle; import android.os.Handler; import android.provider.Settings; -import androidx.annotation.NonNull; -import androidx.annotation.VisibleForTesting; -import androidx.fragment.app.Fragment; -import androidx.fragment.app.FragmentManager; -import androidx.appcompat.app.ActionBar; -import androidx.appcompat.app.AlertDialog; -import androidx.appcompat.app.AppCompatActivity; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; @@ -81,6 +74,14 @@ import java.util.List; import java.util.Map; +import androidx.annotation.NonNull; +import androidx.annotation.VisibleForTesting; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; + import static org.catrobat.catroid.utils.SnackbarUtil.wasHintAlreadyShown; public class FormulaEditorFragment extends Fragment implements ViewTreeObserver.OnGlobalLayoutListener, diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/ProjectDetailsFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/ProjectDetailsFragment.java index 54c0c1687b1..1d17476cded 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/ProjectDetailsFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/ProjectDetailsFragment.java @@ -24,7 +24,6 @@ import android.content.DialogInterface; import android.os.Bundle; -import androidx.fragment.app.Fragment; import android.text.format.DateFormat; import android.text.format.DateUtils; import android.util.Log; @@ -51,6 +50,8 @@ import java.io.IOException; import java.util.Date; +import androidx.fragment.app.Fragment; + import static org.catrobat.catroid.common.FlavoredConstants.DEFAULT_ROOT_DIRECTORY; public class ProjectDetailsFragment extends Fragment { diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/RVButton.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/RVButton.java index e7898751c4e..5d4448b429a 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/RVButton.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/RVButton.java @@ -24,6 +24,7 @@ package org.catrobat.catroid.ui.recyclerview; import android.graphics.drawable.Drawable; + import androidx.annotation.Nullable; public class RVButton { diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/BrickAdapter.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/BrickAdapter.java index e43fc5367c2..d14da4e7b5f 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/BrickAdapter.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/BrickAdapter.java @@ -26,7 +26,6 @@ import android.graphics.ColorMatrix; import android.graphics.ColorMatrixColorFilter; import android.graphics.drawable.Drawable; -import androidx.annotation.IntDef; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; @@ -47,6 +46,8 @@ import java.util.Collections; import java.util.List; +import androidx.annotation.IntDef; + public class BrickAdapter extends BaseAdapter implements BrickAdapterInterface, AdapterView.OnItemClickListener, diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/ButtonAdapter.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/ButtonAdapter.java index a4926e02c01..4bd4efea687 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/ButtonAdapter.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/ButtonAdapter.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.ui.recyclerview.adapter; -import androidx.annotation.NonNull; -import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -35,6 +33,9 @@ import java.util.List; +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + public class ButtonAdapter extends RecyclerView.Adapter { public List items; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/CategoryListRVAdapter.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/CategoryListRVAdapter.java index 0d484eadc43..f80d253dd23 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/CategoryListRVAdapter.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/CategoryListRVAdapter.java @@ -23,11 +23,6 @@ package org.catrobat.catroid.ui.recyclerview.adapter; -import androidx.annotation.IntDef; -import androidx.annotation.LayoutRes; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -40,6 +35,12 @@ import java.lang.annotation.RetentionPolicy; import java.util.List; +import androidx.annotation.IntDef; +import androidx.annotation.LayoutRes; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.recyclerview.widget.RecyclerView; + public class CategoryListRVAdapter extends RecyclerView.Adapter { @Retention(RetentionPolicy.SOURCE) diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/DataListAdapter.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/DataListAdapter.java index 17845d17336..a1edc089296 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/DataListAdapter.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/DataListAdapter.java @@ -23,10 +23,6 @@ package org.catrobat.catroid.ui.recyclerview.adapter; -import androidx.annotation.IntDef; -import androidx.annotation.LayoutRes; -import androidx.annotation.NonNull; -import androidx.recyclerview.widget.RecyclerView; import android.view.ViewGroup; import android.widget.TextView; @@ -45,6 +41,11 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.IntDef; +import androidx.annotation.LayoutRes; +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + public class DataListAdapter extends RecyclerView.Adapter implements RVAdapter.SelectionListener { public boolean allowMultiSelection = true; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/MultiViewSpriteAdapter.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/MultiViewSpriteAdapter.java index fa4004ddede..c666f04620c 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/MultiViewSpriteAdapter.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/MultiViewSpriteAdapter.java @@ -26,7 +26,6 @@ import android.content.Context; import android.graphics.Bitmap; import android.graphics.drawable.Drawable; -import androidx.annotation.IntDef; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -44,6 +43,8 @@ import java.util.List; import java.util.Locale; +import androidx.annotation.IntDef; + public class MultiViewSpriteAdapter extends SpriteAdapter { public static final String TAG = MultiViewSpriteAdapter.class.getSimpleName(); diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/RVAdapter.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/RVAdapter.java index e487e231172..b0c8ed7b04d 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/RVAdapter.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/RVAdapter.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.ui.recyclerview.adapter; -import androidx.annotation.IntDef; -import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -41,6 +39,9 @@ import java.util.Collections; import java.util.List; +import androidx.annotation.IntDef; +import androidx.recyclerview.widget.RecyclerView; + public abstract class RVAdapter extends RecyclerView.Adapter implements TouchHelperAdapterInterface { @Retention(RetentionPolicy.SOURCE) diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/draganddrop/TouchHelperCallback.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/draganddrop/TouchHelperCallback.java index 670ea0d02f3..88e8b35bb02 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/draganddrop/TouchHelperCallback.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/adapter/draganddrop/TouchHelperCallback.java @@ -23,11 +23,11 @@ package org.catrobat.catroid.ui.recyclerview.adapter.draganddrop; -import androidx.recyclerview.widget.RecyclerView; -import androidx.recyclerview.widget.ItemTouchHelper; - import org.catrobat.catroid.R; +import androidx.recyclerview.widget.ItemTouchHelper; +import androidx.recyclerview.widget.RecyclerView; + public class TouchHelperCallback extends ItemTouchHelper.Callback { public static final String TAG = TouchHelperCallback.class.getSimpleName(); diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackActivity.java index c087cffb1db..de60df2e4cb 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackActivity.java @@ -26,13 +26,14 @@ import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.Bundle; -import androidx.fragment.app.FragmentTransaction; -import androidx.appcompat.widget.Toolbar; import android.view.Menu; import org.catrobat.catroid.R; import org.catrobat.catroid.ui.BaseActivity; +import androidx.appcompat.widget.Toolbar; +import androidx.fragment.app.FragmentTransaction; + public class BackpackActivity extends BaseActivity { public static final String TAG = BackpackActivity.class.getSimpleName(); diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackLookFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackLookFragment.java index 6a2c53e94a5..2df0628476b 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackLookFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackLookFragment.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.ui.recyclerview.backpack; -import androidx.annotation.PluralsRes; import android.util.Log; import org.catrobat.catroid.ProjectManager; @@ -38,6 +37,8 @@ import java.io.IOException; import java.util.List; +import androidx.annotation.PluralsRes; + import static org.catrobat.catroid.common.SharedPreferenceKeys.SHOW_DETAILS_LOOKS_PREFERENCE_KEY; public class BackpackLookFragment extends BackpackRecyclerViewFragment { diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackRecyclerViewFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackRecyclerViewFragment.java index 63cda0d92fd..4f7d2964b5b 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackRecyclerViewFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackRecyclerViewFragment.java @@ -26,12 +26,6 @@ import android.content.DialogInterface; import android.os.Bundle; import android.preference.PreferenceManager; -import androidx.annotation.IntDef; -import androidx.annotation.PluralsRes; -import androidx.fragment.app.Fragment; -import androidx.appcompat.app.AlertDialog; -import androidx.recyclerview.widget.RecyclerView; -import androidx.recyclerview.widget.ItemTouchHelper; import android.view.ActionMode; import android.view.LayoutInflater; import android.view.Menu; @@ -52,6 +46,13 @@ import java.util.Collections; import java.util.List; +import androidx.annotation.IntDef; +import androidx.annotation.PluralsRes; +import androidx.appcompat.app.AlertDialog; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.ItemTouchHelper; +import androidx.recyclerview.widget.RecyclerView; + public abstract class BackpackRecyclerViewFragment extends Fragment implements ActionMode.Callback, RVAdapter.SelectionListener, diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackSceneFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackSceneFragment.java index b0dc4ac1fae..ee80c2d8055 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackSceneFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackSceneFragment.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.ui.recyclerview.backpack; -import androidx.annotation.PluralsRes; import android.util.Log; import org.catrobat.catroid.ProjectManager; @@ -38,6 +37,8 @@ import java.io.IOException; import java.util.List; +import androidx.annotation.PluralsRes; + import static org.catrobat.catroid.common.SharedPreferenceKeys.SHOW_DETAILS_SCENES_PREFERENCE_KEY; public class BackpackSceneFragment extends BackpackRecyclerViewFragment { diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackScriptFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackScriptFragment.java index d2e35e2377b..4f751b71f49 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackScriptFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackScriptFragment.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.ui.recyclerview.backpack; -import androidx.annotation.PluralsRes; import android.util.Log; import org.catrobat.catroid.ProjectManager; @@ -36,6 +35,8 @@ import java.util.List; +import androidx.annotation.PluralsRes; + public class BackpackScriptFragment extends BackpackRecyclerViewFragment { public static final String TAG = BackpackScriptFragment.class.getSimpleName(); diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackSoundFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackSoundFragment.java index 77d262ce6f9..ab65ec18aca 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackSoundFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackSoundFragment.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.ui.recyclerview.backpack; -import androidx.annotation.PluralsRes; import android.util.Log; import org.catrobat.catroid.ProjectManager; @@ -38,6 +37,8 @@ import java.io.IOException; import java.util.List; +import androidx.annotation.PluralsRes; + import static org.catrobat.catroid.common.SharedPreferenceKeys.SHOW_DETAILS_SOUNDS_PREFERENCE_KEY; public class BackpackSoundFragment extends BackpackRecyclerViewFragment { diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackSpriteFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackSpriteFragment.java index 3ebbe6bb734..3b237e75bb7 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackSpriteFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/backpack/BackpackSpriteFragment.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.ui.recyclerview.backpack; -import androidx.annotation.PluralsRes; import android.util.Log; import org.catrobat.catroid.ProjectManager; @@ -39,6 +38,8 @@ import java.io.IOException; import java.util.List; +import androidx.annotation.PluralsRes; + import static org.catrobat.catroid.common.SharedPreferenceKeys.SHOW_DETAILS_SPRITES_PREFERENCE_KEY; public class BackpackSpriteFragment extends BackpackRecyclerViewFragment { diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/controller/BrickController.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/controller/BrickController.java index 4fcf0ce96ec..81815d2ff41 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/controller/BrickController.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/controller/BrickController.java @@ -23,7 +23,6 @@ package org.catrobat.catroid.ui.recyclerview.controller; -import androidx.annotation.NonNull; import android.util.Log; import org.catrobat.catroid.content.Script; @@ -33,6 +32,8 @@ import java.util.List; +import androidx.annotation.NonNull; + public final class BrickController { private static final String TAG = BrickController.class.getSimpleName(); diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/AboutDialogFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/AboutDialogFragment.java index 7256296e2f9..722a0c8deeb 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/AboutDialogFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/AboutDialogFragment.java @@ -24,8 +24,6 @@ import android.app.Dialog; import android.os.Bundle; -import androidx.fragment.app.DialogFragment; -import androidx.appcompat.app.AlertDialog; import android.text.Html; import android.text.method.LinkMovementMethod; import android.view.View; @@ -35,6 +33,9 @@ import org.catrobat.catroid.common.Constants; import org.catrobat.catroid.utils.Utils; +import androidx.appcompat.app.AlertDialog; +import androidx.fragment.app.DialogFragment; + public class AboutDialogFragment extends DialogFragment { public static final String TAG = AboutDialogFragment.class.getSimpleName(); diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/NewProjectDialogFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/NewProjectDialogFragment.java index 06b3ad2412f..0c465857c03 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/NewProjectDialogFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/NewProjectDialogFragment.java @@ -25,7 +25,6 @@ import android.app.Dialog; import android.content.Intent; import android.os.Bundle; -import androidx.fragment.app.DialogFragment; import android.view.View; import android.widget.RadioGroup; @@ -39,6 +38,8 @@ import java.io.IOException; +import androidx.fragment.app.DialogFragment; + import static org.catrobat.catroid.common.DefaultProjectHandler.ProjectCreatorType.PROJECT_CREATOR_DRONE; import static org.catrobat.catroid.common.DefaultProjectHandler.ProjectCreatorType.PROJECT_CREATOR_JUMPING_SUMO; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/OrientationDialogFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/OrientationDialogFragment.java index 48435c45a10..b1391060659 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/OrientationDialogFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/OrientationDialogFragment.java @@ -26,9 +26,6 @@ import android.app.Dialog; import android.content.Intent; import android.os.Bundle; -import androidx.annotation.Nullable; -import androidx.fragment.app.DialogFragment; -import androidx.appcompat.app.AlertDialog; import android.view.View; import android.widget.RadioGroup; @@ -40,6 +37,10 @@ import java.io.IOException; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AlertDialog; +import androidx.fragment.app.DialogFragment; + import static org.catrobat.catroid.common.DefaultProjectHandler.ProjectCreatorType.PROJECT_CREATOR_CAST; import static org.catrobat.catroid.common.DefaultProjectHandler.ProjectCreatorType.PROJECT_CREATOR_DEFAULT; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/PlaySceneDialog.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/PlaySceneDialog.java index 3495dc1bcec..8b41785b27e 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/PlaySceneDialog.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/PlaySceneDialog.java @@ -25,13 +25,14 @@ import android.content.Context; import android.content.DialogInterface; -import androidx.annotation.NonNull; -import androidx.appcompat.app.AlertDialog; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Scene; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AlertDialog; + public final class PlaySceneDialog extends AlertDialog { private PlaySceneDialog(Context context) { diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/PrivacyPolicyDialogFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/PrivacyPolicyDialogFragment.java index b66ebe9e848..449df71497a 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/PrivacyPolicyDialogFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/PrivacyPolicyDialogFragment.java @@ -27,9 +27,6 @@ import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; -import androidx.annotation.NonNull; -import androidx.fragment.app.DialogFragment; -import androidx.appcompat.app.AlertDialog; import android.view.View; import org.catrobat.catroid.R; @@ -37,6 +34,10 @@ import org.catrobat.catroid.ui.WebViewActivity; import org.catrobat.catroid.utils.Utils; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AlertDialog; +import androidx.fragment.app.DialogFragment; + public class PrivacyPolicyDialogFragment extends DialogFragment { public static final String TAG = PrivacyPolicyDialogFragment.class.getSimpleName(); diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/ReplaceExistingProjectDialogFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/ReplaceExistingProjectDialogFragment.java index 5fe020c506a..b669f3e06c4 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/ReplaceExistingProjectDialogFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/ReplaceExistingProjectDialogFragment.java @@ -26,15 +26,12 @@ import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; -import androidx.annotation.IdRes; -import androidx.annotation.Nullable; -import com.google.android.material.textfield.TextInputLayout; -import androidx.fragment.app.DialogFragment; -import androidx.appcompat.app.AlertDialog; import android.view.View; import android.widget.RadioGroup; import android.widget.TextView; +import com.google.android.material.textfield.TextInputLayout; + import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.utils.FileMetaDataExtractor; @@ -44,6 +41,11 @@ import java.io.File; +import androidx.annotation.IdRes; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AlertDialog; +import androidx.fragment.app.DialogFragment; + import static org.catrobat.catroid.common.FlavoredConstants.DEFAULT_ROOT_DIRECTORY; public class ReplaceExistingProjectDialogFragment extends DialogFragment { diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/TextInputDialog.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/TextInputDialog.java index 51c0f363ccb..6ef1525f037 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/TextInputDialog.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/TextInputDialog.java @@ -26,14 +26,16 @@ import android.app.Dialog; import android.content.Context; import android.content.DialogInterface; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import com.google.android.material.textfield.TextInputLayout; -import androidx.appcompat.app.AlertDialog; import android.text.Editable; +import com.google.android.material.textfield.TextInputLayout; + import org.catrobat.catroid.R; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AlertDialog; + public final class TextInputDialog extends AlertDialog { private TextInputDialog(@NonNull Context context) { diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/login/LoginDialogFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/login/LoginDialogFragment.java index 6d81054bfa6..030af98f0f1 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/login/LoginDialogFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/login/LoginDialogFragment.java @@ -26,9 +26,6 @@ import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; -import com.google.android.material.textfield.TextInputLayout; -import androidx.fragment.app.DialogFragment; -import androidx.appcompat.app.AlertDialog; import android.text.Editable; import android.text.InputType; import android.text.TextWatcher; @@ -37,6 +34,8 @@ import android.widget.CompoundButton; import android.widget.EditText; +import com.google.android.material.textfield.TextInputLayout; + import org.catrobat.catroid.R; import org.catrobat.catroid.common.Constants; import org.catrobat.catroid.common.FlavoredConstants; @@ -44,6 +43,9 @@ import org.catrobat.catroid.ui.WebViewActivity; import org.catrobat.catroid.web.ServerCalls; +import androidx.appcompat.app.AlertDialog; +import androidx.fragment.app.DialogFragment; + public class LoginDialogFragment extends DialogFragment implements LoginTask.OnLoginListener { public static final String TAG = LoginDialogFragment.class.getSimpleName(); diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/login/OAuthUsernameDialogFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/login/OAuthUsernameDialogFragment.java index ec17f864a92..113aff3bc60 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/login/OAuthUsernameDialogFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/login/OAuthUsernameDialogFragment.java @@ -27,12 +27,11 @@ import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; -import com.google.android.material.textfield.TextInputLayout; -import androidx.fragment.app.DialogFragment; -import androidx.appcompat.app.AlertDialog; import android.view.View; import android.widget.Button; +import com.google.android.material.textfield.TextInputLayout; + import org.catrobat.catroid.R; import org.catrobat.catroid.common.Constants; import org.catrobat.catroid.transfers.CheckUserNameAvailableTask; @@ -40,6 +39,9 @@ import org.catrobat.catroid.transfers.GoogleLogInTask; import org.catrobat.catroid.ui.recyclerview.dialog.textwatcher.DialogInputWatcher; +import androidx.appcompat.app.AlertDialog; +import androidx.fragment.app.DialogFragment; + public class OAuthUsernameDialogFragment extends DialogFragment implements CheckUserNameAvailableTask.OnCheckUserNameAvailableCompleteListener, GoogleExchangeCodeTask.OnGoogleExchangeCodeCompleteListener, diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/login/RegistrationDialogFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/login/RegistrationDialogFragment.java index b23922d397c..bc40aef4977 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/login/RegistrationDialogFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/login/RegistrationDialogFragment.java @@ -26,9 +26,6 @@ import android.content.DialogInterface; import android.content.DialogInterface.OnShowListener; import android.os.Bundle; -import com.google.android.material.textfield.TextInputLayout; -import androidx.fragment.app.DialogFragment; -import androidx.appcompat.app.AlertDialog; import android.text.Editable; import android.text.InputType; import android.text.TextWatcher; @@ -38,6 +35,8 @@ import android.widget.CompoundButton; import android.widget.EditText; +import com.google.android.material.textfield.TextInputLayout; + import org.catrobat.catroid.R; import org.catrobat.catroid.common.Constants; import org.catrobat.catroid.transfers.CheckEmailAvailableTask; @@ -48,6 +47,9 @@ import org.catrobat.catroid.utils.ToastUtil; import org.catrobat.catroid.utils.Utils; +import androidx.appcompat.app.AlertDialog; +import androidx.fragment.app.DialogFragment; + public class RegistrationDialogFragment extends DialogFragment implements OnRegistrationListener { public static final String TAG = RegistrationDialogFragment.class.getSimpleName(); diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/DialogInputWatcher.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/DialogInputWatcher.java index d564e43956b..55cbcd17f8b 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/DialogInputWatcher.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/DialogInputWatcher.java @@ -23,11 +23,12 @@ package org.catrobat.catroid.ui.recyclerview.dialog.textwatcher; -import com.google.android.material.textfield.TextInputLayout; import android.text.Editable; import android.text.TextWatcher; import android.widget.Button; +import com.google.android.material.textfield.TextInputLayout; + public class DialogInputWatcher implements TextWatcher { private TextInputLayout inputLayout; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/NewItemTextWatcher.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/NewItemTextWatcher.java index 5e7c50f91dc..9809ce44d41 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/NewItemTextWatcher.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/NewItemTextWatcher.java @@ -24,7 +24,6 @@ package org.catrobat.catroid.ui.recyclerview.dialog.textwatcher; import android.content.Context; -import androidx.annotation.Nullable; import org.catrobat.catroid.R; import org.catrobat.catroid.common.Nameable; @@ -32,6 +31,8 @@ import java.util.List; +import androidx.annotation.Nullable; + public class NewItemTextWatcher extends TextInputDialog.TextWatcher { private List scope; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/NonEmptyStringTextWatcher.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/NonEmptyStringTextWatcher.java index 4ee3dd17cd6..de5c8c1cdc5 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/NonEmptyStringTextWatcher.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/NonEmptyStringTextWatcher.java @@ -24,11 +24,12 @@ package org.catrobat.catroid.ui.recyclerview.dialog.textwatcher; import android.content.Context; -import androidx.annotation.Nullable; import org.catrobat.catroid.R; import org.catrobat.catroid.ui.recyclerview.dialog.TextInputDialog; +import androidx.annotation.Nullable; + public class NonEmptyStringTextWatcher extends TextInputDialog.TextWatcher { @Nullable diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/RenameItemTextWatcher.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/RenameItemTextWatcher.java index dcc69bc8f9c..d36d1c4392f 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/RenameItemTextWatcher.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/RenameItemTextWatcher.java @@ -24,7 +24,6 @@ package org.catrobat.catroid.ui.recyclerview.dialog.textwatcher; import android.content.Context; -import androidx.annotation.Nullable; import org.catrobat.catroid.R; import org.catrobat.catroid.common.Nameable; @@ -32,6 +31,8 @@ import java.util.List; +import androidx.annotation.Nullable; + public class RenameItemTextWatcher extends TextInputDialog.TextWatcher { private T item; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/UniqueStringTextWatcher.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/UniqueStringTextWatcher.java index 88dacbb7c44..66148b43c91 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/UniqueStringTextWatcher.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/dialog/textwatcher/UniqueStringTextWatcher.java @@ -24,13 +24,14 @@ package org.catrobat.catroid.ui.recyclerview.dialog.textwatcher; import android.content.Context; -import androidx.annotation.Nullable; import org.catrobat.catroid.R; import org.catrobat.catroid.ui.recyclerview.dialog.TextInputDialog; import java.util.List; +import androidx.annotation.Nullable; + public class UniqueStringTextWatcher extends TextInputDialog.TextWatcher { private List scope; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/CategoryListFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/CategoryListFragment.java index 2818bf9dcf1..0f63b97ce4f 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/CategoryListFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/CategoryListFragment.java @@ -26,11 +26,6 @@ import android.content.DialogInterface; import android.content.res.TypedArray; import android.os.Bundle; -import androidx.annotation.Nullable; -import androidx.fragment.app.Fragment; -import androidx.appcompat.app.AlertDialog; -import androidx.appcompat.app.AppCompatActivity; -import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.Menu; import android.view.View; @@ -58,6 +53,12 @@ import java.util.Collections; import java.util.List; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.RecyclerView; + public class CategoryListFragment extends Fragment implements CategoryListRVAdapter.OnItemClickListener { public static final String OBJECT_TAG = "objectFragment"; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/DataListFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/DataListFragment.java index 96525e91a80..b72bf62c427 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/DataListFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/DataListFragment.java @@ -25,11 +25,6 @@ import android.content.DialogInterface; import android.os.Bundle; -import androidx.annotation.IntDef; -import androidx.fragment.app.Fragment; -import androidx.appcompat.app.AlertDialog; -import androidx.appcompat.app.AppCompatActivity; -import androidx.recyclerview.widget.RecyclerView; import android.view.ActionMode; import android.view.LayoutInflater; import android.view.Menu; @@ -64,6 +59,12 @@ import java.util.Collections; import java.util.List; +import androidx.annotation.IntDef; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.RecyclerView; + public class DataListFragment extends Fragment implements ActionMode.Callback, RVAdapter.SelectionListener, diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/LookListFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/LookListFragment.java index 0f08cb6390e..142c535c9c7 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/LookListFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/LookListFragment.java @@ -26,7 +26,6 @@ import android.content.ComponentName; import android.content.Intent; import android.os.Bundle; -import androidx.annotation.PluralsRes; import android.util.Log; import org.catrobat.catroid.ProjectManager; @@ -44,6 +43,8 @@ import java.io.IOException; import java.util.List; +import androidx.annotation.PluralsRes; + import static org.catrobat.catroid.common.Constants.EXTRA_PICTURE_PATH_POCKET_PAINT; import static org.catrobat.catroid.common.Constants.POCKET_PAINT_INTENT_ACTIVITY_NAME; import static org.catrobat.catroid.common.SharedPreferenceKeys.SHOW_DETAILS_LOOKS_PREFERENCE_KEY; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/MainMenuFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/MainMenuFragment.java index 5f5ad139c19..34238111874 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/MainMenuFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/MainMenuFragment.java @@ -26,12 +26,6 @@ import android.content.Intent; import android.net.Uri; import android.os.Bundle; -import androidx.annotation.IntDef; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.fragment.app.Fragment; -import androidx.core.content.ContextCompat; -import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -57,6 +51,13 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.IntDef; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.core.content.ContextCompat; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.RecyclerView; + import static org.catrobat.catroid.common.Constants.EXTRA_PROJECT_NAME; import static org.catrobat.catroid.common.FlavoredConstants.DEFAULT_ROOT_DIRECTORY; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/NfcTagListFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/NfcTagListFragment.java index be1571e4d4f..4b8424ac892 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/NfcTagListFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/NfcTagListFragment.java @@ -28,7 +28,6 @@ import android.nfc.NfcAdapter; import android.os.Bundle; import android.provider.Settings; -import androidx.annotation.PluralsRes; import android.util.Log; import android.view.Menu; @@ -41,6 +40,8 @@ import java.util.List; +import androidx.annotation.PluralsRes; + public class NfcTagListFragment extends RecyclerViewFragment { public static final String TAG = NfcTagListFragment.class.getSimpleName(); diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/ProjectListFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/ProjectListFragment.java index 3c08e77721f..bc6a5e6d680 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/ProjectListFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/ProjectListFragment.java @@ -27,8 +27,6 @@ import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; -import androidx.annotation.PluralsRes; -import androidx.appcompat.app.AlertDialog; import android.util.Log; import android.view.MenuItem; @@ -63,6 +61,9 @@ import java.util.Comparator; import java.util.List; +import androidx.annotation.PluralsRes; +import androidx.appcompat.app.AlertDialog; + import static android.Manifest.permission.READ_EXTERNAL_STORAGE; import static android.Manifest.permission.WRITE_EXTERNAL_STORAGE; import static android.app.Activity.RESULT_OK; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/RecyclerViewFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/RecyclerViewFragment.java index cd460cc070e..62c1156aa0b 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/RecyclerViewFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/RecyclerViewFragment.java @@ -26,14 +26,6 @@ import android.content.Context; import android.os.Bundle; import android.preference.PreferenceManager; -import androidx.annotation.IntDef; -import androidx.annotation.NonNull; -import androidx.annotation.PluralsRes; -import androidx.annotation.StringRes; -import androidx.fragment.app.Fragment; -import androidx.appcompat.app.AlertDialog; -import androidx.recyclerview.widget.RecyclerView; -import androidx.recyclerview.widget.ItemTouchHelper; import android.view.ActionMode; import android.view.LayoutInflater; import android.view.Menu; @@ -60,6 +52,15 @@ import java.lang.annotation.RetentionPolicy; import java.util.List; +import androidx.annotation.IntDef; +import androidx.annotation.NonNull; +import androidx.annotation.PluralsRes; +import androidx.annotation.StringRes; +import androidx.appcompat.app.AlertDialog; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.ItemTouchHelper; +import androidx.recyclerview.widget.RecyclerView; + public abstract class RecyclerViewFragment extends Fragment implements ActionMode.Callback, RVAdapter.SelectionListener, diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/SceneListFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/SceneListFragment.java index 857877b6ddc..772674528ed 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/SceneListFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/SceneListFragment.java @@ -24,8 +24,6 @@ package org.catrobat.catroid.ui.recyclerview.fragment; import android.content.Intent; -import androidx.annotation.PluralsRes; -import androidx.appcompat.app.AppCompatActivity; import android.util.Log; import android.view.Menu; @@ -45,6 +43,9 @@ import java.io.IOException; import java.util.List; +import androidx.annotation.PluralsRes; +import androidx.appcompat.app.AppCompatActivity; + import static org.catrobat.catroid.common.Constants.Z_INDEX_BACKGROUND; import static org.catrobat.catroid.common.SharedPreferenceKeys.SHOW_DETAILS_SCENES_PREFERENCE_KEY; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/ScriptFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/ScriptFragment.java index 2cec8b4803b..742fa4cf0bc 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/ScriptFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/ScriptFragment.java @@ -26,11 +26,6 @@ import android.net.Uri; import android.os.Bundle; import android.os.Parcelable; -import androidx.annotation.IntDef; -import androidx.fragment.app.ListFragment; -import androidx.appcompat.app.ActionBar; -import androidx.appcompat.app.AlertDialog; -import androidx.appcompat.app.AppCompatActivity; import android.util.Log; import android.view.ActionMode; import android.view.LayoutInflater; @@ -74,6 +69,12 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.IntDef; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.ListFragment; + public class ScriptFragment extends ListFragment implements ActionMode.Callback, BrickAdapter.OnItemClickListener, diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/SoundListFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/SoundListFragment.java index e96e0fb7e9f..319693ffcd4 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/SoundListFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/SoundListFragment.java @@ -24,7 +24,6 @@ package org.catrobat.catroid.ui.recyclerview.fragment; import android.content.Intent; -import androidx.annotation.PluralsRes; import android.util.Log; import org.catrobat.catroid.BuildConfig; @@ -44,6 +43,8 @@ import java.io.IOException; import java.util.List; +import androidx.annotation.PluralsRes; + import static org.catrobat.catroid.common.SharedPreferenceKeys.SHOW_DETAILS_SOUNDS_PREFERENCE_KEY; public class SoundListFragment extends RecyclerViewFragment { diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/SpriteListFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/SpriteListFragment.java index 33c22cabe13..5b8d9a23385 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/SpriteListFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/SpriteListFragment.java @@ -25,11 +25,6 @@ import android.content.DialogInterface; import android.content.Intent; -import androidx.annotation.PluralsRes; -import androidx.appcompat.app.AlertDialog; -import androidx.appcompat.app.AppCompatActivity; -import androidx.recyclerview.widget.RecyclerView; -import androidx.recyclerview.widget.ItemTouchHelper; import android.util.Log; import android.view.Menu; import android.view.MenuItem; @@ -58,6 +53,12 @@ import java.util.Collections; import java.util.List; +import androidx.annotation.PluralsRes; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.ItemTouchHelper; +import androidx.recyclerview.widget.RecyclerView; + import static org.catrobat.catroid.common.SharedPreferenceKeys.SHOW_DETAILS_SPRITES_PREFERENCE_KEY; public class SpriteListFragment extends RecyclerViewFragment { diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/scratchconverter/ScratchProgramsFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/scratchconverter/ScratchProgramsFragment.java index 03fd21af88e..fb731c26238 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/scratchconverter/ScratchProgramsFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/scratchconverter/ScratchProgramsFragment.java @@ -25,10 +25,6 @@ import android.content.Intent; import android.os.Bundle; -import androidx.annotation.Nullable; -import androidx.fragment.app.Fragment; -import androidx.appcompat.app.AlertDialog; -import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -47,6 +43,11 @@ import java.io.File; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AlertDialog; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.RecyclerView; + import static org.catrobat.catroid.common.FlavoredConstants.DEFAULT_ROOT_DIRECTORY; public class ScratchProgramsFragment extends Fragment implements diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/scratchconverter/ScratchSearchResultsFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/scratchconverter/ScratchSearchResultsFragment.java index 906533c0551..f6aa01168e6 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/scratchconverter/ScratchSearchResultsFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/scratchconverter/ScratchSearchResultsFragment.java @@ -29,10 +29,6 @@ import android.os.Bundle; import android.os.Parcelable; import android.preference.PreferenceManager; -import androidx.annotation.IntDef; -import androidx.fragment.app.Fragment; -import androidx.appcompat.app.AlertDialog; -import androidx.recyclerview.widget.RecyclerView; import android.view.ActionMode; import android.view.LayoutInflater; import android.view.Menu; @@ -65,6 +61,11 @@ import java.util.Collections; import java.util.List; +import androidx.annotation.IntDef; +import androidx.appcompat.app.AlertDialog; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.RecyclerView; + import static org.catrobat.catroid.common.SharedPreferenceKeys.SHOW_DETAILS_SCRATCH_PROJECTS_PREFERENCE_KEY; public class ScratchSearchResultsFragment extends Fragment implements diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/viewholder/ViewHolder.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/viewholder/ViewHolder.java index fc6b15da947..7d83b09f333 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/viewholder/ViewHolder.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/viewholder/ViewHolder.java @@ -23,12 +23,13 @@ package org.catrobat.catroid.ui.recyclerview.viewholder; -import androidx.recyclerview.widget.RecyclerView; import android.view.View; import android.widget.TextView; import org.catrobat.catroid.R; +import androidx.recyclerview.widget.RecyclerView; + public class ViewHolder extends RecyclerView.ViewHolder { public TextView title; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/runtimepermissions/PermissionRequestActivityExtension.java b/catroid/src/main/java/org/catrobat/catroid/ui/runtimepermissions/PermissionRequestActivityExtension.java index 753d04a4ba1..dc6a914f4ec 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/runtimepermissions/PermissionRequestActivityExtension.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/runtimepermissions/PermissionRequestActivityExtension.java @@ -28,13 +28,14 @@ import android.content.DialogInterface; import android.content.pm.PackageManager; import android.os.Build; -import androidx.annotation.NonNull; import org.catrobat.catroid.R; import java.util.ArrayList; import java.util.List; +import androidx.annotation.NonNull; + public class PermissionRequestActivityExtension { private final List waitingForResponsePermissionTaskList; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/runtimepermissions/RequiresPermissionTask.java b/catroid/src/main/java/org/catrobat/catroid/ui/runtimepermissions/RequiresPermissionTask.java index f5200b06984..f0255758b59 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/runtimepermissions/RequiresPermissionTask.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/runtimepermissions/RequiresPermissionTask.java @@ -25,13 +25,14 @@ import android.app.Activity; import android.content.pm.PackageManager; -import androidx.annotation.StringRes; -import androidx.core.app.ActivityCompat; -import androidx.core.content.ContextCompat; import android.util.Log; import java.util.List; +import androidx.annotation.StringRes; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; + public abstract class RequiresPermissionTask { private final int permissionRequestId; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/scratchconverter/JobViewListener.java b/catroid/src/main/java/org/catrobat/catroid/ui/scratchconverter/JobViewListener.java index cfdbe298d5d..a6e013aca17 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/scratchconverter/JobViewListener.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/scratchconverter/JobViewListener.java @@ -23,10 +23,10 @@ package org.catrobat.catroid.ui.scratchconverter; -import androidx.annotation.NonNull; - import org.catrobat.catroid.scratchconverter.protocol.Job; +import androidx.annotation.NonNull; + public interface JobViewListener { void onJobScheduled(Job job); void onJobReady(Job job); diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/AccessibilityProfile.java b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/AccessibilityProfile.java index d589f4b74d9..cc56c2c95a7 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/AccessibilityProfile.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/AccessibilityProfile.java @@ -25,7 +25,6 @@ import android.content.SharedPreferences; import android.content.res.Resources; -import androidx.annotation.StringDef; import org.catrobat.catroid.R; @@ -36,6 +35,8 @@ import java.util.HashSet; import java.util.Set; +import androidx.annotation.StringDef; + public class AccessibilityProfile { private static final String CUSTOM_ACCESSIBILITY_PROFILE = "custom_accessibility_profile"; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/AccessibilityProfilesFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/AccessibilityProfilesFragment.java index 330ac4328b4..ea9145dcf1b 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/AccessibilityProfilesFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/AccessibilityProfilesFragment.java @@ -28,9 +28,6 @@ import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; -import androidx.annotation.Nullable; -import androidx.core.content.ContextCompat; -import androidx.appcompat.app.AppCompatActivity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -43,6 +40,10 @@ import org.catrobat.catroid.ui.SettingsActivity; import org.catrobat.catroid.utils.ToastUtil; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.content.ContextCompat; + import static org.catrobat.catroid.common.SharedPreferenceKeys.ACCESSIBILITY_PROFILE_PREFERENCE_KEY; import static org.catrobat.catroid.ui.settingsfragments.AccessibilityProfile.BEGINNER_BRICKS; import static org.catrobat.catroid.ui.settingsfragments.AccessibilityProfile.DRAGNDROP_DELAY; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/AccessibilitySettingsFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/AccessibilitySettingsFragment.java index 5523ad93c15..de0f096459a 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/AccessibilitySettingsFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/AccessibilitySettingsFragment.java @@ -29,14 +29,15 @@ import android.preference.Preference; import android.preference.PreferenceFragment; import android.preference.PreferenceScreen; -import androidx.annotation.Nullable; -import androidx.appcompat.app.AppCompatActivity; import org.catrobat.catroid.R; import org.catrobat.catroid.ui.MainMenuActivity; import org.catrobat.catroid.ui.SettingsActivity; import org.catrobat.catroid.utils.ToastUtil; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; + public class AccessibilitySettingsFragment extends PreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener { public static final String TAG = AccessibilitySettingsFragment.class.getSimpleName(); diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/Ev3SensorsSettingsFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/Ev3SensorsSettingsFragment.java index 3f34f9f68fa..ab3318d8936 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/Ev3SensorsSettingsFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/Ev3SensorsSettingsFragment.java @@ -29,13 +29,14 @@ import android.preference.Preference; import android.preference.PreferenceCategory; import android.preference.PreferenceFragment; -import androidx.annotation.Nullable; -import androidx.appcompat.app.AppCompatActivity; import org.catrobat.catroid.BuildConfig; import org.catrobat.catroid.R; import org.catrobat.catroid.devices.mindstorms.ev3.sensors.EV3Sensor; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; + import static org.catrobat.catroid.ui.settingsfragments.SettingsFragment.EV3_SCREEN_KEY; import static org.catrobat.catroid.ui.settingsfragments.SettingsFragment.EV3_SENSORS; import static org.catrobat.catroid.ui.settingsfragments.SettingsFragment.EV3_SETTINGS_CATEGORY; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/NXTSensorsSettingsFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/NXTSensorsSettingsFragment.java index a076b096838..831da378a24 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/NXTSensorsSettingsFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/NXTSensorsSettingsFragment.java @@ -30,13 +30,14 @@ import android.preference.PreferenceCategory; import android.preference.PreferenceFragment; import android.preference.PreferenceScreen; -import androidx.annotation.Nullable; -import androidx.appcompat.app.AppCompatActivity; import org.catrobat.catroid.BuildConfig; import org.catrobat.catroid.R; import org.catrobat.catroid.devices.mindstorms.nxt.sensors.NXTSensor; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; + import static org.catrobat.catroid.ui.settingsfragments.SettingsFragment.NXT_SENSORS; public class NXTSensorsSettingsFragment extends PreferenceFragment { diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/ParrotARDroneSettingsFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/ParrotARDroneSettingsFragment.java index b04b0538520..a840d0bf92f 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/ParrotARDroneSettingsFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/ParrotARDroneSettingsFragment.java @@ -30,13 +30,14 @@ import android.preference.PreferenceCategory; import android.preference.PreferenceFragment; import android.preference.PreferenceScreen; -import androidx.annotation.Nullable; -import androidx.appcompat.app.AppCompatActivity; import org.catrobat.catroid.BuildConfig; import org.catrobat.catroid.R; import org.catrobat.catroid.common.DroneConfigPreference; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; + import static org.catrobat.catroid.ui.settingsfragments.SettingsFragment.DRONE_ALTITUDE_LIMIT; import static org.catrobat.catroid.ui.settingsfragments.SettingsFragment.DRONE_CONFIGS; import static org.catrobat.catroid.ui.settingsfragments.SettingsFragment.DRONE_ROTATION_SPEED; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/ParrotJumpingSumoSettingsFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/ParrotJumpingSumoSettingsFragment.java index 293ec8f79a2..b9bb4aeed2a 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/ParrotJumpingSumoSettingsFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/ParrotJumpingSumoSettingsFragment.java @@ -26,12 +26,13 @@ import android.os.Bundle; import android.preference.PreferenceFragment; import android.preference.PreferenceScreen; -import androidx.annotation.Nullable; -import androidx.appcompat.app.AppCompatActivity; import org.catrobat.catroid.BuildConfig; import org.catrobat.catroid.R; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; + import static org.catrobat.catroid.ui.settingsfragments.SettingsFragment.PARROT_JUMPING_SUMO_SCREEN_KEY; public class ParrotJumpingSumoSettingsFragment extends PreferenceFragment { diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/RaspberryPiSettingsFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/RaspberryPiSettingsFragment.java index 3714ba41b16..3b0be06d18b 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/RaspberryPiSettingsFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/RaspberryPiSettingsFragment.java @@ -32,12 +32,13 @@ import android.preference.PreferenceFragment; import android.preference.PreferenceManager; import android.preference.PreferenceScreen; -import androidx.annotation.Nullable; -import androidx.appcompat.app.AppCompatActivity; import org.catrobat.catroid.BuildConfig; import org.catrobat.catroid.R; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; + import static org.catrobat.catroid.ui.settingsfragments.SettingsFragment.RASPBERRY_SCREEN_KEY; import static org.catrobat.catroid.ui.settingsfragments.SettingsFragment.RASPI_CONNECTION_SETTINGS_CATEGORY; import static org.catrobat.catroid.ui.settingsfragments.SettingsFragment.RASPI_HOST; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/SettingsFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/SettingsFragment.java index fd331f727b6..95d7d64343d 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/SettingsFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/settingsfragments/SettingsFragment.java @@ -35,7 +35,6 @@ import android.preference.PreferenceFragment; import android.preference.PreferenceManager; import android.preference.PreferenceScreen; -import androidx.appcompat.app.AppCompatActivity; import android.util.DisplayMetrics; import org.catrobat.catroid.BuildConfig; @@ -54,6 +53,8 @@ import java.util.List; import java.util.Locale; +import androidx.appcompat.app.AppCompatActivity; + import static org.catrobat.catroid.CatroidApplication.defaultSystemLanguage; import static org.catrobat.catroid.common.SharedPreferenceKeys.DEVICE_LANGUAGE; import static org.catrobat.catroid.common.SharedPreferenceKeys.LANGUAGE_CODE; diff --git a/catroid/src/main/java/org/catrobat/catroid/utils/CrashReporter.java b/catroid/src/main/java/org/catrobat/catroid/utils/CrashReporter.java index 9d27dec99e9..6b2e1a3734e 100644 --- a/catroid/src/main/java/org/catrobat/catroid/utils/CrashReporter.java +++ b/catroid/src/main/java/org/catrobat/catroid/utils/CrashReporter.java @@ -26,7 +26,6 @@ import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; -import androidx.annotation.VisibleForTesting; import android.util.Log; import com.google.gson.Gson; @@ -34,6 +33,8 @@ import org.catrobat.catroid.BuildConfig; import org.catrobat.catroid.ui.settingsfragments.SettingsFragment; +import androidx.annotation.VisibleForTesting; + public final class CrashReporter { private static final String TAG = CrashReporter.class.getSimpleName(); diff --git a/catroid/src/main/java/org/catrobat/catroid/utils/SnackbarUtil.java b/catroid/src/main/java/org/catrobat/catroid/utils/SnackbarUtil.java index 241131a88c1..cf4ffc52198 100644 --- a/catroid/src/main/java/org/catrobat/catroid/utils/SnackbarUtil.java +++ b/catroid/src/main/java/org/catrobat/catroid/utils/SnackbarUtil.java @@ -26,18 +26,20 @@ import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; -import androidx.annotation.StringRes; -import com.google.android.material.snackbar.Snackbar; -import androidx.core.content.ContextCompat; import android.view.View; import android.widget.TextView; +import com.google.android.material.snackbar.Snackbar; + import org.catrobat.catroid.R; import org.catrobat.catroid.ui.settingsfragments.SettingsFragment; import java.util.HashSet; import java.util.Set; +import androidx.annotation.StringRes; +import androidx.core.content.ContextCompat; + public final class SnackbarUtil { private static final int MAX_LINES = 5; diff --git a/catroid/src/main/java/org/catrobat/catroid/utils/ToastUtil.java b/catroid/src/main/java/org/catrobat/catroid/utils/ToastUtil.java index e661307db34..4e40ae1ecba 100644 --- a/catroid/src/main/java/org/catrobat/catroid/utils/ToastUtil.java +++ b/catroid/src/main/java/org/catrobat/catroid/utils/ToastUtil.java @@ -24,12 +24,13 @@ import android.app.Activity; import android.content.Context; -import androidx.annotation.StringRes; import android.view.View; import android.widget.Toast; import org.catrobat.catroid.ui.UiUtils; +import androidx.annotation.StringRes; + public final class ToastUtil { private ToastUtil() { diff --git a/catroid/src/main/java/org/catrobat/catroid/utils/Utils.java b/catroid/src/main/java/org/catrobat/catroid/utils/Utils.java index 770fc730e1e..59ecf081032 100644 --- a/catroid/src/main/java/org/catrobat/catroid/utils/Utils.java +++ b/catroid/src/main/java/org/catrobat/catroid/utils/Utils.java @@ -30,7 +30,6 @@ import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.preference.PreferenceManager; -import android.support.v7.app.AppCompatActivity; import android.util.Log; import com.google.common.base.Splitter; @@ -61,6 +60,8 @@ import java.util.List; import java.util.Locale; +import androidx.appcompat.app.AppCompatActivity; + import static org.catrobat.catroid.common.Constants.PREF_PROJECTNAME_KEY; import static org.catrobat.catroid.common.FlavoredConstants.DEFAULT_ROOT_DIRECTORY; import static org.catrobat.catroid.web.ServerAuthenticationConstants.TOKEN_CODE_INVALID; diff --git a/catroid/src/main/java/org/catrobat/catroid/utils/idlingresources/BooleanInitiallyBusyIdlingResource.java b/catroid/src/main/java/org/catrobat/catroid/utils/idlingresources/BooleanInitiallyBusyIdlingResource.java index 7716daab94d..0ede63bd945 100644 --- a/catroid/src/main/java/org/catrobat/catroid/utils/idlingresources/BooleanInitiallyBusyIdlingResource.java +++ b/catroid/src/main/java/org/catrobat/catroid/utils/idlingresources/BooleanInitiallyBusyIdlingResource.java @@ -22,11 +22,11 @@ */ package org.catrobat.catroid.utils.idlingresources; +import java.util.concurrent.atomic.AtomicBoolean; + import androidx.annotation.Nullable; import androidx.test.espresso.IdlingResource; -import java.util.concurrent.atomic.AtomicBoolean; - public class BooleanInitiallyBusyIdlingResource implements IdlingResource { @Nullable private volatile ResourceCallback callback; diff --git a/catroid/src/main/java/org/catrobat/catroid/utils/notifications/StatusBarNotificationManager.java b/catroid/src/main/java/org/catrobat/catroid/utils/notifications/StatusBarNotificationManager.java index f3ccc21883c..a6f3ab58df4 100644 --- a/catroid/src/main/java/org/catrobat/catroid/utils/notifications/StatusBarNotificationManager.java +++ b/catroid/src/main/java/org/catrobat/catroid/utils/notifications/StatusBarNotificationManager.java @@ -34,8 +34,6 @@ import android.os.Build; import android.os.Bundle; import android.os.ResultReceiver; -import androidx.annotation.StringRes; -import androidx.core.app.NotificationCompat; import android.util.Log; import org.catrobat.catroid.R; @@ -43,6 +41,8 @@ import org.catrobat.catroid.transfers.project.ProjectUploadService; import org.catrobat.catroid.ui.MainMenuActivity; +import androidx.annotation.StringRes; +import androidx.core.app.NotificationCompat; import kotlin.jvm.Synchronized; import static org.catrobat.catroid.common.Constants.EXTERNAL_STORAGE_ROOT_EXPORT_DIRECTORY; diff --git a/catroid/src/main/java/org/catrobat/catroid/visualplacement/VisualPlacementActivity.java b/catroid/src/main/java/org/catrobat/catroid/visualplacement/VisualPlacementActivity.java index c49756d1c8f..6c6474f1234 100644 --- a/catroid/src/main/java/org/catrobat/catroid/visualplacement/VisualPlacementActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/visualplacement/VisualPlacementActivity.java @@ -35,8 +35,6 @@ import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.os.Bundle; -import androidx.annotation.Nullable; -import androidx.appcompat.widget.Toolbar; import android.view.Gravity; import android.view.Menu; import android.view.MenuItem; @@ -59,6 +57,9 @@ import java.io.File; +import androidx.annotation.Nullable; +import androidx.appcompat.widget.Toolbar; + import static android.content.DialogInterface.BUTTON_NEGATIVE; import static android.content.DialogInterface.BUTTON_POSITIVE; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE; diff --git a/catroid/src/main/java/org/catrobat/catroid/web/ProjectDownloader.kt b/catroid/src/main/java/org/catrobat/catroid/web/ProjectDownloader.kt index f93122ae4a0..afbae0c845b 100644 --- a/catroid/src/main/java/org/catrobat/catroid/web/ProjectDownloader.kt +++ b/catroid/src/main/java/org/catrobat/catroid/web/ProjectDownloader.kt @@ -29,9 +29,9 @@ import android.os.Build import android.os.Bundle import android.os.Handler import android.os.ResultReceiver +import android.util.Log import androidx.annotation.VisibleForTesting import androidx.appcompat.app.AppCompatActivity -import android.util.Log import org.catrobat.catroid.R import org.catrobat.catroid.scratchconverter.Client.ProjectDownloadCallback import org.catrobat.catroid.transfers.project.ProjectDownloadService diff --git a/catroid/src/main/java/org/catrobat/catroid/web/ServerAuthenticator.kt b/catroid/src/main/java/org/catrobat/catroid/web/ServerAuthenticator.kt index 35c74330d6e..0c00247e8d9 100644 --- a/catroid/src/main/java/org/catrobat/catroid/web/ServerAuthenticator.kt +++ b/catroid/src/main/java/org/catrobat/catroid/web/ServerAuthenticator.kt @@ -24,8 +24,8 @@ package org.catrobat.catroid.web import android.content.SharedPreferences -import androidx.annotation.VisibleForTesting import android.util.Log +import androidx.annotation.VisibleForTesting import okhttp3.OkHttpClient import org.catrobat.catroid.common.Constants import org.catrobat.catroid.common.SharedPreferenceKeys.DEVICE_LANGUAGE diff --git a/catroid/src/main/java/org/catrobat/catroid/web/WebConnectionHolder.java b/catroid/src/main/java/org/catrobat/catroid/web/WebConnectionHolder.java index 05c18334725..5ef8a540203 100644 --- a/catroid/src/main/java/org/catrobat/catroid/web/WebConnectionHolder.java +++ b/catroid/src/main/java/org/catrobat/catroid/web/WebConnectionHolder.java @@ -23,14 +23,13 @@ package org.catrobat.catroid.web; -import androidx.annotation.VisibleForTesting; - import com.google.common.collect.ImmutableList; import java.util.ArrayList; import java.util.List; import java.util.concurrent.TimeUnit; +import androidx.annotation.VisibleForTesting; import okhttp3.ConnectionSpec; import okhttp3.Dispatcher; import okhttp3.OkHttpClient; diff --git a/catroid/src/test/java/org/catrobat/catroid/test/content/sprite/LookBreakDownCatroidAngleTest.java b/catroid/src/test/java/org/catrobat/catroid/test/content/sprite/LookBreakDownCatroidAngleTest.java index d8e5cb27e40..aff4c468e34 100644 --- a/catroid/src/test/java/org/catrobat/catroid/test/content/sprite/LookBreakDownCatroidAngleTest.java +++ b/catroid/src/test/java/org/catrobat/catroid/test/content/sprite/LookBreakDownCatroidAngleTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.content.sprite; -import androidx.annotation.IdRes; - import org.catrobat.catroid.content.Look; import org.catrobat.catroid.content.SingleSprite; import org.junit.Test; @@ -33,6 +31,8 @@ import java.util.Arrays; +import androidx.annotation.IdRes; + import static junit.framework.Assert.assertEquals; @RunWith(Parameterized.class) diff --git a/catroid/src/test/java/org/catrobat/catroid/test/content/sprite/LookCatroidAngleToStageAngleTest.java b/catroid/src/test/java/org/catrobat/catroid/test/content/sprite/LookCatroidAngleToStageAngleTest.java index 2d413ba3a84..9b0e673d8c9 100644 --- a/catroid/src/test/java/org/catrobat/catroid/test/content/sprite/LookCatroidAngleToStageAngleTest.java +++ b/catroid/src/test/java/org/catrobat/catroid/test/content/sprite/LookCatroidAngleToStageAngleTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.content.sprite; -import androidx.annotation.IdRes; - import org.catrobat.catroid.content.Look; import org.catrobat.catroid.content.SingleSprite; import org.junit.Test; @@ -33,6 +31,8 @@ import java.util.Arrays; +import androidx.annotation.IdRes; + import static junit.framework.Assert.assertEquals; @RunWith(Parameterized.class) diff --git a/catroid/src/test/java/org/catrobat/catroid/test/content/sprite/LookDirectionTest.java b/catroid/src/test/java/org/catrobat/catroid/test/content/sprite/LookDirectionTest.java index d2be6e5373f..6c8df412d52 100644 --- a/catroid/src/test/java/org/catrobat/catroid/test/content/sprite/LookDirectionTest.java +++ b/catroid/src/test/java/org/catrobat/catroid/test/content/sprite/LookDirectionTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.content.sprite; -import androidx.annotation.IdRes; - import org.catrobat.catroid.content.Look; import org.catrobat.catroid.content.SingleSprite; import org.junit.Test; @@ -33,6 +31,8 @@ import java.util.Arrays; +import androidx.annotation.IdRes; + import static junit.framework.Assert.assertEquals; @RunWith(Parameterized.class) diff --git a/catroid/src/test/java/org/catrobat/catroid/test/content/sprite/LookStageAngleToCatroidAngleTest.java b/catroid/src/test/java/org/catrobat/catroid/test/content/sprite/LookStageAngleToCatroidAngleTest.java index 9f311e11a3b..8e0afc8c484 100644 --- a/catroid/src/test/java/org/catrobat/catroid/test/content/sprite/LookStageAngleToCatroidAngleTest.java +++ b/catroid/src/test/java/org/catrobat/catroid/test/content/sprite/LookStageAngleToCatroidAngleTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.content.sprite; -import androidx.annotation.IdRes; - import org.catrobat.catroid.content.Look; import org.catrobat.catroid.content.SingleSprite; import org.junit.Test; @@ -33,6 +31,8 @@ import java.util.Arrays; +import androidx.annotation.IdRes; + import static junit.framework.Assert.assertEquals; @RunWith(Parameterized.class) diff --git a/catroid/src/test/java/org/catrobat/catroid/test/note/trackgrid/GridRowTestDataFactory.java b/catroid/src/test/java/org/catrobat/catroid/test/note/trackgrid/GridRowTestDataFactory.java index 9b95e782a1c..4fa18731f92 100644 --- a/catroid/src/test/java/org/catrobat/catroid/test/note/trackgrid/GridRowTestDataFactory.java +++ b/catroid/src/test/java/org/catrobat/catroid/test/note/trackgrid/GridRowTestDataFactory.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.test.note.trackgrid; -import androidx.collection.SparseArrayCompat; - import org.catrobat.catroid.pocketmusic.note.NoteLength; import org.catrobat.catroid.pocketmusic.note.NoteName; import org.catrobat.catroid.pocketmusic.note.trackgrid.GridRow; @@ -32,6 +30,8 @@ import java.util.ArrayList; import java.util.List; +import androidx.collection.SparseArrayCompat; + public final class GridRowTestDataFactory { private GridRowTestDataFactory() { diff --git a/catroid/src/test/java/org/catrobat/catroid/test/note/trackgrid/TrackGridTestDataFactory.java b/catroid/src/test/java/org/catrobat/catroid/test/note/trackgrid/TrackGridTestDataFactory.java index 1d727a9db8e..979404ec540 100644 --- a/catroid/src/test/java/org/catrobat/catroid/test/note/trackgrid/TrackGridTestDataFactory.java +++ b/catroid/src/test/java/org/catrobat/catroid/test/note/trackgrid/TrackGridTestDataFactory.java @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.test.note.trackgrid; -import androidx.collection.SparseArrayCompat; - import org.catrobat.catroid.pocketmusic.note.MusicalBeat; import org.catrobat.catroid.pocketmusic.note.MusicalInstrument; import org.catrobat.catroid.pocketmusic.note.MusicalKey; @@ -37,6 +35,8 @@ import java.util.ArrayList; import java.util.List; +import androidx.collection.SparseArrayCompat; + public final class TrackGridTestDataFactory { private TrackGridTestDataFactory() { diff --git a/catroid/src/test/java/org/catrobat/catroid/test/robolectric/bricks/BrickAddCategoryTest.java b/catroid/src/test/java/org/catrobat/catroid/test/robolectric/bricks/BrickAddCategoryTest.java index a6e7713246e..ea6ad3e71d0 100644 --- a/catroid/src/test/java/org/catrobat/catroid/test/robolectric/bricks/BrickAddCategoryTest.java +++ b/catroid/src/test/java/org/catrobat/catroid/test/robolectric/bricks/BrickAddCategoryTest.java @@ -26,7 +26,6 @@ import android.app.Activity; import android.content.SharedPreferences; import android.preference.PreferenceManager; -import androidx.fragment.app.Fragment; import android.widget.ListAdapter; import org.catrobat.catroid.ProjectManager; @@ -50,6 +49,8 @@ import java.util.Arrays; import java.util.List; +import androidx.fragment.app.Fragment; + import static junit.framework.Assert.assertEquals; import static junit.framework.TestCase.assertNotNull; diff --git a/catroid/src/test/java/org/catrobat/catroid/test/robolectric/bricks/BrickSingleFormulaFieldTest.java b/catroid/src/test/java/org/catrobat/catroid/test/robolectric/bricks/BrickSingleFormulaFieldTest.java index 94885379c38..41c2e7e418f 100644 --- a/catroid/src/test/java/org/catrobat/catroid/test/robolectric/bricks/BrickSingleFormulaFieldTest.java +++ b/catroid/src/test/java/org/catrobat/catroid/test/robolectric/bricks/BrickSingleFormulaFieldTest.java @@ -24,8 +24,6 @@ package org.catrobat.catroid.test.robolectric.bricks; import android.app.Activity; -import androidx.annotation.IdRes; -import androidx.fragment.app.Fragment; import android.view.View; import android.widget.TextView; @@ -134,6 +132,9 @@ import java.util.Arrays; import java.util.Collection; +import androidx.annotation.IdRes; +import androidx.fragment.app.Fragment; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertNotNull; diff --git a/catroid/src/test/java/org/catrobat/catroid/test/robolectric/bricks/BrickSpinnerTest.java b/catroid/src/test/java/org/catrobat/catroid/test/robolectric/bricks/BrickSpinnerTest.java index 9261ccedc14..bf91f65b6e8 100644 --- a/catroid/src/test/java/org/catrobat/catroid/test/robolectric/bricks/BrickSpinnerTest.java +++ b/catroid/src/test/java/org/catrobat/catroid/test/robolectric/bricks/BrickSpinnerTest.java @@ -24,8 +24,6 @@ package org.catrobat.catroid.test.robolectric.bricks; import android.app.Activity; -import androidx.annotation.IdRes; -import androidx.fragment.app.Fragment; import android.view.View; import android.widget.Spinner; @@ -90,6 +88,9 @@ import java.util.Collection; import java.util.List; +import androidx.annotation.IdRes; +import androidx.fragment.app.Fragment; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertNotNull; diff --git a/catroid/src/test/java/org/catrobat/catroid/test/robolectric/bricks/BrickStringSpinnerTest.java b/catroid/src/test/java/org/catrobat/catroid/test/robolectric/bricks/BrickStringSpinnerTest.java index ddf213c6ac0..1c0ca4a5fb9 100644 --- a/catroid/src/test/java/org/catrobat/catroid/test/robolectric/bricks/BrickStringSpinnerTest.java +++ b/catroid/src/test/java/org/catrobat/catroid/test/robolectric/bricks/BrickStringSpinnerTest.java @@ -24,8 +24,6 @@ package org.catrobat.catroid.test.robolectric.bricks; import android.app.Activity; -import androidx.annotation.IdRes; -import androidx.fragment.app.Fragment; import android.view.View; import android.widget.Spinner; @@ -71,6 +69,9 @@ import java.util.Collection; import java.util.List; +import androidx.annotation.IdRes; +import androidx.fragment.app.Fragment; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertNotNull; diff --git a/catroid/src/test/java/org/catrobat/catroid/test/robolectric/bricks/BroadcastBrickTest.java b/catroid/src/test/java/org/catrobat/catroid/test/robolectric/bricks/BroadcastBrickTest.java index 57bc851218f..9fdcdba9f6f 100644 --- a/catroid/src/test/java/org/catrobat/catroid/test/robolectric/bricks/BroadcastBrickTest.java +++ b/catroid/src/test/java/org/catrobat/catroid/test/robolectric/bricks/BroadcastBrickTest.java @@ -25,7 +25,6 @@ import android.app.Activity; import android.content.DialogInterface; -import androidx.appcompat.app.AppCompatActivity; import android.view.View; import android.widget.Spinner; @@ -51,6 +50,8 @@ import java.util.Arrays; import java.util.Collection; +import androidx.appcompat.app.AppCompatActivity; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertNotNull; diff --git a/catroid/src/test/java/org/catrobat/catroid/test/robolectric/formulaeditor/FormulaEditorEditTextGenericTest.java b/catroid/src/test/java/org/catrobat/catroid/test/robolectric/formulaeditor/FormulaEditorEditTextGenericTest.java index e1132a8c788..3887af71832 100644 --- a/catroid/src/test/java/org/catrobat/catroid/test/robolectric/formulaeditor/FormulaEditorEditTextGenericTest.java +++ b/catroid/src/test/java/org/catrobat/catroid/test/robolectric/formulaeditor/FormulaEditorEditTextGenericTest.java @@ -25,7 +25,6 @@ import android.app.Activity; import android.os.SystemClock; -import androidx.annotation.IdRes; import android.view.MotionEvent; import android.view.View; import android.widget.EditText; @@ -50,6 +49,8 @@ import java.util.Arrays; +import androidx.annotation.IdRes; + import static org.junit.Assert.assertEquals; @RunWith(ParameterizedRobolectricTestRunner.class) diff --git a/catroid/src/test/java/org/catrobat/catroid/test/transfers/ProjectDownloaderTest.java b/catroid/src/test/java/org/catrobat/catroid/test/transfers/ProjectDownloaderTest.java index 9ed5cc94abe..90ec61d93e1 100644 --- a/catroid/src/test/java/org/catrobat/catroid/test/transfers/ProjectDownloaderTest.java +++ b/catroid/src/test/java/org/catrobat/catroid/test/transfers/ProjectDownloaderTest.java @@ -24,8 +24,6 @@ package org.catrobat.catroid.test.transfers; import android.content.Context; -import androidx.fragment.app.FragmentManager; -import androidx.appcompat.app.AppCompatActivity; import org.catrobat.catroid.R; import org.catrobat.catroid.ui.recyclerview.dialog.ReplaceExistingProjectDialogFragment; @@ -42,6 +40,9 @@ import java.io.UnsupportedEncodingException; import java.net.URLDecoder; +import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.FragmentManager; + import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; diff --git a/catroid/src/test/java/org/catrobat/catroid/test/transfers/ProjectUploadTest.kt b/catroid/src/test/java/org/catrobat/catroid/test/transfers/ProjectUploadTest.kt index e2dede644ac..622a850854a 100644 --- a/catroid/src/test/java/org/catrobat/catroid/test/transfers/ProjectUploadTest.kt +++ b/catroid/src/test/java/org/catrobat/catroid/test/transfers/ProjectUploadTest.kt @@ -24,15 +24,15 @@ package org.catrobat.catroid.test.transfers import android.content.SharedPreferences -import org.junit.Assert.assertEquals -import org.junit.Assert.assertTrue -import org.junit.Assert.fail import org.catrobat.catroid.common.Constants import org.catrobat.catroid.io.ProjectAndSceneScreenshotLoader import org.catrobat.catroid.io.ZipArchiver import org.catrobat.catroid.transfers.project.ProjectUpload import org.catrobat.catroid.transfers.project.ProjectUploadData import org.catrobat.catroid.web.ServerCalls +import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue +import org.junit.Assert.fail import org.junit.Before import org.junit.Test import org.junit.runner.RunWith diff --git a/catroid/src/test/java/org/catrobat/catroid/test/ui/HighlightBrickPartsTest.java b/catroid/src/test/java/org/catrobat/catroid/test/ui/HighlightBrickPartsTest.java index 1f07ee6992d..22016faebe0 100644 --- a/catroid/src/test/java/org/catrobat/catroid/test/ui/HighlightBrickPartsTest.java +++ b/catroid/src/test/java/org/catrobat/catroid/test/ui/HighlightBrickPartsTest.java @@ -25,7 +25,6 @@ import android.content.Context; import android.graphics.Canvas; -import androidx.annotation.IdRes; import android.view.View; import org.catrobat.catroid.ProjectManager; @@ -51,6 +50,8 @@ import java.util.Arrays; import java.util.List; +import androidx.annotation.IdRes; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; diff --git a/catroid/src/test/java/org/catrobat/catroid/test/utiltests/NumberFormatsTest.java b/catroid/src/test/java/org/catrobat/catroid/test/utiltests/NumberFormatsTest.java index 35fe9aba5a8..f2beaced531 100644 --- a/catroid/src/test/java/org/catrobat/catroid/test/utiltests/NumberFormatsTest.java +++ b/catroid/src/test/java/org/catrobat/catroid/test/utiltests/NumberFormatsTest.java @@ -23,14 +23,14 @@ package org.catrobat.catroid.test.utiltests; -import androidx.annotation.IdRes; - import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import java.util.Arrays; +import androidx.annotation.IdRes; + import static junit.framework.Assert.assertEquals; import static org.catrobat.catroid.utils.NumberFormats.stringWithoutTrailingZero; From f8ac6fb26b89f9b41fbb303b2ed0f19322a9f25e Mon Sep 17 00:00:00 2001 From: Stefan Simon Date: Wed, 1 Jan 2020 08:44:34 +0100 Subject: [PATCH 09/16] AndroidX - manual adjustments - use correct dependencies and imports - remove deprecated version of InstrumentationProvider --- catroid/build.gradle | 34 +++++------- catroid/config/lint-baseline.xml | 55 ++++++++++++------- .../CatrobatTestRunner.java | 26 ++++----- .../catroid/runner/AndroidPackageRunner.java | 6 +- .../catroid/ScreenshotsForAppStore.java | 26 ++++----- .../lunaandcat/ScreenshotsForAppStore.java | 24 ++++---- .../catroid/test/BricksHelpUrlTest.java | 10 ++-- .../catroid/test/ProjectManagerTest.java | 29 +++++----- .../common/DefaultProjectHandlerTest.java | 10 ++-- .../catroid/test/common/LookDataTest.java | 17 +++--- .../content/actions/PlaySoundActionTest.java | 12 ++-- .../content/actions/SetNfcTagActionTest.java | 9 +-- .../content/actions/StitchActionTest.java | 10 ++-- .../actions/StopAllSoundsActionTest.java | 12 ++-- .../XstreamParserTest.java | 19 ++++--- .../content/bricks/BrickCategoryTest.java | 11 ++-- .../bricks/BrickFormulaDefaultValueTest.java | 11 ++-- .../controller/LookControllerTest.java | 13 +++-- .../controller/SceneControllerTest.java | 13 +++-- .../controller/SoundControllerTest.java | 11 ++-- .../controller/SpriteControllerTest.java | 15 ++--- .../MessageContainerSaveStateTest.java | 12 ++-- .../MessageContainerTest.java | 16 +++--- .../test/content/script/WhenScriptTest.java | 10 ++-- .../script/WhenTouchDownScriptTest.java | 10 ++-- .../test/content/sprite/SpriteTest.java | 10 ++-- .../devices/arduino/ArduinoSettingsTest.java | 17 +++--- .../mindstorms/ev3/LegoEV3ImplTest.java | 9 +-- .../mindstorms/ev3/LegoEV3MotorTest.java | 9 +-- .../mindstorms/ev3/LegoEV3SensorTest.java | 9 +-- .../mindstorms/nxt/LegoNXTImplTest.java | 15 ++--- .../nxt/PreferencesSensorMappingTest.java | 7 ++- .../test/devices/phiro/PhiroSettingsTest.java | 22 ++++---- .../test/embroidery/DSTFileGeneratorTest.java | 15 ++--- .../test/embroidery/DSTHeaderTest.java | 10 ++-- .../EmbroideryFileExporterTest.java | 11 ++-- .../test/embroidery/RunningStitchTest.java | 4 +- .../embroidery/SimpleRunningStitchTest.java | 4 +- .../formulaeditor/DeleteInternTokenTest.java | 14 ++--- .../test/formulaeditor/InternFormulaTest.java | 34 ++++++------ .../InternTokenInsertTokenTest.java | 12 ++-- .../NoSelectionInternTokenTest.java | 14 ++--- .../test/formulaeditor/ParserTestSensors.java | 23 ++++---- ...sorPositionInternTokenByTokenListTest.java | 8 +-- ...ternTokenFunctionWithOneParameterTest.java | 10 ++-- ...ernTokenFunctionWithTwoParametersTest.java | 8 +-- .../DefaultChromeCastProgramLoadingTest.java | 14 ++--- .../io/DefaultDroneProgramLoadingTest.java | 13 +++-- .../DefaultJumpingSumoProgramLoadingTest.java | 9 +-- .../catroid/test/io/ResourceImporterTest.java | 14 ++--- .../catroid/test/io/SoundManagerTest.java | 12 ++-- .../catroid/test/io/StageAudioFocusTest.java | 9 +-- .../test/io/XstreamSerializerTest.java | 30 +++++----- .../asynctask/InvalidProjectSaveTaskTest.java | 10 ++-- .../io/asynctask/ProjectExportTaskTest.java | 19 ++++--- ...rojectRenameSpecialCharactersTaskTest.java | 14 ++--- .../io/asynctask/ProjectRenameTaskTest.java | 14 ++--- .../ProjectUnzipAndImportTaskTest.java | 12 ++-- ...eviceUserListAccessorCleanRoutineTest.java | 10 ++-- .../DeviceUserListAccessorNullValueTest.java | 10 ++-- ...serListAccessorParameterizedValueTest.java | 8 +-- ...eviceVariableAccessorCleanRoutineTest.java | 10 ++-- .../DeviceVariableAccessorNullValueTest.java | 8 +-- ...ariableAccessorParameterizedValueTest.java | 8 +-- .../io/filepicker/ListProjectFilesTest.java | 10 ++-- .../UnzipProjectFromAssetsTest.java | 13 +++-- .../test/io/ziparchiver/ZipFolderTest.java | 10 ++-- .../physics/PhysicsActiveStageAreaTest.java | 10 ++-- .../test/physics/PhysicsShapeBuilderTest.java | 15 ++--- .../physics/PhysicsShapeScaleUtilsTest.java | 13 +++-- .../test/physics/PhysicsSpriteCloneTest.java | 13 +++-- .../catroid/test/physics/PhysicsTestRule.java | 11 ++-- .../physics/actions/SetLookActionTest.java | 10 ++-- .../CollisionDetectionAdvancedTest.java | 13 +++-- ...CollisionDetectionPolygonCreationTest.java | 13 +++-- .../CollisionFormulaConversionTest.java | 24 ++++---- .../collision/CollisionInformationTest.java | 20 ++++--- .../physics/collision/CollisionTestUtils.java | 7 ++- .../physics/look/PhysicsLookDataTest.java | 13 +++-- .../note/midi/ProjectToMidiConverterTest.java | 11 ++-- .../scratchconverter/WebSocketClientTest.java | 9 +-- .../WebSocketMessageListenerTest.java | 9 +-- .../catroid/test/sensing/TouchesEdgeTest.java | 13 +++-- .../test/sensing/TouchesFingerTest.java | 13 +++-- .../catroid/test/stage/DrawAxesTest.java | 10 ++-- .../test/ui/BaseExceptionHandlerTest.java | 9 +-- .../catroid/test/utils/TestUtils.java | 7 ++- .../DefaultProjectComparatorTest.java | 36 ++++++------ .../test/web/AuthenticationCallsTest.java | 11 ++-- .../catroid/test/web/CrashReporterTest.java | 7 ++- .../SettingsFragmentCrashReporterTest.java | 7 ++- .../app/BroadcastBrickMessageUpdateTest.java | 10 ++-- .../brick/app/PlaySoundAndWaitBrickTest.java | 28 +++++----- .../content/brick/app/PlaySoundBrickTest.java | 28 +++++----- .../brick/app/PointToBrickAdditionalTest.java | 30 +++++----- .../content/brick/app/SceneBricksTest.java | 20 +++---- .../content/brick/rtl/RtlBrickTest.java | 29 +++++----- .../brick/stage/AskBrickStageTest.java | 19 ++++--- .../brick/stage/PlaySoundBrickStageTest.java | 17 +++--- .../brick/stage/SayBubbleBrickStageTest.java | 10 ++-- .../stage/SayForBubbleBrickStageTest.java | 16 +++--- .../stage/SceneTransitionBrickStageTest.java | 12 ++-- ...eneTransitionTouchEventRegressionTest.java | 12 ++-- .../stage/ThinkBubbleBrickStageTest.java | 10 ++-- .../stage/ThinkForBubbleBrickStageTest.java | 16 +++--- .../stage/WhenNfcBrickHardwareStageTest.java | 16 +++--- .../WhenNfcBrickStageFromScriptTest.java | 19 ++++--- .../brick/stage/WhenNfcBrickStageTest.java | 7 ++- .../content/brick/utils/BrickTestUtils.java | 8 +-- ...dcastAndWaitBrickMessageContainerTest.java | 22 ++++---- .../BroadcastMessageBrickUtils.java | 7 ++- ...dcastReceiveBrickMessageContainerTest.java | 22 ++++---- ...roadcastSendBrickMessageContainerTest.java | 22 ++++---- ...tectionFormulaEditorComputeDialogTest.java | 19 ++++--- .../FaceDetectionResourceStartedTest.java | 16 +++--- .../FormulaEditorBrickViewOnClickTest.java | 22 ++++---- .../FormulaEditorDeleteVariableTest.java | 16 +++--- .../FormulaEditorFragmentTest.java | 16 +++--- .../FormulaEditorKeyboardTest.java | 14 ++--- .../formulaeditor/FormulaEditorTest.java | 14 ++--- ...ormulaEditorLocaleVariableComputeTest.java | 14 ++--- .../LookFromGalleryIntentDismissTest.java | 23 ++++---- .../gallery/LookFromGalleryIntentTest.java | 28 +++++----- .../SpriteFromGalleryIntentDismissTest.java | 23 ++++---- .../gallery/SpriteFromGalleryIntentTest.java | 28 +++++----- .../PocketPaintEditLookIntentTest.java | 30 +++++----- .../PocketPaintNewLookDiscardIntentTest.java | 21 +++---- .../PocketPaintNewLookIntentTest.java | 23 ++++---- ...PocketPaintNewSpriteDiscardIntentTest.java | 21 +++---- .../PocketPaintNewSpriteIntentTest.java | 25 +++++---- .../SoundFromGalleryIntentDismissTest.java | 23 ++++---- .../gallery/SoundFromGalleryIntentTest.java | 28 +++++----- .../CameraPermissionSpriteActivityTest.java | 24 ++++---- .../pocketmusic/PocketMusicActivityTest.java | 21 +++---- ...AndWaitForDeletedClonesRegressionTest.java | 10 ++-- .../BroadcastForClonesRegressionTest.java | 14 ++--- ...oadcastForDeletedClonesRegressionTest.java | 10 ++-- .../DisabledBrickInClonesRegressionTest.java | 10 ++-- .../uiespresso/stage/ObjectVariableTest.java | 10 ++-- .../stage/StageResourceFailedTest.java | 12 ++-- .../uiespresso/stage/StageSimpleTest.java | 19 ++++--- .../uiespresso/stage/StartStageTouchTest.java | 12 ++-- ...tingFormulaEditorTwoScenesProjectTest.java | 16 +++--- .../ui/actionbar/ActionModeMergeTest.java | 18 +++--- .../ui/activity/OpenFromShareLinkTest.java | 21 +++---- .../activity/PrivacyPolicyDisclaimerTest.java | 21 +++---- ...tActivityNumberOfBricksRegressionTest.java | 16 +++--- .../ui/activity/ProjectActivityTest.java | 22 ++++---- .../ui/activity/ProjectListActivityTest.java | 12 ++-- .../ProjectUploadRatingDialogTest.java | 24 ++++---- .../ui/activity/SettingsFragmentTest.java | 33 +++++------ ...berAtShowDetailsAtProjectActivityTest.java | 22 ++++---- .../ui/activity/rtl/LanguagePickerTest.java | 25 +++++---- .../ui/activity/rtl/RTLMainMenuTest.java | 19 ++++--- .../uiespresso/ui/dialog/AboutDialogTest.java | 15 ++--- .../ui/dialog/DeleteLookDialogTest.java | 27 ++++----- .../ui/dialog/DeleteSoundDialogTest.java | 27 ++++----- .../ui/dialog/DeleteSpriteDialogTest.java | 20 +++---- .../FormulaEditorComputeDialogTest.java | 23 ++++---- .../LegoSensorPortConfigDialogTest.java | 27 ++++----- .../ui/dialog/OrientationDialogTest.java | 25 +++++---- .../ui/dialog/PlaySceneDialogTest.java | 14 ++--- .../ui/dialog/TermsOfUseDialogTest.java | 21 +++---- .../ui/fragment/AddUserbrickTest.java | 16 +++--- .../uiespresso/ui/fragment/CopyLookTest.java | 21 +++---- .../ui/fragment/CopyProjectTest.java | 31 ++++++----- .../uiespresso/ui/fragment/CopySceneTest.java | 28 +++++----- .../uiespresso/ui/fragment/CopySoundTest.java | 21 +++---- .../ui/fragment/DeleteAllScenesTest.java | 19 ++++--- .../ui/fragment/DeleteFirstSceneTest.java | 21 +++---- .../ui/fragment/DeleteLookTest.java | 25 +++++---- .../ui/fragment/DeleteProjectTest.java | 18 +++--- .../ui/fragment/DeleteSoundTest.java | 25 +++++---- .../ui/fragment/MergeProjectDialogTest.java | 18 +++--- .../ui/fragment/MergeProjectNameTest.java | 21 +++---- .../ui/fragment/RenameLookTest.java | 26 +++++---- .../ui/fragment/RenameProjectTest.java | 27 ++++----- .../ui/fragment/RenameSceneTest.java | 25 +++++---- .../ui/fragment/RenameSoundTest.java | 26 +++++---- .../ui/fragment/RenameSpriteTest.java | 23 ++++---- .../ui/fragment/ScriptFragmentTest.java | 26 ++++----- ...ntExplanationTextNoObjectsProjectTest.java | 16 +++--- ...tExplanationTextProjectWithObjectTest.java | 16 +++--- .../hints/Android9SnackbarRegressionTest.java | 21 +++---- ...ragmentActivityRecreateRegressionTest.java | 18 +++--- ...ialogActivityRecreationRegressionTest.java | 18 +++--- ...ragmentActivityRecreateRegressionTest.java | 19 ++++--- ...ragemtnActivityRecreateRegressionTest.java | 20 ++++--- ...eDialogActivityRecreateRegressionTest.java | 12 ++-- ...ectListActivityRecreateRegressionTest.java | 17 +++--- ...ragmentActivityRecreateRegressionTest.java | 15 ++--- ...ragmentActivityRecreateRegressionTest.java | 16 +++--- ...ragmentActivityRecreateRegressionTest.java | 19 ++++--- ...ragmentActivityRecreateRegressionTest.java | 17 +++--- .../catroid/uiespresso/util/UiTestUtils.java | 27 ++++----- ...enerateDefaultProjectActivityTestRule.java | 7 ++- .../util/rules/ScreenshotOnFailRule.java | 8 ++- .../catrobat/catroid/dagger/AppComponent.kt | 27 ++++++++- .../catroid/transfers/GoogleLoginHandler.java | 6 +- 199 files changed, 1754 insertions(+), 1583 deletions(-) diff --git a/catroid/build.gradle b/catroid/build.gradle index d32cb2ff302..734dbe55eff 100644 --- a/catroid/build.gradle +++ b/catroid/build.gradle @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -51,8 +51,7 @@ ext { projectVersion = "0.9" gdxVersion = "1.9.10" mockitoVersion = "2.8.47" - espressoVersion = "3.0.1" - supportLibraryVersion = "28.0.0" + espressoVersion = "3.1.0" paintroidVersion = "2.4.1" } @@ -318,19 +317,18 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" // Support libraries - implementation 'androidx.appcompat:appcompat:1.0.0' - implementation 'androidx.mediarouter:mediarouter:1.0.0' + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'androidx.mediarouter:mediarouter:1.1.0' implementation 'androidx.cardview:cardview:1.0.0' implementation 'com.google.android.material:material:1.0.0' - implementation 'androidx.browser:browser:1.0.0' + implementation 'androidx.browser:browser:1.2.0' - implementation 'androidx.test.espresso:espresso-idling-resource:3.1.0' - implementation 'androidx.multidex:multidex:2.0.0' + implementation "androidx.test.espresso:espresso-idling-resource:$espressoVersion" + implementation 'androidx.multidex:multidex:2.0.1' // Dagger implementation 'com.google.dagger:dagger:2.21' implementation 'com.google.dagger:dagger-android:2.21' - implementation 'com.google.dagger:dagger-android-support:2.21' kapt 'com.google.dagger:dagger-compiler:2.21' kapt 'com.google.dagger:dagger-android-processor:2.21' @@ -343,7 +341,7 @@ dependencies { // Analytics implementation 'com.google.android.gms:play-services-analytics:12.0.0' - implementation 'com.google.guava:guava:19.0' + implementation 'com.google.guava:guava:28.2-android' implementation 'com.google.code.gson:gson:2.8.0' implementation 'com.koushikdutta.async:androidasync:2.2.1' @@ -381,12 +379,11 @@ dependencies { implementation 'com.google.android.gms:play-services-auth:12.0.0' - androidTestImplementation ('tools.fastlane:screengrab:1.1.0'){ - exclude group: 'com.android.support' - } - androidTestImplementation ('androidx.test.espresso:espresso-web:3.1.0') { - exclude group: 'com.android.support' + androidTestImplementation('tools.fastlane:screengrab:1.2.0') { + // https://issuetracker.google.com/issues/123060356 + exclude group: 'com.android.support.test.uiautomator', module: 'uiautomator-v18' } + androidTestImplementation "androidx.test.espresso:espresso-web:$espressoVersion" implementation ('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') { transitive = true @@ -405,14 +402,13 @@ dependencies { testImplementation 'org.reflections:reflections:0.9.11' - androidTestImplementation fileTree(include: '*.jar', dir: 'src/androidTest/libs') androidTestImplementation 'com.linkedin.dexmaker:dexmaker-mockito:2.2.0' androidTestImplementation "org.mockito:mockito-core:$mockitoVersion" androidTestImplementation 'androidx.test.ext:junit:1.1.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' - androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.1.0' - androidTestImplementation 'androidx.test.espresso:espresso-intents:3.1.0' + androidTestImplementation "androidx.test.espresso:espresso-core:$espressoVersion" + androidTestImplementation "androidx.test.espresso:espresso-contrib:$espressoVersion" + androidTestImplementation "androidx.test.espresso:espresso-intents:$espressoVersion" androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0' } diff --git a/catroid/config/lint-baseline.xml b/catroid/config/lint-baseline.xml index 933cc03acf5..14427e34222 100644 --- a/catroid/config/lint-baseline.xml +++ b/catroid/config/lint-baseline.xml @@ -1,4 +1,5 @@ + + + + + + @@ -41,7 +54,7 @@ errorLine2=" ~~~~~~"> @@ -52,7 +65,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -63,7 +76,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~"> @@ -74,7 +87,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -85,7 +98,7 @@ errorLine2=" ^"> @@ -107,7 +120,7 @@ errorLine2=" ~~~~~~"> @@ -118,7 +131,7 @@ errorLine2=" ~~~~~~"> @@ -129,7 +142,7 @@ errorLine2=" ~~~~~~"> @@ -140,7 +153,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -151,7 +164,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -351,7 +364,7 @@ errorLine2=" ~~~~~~~~~~~~"> @@ -362,7 +375,7 @@ errorLine2=" ~~~~~~~"> @@ -373,7 +386,7 @@ errorLine2=" ~~~~~~~"> @@ -384,7 +397,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -395,7 +408,7 @@ errorLine2=" ~~~~~~~"> @@ -417,7 +430,7 @@ errorLine2=" ~~~~~~~"> @@ -428,7 +441,7 @@ errorLine2=" ~~~~~~~~~~~~"> @@ -439,7 +452,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -450,7 +463,7 @@ errorLine2=" ~~~~~~~"> diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/catrobattestrunner/CatrobatTestRunner.java b/catroid/src/androidTest/java/org/catrobat/catroid/catrobattestrunner/CatrobatTestRunner.java index 07882c44adb..3638be962f7 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/catrobattestrunner/CatrobatTestRunner.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/catrobattestrunner/CatrobatTestRunner.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,11 +23,6 @@ package org.catrobat.catroid.catrobattestrunner; import android.app.Instrumentation; -import android.support.test.InstrumentationRegistry; -import androidx.test.espresso.UiController; -import androidx.test.espresso.ViewAction; -import androidx.test.rule.ActivityTestRule; -import android.view.View; import org.catrobat.catroid.common.Constants; import org.catrobat.catroid.io.StorageOperations; @@ -48,11 +43,10 @@ import java.util.ArrayList; import java.util.List; -import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; -import static androidx.test.espresso.matcher.ViewMatchers.isRoot; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.rule.ActivityTestRule; -import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.fail; import static junit.framework.TestCase.assertTrue; @@ -86,7 +80,12 @@ public static Iterable data() throws IOException { private static List getCatrobatAssetsFromPath(String path) throws IOException { List parameters = new ArrayList<>(); - for (String asset : InstrumentationRegistry.getContext().getAssets().list(path)) { + String[] assets = InstrumentationRegistry.getInstrumentation().getContext().getAssets().list(path); + if (null == assets) { + fail("Could not load assets"); + return parameters; + } + for (String asset : assets) { if (asset.endsWith(Constants.CATROBAT_EXTENSION)) { parameters.add(new Object[] {path, asset}); } else { @@ -104,7 +103,8 @@ public void setUp() throws Exception { DEFAULT_ROOT_DIRECTORY.mkdir(); CACHE_DIR.mkdir(); - InputStream inputStream = InstrumentationRegistry.getContext().getAssets() + InputStream inputStream = + InstrumentationRegistry.getInstrumentation().getContext().getAssets() .open(assetPath + "/" + assetName); File projectArchive = StorageOperations @@ -116,7 +116,7 @@ public void setUp() throws Exception { File projectDir = new File(DEFAULT_ROOT_DIRECTORY, projectName); assertTrue(ProjectLoadTask - .task(projectDir, InstrumentationRegistry.getTargetContext())); + .task(projectDir, ApplicationProvider.getApplicationContext())); } @After diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/runner/AndroidPackageRunner.java b/catroid/src/androidTest/java/org/catrobat/catroid/runner/AndroidPackageRunner.java index fa700ae714d..db93c2e06a1 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/runner/AndroidPackageRunner.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/runner/AndroidPackageRunner.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,7 +23,6 @@ package org.catrobat.catroid.runner; -import android.support.test.InstrumentationRegistry; import android.util.Log; import org.junit.runner.Description; @@ -43,6 +42,7 @@ import java.util.Enumeration; import java.util.List; +import androidx.test.platform.app.InstrumentationRegistry; import dalvik.system.DexFile; public class AndroidPackageRunner extends ParentRunner { @@ -62,7 +62,7 @@ private static Class[] getAllClassesInAnnotatedPath(Class klass) throws In } ArrayList classes = new ArrayList<>(); try { - String packageCodePath = InstrumentationRegistry.getContext().getPackageCodePath(); + String packageCodePath = InstrumentationRegistry.getInstrumentation().getContext().getPackageCodePath(); DexFile dexFile = new DexFile(packageCodePath); for (Enumeration iter = dexFile.entries(); iter.hasMoreElements(); ) { String className = iter.nextElement(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/screenshots/catroid/ScreenshotsForAppStore.java b/catroid/src/androidTest/java/org/catrobat/catroid/screenshots/catroid/ScreenshotsForAppStore.java index 1c0f71bc6fb..4e8649bb0be 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/screenshots/catroid/ScreenshotsForAppStore.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/screenshots/catroid/ScreenshotsForAppStore.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,11 +24,6 @@ package org.catrobat.catroid.screenshots.catroid; import android.preference.PreferenceManager; -import android.support.test.InstrumentationRegistry; -import androidx.test.espresso.contrib.RecyclerViewActions; -import androidx.test.espresso.web.webdriver.Locator; -import androidx.test.rule.ActivityTestRule; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.ui.MainMenuActivity; @@ -39,10 +34,21 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.espresso.contrib.RecyclerViewActions; +import androidx.test.espresso.web.webdriver.Locator; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.rule.ActivityTestRule; import tools.fastlane.screengrab.Screengrab; import tools.fastlane.screengrab.UiAutomatorScreenshotStrategy; import tools.fastlane.screengrab.locale.LocaleTestRule; +import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.FORMULA_EDITOR_TEXT_FIELD_MATCHER; +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; +import static org.hamcrest.Matchers.allOf; +import static org.hamcrest.Matchers.anything; + import static androidx.test.espresso.Espresso.onData; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; @@ -55,12 +61,6 @@ import static androidx.test.espresso.web.webdriver.DriverAtoms.findElement; import static androidx.test.espresso.web.webdriver.DriverAtoms.webClick; -import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.FORMULA_EDITOR_TEXT_FIELD_MATCHER; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; -import static org.hamcrest.Matchers.allOf; -import static org.hamcrest.Matchers.anything; - @RunWith(AndroidJUnit4.class) public class ScreenshotsForAppStore { @@ -75,7 +75,7 @@ public class ScreenshotsForAppStore { @Before public void setUp() { - PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()) + PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()) .edit() .putBoolean(AGREED_TO_PRIVACY_POLICY_SETTINGS_KEY, true) .commit(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/screenshots/lunaandcat/ScreenshotsForAppStore.java b/catroid/src/androidTest/java/org/catrobat/catroid/screenshots/lunaandcat/ScreenshotsForAppStore.java index 7b3b4b4593d..0665a45a2a0 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/screenshots/lunaandcat/ScreenshotsForAppStore.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/screenshots/lunaandcat/ScreenshotsForAppStore.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,10 +24,6 @@ package org.catrobat.catroid.screenshots.lunaandcat; import android.preference.PreferenceManager; -import android.support.test.InstrumentationRegistry; -import androidx.test.espresso.contrib.RecyclerViewActions; -import androidx.test.rule.ActivityTestRule; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.ui.MainMenuActivity; @@ -38,10 +34,20 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.espresso.contrib.RecyclerViewActions; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.rule.ActivityTestRule; import tools.fastlane.screengrab.Screengrab; import tools.fastlane.screengrab.UiAutomatorScreenshotStrategy; import tools.fastlane.screengrab.locale.LocaleTestRule; +import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.FORMULA_EDITOR_TEXT_FIELD_MATCHER; +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; +import static org.hamcrest.Matchers.allOf; +import static org.hamcrest.Matchers.anything; + import static androidx.test.espresso.Espresso.onData; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; @@ -51,12 +57,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.FORMULA_EDITOR_TEXT_FIELD_MATCHER; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; -import static org.hamcrest.Matchers.allOf; -import static org.hamcrest.Matchers.anything; - @RunWith(AndroidJUnit4.class) public class ScreenshotsForAppStore { @@ -71,7 +71,7 @@ public class ScreenshotsForAppStore { @Before public void setUp() { - PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()) + PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()) .edit() .putBoolean(AGREED_TO_PRIVACY_POLICY_SETTINGS_KEY, true) .commit(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/BricksHelpUrlTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/BricksHelpUrlTest.java index d0163ed9691..1ec277f7988 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/BricksHelpUrlTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/BricksHelpUrlTest.java @@ -22,7 +22,6 @@ */ package org.catrobat.catroid.test; -import android.support.test.InstrumentationRegistry; import android.util.Log; import org.catrobat.catroid.ProjectManager; @@ -43,6 +42,7 @@ import java.util.Map; import java.util.Set; +import androidx.test.platform.app.InstrumentationRegistry; import dalvik.system.DexFile; import static org.junit.Assert.assertEquals; @@ -407,7 +407,8 @@ public static Iterable data() { private static Set getAllBrickClasses() { ArrayList classes = new ArrayList<>(); try { - String packageCodePath = InstrumentationRegistry.getTargetContext().getPackageCodePath(); + String packageCodePath = + InstrumentationRegistry.getInstrumentation().getTargetContext().getPackageCodePath(); DexFile dexFile = new DexFile(packageCodePath); for (Enumeration iter = dexFile.entries(); iter.hasMoreElements(); ) { String className = iter.nextElement(); @@ -425,7 +426,8 @@ private static Set getAllBrickClasses() { @Before public void setUp() { - ProjectManager.getInstance().setCurrentProject(new Project(InstrumentationRegistry.getTargetContext(), "empty")); + ProjectManager.getInstance().setCurrentProject( + new Project(InstrumentationRegistry.getInstrumentation().getTargetContext(), "empty")); } @Test @@ -433,7 +435,7 @@ public void testBrickHelpUrl() throws IllegalAccessException, InstantiationException { Brick brick = (Brick) brickClass.newInstance(); String category = new CategoryBricksFactory().getBrickCategory(brick, false, - InstrumentationRegistry.getTargetContext()); + InstrumentationRegistry.getInstrumentation().getTargetContext()); String brickHelpUrl = brick.getHelpUrl(category); assertEquals(brickToHelpUrlMapping.get(simpleName), brickHelpUrl); } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/ProjectManagerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/ProjectManagerTest.java index 7ee9341da59..6a1bb3be088 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/ProjectManagerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/ProjectManagerTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,6 @@ package org.catrobat.catroid.test; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.UiTestCatroidApplication; @@ -48,6 +46,10 @@ import java.io.IOException; import java.io.InputStream; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertNotNull; @@ -76,7 +78,7 @@ public class ProjectManagerTest { @Before public void setUp() throws Exception { - Context targetContext = InstrumentationRegistry.getTargetContext(); + Context targetContext = ApplicationProvider.getApplicationContext(); ScreenValueHandler.updateScreenWidthAndHeight(targetContext); projectManager = UiTestCatroidApplication.projectManager; } @@ -85,7 +87,7 @@ public void setUp() throws Exception { public void tearDown() throws Exception { projectManager.setCurrentProject(null); TestUtils.deleteProjects(OLD_PROJECT, NEW_PROJECT); - TestUtils.removeFromPreferences(InstrumentationRegistry.getTargetContext(), Constants.PREF_PROJECTNAME_KEY); + TestUtils.removeFromPreferences(ApplicationProvider.getApplicationContext(), Constants.PREF_PROJECTNAME_KEY); } @Test @@ -94,7 +96,7 @@ public void testShouldReturnFalseIfCatrobatLanguageVersionNotSupported() throws .createProjectWithLanguageVersion(CATROBAT_LANGUAGE_VERSION_NOT_SUPPORTED, PROJECT_NAME); try { - projectManager.loadProject(project.getDirectory(), InstrumentationRegistry.getTargetContext()); + projectManager.loadProject(project.getDirectory(), ApplicationProvider.getApplicationContext()); fail("Project shouldn't be compatible"); } catch (CompatibilityProjectException expected) { } @@ -106,12 +108,12 @@ public void testShouldReturnFalseIfCatrobatLanguageVersionNotSupported() throws public void testShouldKeepExistingProjectIfCannotLoadNewProject() throws IOException, ProjectException { Project project = TestUtils.createProjectWithLanguageVersion(CURRENT_CATROBAT_LANGUAGE_VERSION, OLD_PROJECT); - projectManager.loadProject(project.getDirectory(), InstrumentationRegistry.getTargetContext()); + projectManager.loadProject(project.getDirectory(), ApplicationProvider.getApplicationContext()); TestUtils.createProjectWithLanguageVersion(CATROBAT_LANGUAGE_VERSION_NOT_SUPPORTED, PROJECT_NAME); try { - projectManager.loadProject(new File(NEW_PROJECT), InstrumentationRegistry.getTargetContext()); + projectManager.loadProject(new File(NEW_PROJECT), ApplicationProvider.getApplicationContext()); fail("Expected ProjectException while loading project " + NEW_PROJECT); } catch (ProjectException expected) { } @@ -129,14 +131,14 @@ public void testLoadProjectException() throws Exception { assertNull(projectManager.getCurrentProject()); exception.expect(ProjectException.class); - projectManager.loadProject(new File(NEW_PROJECT), InstrumentationRegistry.getTargetContext()); + projectManager.loadProject(new File(NEW_PROJECT), ApplicationProvider.getApplicationContext()); } @Test public void testSavingAProjectDuringDelete() throws IOException, ProjectException { Project project = TestUtils.createProjectWithLanguageVersion(CURRENT_CATROBAT_LANGUAGE_VERSION, PROJECT_NAME); - projectManager.loadProject(project.getDirectory(), InstrumentationRegistry.getTargetContext()); + projectManager.loadProject(project.getDirectory(), ApplicationProvider.getApplicationContext()); Project currentProject = projectManager.getCurrentProject(); assertNotNull(String.format("Could not load %s project.", PROJECT_NAME), currentProject); @@ -147,7 +149,7 @@ public void testSavingAProjectDuringDelete() throws IOException, ProjectExceptio // simulate multiple saving trigger asynchronous (occurs in black box testing) for (int i = 0; i < 3; i++) { currentProject.setDescription(currentProject.getDescription() + i); - new ProjectSaveTask(currentProject, InstrumentationRegistry.getTargetContext()) + new ProjectSaveTask(currentProject, ApplicationProvider.getApplicationContext()) .execute(); } @@ -163,11 +165,12 @@ public void testSavingAProjectDuringDelete() throws IOException, ProjectExceptio public void testLoadProjectWithInvalidNestingBrickReferences() throws IOException, ProjectException { DEFAULT_ROOT_DIRECTORY.mkdir(); - InputStream inputStream = InstrumentationRegistry.getContext().getAssets().open(ZIP_FILENAME_WRONG_NESTING_BRICKS); + InputStream inputStream = + InstrumentationRegistry.getInstrumentation().getContext().getAssets().open(ZIP_FILENAME_WRONG_NESTING_BRICKS); File projectDir = new File(DEFAULT_ROOT_DIRECTORY, PROJECT_NAME_NESTING_BRICKS); new ZipArchiver().unzip(inputStream, projectDir); - projectManager.loadProject(projectDir, InstrumentationRegistry.getTargetContext()); + projectManager.loadProject(projectDir, ApplicationProvider.getApplicationContext()); Project project = projectManager.getCurrentProject(); assertNotNull(project); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/common/DefaultProjectHandlerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/common/DefaultProjectHandlerTest.java index 60e427a77bc..ed991203bbc 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/common/DefaultProjectHandlerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/common/DefaultProjectHandlerTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -22,9 +22,6 @@ */ package org.catrobat.catroid.test.common; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.common.DefaultProjectHandler; import org.catrobat.catroid.content.Project; import org.catrobat.catroid.content.Scene; @@ -39,6 +36,9 @@ import java.io.IOException; import java.util.List; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; @@ -59,7 +59,7 @@ public void setUp() throws IOException { String projectName = "defaultProject"; project = DefaultProjectHandler - .createAndSaveDefaultProject(projectName, InstrumentationRegistry.getTargetContext(), false); + .createAndSaveDefaultProject(projectName, ApplicationProvider.getApplicationContext(), false); } @After diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/common/LookDataTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/common/LookDataTest.java index 253be8413ab..19923068200 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/common/LookDataTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/common/LookDataTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.test.common; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.common.Constants; import org.catrobat.catroid.common.LookData; import org.catrobat.catroid.io.ResourceImporter; @@ -39,6 +36,10 @@ import java.io.File; import java.io.IOException; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + import static junit.framework.Assert.assertEquals; import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; @@ -51,14 +52,14 @@ public class LookDataTest { @Before public void setUp() throws Exception { - StorageOperations.deleteDir(InstrumentationRegistry.getTargetContext().getCacheDir()); - imageFolder = new File(InstrumentationRegistry.getTargetContext().getCacheDir(), IMAGE_DIRECTORY_NAME); + StorageOperations.deleteDir(ApplicationProvider.getApplicationContext().getCacheDir()); + imageFolder = new File(ApplicationProvider.getApplicationContext().getCacheDir(), IMAGE_DIRECTORY_NAME); if (!imageFolder.exists()) { imageFolder.mkdirs(); } File imageFile = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.collision_donut, imageFolder, fileName, 1.0); @@ -67,7 +68,7 @@ public void setUp() throws Exception { @After public void tearDown() throws IOException { - StorageOperations.deleteDir(InstrumentationRegistry.getTargetContext().getCacheDir()); + StorageOperations.deleteDir(ApplicationProvider.getApplicationContext().getCacheDir()); } @Test diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/PlaySoundActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/PlaySoundActionTest.java index d77d6e5918d..8f38ef9443b 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/PlaySoundActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/PlaySoundActionTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.content.actions; import android.media.MediaPlayer; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.scenes.scene2d.Action; @@ -48,6 +46,10 @@ import java.io.IOException; import java.util.List; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertTrue; @@ -107,13 +109,13 @@ public void testPlaySimultaneousSounds() { private void createTestProject() throws IOException { String projectName = "testProject"; - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); XstreamSerializer.getInstance().saveProject(project); ProjectManager.getInstance().setCurrentProject(project); int soundFileId = R.raw.testsound; soundFile = ResourceImporter.createSoundFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), soundFileId, new File(project.getDefaultScene().getDirectory(), SOUND_DIRECTORY_NAME), "soundTest.mp3"); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/SetNfcTagActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/SetNfcTagActionTest.java index 6f0c1ab4eaf..965ee99c5b1 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/SetNfcTagActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/SetNfcTagActionTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,8 +24,6 @@ import android.nfc.FormatException; import android.nfc.NdefMessage; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.common.BrickValues; @@ -38,6 +36,9 @@ import java.nio.charset.Charset; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; import static org.junit.Assert.assertArrayEquals; @@ -63,7 +64,7 @@ public class SetNfcTagActionTest { @Before public void setUp() throws Exception { - project = new Project(InstrumentationRegistry.getTargetContext(), "testProject"); + project = new Project(ApplicationProvider.getApplicationContext(), "testProject"); ProjectManager.getInstance().setCurrentProject(project); } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/StitchActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/StitchActionTest.java index 9d2f2d42109..c9eb1e66cd8 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/StitchActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/StitchActionTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -22,9 +22,8 @@ */ package org.catrobat.catroid.test.content.actions; + import android.graphics.PointF; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.ActionFactory; @@ -40,6 +39,9 @@ import org.junit.runner.RunWith; import org.mockito.Mockito; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + @RunWith(AndroidJUnit4.class) public class StitchActionTest { private Sprite testSprite1; @@ -61,7 +63,7 @@ public void setUp() throws Exception { testSprite2 = new Sprite("testSprite2"); spriteCoords2 = new PointF(0, 0); - project = new Project(InstrumentationRegistry.getTargetContext(), "testProject"); + project = new Project(ApplicationProvider.getApplicationContext(), "testProject"); ProjectManager.getInstance().setCurrentProject(project); StageActivity.stageListener = Mockito.mock(StageListener.class); StageActivity.stageListener.embroideryPatternManager = Mockito.mock(DSTPatternManager.class); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/StopAllSoundsActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/StopAllSoundsActionTest.java index 8c88ac5a96b..8f1d2cef103 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/StopAllSoundsActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/actions/StopAllSoundsActionTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.content.actions; import android.media.MediaPlayer; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.scenes.scene2d.Action; @@ -48,6 +46,10 @@ import java.io.IOException; import java.util.List; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; @@ -122,13 +124,13 @@ public void testStopSimultaneousPlayingSounds() throws Exception { private void createTestProject() throws IOException { final String projectName = TestUtils.DEFAULT_TEST_PROJECT_NAME; - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); XstreamSerializer.getInstance().saveProject(project); ProjectManager.getInstance().setCurrentProject(project); int soundFileId = R.raw.testsound; soundFile = ResourceImporter.createSoundFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), soundFileId, new File(project.getDefaultScene().getDirectory(), SOUND_DIRECTORY_NAME), "soundTest.mp3"); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/backwardcompatibility/XstreamParserTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/backwardcompatibility/XstreamParserTest.java index 4ba3108ce1b..04e8d952ab3 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/backwardcompatibility/XstreamParserTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/backwardcompatibility/XstreamParserTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.content.backwardcompatibility; -import android.support.test.InstrumentationRegistry; - import org.catrobat.catroid.R; import org.catrobat.catroid.content.Project; import org.catrobat.catroid.content.Scene; @@ -40,6 +38,9 @@ import java.io.IOException; import java.io.InputStream; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.platform.app.InstrumentationRegistry; + import static junit.framework.Assert.assertNotNull; import static junit.framework.Assert.assertNull; @@ -59,7 +60,7 @@ public void tearDown() throws IOException { } private void copyProjectFromAssets(String assetName, String projectName) throws IOException { - InputStream inputStream = InstrumentationRegistry.getContext().getAssets().open(assetName); + InputStream inputStream = InstrumentationRegistry.getInstrumentation().getContext().getAssets().open(assetName); new ZipArchiver().unzip(inputStream, new File(DEFAULT_ROOT_DIRECTORY, projectName)); } @@ -68,7 +69,7 @@ private void testLoadProjectWithoutScenes(String projectName, String assetName) projectDir = new File(DEFAULT_ROOT_DIRECTORY, projectName); Project project = XstreamSerializer.getInstance() - .loadProject(projectDir, InstrumentationRegistry.getTargetContext()); + .loadProject(projectDir, ApplicationProvider.getApplicationContext()); assertNotNull(project); @@ -76,7 +77,7 @@ private void testLoadProjectWithoutScenes(String projectName, String assetName) assertEquals(1, project.getSceneList().size()); - assertEquals(InstrumentationRegistry.getTargetContext().getString(R.string.default_scene_name, 1), + assertEquals(ApplicationProvider.getApplicationContext().getString(R.string.default_scene_name, 1), project.getSceneList().get(0).getName()); } @@ -121,7 +122,7 @@ public void testLoadProjectLanguageVersion0999() throws IOException, LoadingProj projectDir = new File(DEFAULT_ROOT_DIRECTORY, projectName); Project project = XstreamSerializer.getInstance() - .loadProject(projectDir, InstrumentationRegistry.getTargetContext()); + .loadProject(projectDir, ApplicationProvider.getApplicationContext()); assertNotNull(project); @@ -132,10 +133,10 @@ public void testLoadProjectLanguageVersion0999() throws IOException, LoadingProj Scene scene1 = project.getSceneList().get(0); Scene scene2 = project.getSceneList().get(1); - assertEquals(InstrumentationRegistry.getTargetContext().getString(R.string.default_scene_name, 1), + assertEquals(ApplicationProvider.getApplicationContext().getString(R.string.default_scene_name, 1), scene1.getName()); - assertEquals(InstrumentationRegistry.getTargetContext().getString(R.string.default_scene_name, 2), + assertEquals(ApplicationProvider.getApplicationContext().getString(R.string.default_scene_name, 2), scene2.getName()); assertNotNull(UserDataWrapper.getUserVariable("localVar", diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickCategoryTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickCategoryTest.java index ec383e5e73c..0daa562d39e 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickCategoryTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickCategoryTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -25,7 +25,6 @@ import android.content.Context; import android.preference.PreferenceManager; -import android.support.test.InstrumentationRegistry; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; @@ -200,6 +199,8 @@ import java.util.Collection; import java.util.List; +import androidx.test.core.app.ApplicationProvider; + import static junit.framework.Assert.assertEquals; @RunWith(Parameterized.class) @@ -391,9 +392,9 @@ public static Collection data() { @Before public void setUp() throws Exception { - PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()).edit().clear().commit(); + PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()).edit().clear().commit(); - createProject(InstrumentationRegistry.getTargetContext()); + createProject(ApplicationProvider.getApplicationContext()); categoryBricksFactory = new CategoryBricksFactory(); } @@ -413,7 +414,7 @@ public void createProject(Context context) { @Test public void testBrickCategory() { List categoryBricks = categoryBricksFactory.getBricks(category, false, - InstrumentationRegistry.getTargetContext()); + ApplicationProvider.getApplicationContext()); List brickClasses = new ArrayList<>(); for (Brick brick : categoryBricks) { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickFormulaDefaultValueTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickFormulaDefaultValueTest.java index bb5047d13b4..780db3b271f 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickFormulaDefaultValueTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickFormulaDefaultValueTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,7 +24,6 @@ package org.catrobat.catroid.test.content.bricks; import android.content.Context; -import android.support.test.InstrumentationRegistry; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -109,6 +108,8 @@ import java.util.Collection; import java.util.List; +import androidx.test.core.app.ApplicationProvider; + import static junit.framework.Assert.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -230,7 +231,7 @@ public static Collection data() { @Before public void setUp() throws Exception { - createProject(InstrumentationRegistry.getTargetContext()); + createProject(ApplicationProvider.getApplicationContext()); categoryBricksFactory = new CategoryBricksFactory(); } @@ -250,7 +251,7 @@ public void createProject(Context context) { @Test public void testBrickCategory() { List categoryBricks = categoryBricksFactory.getBricks(category, false, - InstrumentationRegistry.getTargetContext()); + ApplicationProvider.getApplicationContext()); Brick brickInAdapter = null; for (Brick brick : categoryBricks) { @@ -262,7 +263,7 @@ public void testBrickCategory() { assertNotNull(brickInAdapter); Brick.BrickField brickField = ((FormulaBrick) brickInAdapter).brickFieldToTextViewIdMap.inverse().get(formulaTextFieldId); - String actual = ((FormulaBrick) brickInAdapter).getFormulaWithBrickField(brickField).getTrimmedFormulaString(InstrumentationRegistry.getTargetContext()); + String actual = ((FormulaBrick) brickInAdapter).getFormulaWithBrickField(brickField).getTrimmedFormulaString(ApplicationProvider.getApplicationContext()); assertEquals(expected, actual); } } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/LookControllerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/LookControllerTest.java index 14980ba3f93..d421ed96193 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/LookControllerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/LookControllerTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.test.content.controller; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.common.LookData; import org.catrobat.catroid.content.Project; @@ -44,6 +41,10 @@ import java.io.File; import java.io.IOException; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + import static junit.framework.Assert.assertEquals; import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; @@ -149,7 +150,7 @@ private void clearBackPack() throws IOException { } private void createProject() throws IOException { - project = new Project(InstrumentationRegistry.getTargetContext(), "LookControllerTest"); + project = new Project(ApplicationProvider.getApplicationContext(), "LookControllerTest"); scene = project.getDefaultScene(); ProjectManager.getInstance().setCurrentProject(project); @@ -158,7 +159,7 @@ private void createProject() throws IOException { XstreamSerializer.getInstance().saveProject(project); File imageFile = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.red_image, new File(project.getDefaultScene().getDirectory(), IMAGE_DIRECTORY_NAME), "red_image.bmp", diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/SceneControllerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/SceneControllerTest.java index 669662f9c9f..82790786905 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/SceneControllerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/SceneControllerTest.java @@ -23,9 +23,6 @@ package org.catrobat.catroid.test.content.controller; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.common.Constants; import org.catrobat.catroid.common.LookData; @@ -50,6 +47,10 @@ import java.io.File; import java.io.IOException; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertTrue; @@ -230,7 +231,7 @@ private void clearBackPack() throws IOException { } private void createProject() throws IOException { - project = new Project(InstrumentationRegistry.getTargetContext(), "SpriteControllerTest"); + project = new Project(ApplicationProvider.getApplicationContext(), "SpriteControllerTest"); scene = project.getDefaultScene(); ProjectManager.getInstance().setCurrentProject(project); @@ -250,7 +251,7 @@ private void createProject() throws IOException { XstreamSerializer.getInstance().saveProject(project); File imageFile = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.red_image, new File(project.getDefaultScene().getDirectory(), IMAGE_DIRECTORY_NAME), "red_image.png", @@ -259,7 +260,7 @@ private void createProject() throws IOException { sprite.getLookList().add(new LookData("testLook", imageFile)); File soundFile = ResourceImporter.createSoundFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.longsound, new File(project.getDefaultScene().getDirectory(), SOUND_DIRECTORY_NAME), "longsound.mp3"); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/SoundControllerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/SoundControllerTest.java index 3156a1a85cd..1a69bc7bb14 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/SoundControllerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/SoundControllerTest.java @@ -23,9 +23,6 @@ package org.catrobat.catroid.test.content.controller; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.common.SoundInfo; import org.catrobat.catroid.content.Project; @@ -44,6 +41,10 @@ import java.io.File; import java.io.IOException; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + import static junit.framework.Assert.assertEquals; import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; @@ -156,7 +157,7 @@ private void clearBackPack() throws IOException { } private void createProject() throws IOException { - project = new Project(InstrumentationRegistry.getTargetContext(), "SoundControllerTest"); + project = new Project(ApplicationProvider.getApplicationContext(), "SoundControllerTest"); scene = project.getDefaultScene(); ProjectManager.getInstance().setCurrentProject(project); @@ -166,7 +167,7 @@ private void createProject() throws IOException { XstreamSerializer.getInstance().saveProject(project); File soundFile = ResourceImporter.createSoundFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.longsound, new File(project.getDefaultScene().getDirectory(), SOUND_DIRECTORY_NAME), "longsound.mp3"); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/SpriteControllerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/SpriteControllerTest.java index 84e1be7a3bd..2ac22badafd 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/SpriteControllerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/controller/SpriteControllerTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.test.content.controller; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.common.LookData; import org.catrobat.catroid.common.SoundInfo; @@ -49,6 +46,10 @@ import java.io.File; import java.io.IOException; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertNotNull; import static junit.framework.Assert.assertNotSame; @@ -231,7 +232,7 @@ private void clearBackPack() throws IOException { } private void createProject() throws IOException { - project = new Project(InstrumentationRegistry.getTargetContext(), "SpriteControllerTest"); + project = new Project(ApplicationProvider.getApplicationContext(), "SpriteControllerTest"); scene = project.getDefaultScene(); ProjectManager.getInstance().setCurrentProject(project); @@ -246,7 +247,7 @@ private void createProject() throws IOException { XstreamSerializer.getInstance().saveProject(project); File imageFile = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.red_image, new File(project.getDefaultScene().getDirectory(), IMAGE_DIRECTORY_NAME), "red_image.bmp", @@ -255,7 +256,7 @@ private void createProject() throws IOException { sprite.getLookList().add(new LookData("testLook", imageFile)); File soundFile = ResourceImporter.createSoundFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.longsound, new File(project.getDefaultScene().getDirectory(), SOUND_DIRECTORY_NAME), "longsound.mp3"); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/messagecontainer/MessageContainerSaveStateTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/messagecontainer/MessageContainerSaveStateTest.java index 8fe37f0ebb7..8fd014a82a1 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/messagecontainer/MessageContainerSaveStateTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/messagecontainer/MessageContainerSaveStateTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -22,9 +22,6 @@ */ package org.catrobat.catroid.test.content.messagecontainer; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.common.FlavoredConstants; import org.catrobat.catroid.content.BroadcastScript; @@ -45,6 +42,9 @@ import java.io.File; import java.util.List; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; import static org.hamcrest.CoreMatchers.hasItem; @@ -80,7 +80,7 @@ public void testDoNotSaveUnusedMessages() { } private void createTestProjects() throws ProjectException { - Project project1 = new Project(InstrumentationRegistry.getTargetContext(), projectName1); + Project project1 = new Project(ApplicationProvider.getApplicationContext(), projectName1); Sprite sprite1 = new SingleSprite("cat"); Script script1 = new StartScript(); @@ -97,7 +97,7 @@ private void createTestProjects() throws ProjectException { XstreamSerializer.getInstance().saveProject(project1); ProjectManager.getInstance() - .loadProject(project1.getDirectory(), InstrumentationRegistry.getTargetContext()); + .loadProject(project1.getDirectory(), ApplicationProvider.getApplicationContext()); ProjectManager.getInstance() .setCurrentlyEditedScene(ProjectManager.getInstance().getCurrentProject().getDefaultScene()); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/messagecontainer/MessageContainerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/messagecontainer/MessageContainerTest.java index 509587ae823..2aaf2305f4d 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/messagecontainer/MessageContainerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/messagecontainer/MessageContainerTest.java @@ -22,9 +22,6 @@ */ package org.catrobat.catroid.test.content.messagecontainer; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.common.FlavoredConstants; import org.catrobat.catroid.content.BroadcastScript; @@ -46,6 +43,9 @@ import java.io.File; import java.util.List; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; import static org.hamcrest.CoreMatchers.hasItem; @@ -90,7 +90,7 @@ public void testLoadTwoProjects() throws ProjectException { currentProject.getBroadcastMessageContainer().update(); ProjectManager.getInstance() - .loadProject(project2.getDirectory(), InstrumentationRegistry.getTargetContext()); + .loadProject(project2.getDirectory(), ApplicationProvider.getApplicationContext()); currentProject = ProjectManager.getInstance().getCurrentProject(); ProjectManager.getInstance().setCurrentlyEditedScene(currentProject.getDefaultScene()); @@ -102,7 +102,7 @@ public void testLoadTwoProjects() throws ProjectException { } private void createTestProjects() throws ProjectException { - project1 = new Project(InstrumentationRegistry.getTargetContext(), projectName1); + project1 = new Project(ApplicationProvider.getApplicationContext(), projectName1); Sprite sprite1 = new SingleSprite("cat"); Script script1 = new StartScript(); @@ -116,9 +116,9 @@ private void createTestProjects() throws ProjectException { project1.getDefaultScene().addSprite(sprite1); ProjectSaveTask - .task(project1, InstrumentationRegistry.getTargetContext()); + .task(project1, ApplicationProvider.getApplicationContext()); - project2 = new Project(InstrumentationRegistry.getTargetContext(), projectName2); + project2 = new Project(ApplicationProvider.getApplicationContext(), projectName2); Sprite sprite2 = new SingleSprite("cat"); Script script2 = new StartScript(); @@ -134,6 +134,6 @@ private void createTestProjects() throws ProjectException { ProjectManager.getInstance() .loadProject(new File(FlavoredConstants.DEFAULT_ROOT_DIRECTORY, projectName2), - InstrumentationRegistry.getTargetContext()); + ApplicationProvider.getApplicationContext()); } } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/script/WhenScriptTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/script/WhenScriptTest.java index 1b16af5be33..d78589226dc 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/script/WhenScriptTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/script/WhenScriptTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.test.content.script; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.badlogic.gdx.graphics.Color; import org.catrobat.catroid.ProjectManager; @@ -44,6 +41,9 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; @RunWith(AndroidJUnit4.class) @@ -80,7 +80,7 @@ private Sprite createSprite() { } private Project createProjectWithSprite(Sprite sprite) { - Project project = new Project(InstrumentationRegistry.getInstrumentation().getTargetContext(), "testProject"); + Project project = new Project(ApplicationProvider.getApplicationContext(), "testProject"); ProjectManager.getInstance().setCurrentProject(project); project.getDefaultScene().addSprite(sprite); return project; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/script/WhenTouchDownScriptTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/script/WhenTouchDownScriptTest.java index 9046b86426b..5f465542d20 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/script/WhenTouchDownScriptTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/script/WhenTouchDownScriptTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.test.content.script; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; import org.catrobat.catroid.content.Script; @@ -40,6 +37,9 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; @RunWith(AndroidJUnit4.class) @@ -92,7 +92,7 @@ public void touchDownScriptRestartTest() { } private Project createProjectWithSprite(Sprite sprite) { - Project project = new Project(InstrumentationRegistry.getInstrumentation().getTargetContext(), "testProject"); + Project project = new Project(ApplicationProvider.getApplicationContext(), "testProject"); ProjectManager.getInstance().setCurrentProject(project); project.getDefaultScene().addSprite(sprite); return project; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/sprite/SpriteTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/sprite/SpriteTest.java index f4cead8689d..17a495a1706 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/sprite/SpriteTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/sprite/SpriteTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -22,9 +22,6 @@ */ package org.catrobat.catroid.test.content.sprite; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.ActionFactory; import org.catrobat.catroid.content.Project; @@ -44,6 +41,9 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; @@ -62,7 +62,7 @@ public class SpriteTest { @Before public void setUp() throws Exception { sprite = new SingleSprite("testSprite"); - project = new Project(InstrumentationRegistry.getTargetContext(), TestUtils.DEFAULT_TEST_PROJECT_NAME); + project = new Project(ApplicationProvider.getApplicationContext(), TestUtils.DEFAULT_TEST_PROJECT_NAME); project.getDefaultScene().addSprite(sprite); sprite.addUserVariable(new UserVariable(LOCAL_VARIABLE_NAME)); sprite.getUserVariable(LOCAL_VARIABLE_NAME).setValue(LOCAL_VARIABLE_VALUE); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/arduino/ArduinoSettingsTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/arduino/ArduinoSettingsTest.java index 3ee4df90f3e..07317843385 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/arduino/ArduinoSettingsTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/arduino/ArduinoSettingsTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,8 +24,6 @@ package org.catrobat.catroid.test.devices.arduino; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.common.FlavoredConstants; @@ -47,6 +45,9 @@ import java.io.File; import java.io.IOException; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; @@ -59,7 +60,7 @@ public class ArduinoSettingsTest { @Before public void setUp() throws Exception { - Context context = InstrumentationRegistry.getTargetContext(); + Context context = ApplicationProvider.getApplicationContext(); sharedPreferenceBuffer = SettingsFragment.isArduinoSharedPreferenceEnabled(context); SettingsFragment.setArduinoSharedPreferenceEnabled(context, false); createProjectArduino(); @@ -69,12 +70,12 @@ public void setUp() throws Exception { public void tearDown() throws Exception { TestUtils.deleteProjects(projectName); SettingsFragment - .setArduinoSharedPreferenceEnabled(InstrumentationRegistry.getTargetContext(), sharedPreferenceBuffer); + .setArduinoSharedPreferenceEnabled(ApplicationProvider.getApplicationContext(), sharedPreferenceBuffer); } @Test public void testIfArduinoBricksAreEnabledIfItItUsedInAProgram() throws IOException, ProjectException { - Context context = InstrumentationRegistry.getTargetContext(); + Context context = ApplicationProvider.getApplicationContext(); assertFalse(SettingsFragment.isArduinoSharedPreferenceEnabled(context)); @@ -86,7 +87,7 @@ public void testIfArduinoBricksAreEnabledIfItItUsedInAProgram() throws IOExcepti } private void createProjectArduino() { - project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new SingleSprite("Arduino"); StartScript startScript = new StartScript(); @@ -98,6 +99,6 @@ private void createProjectArduino() { ProjectManager.getInstance().setCurrentProject(project); ProjectSaveTask - .task(project, InstrumentationRegistry.getTargetContext()); + .task(project, ApplicationProvider.getApplicationContext()); } } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/ev3/LegoEV3ImplTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/ev3/LegoEV3ImplTest.java index 47ba72206ec..0d3de2607ea 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/ev3/LegoEV3ImplTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/ev3/LegoEV3ImplTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.devices.mindstorms.ev3; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.common.bluetooth.ConnectionDataLogger; import org.catrobat.catroid.devices.mindstorms.MindstormsException; @@ -34,6 +32,9 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; @RunWith(AndroidJUnit4.class) @@ -49,7 +50,7 @@ public class LegoEV3ImplTest { @Before public void setUp() throws Exception { - applicationContext = InstrumentationRegistry.getTargetContext().getApplicationContext(); + applicationContext = ApplicationProvider.getApplicationContext().getApplicationContext(); ev3 = new LegoEV3Impl(this.applicationContext); logger = ConnectionDataLogger.createLocalConnectionLogger(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/ev3/LegoEV3MotorTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/ev3/LegoEV3MotorTest.java index c25d27f3933..e48dee38e55 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/ev3/LegoEV3MotorTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/ev3/LegoEV3MotorTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,8 +24,6 @@ package org.catrobat.catroid.test.devices.mindstorms.ev3; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.common.bluetooth.ConnectionDataLogger; import org.catrobat.catroid.devices.mindstorms.MindstormsException; @@ -36,6 +34,9 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; @RunWith(AndroidJUnit4.class) @@ -55,7 +56,7 @@ public class LegoEV3MotorTest { @Before public void setUp() throws Exception { - applicationContext = InstrumentationRegistry.getTargetContext().getApplicationContext(); + applicationContext = ApplicationProvider.getApplicationContext().getApplicationContext(); ev3 = new LegoEV3Impl(this.applicationContext); logger = ConnectionDataLogger.createLocalConnectionLogger(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/ev3/LegoEV3SensorTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/ev3/LegoEV3SensorTest.java index 898294bdecd..e978c18ca31 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/ev3/LegoEV3SensorTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/ev3/LegoEV3SensorTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,8 +24,6 @@ package org.catrobat.catroid.test.devices.mindstorms.ev3; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.common.bluetooth.ConnectionDataLogger; import org.catrobat.catroid.devices.mindstorms.MindstormsException; @@ -40,6 +38,9 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; @RunWith(AndroidJUnit4.class) @@ -53,7 +54,7 @@ public class LegoEV3SensorTest { @Before public void setUp() throws Exception { - applicationContext = InstrumentationRegistry.getTargetContext().getApplicationContext(); + applicationContext = ApplicationProvider.getApplicationContext().getApplicationContext(); ev3 = new LegoEV3Impl(applicationContext); logger = ConnectionDataLogger.createLocalConnectionLogger(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/LegoNXTImplTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/LegoNXTImplTest.java index acab395f75b..a9b4c4107fa 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/LegoNXTImplTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/LegoNXTImplTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -25,8 +25,6 @@ import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.common.bluetooth.ConnectionDataLogger; import org.catrobat.catroid.devices.mindstorms.MindstormsException; @@ -45,6 +43,9 @@ import java.util.ArrayList; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertNotNull; import static junit.framework.Assert.assertTrue; @@ -73,10 +74,10 @@ public class LegoNXTImplTest { @Before public void setUp() throws Exception { - applicationContext = InstrumentationRegistry.getTargetContext().getApplicationContext(); + applicationContext = ApplicationProvider.getApplicationContext().getApplicationContext(); SharedPreferences sharedPreferences = PreferenceManager - .getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()); + .getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()); nxtSettingBuffer = sharedPreferences .getBoolean(SettingsFragment.SETTINGS_MINDSTORMS_NXT_BRICKS_ENABLED, false); @@ -85,7 +86,7 @@ public void setUp() throws Exception { .putBoolean(SettingsFragment.SETTINGS_MINDSTORMS_NXT_BRICKS_ENABLED, true) .commit(); - sensorMappingBuffer = SettingsFragment.getLegoNXTSensorMapping(InstrumentationRegistry.getTargetContext()); + sensorMappingBuffer = SettingsFragment.getLegoNXTSensorMapping(ApplicationProvider.getApplicationContext()); setSensorMapping(new NXTSensor.Sensor[] { NXTSensor.Sensor.NO_SENSOR, @@ -103,7 +104,7 @@ public void tearDown() throws Exception { nxt.disconnect(); logger.disconnectAndDestroy(); - PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()).edit() + PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()).edit() .putBoolean(SettingsFragment.SETTINGS_MINDSTORMS_NXT_BRICKS_ENABLED, nxtSettingBuffer) .commit(); setSensorMapping(sensorMappingBuffer); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/PreferencesSensorMappingTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/PreferencesSensorMappingTest.java index fa49c9566a0..278a15d5973 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/PreferencesSensorMappingTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/mindstorms/nxt/PreferencesSensorMappingTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,7 +24,6 @@ package org.catrobat.catroid.test.devices.mindstorms.nxt; import android.content.Context; -import android.support.test.InstrumentationRegistry; import org.catrobat.catroid.R; import org.catrobat.catroid.devices.mindstorms.nxt.sensors.NXTSensor; @@ -36,6 +35,8 @@ import java.util.ArrayList; import java.util.Arrays; +import androidx.test.core.app.ApplicationProvider; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertSame; @@ -74,7 +75,7 @@ public static Iterable data() { @Before public void setUp() { - Context context = InstrumentationRegistry.getTargetContext(); + Context context = ApplicationProvider.getApplicationContext(); sensorNames.addAll(Arrays.asList(context.getResources().getStringArray(R.array.nxt_sensor_chooser))); sensorCodes.addAll(Arrays.asList(NXTSensor.Sensor.getSensorCodes())); sensorName = context.getString(sensorNameStringId); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/phiro/PhiroSettingsTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/phiro/PhiroSettingsTest.java index d5b6a6dd438..d3b80db1aa7 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/phiro/PhiroSettingsTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/devices/phiro/PhiroSettingsTest.java @@ -23,9 +23,6 @@ package org.catrobat.catroid.test.devices.phiro; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.common.FlavoredConstants; import org.catrobat.catroid.content.Project; @@ -48,6 +45,9 @@ import java.io.File; import java.io.IOException; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; @@ -61,31 +61,31 @@ public class PhiroSettingsTest { @Before public void setUp() throws Exception { sharedPreferenceBuffer = - SettingsFragment.isPhiroSharedPreferenceEnabled(InstrumentationRegistry.getTargetContext()); - SettingsFragment.setPhiroSharedPreferenceEnabled(InstrumentationRegistry.getTargetContext(), false); + SettingsFragment.isPhiroSharedPreferenceEnabled(ApplicationProvider.getApplicationContext()); + SettingsFragment.setPhiroSharedPreferenceEnabled(ApplicationProvider.getApplicationContext(), false); createProject(); } @After public void tearDown() throws Exception { SettingsFragment - .setPhiroSharedPreferenceEnabled(InstrumentationRegistry.getTargetContext(), sharedPreferenceBuffer); + .setPhiroSharedPreferenceEnabled(ApplicationProvider.getApplicationContext(), sharedPreferenceBuffer); } @Test public void testIfPhiroBricksAreEnabledIfItItUsedInAProgram() throws IOException, ProjectException { - assertFalse(SettingsFragment.isPhiroSharedPreferenceEnabled(InstrumentationRegistry.getTargetContext())); + assertFalse(SettingsFragment.isPhiroSharedPreferenceEnabled(ApplicationProvider.getApplicationContext())); ProjectManager.getInstance() - .loadProject(project.getDirectory(), InstrumentationRegistry.getTargetContext()); + .loadProject(project.getDirectory(), ApplicationProvider.getApplicationContext()); - assertTrue(SettingsFragment.isPhiroSharedPreferenceEnabled(InstrumentationRegistry.getTargetContext())); + assertTrue(SettingsFragment.isPhiroSharedPreferenceEnabled(ApplicationProvider.getApplicationContext())); StorageOperations.deleteDir(new File(FlavoredConstants.DEFAULT_ROOT_DIRECTORY, projectName)); } private void createProject() { - project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new SingleSprite("Phiro"); StartScript startScript = new StartScript(); SetSizeToBrick setSizeToBrick = new SetSizeToBrick( @@ -98,6 +98,6 @@ private void createProject() { ProjectManager.getInstance().setCurrentProject(project); ProjectSaveTask - .task(project, InstrumentationRegistry.getTargetContext()); + .task(project, ApplicationProvider.getApplicationContext()); } } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTFileGeneratorTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTFileGeneratorTest.java index edab5f18fc9..6d80af5d567 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTFileGeneratorTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTFileGeneratorTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.test.embroidery; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.android.dex.util.FileUtils; import org.catrobat.catroid.ProjectManager; @@ -44,6 +41,10 @@ import java.io.IOException; import java.io.InputStream; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; @@ -55,7 +56,7 @@ public class DSTFileGeneratorTest { @Before public void setUp() throws IOException { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); ProjectManager.getInstance().setCurrentProject(project); dstFile = new File(Constants.CACHE_DIR, projectName + ".dst"); @@ -83,7 +84,7 @@ public void testWriteToSampleDSTFile() throws IOException { DSTFileGenerator fileGenerator = new DSTFileGenerator(stream); fileGenerator.writeToDSTFile(dstFile); - InputStream inputStream = InstrumentationRegistry.getContext().getResources().openRawResource(org.catrobat + InputStream inputStream = InstrumentationRegistry.getInstrumentation().getContext().getResources().openRawResource(org.catrobat .catroid.test.R.raw.sample_dst_file); File compareFile = StorageOperations.copyStreamToDir(inputStream, Constants.CACHE_DIR, "sample_dst_file.dst"); @@ -121,7 +122,7 @@ public void testWriteToComplexSampleDSTFile() throws IOException { DSTFileGenerator fileGenerator = new DSTFileGenerator(stream); fileGenerator.writeToDSTFile(dstFile); - InputStream inputStream = InstrumentationRegistry.getContext().getResources().openRawResource(org.catrobat + InputStream inputStream = InstrumentationRegistry.getInstrumentation().getContext().getResources().openRawResource(org.catrobat .catroid.test.R.raw.complex_sample_dst_file); File compareFile = StorageOperations.copyStreamToDir(inputStream, Constants.CACHE_DIR, "complex_sample_dst_file.dst"); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTHeaderTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTHeaderTest.java index 0466f1e8512..a9f804f1161 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTHeaderTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/DSTHeaderTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.test.embroidery; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; import org.catrobat.catroid.embroidery.DSTFileConstants; @@ -40,6 +37,9 @@ import java.io.IOException; import java.util.Locale; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @@ -50,7 +50,7 @@ public class DSTHeaderTest { @Before public void setUp() { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); ProjectManager.getInstance().setCurrentProject(project); fileOutputStream = Mockito.mock(FileOutputStream.class); } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/EmbroideryFileExporterTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/EmbroideryFileExporterTest.java index 7c341111313..13a4a2a7f51 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/EmbroideryFileExporterTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/EmbroideryFileExporterTest.java @@ -25,9 +25,6 @@ import android.content.Intent; import android.net.Uri; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; -import androidx.core.content.FileProvider; import org.catrobat.catroid.common.Constants; import org.catrobat.catroid.stage.StageActivity; @@ -40,6 +37,10 @@ import java.io.File; +import androidx.core.content.FileProvider; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; @RunWith(AndroidJUnit4.class) @@ -51,8 +52,8 @@ public class EmbroideryFileExporterTest { @Before public void setUp() { stageActivity = Mockito.mock(StageActivity.class); - Mockito.when(stageActivity.getPackageManager()).thenReturn(InstrumentationRegistry.getTargetContext().getPackageManager()); - Mockito.when(stageActivity.getPackageName()).thenReturn(InstrumentationRegistry.getTargetContext().getPackageName()); + Mockito.when(stageActivity.getPackageManager()).thenReturn(ApplicationProvider.getApplicationContext().getPackageManager()); + Mockito.when(stageActivity.getPackageName()).thenReturn(ApplicationProvider.getApplicationContext().getPackageName()); } @Test diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/RunningStitchTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/RunningStitchTest.java index 39ca1400983..905e95538a3 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/RunningStitchTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/RunningStitchTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.embroidery; -import android.support.test.runner.AndroidJUnit4; - import org.catrobat.catroid.content.Look; import org.catrobat.catroid.content.Sprite; import org.catrobat.catroid.embroidery.RunningStitch; @@ -34,6 +32,8 @@ import org.junit.runner.RunWith; import org.mockito.Mockito; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static org.mockito.ArgumentMatchers.anyFloat; @RunWith(AndroidJUnit4.class) diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/SimpleRunningStitchTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/SimpleRunningStitchTest.java index 7835d7a44be..b375360c5e0 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/SimpleRunningStitchTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/SimpleRunningStitchTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.embroidery; -import android.support.test.runner.AndroidJUnit4; - import org.catrobat.catroid.content.Look; import org.catrobat.catroid.content.Sprite; import org.catrobat.catroid.embroidery.EmbroideryPatternManager; @@ -37,6 +35,8 @@ import org.junit.runner.RunWith; import org.mockito.Mockito; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/DeleteInternTokenTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/DeleteInternTokenTest.java index 853a047cd7c..edd753ef6db 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/DeleteInternTokenTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/DeleteInternTokenTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.formulaeditor; -import android.support.test.InstrumentationRegistry; - import org.catrobat.catroid.R; import org.catrobat.catroid.formulaeditor.Functions; import org.catrobat.catroid.formulaeditor.InternFormula; @@ -39,6 +37,8 @@ import java.util.ArrayList; import java.util.Arrays; +import androidx.test.core.app.ApplicationProvider; + import static junit.framework.Assert.assertEquals; @RunWith(Parameterized.class) @@ -80,7 +80,7 @@ public static Iterable data() { new InternToken(InternTokenType.FUNCTION_NAME, Functions.SIN.name()), new InternToken(InternTokenType.FUNCTION_PARAMETERS_BRACKET_OPEN, Operators.PLUS.name()), new InternToken(InternTokenType.NUMBER, "42.42")}, - InstrumentationRegistry.getTargetContext().getResources().getString(R.string.formula_editor_function_sin) + ApplicationProvider.getApplicationContext().getResources().getString(R.string.formula_editor_function_sin) .length(), "sine( 42.42 "}, }); } @@ -103,15 +103,15 @@ public static Iterable data() { public void setUp() { ArrayList internTokens = new ArrayList<>(Arrays.asList(initialTokens)); internFormula = new InternFormula(internTokens); - internFormula.generateExternFormulaStringAndInternExternMapping(InstrumentationRegistry.getTargetContext()); + internFormula.generateExternFormulaStringAndInternExternMapping(ApplicationProvider.getApplicationContext()); internFormula.setCursorAndSelection(0, false); } @Test public void testExternFormulaString() { internFormula.externCursorPosition = externCursorPosition; - internFormula.handleKeyInput(R.id.formula_editor_keyboard_delete, InstrumentationRegistry.getTargetContext(), null); - internFormula.generateExternFormulaStringAndInternExternMapping(InstrumentationRegistry.getTargetContext()); + internFormula.handleKeyInput(R.id.formula_editor_keyboard_delete, ApplicationProvider.getApplicationContext(), null); + internFormula.generateExternFormulaStringAndInternExternMapping(ApplicationProvider.getApplicationContext()); assertEquals(expectedFormulaString, internFormula.getExternFormulaString()); } } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/InternFormulaTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/InternFormulaTest.java index e644ad1bf69..3555e9d7c2b 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/InternFormulaTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/InternFormulaTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.test.formulaeditor; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.R; import org.catrobat.catroid.formulaeditor.ExternInternRepresentationMapping; import org.catrobat.catroid.formulaeditor.Functions; @@ -40,6 +37,9 @@ import java.util.ArrayList; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertNull; @@ -60,11 +60,11 @@ public void testReplaceFunctionByToken() { internTokens.add(new InternToken(InternTokenType.FUNCTION_PARAMETERS_BRACKET_CLOSE)); InternFormula internFormula = new InternFormula(internTokens); - internFormula.generateExternFormulaStringAndInternExternMapping(InstrumentationRegistry.getTargetContext()); + internFormula.generateExternFormulaStringAndInternExternMapping(ApplicationProvider.getApplicationContext()); internFormula.setCursorAndSelection(internFormula.getExternFormulaString().length(), true); - internFormula.handleKeyInput(R.id.formula_editor_keyboard_4, InstrumentationRegistry.getTargetContext(), null); - internFormula.handleKeyInput(R.id.formula_editor_keyboard_2, InstrumentationRegistry.getTargetContext(), null); + internFormula.handleKeyInput(R.id.formula_editor_keyboard_4, ApplicationProvider.getApplicationContext(), null); + internFormula.handleKeyInput(R.id.formula_editor_keyboard_2, ApplicationProvider.getApplicationContext(), null); assertNull(internFormula.getSelection()); internFormula.setCursorAndSelection(internFormula.getExternFormulaString().length(), true); @@ -86,18 +86,18 @@ public void testReplaceFunctionButKeepParameters() { internTokens.add(new InternToken(InternTokenType.FUNCTION_PARAMETERS_BRACKET_CLOSE)); InternFormula internFormula = new InternFormula(internTokens); - internFormula.generateExternFormulaStringAndInternExternMapping(InstrumentationRegistry.getTargetContext()); + internFormula.generateExternFormulaStringAndInternExternMapping(ApplicationProvider.getApplicationContext()); internFormula.setCursorAndSelection(internFormula.getExternFormulaString().length(), true); assertInternFormulaSelectionIndices(0, 9, internFormula); - internFormula.handleKeyInput(R.string.formula_editor_function_rand, InstrumentationRegistry.getTargetContext(), null); + internFormula.handleKeyInput(R.string.formula_editor_function_rand, ApplicationProvider.getApplicationContext(), null); assertInternFormulaSelectionIndices(2, 8, internFormula); internFormula.setCursorAndSelection(internFormula.getExternFormulaString().length(), true); assertInternFormulaSelectionIndices(0, 11, internFormula); - internFormula.handleKeyInput(R.string.formula_editor_function_sqrt, InstrumentationRegistry.getTargetContext(), null); + internFormula.handleKeyInput(R.string.formula_editor_function_sqrt, ApplicationProvider.getApplicationContext(), null); assertInternFormulaSelectionIndices(2, 8, internFormula); internFormula.setCursorAndSelection(internFormula.getExternFormulaString().length(), true); @@ -112,7 +112,7 @@ public void testSelectBrackets() { internTokens.add(new InternToken(InternTokenType.BRACKET_CLOSE)); InternFormula internFormula = new InternFormula(internTokens); - internFormula.generateExternFormulaStringAndInternExternMapping(InstrumentationRegistry.getTargetContext()); + internFormula.generateExternFormulaStringAndInternExternMapping(ApplicationProvider.getApplicationContext()); String externFormulaString = internFormula.getExternFormulaString(); internFormula.setCursorAndSelection(externFormulaString.length(), true); @@ -128,7 +128,7 @@ public void testReplaceSelection() { internTokens.add(new InternToken(InternTokenType.NUMBER, "42.42")); InternFormula internFormula = new InternFormula(internTokens); - internFormula.generateExternFormulaStringAndInternExternMapping(InstrumentationRegistry.getTargetContext()); + internFormula.generateExternFormulaStringAndInternExternMapping(ApplicationProvider.getApplicationContext()); internFormula.setCursorAndSelection(1, true); String externFormulaString = internFormula.getExternFormulaString(); @@ -139,8 +139,8 @@ public void testReplaceSelection() { internFormula.internFormulaTokenSelection = new InternFormulaTokenSelection( TokenSelectionType.USER_SELECTION, tokenSelectionStartIndex, tokenSelectionEndIndex); - internFormula.handleKeyInput(R.id.formula_editor_keyboard_0, InstrumentationRegistry.getTargetContext(), null); - internFormula.generateExternFormulaStringAndInternExternMapping(InstrumentationRegistry.getTargetContext()); + internFormula.handleKeyInput(R.id.formula_editor_keyboard_0, ApplicationProvider.getApplicationContext(), null); + internFormula.generateExternFormulaStringAndInternExternMapping(ApplicationProvider.getApplicationContext()); assertEquals(externFormulaString, internFormula.getExternFormulaString()); } @@ -151,7 +151,7 @@ public void testSetExternCursorPositionLeftTo() { internTokens.add(new InternToken(InternTokenType.OPERATOR, Operators.PLUS.name())); internTokens.add(new InternToken(InternTokenType.NUMBER, "42.42")); InternFormula internFormula = new InternFormula(internTokens); - internFormula.generateExternFormulaStringAndInternExternMapping(InstrumentationRegistry.getTargetContext()); + internFormula.generateExternFormulaStringAndInternExternMapping(ApplicationProvider.getApplicationContext()); internFormula.setCursorAndSelection(1, false); ExternInternRepresentationMapping externInternRepresentationMapping = new ExternInternRepresentationMapping(); @@ -167,7 +167,7 @@ public void testSetExternCursorPositionLeftTo() { public void testSetExternCursorPositionRightToEmptyFormula() { ArrayList internTokens = new ArrayList<>(); InternFormula internFormula = new InternFormula(internTokens); - internFormula.generateExternFormulaStringAndInternExternMapping(InstrumentationRegistry.getTargetContext()); + internFormula.generateExternFormulaStringAndInternExternMapping(ApplicationProvider.getApplicationContext()); internFormula.setCursorAndSelection(1, false); int externCursorPositionBeforeMethodCall = internFormula.getExternCursorPosition(); @@ -182,7 +182,7 @@ public void testSetExternCursorPositionRightTo() { internTokens.add(new InternToken(InternTokenType.OPERATOR, Operators.PLUS.name())); internTokens.add(new InternToken(InternTokenType.NUMBER, "42.42")); InternFormula internFormula = new InternFormula(internTokens); - internFormula.generateExternFormulaStringAndInternExternMapping(InstrumentationRegistry.getTargetContext()); + internFormula.generateExternFormulaStringAndInternExternMapping(ApplicationProvider.getApplicationContext()); internFormula.setCursorAndSelection(1, false); internFormula.setExternCursorPositionRightTo(3); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/InternTokenInsertTokenTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/InternTokenInsertTokenTest.java index c5bca1aefa1..41473e796fd 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/InternTokenInsertTokenTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/InternTokenInsertTokenTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -22,9 +22,6 @@ */ package org.catrobat.catroid.test.formulaeditor; -import androidx.annotation.IdRes; -import android.support.test.InstrumentationRegistry; - import org.catrobat.catroid.R; import org.catrobat.catroid.formulaeditor.InternFormula; import org.catrobat.catroid.formulaeditor.InternToken; @@ -38,6 +35,9 @@ import java.util.ArrayList; import java.util.Arrays; +import androidx.annotation.IdRes; +import androidx.test.core.app.ApplicationProvider; + import static junit.framework.Assert.assertEquals; @RunWith(Parameterized.class) @@ -98,9 +98,9 @@ public static Iterable data() { public void setUp() { internTokens = new ArrayList<>(Arrays.asList(initialTokens)); internFormula = new InternFormula(internTokens); - internFormula.generateExternFormulaStringAndInternExternMapping(InstrumentationRegistry.getTargetContext()); + internFormula.generateExternFormulaStringAndInternExternMapping(ApplicationProvider.getApplicationContext()); internFormula.setCursorAndSelection(externCursorPosition, false); - internFormula.handleKeyInput(keyInputId, InstrumentationRegistry.getTargetContext(), null); + internFormula.handleKeyInput(keyInputId, ApplicationProvider.getApplicationContext(), null); } @Test diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/NoSelectionInternTokenTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/NoSelectionInternTokenTest.java index 738c0250017..f7adef7f514 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/NoSelectionInternTokenTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/NoSelectionInternTokenTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.formulaeditor; -import android.support.test.InstrumentationRegistry; - import org.catrobat.catroid.R; import org.catrobat.catroid.formulaeditor.Functions; import org.catrobat.catroid.formulaeditor.InternFormula; @@ -39,6 +37,8 @@ import java.util.ArrayList; import java.util.Arrays; +import androidx.test.core.app.ApplicationProvider; + import static org.junit.Assert.assertNull; @RunWith(Parameterized.class) @@ -60,20 +60,20 @@ public static Iterable data() { new InternToken(InternTokenType.FUNCTION_PARAMETERS_BRACKET_CLOSE), new InternToken(InternTokenType.FUNCTION_PARAMETERS_BRACKET_CLOSE), new InternToken(InternTokenType.NUMBER, "42.42")}, - InstrumentationRegistry.getTargetContext().getResources().getString(R.string.formula_editor_function_sin) + ApplicationProvider.getApplicationContext().getResources().getString(R.string.formula_editor_function_sin) .length() + 4}, {"Select SIN Bracket OPEN", new InternToken[]{ new InternToken(InternTokenType.FUNCTION_NAME, Functions.SIN.name()), new InternToken(InternTokenType.FUNCTION_PARAMETERS_BRACKET_OPEN), new InternToken(InternTokenType.FUNCTION_PARAMETER_DELIMITER), new InternToken(InternTokenType.NUMBER, "42.42")}, - InstrumentationRegistry.getTargetContext().getResources().getString(R.string.formula_editor_function_sin) + ApplicationProvider.getApplicationContext().getResources().getString(R.string.formula_editor_function_sin) .length() + 2}, {"Select SIN name end", new InternToken[]{ new InternToken(InternTokenType.FUNCTION_NAME, Functions.SIN.name()), new InternToken(InternTokenType.FUNCTION_PARAMETERS_BRACKET_OPEN), new InternToken(InternTokenType.NUMBER, "42.42")}, - InstrumentationRegistry.getTargetContext().getResources().getString(R.string.formula_editor_function_sin) + ApplicationProvider.getApplicationContext().getResources().getString(R.string.formula_editor_function_sin) .length()}, {"Select SIN name begin", new InternToken[]{ new InternToken(InternTokenType.FUNCTION_NAME, Functions.SIN.name()), @@ -98,7 +98,7 @@ public static Iterable data() { public void setUp() { ArrayList internTokens = new ArrayList<>(Arrays.asList(initialTokens)); internFormula = new InternFormula(internTokens); - internFormula.generateExternFormulaStringAndInternExternMapping(InstrumentationRegistry.getTargetContext()); + internFormula.generateExternFormulaStringAndInternExternMapping(ApplicationProvider.getApplicationContext()); internFormula.setCursorAndSelection(externCursorPosition, true); } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/ParserTestSensors.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/ParserTestSensors.java index 661b8d5a2b3..c77c00f7707 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/ParserTestSensors.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/ParserTestSensors.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,10 +24,6 @@ import android.Manifest; import android.graphics.Point; -import android.support.test.InstrumentationRegistry; -import androidx.test.annotation.UiThreadTest; -import androidx.test.rule.GrantPermissionRule; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.camera.CameraManager; @@ -61,6 +57,11 @@ import java.util.LinkedList; import java.util.List; +import androidx.test.annotation.UiThreadTest; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.rule.GrantPermissionRule; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertNotNull; @@ -97,7 +98,7 @@ public void tearDown() throws Exception { public void testSensorManagerNotInitialized() { SensorHandler.registerListener(null); SensorHandler.unregisterListener(null); - SensorHandler.startSensorListener(InstrumentationRegistry.getTargetContext()); + SensorHandler.startSensorListener(ApplicationProvider.getApplicationContext()); assertEquals(0d, Math.abs((Double) SensorHandler.getSensorValue(Sensors.X_ACCELERATION))); } @@ -105,7 +106,7 @@ public void testSensorManagerNotInitialized() { @Test @UiThreadTest public void testSensorHandlerWithLookSensorValue() { - SensorHandler.startSensorListener(InstrumentationRegistry.getTargetContext()); + SensorHandler.startSensorListener(ApplicationProvider.getApplicationContext()); assertEquals(0d, SensorHandler.getSensorValue(Sensors.OBJECT_BRIGHTNESS)); SensorHandler.stopSensorListeners(); } @@ -114,7 +115,7 @@ public void testSensorHandlerWithLookSensorValue() { @UiThreadTest public void testFaceDetection() throws Exception { CameraManager.makeInstance(); - SensorHandler.startSensorListener(InstrumentationRegistry.getTargetContext()); + SensorHandler.startSensorListener(ApplicationProvider.getApplicationContext()); FaceDetector faceDetector = FaceDetectionHandler.getFaceDetector(); assertNotNull(faceDetector); @@ -168,8 +169,8 @@ public void testMicRelease() throws IOException { InOrder inOrder = inOrder(soundRecorder); when(soundRecorder.isRecording()).thenReturn(false); - SensorHandler.getInstance(InstrumentationRegistry.getTargetContext()).setSensorLoudness(loudnessSensor); - SensorHandler.startSensorListener(InstrumentationRegistry.getTargetContext()); + SensorHandler.getInstance(ApplicationProvider.getApplicationContext()).setSensorLoudness(loudnessSensor); + SensorHandler.startSensorListener(ApplicationProvider.getApplicationContext()); inOrder.verify(soundRecorder).start(); when(soundRecorder.isRecording()).thenReturn(true); @@ -186,7 +187,7 @@ private Formula createFormulaWithSensor(Sensors sensor) { } private void createProject() { - this.project = new Project(InstrumentationRegistry.getTargetContext(), "testProject"); + this.project = new Project(ApplicationProvider.getApplicationContext(), "testProject"); firstSprite = new SingleSprite("zwoosh"); startScript1 = new StartScript(); firstSprite.addScript(startScript1); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/ReplaceCursorPositionInternTokenByTokenListTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/ReplaceCursorPositionInternTokenByTokenListTest.java index ec4e558bace..252be369c1e 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/ReplaceCursorPositionInternTokenByTokenListTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/ReplaceCursorPositionInternTokenByTokenListTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.formulaeditor; -import android.support.test.InstrumentationRegistry; - import org.catrobat.catroid.formulaeditor.Functions; import org.catrobat.catroid.formulaeditor.InternFormula; import org.catrobat.catroid.formulaeditor.InternFormula.CursorTokenPropertiesAfterModification; @@ -39,6 +37,8 @@ import java.util.ArrayList; import java.util.Arrays; +import androidx.test.core.app.ApplicationProvider; + import static junit.framework.Assert.assertEquals; @RunWith(Parameterized.class) @@ -94,7 +94,7 @@ public static Iterable data() { public void setUp() { ArrayList internTokens = new ArrayList<>(Arrays.asList(initialTokens)); internFormula = new InternFormula(internTokens); - internFormula.generateExternFormulaStringAndInternExternMapping(InstrumentationRegistry.getTargetContext()); + internFormula.generateExternFormulaStringAndInternExternMapping(ApplicationProvider.getApplicationContext()); internFormula.setCursorAndSelection(1, true); } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/SelectInternTokenFunctionWithOneParameterTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/SelectInternTokenFunctionWithOneParameterTest.java index 7e38daec0d5..1e8e55a5639 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/SelectInternTokenFunctionWithOneParameterTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/SelectInternTokenFunctionWithOneParameterTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.formulaeditor; -import android.support.test.InstrumentationRegistry; - import org.catrobat.catroid.formulaeditor.Functions; import org.catrobat.catroid.formulaeditor.InternFormula; import org.catrobat.catroid.formulaeditor.InternToExternGenerator; @@ -38,6 +36,8 @@ import java.util.ArrayList; import java.util.Arrays; +import androidx.test.core.app.ApplicationProvider; + import static junit.framework.Assert.assertEquals; import static org.catrobat.catroid.formulaeditor.InternTokenType.FUNCTION_NAME; @@ -82,9 +82,9 @@ public void setUp() { internTokens.add(new InternToken(InternTokenType.FUNCTION_PARAMETERS_BRACKET_CLOSE)); internFormula = new InternFormula(internTokens); - internFormula.generateExternFormulaStringAndInternExternMapping(InstrumentationRegistry.getTargetContext()); + internFormula.generateExternFormulaStringAndInternExternMapping(ApplicationProvider.getApplicationContext()); - functionName = InstrumentationRegistry.getTargetContext().getResources() + functionName = ApplicationProvider.getApplicationContext().getResources() .getString(InternToExternGenerator.getMappedString(functionToken.getTokenStringValue())); } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/SelectInternTokenFunctionWithTwoParametersTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/SelectInternTokenFunctionWithTwoParametersTest.java index 3291580ec62..25a4d7f84b2 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/SelectInternTokenFunctionWithTwoParametersTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/formulaeditor/SelectInternTokenFunctionWithTwoParametersTest.java @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.formulaeditor; -import android.support.test.InstrumentationRegistry; - import org.catrobat.catroid.formulaeditor.Functions; import org.catrobat.catroid.formulaeditor.InternFormula; import org.catrobat.catroid.formulaeditor.InternToExternGenerator; @@ -38,6 +36,8 @@ import java.util.ArrayList; import java.util.Arrays; +import androidx.test.core.app.ApplicationProvider; + import static junit.framework.Assert.assertEquals; import static org.catrobat.catroid.formulaeditor.InternTokenType.FUNCTION_NAME; @@ -81,9 +81,9 @@ public void setUp() { internTokens.add(new InternToken(InternTokenType.FUNCTION_PARAMETERS_BRACKET_CLOSE)); internFormula = new InternFormula(internTokens); - internFormula.generateExternFormulaStringAndInternExternMapping(InstrumentationRegistry.getTargetContext()); + internFormula.generateExternFormulaStringAndInternExternMapping(ApplicationProvider.getApplicationContext()); - functionName = InstrumentationRegistry.getTargetContext().getResources() + functionName = ApplicationProvider.getApplicationContext().getResources() .getString(InternToExternGenerator.getMappedString(functionToken.getTokenStringValue())); } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/DefaultChromeCastProgramLoadingTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/DefaultChromeCastProgramLoadingTest.java index 9f6ebba727a..7333332acc1 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/DefaultChromeCastProgramLoadingTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/DefaultChromeCastProgramLoadingTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.test.io; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.common.defaultprojectcreators.ChromeCastProjectCreator; @@ -43,6 +40,9 @@ import java.io.IOException; import java.util.ArrayList; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; @RunWith(AndroidJUnit4.class) @@ -55,9 +55,9 @@ public class DefaultChromeCastProgramLoadingTest { @Before public void setUp() throws Exception { currentProjectBuffer = ProjectManager.getInstance().getCurrentProject(); - projectName = InstrumentationRegistry.getTargetContext().getString(R.string.default_cast_project_name); + projectName = ApplicationProvider.getApplicationContext().getString(R.string.default_cast_project_name); project = new ChromeCastProjectCreator() - .createDefaultProject(projectName, InstrumentationRegistry.getTargetContext(), true); + .createDefaultProject(projectName, ApplicationProvider.getApplicationContext(), true); } @After @@ -69,7 +69,7 @@ public void tearDown() throws Exception { @Test public void testLoadingChromeCastProgram() throws IOException, LoadingProjectException { Project loadedProject = XstreamSerializer.getInstance() - .loadProject(project.getDirectory(), InstrumentationRegistry.getTargetContext()); + .loadProject(project.getDirectory(), ApplicationProvider.getApplicationContext()); Scene preScene = project.getDefaultScene(); Scene postScene = loadedProject.getDefaultScene(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/DefaultDroneProgramLoadingTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/DefaultDroneProgramLoadingTest.java index cc6c3f6d3c0..e13eff40e4a 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/DefaultDroneProgramLoadingTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/DefaultDroneProgramLoadingTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,8 +24,6 @@ package org.catrobat.catroid.test.io; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -44,6 +42,9 @@ import java.io.IOException; import java.util.List; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; @RunWith(AndroidJUnit4.class) @@ -55,11 +56,11 @@ public class DefaultDroneProgramLoadingTest { @Before public void setUp() throws Exception { - Context targetContext = InstrumentationRegistry.getTargetContext(); + Context targetContext = ApplicationProvider.getApplicationContext(); currentProjectBuffer = ProjectManager.getInstance().getCurrentProject(); projectName = targetContext.getString(R.string.default_drone_project_name); project = new ArDroneProjectCreator() - .createDefaultProject(projectName, InstrumentationRegistry.getTargetContext(), false); + .createDefaultProject(projectName, ApplicationProvider.getApplicationContext(), false); } @After @@ -71,7 +72,7 @@ public void tearDown() throws Exception { @Test public void testDroneProgramLoadingSuccessfully() throws IOException, LoadingProjectException { Project loadedProject = XstreamSerializer.getInstance() - .loadProject(project.getDirectory(), InstrumentationRegistry.getTargetContext()); + .loadProject(project.getDirectory(), ApplicationProvider.getApplicationContext()); Scene preScene = project.getDefaultScene(); Scene postScene = loadedProject.getDefaultScene(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/DefaultJumpingSumoProgramLoadingTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/DefaultJumpingSumoProgramLoadingTest.java index ff26f0ea3da..d97ea2a889c 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/DefaultJumpingSumoProgramLoadingTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/DefaultJumpingSumoProgramLoadingTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,8 +24,6 @@ package org.catrobat.catroid.test.io; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -44,6 +42,9 @@ import java.io.IOException; import java.util.ArrayList; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; @RunWith(AndroidJUnit4.class) @@ -61,7 +62,7 @@ public DefaultJumpingSumoProgramLoadingTest() { @Before public void setUp() throws Exception { - targetContext = InstrumentationRegistry.getTargetContext(); + targetContext = ApplicationProvider.getApplicationContext(); currentProjectBuffer = ProjectManager.getInstance().getCurrentProject(); projectName = targetContext.getString(R.string.default_jumping_sumo_project_name); project = new JumpingSumoProjectCreator().createDefaultProject(projectName, targetContext, false); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ResourceImporterTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ResourceImporterTest.java index 593a010fc06..75157d8879e 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ResourceImporterTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ResourceImporterTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.test.io; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.common.FlavoredConstants; import org.catrobat.catroid.io.ResourceImporter; import org.catrobat.catroid.io.StorageOperations; @@ -37,6 +34,9 @@ import java.io.File; import java.io.IOException; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + import static junit.framework.Assert.assertTrue; @RunWith(AndroidJUnit4.class) @@ -57,13 +57,13 @@ public void tearDown() throws IOException { @Test public void testImportImageFile() throws IOException { File fileFromDrawables = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.drawable.catroid_banzai, testDir, "drawable.png", 1); assertTrue(fileFromDrawables.getAbsolutePath() + " does not exist", fileFromDrawables.exists()); File fileFromRaw = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), org.catrobat.catroid.test.R.raw.alpha_test_image, + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.alpha_test_image, testDir, "raw.png", 1); assertTrue(fileFromRaw.getAbsolutePath() + " does not exist", fileFromRaw.exists()); @@ -72,7 +72,7 @@ public void testImportImageFile() throws IOException { @Test public void testImportSoundFile() throws IOException { File fileFromRaw = ResourceImporter.createSoundFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), org.catrobat.catroid.test.R.raw.longtestsound, + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.longtestsound, testDir, "sound.m4a" ); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/SoundManagerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/SoundManagerTest.java index fecea1e72d1..d68411976a2 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/SoundManagerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/SoundManagerTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.io; import android.media.MediaPlayer; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; @@ -46,6 +44,10 @@ import java.util.Collections; import java.util.List; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; @@ -71,7 +73,7 @@ public void setUp() throws Exception { soundManager.clear(); soundFile = ResourceImporter - .createSoundFileFromResourcesInDirectory(InstrumentationRegistry.getContext().getResources(), + .createSoundFileFromResourcesInDirectory(InstrumentationRegistry.getInstrumentation().getContext().getResources(), R.raw.testsound, new File(project.getDefaultScene().getDirectory(), SOUND_DIRECTORY_NAME), "testsound.m4a"); } @@ -189,7 +191,7 @@ public void testSetVolume() { } private void createProject() { - project = new Project(InstrumentationRegistry.getTargetContext(), "testProject"); + project = new Project(ApplicationProvider.getApplicationContext(), "testProject"); Sprite sprite = new Sprite("TestSprite"); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/StageAudioFocusTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/StageAudioFocusTest.java index 97e50959662..8f7f1732bda 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/StageAudioFocusTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/StageAudioFocusTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.io; import android.media.AudioManager; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.io.StageAudioFocus; import org.junit.After; @@ -32,6 +30,9 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; @@ -42,7 +43,7 @@ public class StageAudioFocusTest { @Before public void setUp() throws Exception { - audioFocus = new StageAudioFocus(InstrumentationRegistry.getTargetContext()); + audioFocus = new StageAudioFocus(ApplicationProvider.getApplicationContext()); } @After diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/XstreamSerializerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/XstreamSerializerTest.java index e105be354fe..04dca0f1dbd 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/XstreamSerializerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/XstreamSerializerTest.java @@ -22,9 +22,6 @@ */ package org.catrobat.catroid.test.io; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.google.common.base.Charsets; import com.google.common.io.Files; @@ -66,6 +63,9 @@ import java.io.IOException; import java.util.ArrayList; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; @@ -112,7 +112,7 @@ public void testSerializeProject() throws Exception { final int yPosition = 598; final float size = 0.8f; - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite firstSprite = new SingleSprite("first"); Sprite secondSprite = new SingleSprite("second"); Sprite thirdSprite = new SingleSprite("third"); @@ -141,10 +141,10 @@ public void testSerializeProject() throws Exception { project.getDefaultScene().addSprite(fourthSprite); ProjectSaveTask - .task(project, InstrumentationRegistry.getTargetContext()); + .task(project, ApplicationProvider.getApplicationContext()); Project loadedProject = XstreamSerializer.getInstance() - .loadProject(project.getDirectory(), InstrumentationRegistry.getContext()); + .loadProject(project.getDirectory(), ApplicationProvider.getApplicationContext()); Scene preScene = project.getDefaultScene(); Scene postScene = loadedProject.getDefaultScene(); @@ -182,7 +182,7 @@ public void testSanityCheck() throws IOException { final int yPosition = 598; final float size = 0.8f; - final Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + final Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite firstSprite = new SingleSprite("first"); Sprite secondSprite = new SingleSprite("second"); Sprite thirdSprite = new SingleSprite("third"); @@ -276,9 +276,9 @@ public void testSerializeSettings() { Project project = generateMultiplePermissionsProject(); ProjectManager.getInstance().setCurrentProject(project); - SettingsFragment.setLegoMindstormsNXTSensorMapping(InstrumentationRegistry.getTargetContext(), sensorMapping); + SettingsFragment.setLegoMindstormsNXTSensorMapping(ApplicationProvider.getApplicationContext(), sensorMapping); - ProjectSaveTask.task(project, InstrumentationRegistry.getTargetContext()); + ProjectSaveTask.task(project, ApplicationProvider.getApplicationContext()); Setting setting = project.getSettings().get(0); @@ -298,12 +298,12 @@ public void testSerializeSettings() { changedSensorMapping[0] = NXTSensor.Sensor.LIGHT_ACTIVE; SettingsFragment - .setLegoMindstormsNXTSensorMapping(InstrumentationRegistry.getTargetContext(), changedSensorMapping); + .setLegoMindstormsNXTSensorMapping(ApplicationProvider.getApplicationContext(), changedSensorMapping); assertTrue(ProjectLoadTask - .task(project.getDirectory(), InstrumentationRegistry.getTargetContext())); + .task(project.getDirectory(), ApplicationProvider.getApplicationContext())); - actualSensorMapping = SettingsFragment.getLegoNXTSensorMapping(InstrumentationRegistry.getTargetContext()); + actualSensorMapping = SettingsFragment.getLegoNXTSensorMapping(ApplicationProvider.getApplicationContext()); assertEquals(4, actualSensorMapping.length); @@ -330,7 +330,7 @@ public void testSerializeSettings() { } private Project generateMultiplePermissionsProject() { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); LegoNxtMotorMoveBrick motorBrick = new LegoNxtMotorMoveBrick( LegoNxtMotorMoveBrick.Motor.MOTOR_A, SET_SPEED_INITIALLY); @@ -367,12 +367,12 @@ private Project generateMultiplePermissionsProject() { public void testExtractDefaultSceneNameFromXml() { String firstSceneName = "First Scene"; - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); project.getSceneList().get(0).setName(firstSceneName); ProjectSaveTask - .task(project, InstrumentationRegistry.getTargetContext()); + .task(project, ApplicationProvider.getApplicationContext()); assertEquals(firstSceneName, XstreamSerializer.extractDefaultSceneNameFromXml(project.getDirectory())); } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/InvalidProjectSaveTaskTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/InvalidProjectSaveTaskTest.java index da8cb58d67f..7b4d1734e83 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/InvalidProjectSaveTaskTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/InvalidProjectSaveTaskTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,15 +23,15 @@ package org.catrobat.catroid.test.io.asynctask; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.io.asynctask.ProjectSaveTask; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static org.junit.Assert.assertFalse; @RunWith(AndroidJUnit4.class) @@ -43,6 +43,6 @@ public void setUp() { @Test public void invalidProjectSaveTaskTest() { - assertFalse(ProjectSaveTask.task(null, InstrumentationRegistry.getTargetContext())); + assertFalse(ProjectSaveTask.task(null, ApplicationProvider.getApplicationContext())); } } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/ProjectExportTaskTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/ProjectExportTaskTest.java index 92db5975535..a035d8d2271 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/ProjectExportTaskTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/ProjectExportTaskTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -26,9 +26,6 @@ import android.Manifest; import android.app.NotificationManager; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import androidx.test.rule.GrantPermissionRule; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; @@ -47,6 +44,10 @@ import java.io.File; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.rule.GrantPermissionRule; + import static org.catrobat.catroid.common.Constants.CATROBAT_EXTENSION; import static org.catrobat.catroid.common.Constants.EXTERNAL_STORAGE_ROOT_EXPORT_DIRECTORY; import static org.mockito.ArgumentMatchers.anyString; @@ -64,16 +65,16 @@ public class ProjectExportTaskTest { @Before public void setUp() { - project = new Project(InstrumentationRegistry.getTargetContext(), + project = new Project(ApplicationProvider.getApplicationContext(), ProjectExportTaskTest.class.getSimpleName()); ProjectManager.getInstance().setCurrentProject(project); ProjectSaveTask - .task(project, InstrumentationRegistry.getTargetContext()); + .task(project, ApplicationProvider.getApplicationContext()); NotificationManager notificationManagerMock = Mockito.mock(NotificationManager.class); contextMock = Mockito.mock(Context.class); - Mockito.when(contextMock.getResources()).thenReturn(InstrumentationRegistry.getTargetContext().getResources()); + Mockito.when(contextMock.getResources()).thenReturn(ApplicationProvider.getApplicationContext().getResources()); Mockito.when(contextMock.getSystemService(anyString())).thenReturn(notificationManagerMock); } @@ -81,10 +82,10 @@ public void setUp() { public void exportProjectTest() { StatusBarNotificationManager notificationManager = new StatusBarNotificationManager(contextMock); NotificationData notificationData = notificationManager - .createSaveProjectToExternalMemoryNotification(InstrumentationRegistry.getTargetContext(), project.getName()); + .createSaveProjectToExternalMemoryNotification(ApplicationProvider.getApplicationContext(), project.getName()); new ProjectExportTask(project.getDirectory(), notificationData, - InstrumentationRegistry.getTargetContext()).exportProjectToExternalStorage(); + ApplicationProvider.getApplicationContext()).exportProjectToExternalStorage(); File externalProjectZip = new File(EXTERNAL_STORAGE_ROOT_EXPORT_DIRECTORY, project.getDirectory().getName() + CATROBAT_EXTENSION); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/ProjectRenameSpecialCharactersTaskTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/ProjectRenameSpecialCharactersTaskTest.java index abb4c729ce1..db2121e2813 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/ProjectRenameSpecialCharactersTaskTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/ProjectRenameSpecialCharactersTaskTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,6 @@ package org.catrobat.catroid.test.io.asynctask; -import android.support.test.InstrumentationRegistry; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.common.DefaultProjectHandler; import org.catrobat.catroid.content.Project; @@ -41,6 +39,8 @@ import java.io.IOException; import java.util.Arrays; +import androidx.test.core.app.ApplicationProvider; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -90,13 +90,13 @@ public void tearDown() throws IOException { @Test public void testRenameFromSpecialCharacter() throws IOException { Project project = DefaultProjectHandler.createAndSaveDefaultProject(specialCharacterProjectName, - InstrumentationRegistry.getTargetContext(), false); + ApplicationProvider.getApplicationContext(), false); File renamedDirectory = ProjectRenameTask.task(project.getDirectory(), projectNameWithoutSpecialCharacter); assertEquals(projectNameWithoutSpecialCharacter, renamedDirectory.getName()); - assertTrue(ProjectLoadTask.task(renamedDirectory, InstrumentationRegistry.getTargetContext())); + assertTrue(ProjectLoadTask.task(renamedDirectory, ApplicationProvider.getApplicationContext())); project = ProjectManager.getInstance().getCurrentProject(); assertEquals(projectNameWithoutSpecialCharacter, project.getName()); @@ -105,14 +105,14 @@ public void testRenameFromSpecialCharacter() throws IOException { @Test public void testRenameToSpecialCharacter() throws IOException { Project project = DefaultProjectHandler.createAndSaveDefaultProject(projectNameWithoutSpecialCharacter, - InstrumentationRegistry.getTargetContext(), false); + ApplicationProvider.getApplicationContext(), false); File renamedDirectory = ProjectRenameTask.task(project.getDirectory(), specialCharacterProjectName); File expectedDirectory = new File(project.getDirectory().getParent(), specialCharacterEncodedProjectName); assertEquals(expectedDirectory, renamedDirectory); - assertTrue(ProjectLoadTask.task(renamedDirectory, InstrumentationRegistry.getTargetContext())); + assertTrue(ProjectLoadTask.task(renamedDirectory, ApplicationProvider.getApplicationContext())); project = ProjectManager.getInstance().getCurrentProject(); assertEquals(specialCharacterProjectName, project.getName()); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/ProjectRenameTaskTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/ProjectRenameTaskTest.java index 6993e648ced..cb5045bd2c1 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/ProjectRenameTaskTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/ProjectRenameTaskTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.test.io.asynctask; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.common.DefaultProjectHandler; import org.catrobat.catroid.content.Project; import org.catrobat.catroid.io.asynctask.ProjectLoadTask; @@ -39,6 +36,9 @@ import java.io.File; import java.io.IOException; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -54,7 +54,7 @@ public class ProjectRenameTaskTest { public void setUp() throws IOException { TestUtils.deleteProjects(projectName, renamedProjectName); defaultProject = DefaultProjectHandler.createAndSaveDefaultProject(projectName, - InstrumentationRegistry.getTargetContext(), false); + ApplicationProvider.getApplicationContext(), false); } @After @@ -66,7 +66,7 @@ public void tearDown() throws IOException { public void projectRenameTaskTest() throws IOException { File renamedDirectory = ProjectRenameTask.task(defaultProject.getDirectory(), renamedProjectName); assertEquals(renamedProjectName, renamedDirectory.getName()); - assertTrue(ProjectLoadTask.task(renamedDirectory, InstrumentationRegistry.getTargetContext())); + assertTrue(ProjectLoadTask.task(renamedDirectory, ApplicationProvider.getApplicationContext())); } @Test @@ -74,6 +74,6 @@ public void projectDirectoryRenameTest() throws IOException { File expectedDirectory = new File(defaultProject.getDirectory().getParent(), renamedProjectName); File renamedDirectory = ProjectRenameTask.task(defaultProject.getDirectory(), renamedProjectName); assertEquals(expectedDirectory, renamedDirectory); - assertTrue(ProjectLoadTask.task(renamedDirectory, InstrumentationRegistry.getTargetContext())); + assertTrue(ProjectLoadTask.task(renamedDirectory, ApplicationProvider.getApplicationContext())); } } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/ProjectUnzipAndImportTaskTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/ProjectUnzipAndImportTaskTest.java index 6f4c3a66a28..32c1b47bdbd 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/ProjectUnzipAndImportTaskTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/asynctask/ProjectUnzipAndImportTaskTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.test.io.asynctask; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.content.backwardcompatibility.ProjectMetaDataParser; import org.catrobat.catroid.io.StorageOperations; import org.catrobat.catroid.io.asynctask.ProjectUnzipAndImportTask; @@ -40,6 +37,9 @@ import java.io.IOException; import java.io.InputStream; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + import static junit.framework.Assert.assertEquals; import static junit.framework.TestCase.assertTrue; @@ -65,11 +65,11 @@ public void setUp() throws IOException { CACHE_DIR.mkdir(); String assetName = "Air_fight_0.5.catrobat"; - InputStream inputStream = InstrumentationRegistry.getContext().getAssets().open(assetName); + InputStream inputStream = InstrumentationRegistry.getInstrumentation().getContext().getAssets().open(assetName); projectAirFightFile = StorageOperations.copyStreamToDir(inputStream, CACHE_DIR, assetName); assetName = "Falling_balls.catrobat"; - inputStream = InstrumentationRegistry.getContext().getAssets().open(assetName); + inputStream = InstrumentationRegistry.getInstrumentation().getContext().getAssets().open(assetName); projectFallingBallsFile = StorageOperations.copyStreamToDir(inputStream, CACHE_DIR, assetName); } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicelistaccessor/DeviceUserListAccessorCleanRoutineTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicelistaccessor/DeviceUserListAccessorCleanRoutineTest.java index 1b8d5ae4c1a..2ff000a8ded 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicelistaccessor/DeviceUserListAccessorCleanRoutineTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicelistaccessor/DeviceUserListAccessorCleanRoutineTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -22,9 +22,6 @@ */ package org.catrobat.catroid.test.io.devicelistaccessor; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.content.Project; import org.catrobat.catroid.content.Scene; import org.catrobat.catroid.content.Sprite; @@ -45,6 +42,9 @@ import java.util.Map; import java.util.UUID; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertFalse; import static junit.framework.TestCase.assertTrue; @@ -87,7 +87,7 @@ public void setUp() throws IOException { private Project createProject() { Project project = new Project(); - directory = new File(InstrumentationRegistry.getTargetContext().getCacheDir(), "DeviceValues"); + directory = new File(ApplicationProvider.getApplicationContext().getCacheDir(), "DeviceValues"); directory.mkdir(); project.setDirectory(directory); project.setName("__project__"); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicelistaccessor/DeviceUserListAccessorNullValueTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicelistaccessor/DeviceUserListAccessorNullValueTest.java index f6b18e51334..8b23e8520d7 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicelistaccessor/DeviceUserListAccessorNullValueTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicelistaccessor/DeviceUserListAccessorNullValueTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -22,9 +22,6 @@ */ package org.catrobat.catroid.test.io.devicelistaccessor; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.formulaeditor.UserList; import org.catrobat.catroid.io.DeviceListAccessor; import org.catrobat.catroid.io.StorageOperations; @@ -41,6 +38,9 @@ import java.util.Map; import java.util.UUID; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertFalse; import static org.junit.Assert.assertEquals; @@ -57,7 +57,7 @@ public class DeviceUserListAccessorNullValueTest { @Before public void setUp() { - directory = new File(InstrumentationRegistry.getTargetContext().getCacheDir(), "DeviceLists"); + directory = new File(ApplicationProvider.getApplicationContext().getCacheDir(), "DeviceLists"); directory.mkdir(); userList = new UserList("UserList", initialNullValue); accessor = new DeviceListAccessor(directory); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicelistaccessor/DeviceUserListAccessorParameterizedValueTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicelistaccessor/DeviceUserListAccessorParameterizedValueTest.java index e6de5bd72f1..461eb35de6d 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicelistaccessor/DeviceUserListAccessorParameterizedValueTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicelistaccessor/DeviceUserListAccessorParameterizedValueTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.test.io.devicelistaccessor; -import android.support.test.InstrumentationRegistry; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; import org.catrobat.catroid.content.Scene; @@ -48,6 +46,8 @@ import java.util.Map; import java.util.UUID; +import androidx.test.core.app.ApplicationProvider; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotEquals; @@ -83,7 +83,7 @@ public static Iterable data() { @Before public void setUp() { - directory = new File(InstrumentationRegistry.getTargetContext().getCacheDir(), "DeviceLists"); + directory = new File(ApplicationProvider.getApplicationContext().getCacheDir(), "DeviceLists"); directory.mkdir(); userList = new UserList("globalListX", initialValue); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicevariableaccessor/DeviceVariableAccessorCleanRoutineTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicevariableaccessor/DeviceVariableAccessorCleanRoutineTest.java index 89c9500d748..4b95387d421 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicevariableaccessor/DeviceVariableAccessorCleanRoutineTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicevariableaccessor/DeviceVariableAccessorCleanRoutineTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -22,9 +22,6 @@ */ package org.catrobat.catroid.test.io.devicevariableaccessor; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.content.Project; import org.catrobat.catroid.content.Scene; import org.catrobat.catroid.content.Sprite; @@ -43,6 +40,9 @@ import java.util.Map; import java.util.UUID; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertFalse; import static junit.framework.TestCase.assertTrue; @@ -85,7 +85,7 @@ public void setUp() throws IOException { private Project createProject() { Project project = new Project(); - directory = new File(InstrumentationRegistry.getTargetContext().getCacheDir(), "DeviceValues"); + directory = new File(ApplicationProvider.getApplicationContext().getCacheDir(), "DeviceValues"); directory.mkdir(); project.setDirectory(directory); project.setName("__project__"); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicevariableaccessor/DeviceVariableAccessorNullValueTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicevariableaccessor/DeviceVariableAccessorNullValueTest.java index 7017469da1c..431a2cbc0b6 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicevariableaccessor/DeviceVariableAccessorNullValueTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicevariableaccessor/DeviceVariableAccessorNullValueTest.java @@ -22,9 +22,6 @@ */ package org.catrobat.catroid.test.io.devicevariableaccessor; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.formulaeditor.UserVariable; import org.catrobat.catroid.io.DeviceVariableAccessor; import org.catrobat.catroid.io.StorageOperations; @@ -39,6 +36,9 @@ import java.util.Map; import java.util.UUID; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertFalse; import static org.junit.Assert.assertEquals; @@ -55,7 +55,7 @@ public class DeviceVariableAccessorNullValueTest { @Before public void setUp() { - directory = new File(InstrumentationRegistry.getTargetContext().getCacheDir(), "DeviceValues"); + directory = new File(ApplicationProvider.getApplicationContext().getCacheDir(), "DeviceValues"); directory.mkdir(); userVariable = new UserVariable("UserVariable", initialNullValue); accessor = new DeviceVariableAccessor(directory); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicevariableaccessor/DeviceVariableAccessorParameterizedValueTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicevariableaccessor/DeviceVariableAccessorParameterizedValueTest.java index a2b320663b9..a2f043fa4ce 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicevariableaccessor/DeviceVariableAccessorParameterizedValueTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/devicevariableaccessor/DeviceVariableAccessorParameterizedValueTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.test.io.devicevariableaccessor; -import android.support.test.InstrumentationRegistry; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; import org.catrobat.catroid.content.Scene; @@ -46,6 +44,8 @@ import java.util.Map; import java.util.UUID; +import androidx.test.core.app.ApplicationProvider; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotSame; @@ -82,7 +82,7 @@ public static Iterable data() { @Before public void setUp() { - directory = new File(InstrumentationRegistry.getTargetContext().getCacheDir(), "DeviceValues"); + directory = new File(ApplicationProvider.getApplicationContext().getCacheDir(), "DeviceValues"); directory.mkdir(); userVariable = new UserVariable("globalVarX", initialValue); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/filepicker/ListProjectFilesTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/filepicker/ListProjectFilesTest.java index c85453160c5..81784026113 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/filepicker/ListProjectFilesTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/filepicker/ListProjectFilesTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.test.io.filepicker; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.io.StorageOperations; import org.catrobat.catroid.ui.filepicker.ListProjectFilesTask; import org.junit.After; @@ -37,6 +34,9 @@ import java.io.IOException; import java.util.List; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertTrue; import static org.catrobat.catroid.common.Constants.CODE_XML_FILE_NAME; @@ -53,7 +53,7 @@ public class ListProjectFilesTest { @Before public void setUp() throws IOException { - tmpFolder = new File(InstrumentationRegistry.getTargetContext().getCacheDir(), "ListProjectFilesTestTmp"); + tmpFolder = new File(ApplicationProvider.getApplicationContext().getCacheDir(), "ListProjectFilesTestTmp"); if (tmpFolder.isDirectory()) { StorageOperations.deleteDir(tmpFolder); } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ziparchiver/UnzipProjectFromAssetsTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ziparchiver/UnzipProjectFromAssetsTest.java index 2631e81f184..d97539576bd 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ziparchiver/UnzipProjectFromAssetsTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ziparchiver/UnzipProjectFromAssetsTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.test.io.ziparchiver; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.io.StorageOperations; import org.catrobat.catroid.io.ZipArchiver; import org.junit.After; @@ -39,6 +36,9 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + import static junit.framework.Assert.assertTrue; import static org.catrobat.catroid.common.FlavoredConstants.DEFAULT_ROOT_DIRECTORY; @@ -63,13 +63,14 @@ public void tearDown() throws IOException { @Test public void testUnzipProjectFromAssets() throws IOException { String assetName = "Air_fight_0.5.catrobat"; - InputStream inputStream = InstrumentationRegistry.getContext().getAssets().open(assetName); + InputStream inputStream = + InstrumentationRegistry.getInstrumentation().getContext().getAssets().open(assetName); new ZipArchiver().unzip(inputStream, projectDir); assertTrue(projectDir.exists()); - inputStream = InstrumentationRegistry.getContext().getAssets().open(assetName); + inputStream = InstrumentationRegistry.getInstrumentation().getContext().getAssets().open(assetName); ZipInputStream zipInputStream = new ZipInputStream(inputStream); ZipEntry entry; diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ziparchiver/ZipFolderTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ziparchiver/ZipFolderTest.java index d586d2eac05..b93a8208ffe 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ziparchiver/ZipFolderTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/io/ziparchiver/ZipFolderTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.test.io.ziparchiver; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.common.FlavoredConstants; import org.catrobat.catroid.io.StorageOperations; import org.catrobat.catroid.io.ZipArchiver; @@ -38,6 +35,9 @@ import java.io.IOException; import java.io.InputStream; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + import static junit.framework.Assert.assertTrue; @RunWith(AndroidJUnit4.class) @@ -61,7 +61,7 @@ public void tearDown() throws IOException { @Test public void testCompareZippedProjects() throws IOException { String assetName = "Air_fight_0.5.catrobat"; - InputStream inputStream = InstrumentationRegistry.getContext().getAssets().open(assetName); + InputStream inputStream = InstrumentationRegistry.getInstrumentation().getContext().getAssets().open(assetName); new ZipArchiver().unzip(inputStream, projectDir); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsActiveStageAreaTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsActiveStageAreaTest.java index ba8ffa053d2..292869f276a 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsActiveStageAreaTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsActiveStageAreaTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.test.physics; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.common.LookData; import org.catrobat.catroid.content.Project; import org.catrobat.catroid.content.SingleSprite; @@ -42,6 +39,9 @@ import java.io.File; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertNotNull; @@ -147,7 +147,7 @@ public void testSpriteLargerThanActiveAreaHangupAndResume() throws Exception { String rectangle8192x8192FileName = PhysicsTestUtils.getInternalImageFilenameFromFilename("rectangle_8192x8192.png"); File rectangle8192x8192File = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.rectangle_8192x8192, new File(project.getDefaultScene().getDirectory(), IMAGE_DIRECTORY_NAME), rectangle8192x8192FileName, diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsShapeBuilderTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsShapeBuilderTest.java index 54d0aaa4cbb..ff903a9568a 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsShapeBuilderTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsShapeBuilderTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -22,9 +22,6 @@ */ package org.catrobat.catroid.test.physics; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.badlogic.gdx.physics.box2d.PolygonShape; import com.badlogic.gdx.physics.box2d.Shape; import com.badlogic.gdx.utils.GdxNativesLoader; @@ -51,6 +48,10 @@ import java.io.File; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertNotNull; @@ -87,7 +88,7 @@ public void setUp() throws Exception { physicsShapeBuilder = PhysicsShapeBuilder.getInstance(); - project = new Project(InstrumentationRegistry.getTargetContext(), TestUtils.DEFAULT_TEST_PROJECT_NAME); + project = new Project(ApplicationProvider.getApplicationContext(), TestUtils.DEFAULT_TEST_PROJECT_NAME); XstreamSerializer.getInstance().saveProject(project); ProjectManager.getInstance().setCurrentProject(project); @@ -95,7 +96,7 @@ public void setUp() throws Exception { .getInternalImageFilenameFromFilename("simple_single_convex_polygon.png"); simpleSingleConvexPolygonFile = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), R.raw.rectangle_125x125, new File(project.getDefaultScene().getDirectory(), IMAGE_DIRECTORY_NAME), simpleSingleConvexPolygonFileName, @@ -105,7 +106,7 @@ public void setUp() throws Exception { .getInternalImageFilenameFromFilename("complex_single_convex_polygon.png"); complexSingleConvexPolygonFile = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), R.raw.complex_single_convex_polygon, new File(project.getDefaultScene().getDirectory(), IMAGE_DIRECTORY_NAME), complexSingleConvexPolygonFileName, diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsShapeScaleUtilsTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsShapeScaleUtilsTest.java index 26d162de5fd..0be2063c0ba 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsShapeScaleUtilsTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsShapeScaleUtilsTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -22,9 +22,6 @@ */ package org.catrobat.catroid.test.physics; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.physics.box2d.PolygonShape; @@ -52,6 +49,10 @@ import java.io.File; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertNotNull; @@ -81,7 +82,7 @@ public void setUp() throws Exception { StorageOperations.deleteDir(projectDir); } - project = new Project(InstrumentationRegistry.getTargetContext(), TestUtils.DEFAULT_TEST_PROJECT_NAME); + project = new Project(ApplicationProvider.getApplicationContext(), TestUtils.DEFAULT_TEST_PROJECT_NAME); XstreamSerializer.getInstance().saveProject(project); ProjectManager.getInstance().setCurrentProject(project); @@ -89,7 +90,7 @@ public void setUp() throws Exception { .getInternalImageFilenameFromFilename("complex_single_convex_polygon.png"); File complexSingleConvexPolygonFile = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), R.raw.complex_single_convex_polygon, new File(project.getDefaultScene().getDirectory(), IMAGE_DIRECTORY_NAME), complexSingleConvexPolygonFileName, diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsSpriteCloneTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsSpriteCloneTest.java index b37ea6939f2..4cc14fba749 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsSpriteCloneTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsSpriteCloneTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -22,9 +22,6 @@ */ package org.catrobat.catroid.test.physics; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.common.LookData; import org.catrobat.catroid.content.Look; @@ -48,6 +45,10 @@ import java.io.File; import java.io.IOException; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertNotNull; import static junit.framework.Assert.assertNotSame; @@ -65,7 +66,7 @@ public class PhysicsSpriteCloneTest { public void setUp() throws Exception { TestUtils.deleteProjects(); - project = new Project(InstrumentationRegistry.getTargetContext(), TestUtils.DEFAULT_TEST_PROJECT_NAME); + project = new Project(ApplicationProvider.getApplicationContext(), TestUtils.DEFAULT_TEST_PROJECT_NAME); XstreamSerializer.getInstance().saveProject(project); ProjectManager.getInstance().setCurrentProject(project); @@ -96,7 +97,7 @@ public void testSpriteClonePhysicsLookAndPhysicsObject() throws IOException { LookData lookdata; File rectangle125x125File = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.rectangle_125x125, new File(project.getDefaultScene().getDirectory(), IMAGE_DIRECTORY_NAME), rectangle125x125FileName, diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsTestRule.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsTestRule.java index 78a063a21b3..ed5358ac972 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsTestRule.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/PhysicsTestRule.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.test.physics; -import android.support.test.InstrumentationRegistry; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.common.LookData; import org.catrobat.catroid.content.Project; @@ -39,6 +37,9 @@ import java.io.File; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.platform.app.InstrumentationRegistry; + import static junit.framework.Assert.assertNotNull; import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; @@ -57,7 +58,7 @@ protected void before() throws Throwable { TestUtils.deleteProjects(); rectangle125x125FileName = PhysicsTestUtils.getInternalImageFilenameFromFilename("rectangle_125x125.png"); - project = new Project(InstrumentationRegistry.getTargetContext(), TestUtils.DEFAULT_TEST_PROJECT_NAME); + project = new Project(ApplicationProvider.getApplicationContext(), TestUtils.DEFAULT_TEST_PROJECT_NAME); physicsWorld = project.getDefaultScene().getPhysicsWorld(); sprite = new Sprite("TestSprite"); @@ -69,7 +70,7 @@ protected void before() throws Throwable { ProjectManager.getInstance().setCurrentProject(project); rectangle125x125File = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), R.raw.rectangle_125x125, new File(project.getDefaultScene().getDirectory(), IMAGE_DIRECTORY_NAME), rectangle125x125FileName, diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetLookActionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetLookActionTest.java index c6016d386d4..d8fa1b11108 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetLookActionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/actions/SetLookActionTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.test.physics.actions; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.badlogic.gdx.scenes.scene2d.Action; import org.catrobat.catroid.common.LookData; @@ -43,6 +40,9 @@ import java.io.File; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertNotNull; @@ -73,7 +73,7 @@ public void setUp() throws Exception { multipleConvexPolygonsFileName = PhysicsTestUtils.getInternalImageFilenameFromFilename("multible_convex_polygons.png"); multipleConvexPolygonsFile = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.multible_convex_polygons, new File(project.getDefaultScene().getDirectory(), IMAGE_DIRECTORY_NAME), multipleConvexPolygonsFileName, diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionDetectionAdvancedTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionDetectionAdvancedTest.java index 50c7a82bad8..9a51d01f689 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionDetectionAdvancedTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionDetectionAdvancedTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.test.physics.collision; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.badlogic.gdx.math.Polygon; import com.badlogic.gdx.scenes.scene2d.Action; @@ -51,6 +48,10 @@ import java.io.File; import java.io.IOException; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + import static junit.framework.Assert.assertEquals; import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; @@ -72,7 +73,7 @@ private void initializeSprite(Sprite sprite, int resourceId, String filename) th String hashedFileName = Utils.md5Checksum(filename) + "_" + filename; File file = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), resourceId, new File(project.getDefaultScene().getDirectory(), IMAGE_DIRECTORY_NAME), hashedFileName, @@ -93,7 +94,7 @@ private void initializeSprite(Sprite sprite, int resourceId, String filename) th public void setUp() throws Exception { TestUtils.deleteProjects(); - project = new Project(InstrumentationRegistry.getTargetContext(), TestUtils.DEFAULT_TEST_PROJECT_NAME); + project = new Project(ApplicationProvider.getApplicationContext(), TestUtils.DEFAULT_TEST_PROJECT_NAME); sprite1 = new Sprite("TestSprite1"); sprite2 = new Sprite("TestSprite2"); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionDetectionPolygonCreationTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionDetectionPolygonCreationTest.java index 5e4b1da6b4c..0fef64339c4 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionDetectionPolygonCreationTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionDetectionPolygonCreationTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.test.physics.collision; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.common.LookData; import org.catrobat.catroid.content.Project; @@ -42,6 +39,10 @@ import java.io.File; import java.io.IOException; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertNotNull; @@ -59,7 +60,7 @@ public class CollisionDetectionPolygonCreationTest { public void setUp() throws Exception { TestUtils.deleteProjects(); - project = new Project(InstrumentationRegistry.getTargetContext(), TestUtils.DEFAULT_TEST_PROJECT_NAME); + project = new Project(ApplicationProvider.getApplicationContext(), TestUtils.DEFAULT_TEST_PROJECT_NAME); sprite = new Sprite("testSprite"); project.getDefaultScene().addSprite(sprite); @@ -71,7 +72,7 @@ protected CollisionInformation generateCollisionInformation(int resourceId, Stri String hashedFileName = PhysicsTestUtils.getInternalImageFilenameFromFilename(filename); File file = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), resourceId, new File(project.getDefaultScene().getDirectory(), IMAGE_DIRECTORY_NAME), hashedFileName, diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionFormulaConversionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionFormulaConversionTest.java index 08042dd10a6..8797237a2df 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionFormulaConversionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionFormulaConversionTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -26,8 +26,6 @@ import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.CatroidApplication; import org.catrobat.catroid.ProjectManager; @@ -52,6 +50,10 @@ import java.io.IOException; import java.util.Locale; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + import static junit.framework.Assert.assertEquals; import static org.hamcrest.Matchers.instanceOf; @@ -66,7 +68,7 @@ public class CollisionFormulaConversionTest { @Before public void setUp() throws Exception { - ScreenValueHandler.updateScreenWidthAndHeight(InstrumentationRegistry.getContext()); + ScreenValueHandler.updateScreenWidthAndHeight(InstrumentationRegistry.getInstrumentation().getContext()); projectManager = ProjectManager.getInstance(); } @@ -74,7 +76,7 @@ public void setUp() throws Exception { public void tearDown() throws Exception { projectManager.setCurrentProject(null); TestUtils.deleteProjects(COLLISION_TEST_PROJECT); - TestUtils.removeFromPreferences(InstrumentationRegistry.getContext(), Constants.PREF_PROJECTNAME_KEY); + TestUtils.removeFromPreferences(InstrumentationRegistry.getInstrumentation().getContext(), Constants.PREF_PROJECTNAME_KEY); } @Test @@ -85,7 +87,7 @@ public void testFormulaUpdated() throws IOException { String collisionTag = CatroidApplication.getAppContext().getString(R.string .formula_editor_function_collision); Project project = createProjectWithOldCollisionFormulas(COLLISION_TEST_PROJECT, - InstrumentationRegistry.getTargetContext(), + ApplicationProvider.getApplicationContext(), firstSpriteName, secondSpriteName, thirdSpriteName, collisionTag); ProjectManager.updateCollisionFormulasTo993(project); @@ -96,8 +98,8 @@ public void testFormulaUpdated() throws IOException { assertThat(brick, is(instanceOf(FormulaBrick.class))); FormulaBrick formulaBrick = (FormulaBrick) brick; - String newFormula = formulaBrick.getFormulas().get(0).getTrimmedFormulaString(InstrumentationRegistry - .getTargetContext()); + String newFormula = + formulaBrick.getFormulas().get(0).getTrimmedFormulaString(ApplicationProvider.getApplicationContext()); String expected = collisionTag + "(" + thirdSpriteName + ") "; assertEquals(expected, newFormula); @@ -124,7 +126,7 @@ public void testFormulaUpdatedWithLanguageConversion() throws IOException { .formula_editor_function_collision); Project project = createProjectWithOldCollisionFormulas(COLLISION_TEST_PROJECT, - InstrumentationRegistry.getTargetContext(), + ApplicationProvider.getApplicationContext(), firstSpriteName, secondSpriteName, thirdSpriteName, collisionTag); ProjectManager.updateCollisionFormulasTo993(project); @@ -135,8 +137,8 @@ public void testFormulaUpdatedWithLanguageConversion() throws IOException { assertThat(brick, is(instanceOf(FormulaBrick.class))); FormulaBrick formulaBrick = (FormulaBrick) brick; - String newFormula = formulaBrick.getFormulas().get(0).getTrimmedFormulaString(InstrumentationRegistry - .getTargetContext()); + String newFormula = + formulaBrick.getFormulas().get(0).getTrimmedFormulaString(ApplicationProvider.getApplicationContext()); String expected = collisionTag + "(" + thirdSpriteName + ") "; assertEquals(expected, newFormula); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionInformationTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionInformationTest.java index 213f75a05bf..9baec4f24e5 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionInformationTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionInformationTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,8 +24,6 @@ package org.catrobat.catroid.test.physics.collision; import android.graphics.Bitmap; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import com.badlogic.gdx.math.Polygon; @@ -48,6 +46,10 @@ import java.util.ArrayList; import java.util.Arrays; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertNotNull; import static junit.framework.Assert.assertTrue; @@ -105,7 +107,7 @@ public void testCreateCollisionPolygonByHitbox() { public void testGetCollisionPolygonFromPNGMeta() throws IOException { TestUtils.deleteProjects(); - Project project = new Project(InstrumentationRegistry.getTargetContext(), TestUtils.DEFAULT_TEST_PROJECT_NAME); + Project project = new Project(ApplicationProvider.getApplicationContext(), TestUtils.DEFAULT_TEST_PROJECT_NAME); XstreamSerializer.getInstance().saveProject(project); ProjectManager.getInstance().setCurrentProject(project); @@ -113,7 +115,7 @@ public void testGetCollisionPolygonFromPNGMeta() throws IOException { String filename = PhysicsTestUtils.getInternalImageFilenameFromFilename("polygon_in_file.png"); File file = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.polygon_in_file, new File(project.getDefaultScene().getDirectory(), IMAGE_DIRECTORY_NAME), filename, @@ -132,7 +134,7 @@ public void testGetCollisionPolygonFromPNGMeta() throws IOException { public void testWriteReadCollisionVerticesToPNGMeta() throws IOException { TestUtils.deleteProjects(); - Project project = new Project(InstrumentationRegistry.getTargetContext(), TestUtils.DEFAULT_TEST_PROJECT_NAME); + Project project = new Project(ApplicationProvider.getApplicationContext(), TestUtils.DEFAULT_TEST_PROJECT_NAME); XstreamSerializer.getInstance().saveProject(project); ProjectManager.getInstance().setCurrentProject(project); @@ -141,7 +143,7 @@ public void testWriteReadCollisionVerticesToPNGMeta() throws IOException { String hashedFileName = Utils.md5Checksum(filename) + "_" + filename; File file = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.collision_donut, new File(project.getDefaultScene().getDirectory(), IMAGE_DIRECTORY_NAME), hashedFileName, @@ -162,7 +164,7 @@ public void testWriteReadCollisionVerticesToPNGMeta() throws IOException { public void testWriteReadEmptyCollisionVerticesToPNGMeta() throws IOException { TestUtils.deleteProjects(); - Project project = new Project(InstrumentationRegistry.getTargetContext(), TestUtils.DEFAULT_TEST_PROJECT_NAME); + Project project = new Project(ApplicationProvider.getApplicationContext(), TestUtils.DEFAULT_TEST_PROJECT_NAME); XstreamSerializer.getInstance().saveProject(project); ProjectManager.getInstance().setCurrentProject(project); @@ -171,7 +173,7 @@ public void testWriteReadEmptyCollisionVerticesToPNGMeta() throws IOException { String hashedFileName = Utils.md5Checksum(filename) + "_" + filename; File file = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.collision_donut, new File(project.getDefaultScene().getDirectory(), IMAGE_DIRECTORY_NAME), hashedFileName, diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionTestUtils.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionTestUtils.java index 5a719bb9f80..179561d34be 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionTestUtils.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/collision/CollisionTestUtils.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,7 +24,6 @@ package org.catrobat.catroid.test.physics.collision; import android.content.Context; -import android.support.test.InstrumentationRegistry; import junit.framework.Assert; @@ -40,6 +39,8 @@ import java.io.File; import java.io.IOException; +import androidx.test.platform.app.InstrumentationRegistry; + import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; import static org.catrobat.catroid.test.physics.PhysicsTestUtils.generateLookData; @@ -57,7 +58,7 @@ public static void initializeSprite(Sprite sprite, int resourceId, String filena String hashedFileName = Utils.md5Checksum(filename) + "_" + filename; File file = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), resourceId, new File(project.getDefaultScene().getDirectory(), IMAGE_DIRECTORY_NAME), hashedFileName, diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/look/PhysicsLookDataTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/look/PhysicsLookDataTest.java index e1dbdd324b7..42520bde66b 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/look/PhysicsLookDataTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/physics/look/PhysicsLookDataTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -22,9 +22,6 @@ */ package org.catrobat.catroid.test.physics.look; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.physics.box2d.PolygonShape; @@ -54,6 +51,10 @@ import java.io.File; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertNotNull; @@ -79,12 +80,12 @@ public void setUp() throws Exception { StorageOperations.deleteDir(projectDir); } String testImageFilename = PhysicsTestUtils.getInternalImageFilenameFromFilename("testImage.png"); - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); XstreamSerializer.getInstance().saveProject(project); ProjectManager.getInstance().setCurrentProject(project); File testImage = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), R.raw.multible_mixed_polygons, new File(project.getDefaultScene().getDirectory(), IMAGE_DIRECTORY_NAME), testImageFilename, diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/pocketmusic/note/midi/ProjectToMidiConverterTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/pocketmusic/note/midi/ProjectToMidiConverterTest.java index 0dae58813b8..d481f127a99 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/pocketmusic/note/midi/ProjectToMidiConverterTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/pocketmusic/note/midi/ProjectToMidiConverterTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.test.pocketmusic.note.midi; import android.Manifest; -import android.support.test.InstrumentationRegistry; -import androidx.test.rule.GrantPermissionRule; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.pocketmusic.note.Project; import org.catrobat.catroid.pocketmusic.note.midi.MidiException; @@ -39,6 +36,10 @@ import java.io.File; import java.io.IOException; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.rule.GrantPermissionRule; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertTrue; @@ -53,7 +54,7 @@ public class ProjectToMidiConverterTest { @Before public void setUp() { - file = new File(InstrumentationRegistry.getTargetContext().getCacheDir(), FILE_NAME); + file = new File(ApplicationProvider.getApplicationContext().getCacheDir(), FILE_NAME); } @After diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/WebSocketClientTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/WebSocketClientTest.java index f3ca288bab6..5283ec22994 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/WebSocketClientTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/WebSocketClientTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,8 +24,6 @@ package org.catrobat.catroid.test.scratchconverter; import android.net.Uri; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import com.google.android.gms.common.images.WebImage; import com.koushikdutta.async.callback.CompletedCallback; @@ -59,6 +57,9 @@ import java.lang.reflect.Field; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertNotNull; @@ -92,7 +93,7 @@ public class WebSocketClientTest { @Before public void setUp() throws Exception { - System.setProperty("dexmaker.dexcache", InstrumentationRegistry.getTargetContext().getCacheDir().getPath()); + System.setProperty("dexmaker.dexcache", ApplicationProvider.getApplicationContext().getCacheDir().getPath()); messageListenerMock = Mockito.mock(WebSocketMessageListener.class); asyncHttpClientMock = Mockito.mock(AsyncHttpClient.class); webSocketClient = new WebSocketClient(VALID_CLIENT_ID, messageListenerMock); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/protocol/WebSocketMessageListenerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/protocol/WebSocketMessageListenerTest.java index e46819ba958..dd32ca84d3b 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/protocol/WebSocketMessageListenerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/scratchconverter/protocol/WebSocketMessageListenerTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,8 +24,6 @@ package org.catrobat.catroid.test.scratchconverter.protocol; import android.net.Uri; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import com.google.android.gms.common.images.WebImage; @@ -67,6 +65,9 @@ import java.util.Map; import java.util.TimeZone; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertNotNull; @@ -97,7 +98,7 @@ public class WebSocketMessageListenerTest { @Before public void setUp() throws Exception { - System.setProperty("dexmaker.dexcache", InstrumentationRegistry.getTargetContext().getCacheDir().getPath()); + System.setProperty("dexmaker.dexcache", ApplicationProvider.getApplicationContext().getCacheDir().getPath()); baseMessageHandlerMock = Mockito.mock(BaseMessageHandler.class); webSocketMessageListener = new WebSocketMessageListener(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/sensing/TouchesEdgeTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/sensing/TouchesEdgeTest.java index a2e43d6e1da..5264f2487fd 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/sensing/TouchesEdgeTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/sensing/TouchesEdgeTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.test.sensing; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; import org.catrobat.catroid.content.Sprite; @@ -37,6 +34,10 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + import static junit.framework.Assert.assertEquals; import static org.hamcrest.Matchers.equalTo; @@ -53,7 +54,7 @@ public class TouchesEdgeTest { public void setUp() throws Exception { TestUtils.deleteProjects(); - project = new Project(InstrumentationRegistry.getTargetContext(), TestUtils.DEFAULT_TEST_PROJECT_NAME); + project = new Project(ApplicationProvider.getApplicationContext(), TestUtils.DEFAULT_TEST_PROJECT_NAME); sprite1 = new Sprite("TestSprite1"); project.getDefaultScene().addSprite(sprite1); @@ -61,7 +62,7 @@ public void setUp() throws Exception { ProjectManager.getInstance().setCurrentProject(project); CollisionTestUtils.initializeSprite(sprite1, org.catrobat.catroid.test.R.raw.collision_donut, - "collision_donut.png", InstrumentationRegistry.getContext(), project); + "collision_donut.png", InstrumentationRegistry.getInstrumentation().getContext(), project); } @Test diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/sensing/TouchesFingerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/sensing/TouchesFingerTest.java index 3ab54a04b64..9da4d031047 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/sensing/TouchesFingerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/sensing/TouchesFingerTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.test.sensing; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; import org.catrobat.catroid.content.Sprite; @@ -38,6 +35,10 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + import static junit.framework.Assert.assertEquals; import static org.hamcrest.Matchers.equalTo; @@ -54,7 +55,7 @@ public class TouchesFingerTest { public void setUp() throws Exception { TestUtils.deleteProjects(); - project = new Project(InstrumentationRegistry.getTargetContext(), TestUtils.DEFAULT_TEST_PROJECT_NAME); + project = new Project(ApplicationProvider.getApplicationContext(), TestUtils.DEFAULT_TEST_PROJECT_NAME); sprite1 = new Sprite("TestSprite1"); project.getDefaultScene().addSprite(sprite1); @@ -62,7 +63,7 @@ public void setUp() throws Exception { ProjectManager.getInstance().setCurrentProject(project); CollisionTestUtils.initializeSprite(sprite1, org.catrobat.catroid.test.R.raw.collision_donut, - "collision_donut.png", InstrumentationRegistry.getContext(), project); + "collision_donut.png", InstrumentationRegistry.getInstrumentation().getContext(), project); } @Test diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/stage/DrawAxesTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/stage/DrawAxesTest.java index 4ca3a2aea65..db5d665be75 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/stage/DrawAxesTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/stage/DrawAxesTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.test.stage; -import androidx.annotation.IdRes; -import android.support.test.InstrumentationRegistry; - import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.GlyphLayout; @@ -40,6 +37,9 @@ import java.util.Arrays; +import androidx.annotation.IdRes; +import androidx.test.core.app.ApplicationProvider; + import static junit.framework.Assert.assertEquals; @RunWith(Parameterized.class) @@ -81,7 +81,7 @@ public static Iterable data() { @Before public void setUp() throws Exception { - project = new Project(InstrumentationRegistry.getTargetContext(), "Project"); + project = new Project(ApplicationProvider.getApplicationContext(), "Project"); ProjectManager.getInstance().setCurrentProject(project); project.getXmlHeader().setVirtualScreenHeight(projectLayoutHeight); project.getXmlHeader().setVirtualScreenWidth(projectLayoutWidth); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/ui/BaseExceptionHandlerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/ui/BaseExceptionHandlerTest.java index 057a5c1a999..88b6c3ccf62 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/ui/BaseExceptionHandlerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/ui/BaseExceptionHandlerTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -26,8 +26,6 @@ import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ui.BaseExceptionHandler; import org.catrobat.catroid.ui.settingsfragments.SettingsFragment; @@ -37,6 +35,9 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; @@ -52,7 +53,7 @@ public class BaseExceptionHandlerTest { @Before public void setUp() throws Exception { - context = InstrumentationRegistry.getTargetContext(); + context = ApplicationProvider.getApplicationContext(); sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); editor = sharedPreferences.edit(); editor.clear(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/utils/TestUtils.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/utils/TestUtils.java index 5951ccfca1c..47184d13f6b 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/utils/TestUtils.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/utils/TestUtils.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -25,7 +25,6 @@ import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; -import android.support.test.InstrumentationRegistry; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Pixmap; @@ -44,6 +43,8 @@ import java.io.File; import java.io.IOException; +import androidx.test.core.app.ApplicationProvider; + public final class TestUtils { public static final String DEFAULT_TEST_PROJECT_NAME = "testProject"; @@ -64,7 +65,7 @@ public static void deleteProjects(String... projectNames) throws IOException { } public static Project createProjectWithLanguageVersion(float catrobatLanguageVersion, String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); project.setCatrobatLanguageVersion(catrobatLanguageVersion); Sprite firstSprite = new SingleSprite("cat"); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/DefaultProjectComparatorTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/DefaultProjectComparatorTest.java index 31413a1432f..3b650073748 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/DefaultProjectComparatorTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/utiltests/DefaultProjectComparatorTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.test.utiltests; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.common.DefaultProjectHandler; import org.catrobat.catroid.common.ScreenValues; import org.catrobat.catroid.content.Project; @@ -46,6 +43,9 @@ import java.io.IOException; import java.util.List; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; @@ -74,7 +74,7 @@ public void setUp() throws IOException { } defaultProject = DefaultProjectHandler - .createAndSaveDefaultProject(PROJECT_NAME, InstrumentationRegistry.getTargetContext(), false); + .createAndSaveDefaultProject(PROJECT_NAME, ApplicationProvider.getApplicationContext(), false); } @After @@ -89,7 +89,7 @@ public void tearDown() throws Exception { @Test public void testCompareProjectToDefaultProject() { - assertTrue(Utils.isDefaultProject(defaultProject, InstrumentationRegistry.getTargetContext())); + assertTrue(Utils.isDefaultProject(defaultProject, ApplicationProvider.getApplicationContext())); addSpriteAndCompareToDefaultProject(); addScriptAndCompareToDefalutProject(); @@ -102,18 +102,18 @@ public void testCompareProjectToDefaultProject() { private void addSpriteAndCompareToDefaultProject() { Sprite sprite = new SingleSprite("TestSprite"); defaultProject.getDefaultScene().addSprite(sprite); - assertFalse(Utils.isDefaultProject(defaultProject, InstrumentationRegistry.getTargetContext())); + assertFalse(Utils.isDefaultProject(defaultProject, ApplicationProvider.getApplicationContext())); defaultProject.getDefaultScene().removeSprite(sprite); - assertTrue(Utils.isDefaultProject(defaultProject, InstrumentationRegistry.getTargetContext())); + assertTrue(Utils.isDefaultProject(defaultProject, ApplicationProvider.getApplicationContext())); } private void addScriptAndCompareToDefalutProject() { Sprite sprite = defaultProject.getDefaultScene().getSpriteList().get(1); WhenScript whenScript = new WhenScript(); sprite.addScript(whenScript); - assertFalse(Utils.isDefaultProject(defaultProject, InstrumentationRegistry.getTargetContext())); + assertFalse(Utils.isDefaultProject(defaultProject, ApplicationProvider.getApplicationContext())); sprite.removeScript(whenScript); - assertTrue(Utils.isDefaultProject(defaultProject, InstrumentationRegistry.getTargetContext())); + assertTrue(Utils.isDefaultProject(defaultProject, ApplicationProvider.getApplicationContext())); } private void addBrickAndCompareToDefaultProject() { @@ -121,9 +121,9 @@ private void addBrickAndCompareToDefaultProject() { Brick brick = new HideBrick(); Script script = sprite.getScript(0); script.addBrick(brick); - assertFalse(Utils.isDefaultProject(defaultProject, InstrumentationRegistry.getTargetContext())); + assertFalse(Utils.isDefaultProject(defaultProject, ApplicationProvider.getApplicationContext())); script.removeBrick(brick); - assertTrue(Utils.isDefaultProject(defaultProject, InstrumentationRegistry.getTargetContext())); + assertTrue(Utils.isDefaultProject(defaultProject, ApplicationProvider.getApplicationContext())); } private void removeBrickAndCompareToDefaultProject() { @@ -131,20 +131,20 @@ private void removeBrickAndCompareToDefaultProject() { List brickList = script.getBrickList(); Brick brick = brickList.get(brickList.size() - 1); brickList.remove(brickList.size() - 1); - assertFalse(Utils.isDefaultProject(defaultProject, InstrumentationRegistry.getTargetContext())); + assertFalse(Utils.isDefaultProject(defaultProject, ApplicationProvider.getApplicationContext())); brickList.add(brick); - assertTrue(Utils.isDefaultProject(defaultProject, InstrumentationRegistry.getTargetContext())); + assertTrue(Utils.isDefaultProject(defaultProject, ApplicationProvider.getApplicationContext())); } private void removeScriptAndCompareToDefaultProject() { Script script = defaultProject.getDefaultScene().getSpriteList().get(1).getScript(0); Sprite sprite = defaultProject.getDefaultScene().getSpriteList().get(1); sprite.removeScript(script); - assertFalse(Utils.isDefaultProject(defaultProject, InstrumentationRegistry.getTargetContext())); + assertFalse(Utils.isDefaultProject(defaultProject, ApplicationProvider.getApplicationContext())); sprite.addScript(script); - assertTrue(Utils.isDefaultProject(defaultProject, InstrumentationRegistry.getTargetContext())); + assertTrue(Utils.isDefaultProject(defaultProject, ApplicationProvider.getApplicationContext())); } private void removeSpriteAndCompareToDefaultProject() { @@ -152,9 +152,9 @@ private void removeSpriteAndCompareToDefaultProject() { int lastIndex = defaultProject.getDefaultScene().getSpriteList().size() - 1; List spriteList = defaultProject.getDefaultScene().getSpriteList(); spriteList.remove(lastIndex); - assertFalse(Utils.isDefaultProject(defaultProject, InstrumentationRegistry.getTargetContext())); + assertFalse(Utils.isDefaultProject(defaultProject, ApplicationProvider.getApplicationContext())); spriteList.add(sprite); - assertTrue(Utils.isDefaultProject(defaultProject, InstrumentationRegistry.getTargetContext())); + assertTrue(Utils.isDefaultProject(defaultProject, ApplicationProvider.getApplicationContext())); } } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/web/AuthenticationCallsTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/web/AuthenticationCallsTest.java index eb6cb34ff88..7b293fb2a11 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/web/AuthenticationCallsTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/web/AuthenticationCallsTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,8 +24,6 @@ import android.content.SharedPreferences; import android.preference.PreferenceManager; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.common.Constants; import org.catrobat.catroid.runner.Flaky; @@ -44,6 +42,9 @@ import org.junit.runner.RunWith; import org.mockito.Mockito; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertTrue; import static org.hamcrest.MatcherAssert.assertThat; @@ -84,7 +85,7 @@ public void setUp() throws Exception { testEmail = testUser + "@gmail.com"; String testPassword = "pwspws"; listenerMock = Mockito.mock(TaskListener.class); - sharedPreferences = PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()); + sharedPreferences = PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()); authenticator = new ServerAuthenticator(testUser, testPassword, token, CatrobatWebClient.INSTANCE.getClient(), BASE_URL_TEST_HTTPS, sharedPreferences, listenerMock); } @@ -200,7 +201,7 @@ public void testCheckTokenOk() throws WebconnectionException { verify(listenerMock, never()).onError(anyInt(), anyString()); verify(listenerMock, atLeastOnce()).onSuccess(); - SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()); + SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()); token = sharedPreferences.getString(Constants.TOKEN, Constants.NO_TOKEN); assertTrue(new CatrobatServerCalls().checkToken(token, testUser, BASE_URL_TEST_HTTPS)); } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/web/CrashReporterTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/web/CrashReporterTest.java index f68847ffab5..c0cff77a563 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/web/CrashReporterTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/web/CrashReporterTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -26,7 +26,6 @@ import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; -import android.support.test.InstrumentationRegistry; import org.catrobat.catroid.ui.settingsfragments.SettingsFragment; import org.catrobat.catroid.utils.CrashReporter; @@ -38,6 +37,8 @@ import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; +import androidx.test.core.app.ApplicationProvider; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; @@ -59,7 +60,7 @@ public class CrashReporterTest { @Before public void setUp() { - context = InstrumentationRegistry.getTargetContext(); + context = ApplicationProvider.getApplicationContext(); sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); editor = sharedPreferences.edit(); editor.clear(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/web/SettingsFragmentCrashReporterTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/web/SettingsFragmentCrashReporterTest.java index 2de4fa3f6bc..d4cb8723dfa 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/web/SettingsFragmentCrashReporterTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/web/SettingsFragmentCrashReporterTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,7 +24,6 @@ package org.catrobat.catroid.test.web; import android.content.Context; -import android.support.test.InstrumentationRegistry; import org.catrobat.catroid.ui.settingsfragments.SettingsFragment; import org.catrobat.catroid.utils.CrashReporter; @@ -36,6 +35,8 @@ import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; +import androidx.test.core.app.ApplicationProvider; + import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @@ -53,7 +54,7 @@ public void setUp() throws Exception { @Test public void testAutoCrashReportEnabling() { - Context context = InstrumentationRegistry.getTargetContext(); + Context context = ApplicationProvider.getApplicationContext(); SettingsFragment.setAutoCrashReportingEnabled(context, false); verify(reporter, times(0)).initialize(context); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/BroadcastBrickMessageUpdateTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/BroadcastBrickMessageUpdateTest.java index 605ff355494..f4ca0a71444 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/BroadcastBrickMessageUpdateTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/BroadcastBrickMessageUpdateTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.content.brick.app; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.content.BroadcastScript; @@ -46,6 +43,9 @@ import java.util.Arrays; import java.util.List; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.content.messagecontainer.BroadcastMessageBrickUtils.createNewBroadCastMessageOnBrick; @@ -93,7 +93,7 @@ public void testAllBroadcastBricksSpinnersShowTheNewAddedMessage() { } private void createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new Sprite("testSprite"); Script script1 = new BroadcastScript(defaultMessage); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PlaySoundAndWaitBrickTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PlaySoundAndWaitBrickTest.java index 2e176300e36..8708eda7524 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PlaySoundAndWaitBrickTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PlaySoundAndWaitBrickTest.java @@ -24,9 +24,6 @@ package org.catrobat.catroid.uiespresso.content.brick.app; import android.Manifest; -import android.support.test.InstrumentationRegistry; -import androidx.test.rule.GrantPermissionRule; -import androidx.test.ext.junit.runners.AndroidJUnit4; import android.widget.EditText; import org.catrobat.catroid.ProjectManager; @@ -58,7 +55,18 @@ import java.io.IOException; import java.util.List; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.rule.GrantPermissionRule; + +import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; +import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.hamcrest.Matchers.allOf; +import static org.hamcrest.Matchers.instanceOf; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.closeSoftKeyboard; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; @@ -73,12 +81,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; -import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.hamcrest.Matchers.allOf; -import static org.hamcrest.Matchers.instanceOf; - @RunWith(AndroidJUnit4.class) public class PlaySoundAndWaitBrickTest { @@ -255,7 +257,7 @@ private void recordNewSound(int durationMillis) { private void createProject() throws IOException { String projectName = "playSoundAndWaitBrickTest"; SoundManager.getInstance(); - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new Sprite("testSprite"); Script startScript = new StartScript(); @@ -272,7 +274,7 @@ private void createProject() throws IOException { startScript.addBrick(new PlaySoundBrick()); soundFile = ResourceImporter.createSoundFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.longsound, new File(project.getDefaultScene().getDirectory(), SOUND_DIRECTORY_NAME), "longsound.mp3"); @@ -282,7 +284,7 @@ private void createProject() throws IOException { soundInfo.setName(soundName); soundFile2 = ResourceImporter.createSoundFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.testsoundui, new File(project.getDefaultScene().getDirectory(), SOUND_DIRECTORY_NAME), "testsoundui.mp3"); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PlaySoundBrickTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PlaySoundBrickTest.java index 1910f6a0153..d896b0a77ef 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PlaySoundBrickTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PlaySoundBrickTest.java @@ -24,9 +24,6 @@ package org.catrobat.catroid.uiespresso.content.brick.app; import android.Manifest; -import android.support.test.InstrumentationRegistry; -import androidx.test.rule.GrantPermissionRule; -import androidx.test.ext.junit.runners.AndroidJUnit4; import android.widget.EditText; import org.catrobat.catroid.ProjectManager; @@ -54,7 +51,18 @@ import java.io.IOException; import java.util.List; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.rule.GrantPermissionRule; + +import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; +import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.hamcrest.Matchers.allOf; +import static org.hamcrest.Matchers.instanceOf; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static androidx.test.espresso.Espresso.pressBack; @@ -67,12 +75,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; -import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.hamcrest.Matchers.allOf; -import static org.hamcrest.Matchers.instanceOf; - @RunWith(AndroidJUnit4.class) public class PlaySoundBrickTest { @@ -200,7 +202,7 @@ public void testRenameSound() { private void createProject() throws IOException { SoundManager.getInstance(); - Project project = new Project(InstrumentationRegistry.getTargetContext(), getClass().getSimpleName()); + Project project = new Project(ApplicationProvider.getApplicationContext(), getClass().getSimpleName()); Sprite sprite = new Sprite("testSprite"); Script startScript = new StartScript(); @@ -215,7 +217,7 @@ private void createProject() throws IOException { startScript.addBrick(new PlaySoundBrick()); soundFile = ResourceImporter.createSoundFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.longsound, new File(project.getDefaultScene().getDirectory(), SOUND_DIRECTORY_NAME), "longsound.mp3"); @@ -225,7 +227,7 @@ private void createProject() throws IOException { soundInfo.setName(soundName); soundFile2 = ResourceImporter.createSoundFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.testsoundui, new File(project.getDefaultScene().getDirectory(), SOUND_DIRECTORY_NAME), "testsoundui.mp3"); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PointToBrickAdditionalTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PointToBrickAdditionalTest.java index 09a5bf3675c..663858881d2 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PointToBrickAdditionalTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PointToBrickAdditionalTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -29,10 +29,6 @@ import android.content.Intent; import android.net.Uri; import android.os.Environment; -import android.support.test.InstrumentationRegistry; -import androidx.test.espresso.intent.Intents; -import androidx.test.rule.GrantPermissionRule; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -59,6 +55,17 @@ import java.util.ArrayList; import java.util.List; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.espresso.intent.Intents; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.rule.GrantPermissionRule; + +import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; +import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasExtraIntent; +import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasMatchingString; +import static org.hamcrest.core.AllOf.allOf; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.matches; @@ -71,11 +78,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; -import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasExtraIntent; -import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasMatchingString; -import static org.hamcrest.core.AllOf.allOf; - @RunWith(AndroidJUnit4.class) public class PointToBrickAdditionalTest { private Matcher expectedChooserIntent; @@ -110,7 +112,7 @@ public void setUp() throws Exception { } File imageFile = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.drawable.catroid_banzai, tmpPath, lookFileName, @@ -143,11 +145,11 @@ public void testBothOfPointTowardsBrickAndCloneBrickSpinnersShowTheNewAddedObjec String newObjectName = lookFileName.replace(".png", ""); List pointToBrickSpinnerValues = new ArrayList<>(); - pointToBrickSpinnerValues.add(InstrumentationRegistry.getTargetContext().getString(R.string.new_option)); + pointToBrickSpinnerValues.add(ApplicationProvider.getApplicationContext().getString(R.string.new_option)); pointToBrickSpinnerValues.add(newObjectName); List cloneBrickSpinnerValues = new ArrayList<>(); - cloneBrickSpinnerValues.add(InstrumentationRegistry.getTargetContext().getString(R.string.brick_clone_this)); + cloneBrickSpinnerValues.add(ApplicationProvider.getApplicationContext().getString(R.string.brick_clone_this)); cloneBrickSpinnerValues.add(newObjectName); onBrickAtPosition(2) @@ -168,7 +170,7 @@ public void tearDown() throws Exception { } private void createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new Sprite("testSprite"); Script script = new StartScript(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SceneBricksTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SceneBricksTest.java index f961dae0fc5..a15196467f0 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SceneBricksTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/SceneBricksTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.content.brick.app; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Project; @@ -46,12 +43,15 @@ import java.util.ArrayList; import java.util.List; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; - @RunWith(AndroidJUnit4.class) public class SceneBricksTest { @Rule @@ -78,12 +78,12 @@ public void testAllSceneBricksSpinnersShowTheNewAddedScene() { .checkShowsText(newSceneName); List sceneStartBrickSpinnerValues = new ArrayList<>(); - sceneStartBrickSpinnerValues.add(InstrumentationRegistry.getTargetContext().getString(R.string.new_option)); - sceneStartBrickSpinnerValues.add(InstrumentationRegistry.getTargetContext().getString(R.string.default_scene_name, 1)); + sceneStartBrickSpinnerValues.add(ApplicationProvider.getApplicationContext().getString(R.string.new_option)); + sceneStartBrickSpinnerValues.add(ApplicationProvider.getApplicationContext().getString(R.string.default_scene_name, 1)); sceneStartBrickSpinnerValues.add(newSceneName); List sceneTransitionBrickSpinnerValues = new ArrayList<>(); - sceneTransitionBrickSpinnerValues.add(InstrumentationRegistry.getTargetContext().getString(R.string.new_option)); + sceneTransitionBrickSpinnerValues.add(ApplicationProvider.getApplicationContext().getString(R.string.new_option)); sceneTransitionBrickSpinnerValues.add(newSceneName); onBrickAtPosition(2) @@ -105,7 +105,7 @@ public void tearDown() throws Exception { private void createProject(String projectName) { String sceneName = "New Scene"; - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new Sprite("testSprite"); Script script = new StartScript(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/rtl/RtlBrickTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/rtl/RtlBrickTest.java index 46ff023c4ce..5abd31f5cb3 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/rtl/RtlBrickTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/rtl/RtlBrickTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -25,8 +25,6 @@ import android.content.SharedPreferences; import android.preference.PreferenceManager; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -190,14 +188,8 @@ import java.util.List; import java.util.Locale; -import static android.support.test.InstrumentationRegistry.getTargetContext; -import static androidx.test.espresso.Espresso.onData; -import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.assertion.ViewAssertions.matches; -import static androidx.test.espresso.matcher.ViewMatchers.hasChildCount; -import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static androidx.test.espresso.matcher.ViewMatchers.withParent; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertTrue; @@ -215,6 +207,15 @@ import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.core.Is.is; +import static androidx.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.espresso.Espresso.onData; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.hasChildCount; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withParent; + @RunWith(AndroidJUnit4.class) public class RtlBrickTest { @@ -235,7 +236,7 @@ public void setUp() throws Exception { SettingsFragment.setLanguageSharedPreference(getTargetContext(), "ar"); createProject("RtlBricksTest"); SharedPreferences sharedPreferences = PreferenceManager - .getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()); + .getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()); for (String category : allPeripheralCategories) { boolean categoryEnabled = sharedPreferences.getBoolean(category, false); @@ -250,7 +251,7 @@ public void setUp() throws Exception { @After public void tearDown() { SharedPreferences sharedPreferences = PreferenceManager - .getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()); + .getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()); for (String category : enabledByThisTestPeripheralCategories) { sharedPreferences.edit().putBoolean(category, false).commit(); } @@ -684,7 +685,7 @@ private void checkIfBrickAtPositionIsRtl(Class brickClass, int position, int bri private void createProject(String projectName) { String nameSpriteTwo = "testSpriteTwo"; - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite spriteOne = new Sprite("testSpriteOne"); project.getDefaultScene().addSprite(spriteOne); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/AskBrickStageTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/AskBrickStageTest.java index 584788fad4f..3cf0eda7e51 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/AskBrickStageTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/AskBrickStageTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,9 +24,6 @@ package org.catrobat.catroid.uiespresso.content.brick.stage; import android.Manifest; -import android.support.test.InstrumentationRegistry; -import androidx.test.rule.GrantPermissionRule; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -48,16 +45,20 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.rule.GrantPermissionRule; + +import static org.catrobat.catroid.uiespresso.util.UiTestUtils.getResourcesString; +import static org.catrobat.catroid.uiespresso.util.UserVariableAssertions.assertUserVariableEqualsWithTimeout; +import static org.hamcrest.core.StringEndsWith.endsWith; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.action.ViewActions.typeText; import static androidx.test.espresso.matcher.ViewMatchers.withClassName; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.util.UiTestUtils.getResourcesString; -import static org.catrobat.catroid.uiespresso.util.UserVariableAssertions.assertUserVariableEqualsWithTimeout; -import static org.hamcrest.core.StringEndsWith.endsWith; - @RunWith(AndroidJUnit4.class) public class AskBrickStageTest { @@ -107,7 +108,7 @@ public void testAskBrickNormalAnswer() { private void createProject(String projectName) { String userVariableName = "TempVariable"; - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite1 = new Sprite("testSprite"); Script sprite1StartScript = new StartScript(); sprite1.addScript(sprite1StartScript); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/PlaySoundBrickStageTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/PlaySoundBrickStageTest.java index 42222ebc055..c81b360a22a 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/PlaySoundBrickStageTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/PlaySoundBrickStageTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.content.brick.stage; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.common.SoundInfo; @@ -52,12 +49,16 @@ import java.io.IOException; import java.util.List; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + +import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; - @RunWith(AndroidJUnit4.class) public class PlaySoundBrickStageTest { @@ -114,7 +115,7 @@ private void createProjectWithSound() throws IOException { String projectName = "playSoundStageTest"; SoundManager.getInstance(); - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new Sprite("testSprite"); Script startScript = new StartScript(); @@ -126,7 +127,7 @@ private void createProjectWithSound() throws IOException { startScript.addBrick(new PlaySoundBrick()); soundFile = ResourceImporter.createSoundFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.longsound, new File(project.getDefaultScene().getDirectory(), SOUND_DIRECTORY_NAME), "longsound.mp3"); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SayBubbleBrickStageTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SayBubbleBrickStageTest.java index 4b9e0d103ab..de7eff634bf 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SayBubbleBrickStageTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SayBubbleBrickStageTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.content.brick.stage; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; import org.catrobat.catroid.content.Script; @@ -43,6 +40,9 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertNotNull; @RunWith(AndroidJUnit4.class) @@ -70,7 +70,7 @@ public void sayBubbleBrickStageTest() { private void createProject(String projectName) { String sayString = "say something"; - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); sprite = new Sprite("testSprite"); Script script = new StartScript(); script.addBrick(new SayBubbleBrick(sayString)); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SayForBubbleBrickStageTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SayForBubbleBrickStageTest.java index 12f20dacc2a..70c9b7d1082 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SayForBubbleBrickStageTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SayForBubbleBrickStageTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.content.brick.stage; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; import org.catrobat.catroid.content.Script; @@ -46,13 +43,16 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.matcher.ViewMatchers.isFocusable; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; import static junit.framework.Assert.assertNotNull; import static junit.framework.Assert.assertNull; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.isFocusable; + @RunWith(AndroidJUnit4.class) public class SayForBubbleBrickStageTest { private Sprite sprite; @@ -88,7 +88,7 @@ public void sayForBubbleBrickStageTest() { private void createProject(String projectName) { String sayString = "say something"; float duration = 2f; - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); sprite = new Sprite("testSprite"); Script script = new WhenTouchDownScript(); sprite.addScript(script); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SceneTransitionBrickStageTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SceneTransitionBrickStageTest.java index b007f875b3b..bc713ba76f8 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SceneTransitionBrickStageTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SceneTransitionBrickStageTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.content.brick.stage; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; import org.catrobat.catroid.content.Scene; @@ -49,6 +46,9 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + @RunWith(AndroidJUnit4.class) public class SceneTransitionBrickStageTest { @@ -74,7 +74,7 @@ public void testContinueScene() { } private void createProject() { - Project project = new Project(InstrumentationRegistry.getTargetContext(), getClass().getSimpleName()); + Project project = new Project(ApplicationProvider.getApplicationContext(), getClass().getSimpleName()); Scene firstScene = project.getDefaultScene(); Scene secondScene = new Scene("Scene 2", project); @@ -120,6 +120,6 @@ private void createProject() { project.addScene(secondScene); ProjectSaveTask - .task(project, InstrumentationRegistry.getTargetContext()); + .task(project, ApplicationProvider.getApplicationContext()); } } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SceneTransitionTouchEventRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SceneTransitionTouchEventRegressionTest.java index ce448b57e83..604e4590ad9 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SceneTransitionTouchEventRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/SceneTransitionTouchEventRegressionTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.content.brick.stage; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; import org.catrobat.catroid.content.Scene; @@ -48,6 +45,9 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.matcher.ViewMatchers.isFocusable; @@ -80,7 +80,7 @@ public void testContinueScene() { } private void createProject() { - Project project = new Project(InstrumentationRegistry.getTargetContext(), getClass().getSimpleName()); + Project project = new Project(ApplicationProvider.getApplicationContext(), getClass().getSimpleName()); ProjectManager.getInstance().setCurrentProject(project); Scene firstScene = project.getDefaultScene(); @@ -106,6 +106,6 @@ private void createProject() { project.addScene(secondScene); ProjectSaveTask - .task(project, InstrumentationRegistry.getTargetContext()); + .task(project, ApplicationProvider.getApplicationContext()); } } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/ThinkBubbleBrickStageTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/ThinkBubbleBrickStageTest.java index e7def692d6f..e6817cbea09 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/ThinkBubbleBrickStageTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/ThinkBubbleBrickStageTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.content.brick.stage; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; import org.catrobat.catroid.content.Script; @@ -43,6 +40,9 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertNotNull; @RunWith(AndroidJUnit4.class) @@ -70,7 +70,7 @@ public void thinkBubbleBrickStageTest() { private void createProject(String projectName) { String thinkString = "say something"; - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); sprite = new Sprite("testSprite"); Script script = new StartScript(); script.addBrick(new ThinkBubbleBrick(thinkString)); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/ThinkForBubbleBrickStageTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/ThinkForBubbleBrickStageTest.java index fb882a845b9..76ab96d5c17 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/ThinkForBubbleBrickStageTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/ThinkForBubbleBrickStageTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.content.brick.stage; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; import org.catrobat.catroid.content.Script; @@ -46,13 +43,16 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.matcher.ViewMatchers.isFocusable; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; import static junit.framework.Assert.assertNotNull; import static junit.framework.Assert.assertNull; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.isFocusable; + @RunWith(AndroidJUnit4.class) public class ThinkForBubbleBrickStageTest { private Sprite sprite; @@ -88,7 +88,7 @@ public void thinkForBubbleBrickStageTest() { private void createProject(String projectName) { String sayString = "think something"; float duration = 2f; - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); sprite = new Sprite("testSprite"); Script script = new WhenTouchDownScript(); sprite.addScript(script); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/WhenNfcBrickHardwareStageTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/WhenNfcBrickHardwareStageTest.java index ccafca27d2b..ce58b085b8a 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/WhenNfcBrickHardwareStageTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/WhenNfcBrickHardwareStageTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.content.brick.stage; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Project; @@ -49,9 +46,8 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.matcher.ViewMatchers.withId; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.content.brick.utils.UiNFCTestUtils.NUM_DETECTED_TAGS; @@ -60,6 +56,10 @@ import static org.catrobat.catroid.uiespresso.util.UserVariableAssertions.assertUserVariableContainsStringWithTimeout; import static org.catrobat.catroid.uiespresso.util.UserVariableAssertions.assertUserVariableEqualsWithTimeout; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; + @RunWith(AndroidJUnit4.class) public class WhenNfcBrickHardwareStageTest { private int waitingTime = 2000; @@ -84,7 +84,7 @@ public void setUp() throws Exception { } private void createProjectWithNfcAndSetVariable() { - Project project = new Project(InstrumentationRegistry.getTargetContext(), "whenNfcBrickHardwareTest"); + Project project = new Project(ApplicationProvider.getApplicationContext(), "whenNfcBrickHardwareTest"); numDetectedTags = new UserVariable(NUM_DETECTED_TAGS); readTagId = new UserVariable(READ_TAG_ID); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/WhenNfcBrickStageFromScriptTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/WhenNfcBrickStageFromScriptTest.java index 7af1401533c..84cab45d692 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/WhenNfcBrickStageFromScriptTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/WhenNfcBrickStageFromScriptTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,8 +24,6 @@ package org.catrobat.catroid.uiespresso.content.brick.stage; import android.nfc.NdefMessage; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -54,11 +52,8 @@ import java.util.List; -import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.Espresso.pressBack; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static androidx.test.espresso.matcher.ViewMatchers.withText; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; import static junit.framework.Assert.assertEquals; @@ -71,6 +66,12 @@ import static org.catrobat.catroid.uiespresso.content.brick.utils.UiNFCTestUtils.onNfcBrickAtPosition; import static org.catrobat.catroid.uiespresso.util.UserVariableAssertions.assertUserVariableEqualsWithTimeout; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.pressBack; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; + @RunWith(AndroidJUnit4.class) public class WhenNfcBrickStageFromScriptTest { @Rule @@ -148,7 +149,7 @@ private void gotoNfcFragment(int nfcBrickPosition) { } private Script createProjectWithNfcAndSetVariable() { - Project project = new Project(InstrumentationRegistry.getTargetContext(), "nfcTestProject"); + Project project = new Project(ApplicationProvider.getApplicationContext(), "nfcTestProject"); numDetectedTags = new UserVariable(NUM_DETECTED_TAGS); readTagId = new UserVariable(READ_TAG_ID); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/WhenNfcBrickStageTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/WhenNfcBrickStageTest.java index 0c613b0072d..2cd804ff47c 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/WhenNfcBrickStageTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/stage/WhenNfcBrickStageTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,7 +24,6 @@ package org.catrobat.catroid.uiespresso.content.brick.stage; import android.nfc.NdefMessage; -import android.support.test.InstrumentationRegistry; import junit.framework.Assert; @@ -53,6 +52,8 @@ import java.util.List; +import androidx.test.core.app.ApplicationProvider; + import static org.catrobat.catroid.uiespresso.content.brick.utils.UiNFCTestUtils.NUM_DETECTED_TAGS; import static org.catrobat.catroid.uiespresso.content.brick.utils.UiNFCTestUtils.READ_TAG_ID; import static org.catrobat.catroid.uiespresso.content.brick.utils.UiNFCTestUtils.READ_TAG_MESSAGE; @@ -81,7 +82,7 @@ public class WhenNfcBrickStageTest { private WhenNfcScript scriptUnderTest; private WhenNfcScript createProjectWithNfcAndSetVariable() { - Project project = new Project(InstrumentationRegistry.getTargetContext(), "nfcStageTestProject"); + Project project = new Project(ApplicationProvider.getApplicationContext(), "nfcStageTestProject"); numDetectedTags = new UserVariable(NUM_DETECTED_TAGS); readTagId = new UserVariable(READ_TAG_ID); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickTestUtils.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickTestUtils.java index b7c56575776..3b31d3ec13d 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickTestUtils.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/utils/BrickTestUtils.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,21 +23,21 @@ package org.catrobat.catroid.uiespresso.content.brick.utils; -import android.support.test.InstrumentationRegistry; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; import org.catrobat.catroid.content.Script; import org.catrobat.catroid.content.Sprite; import org.catrobat.catroid.content.StartScript; +import androidx.test.core.app.ApplicationProvider; + public final class BrickTestUtils { private BrickTestUtils() { throw new AssertionError(); } public static Script createProjectAndGetStartScript(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new Sprite("testSprite"); Script script = new StartScript(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastAndWaitBrickMessageContainerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastAndWaitBrickMessageContainerTest.java index 6284622a7d5..788dd93c384 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastAndWaitBrickMessageContainerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastAndWaitBrickMessageContainerTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.content.messagecontainer; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Project; @@ -50,16 +47,19 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; -import static androidx.test.espresso.matcher.ViewMatchers.withText; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; import static junit.framework.TestCase.assertTrue; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.content.messagecontainer.BroadcastMessageBrickUtils.createNewBroadCastMessageOnBrick; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.matcher.ViewMatchers.withText; + @RunWith(AndroidJUnit4.class) public class BroadcastAndWaitBrickMessageContainerTest { @@ -109,12 +109,12 @@ public void testBroadcastAndWaitBrickOmitSaveUnusedMessages() { .checkShowsText(defaultMessage); ProjectSaveTask - .task(project, InstrumentationRegistry.getTargetContext()); + .task(project, ApplicationProvider.getApplicationContext()); baseActivityTestRule.finishActivity(); assertTrue(ProjectLoadTask - .task(project.getDirectory(), InstrumentationRegistry.getTargetContext())); + .task(project.getDirectory(), ApplicationProvider.getApplicationContext())); ProjectManager.getInstance().setCurrentSprite(sprite); @@ -133,7 +133,7 @@ public void testBroadcastAndWaitBrickOmitSaveUnusedMessages() { } private void createProject(String projectName) { - project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + project = new Project(ApplicationProvider.getApplicationContext(), projectName); sprite = new Sprite("testSprite"); Script script = new StartScript(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastMessageBrickUtils.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastMessageBrickUtils.java index 58f9bcb96e4..02f99a472b0 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastMessageBrickUtils.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastMessageBrickUtils.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,13 +24,14 @@ package org.catrobat.catroid.uiespresso.content.messagecontainer; import android.content.DialogInterface; -import android.support.test.InstrumentationRegistry; -import androidx.appcompat.app.AppCompatActivity; import org.catrobat.catroid.content.bricks.BroadcastMessageBrick; import org.catrobat.catroid.ui.SpriteActivity; import org.mockito.Mockito; +import androidx.appcompat.app.AppCompatActivity; +import androidx.test.platform.app.InstrumentationRegistry; + public final class BroadcastMessageBrickUtils { private BroadcastMessageBrickUtils() { throw new AssertionError(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastReceiveBrickMessageContainerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastReceiveBrickMessageContainerTest.java index 89dfa477a56..a6e03dbf85c 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastReceiveBrickMessageContainerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastReceiveBrickMessageContainerTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.content.messagecontainer; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.content.BroadcastScript; @@ -51,16 +48,19 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; -import static androidx.test.espresso.matcher.ViewMatchers.withText; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; import static junit.framework.TestCase.assertTrue; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.content.messagecontainer.BroadcastMessageBrickUtils.createNewBroadCastMessageOnBrick; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.matcher.ViewMatchers.withText; + @RunWith(AndroidJUnit4.class) public class BroadcastReceiveBrickMessageContainerTest { @@ -110,12 +110,12 @@ public void testBroadcastReceiveBrickOmitSaveUnusedMessages() { .checkShowsText(defaultMessage); ProjectSaveTask - .task(project, InstrumentationRegistry.getTargetContext()); + .task(project, ApplicationProvider.getApplicationContext()); baseActivityTestRule.finishActivity(); assertTrue(ProjectLoadTask - .task(project.getDirectory(), InstrumentationRegistry.getTargetContext())); + .task(project.getDirectory(), ApplicationProvider.getApplicationContext())); ProjectManager.getInstance().setCurrentSprite(sprite); @@ -134,7 +134,7 @@ public void testBroadcastReceiveBrickOmitSaveUnusedMessages() { } private void createProject(String projectName) { - project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + project = new Project(ApplicationProvider.getApplicationContext(), projectName); sprite = new Sprite("testSprite"); Script script = new StartScript(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastSendBrickMessageContainerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastSendBrickMessageContainerTest.java index 6c37a05e75b..d62d3eae536 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastSendBrickMessageContainerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/messagecontainer/BroadcastSendBrickMessageContainerTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.content.messagecontainer; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Project; @@ -50,16 +47,19 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; -import static androidx.test.espresso.matcher.ViewMatchers.withText; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; import static junit.framework.TestCase.assertTrue; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.content.messagecontainer.BroadcastMessageBrickUtils.createNewBroadCastMessageOnBrick; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.matcher.ViewMatchers.withText; + @RunWith(AndroidJUnit4.class) public class BroadcastSendBrickMessageContainerTest { @@ -109,12 +109,12 @@ public void testBroadcastSendBrickOmitSaveUnusedMessages() { .checkShowsText(defaultMessage); ProjectSaveTask - .task(project, InstrumentationRegistry.getTargetContext()); + .task(project, ApplicationProvider.getApplicationContext()); baseActivityTestRule.finishActivity(); assertTrue(ProjectLoadTask - .task(project.getDirectory(), InstrumentationRegistry.getTargetContext())); + .task(project.getDirectory(), ApplicationProvider.getApplicationContext())); ProjectManager.getInstance().setCurrentSprite(sprite); @@ -133,7 +133,7 @@ public void testBroadcastSendBrickOmitSaveUnusedMessages() { } private void createProject(String projectName) { - project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + project = new Project(ApplicationProvider.getApplicationContext(), projectName); sprite = new Sprite("testSprite"); Script script = new StartScript(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/facedetection/FaceDetectionFormulaEditorComputeDialogTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/facedetection/FaceDetectionFormulaEditorComputeDialogTest.java index 7e4bc96df74..5f104e8e446 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/facedetection/FaceDetectionFormulaEditorComputeDialogTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/facedetection/FaceDetectionFormulaEditorComputeDialogTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.facedetection; import android.Manifest; -import android.support.test.InstrumentationRegistry; -import androidx.test.rule.GrantPermissionRule; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -50,16 +47,20 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.Espresso.pressBack; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.matcher.ViewMatchers.withId; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.rule.GrantPermissionRule; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.pressBack; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; + @RunWith(AndroidJUnit4.class) public class FaceDetectionFormulaEditorComputeDialogTest { @@ -102,7 +103,7 @@ public void computeDialogFacedetectionResourceTest() { } public Project createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new Sprite("testSprite"); Script script = new StartScript(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/facedetection/FaceDetectionResourceStartedTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/facedetection/FaceDetectionResourceStartedTest.java index 29868c7451d..ca6d0be2bb7 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/facedetection/FaceDetectionResourceStartedTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/facedetection/FaceDetectionResourceStartedTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -22,9 +22,6 @@ */ package org.catrobat.catroid.uiespresso.facedetection; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Project; @@ -49,14 +46,17 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static junit.framework.Assert.assertFalse; +import static junit.framework.Assert.assertTrue; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.pressBack; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static junit.framework.Assert.assertFalse; -import static junit.framework.Assert.assertTrue; - @RunWith(AndroidJUnit4.class) public class FaceDetectionResourceStartedTest { @@ -143,7 +143,7 @@ public void facedetectionResourceChangedTest() { } private void createProject() { - Project project = new Project(InstrumentationRegistry.getTargetContext(), "FaceDetectionResourceStartedTest"); + Project project = new Project(ApplicationProvider.getApplicationContext(), "FaceDetectionResourceStartedTest"); Sprite sprite = new Sprite("testSprite"); Script startScript = new StartScript(); SetSizeToBrick setSizeToBrick = new SetSizeToBrick(formula); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorBrickViewOnClickTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorBrickViewOnClickTest.java index 326ac8b919f..4ed95f8dfe8 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorBrickViewOnClickTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorBrickViewOnClickTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.formulaeditor; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; import org.catrobat.catroid.content.bricks.Brick; @@ -39,6 +36,14 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; +import static org.hamcrest.Matchers.allOf; +import static org.hamcrest.core.IsNot.not; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.matches; @@ -47,11 +52,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.isFocusable; import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; -import static org.hamcrest.Matchers.allOf; -import static org.hamcrest.core.IsNot.not; - @RunWith(AndroidJUnit4.class) public class FormulaEditorBrickViewOnClickTest { @@ -86,14 +86,14 @@ public void checkSwitchBetweenBrickFields() { onFormulaEditor() .checkShows(showTextBrick.getFormulaWithBrickField(Brick.BrickField.X_POSITION) - .getTrimmedFormulaString(InstrumentationRegistry.getTargetContext())); + .getTrimmedFormulaString(ApplicationProvider.getApplicationContext())); onView(withId(R.id.brick_show_variable_edit_text_y)) .perform(click()); onFormulaEditor() .checkShows(showTextBrick.getFormulaWithBrickField(Brick.BrickField.Y_POSITION) - .getTrimmedFormulaString(InstrumentationRegistry.getTargetContext())); + .getTrimmedFormulaString(ApplicationProvider.getApplicationContext())); } private void createProject() { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorDeleteVariableTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorDeleteVariableTest.java index 79575dd7a13..6261c52b07b 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorDeleteVariableTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorDeleteVariableTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -36,19 +36,19 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.matcher.RootMatchers.isPlatformPopup; -import static androidx.test.espresso.matcher.ViewMatchers.withId; - import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorDataListWrapper.onDataList; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; import static org.catrobat.catroid.uiespresso.ui.actionbar.utils.ActionModeWrapper.onActionMode; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static androidx.test.InstrumentationRegistry.getInstrumentation; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.RootMatchers.isPlatformPopup; +import static androidx.test.espresso.matcher.ViewMatchers.withId; + public class FormulaEditorDeleteVariableTest { @Rule diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorFragmentTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorFragmentTest.java index eed1c498ae6..edd9941fd28 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorFragmentTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorFragmentTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -22,9 +22,6 @@ */ package org.catrobat.catroid.uiespresso.formulaeditor; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Project; @@ -48,6 +45,12 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.pressBack; import static androidx.test.espresso.action.ViewActions.click; @@ -56,9 +59,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; - @RunWith(AndroidJUnit4.class) public class FormulaEditorFragmentTest { @@ -179,7 +179,7 @@ public void tearDown() throws Exception { } public Project createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new Sprite("testSprite"); Script script = new StartScript(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorKeyboardTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorKeyboardTest.java index 798fb11de62..480b3bb7c19 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorKeyboardTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorKeyboardTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -22,9 +22,6 @@ */ package org.catrobat.catroid.uiespresso.formulaeditor; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Project; @@ -45,14 +42,17 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.matches; import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; - @RunWith(AndroidJUnit4.class) public class FormulaEditorKeyboardTest { @@ -114,7 +114,7 @@ public void tearDown() throws Exception { } public Project createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new Sprite("testSprite"); Script script = new StartScript(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorTest.java index d03ec869baa..85a714d9cd1 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -22,9 +22,6 @@ */ package org.catrobat.catroid.uiespresso.formulaeditor; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Project; @@ -44,12 +41,15 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; - @RunWith(AndroidJUnit4.class) public class FormulaEditorTest { @@ -80,7 +80,7 @@ public void tearDown() throws Exception { } public static Project createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new Sprite("testSprite"); Script script = new StartScript(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/FormulaEditorLocaleVariableComputeTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/FormulaEditorLocaleVariableComputeTest.java index f8e12bd2d2e..bde2142950d 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/FormulaEditorLocaleVariableComputeTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/utils/FormulaEditorLocaleVariableComputeTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.formulaeditor.utils; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Project; @@ -46,6 +43,11 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.pressBack; import static androidx.test.espresso.action.ViewActions.click; @@ -53,8 +55,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; - @RunWith(AndroidJUnit4.class) public class FormulaEditorLocaleVariableComputeTest { @Rule @@ -87,7 +87,7 @@ public void tearDown() throws Exception { } public Project createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); firstScene = project.getDefaultScene(); secondScene = new Scene("secondScene", project); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/LookFromGalleryIntentDismissTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/LookFromGalleryIntentDismissTest.java index c4d71e4ade6..d7a0880f9cf 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/LookFromGalleryIntentDismissTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/LookFromGalleryIntentDismissTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -27,10 +27,6 @@ import android.app.Activity; import android.app.Instrumentation; import android.content.Intent; -import android.support.test.InstrumentationRegistry; -import androidx.test.espresso.intent.Intents; -import androidx.test.rule.GrantPermissionRule; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -50,6 +46,16 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.espresso.intent.Intents; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.rule.GrantPermissionRule; + +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasExtraIntent; +import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasMatchingString; +import static org.hamcrest.core.AllOf.allOf; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.intent.Intents.intended; @@ -59,11 +65,6 @@ import static androidx.test.espresso.intent.matcher.IntentMatchers.hasType; import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasExtraIntent; -import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasMatchingString; -import static org.hamcrest.core.AllOf.allOf; - @RunWith(AndroidJUnit4.class) public class LookFromGalleryIntentDismissTest { @@ -122,7 +123,7 @@ public void testLookFromGalleryIntentDismissTest() { } private void createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new Sprite("testSprite"); project.getDefaultScene().addSprite(sprite); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/LookFromGalleryIntentTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/LookFromGalleryIntentTest.java index 37db29d571f..6c487924702 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/LookFromGalleryIntentTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/LookFromGalleryIntentTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -29,10 +29,6 @@ import android.content.Intent; import android.net.Uri; import android.os.Environment; -import android.support.test.InstrumentationRegistry; -import androidx.test.espresso.intent.Intents; -import androidx.test.rule.GrantPermissionRule; -import androidx.test.ext.junit.runners.AndroidJUnit4; import android.util.Log; import org.catrobat.catroid.ProjectManager; @@ -58,6 +54,18 @@ import java.io.File; import java.io.IOException; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.espresso.intent.Intents; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.rule.GrantPermissionRule; + +import static org.catrobat.catroid.common.FlavoredConstants.DEFAULT_ROOT_DIRECTORY; +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasExtraIntent; +import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasMatchingString; +import static org.hamcrest.core.AllOf.allOf; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.matches; @@ -69,12 +77,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.common.FlavoredConstants.DEFAULT_ROOT_DIRECTORY; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasExtraIntent; -import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasMatchingString; -import static org.hamcrest.core.AllOf.allOf; - @RunWith(AndroidJUnit4.class) public class LookFromGalleryIntentTest { @@ -114,7 +116,7 @@ public void setUp() throws Exception { } File imageFile = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.drawable.catroid_banzai, tmpPath, lookFileName, @@ -157,7 +159,7 @@ public void testLookFromGalleryIntentTest() { } private void createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new Sprite("testSprite"); project.getDefaultScene().addSprite(sprite); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/SpriteFromGalleryIntentDismissTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/SpriteFromGalleryIntentDismissTest.java index 82dc0dd90da..42503eb2c65 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/SpriteFromGalleryIntentDismissTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/SpriteFromGalleryIntentDismissTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -27,10 +27,6 @@ import android.app.Activity; import android.app.Instrumentation; import android.content.Intent; -import android.support.test.InstrumentationRegistry; -import androidx.test.espresso.intent.Intents; -import androidx.test.rule.GrantPermissionRule; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -49,6 +45,16 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.espresso.intent.Intents; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.rule.GrantPermissionRule; + +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasExtraIntent; +import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasMatchingString; +import static org.hamcrest.core.AllOf.allOf; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; @@ -60,11 +66,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasExtraIntent; -import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasMatchingString; -import static org.hamcrest.core.AllOf.allOf; - @RunWith(AndroidJUnit4.class) public class SpriteFromGalleryIntentDismissTest { @@ -126,7 +127,7 @@ public void testSpriteFromGalleryIntentDismissTest() { } private void createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); ProjectManager.getInstance().setCurrentProject(project); ProjectManager.getInstance().setCurrentlyEditedScene(project.getDefaultScene()); XstreamSerializer.getInstance().saveProject(project); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/SpriteFromGalleryIntentTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/SpriteFromGalleryIntentTest.java index ef468b46fd0..f3859f1b36a 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/SpriteFromGalleryIntentTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/gallery/SpriteFromGalleryIntentTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -29,10 +29,6 @@ import android.content.Intent; import android.net.Uri; import android.os.Environment; -import android.support.test.InstrumentationRegistry; -import androidx.test.espresso.intent.Intents; -import androidx.test.rule.GrantPermissionRule; -import androidx.test.ext.junit.runners.AndroidJUnit4; import android.util.Log; import org.catrobat.catroid.ProjectManager; @@ -57,6 +53,18 @@ import java.io.File; import java.io.IOException; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.espresso.intent.Intents; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.rule.GrantPermissionRule; + +import static org.catrobat.catroid.common.FlavoredConstants.DEFAULT_ROOT_DIRECTORY; +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasExtraIntent; +import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasMatchingString; +import static org.hamcrest.core.AllOf.allOf; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.matches; @@ -69,12 +77,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.common.FlavoredConstants.DEFAULT_ROOT_DIRECTORY; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasExtraIntent; -import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasMatchingString; -import static org.hamcrest.core.AllOf.allOf; - @RunWith(AndroidJUnit4.class) public class SpriteFromGalleryIntentTest { @@ -114,7 +116,7 @@ public void setUp() throws Exception { } File imageFile = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.drawable.catroid_banzai, tmpPath, lookFileName, @@ -162,7 +164,7 @@ public void testSpriteFromGalleryIntentTest() { } private void createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); ProjectManager.getInstance().setCurrentProject(project); ProjectManager.getInstance().setCurrentlyEditedScene(project.getDefaultScene()); XstreamSerializer.getInstance().saveProject(project); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintEditLookIntentTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintEditLookIntentTest.java index 309bb4bd67b..652d7d6aa07 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintEditLookIntentTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintEditLookIntentTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -26,9 +26,6 @@ import android.app.Activity; import android.app.Instrumentation; import android.content.Intent; -import android.support.test.InstrumentationRegistry; -import androidx.test.espresso.intent.Intents; -import androidx.test.ext.junit.runners.AndroidJUnit4; import android.util.Log; import org.catrobat.catroid.ProjectManager; @@ -57,6 +54,19 @@ import java.io.IOException; import java.util.List; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.espresso.intent.Intents; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + +import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; +import static org.catrobat.catroid.common.FlavoredConstants.DEFAULT_ROOT_DIRECTORY; +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasMatchingString; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.hasItem; +import static org.hamcrest.core.AllOf.allOf; + import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.matches; import static androidx.test.espresso.intent.Intents.intended; @@ -67,14 +77,6 @@ import static androidx.test.espresso.intent.matcher.IntentMatchers.hasExtras; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; -import static org.catrobat.catroid.common.FlavoredConstants.DEFAULT_ROOT_DIRECTORY; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasMatchingString; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.hasItem; -import static org.hamcrest.core.AllOf.allOf; - @RunWith(AndroidJUnit4.class) public class PocketPaintEditLookIntentTest { @@ -133,7 +135,7 @@ public void testOpenPaintroid() { } private Project createProject(String projectName) throws IOException { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new SingleSprite("testSprite"); project.getDefaultScene().addSprite(sprite); @@ -143,7 +145,7 @@ private Project createProject(String projectName) throws IOException { XstreamSerializer.getInstance().saveProject(project); File imageFile = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.drawable.catroid_banzai, new File(project.getDefaultScene().getDirectory(), IMAGE_DIRECTORY_NAME), "catroid_sunglasses.png", diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewLookDiscardIntentTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewLookDiscardIntentTest.java index acccf42488e..b45e78c8b03 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewLookDiscardIntentTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewLookDiscardIntentTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -26,9 +26,6 @@ import android.app.Activity; import android.app.Instrumentation; import android.content.Intent; -import android.support.test.InstrumentationRegistry; -import androidx.test.espresso.intent.Intents; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -47,6 +44,15 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.espresso.intent.Intents; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.hasItem; +import static org.hamcrest.core.AllOf.allOf; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.intent.Intents.intended; @@ -56,11 +62,6 @@ import static androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent; import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.hasItem; -import static org.hamcrest.core.AllOf.allOf; - @RunWith(AndroidJUnit4.class) public class PocketPaintNewLookDiscardIntentTest { @@ -111,7 +112,7 @@ public void testCancelImport() { } private void createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite testSprite = new Sprite(); project.getDefaultScene().addSprite(testSprite); ProjectManager.getInstance().setCurrentProject(project); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewLookIntentTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewLookIntentTest.java index cad2024e1e1..4d0194f9f44 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewLookIntentTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewLookIntentTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -25,9 +25,6 @@ import android.app.Activity; import android.app.Instrumentation; -import android.support.test.InstrumentationRegistry; -import androidx.test.espresso.intent.Intents; -import androidx.test.ext.junit.runners.AndroidJUnit4; import android.util.Log; import org.catrobat.catroid.ProjectManager; @@ -52,6 +49,16 @@ import java.io.File; import java.io.IOException; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.espresso.intent.Intents; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.common.FlavoredConstants.DEFAULT_ROOT_DIRECTORY; +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.hasItem; +import static org.hamcrest.core.AllOf.allOf; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.matches; @@ -63,12 +70,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.common.FlavoredConstants.DEFAULT_ROOT_DIRECTORY; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.hasItem; -import static org.hamcrest.core.AllOf.allOf; - @RunWith(AndroidJUnit4.class) public class PocketPaintNewLookIntentTest { @@ -125,7 +126,7 @@ public void testAddNewLook() { } private void createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new Sprite(spriteName); project.getDefaultScene().addSprite(sprite); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewSpriteDiscardIntentTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewSpriteDiscardIntentTest.java index 8f2dcce22eb..1c6d0ac37a5 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewSpriteDiscardIntentTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewSpriteDiscardIntentTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -26,9 +26,6 @@ import android.app.Activity; import android.app.Instrumentation; import android.content.Intent; -import android.support.test.InstrumentationRegistry; -import androidx.test.espresso.intent.Intents; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -46,6 +43,15 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.espresso.intent.Intents; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.hasItem; +import static org.hamcrest.core.AllOf.allOf; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.intent.Intents.intended; @@ -55,11 +61,6 @@ import static androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent; import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.hasItem; -import static org.hamcrest.core.AllOf.allOf; - @RunWith(AndroidJUnit4.class) public class PocketPaintNewSpriteDiscardIntentTest { @@ -110,7 +111,7 @@ public void testCancelImport() { } private void createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); ProjectManager.getInstance().setCurrentProject(project); ProjectManager.getInstance().setCurrentlyEditedScene(project.getDefaultScene()); } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewSpriteIntentTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewSpriteIntentTest.java index 9b499d12e43..b59ad31e992 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewSpriteIntentTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/looks/paintroid/PocketPaintNewSpriteIntentTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -25,9 +25,6 @@ import android.app.Activity; import android.app.Instrumentation; -import android.support.test.InstrumentationRegistry; -import androidx.test.espresso.intent.Intents; -import androidx.test.ext.junit.runners.AndroidJUnit4; import android.util.Log; import org.catrobat.catroid.ProjectManager; @@ -54,6 +51,17 @@ import java.io.File; import java.io.IOException; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.espresso.intent.Intents; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.common.FlavoredConstants.DEFAULT_ROOT_DIRECTORY; +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.hasItem; +import static org.hamcrest.core.AllOf.allOf; +import static org.junit.Assert.assertEquals; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.matches; @@ -66,13 +74,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.common.FlavoredConstants.DEFAULT_ROOT_DIRECTORY; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.hasItem; -import static org.hamcrest.core.AllOf.allOf; -import static org.junit.Assert.assertEquals; - @RunWith(AndroidJUnit4.class) public class PocketPaintNewSpriteIntentTest { @@ -139,7 +140,7 @@ public void testAddNewSprite() { } private void createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); ProjectManager.getInstance().setCurrentProject(project); ProjectManager.getInstance().setCurrentlyEditedScene(project.getDefaultScene()); XstreamSerializer.getInstance().saveProject(project); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/sounds/gallery/SoundFromGalleryIntentDismissTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/sounds/gallery/SoundFromGalleryIntentDismissTest.java index c3887b31d0d..53923e0c8f3 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/sounds/gallery/SoundFromGalleryIntentDismissTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/sounds/gallery/SoundFromGalleryIntentDismissTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -27,10 +27,6 @@ import android.app.Activity; import android.app.Instrumentation; import android.content.Intent; -import android.support.test.InstrumentationRegistry; -import androidx.test.espresso.intent.Intents; -import androidx.test.rule.GrantPermissionRule; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -52,6 +48,16 @@ import java.io.IOException; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.espresso.intent.Intents; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.rule.GrantPermissionRule; + +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasExtraIntent; +import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasMatchingString; +import static org.hamcrest.core.AllOf.allOf; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.intent.Intents.intended; @@ -61,11 +67,6 @@ import static androidx.test.espresso.intent.matcher.IntentMatchers.hasType; import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasExtraIntent; -import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasMatchingString; -import static org.hamcrest.core.AllOf.allOf; - @RunWith(AndroidJUnit4.class) public class SoundFromGalleryIntentDismissTest { @@ -124,7 +125,7 @@ public void testSoundFromGalleryIntentDismissTest() { } private void createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new Sprite("testSprite"); project.getDefaultScene().addSprite(sprite); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/sounds/gallery/SoundFromGalleryIntentTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/sounds/gallery/SoundFromGalleryIntentTest.java index 7fc7d1aad91..8ecd73b41f6 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/sounds/gallery/SoundFromGalleryIntentTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/sounds/gallery/SoundFromGalleryIntentTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -29,10 +29,6 @@ import android.content.Intent; import android.net.Uri; import android.os.Environment; -import android.support.test.InstrumentationRegistry; -import androidx.test.espresso.intent.Intents; -import androidx.test.rule.GrantPermissionRule; -import androidx.test.ext.junit.runners.AndroidJUnit4; import android.util.Log; import org.catrobat.catroid.ProjectManager; @@ -58,6 +54,18 @@ import java.io.File; import java.io.IOException; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.espresso.intent.Intents; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.rule.GrantPermissionRule; + +import static org.catrobat.catroid.common.FlavoredConstants.DEFAULT_ROOT_DIRECTORY; +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasExtraIntent; +import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasMatchingString; +import static org.hamcrest.core.AllOf.allOf; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.matches; @@ -69,12 +77,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.common.FlavoredConstants.DEFAULT_ROOT_DIRECTORY; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasExtraIntent; -import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasMatchingString; -import static org.hamcrest.core.AllOf.allOf; - @RunWith(AndroidJUnit4.class) public class SoundFromGalleryIntentTest { @@ -114,7 +116,7 @@ public void setUp() throws Exception { } File soundFile = ResourceImporter.createSoundFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.longsound, tmpPath, soundFileName); @@ -156,7 +158,7 @@ public void testSoundFromGalleryIntentTest() { } private void createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new Sprite("testSprite"); project.getDefaultScene().addSprite(sprite); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/permissions/CameraPermissionSpriteActivityTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/permissions/CameraPermissionSpriteActivityTest.java index 5e57f7bd5a9..d4c56818399 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/permissions/CameraPermissionSpriteActivityTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/permissions/CameraPermissionSpriteActivityTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -26,9 +26,6 @@ import android.app.Activity; import android.app.Instrumentation; import android.content.Intent; -import android.support.test.InstrumentationRegistry; -import androidx.test.espresso.intent.Intents; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -51,12 +48,23 @@ import java.util.Arrays; import java.util.List; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.espresso.intent.Intents; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.uiautomator.UiDevice; import androidx.test.uiautomator.UiObject; import androidx.test.uiautomator.UiObjectNotFoundException; import androidx.test.uiautomator.UiSelector; import static android.Manifest.permission.CAMERA; + +import static junit.framework.Assert.assertTrue; + +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasMatchingString; +import static org.hamcrest.core.AllOf.allOf; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.intent.Intents.intended; @@ -66,12 +74,6 @@ import static androidx.test.espresso.intent.matcher.IntentMatchers.hasPackage; import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static junit.framework.Assert.assertTrue; - -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasMatchingString; -import static org.hamcrest.core.AllOf.allOf; - @RunWith(AndroidJUnit4.class) public class CameraPermissionSpriteActivityTest { @@ -147,7 +149,7 @@ public void testSpriteFromCameraPermission() throws UiObjectNotFoundException { } private void createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite testSprite = new Sprite(); project.getDefaultScene().addSprite(testSprite); ProjectManager.getInstance().setCurrentProject(project); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/pocketmusic/PocketMusicActivityTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/pocketmusic/PocketMusicActivityTest.java index dc1dbef397d..3eb0297eacb 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/pocketmusic/PocketMusicActivityTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/pocketmusic/PocketMusicActivityTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,12 +23,6 @@ package org.catrobat.catroid.uiespresso.pocketmusic; import android.content.Intent; -import android.support.test.InstrumentationRegistry; -import androidx.test.espresso.UiController; -import androidx.test.espresso.ViewAction; -import androidx.test.espresso.contrib.RecyclerViewActions; -import androidx.test.espresso.matcher.BoundedMatcher; -import androidx.test.ext.junit.runners.AndroidJUnit4; import android.view.View; import org.catrobat.catroid.ProjectManager; @@ -59,6 +53,16 @@ import java.util.Locale; import java.util.Random; +import androidx.test.espresso.UiController; +import androidx.test.espresso.ViewAction; +import androidx.test.espresso.contrib.RecyclerViewActions; +import androidx.test.espresso.matcher.BoundedMatcher; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.action.ViewActions.swipeLeft; @@ -68,9 +72,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; - @RunWith(AndroidJUnit4.class) public class PocketMusicActivityTest { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastAndWaitForDeletedClonesRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastAndWaitForDeletedClonesRegressionTest.java index ca298705a86..cef7b21c40e 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastAndWaitForDeletedClonesRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastAndWaitForDeletedClonesRegressionTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.stage; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.BroadcastScript; import org.catrobat.catroid.content.Project; @@ -47,6 +44,9 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + @RunWith(AndroidJUnit4.class) public class BroadcastAndWaitForDeletedClonesRegressionTest { @@ -70,7 +70,7 @@ public void testBroadcastsAndWaitToDeletedClones() { } private void createProject() { - Project project = new Project(InstrumentationRegistry.getTargetContext(), "BroadcastForDeletedClonesRegressionTest"); + Project project = new Project(ApplicationProvider.getApplicationContext(), "BroadcastForDeletedClonesRegressionTest"); ProjectManager.getInstance().setCurrentProject(project); Sprite sprite = new Sprite("testSprite"); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastForClonesRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastForClonesRegressionTest.java index 5527378d624..2fe5ba7ffa8 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastForClonesRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastForClonesRegressionTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.stage; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.content.BroadcastScript; @@ -48,13 +45,16 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.uiespresso.util.UserVariableAssertions.assertUserVariableEqualsWithTimeout; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.pressBack; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static org.catrobat.catroid.uiespresso.util.UserVariableAssertions.assertUserVariableEqualsWithTimeout; - @RunWith(AndroidJUnit4.class) public class BroadcastForClonesRegressionTest { @@ -93,7 +93,7 @@ public void testIfClonesBroadcastReceiversAreRemovedOnRestart() { } private void createProject() { - Project project = new Project(InstrumentationRegistry.getTargetContext(), "BroadcastForClonesRegressionTest"); + Project project = new Project(ApplicationProvider.getApplicationContext(), "BroadcastForClonesRegressionTest"); ProjectManager.getInstance().setCurrentProject(project); userVariable = new UserVariable(VARIABLE_NAME); project.addUserVariable(userVariable); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastForDeletedClonesRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastForDeletedClonesRegressionTest.java index 3c7678c5f81..f649d61363d 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastForDeletedClonesRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/BroadcastForDeletedClonesRegressionTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.stage; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.BroadcastScript; import org.catrobat.catroid.content.Project; @@ -47,6 +44,9 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + @RunWith(AndroidJUnit4.class) public class BroadcastForDeletedClonesRegressionTest { @@ -70,7 +70,7 @@ public void testBroadcastsToDeletedClones() { } private void createProject() { - Project project = new Project(InstrumentationRegistry.getTargetContext(), "BroadcastForDeletedClonesRegressionTest"); + Project project = new Project(ApplicationProvider.getApplicationContext(), "BroadcastForDeletedClonesRegressionTest"); ProjectManager.getInstance().setCurrentProject(project); Sprite sprite = new Sprite("testSprite"); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/DisabledBrickInClonesRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/DisabledBrickInClonesRegressionTest.java index c30a6e60ce2..146b4e9ba32 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/DisabledBrickInClonesRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/DisabledBrickInClonesRegressionTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.stage; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; import org.catrobat.catroid.content.Script; @@ -48,6 +45,9 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static org.catrobat.catroid.uiespresso.util.UserVariableAssertions.assertUserVariableEqualsWithTimeout; @RunWith(AndroidJUnit4.class) @@ -68,7 +68,7 @@ public void setUp() throws Exception { } private void createProject() { - Project project = new Project(InstrumentationRegistry.getTargetContext(), + Project project = new Project(ApplicationProvider.getApplicationContext(), "DisabledBrickInClonesRegressionTest"); Sprite sprite = new Sprite("someSprite"); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/ObjectVariableTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/ObjectVariableTest.java index b4d825c0680..6891652a344 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/ObjectVariableTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/ObjectVariableTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -22,9 +22,6 @@ */ package org.catrobat.catroid.uiespresso.stage; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; import org.catrobat.catroid.content.SingleSprite; @@ -58,6 +55,9 @@ import java.util.LinkedList; import java.util.List; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; @RunWith(AndroidJUnit4.class) @@ -110,7 +110,7 @@ public Double getSensorValue(Sensors sensor) throws InterpretationException { } private void createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); ProjectManager.getInstance().setCurrentProject(project); ProjectManager.getInstance().setCurrentlyEditedScene(project.getDefaultScene()); ProjectManager.getInstance().getCurrentlyEditedScene().addSprite(new SingleSprite("sprite1")); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StageResourceFailedTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StageResourceFailedTest.java index ff59cfcfcd5..175c172e7b9 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StageResourceFailedTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StageResourceFailedTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -22,9 +22,6 @@ */ package org.catrobat.catroid.uiespresso.stage; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Project; @@ -48,6 +45,9 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.assertion.ViewAssertions.matches; import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; @@ -64,7 +64,7 @@ public class StageResourceFailedTest { @Before public void setUp() throws Exception { createProject("StagePausedTest"); - SensorHandler sensorHandler = SensorHandler.getInstance(InstrumentationRegistry.getTargetContext()); + SensorHandler sensorHandler = SensorHandler.getInstance(ApplicationProvider.getApplicationContext()); sensorHandler.setAccelerationUnavailable(); } @@ -87,7 +87,7 @@ public void testResourceFailedDialog() { } public void createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new Sprite("testSprite"); Script script = new StartScript(); Formula accelerationFormula = new Formula( diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StageSimpleTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StageSimpleTest.java index 8dba9bd7837..23e30a68278 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StageSimpleTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StageSimpleTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -22,9 +22,6 @@ */ package org.catrobat.catroid.uiespresso.stage; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.common.LookData; import org.catrobat.catroid.common.ScreenValues; @@ -50,12 +47,16 @@ import java.io.File; import java.io.IOException; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + +import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.assertion.ViewAssertions.matches; import static androidx.test.espresso.matcher.ViewMatchers.isFocusable; -import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; - @RunWith(AndroidJUnit4.class) public class StageSimpleTest { @@ -87,7 +88,7 @@ public Project createProjectWithBlueSprite(String projectName) throws IOExceptio ScreenValues.SCREEN_HEIGHT = PROJECT_HEIGHT; ScreenValues.SCREEN_WIDTH = PROJECT_WIDTH; - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); // blue Sprite Sprite blueSprite = new SingleSprite("blueSprite"); @@ -108,7 +109,7 @@ public Project createProjectWithBlueSprite(String projectName) throws IOExceptio XstreamSerializer.getInstance().saveProject(project); File blueImageFile = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.blue_image, new File(project.getDefaultScene().getDirectory(), IMAGE_DIRECTORY_NAME), blueImageName, @@ -119,7 +120,7 @@ public Project createProjectWithBlueSprite(String projectName) throws IOExceptio XstreamSerializer.getInstance().saveProject(project); ProjectManager.getInstance().setCurrentProject(project); ProjectManager.getInstance().setCurrentSprite(blueSprite); - ScreenValueHandler.updateScreenWidthAndHeight(InstrumentationRegistry.getContext()); + ScreenValueHandler.updateScreenWidthAndHeight(InstrumentationRegistry.getInstrumentation().getContext()); return project; } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StartStageTouchTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StartStageTouchTest.java index 5f516c46210..fb06d76a7c7 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StartStageTouchTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/stage/StartStageTouchTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,6 @@ package org.catrobat.catroid.uiespresso.stage; -import android.support.test.InstrumentationRegistry; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.content.Project; import org.catrobat.catroid.content.Scene; @@ -56,12 +54,14 @@ import java.util.LinkedList; import java.util.List; +import androidx.test.core.app.ApplicationProvider; + +import static org.catrobat.catroid.uiespresso.util.UserVariableAssertions.assertUserVariableEqualsWithTimeout; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.matcher.ViewMatchers.isFocusable; import static androidx.test.espresso.matcher.ViewMatchers.isRoot; -import static org.catrobat.catroid.uiespresso.util.UserVariableAssertions.assertUserVariableEqualsWithTimeout; - @Category({Cat.AppUi.class, Level.Smoke.class}) public class StartStageTouchTest { @@ -88,7 +88,7 @@ public void switchStageTouchTest() { private void createProject() { String projectName = getClass().getSimpleName(); - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); String scene2Name = "Scene2"; Scene scene2 = new Scene(scene2Name, project); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionBarScriptTitleAfterExitingFormulaEditorTwoScenesProjectTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionBarScriptTitleAfterExitingFormulaEditorTwoScenesProjectTest.java index 0dc09f163a3..161de7c3278 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionBarScriptTitleAfterExitingFormulaEditorTwoScenesProjectTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionBarScriptTitleAfterExitingFormulaEditorTwoScenesProjectTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,10 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.actionbar; -import android.support.test.InstrumentationRegistry; -import androidx.test.espresso.Espresso; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Project; @@ -42,12 +38,16 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.espresso.Espresso; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.uiespresso.ui.actionbar.utils.ActionBarWrapper.onActionBar; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static org.catrobat.catroid.uiespresso.ui.actionbar.utils.ActionBarWrapper.onActionBar; - @RunWith(AndroidJUnit4.class) public class ActionBarScriptTitleAfterExitingFormulaEditorTwoScenesProjectTest { @Rule @@ -62,7 +62,7 @@ public void setUp() throws Exception { } private void createTwoScenesProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Scene sceneOne = new Scene("testScene1", project); Scene sceneTwo = new Scene("testScene2", project); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionModeMergeTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionModeMergeTest.java index b33cd182c9e..3e50cd5e6ac 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionModeMergeTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/actionbar/ActionModeMergeTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.actionbar; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.R; import org.catrobat.catroid.common.BrickValues; import org.catrobat.catroid.content.Project; @@ -47,7 +44,13 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.uiespresso.ui.actionbar.utils.ActionModeWrapper.onActionMode; +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static androidx.test.espresso.action.ViewActions.click; @@ -57,9 +60,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.isNotChecked; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.ui.actionbar.utils.ActionModeWrapper.onActionMode; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; - @RunWith(AndroidJUnit4.class) public class ActionModeMergeTest { @@ -141,7 +141,7 @@ public void actionModeMergeTitleTest() { } private void createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new SingleSprite("firstSprite"); Script script = new StartScript(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/OpenFromShareLinkTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/OpenFromShareLinkTest.java index 41b41ab3cfe..2797626b71d 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/OpenFromShareLinkTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/OpenFromShareLinkTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -28,8 +28,6 @@ import android.content.Intent; import android.net.Uri; import android.preference.PreferenceManager; -import android.support.test.InstrumentationRegistry; -import androidx.test.espresso.intent.Intents; import org.catrobat.catroid.R; import org.catrobat.catroid.testsuites.annotations.Cat; @@ -49,13 +47,16 @@ import java.util.Arrays; -import static androidx.test.espresso.intent.Intents.intended; -import static androidx.test.espresso.intent.Intents.intending; -import static androidx.test.espresso.intent.matcher.IntentMatchers.hasExtras; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.espresso.intent.Intents; import static org.catrobat.catroid.common.SharedPreferenceKeys.AGREED_TO_PRIVACY_POLICY_VERSION; import static org.catrobat.catroid.uiespresso.util.matchers.BundleMatchers.bundleHasMatchingString; +import static androidx.test.espresso.intent.Intents.intended; +import static androidx.test.espresso.intent.Intents.intending; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasExtras; + @Category({Cat.AppUi.class, Level.Functional.class}) @RunWith(Parameterized.class) public class OpenFromShareLinkTest { @@ -86,11 +87,11 @@ public static Iterable data() { @Before public void setUp() throws Exception { - bufferedPreferenceSetting = PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry - .getTargetContext()) + bufferedPreferenceSetting = + PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()) .getInt(AGREED_TO_PRIVACY_POLICY_VERSION, 0); - PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()) + PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()) .edit() .putInt(AGREED_TO_PRIVACY_POLICY_VERSION, UiTestUtils.getResourcesString(R.string.dialog_privacy_policy_text) @@ -114,7 +115,7 @@ public void setUp() throws Exception { @After public void tearDown() { - PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()) + PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()) .edit() .putInt(AGREED_TO_PRIVACY_POLICY_VERSION, bufferedPreferenceSetting) .commit(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/PrivacyPolicyDisclaimerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/PrivacyPolicyDisclaimerTest.java index 64bd9299479..aa27a7fd8d9 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/PrivacyPolicyDisclaimerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/PrivacyPolicyDisclaimerTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -25,8 +25,6 @@ import android.content.SharedPreferences; import android.preference.PreferenceManager; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.ui.MainMenuActivity; @@ -38,14 +36,17 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.common.SharedPreferenceKeys.AGREED_TO_PRIVACY_POLICY_VERSION; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.assertion.ViewAssertions.matches; import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.common.SharedPreferenceKeys.AGREED_TO_PRIVACY_POLICY_VERSION; - @RunWith(AndroidJUnit4.class) public class PrivacyPolicyDisclaimerTest { @@ -57,8 +58,8 @@ public class PrivacyPolicyDisclaimerTest { @Before public void setUp() throws Exception { - SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry - .getTargetContext()); + SharedPreferences sharedPreferences = + PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()); bufferedPrivacyPolicyPreferenceSetting = sharedPreferences .getInt(AGREED_TO_PRIVACY_POLICY_VERSION, 0); @@ -66,7 +67,7 @@ public void setUp() throws Exception { @After public void tearDown() { - PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()) + PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()) .edit() .putInt(AGREED_TO_PRIVACY_POLICY_VERSION, bufferedPrivacyPolicyPreferenceSetting) @@ -75,7 +76,7 @@ public void tearDown() { @Test public void testShowPrivacyPolicyDisclaimer() { - PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()) + PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()) .edit() .putInt(AGREED_TO_PRIVACY_POLICY_VERSION, 0) @@ -88,7 +89,7 @@ public void testShowPrivacyPolicyDisclaimer() { @Test public void testHidePrivacyPolicyDisclaimer() { - PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()) + PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()) .edit() .putInt(AGREED_TO_PRIVACY_POLICY_VERSION, UiTestUtils.getResourcesString(R.string.dialog_privacy_policy_text) diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectActivityNumberOfBricksRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectActivityNumberOfBricksRegressionTest.java index 4ff5c831644..8e2e3e2e746 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectActivityNumberOfBricksRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectActivityNumberOfBricksRegressionTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.activity; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.common.BrickValues; @@ -51,15 +48,18 @@ import java.util.Locale; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.matches; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; - @RunWith(AndroidJUnit4.class) public class ProjectActivityNumberOfBricksRegressionTest { @@ -93,7 +93,7 @@ public void numberOfBricksDetailsRegressionTest() throws Exception { } private void createProject() { - Project project = new Project(InstrumentationRegistry.getTargetContext(), "ProjectActivityNumberOfBricksRegressionTest"); + Project project = new Project(ApplicationProvider.getApplicationContext(), "ProjectActivityNumberOfBricksRegressionTest"); Sprite firstSprite = new SingleSprite("firstSprite"); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectActivityTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectActivityTest.java index a7325c8253e..bae17514fcb 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectActivityTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectActivityTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -28,9 +28,6 @@ import android.content.Intent; import android.content.SharedPreferences; import android.preference.PreferenceManager; -import android.support.test.InstrumentationRegistry; -import androidx.test.espresso.intent.Intents; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -52,7 +49,15 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.espresso.intent.Intents; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + +import static org.hamcrest.core.AllOf.allOf; +import static org.junit.Assert.assertEquals; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static androidx.test.espresso.action.ViewActions.click; @@ -62,9 +67,6 @@ import static androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.hamcrest.core.AllOf.allOf; -import static org.junit.Assert.assertEquals; - @RunWith(AndroidJUnit4.class) public class ProjectActivityTest { @@ -77,7 +79,7 @@ public class ProjectActivityTest { @Before public void setUp() { - Project project = new Project(InstrumentationRegistry.getTargetContext(), PROJECT_NAME); + Project project = new Project(ApplicationProvider.getApplicationContext(), PROJECT_NAME); Sprite firstSprite = new SingleSprite("firstSprite"); project.getDefaultScene().addSprite(firstSprite); ProjectManager.getInstance().setCurrentProject(project); @@ -123,6 +125,6 @@ public void testUploadActivityLaunchedWhenUploadButtonClicked() { } private SharedPreferences getDefaultSharedPreferences() { - return PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()); + return PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()); } } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectListActivityTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectListActivityTest.java index 3e37fd80357..2c51c92ec90 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectListActivityTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectListActivityTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -26,8 +26,6 @@ import android.content.SharedPreferences; import android.content.res.AssetManager; import android.preference.PreferenceManager; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.io.StorageOperations; import org.catrobat.catroid.testsuites.annotations.Cat; @@ -45,6 +43,10 @@ import java.io.IOException; import java.io.InputStream; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + import static org.catrobat.catroid.common.Constants.CODE_XML_FILE_NAME; import static org.catrobat.catroid.common.FlavoredConstants.DEFAULT_ROOT_DIRECTORY; import static org.catrobat.catroid.common.SharedPreferenceKeys.SHOW_DETAILS_PROJECTS_PREFERENCE_KEY; @@ -101,10 +103,10 @@ public void testInvalidProjectXMLDoesNotCrashWhenShowDetailsEnabled() throws IOE } private AssetManager getAssets() { - return InstrumentationRegistry.getContext().getAssets(); + return InstrumentationRegistry.getInstrumentation().getContext().getAssets(); } private SharedPreferences getDefaultSharedPreferences() { - return PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()); + return PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()); } } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectUploadRatingDialogTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectUploadRatingDialogTest.java index 9eeba1cae58..9a9f1438461 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectUploadRatingDialogTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectUploadRatingDialogTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -28,8 +28,6 @@ import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Project; @@ -46,13 +44,9 @@ import org.junit.Test; import org.junit.runner.RunWith; -import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; -import static androidx.test.espresso.assertion.ViewAssertions.matches; -import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; -import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static androidx.test.espresso.matcher.ViewMatchers.withText; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; import static org.catrobat.catroid.common.Constants.UPLOAD_RESULT_RECEIVER_RESULT_CODE; import static org.catrobat.catroid.ui.ProjectUploadActivity.NUMBER_OF_UPLOADED_PROJECTS; @@ -63,6 +57,14 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; + @RunWith(AndroidJUnit4.class) public class ProjectUploadRatingDialogTest { @@ -77,7 +79,7 @@ public class ProjectUploadRatingDialogTest { @Before public void setUp() throws Exception { - Context context = InstrumentationRegistry.getTargetContext(); + Context context = ApplicationProvider.getApplicationContext(); sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); bundle = new Bundle(); Project project = new Project(context, PROJECT_NAME, false); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/SettingsFragmentTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/SettingsFragmentTest.java index ce7df4a955e..b25bd71f09c 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/SettingsFragmentTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/SettingsFragmentTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -25,9 +25,6 @@ import android.content.SharedPreferences; import android.preference.PreferenceManager; -import android.support.test.InstrumentationRegistry; -import androidx.test.espresso.matcher.PreferenceMatchers; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.testsuites.annotations.Cat; @@ -48,14 +45,9 @@ import java.util.Locale; import java.util.Map; -import static androidx.test.espresso.Espresso.onData; -import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.assertion.ViewAssertions.matches; -import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; -import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static androidx.test.espresso.matcher.ViewMatchers.withParent; -import static androidx.test.espresso.matcher.ViewMatchers.withText; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.espresso.matcher.PreferenceMatchers; +import androidx.test.ext.junit.runners.AndroidJUnit4; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; @@ -80,6 +72,15 @@ import static org.hamcrest.core.AllOf.allOf; import static org.hamcrest.core.Is.is; +import static androidx.test.espresso.Espresso.onData; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withParent; +import static androidx.test.espresso.matcher.ViewMatchers.withText; + @RunWith(AndroidJUnit4.class) public class SettingsFragmentTest { @@ -99,7 +100,7 @@ public class SettingsFragmentTest { @Before public void setUp() throws Exception { SharedPreferences sharedPreferences = PreferenceManager - .getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()); + .getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()); for (String setting : allSettings) { initialSettings.put(setting, sharedPreferences.getBoolean(setting, false)); @@ -110,7 +111,7 @@ public void setUp() throws Exception { private void setAllSettingsTo(boolean value) { SharedPreferences.Editor sharedPreferencesEditor = PreferenceManager - .getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()).edit(); + .getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()).edit(); for (String setting : allSettings) { sharedPreferencesEditor.putBoolean(setting, value); @@ -122,7 +123,7 @@ private void setAllSettingsTo(boolean value) { @After public void tearDown() { SharedPreferences.Editor sharedPreferencesEditor = PreferenceManager - .getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()).edit(); + .getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()).edit(); for (String setting : initialSettings.keySet()) { sharedPreferencesEditor.putBoolean(setting, initialSettings.get(setting)); } @@ -233,7 +234,7 @@ public void languageSettingTest() { private void checkPreference(int displayedTitleResourceString, String sharedPreferenceTag) { SharedPreferences sharedPreferences = PreferenceManager - .getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()); + .getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()); onData(PreferenceMatchers.withTitle(displayedTitleResourceString)) .perform(click()); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/rtl/HindiNumberAtShowDetailsAtProjectActivityTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/rtl/HindiNumberAtShowDetailsAtProjectActivityTest.java index 397861fe97e..6b56167b917 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/rtl/HindiNumberAtShowDetailsAtProjectActivityTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/rtl/HindiNumberAtShowDetailsAtProjectActivityTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.activity.rtl; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.common.BrickValues; @@ -53,18 +50,21 @@ import java.util.Locale; -import static android.support.test.InstrumentationRegistry.getTargetContext; -import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.Espresso.openContextualActionModeOverflowMenu; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.assertion.ViewAssertions.matches; -import static androidx.test.espresso.matcher.ViewMatchers.withText; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertTrue; import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static androidx.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.Espresso.openContextualActionModeOverflowMenu; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.withText; + @RunWith(AndroidJUnit4.class) public class HindiNumberAtShowDetailsAtProjectActivityTest { @Rule @@ -104,7 +104,7 @@ public void hindiNumbers() throws Exception { private void createProject() { String projectName = "HindiNumberTest"; - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite firstSprite = new SingleSprite("firstSprite"); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/rtl/LanguagePickerTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/rtl/LanguagePickerTest.java index 82d40b992ad..50830c8938a 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/rtl/LanguagePickerTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/rtl/LanguagePickerTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -25,9 +25,6 @@ import android.content.SharedPreferences; import android.preference.PreferenceManager; -import android.support.test.InstrumentationRegistry; -import androidx.test.espresso.matcher.PreferenceMatchers; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.testsuites.annotations.Cat; @@ -45,15 +42,19 @@ import java.util.Locale; -import static androidx.test.espresso.Espresso.onData; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.assertion.ViewAssertions.matches; -import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.espresso.matcher.PreferenceMatchers; +import androidx.test.ext.junit.runners.AndroidJUnit4; import static org.catrobat.catroid.common.SharedPreferenceKeys.AGREED_TO_PRIVACY_POLICY_VERSION; import static org.hamcrest.Matchers.hasToString; import static org.hamcrest.core.StringStartsWith.startsWith; +import static androidx.test.espresso.Espresso.onData; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; + @RunWith(AndroidJUnit4.class) public class LanguagePickerTest { @@ -69,12 +70,12 @@ public class LanguagePickerTest { @Before public void setUp() { SharedPreferences sharedPreferences = PreferenceManager - .getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()); + .getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()); bufferedPrivacyPolicyPreferenceSetting = sharedPreferences .getInt(AGREED_TO_PRIVACY_POLICY_VERSION, 0); - PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()) + PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()) .edit() .putInt(AGREED_TO_PRIVACY_POLICY_VERSION, UiTestUtils.getResourcesString(R.string.dialog_privacy_policy_text) @@ -85,13 +86,13 @@ public void setUp() { @After public void tearDown() { - PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()) + PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()) .edit() .putInt(AGREED_TO_PRIVACY_POLICY_VERSION, bufferedPrivacyPolicyPreferenceSetting) .commit(); - SettingsFragment.removeLanguageSharedPreference(InstrumentationRegistry.getTargetContext()); + SettingsFragment.removeLanguageSharedPreference(ApplicationProvider.getApplicationContext()); } @Category({Cat.AppUi.class, Level.Smoke.class, Cat.RTLTests.class}) diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/rtl/RTLMainMenuTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/rtl/RTLMainMenuTest.java index dfd2fc17274..fd1745c7750 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/rtl/RTLMainMenuTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/rtl/RTLMainMenuTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -26,8 +26,6 @@ import android.content.SharedPreferences; import android.content.res.Configuration; import android.preference.PreferenceManager; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import android.view.View; import org.catrobat.catroid.R; @@ -46,6 +44,9 @@ import java.util.Locale; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; @@ -70,12 +71,12 @@ public class RTLMainMenuTest { @Before public void setUp() { SharedPreferences sharedPreferences = PreferenceManager - .getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()); + .getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()); bufferedPrivacyPolicyPreferenceSetting = sharedPreferences .getInt(AGREED_TO_PRIVACY_POLICY_VERSION, 0); - PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()) + PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()) .edit() .putInt(AGREED_TO_PRIVACY_POLICY_VERSION, UiTestUtils.getResourcesString(R.string.dialog_privacy_policy_text) @@ -85,18 +86,18 @@ public void setUp() { @After public void tearDown() { - PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()) + PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()) .edit() .putInt(AGREED_TO_PRIVACY_POLICY_VERSION, bufferedPrivacyPolicyPreferenceSetting) .commit(); - SettingsFragment.removeLanguageSharedPreference(InstrumentationRegistry.getTargetContext()); + SettingsFragment.removeLanguageSharedPreference(ApplicationProvider.getApplicationContext()); } @Category({Cat.AppUi.class, Level.Smoke.class, Cat.RTLTests.class}) @Test public void testSetLanguageToArabic() { - SettingsFragment.setLanguageSharedPreference(InstrumentationRegistry.getTargetContext(), "ar"); + SettingsFragment.setLanguageSharedPreference(ApplicationProvider.getApplicationContext(), "ar"); baseActivityTestRule.launchActivity(null); assertEquals(Locale.getDefault().getDisplayLanguage(), ARABIC_LOCALE.getDisplayLanguage()); @@ -107,7 +108,7 @@ public void testSetLanguageToArabic() { @Category({Cat.AppUi.class, Level.Smoke.class, Cat.RTLTests.class}) @Test public void testSetLanguageToGerman() { - SettingsFragment.setLanguageSharedPreference(InstrumentationRegistry.getTargetContext(), "de"); + SettingsFragment.setLanguageSharedPreference(ApplicationProvider.getApplicationContext(), "de"); baseActivityTestRule.launchActivity(null); assertEquals(Locale.getDefault().getDisplayLanguage(), GERMAN_LOCALE.getDisplayLanguage()); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/AboutDialogTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/AboutDialogTest.java index e2194237eae..8b0d8417ab8 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/AboutDialogTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/AboutDialogTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,8 +24,6 @@ import android.content.SharedPreferences; import android.preference.PreferenceManager; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.testsuites.annotations.Cat; @@ -40,6 +38,11 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.common.SharedPreferenceKeys.AGREED_TO_PRIVACY_POLICY_VERSION; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static androidx.test.espresso.action.ViewActions.click; @@ -48,8 +51,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.common.SharedPreferenceKeys.AGREED_TO_PRIVACY_POLICY_VERSION; - @RunWith(AndroidJUnit4.class) public class AboutDialogTest { @@ -62,7 +63,7 @@ public class AboutDialogTest { @Before public void setUp() throws Exception { SharedPreferences sharedPreferences = PreferenceManager - .getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()); + .getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()); bufferedPrivacyPolicyPreferenceSetting = sharedPreferences .getInt(AGREED_TO_PRIVACY_POLICY_VERSION, 0); @@ -78,7 +79,7 @@ public void setUp() throws Exception { @After public void tearDown() { - PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()) + PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()) .edit() .putInt(AGREED_TO_PRIVACY_POLICY_VERSION, bufferedPrivacyPolicyPreferenceSetting) diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/DeleteLookDialogTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/DeleteLookDialogTest.java index 1b6d0b226ea..a8fa16f213e 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/DeleteLookDialogTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/DeleteLookDialogTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.dialog; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.common.LookData; @@ -49,7 +46,15 @@ import java.io.IOException; import java.util.List; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + +import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.hamcrest.Matchers.allOf; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static androidx.test.espresso.action.ViewActions.click; @@ -60,10 +65,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.hamcrest.Matchers.allOf; - @RunWith(AndroidJUnit4.class) public class DeleteLookDialogTest { @@ -140,13 +141,13 @@ public void cancelDeleteLookDialogTest() { onView(withText(toBeDeletedLookName)) .check(matches(isDisplayed())); - onView(withText(InstrumentationRegistry.getTargetContext() + onView(withText(ApplicationProvider.getApplicationContext() .getResources().getQuantityString(R.plurals.am_delete_looks_title, 1, 1))) .check(matches(isDisplayed())); } private void createProject(String projectName) throws IOException { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); XstreamSerializer.getInstance().saveProject(project); Sprite sprite = new SingleSprite("testSprite"); @@ -157,14 +158,14 @@ private void createProject(String projectName) throws IOException { ProjectManager.getInstance().setCurrentSprite(sprite); File imageFile = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.drawable.catroid_banzai, new File(project.getDefaultScene().getDirectory(), IMAGE_DIRECTORY_NAME), "catroid_sunglasses.png", 1); File imageFile2 = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.drawable.catroid_sunglasses, new File(project.getDefaultScene().getDirectory(), IMAGE_DIRECTORY_NAME), "catroid_sunglasses.png", diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/DeleteSoundDialogTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/DeleteSoundDialogTest.java index 9dc22dfb6a4..fe2b40186c8 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/DeleteSoundDialogTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/DeleteSoundDialogTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.dialog; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.common.SoundInfo; @@ -49,7 +46,15 @@ import java.io.IOException; import java.util.List; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + +import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.hamcrest.Matchers.allOf; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static androidx.test.espresso.action.ViewActions.click; @@ -60,10 +65,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.hamcrest.Matchers.allOf; - @RunWith(AndroidJUnit4.class) public class DeleteSoundDialogTest { @@ -139,13 +140,13 @@ public void cancelDeleteSoundDialogTest() { onView(withText(toBeDeletedSoundName)) .check(matches(isDisplayed())); - onView(withText(InstrumentationRegistry.getTargetContext() + onView(withText(ApplicationProvider.getApplicationContext() .getResources().getQuantityString(R.plurals.am_delete_sounds_title, 1, 1))) .check(matches(isDisplayed())); } private void createProject(String projectName) throws IOException { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new SingleSprite("testSprite"); project.getDefaultScene().addSprite(sprite); @@ -156,13 +157,13 @@ private void createProject(String projectName) throws IOException { XstreamSerializer.getInstance().saveProject(project); File soundFile = ResourceImporter.createSoundFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.longsound, new File(project.getDefaultScene().getDirectory(), SOUND_DIRECTORY_NAME), "longsound.mp3"); File soundFile2 = ResourceImporter.createSoundFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.testsoundui, new File(project.getDefaultScene().getDirectory(), SOUND_DIRECTORY_NAME), "testsoundui.mp3"); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/DeleteSpriteDialogTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/DeleteSpriteDialogTest.java index e5bf85d3d55..d88c38260df 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/DeleteSpriteDialogTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/DeleteSpriteDialogTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.dialog; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Project; @@ -42,7 +39,13 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.hamcrest.Matchers.allOf; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static androidx.test.espresso.action.ViewActions.click; @@ -53,9 +56,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.hamcrest.Matchers.allOf; - @RunWith(AndroidJUnit4.class) public class DeleteSpriteDialogTest { @@ -131,13 +131,13 @@ public void cancelDeleteSpriteDialogTest() { onView(withText(toBeDeletedSpriteName)) .check(matches(isDisplayed())); - onView(withText(InstrumentationRegistry.getTargetContext() + onView(withText(ApplicationProvider.getApplicationContext() .getResources().getQuantityString(R.plurals.am_delete_sprites_title, 1, 1))) .check(matches(isDisplayed())); } private void createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite firstSprite = new SingleSprite("firstSprite"); Sprite secondSprite = new SingleSprite(toBeDeletedSpriteName); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/FormulaEditorComputeDialogTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/FormulaEditorComputeDialogTest.java index 36eb2d84b41..3948e3a884f 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/FormulaEditorComputeDialogTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/FormulaEditorComputeDialogTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -22,13 +22,6 @@ */ package org.catrobat.catroid.uiespresso.ui.dialog; -import android.support.test.InstrumentationRegistry; -import androidx.test.espresso.ViewAction; -import androidx.test.espresso.action.CoordinatesProvider; -import androidx.test.espresso.action.GeneralClickAction; -import androidx.test.espresso.action.Press; -import androidx.test.espresso.action.Tap; -import androidx.test.ext.junit.runners.AndroidJUnit4; import android.view.View; import org.catrobat.catroid.ProjectManager; @@ -50,6 +43,16 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.espresso.ViewAction; +import androidx.test.espresso.action.CoordinatesProvider; +import androidx.test.espresso.action.GeneralClickAction; +import androidx.test.espresso.action.Press; +import androidx.test.espresso.action.Tap; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.pressBack; import static androidx.test.espresso.action.ViewActions.click; @@ -58,8 +61,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; - @RunWith(AndroidJUnit4.class) public class FormulaEditorComputeDialogTest { @@ -130,7 +131,7 @@ public void cancelOnTouchOutsideOfDialogTest() { } public Project createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new Sprite("testSprite"); Script script = new StartScript(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/LegoSensorPortConfigDialogTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/LegoSensorPortConfigDialogTest.java index 697c7646e4b..dc092c8d51a 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/LegoSensorPortConfigDialogTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/LegoSensorPortConfigDialogTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -25,7 +25,6 @@ import android.content.SharedPreferences; import android.preference.PreferenceManager; -import android.support.test.InstrumentationRegistry; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; @@ -48,12 +47,7 @@ import java.io.IOException; -import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.assertion.ViewAssertions.matches; -import static androidx.test.espresso.matcher.ViewMatchers.isEnabled; -import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static androidx.test.espresso.matcher.ViewMatchers.withText; +import androidx.test.core.app.ApplicationProvider; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; @@ -63,6 +57,13 @@ import static org.catrobat.catroid.uiespresso.ui.dialog.utils.LegoSensorPortConfigDialogWrapper.onLegoSensorPortConfigDialog; import static org.hamcrest.core.IsNot.not; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.matcher.ViewMatchers.isEnabled; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; + @Category({Cat.AppUi.class, Level.Smoke.class}) public class LegoSensorPortConfigDialogTest { @@ -79,7 +80,7 @@ public void setUp() throws Exception { script.addBrick(new ChangeSizeByNBrick(0)); SharedPreferences sharedPreferences = PreferenceManager - .getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()); + .getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()); nxtSettingBuffer = sharedPreferences .getBoolean(SettingsFragment.SETTINGS_MINDSTORMS_NXT_BRICKS_ENABLED, false); @@ -88,9 +89,9 @@ public void setUp() throws Exception { .putBoolean(SettingsFragment.SETTINGS_MINDSTORMS_NXT_BRICKS_ENABLED, true) .commit(); - sensorMappingBuffer = SettingsFragment.getLegoNXTSensorMapping(InstrumentationRegistry.getTargetContext()); + sensorMappingBuffer = SettingsFragment.getLegoNXTSensorMapping(ApplicationProvider.getApplicationContext()); - SettingsFragment.setLegoMindstormsNXTSensorMapping(InstrumentationRegistry.getTargetContext(), + SettingsFragment.setLegoMindstormsNXTSensorMapping(ApplicationProvider.getApplicationContext(), new NXTSensor.Sensor[] { NXTSensor.Sensor.NO_SENSOR, NXTSensor.Sensor.NO_SENSOR, @@ -128,12 +129,12 @@ public void checkDialogTest() { @After public void tearDown() throws IOException { - PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()).edit() + PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()).edit() .putBoolean(SettingsFragment.SETTINGS_MINDSTORMS_NXT_BRICKS_ENABLED, nxtSettingBuffer) .commit(); SettingsFragment - .setLegoMindstormsNXTSensorMapping(InstrumentationRegistry.getTargetContext(), sensorMappingBuffer); + .setLegoMindstormsNXTSensorMapping(ApplicationProvider.getApplicationContext(), sensorMappingBuffer); TestUtils.deleteProjects(getClass().getSimpleName()); } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/OrientationDialogTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/OrientationDialogTest.java index c4f802ae48c..5cee4c63a4a 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/OrientationDialogTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/OrientationDialogTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -25,8 +25,6 @@ import android.content.SharedPreferences; import android.preference.PreferenceManager; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.testsuites.annotations.Cat; @@ -42,6 +40,15 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.common.SharedPreferenceKeys.AGREED_TO_PRIVACY_POLICY_VERSION; +import static org.catrobat.catroid.ui.settingsfragments.SettingsFragment.SETTINGS_CAST_GLOBALLY_ENABLED; +import static org.catrobat.catroid.uiespresso.util.UiTestUtils.assertCurrentActivityIsInstanceOf; +import static org.hamcrest.Matchers.allOf; +import static org.hamcrest.core.IsNot.not; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard; @@ -52,12 +59,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.common.SharedPreferenceKeys.AGREED_TO_PRIVACY_POLICY_VERSION; -import static org.catrobat.catroid.ui.settingsfragments.SettingsFragment.SETTINGS_CAST_GLOBALLY_ENABLED; -import static org.catrobat.catroid.uiespresso.util.UiTestUtils.assertCurrentActivityIsInstanceOf; -import static org.hamcrest.Matchers.allOf; -import static org.hamcrest.core.IsNot.not; - @RunWith(AndroidJUnit4.class) public class OrientationDialogTest { @@ -71,7 +72,7 @@ public class OrientationDialogTest { @Before public void setUp() throws Exception { SharedPreferences sharedPreferences = PreferenceManager - .getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()); + .getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()); bufferedChromeCastSetting = sharedPreferences .getBoolean(SETTINGS_CAST_GLOBALLY_ENABLED, false); @@ -79,7 +80,7 @@ public void setUp() throws Exception { bufferedPrivacyPolicyPreferenceSetting = sharedPreferences .getInt(AGREED_TO_PRIVACY_POLICY_VERSION, 0); - PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()) + PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()) .edit() .putBoolean(SETTINGS_CAST_GLOBALLY_ENABLED, true) .putInt(AGREED_TO_PRIVACY_POLICY_VERSION, @@ -92,7 +93,7 @@ public void setUp() throws Exception { @After public void tearDown() { - PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()) + PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()) .edit() .putBoolean(SETTINGS_CAST_GLOBALLY_ENABLED, bufferedChromeCastSetting) .putInt(AGREED_TO_PRIVACY_POLICY_VERSION, diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/PlaySceneDialogTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/PlaySceneDialogTest.java index 67ea3bb668f..01c02dc5058 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/PlaySceneDialogTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/PlaySceneDialogTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.dialog; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Project; @@ -41,6 +38,11 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static junit.framework.Assert.assertEquals; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.matches; @@ -48,8 +50,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static junit.framework.Assert.assertEquals; - @RunWith(AndroidJUnit4.class) public class PlaySceneDialogTest { @@ -97,7 +97,7 @@ public void playSceneDialogTest() { } private void createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); firstScene = project.getDefaultScene(); secondScene = new Scene("secondScene", project); project.addScene(secondScene); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/TermsOfUseDialogTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/TermsOfUseDialogTest.java index 9009d009c58..ccedc7674ac 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/TermsOfUseDialogTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/dialog/TermsOfUseDialogTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,8 +24,6 @@ import android.content.SharedPreferences; import android.preference.PreferenceManager; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.testsuites.annotations.Cat; @@ -40,7 +38,13 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + +import static org.catrobat.catroid.common.SharedPreferenceKeys.AGREED_TO_PRIVACY_POLICY_VERSION; +import static org.hamcrest.Matchers.allOf; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static androidx.test.espresso.action.ViewActions.click; @@ -50,9 +54,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.common.SharedPreferenceKeys.AGREED_TO_PRIVACY_POLICY_VERSION; -import static org.hamcrest.Matchers.allOf; - @RunWith(AndroidJUnit4.class) public class TermsOfUseDialogTest { @@ -65,7 +66,7 @@ public class TermsOfUseDialogTest { @Before public void setUp() throws Exception { SharedPreferences sharedPreferences = PreferenceManager - .getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()); + .getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()); bufferedPrivacyPolicyPreferenceSetting = sharedPreferences .getInt(AGREED_TO_PRIVACY_POLICY_VERSION, 0); @@ -81,7 +82,7 @@ public void setUp() throws Exception { @After public void tearDown() { - PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()) + PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()) .edit() .putInt(AGREED_TO_PRIVACY_POLICY_VERSION, bufferedPrivacyPolicyPreferenceSetting) @@ -91,7 +92,7 @@ public void tearDown() { @Category({Cat.AppUi.class, Level.Smoke.class}) @Test public void termsOfUseDialogTest() { - openActionBarOverflowOrOptionsMenu(getInstrumentation().getTargetContext()); + openActionBarOverflowOrOptionsMenu(InstrumentationRegistry.getInstrumentation().getTargetContext()); onView(withText(R.string.main_menu_terms_of_use)).perform(click()); onView(withId(R.id.alertTitle)) diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/AddUserbrickTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/AddUserbrickTest.java index dfcaceed81d..b9ea19eee18 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/AddUserbrickTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/AddUserbrickTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.uiespresso.ui.fragment; -import android.support.test.InstrumentationRegistry; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Project; @@ -39,6 +37,12 @@ import java.io.IOException; +import androidx.test.core.app.ApplicationProvider; + +import static org.hamcrest.Matchers.allOf; +import static org.hamcrest.Matchers.instanceOf; +import static org.hamcrest.Matchers.is; + import static androidx.test.espresso.Espresso.onData; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; @@ -46,10 +50,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static org.hamcrest.Matchers.allOf; -import static org.hamcrest.Matchers.instanceOf; -import static org.hamcrest.Matchers.is; - public class AddUserbrickTest { @Rule @@ -65,7 +65,7 @@ public void setUp() throws IOException { private void createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite firstSprite = new SingleSprite("first Sprite"); project.getDefaultScene().addSprite(firstSprite); ProjectManager.getInstance().setCurrentProject(project); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopyLookTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopyLookTest.java index 97e45437128..e6cc71c9d60 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopyLookTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopyLookTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.fragment; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.common.LookData; @@ -48,7 +45,14 @@ import java.io.IOException; import java.util.List; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + +import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static androidx.test.espresso.action.ViewActions.click; @@ -57,9 +61,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; - @RunWith(AndroidJUnit4.class) public class CopyLookTest { @@ -96,7 +97,7 @@ public void copyLookTest() { private void createProject() throws IOException { String projectName = "copyLookFragmentTest"; - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new SingleSprite("testSprite"); project.getDefaultScene().addSprite(sprite); @@ -106,7 +107,7 @@ private void createProject() throws IOException { XstreamSerializer.getInstance().saveProject(project); File imageFile = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.drawable.catroid_banzai, new File(project.getDefaultScene().getDirectory(), IMAGE_DIRECTORY_NAME), "catroid_sunglasses.png", diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopyProjectTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopyProjectTest.java index 6b6fcfc26c4..ff4fe0fb9be 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopyProjectTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopyProjectTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.fragment; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.common.BrickValues; @@ -56,7 +53,16 @@ import java.io.IOException; import java.util.List; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + +import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; +import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; +import static org.catrobat.catroid.common.Constants.Z_INDEX_BACKGROUND; +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static androidx.test.espresso.action.ViewActions.click; @@ -65,11 +71,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; -import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; -import static org.catrobat.catroid.common.Constants.Z_INDEX_BACKGROUND; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; - @RunWith(AndroidJUnit4.class) public class CopyProjectTest { @@ -105,7 +106,7 @@ public void copyProjectTest() { } private void createProject() throws IOException { - Project project = new Project(InstrumentationRegistry.getTargetContext(), toBeCopiedProjectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), toBeCopiedProjectName); Sprite sprite = new SingleSprite("firstSprite"); Script script = new StartScript(); script.addBrick(new SetXBrick(new Formula(BrickValues.X_POSITION))); @@ -117,7 +118,7 @@ private void createProject() throws IOException { XstreamSerializer.getInstance().saveProject(project); File soundFile = ResourceImporter.createSoundFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.longsound, new File(project.getDefaultScene().getDirectory(), SOUND_DIRECTORY_NAME), "longsound.mp3"); @@ -129,7 +130,7 @@ private void createProject() throws IOException { soundInfoList.add(soundInfo); File imageFile = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.drawable.catroid_banzai, new File(project.getDefaultScene().getDirectory(), IMAGE_DIRECTORY_NAME), "catroid_sunglasses.png", @@ -143,13 +144,13 @@ private void createProject() throws IOException { Scene secondScene = new Scene("secondScene", project); - Sprite backgroundSprite = new Sprite(InstrumentationRegistry.getTargetContext().getString(R.string.background)); + Sprite backgroundSprite = new Sprite(ApplicationProvider.getApplicationContext().getString(R.string.background)); backgroundSprite.look.setZIndex(Z_INDEX_BACKGROUND); secondScene.addSprite(backgroundSprite); project.addScene(secondScene); ProjectSaveTask - .task(project, InstrumentationRegistry.getTargetContext()); + .task(project, ApplicationProvider.getApplicationContext()); } } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopySceneTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopySceneTest.java index f2f3945863d..3352082fcfc 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopySceneTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopySceneTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,8 +24,6 @@ package org.catrobat.catroid.uiespresso.ui.fragment; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -56,7 +54,17 @@ import java.io.File; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + +import static junit.framework.TestCase.assertEquals; + +import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; +import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static androidx.test.espresso.action.ViewActions.click; @@ -65,12 +73,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static junit.framework.TestCase.assertEquals; - -import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; -import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; - @RunWith(AndroidJUnit4.class) public class CopySceneTest { @@ -82,7 +84,7 @@ public class CopySceneTest { @Before public void setUp() throws Exception { - createProject(InstrumentationRegistry.getTargetContext(), projectName); + createProject(ApplicationProvider.getApplicationContext(), projectName); baseActivityTestRule.launchActivity(null); } @@ -138,7 +140,7 @@ private void createProject(Context context, String projectName) throws Exception sprite.addScript(script); File imageFile = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.drawable.catroid_banzai, new File(project.getDefaultScene().getDirectory(), IMAGE_DIRECTORY_NAME), "catroid_sunglasses.png", @@ -148,7 +150,7 @@ private void createProject(Context context, String projectName) throws Exception sprite.getLookList().add(lookData); File soundFile = ResourceImporter.createSoundFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.longsound, new File(project.getDefaultScene().getDirectory(), SOUND_DIRECTORY_NAME), "longsound.mp3"); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopySoundTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopySoundTest.java index cca0ccbf9fc..da06f0d4a08 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopySoundTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/CopySoundTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.fragment; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.common.SoundInfo; @@ -48,7 +45,14 @@ import java.io.IOException; import java.util.List; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + +import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static androidx.test.espresso.action.ViewActions.click; @@ -57,9 +61,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; - @RunWith(AndroidJUnit4.class) public class CopySoundTest { @@ -96,7 +97,7 @@ public void copySoundTest() { private void createProject() throws IOException { String projectName = "copySoundFragmentTest"; - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new SingleSprite("testSprite"); project.getDefaultScene().addSprite(sprite); @@ -106,7 +107,7 @@ private void createProject() throws IOException { XstreamSerializer.getInstance().saveProject(project); File soundFile = ResourceImporter.createSoundFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.longsound, new File(project.getDefaultScene().getDirectory(), SOUND_DIRECTORY_NAME), "longsound.mp3"); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteAllScenesTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteAllScenesTest.java index 1d43c27de10..d8958966506 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteAllScenesTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteAllScenesTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,8 +24,6 @@ package org.catrobat.catroid.uiespresso.ui.fragment; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -45,7 +43,13 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.hamcrest.Matchers.allOf; +import static org.junit.Assert.assertEquals; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static androidx.test.espresso.action.ViewActions.click; @@ -56,9 +60,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.hamcrest.Matchers.allOf; -import static org.junit.Assert.assertEquals; - @RunWith(AndroidJUnit4.class) public class DeleteAllScenesTest { private String secondSceneName = "Scene2"; @@ -76,7 +77,7 @@ public void tearDown() throws Exception { @Before public void setUp() throws Exception { - createProject(InstrumentationRegistry.getTargetContext(), projectName); + createProject(ApplicationProvider.getApplicationContext(), projectName); baseActivityTestRule.launchActivity(null); } @@ -129,6 +130,6 @@ private void createProject(Context context, String projectName) { project.addScene(scene3); ProjectManager.getInstance().setCurrentProject(project); ProjectSaveTask - .task(project, InstrumentationRegistry.getTargetContext()); + .task(project, ApplicationProvider.getApplicationContext()); } } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteFirstSceneTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteFirstSceneTest.java index 61cf7b8c4f4..15a4cb5b239 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteFirstSceneTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteFirstSceneTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,8 +24,6 @@ package org.catrobat.catroid.uiespresso.ui.fragment; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -49,7 +47,14 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.hamcrest.Matchers.allOf; +import static org.junit.Assert.assertEquals; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static androidx.test.espresso.action.ViewActions.click; @@ -60,10 +65,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.hamcrest.Matchers.allOf; -import static org.junit.Assert.assertEquals; - @RunWith(AndroidJUnit4.class) public class DeleteFirstSceneTest { private String secondSceneName = "Scene2"; @@ -82,7 +83,7 @@ public void tearDown() throws Exception { @Before public void setUp() throws Exception { - createProject(InstrumentationRegistry.getTargetContext(), projectName); + createProject(ApplicationProvider.getApplicationContext(), projectName); baseActivityTestRule.launchActivity(null); } @@ -143,6 +144,6 @@ private void createProject(Context context, String projectName) { project.addScene(scene2); ProjectManager.getInstance().setCurrentProject(project); ProjectSaveTask - .task(project, InstrumentationRegistry.getTargetContext()); + .task(project, ApplicationProvider.getApplicationContext()); } } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteLookTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteLookTest.java index 686789f47be..265cd9d7550 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteLookTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteLookTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.fragment; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.common.LookData; @@ -49,7 +46,15 @@ import java.io.IOException; import java.util.List; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + +import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.hamcrest.Matchers.allOf; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static androidx.test.espresso.action.ViewActions.click; @@ -60,10 +65,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.hamcrest.Matchers.allOf; - @RunWith(AndroidJUnit4.class) public class DeleteLookTest { @@ -138,7 +139,7 @@ public void cancelDeleteLookTest() { private void createProject() throws IOException { String projectName = "deleteLookFragmentTest"; - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new SingleSprite("testSprite"); project.getDefaultScene().addSprite(sprite); @@ -148,14 +149,14 @@ private void createProject() throws IOException { XstreamSerializer.getInstance().saveProject(project); File imageFile = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.drawable.catroid_banzai, new File(project.getDefaultScene().getDirectory(), IMAGE_DIRECTORY_NAME), "catroid_sunglasses.png", 1); File imageFile2 = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.drawable.catroid_banzai, new File(project.getDefaultScene().getDirectory(), IMAGE_DIRECTORY_NAME), "catroid_banzai.png", diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteProjectTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteProjectTest.java index 0f928732425..a6377ba337c 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteProjectTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteProjectTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.fragment; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.R; import org.catrobat.catroid.common.BrickValues; import org.catrobat.catroid.content.Project; @@ -47,7 +44,13 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.hamcrest.Matchers.allOf; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static androidx.test.espresso.action.ViewActions.click; @@ -58,9 +61,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.hamcrest.Matchers.allOf; - @RunWith(AndroidJUnit4.class) public class DeleteProjectTest { @@ -135,7 +135,7 @@ public void cancelDeleteProjectTest() { } private void createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new SingleSprite("firstSprite"); Script script = new StartScript(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteSoundTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteSoundTest.java index 54c45ae44ee..7e16fba36dc 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteSoundTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/DeleteSoundTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.fragment; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.common.SoundInfo; @@ -49,7 +46,15 @@ import java.io.IOException; import java.util.List; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + +import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.hamcrest.Matchers.allOf; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static androidx.test.espresso.action.ViewActions.click; @@ -60,10 +65,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.hamcrest.Matchers.allOf; - @RunWith(AndroidJUnit4.class) public class DeleteSoundTest { @@ -138,7 +139,7 @@ public void cancelDeleteSoundTest() { private void createProject() throws IOException { String projectName = "deleteSoundFragmentTest"; - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new SingleSprite("testSprite"); project.getDefaultScene().addSprite(sprite); @@ -148,13 +149,13 @@ private void createProject() throws IOException { XstreamSerializer.getInstance().saveProject(project); File soundFile = ResourceImporter.createSoundFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.longsound, new File(project.getDefaultScene().getDirectory(), SOUND_DIRECTORY_NAME), "longsound.mp3"); File soundFile2 = ResourceImporter.createSoundFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.testsoundui, new File(project.getDefaultScene().getDirectory(), SOUND_DIRECTORY_NAME), "testsoundui.mp3"); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/MergeProjectDialogTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/MergeProjectDialogTest.java index 6aa61b2786f..0415eef52e8 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/MergeProjectDialogTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/MergeProjectDialogTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.fragment; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.R; import org.catrobat.catroid.common.BrickValues; import org.catrobat.catroid.content.Project; @@ -46,7 +43,13 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.hamcrest.core.AllOf.allOf; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static androidx.test.espresso.action.ViewActions.click; @@ -56,9 +59,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.hamcrest.core.AllOf.allOf; - @RunWith(AndroidJUnit4.class) public class MergeProjectDialogTest { @@ -102,7 +102,7 @@ public void mergeProjectsDialogTests() { } private void createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new SingleSprite("firstSprite"); Script script = new StartScript(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/MergeProjectNameTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/MergeProjectNameTest.java index ccc615811d9..c49f95d9377 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/MergeProjectNameTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/MergeProjectNameTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -22,8 +22,6 @@ */ package org.catrobat.catroid.uiespresso.ui.fragment; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import android.widget.EditText; import org.catrobat.catroid.R; @@ -47,7 +45,15 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.hamcrest.Matchers.allOf; +import static org.hamcrest.Matchers.instanceOf; +import static org.hamcrest.Matchers.not; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.closeSoftKeyboard; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; @@ -59,11 +65,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.hamcrest.Matchers.allOf; -import static org.hamcrest.Matchers.instanceOf; -import static org.hamcrest.Matchers.not; - @RunWith(AndroidJUnit4.class) public class MergeProjectNameTest { static final String FIRSTPROJECTNAME = "firstProjectName"; @@ -152,7 +153,7 @@ public void mergeProjectsInvalidEmptyNameTests() { } private void createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new SingleSprite("firstSprite"); Script script = new StartScript(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameLookTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameLookTest.java index 41e208e54cb..57e24a2ad85 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameLookTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameLookTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.fragment; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import android.widget.EditText; import org.catrobat.catroid.ProjectManager; @@ -50,7 +48,17 @@ import java.io.IOException; import java.util.List; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + +import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.hamcrest.Matchers.allOf; +import static org.hamcrest.Matchers.instanceOf; +import static org.hamcrest.Matchers.not; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.closeSoftKeyboard; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; @@ -63,12 +71,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.hamcrest.Matchers.allOf; -import static org.hamcrest.Matchers.instanceOf; -import static org.hamcrest.Matchers.not; - @RunWith(AndroidJUnit4.class) public class RenameLookTest { @@ -183,7 +185,7 @@ public void invalidInputRenameLookTest() { private void createProject() throws IOException { String projectName = "renameLookFragmentTest"; - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new SingleSprite("testSprite"); project.getDefaultScene().addSprite(sprite); @@ -193,7 +195,7 @@ private void createProject() throws IOException { XstreamSerializer.getInstance().saveProject(project); File imageFile0 = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.drawable.catroid_banzai, new File(project.getDefaultScene().getDirectory(), IMAGE_DIRECTORY_NAME), "catroid_sunglasses.png", diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameProjectTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameProjectTest.java index a742a6063d0..34351ed1f94 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameProjectTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameProjectTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.fragment; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import android.widget.EditText; import org.catrobat.catroid.R; @@ -47,7 +45,15 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.hamcrest.Matchers.allOf; +import static org.hamcrest.Matchers.instanceOf; +import static org.hamcrest.Matchers.not; + import static androidx.test.espresso.Espresso.closeSoftKeyboard; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; @@ -60,11 +66,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.hamcrest.Matchers.allOf; -import static org.hamcrest.Matchers.instanceOf; -import static org.hamcrest.Matchers.not; - @RunWith(AndroidJUnit4.class) public class RenameProjectTest { @@ -87,7 +88,7 @@ public void setUp() throws Exception { @Category({Cat.AppUi.class, Level.Smoke.class}) @Test public void renameProjectTest() { - openActionBarOverflowOrOptionsMenu(getInstrumentation().getTargetContext()); + openActionBarOverflowOrOptionsMenu(InstrumentationRegistry.getInstrumentation().getTargetContext()); onView(withText(R.string.rename)).perform(click()); onRecyclerView().atPosition(0) @@ -114,7 +115,7 @@ public void renameProjectTest() { @Category({Cat.AppUi.class, Level.Smoke.class}) @Test public void cancelRenameProjectTest() { - openActionBarOverflowOrOptionsMenu(getInstrumentation().getTargetContext()); + openActionBarOverflowOrOptionsMenu(InstrumentationRegistry.getInstrumentation().getTargetContext()); onView(withText(R.string.rename)).perform(click()); onRecyclerView().atPosition(0) @@ -139,7 +140,7 @@ public void cancelRenameProjectTest() { @Category({Cat.AppUi.class, Level.Smoke.class}) @Test public void invalidInputRenameProjectTest() { - openActionBarOverflowOrOptionsMenu(getInstrumentation().getTargetContext()); + openActionBarOverflowOrOptionsMenu(InstrumentationRegistry.getInstrumentation().getTargetContext()); onView(withText(R.string.rename)).perform(click()); onRecyclerView().atPosition(0) @@ -180,7 +181,7 @@ public void invalidInputRenameProjectTest() { } private void createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new SingleSprite("firstSprite"); Script script = new StartScript(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameSceneTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameSceneTest.java index 0799c32917e..fa4bffc79df 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameSceneTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameSceneTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.fragment; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import android.widget.EditText; import org.catrobat.catroid.ProjectManager; @@ -44,7 +42,16 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static junit.framework.Assert.assertEquals; + +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.hamcrest.Matchers.allOf; +import static org.hamcrest.Matchers.instanceOf; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.closeSoftKeyboard; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; @@ -56,12 +63,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static junit.framework.Assert.assertEquals; - -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.hamcrest.Matchers.allOf; -import static org.hamcrest.Matchers.instanceOf; - @RunWith(AndroidJUnit4.class) public class RenameSceneTest { @@ -118,11 +119,11 @@ public void setUp() throws Exception { } private void createProject(String projectName) { - project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + project = new Project(ApplicationProvider.getApplicationContext(), projectName); Scene secondScene = new Scene("secondScene", project); project.addScene(secondScene); ProjectManager.getInstance().setCurrentProject(project); ProjectSaveTask - .task(project, InstrumentationRegistry.getTargetContext()); + .task(project, ApplicationProvider.getApplicationContext()); } } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameSoundTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameSoundTest.java index 01cb0f29755..1f9cdcfe9b3 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameSoundTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameSoundTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.fragment; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import android.widget.EditText; import org.catrobat.catroid.ProjectManager; @@ -50,7 +48,17 @@ import java.io.IOException; import java.util.List; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + +import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.hamcrest.Matchers.allOf; +import static org.hamcrest.Matchers.instanceOf; +import static org.hamcrest.Matchers.not; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.closeSoftKeyboard; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; @@ -63,12 +71,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.hamcrest.Matchers.allOf; -import static org.hamcrest.Matchers.instanceOf; -import static org.hamcrest.Matchers.not; - @RunWith(AndroidJUnit4.class) public class RenameSoundTest { @@ -184,7 +186,7 @@ public void invalidInputRenameSoundTest() { private void createProject() throws IOException { String projectName = "renameSoundFragmentTest"; - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new SingleSprite("testSprite"); project.getDefaultScene().addSprite(sprite); @@ -195,7 +197,7 @@ private void createProject() throws IOException { XstreamSerializer.getInstance().saveProject(project); File soundFile0 = ResourceImporter.createSoundFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.longsound, new File(project.getDefaultScene().getDirectory(), SOUND_DIRECTORY_NAME), "longsound.mp3"); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameSpriteTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameSpriteTest.java index 754bb9a327e..97ca5bce46b 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameSpriteTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RenameSpriteTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.fragment; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import android.widget.EditText; import org.catrobat.catroid.ProjectManager; @@ -44,7 +42,15 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.hamcrest.Matchers.allOf; +import static org.hamcrest.Matchers.instanceOf; +import static org.hamcrest.Matchers.not; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.closeSoftKeyboard; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; @@ -58,11 +64,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.hamcrest.Matchers.allOf; -import static org.hamcrest.Matchers.instanceOf; -import static org.hamcrest.Matchers.not; - @RunWith(AndroidJUnit4.class) public class RenameSpriteTest { @@ -114,7 +115,7 @@ public void cancelRenameSpriteDialogTest() { onView(withText(secondSpriteName)) .check(matches(isDisplayed())); - onView(withText(InstrumentationRegistry.getTargetContext() + onView(withText(ApplicationProvider.getApplicationContext() .getResources().getQuantityString(R.plurals.am_rename_sprites_title, 1, 1))) .check(matches(isDisplayed())); } @@ -196,7 +197,7 @@ private void renameSpriteTo(String newSpriteName) { } private void createProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite firstSprite = new SingleSprite(firstSpriteName); Sprite secondSprite = new SingleSprite(secondSpriteName); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/ScriptFragmentTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/ScriptFragmentTest.java index de8cd1ac883..14086337734 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/ScriptFragmentTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/ScriptFragmentTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.fragment; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Project; @@ -49,6 +46,17 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static junit.framework.TestCase.assertTrue; + +import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; +import static org.hamcrest.Matchers.allOf; +import static org.hamcrest.Matchers.instanceOf; +import static org.hamcrest.core.Is.is; +import static org.hamcrest.core.IsNot.not; + import static androidx.test.espresso.Espresso.onData; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openContextualActionModeOverflowMenu; @@ -62,14 +70,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static junit.framework.TestCase.assertTrue; - -import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; -import static org.hamcrest.Matchers.allOf; -import static org.hamcrest.Matchers.instanceOf; -import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsNot.not; - @RunWith(AndroidJUnit4.class) public class ScriptFragmentTest { @@ -241,7 +241,7 @@ public void testCheckControlStructure() { private void createProject() { String projectName = getClass().getSimpleName(); - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new SingleSprite("testSprite"); project.getDefaultScene().addSprite(sprite); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/SpriteListFragmentExplanationTextNoObjectsProjectTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/SpriteListFragmentExplanationTextNoObjectsProjectTest.java index 92e90c5f3eb..c6719b9d1f3 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/SpriteListFragmentExplanationTextNoObjectsProjectTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/SpriteListFragmentExplanationTextNoObjectsProjectTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,8 +24,6 @@ package org.catrobat.catroid.uiespresso.ui.fragment; import android.app.Activity; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -37,6 +35,13 @@ import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + +import static org.hamcrest.core.AllOf.allOf; +import static org.hamcrest.core.IsNot.not; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.matches; @@ -44,9 +49,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.hamcrest.core.AllOf.allOf; -import static org.hamcrest.core.IsNot.not; - @RunWith(AndroidJUnit4.class) public class SpriteListFragmentExplanationTextNoObjectsProjectTest { @Rule @@ -92,7 +94,7 @@ public void run() { } private void createNoObjectsProject() { - Project project = new Project(InstrumentationRegistry.getTargetContext(), "SpriteListFragmentExplanationTextNoObjectsProjectTest"); + Project project = new Project(ApplicationProvider.getApplicationContext(), "SpriteListFragmentExplanationTextNoObjectsProjectTest"); ProjectManager.getInstance().setCurrentProject(project); ProjectManager.getInstance().setCurrentlyEditedScene(project.getDefaultScene()); } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/SpriteListFragmentExplanationTextProjectWithObjectTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/SpriteListFragmentExplanationTextProjectWithObjectTest.java index 33bc0680006..29d3cc45026 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/SpriteListFragmentExplanationTextProjectWithObjectTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/SpriteListFragmentExplanationTextProjectWithObjectTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.fragment; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.R; import org.catrobat.catroid.ui.ProjectActivity; import org.catrobat.catroid.uiespresso.content.brick.utils.BrickTestUtils; @@ -34,7 +32,13 @@ import org.junit.Test; import org.junit.runner.RunWith; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.hamcrest.Matchers.allOf; +import static org.hamcrest.Matchers.not; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static androidx.test.espresso.action.ViewActions.click; @@ -43,10 +47,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.hamcrest.Matchers.allOf; -import static org.hamcrest.Matchers.not; - @RunWith(AndroidJUnit4.class) public class SpriteListFragmentExplanationTextProjectWithObjectTest { @Rule diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/hints/Android9SnackbarRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/hints/Android9SnackbarRegressionTest.java index b437f020db9..4142f09c6a0 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/hints/Android9SnackbarRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/hints/Android9SnackbarRegressionTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -25,8 +25,6 @@ import android.content.SharedPreferences; import android.preference.PreferenceManager; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; @@ -48,6 +46,11 @@ import java.util.HashSet; import java.util.Set; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.hamcrest.core.AllOf.allOf; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.assertion.ViewAssertions.matches; import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; @@ -55,8 +58,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.hamcrest.core.AllOf.allOf; - @RunWith(AndroidJUnit4.class) public class Android9SnackbarRegressionTest { @@ -70,7 +71,7 @@ public class Android9SnackbarRegressionTest { @Before public void setUp() { - SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()); + SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()); hintSetting = sharedPreferences .getBoolean(SettingsFragment.SETTINGS_SHOW_HINTS, false); hintList = new HashSet<>(sharedPreferences.getStringSet(SnackbarUtil.SHOWN_HINT_LIST, new HashSet())); @@ -86,7 +87,7 @@ public void setUp() { @After public void tearDown() { - SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()); + SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()); sharedPreferences.edit() .putBoolean(SettingsFragment.SETTINGS_SHOW_HINTS, hintSetting) @@ -98,14 +99,14 @@ public void tearDown() { @Test public void snackbarTest() { onView(isRoot()).perform(CustomActions.wait(200)); - onView(allOf(withId(android.support.design.R.id.snackbar_text), withText(R.string.hint_objects))) + onView(allOf(withId(com.google.android.material.R.id.snackbar_text), withText(R.string.hint_objects))) .check(matches(isDisplayed())); - onView(allOf(withId(android.support.design.R.id.snackbar_action), withText(R.string.got_it))) + onView(allOf(withId(com.google.android.material.R.id.snackbar_action), withText(R.string.got_it))) .check(matches(isDisplayed())); } public void createProject() { - Project project = new Project(InstrumentationRegistry.getTargetContext(), getClass().getSimpleName()); + Project project = new Project(ApplicationProvider.getApplicationContext(), getClass().getSimpleName()); ProjectManager.getInstance().setCurrentProject(project); ProjectManager.getInstance().setCurrentlyEditedScene(project.getDefaultScene()); } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/FormulaEditorFragmentActivityRecreateRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/FormulaEditorFragmentActivityRecreateRegressionTest.java index 7b6ff0d5020..335e5b06b55 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/FormulaEditorFragmentActivityRecreateRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/FormulaEditorFragmentActivityRecreateRegressionTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.regression.activitydestroy; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; import org.catrobat.catroid.content.bricks.ChangeSizeByNBrick; @@ -43,6 +40,14 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + +import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.FORMULA_EDITOR_KEYBOARD_MATCHER; +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.FORMULA_EDITOR_TEXT_FIELD_MATCHER; +import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; @@ -52,11 +57,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.FORMULA_EDITOR_KEYBOARD_MATCHER; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.FORMULA_EDITOR_TEXT_FIELD_MATCHER; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; - @RunWith(AndroidJUnit4.class) public class FormulaEditorFragmentActivityRecreateRegressionTest { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/LegoConfigDialogActivityRecreationRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/LegoConfigDialogActivityRecreationRegressionTest.java index d2b906792b8..7b5372be6a6 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/LegoConfigDialogActivityRecreationRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/LegoConfigDialogActivityRecreationRegressionTest.java @@ -24,7 +24,6 @@ package org.catrobat.catroid.uiespresso.ui.regression.activitydestroy; import android.preference.PreferenceManager; -import android.support.test.InstrumentationRegistry; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; @@ -48,12 +47,15 @@ import java.io.IOException; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.matcher.ViewMatchers.withId; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.platform.app.InstrumentationRegistry; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withId; + @Category({Cat.AppUi.class, Level.Smoke.class}) public class LegoConfigDialogActivityRecreationRegressionTest { @@ -72,14 +74,14 @@ public void setUp() throws Exception { Script script = BrickTestUtils.createProjectAndGetStartScript(getClass().getSimpleName()); script.addBrick(new ChangeSizeByNBrick(0)); - nxtSettingBuffer = PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()) + nxtSettingBuffer = PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()) .getBoolean(SettingsFragment.SETTINGS_MINDSTORMS_NXT_BRICKS_ENABLED, false); setNXTBrickSetting(true); - sensorMappingBuffer = SettingsFragment.getLegoNXTSensorMapping(InstrumentationRegistry.getTargetContext()); + sensorMappingBuffer = SettingsFragment.getLegoNXTSensorMapping(ApplicationProvider.getApplicationContext()); - SettingsFragment.setLegoMindstormsNXTSensorMapping(InstrumentationRegistry.getTargetContext(), + SettingsFragment.setLegoMindstormsNXTSensorMapping(ApplicationProvider.getApplicationContext(), new NXTSensor.Sensor[] { NXTSensor.Sensor.NO_SENSOR, NXTSensor.Sensor.NO_SENSOR, @@ -109,13 +111,13 @@ public void tearDown() throws IOException { setNXTBrickSetting(nxtSettingBuffer); SettingsFragment - .setLegoMindstormsNXTSensorMapping(InstrumentationRegistry.getTargetContext(), sensorMappingBuffer); + .setLegoMindstormsNXTSensorMapping(ApplicationProvider.getApplicationContext(), sensorMappingBuffer); TestUtils.deleteProjects(getClass().getSimpleName()); } private void setNXTBrickSetting(boolean bricksEnabled) { - PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()).edit() + PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()).edit() .putBoolean(SettingsFragment.SETTINGS_MINDSTORMS_NXT_BRICKS_ENABLED, bricksEnabled) .commit(); } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/LookFragmentActivityRecreateRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/LookFragmentActivityRecreateRegressionTest.java index 07c1f2aa635..9546f456b27 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/LookFragmentActivityRecreateRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/LookFragmentActivityRecreateRegressionTest.java @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.regression.activitydestroy; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.common.LookData; @@ -50,7 +47,14 @@ import java.io.IOException; import java.util.List; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + +import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static androidx.test.espresso.action.ViewActions.click; @@ -60,9 +64,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.common.Constants.IMAGE_DIRECTORY_NAME; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; - @RunWith(AndroidJUnit4.class) public class LookFragmentActivityRecreateRegressionTest { @@ -129,7 +130,7 @@ public void run() { private void createProject() throws IOException { String projectName = "copyLookFragmentTest"; - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new SingleSprite("testSprite"); project.getDefaultScene().addSprite(sprite); @@ -139,7 +140,7 @@ private void createProject() throws IOException { XstreamSerializer.getInstance().saveProject(project); File imageFile = ResourceImporter.createImageFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.drawable.catroid_banzai, new File(project.getDefaultScene().getDirectory(), IMAGE_DIRECTORY_NAME), "catroid_sunglasses.png", diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/MainMenuFragemtnActivityRecreateRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/MainMenuFragemtnActivityRecreateRegressionTest.java index 2062baf6008..27f5c378c3e 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/MainMenuFragemtnActivityRecreateRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/MainMenuFragemtnActivityRecreateRegressionTest.java @@ -24,8 +24,6 @@ package org.catrobat.catroid.uiespresso.ui.regression.activitydestroy; import android.preference.PreferenceManager; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; import org.catrobat.catroid.R; import org.catrobat.catroid.rules.FlakyTestRule; @@ -41,7 +39,13 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + +import static org.hamcrest.Matchers.is; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static androidx.test.espresso.action.ViewActions.click; @@ -54,8 +58,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.hamcrest.Matchers.is; - @RunWith(AndroidJUnit4.class) public class MainMenuFragemtnActivityRecreateRegressionTest { @@ -71,11 +73,11 @@ public class MainMenuFragemtnActivityRecreateRegressionTest { @Before public void setUp() throws Exception { - bufferedPreferenceSetting = PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry - .getTargetContext()) + bufferedPreferenceSetting = + PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()) .getBoolean(AGREED_TO_PRIVACY_POLICY_SETTINGS_KEY, false); - PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()) + PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()) .edit() .putBoolean(AGREED_TO_PRIVACY_POLICY_SETTINGS_KEY, true) .commit(); @@ -84,7 +86,7 @@ public void setUp() throws Exception { @After public void tearDown() { - PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()) + PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext()) .edit() .putBoolean(AGREED_TO_PRIVACY_POLICY_SETTINGS_KEY, bufferedPreferenceSetting) .commit(); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/NewMessageDialogActivityRecreateRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/NewMessageDialogActivityRecreateRegressionTest.java index 91a2f6b391d..66c0ee50a24 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/NewMessageDialogActivityRecreateRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/NewMessageDialogActivityRecreateRegressionTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.regression.activitydestroy; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; import org.catrobat.catroid.content.bricks.BroadcastBrick; @@ -42,6 +39,11 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + +import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.matches; @@ -49,8 +51,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; - @RunWith(AndroidJUnit4.class) public class NewMessageDialogActivityRecreateRegressionTest { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/ProjectListActivityRecreateRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/ProjectListActivityRecreateRegressionTest.java index 40ef8581fe2..7b51f84c642 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/ProjectListActivityRecreateRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/ProjectListActivityRecreateRegressionTest.java @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.regression.activitydestroy; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.common.BrickValues; @@ -49,7 +46,14 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; +import static org.hamcrest.Matchers.is; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static androidx.test.espresso.action.ViewActions.click; @@ -62,9 +66,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; -import static org.hamcrest.Matchers.is; - @RunWith(AndroidJUnit4.class) public class ProjectListActivityRecreateRegressionTest { @@ -133,7 +134,7 @@ public void run() { } private void createProject() { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new SingleSprite("firstSprite"); Script script = new StartScript(); script.addBrick(new SetXBrick(new Formula(BrickValues.X_POSITION))); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/SceneFragmentActivityRecreateRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/SceneFragmentActivityRecreateRegressionTest.java index 38ed9caff07..3b8214f7fcd 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/SceneFragmentActivityRecreateRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/SceneFragmentActivityRecreateRegressionTest.java @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.regression.activitydestroy; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Project; @@ -42,7 +39,13 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static androidx.test.espresso.action.ViewActions.click; @@ -52,8 +55,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; - @RunWith(AndroidJUnit4.class) public class SceneFragmentActivityRecreateRegressionTest { @@ -119,7 +120,7 @@ public void run() { } private void createProject() { - Project project = new Project(InstrumentationRegistry.getTargetContext(), "SceneTestProject"); + Project project = new Project(ApplicationProvider.getApplicationContext(), "SceneTestProject"); project.addScene(new Scene("secondScene", project)); ProjectManager.getInstance().setCurrentProject(project); ProjectManager.getInstance().setCurrentlyEditedScene(project.getDefaultScene()); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/ScriptFragmentActivityRecreateRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/ScriptFragmentActivityRecreateRegressionTest.java index d0a0545041f..25c5fc721a0 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/ScriptFragmentActivityRecreateRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/ScriptFragmentActivityRecreateRegressionTest.java @@ -23,12 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.regression.activitydestroy; -import android.support.test.InstrumentationRegistry; -import androidx.test.espresso.action.GeneralClickAction; -import androidx.test.espresso.action.Press; -import androidx.test.espresso.action.Tap; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; import org.catrobat.catroid.content.bricks.ChangeSizeByNBrick; @@ -46,13 +40,19 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import androidx.test.espresso.action.GeneralClickAction; +import androidx.test.espresso.action.Press; +import androidx.test.espresso.action.Tap; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + +import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; + import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; - @RunWith(AndroidJUnit4.class) public class ScriptFragmentActivityRecreateRegressionTest { diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/SoundFragmentActivityRecreateRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/SoundFragmentActivityRecreateRegressionTest.java index 03d914f7bcd..557aa12a3a1 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/SoundFragmentActivityRecreateRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/SoundFragmentActivityRecreateRegressionTest.java @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.regression.activitydestroy; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.common.SoundInfo; @@ -50,7 +47,14 @@ import java.io.IOException; import java.util.List; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + +import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static androidx.test.espresso.action.ViewActions.click; @@ -60,9 +64,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.common.Constants.SOUND_DIRECTORY_NAME; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; - @RunWith(AndroidJUnit4.class) public class SoundFragmentActivityRecreateRegressionTest { @@ -129,7 +130,7 @@ public void run() { private void createProject() throws IOException { String projectName = "copySoundFragmentTest"; - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new SingleSprite("testSprite"); project.getDefaultScene().addSprite(sprite); @@ -139,7 +140,7 @@ private void createProject() throws IOException { XstreamSerializer.getInstance().saveProject(project); File soundFile = ResourceImporter.createSoundFileFromResourcesInDirectory( - InstrumentationRegistry.getContext().getResources(), + InstrumentationRegistry.getInstrumentation().getContext().getResources(), org.catrobat.catroid.test.R.raw.longsound, new File(project.getDefaultScene().getDirectory(), SOUND_DIRECTORY_NAME), "longsound.mp3"); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/SpriteListFragmentActivityRecreateRegressionTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/SpriteListFragmentActivityRecreateRegressionTest.java index 4f7644c8582..d25db7c6351 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/SpriteListFragmentActivityRecreateRegressionTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/regression/activitydestroy/SpriteListFragmentActivityRecreateRegressionTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,9 +23,6 @@ package org.catrobat.catroid.uiespresso.ui.regression.activitydestroy; -import android.support.test.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Project; @@ -42,7 +39,13 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static android.support.test.InstrumentationRegistry.getInstrumentation; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; + +import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; + +import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static androidx.test.espresso.action.ViewActions.click; @@ -52,8 +55,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.catrobat.catroid.uiespresso.ui.fragment.rvutils.RecyclerViewInteractionWrapper.onRecyclerView; - @RunWith(AndroidJUnit4.class) public class SpriteListFragmentActivityRecreateRegressionTest { @@ -156,7 +157,7 @@ public void run() { } private void createProject() { - Project project = new Project(InstrumentationRegistry.getTargetContext(), "spriteListFragmentTest"); + Project project = new Project(ApplicationProvider.getApplicationContext(), "spriteListFragmentTest"); Sprite sprite = new Sprite("testSprite"); project.getDefaultScene().addSprite(sprite); ProjectManager.getInstance().setCurrentProject(project); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/UiTestUtils.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/UiTestUtils.java index c1b6e9e454a..5e144aa605d 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/UiTestUtils.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/UiTestUtils.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,9 +24,6 @@ import android.app.Activity; import android.content.res.Resources; -import android.support.test.InstrumentationRegistry; -import androidx.test.espresso.ViewInteraction; -import androidx.test.runner.lifecycle.ActivityLifecycleMonitorRegistry; import android.view.View; import org.catrobat.catroid.ProjectManager; @@ -38,14 +35,18 @@ import java.util.Collection; -import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.matcher.ViewMatchers.assertThat; -import static androidx.test.runner.lifecycle.Stage.RESUMED; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.espresso.ViewInteraction; +import androidx.test.runner.lifecycle.ActivityLifecycleMonitorRegistry; import static org.catrobat.catroid.uiespresso.util.matchers.SuperToastMatchers.isToast; import static org.hamcrest.CoreMatchers.instanceOf; +import static androidx.test.InstrumentationRegistry.getInstrumentation; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.matcher.ViewMatchers.assertThat; +import static androidx.test.runner.lifecycle.Stage.RESUMED; + public final class UiTestUtils { private UiTestUtils() { @@ -53,19 +54,19 @@ private UiTestUtils() { } public static Resources getResources() { - return InstrumentationRegistry.getTargetContext().getResources(); + return ApplicationProvider.getApplicationContext().getResources(); } public static String getResourcesString(int stringId) { - return InstrumentationRegistry.getTargetContext().getResources().getString(stringId); + return ApplicationProvider.getApplicationContext().getResources().getString(stringId); } public static String getResourcesString(int stringId, Object... formatArgs) { - return InstrumentationRegistry.getTargetContext().getResources().getString(stringId, formatArgs); + return ApplicationProvider.getApplicationContext().getResources().getString(stringId, formatArgs); } public static String getQuantitiyString(int stringId, int quantity) { - return InstrumentationRegistry.getTargetContext().getResources().getQuantityString(stringId, quantity); + return ApplicationProvider.getApplicationContext().getResources().getQuantityString(stringId, quantity); } public static void assertCurrentActivityIsInstanceOf(Class activityClass) { @@ -82,7 +83,7 @@ public void run() { } public static Project createEmptyProject(String projectName) { - Project project = new Project(InstrumentationRegistry.getTargetContext(), projectName); + Project project = new Project(ApplicationProvider.getApplicationContext(), projectName); Sprite sprite = new Sprite("testSprite"); Script script = new StartScript(); sprite.addScript(script); diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/rules/DontGenerateDefaultProjectActivityTestRule.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/rules/DontGenerateDefaultProjectActivityTestRule.java index ee68c906c75..e1c2942401a 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/rules/DontGenerateDefaultProjectActivityTestRule.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/rules/DontGenerateDefaultProjectActivityTestRule.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -23,12 +23,13 @@ package org.catrobat.catroid.uiespresso.util.rules; import android.app.Activity; -import android.support.test.InstrumentationRegistry; import org.catrobat.catroid.common.FlavoredConstants; import org.catrobat.catroid.content.Project; import org.catrobat.catroid.io.XstreamSerializer; +import androidx.test.core.app.ApplicationProvider; + public class DontGenerateDefaultProjectActivityTestRule extends BaseActivityTestRule { @@ -52,7 +53,7 @@ protected void beforeActivityLaunched() { void setUpDummyProject() { FlavoredConstants.DEFAULT_ROOT_DIRECTORY.mkdir(); - Project project = new Project(InstrumentationRegistry.getTargetContext(), + Project project = new Project(ApplicationProvider.getApplicationContext(), "DummyToPreventDefaultProjectCreation"); XstreamSerializer.getInstance().saveProject(project); } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/rules/ScreenshotOnFailRule.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/rules/ScreenshotOnFailRule.java index 631031222e4..92b04adb4d0 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/rules/ScreenshotOnFailRule.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/util/rules/ScreenshotOnFailRule.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -27,7 +27,6 @@ import android.app.UiAutomation; import android.graphics.Bitmap; import android.os.Environment; -import android.support.test.InstrumentationRegistry; import android.util.Log; import org.junit.rules.TestWatcher; @@ -41,6 +40,9 @@ import java.text.SimpleDateFormat; import java.util.Locale; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.platform.app.InstrumentationRegistry; + public class ScreenshotOnFailRule extends TestWatcher { private static final String TAG = ScreenshotOnFailRule.class.getSimpleName(); @@ -69,7 +71,7 @@ private Bitmap takeScreenshot() throws TakeScreenShotException { private File makeFileDescriptor(Description description) { File path = new File(Environment.getExternalStorageDirectory().getAbsolutePath() - + "/PocketCodeEspressoScreenshots/" + InstrumentationRegistry.getTargetContext().getPackageName()); + + "/PocketCodeEspressoScreenshots/" + ApplicationProvider.getApplicationContext().getPackageName()); if (!path.exists()) { path.mkdirs(); } diff --git a/catroid/src/main/java/org/catrobat/catroid/dagger/AppComponent.kt b/catroid/src/main/java/org/catrobat/catroid/dagger/AppComponent.kt index 5954e53d38d..b0062541e24 100644 --- a/catroid/src/main/java/org/catrobat/catroid/dagger/AppComponent.kt +++ b/catroid/src/main/java/org/catrobat/catroid/dagger/AppComponent.kt @@ -1,14 +1,37 @@ +/* + * Catroid: An on-device visual programming system for Android devices + * Copyright (C) 2010-2020 The Catrobat Team + * () + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * An additional term exception under section 7 of the GNU Affero + * General Public License, version 3, is available at + * http://developer.catrobat.org/license_additional_term + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + package org.catrobat.catroid.dagger import dagger.Component -import dagger.android.support.AndroidSupportInjectionModule +import dagger.android.AndroidInjectionModule import org.catrobat.catroid.CatroidApplication import javax.inject.Singleton @Singleton @Component( modules = [ - AndroidSupportInjectionModule::class, + AndroidInjectionModule::class, ActivityBindingModule::class, CatroidModule::class, EagerSingletonsModule::class diff --git a/catroid/src/main/java/org/catrobat/catroid/transfers/GoogleLoginHandler.java b/catroid/src/main/java/org/catrobat/catroid/transfers/GoogleLoginHandler.java index d3608d9330f..9b9c4b2dca4 100644 --- a/catroid/src/main/java/org/catrobat/catroid/transfers/GoogleLoginHandler.java +++ b/catroid/src/main/java/org/catrobat/catroid/transfers/GoogleLoginHandler.java @@ -27,10 +27,6 @@ import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.appcompat.app.AlertDialog; -import androidx.appcompat.app.AppCompatActivity; import com.google.android.gms.auth.api.signin.GoogleSignInAccount; import com.google.android.gms.auth.api.signin.GoogleSignInClient; @@ -44,6 +40,8 @@ import org.catrobat.catroid.utils.DeviceSettingsProvider; import org.catrobat.catroid.utils.ToastUtil; +import androidx.appcompat.app.AppCompatActivity; + import static com.google.android.gms.auth.api.signin.GoogleSignIn.getClient; import static com.google.android.gms.auth.api.signin.GoogleSignIn.getSignedInAccountFromIntent; From a08e9e846031292c01322a7c184f2a9e0beb8d99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20St=C3=B6glehner?= Date: Wed, 5 Feb 2020 15:40:05 +0100 Subject: [PATCH 10/16] CATROID-182 Add visual placement to the GlideToBrick - Derive a new class VisualPlacementBrick from FormulaBrick and move the logic for visual placement from the PlaceAtBrick class to this new base class to prevent code duplication. - Add an entry "Place Visually" also in the ScriptFragment of the GlideToBrick. - Refactor the testcase PlaceAtBrickTest and make a new Test for VisualPlacementBricks to test that visual placement both works for GlideToBricks and PlaceAtBricks. --- ...est.java => VisualPlacementBrickTest.java} | 120 +++++++++++++---- .../SpriteActivityVisualPlacementTest.java | 4 +- .../ui/activity/ProjectActivityTest.java | 3 +- .../catroid/content/bricks/GlideToBrick.java | 22 +++- .../catroid/content/bricks/PlaceAtBrick.java | 103 +++------------ .../content/bricks/VisualPlacementBrick.java | 123 ++++++++++++++++++ .../catrobat/catroid/ui/SpriteActivity.java | 4 +- .../recyclerview/fragment/ScriptFragment.java | 8 +- .../bricks/BrickSingleFormulaFieldTest.java | 2 - 9 files changed, 268 insertions(+), 121 deletions(-) rename catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/{PlaceAtBrickTest.java => VisualPlacementBrickTest.java} (50%) create mode 100644 catroid/src/main/java/org/catrobat/catroid/content/bricks/VisualPlacementBrick.java diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PlaceAtBrickTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/VisualPlacementBrickTest.java similarity index 50% rename from catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PlaceAtBrickTest.java rename to catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/VisualPlacementBrickTest.java index 8f9b098a914..1e9610919e2 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/PlaceAtBrickTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/VisualPlacementBrickTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2018 The Catrobat Team + * Copyright (C) 2010-2020 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,89 +24,157 @@ package org.catrobat.catroid.uiespresso.content.brick.app; import org.catrobat.catroid.R; +import org.catrobat.catroid.content.Script; +import org.catrobat.catroid.content.bricks.GlideToBrick; import org.catrobat.catroid.content.bricks.PlaceAtBrick; +import org.catrobat.catroid.content.bricks.VisualPlacementBrick; +import org.catrobat.catroid.formulaeditor.Formula; import org.catrobat.catroid.test.utils.TestUtils; import org.catrobat.catroid.testsuites.annotations.Cat; import org.catrobat.catroid.testsuites.annotations.Level; import org.catrobat.catroid.ui.SpriteActivity; +import org.catrobat.catroid.uiespresso.content.brick.utils.BrickTestUtils; import org.catrobat.catroid.uiespresso.util.rules.FragmentActivityTestRule; +import org.catrobat.catroid.visualplacement.VisualPlacementActivity; import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; -import androidx.test.ext.junit.runners.AndroidJUnit4; +import java.util.Arrays; +import java.util.Collection; + +import androidx.test.espresso.intent.Intents; import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickDataInteractionWrapper.onBrickAtPosition; -import static org.catrobat.catroid.uiespresso.content.brick.utils.BrickTestUtils.createProjectAndGetStartScript; import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.Espresso.pressBack; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.matches; +import static androidx.test.espresso.intent.Intents.intended; +import static androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent; import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; -@RunWith(AndroidJUnit4.class) -public class PlaceAtBrickTest { - private int brickPosition; +@Category({Cat.AppUi.class, Level.Smoke.class}) +@RunWith(Parameterized.class) +public class VisualPlacementBrickTest { @Rule public FragmentActivityTestRule baseActivityTestRule = new FragmentActivityTestRule<>(SpriteActivity.class, SpriteActivity.EXTRA_FRAGMENT_POSITION, SpriteActivity.FRAGMENT_SCRIPTS); + @Parameterized.Parameters(name = "{0}") + public static Collection data() { + return Arrays.asList(new Object[][] { + {"GlideToBrick", R.string.brick_glide, new GlideToBrick()}, + {"PlaceAtBrick", R.string.brick_place_at, new PlaceAtBrick()} + }); + } + + @Parameterized.Parameter + public String name; + + @Parameterized.Parameter(1) + public int brickString; + + @Parameterized.Parameter(2) + public VisualPlacementBrick brick; + @After public void tearDown() throws Exception { - TestUtils.deleteProjects(PlaceAtBrickTest.class.getSimpleName()); + Intents.release(); + resetFormulaFields(); + baseActivityTestRule.finishActivity(); + TestUtils.deleteProjects(VisualPlacementBrickTest.class.getSimpleName()); + } + + private void resetFormulaFields() { + brick.setFormulaWithBrickField(brick.getXBrickField(), new Formula(0.0)); + brick.setFormulaWithBrickField(brick.getYBrickField(), new Formula(0.0)); } @Before public void setUp() throws Exception { - brickPosition = 1; - createProjectAndGetStartScript(PlaceAtBrickTest.class.getSimpleName()) - .addBrick(new PlaceAtBrick()); + Script script = + BrickTestUtils.createProjectAndGetStartScript(VisualPlacementBrickTest.class.getSimpleName()); + script.addBrick(brick); baseActivityTestRule.launchActivity(); + Intents.init(); + } + + @Test + public void testIsVisualPlacementShownForEditTextX() { + onBrickAtPosition(1).checkShowsText(brickString); + onView(withId(brick.getXEditTextId())) + .perform(click()); + onView(withText(R.string.brick_place_at_option_place_visually)) + .check(matches(isDisplayed())); + onView(withText(R.string.brick_context_dialog_formula_edit_brick)) + .check(matches(isDisplayed())); } - @Category({Cat.AppUi.class, Level.Smoke.class}) @Test - public void testPlaceAtBrick() { - onBrickAtPosition(brickPosition).checkShowsText(R.string.brick_place_at); - onView(withId(R.id.brick_place_at_edit_text_x)) + public void testIsVisualPlacementShownForEditTextY() { + onView(withId(brick.getYEditTextId())) .perform(click()); onView(withText(R.string.brick_place_at_option_place_visually)) .check(matches(isDisplayed())); onView(withText(R.string.brick_context_dialog_formula_edit_brick)) - .check(matches(isDisplayed())) + .check(matches(isDisplayed())); + } + + @Test + public void testIsVisualPlacementShownOnBrickClick() { + onBrickAtPosition(1).performClick(); + onView(withText(R.string.brick_place_at_option_place_visually)) + .check(matches(isDisplayed())); + } + + @Test + public void testVisualPlacementAfterFormulaNotANumber() { + onView(withId(brick.getXEditTextId())) + .perform(click()); + onView(withText(R.string.brick_context_dialog_formula_edit_brick)) .perform(click()); onFormulaEditor() .performEnterFormula("1+2") .performCloseAndSave(); - onView(withId(R.id.brick_place_at_edit_text_x)) - .check(matches(withText("1 + 2 "))); + onView(withId(brick.getXEditTextId())) + .perform(click()); + onFormulaEditor() + .check(matches(isDisplayed())); + } - onView(withId(R.id.brick_place_at_edit_text_x)) + @Test + public void testVisualPlacementAfterNumberEntered() { + onView(withId(brick.getXEditTextId())) + .perform(click()); + onView(withText(R.string.brick_context_dialog_formula_edit_brick)) .perform(click()); onFormulaEditor() .performEnterNumber(42) .performCloseAndSave(); - onView(withId(R.id.brick_place_at_edit_text_x)) - .check(matches(withText("42 "))); - - onView(withId(R.id.brick_place_at_edit_text_y)) + onView(withId(brick.getXEditTextId())) + .check(matches(withText("42 "))) .perform(click()); onView(withText(R.string.brick_place_at_option_place_visually)) .check(matches(isDisplayed())); onView(withText(R.string.brick_context_dialog_formula_edit_brick)) .check(matches(isDisplayed())); - pressBack(); + } - onBrickAtPosition(brickPosition).performClick(); + @Test + public void testIsVisualPlacementActivityShown() { + onView(withId(brick.getXEditTextId())) + .perform(click()); onView(withText(R.string.brick_place_at_option_place_visually)) - .check(matches(isDisplayed())); + .perform(click()); + intended(hasComponent(VisualPlacementActivity.class.getName())); } } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/visualplacement/SpriteActivityVisualPlacementTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/visualplacement/SpriteActivityVisualPlacementTest.java index 5e7d721baab..2f7d78f9d23 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/visualplacement/SpriteActivityVisualPlacementTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/visualplacement/SpriteActivityVisualPlacementTest.java @@ -32,7 +32,6 @@ import org.catrobat.catroid.formulaeditor.Formula; import org.catrobat.catroid.test.utils.TestUtils; import org.catrobat.catroid.ui.SpriteActivity; -import org.catrobat.catroid.uiespresso.content.brick.app.PlaceAtBrickTest; import org.catrobat.catroid.uiespresso.util.rules.FragmentActivityTestRule; import org.catrobat.catroid.visualplacement.VisualPlacementActivity; import org.junit.After; @@ -87,7 +86,8 @@ public void setUp() throws Exception { @After public void tearDown() throws Exception { Intents.release(); - TestUtils.deleteProjects(PlaceAtBrickTest.class.getSimpleName()); + baseActivityTestRule.finishActivity(); + TestUtils.deleteProjects(SpriteActivityVisualPlacementTest.class.getSimpleName()); } @Test diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectActivityTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectActivityTest.java index bae17514fcb..bfbb9f83606 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectActivityTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/ProjectActivityTest.java @@ -40,7 +40,6 @@ import org.catrobat.catroid.testsuites.annotations.Level; import org.catrobat.catroid.ui.ProjectActivity; import org.catrobat.catroid.ui.ProjectUploadActivity; -import org.catrobat.catroid.uiespresso.content.brick.app.PlaceAtBrickTest; import org.catrobat.catroid.uiespresso.util.rules.FragmentActivityTestRule; import org.junit.After; import org.junit.Before; @@ -90,7 +89,7 @@ public void setUp() { @After public void tearDown() throws Exception { Intents.release(); - TestUtils.deleteProjects(PlaceAtBrickTest.class.getSimpleName()); + TestUtils.deleteProjects(PROJECT_NAME); } @Category({Cat.AppUi.class, Level.Smoke.class}) diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/GlideToBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/GlideToBrick.java index ac515b09916..7668766ed64 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/GlideToBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/GlideToBrick.java @@ -30,7 +30,7 @@ import org.catrobat.catroid.content.actions.ScriptSequenceAction; import org.catrobat.catroid.formulaeditor.Formula; -public class GlideToBrick extends FormulaBrick { +public class GlideToBrick extends VisualPlacementBrick { private static final long serialVersionUID = 1L; @@ -77,4 +77,24 @@ public void addActionToSequence(Sprite sprite, ScriptSequenceAction sequence) { getFormulaWithBrickField(BrickField.Y_DESTINATION), getFormulaWithBrickField(BrickField.DURATION_IN_SECONDS))); } + + @Override + public BrickField getXBrickField() { + return BrickField.X_DESTINATION; + } + + @Override + public BrickField getYBrickField() { + return BrickField.Y_DESTINATION; + } + + @Override + public int getXEditTextId() { + return R.id.brick_glide_to_edit_text_x; + } + + @Override + public int getYEditTextId() { + return R.id.brick_glide_to_edit_text_y; + } } diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/PlaceAtBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/PlaceAtBrick.java index 4dae53e239e..db2f77105b3 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/PlaceAtBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/PlaceAtBrick.java @@ -22,33 +22,15 @@ */ package org.catrobat.catroid.content.bricks; -import android.app.AlertDialog; -import android.content.Context; -import android.content.Intent; -import android.view.View; - -import org.catrobat.catroid.ProjectManager; import org.catrobat.catroid.R; import org.catrobat.catroid.content.Sprite; import org.catrobat.catroid.content.actions.ScriptSequenceAction; import org.catrobat.catroid.formulaeditor.Formula; -import org.catrobat.catroid.formulaeditor.InterpretationException; -import org.catrobat.catroid.ui.SpriteActivity; -import org.catrobat.catroid.ui.UiUtils; -import org.catrobat.catroid.ui.recyclerview.fragment.ScriptFragment; -import org.catrobat.catroid.visualplacement.VisualPlacementActivity; - -import androidx.appcompat.app.AppCompatActivity; -import androidx.fragment.app.Fragment; import static org.catrobat.catroid.content.bricks.Brick.BrickField.X_POSITION; import static org.catrobat.catroid.content.bricks.Brick.BrickField.Y_POSITION; -import static org.catrobat.catroid.ui.SpriteActivity.EXTRA_BRICK_HASH; -import static org.catrobat.catroid.ui.SpriteActivity.EXTRA_X_TRANSFORM; -import static org.catrobat.catroid.ui.SpriteActivity.EXTRA_Y_TRANSFORM; -import static org.catrobat.catroid.ui.SpriteActivity.REQUEST_CODE_VISUAL_PLACEMENT; -public class PlaceAtBrick extends FormulaBrick { +public class PlaceAtBrick extends VisualPlacementBrick { private static final long serialVersionUID = 1L; @@ -68,84 +50,39 @@ public PlaceAtBrick(Formula xPosition, Formula yPosition) { } @Override - public void showFormulaEditorToEditFormula(final View view) { - Context context = view.getContext(); - Fragment currentFragment = UiUtils.getActivityFromView(view).getSupportFragmentManager() - .findFragmentById(R.id.fragment_container); - - boolean showVisualPlacementDialog = currentFragment instanceof ScriptFragment - && (view.getId() == R.id.brick_place_at_edit_text_x || view.getId() == R.id.brick_place_at_edit_text_y) - && areAllBrickFieldsNumbers(); - - if (showVisualPlacementDialog) { - String[] optionStrings = { - context.getString(R.string.brick_place_at_option_place_visually), - context.getString(R.string.brick_context_dialog_formula_edit_brick)}; - - new AlertDialog.Builder(context).setItems(optionStrings, (dialog, which) -> { - switch (which) { - case 0: - placeVisually(); - break; - case 1: - super.showFormulaEditorToEditFormula(view); - break; - } - }).show(); - } else { - super.showFormulaEditorToEditFormula(view); - } + public BrickField getDefaultBrickField() { + return X_POSITION; } - private boolean areAllBrickFieldsNumbers() { - return isBrickFieldANumber(X_POSITION) - && isBrickFieldANumber(Y_POSITION); + @Override + public int getViewResource() { + return R.layout.brick_place_at; } - public void placeVisually() { - AppCompatActivity activity = UiUtils.getActivityFromView(view); - if (!(activity instanceof SpriteActivity)) { - return; - } - - Sprite currentSprite = ProjectManager.getInstance().getCurrentSprite(); - Formula formulax = getFormulaWithBrickField(BrickField.X_POSITION); - Formula formulay = getFormulaWithBrickField(BrickField.Y_POSITION); - Intent intent = new Intent(view.getContext(), VisualPlacementActivity.class); - intent.putExtra(EXTRA_BRICK_HASH, hashCode()); - int xValue; - int yValue; - try { - xValue = formulax.interpretInteger(currentSprite); - yValue = formulay.interpretInteger(currentSprite); - } catch (InterpretationException interpretationException) { - xValue = 0; - yValue = 0; - } - intent.putExtra(EXTRA_X_TRANSFORM, xValue); - intent.putExtra(EXTRA_Y_TRANSFORM, yValue); - activity.startActivityForResult(intent, REQUEST_CODE_VISUAL_PLACEMENT); + @Override + public void addActionToSequence(Sprite sprite, ScriptSequenceAction sequence) { + sequence.addAction(sprite.getActionFactory().createPlaceAtAction(sprite, + getFormulaWithBrickField(X_POSITION), + getFormulaWithBrickField(Y_POSITION))); } - public void setCoordinates(int x, int y) { - setFormulaWithBrickField(X_POSITION, new Formula(x)); - setFormulaWithBrickField(Y_POSITION, new Formula(y)); + @Override + public BrickField getXBrickField() { + return BrickField.X_POSITION; } @Override - public BrickField getDefaultBrickField() { - return X_POSITION; + public BrickField getYBrickField() { + return BrickField.Y_POSITION; } @Override - public int getViewResource() { - return R.layout.brick_place_at; + public int getXEditTextId() { + return R.id.brick_place_at_edit_text_x; } @Override - public void addActionToSequence(Sprite sprite, ScriptSequenceAction sequence) { - sequence.addAction(sprite.getActionFactory().createPlaceAtAction(sprite, - getFormulaWithBrickField(X_POSITION), - getFormulaWithBrickField(Y_POSITION))); + public int getYEditTextId() { + return R.id.brick_place_at_edit_text_y; } } diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/VisualPlacementBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/VisualPlacementBrick.java new file mode 100644 index 00000000000..101ee8b59cc --- /dev/null +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/VisualPlacementBrick.java @@ -0,0 +1,123 @@ +/* + * Catroid: An on-device visual programming system for Android devices + * Copyright (C) 2010-2020 The Catrobat Team + * () + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * An additional term exception under section 7 of the GNU Affero + * General Public License, version 3, is available at + * http://developer.catrobat.org/license_additional_term + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package org.catrobat.catroid.content.bricks; + +import android.content.Context; +import android.content.Intent; +import android.view.View; + +import org.catrobat.catroid.ProjectManager; +import org.catrobat.catroid.R; +import org.catrobat.catroid.content.Sprite; +import org.catrobat.catroid.formulaeditor.Formula; +import org.catrobat.catroid.formulaeditor.InterpretationException; +import org.catrobat.catroid.ui.SpriteActivity; +import org.catrobat.catroid.ui.UiUtils; +import org.catrobat.catroid.ui.recyclerview.fragment.ScriptFragment; +import org.catrobat.catroid.visualplacement.VisualPlacementActivity; + +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.Fragment; + +import static org.catrobat.catroid.ui.SpriteActivity.EXTRA_BRICK_HASH; +import static org.catrobat.catroid.ui.SpriteActivity.EXTRA_X_TRANSFORM; +import static org.catrobat.catroid.ui.SpriteActivity.EXTRA_Y_TRANSFORM; +import static org.catrobat.catroid.ui.SpriteActivity.REQUEST_CODE_VISUAL_PLACEMENT; + +public abstract class VisualPlacementBrick extends FormulaBrick { + + @Override + public void showFormulaEditorToEditFormula(View view) { + Context context = view.getContext(); + + if (showVisualPlacementDialog(view)) { + String[] optionStrings = { + context.getString(R.string.brick_place_at_option_place_visually), + context.getString(R.string.brick_context_dialog_formula_edit_brick)}; + + new AlertDialog.Builder(context).setItems(optionStrings, (dialog, which) -> { + switch (which) { + case 0: + placeVisually(getXBrickField(), getYBrickField()); + break; + case 1: + super.showFormulaEditorToEditFormula(view); + break; + } + }).show(); + } else { + super.showFormulaEditorToEditFormula(view); + } + } + + public void placeVisually(BrickField brickFieldX, BrickField brickFieldY) { + AppCompatActivity activity = UiUtils.getActivityFromView(view); + if (!(activity instanceof SpriteActivity)) { + return; + } + Sprite currentSprite = ProjectManager.getInstance().getCurrentSprite(); + + Formula formulax = getFormulaWithBrickField(brickFieldX); + Formula formulay = getFormulaWithBrickField(brickFieldY); + Intent intent = new Intent(view.getContext(), VisualPlacementActivity.class); + intent.putExtra(EXTRA_BRICK_HASH, hashCode()); + int xValue; + int yValue; + try { + xValue = formulax.interpretInteger(currentSprite); + yValue = formulay.interpretInteger(currentSprite); + } catch (InterpretationException interpretationException) { + xValue = 0; + yValue = 0; + } + intent.putExtra(EXTRA_X_TRANSFORM, xValue); + intent.putExtra(EXTRA_Y_TRANSFORM, yValue); + activity.startActivityForResult(intent, REQUEST_CODE_VISUAL_PLACEMENT); + } + + public void setCoordinates(int x, int y) { + setFormulaWithBrickField(getXBrickField(), new Formula(x)); + setFormulaWithBrickField(getYBrickField(), new Formula(y)); + } + + public boolean areAllBrickFieldsNumbers() { + return isBrickFieldANumber(getXBrickField()) + && isBrickFieldANumber(getYBrickField()); + } + + public boolean showVisualPlacementDialog(View view) { + Fragment currentFragment = UiUtils.getActivityFromView(view).getSupportFragmentManager() + .findFragmentById(R.id.fragment_container); + + return currentFragment instanceof ScriptFragment + && (view.getId() == getXEditTextId() || view.getId() == getYEditTextId()) + && areAllBrickFieldsNumbers(); + } + + public abstract BrickField getXBrickField(); + public abstract BrickField getYBrickField(); + public abstract int getXEditTextId(); + public abstract int getYEditTextId(); +} diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/SpriteActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/SpriteActivity.java index 7218dbd9204..1b09550e291 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/SpriteActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/SpriteActivity.java @@ -42,7 +42,7 @@ import org.catrobat.catroid.content.Scene; import org.catrobat.catroid.content.Sprite; import org.catrobat.catroid.content.bricks.Brick; -import org.catrobat.catroid.content.bricks.PlaceAtBrick; +import org.catrobat.catroid.content.bricks.VisualPlacementBrick; import org.catrobat.catroid.formulaeditor.UserData; import org.catrobat.catroid.formulaeditor.UserList; import org.catrobat.catroid.formulaeditor.UserVariable; @@ -353,7 +353,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { if (fragment instanceof ScriptFragment) { Brick brick = ((ScriptFragment) fragment).findBrickByHash(brickHash); if (brick != null) { - ((PlaceAtBrick) brick).setCoordinates(xCoordinate, yCoordinate); + ((VisualPlacementBrick) brick).setCoordinates(xCoordinate, yCoordinate); } } break; diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/ScriptFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/ScriptFragment.java index 742fa4cf0bc..75ca40a5c13 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/ScriptFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/ScriptFragment.java @@ -44,8 +44,8 @@ import org.catrobat.catroid.content.StartScript; import org.catrobat.catroid.content.bricks.Brick; import org.catrobat.catroid.content.bricks.FormulaBrick; -import org.catrobat.catroid.content.bricks.PlaceAtBrick; import org.catrobat.catroid.content.bricks.ScriptBrick; +import org.catrobat.catroid.content.bricks.VisualPlacementBrick; import org.catrobat.catroid.io.asynctask.ProjectSaveTask; import org.catrobat.catroid.ui.BottomBar; import org.catrobat.catroid.ui.controller.BackpackListManager; @@ -494,7 +494,7 @@ private List getContextMenuItems(Brick brick) { items.add(brick.isCommentedOut() ? R.string.brick_context_dialog_comment_in : R.string.brick_context_dialog_comment_out); - if (brick instanceof PlaceAtBrick) { + if (brick instanceof VisualPlacementBrick) { items.add(R.string.brick_place_at_option_place_visually); } if (brick instanceof FormulaBrick) { @@ -548,7 +548,9 @@ private void handleContextMenuItemClick(int itemId, Brick brick, int position) { adapter.notifyDataSetChanged(); break; case R.string.brick_place_at_option_place_visually: - ((PlaceAtBrick) brick).placeVisually(); + VisualPlacementBrick visualPlacementBrick = (VisualPlacementBrick) brick; + visualPlacementBrick.placeVisually(visualPlacementBrick.getXBrickField(), + visualPlacementBrick.getYBrickField()); break; case R.string.brick_context_dialog_formula_edit_brick: ((FormulaBrick) brick).onClick(listView); diff --git a/catroid/src/test/java/org/catrobat/catroid/test/robolectric/bricks/BrickSingleFormulaFieldTest.java b/catroid/src/test/java/org/catrobat/catroid/test/robolectric/bricks/BrickSingleFormulaFieldTest.java index 41c2e7e418f..38d49b774d6 100644 --- a/catroid/src/test/java/org/catrobat/catroid/test/robolectric/bricks/BrickSingleFormulaFieldTest.java +++ b/catroid/src/test/java/org/catrobat/catroid/test/robolectric/bricks/BrickSingleFormulaFieldTest.java @@ -200,8 +200,6 @@ public static Collection data() { {IfThenLogicBeginBrick.class.getSimpleName(), new IfThenLogicBeginBrick(), R.id.brick_if_begin_edit_text}, //Bricks with multiple formula fields: - {GlideToBrick.class.getSimpleName() + " x", new GlideToBrick(), R.id.brick_glide_to_edit_text_x}, - {GlideToBrick.class.getSimpleName() + " y", new GlideToBrick(), R.id.brick_glide_to_edit_text_y}, {GlideToBrick.class.getSimpleName() + " duration", new GlideToBrick(), R.id.brick_glide_to_edit_text_duration}, {SetVelocityBrick.class.getSimpleName() + " x", new SetVelocityBrick(), R.id.brick_set_velocity_edit_text_x}, {SetVelocityBrick.class.getSimpleName() + " y", new SetVelocityBrick(), R.id.brick_set_velocity_edit_text_y}, From 512d5ef3f7576874860dc78daff90f3f6e2f0206 Mon Sep 17 00:00:00 2001 From: Michelle Perkonigg Date: Sat, 2 Nov 2019 19:38:05 +0100 Subject: [PATCH 11/16] CATROID-232 Start zigzag stitch with length 2 and width 10 --- .../catroid/test/BricksHelpUrlTest.java | 2 + .../content/bricks/BrickCategoryTest.java | 2 + .../bricks/BrickFormulaDefaultValueTest.java | 3 + .../embroidery/ZigZagRunningStitchTest.java | 89 ++++++++++++++ .../catrobat/catroid/common/BrickValues.java | 2 + .../catrobat/catroid/common/Constants.java | 2 +- .../catroid/content/ActionFactory.java | 9 ++ .../content/actions/ZigZagStitchAction.java | 76 ++++++++++++ .../catroid/content/bricks/Brick.java | 2 +- .../content/bricks/ZigZagStitchBrick.java | 61 ++++++++++ .../embroidery/ZigZagRunningStitch.java | 109 ++++++++++++++++++ .../catroid/io/XstreamSerializer.java | 2 + .../ui/fragment/CategoryBricksFactory.java | 3 + .../main/res/layout/brick_zigzag_stitch.xml | 74 ++++++++++++ catroid/src/main/res/values/strings.xml | 2 + 15 files changed, 436 insertions(+), 2 deletions(-) create mode 100644 catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/ZigZagRunningStitchTest.java create mode 100644 catroid/src/main/java/org/catrobat/catroid/content/actions/ZigZagStitchAction.java create mode 100644 catroid/src/main/java/org/catrobat/catroid/content/bricks/ZigZagStitchBrick.java create mode 100644 catroid/src/main/java/org/catrobat/catroid/embroidery/ZigZagRunningStitch.java create mode 100644 catroid/src/main/res/layout/brick_zigzag_stitch.xml diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/BricksHelpUrlTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/BricksHelpUrlTest.java index 1ec277f7988..a500e56d93f 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/BricksHelpUrlTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/BricksHelpUrlTest.java @@ -382,6 +382,8 @@ public class BricksHelpUrlTest { "https://wiki.catrobat.org/bin/view/Documentation/Brick%20Documentation/Embroidery%20Bricks/#RunningStitchBrick"); brickToHelpUrlMapping.put("org.catrobat.catroid.content.bricks.StopRunningStitchBrick", "https://wiki.catrobat.org/bin/view/Documentation/Brick%20Documentation/Embroidery%20Bricks/#StopRunningStitchBrick"); + brickToHelpUrlMapping.put("org.catrobat.catroid.content.bricks.ZigZagStitchBrick", + "https://wiki.catrobat.org/bin/view/Documentation/Brick%20Documentation/Embroidery%20Bricks/#ZigZagStitchBrick"); } @Parameterized.Parameters(name = "{0}") diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickCategoryTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickCategoryTest.java index 0daa562d39e..cdb25f21fa5 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickCategoryTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickCategoryTest.java @@ -188,6 +188,7 @@ import org.catrobat.catroid.content.bricks.WhenTouchDownBrick; import org.catrobat.catroid.content.bricks.WriteListOnDeviceBrick; import org.catrobat.catroid.content.bricks.WriteVariableOnDeviceBrick; +import org.catrobat.catroid.content.bricks.ZigZagStitchBrick; import org.catrobat.catroid.ui.fragment.CategoryBricksFactory; import org.junit.Before; import org.junit.Test; @@ -237,6 +238,7 @@ public static Collection data() { SetFrictionBrick.class)}, {"Embroidery", Arrays.asList(StitchBrick.class, RunningStitchBrick.class, + ZigZagStitchBrick.class, StopRunningStitchBrick.class)}, {"Event", Arrays.asList(WhenStartedBrick.class, WhenBrick.class, diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickFormulaDefaultValueTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickFormulaDefaultValueTest.java index 780db3b271f..02f8acfa2ac 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickFormulaDefaultValueTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickFormulaDefaultValueTest.java @@ -98,6 +98,7 @@ import org.catrobat.catroid.content.bricks.WaitBrick; import org.catrobat.catroid.content.bricks.WaitUntilBrick; import org.catrobat.catroid.content.bricks.WhenConditionBrick; +import org.catrobat.catroid.content.bricks.ZigZagStitchBrick; import org.catrobat.catroid.ui.fragment.CategoryBricksFactory; import org.junit.Before; import org.junit.Test; @@ -207,6 +208,8 @@ public static Collection data() { {"WaitUntilBrick - R.id.brick_wait_until_edit_text", "Control", WaitUntilBrick.class, R.id.brick_wait_until_edit_text, "1 < 2 "}, {"RepeatUntilBrick - R.id.brick_repeat_until_edit_text", "Control", RepeatUntilBrick.class, R.id.brick_repeat_until_edit_text, "1 < 2 "}, {"RepeatUntilBrick - R.id.brick_repeat_edit_text", "Control", RepeatBrick.class, R.id.brick_repeat_edit_text, "10 "}, + {"ZigZagStitchBrick - R.id.brick_zigzag_stitch_edit_text_density", "Embroidery", ZigZagStitchBrick.class, R.id.brick_zigzag_stitch_edit_text_length, "2 "}, + {"ZigZagStitchBrick - R.id.brick_zigzag_stitch_edit_text_height", "Embroidery", ZigZagStitchBrick.class, R.id.brick_zigzag_stitch_edit_text_width, "10 "}, {"RunningStitchBrick - R.id.brick_running_stitch_edit_text_steps", "Embroidery", RunningStitchBrick.class, R.id.brick_running_stitch_edit_text_length, "10 "}, }); } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/ZigZagRunningStitchTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/ZigZagRunningStitchTest.java new file mode 100644 index 00000000000..59598013049 --- /dev/null +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/ZigZagRunningStitchTest.java @@ -0,0 +1,89 @@ +/* + * Catroid: An on-device visual programming system for Android devices + * Copyright (C) 2010-2019 The Catrobat Team + * () + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * An additional term exception under section 7 of the GNU Affero + * General Public License, version 3, is available at + * http://developer.catrobat.org/license_additional_term + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package org.catrobat.catroid.test.embroidery; + +import org.catrobat.catroid.content.Look; +import org.catrobat.catroid.content.Sprite; +import org.catrobat.catroid.embroidery.EmbroideryPatternManager; +import org.catrobat.catroid.embroidery.ZigZagRunningStitch; +import org.catrobat.catroid.stage.StageActivity; +import org.catrobat.catroid.stage.StageListener; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; + +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +@RunWith(AndroidJUnit4.class) +public class ZigZagRunningStitchTest { + + private Sprite sprite; + private Look spriteLook; + private ZigZagRunningStitch zigZagRunningStitch; + private EmbroideryPatternManager embroideryPatternManager; + + @Before + public void setUp() { + sprite = Mockito.mock(Sprite.class); + spriteLook = Mockito.mock(Look.class); + sprite.look = spriteLook; + embroideryPatternManager = Mockito.mock(EmbroideryPatternManager.class); + StageActivity.stageListener = Mockito.mock(StageListener.class); + StageActivity.stageListener.embroideryPatternManager = embroideryPatternManager; + final int width = 5; + final int height = 10; + zigZagRunningStitch = new ZigZagRunningStitch(sprite, width, height); + } + + @After + public void tearDown() { + StageActivity.stageListener = null; + } + + @Test + public void testNoMoveOfRunningStitch() { + zigZagRunningStitch.update(0, 0); + verify(embroideryPatternManager, times(0)).addStitchCommand(any()); + } + + @Test + public void testSimpleMoveOfRunningStitch() { + zigZagRunningStitch.update(10, 10); + verify(embroideryPatternManager, times(6)).addStitchCommand(any()); + } + + @Test + public void testSetStartCoordinates() { + zigZagRunningStitch.setStartCoordinates(10, 10); + zigZagRunningStitch.update(0, 0); + + verify(embroideryPatternManager, times(6)).addStitchCommand(any()); + } +} diff --git a/catroid/src/main/java/org/catrobat/catroid/common/BrickValues.java b/catroid/src/main/java/org/catrobat/catroid/common/BrickValues.java index eb048a55ca8..55d4fc83908 100644 --- a/catroid/src/main/java/org/catrobat/catroid/common/BrickValues.java +++ b/catroid/src/main/java/org/catrobat/catroid/common/BrickValues.java @@ -175,6 +175,8 @@ public final class BrickValues { //Constants Embroidery public static final float STITCH_SIZE = 3.15f; public static final int STITCH_LENGTH = 10; + public static final int ZIGZAG_STITCH_LENGTH = 2; + public static final int ZIGZAG_STITCH_WIDTH = 10; private BrickValues() { throw new AssertionError("No."); diff --git a/catroid/src/main/java/org/catrobat/catroid/common/Constants.java b/catroid/src/main/java/org/catrobat/catroid/common/Constants.java index bc4e4a076e3..52e23ceb7b9 100644 --- a/catroid/src/main/java/org/catrobat/catroid/common/Constants.java +++ b/catroid/src/main/java/org/catrobat/catroid/common/Constants.java @@ -38,7 +38,7 @@ public final class Constants { - public static final float CURRENT_CATROBAT_LANGUAGE_VERSION = 0.99995f; + public static final float CURRENT_CATROBAT_LANGUAGE_VERSION = 0.99996f; public static final String REMOTE_DISPLAY_APP_ID = "CEBB9229"; public static final int CAST_CONNECTION_TIMEOUT = 5000; //in milliseconds diff --git a/catroid/src/main/java/org/catrobat/catroid/content/ActionFactory.java b/catroid/src/main/java/org/catrobat/catroid/content/ActionFactory.java index 2bb9d9b343f..81c379f5753 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/ActionFactory.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/ActionFactory.java @@ -167,6 +167,7 @@ import org.catrobat.catroid.content.actions.WebRequestAction; import org.catrobat.catroid.content.actions.WriteListOnDeviceAction; import org.catrobat.catroid.content.actions.WriteVariableOnDeviceAction; +import org.catrobat.catroid.content.actions.ZigZagStitchAction; import org.catrobat.catroid.content.actions.conditional.GlideToAction; import org.catrobat.catroid.content.actions.conditional.IfOnEdgeBounceAction; import org.catrobat.catroid.content.bricks.JumpingSumoAnimationsBrick; @@ -866,6 +867,14 @@ public Action createRunningStitchAction(Sprite sprite, Formula length) { return action; } + public Action createZigZagStitchAction(Sprite sprite, Formula length, Formula width) { + ZigZagStitchAction action = Actions.action(ZigZagStitchAction.class); + action.setSprite(sprite); + action.setLength(length); + action.setWidth(width); + return action; + } + public static Action createStopRunningStitchAction(Sprite sprite) { StopRunningStitchAction action = Actions.action(StopRunningStitchAction.class); action.setSprite(sprite); diff --git a/catroid/src/main/java/org/catrobat/catroid/content/actions/ZigZagStitchAction.java b/catroid/src/main/java/org/catrobat/catroid/content/actions/ZigZagStitchAction.java new file mode 100644 index 00000000000..9f70491de88 --- /dev/null +++ b/catroid/src/main/java/org/catrobat/catroid/content/actions/ZigZagStitchAction.java @@ -0,0 +1,76 @@ +/* + * Catroid: An on-device visual programming system for Android devices + * Copyright (C) 2010-2019 The Catrobat Team + * () + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * An additional term exception under section 7 of the GNU Affero + * General Public License, version 3, is available at + * http://developer.catrobat.org/license_additional_term + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package org.catrobat.catroid.content.actions; + +import android.util.Log; + +import com.badlogic.gdx.scenes.scene2d.actions.TemporalAction; + +import org.catrobat.catroid.content.Sprite; +import org.catrobat.catroid.embroidery.ZigZagRunningStitch; +import org.catrobat.catroid.formulaeditor.Formula; +import org.catrobat.catroid.formulaeditor.InterpretationException; + +public class ZigZagStitchAction extends TemporalAction { + + private Sprite sprite; + private Formula length; + private Formula width; + + @Override + protected void update(float delta) { + float lengthInterpretation = 0; + float heightInterpretation = 0; + try { + if (length != null) { + lengthInterpretation = length.interpretFloat(sprite); + } + } catch (InterpretationException interpretationException) { + lengthInterpretation = 0; + Log.d(getClass().getSimpleName(), "Formula interpretation for this specific Brick failed.", interpretationException); + } + try { + if (width != null) { + heightInterpretation = width.interpretFloat(sprite); + } + } catch (InterpretationException interpretationException) { + heightInterpretation = 0; + Log.d(getClass().getSimpleName(), "Formula interpretation for this specific Brick failed.", interpretationException); + } + this.sprite.runningStitch.activateStitching(sprite, new ZigZagRunningStitch(sprite, + lengthInterpretation, heightInterpretation)); + } + + public void setSprite(Sprite sprite) { + this.sprite = sprite; + } + + public void setLength(Formula length) { + this.length = length; + } + + public void setWidth(Formula width) { + this.width = width; + } +} diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/Brick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/Brick.java index 019433e5526..c84d3110f58 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/Brick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/Brick.java @@ -73,7 +73,7 @@ enum BrickField { RASPI_DIGITAL_PIN_VALUE, RASPI_DIGITAL_PIN_NUMBER, RASPI_PWM_PERCENTAGE, RASPI_PWM_FREQUENCY, - EMBROIDERY_LENGTH, + EMBROIDERY_LENGTH, ZIGZAG_EMBROIDERY_LENGTH, ZIGZAG_EMBROIDERY_WIDTH, ASSERT_EQUALS_EXPECTED, ASSERT_EQUALS_ACTUAL; diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/ZigZagStitchBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/ZigZagStitchBrick.java new file mode 100644 index 00000000000..40f7a331474 --- /dev/null +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/ZigZagStitchBrick.java @@ -0,0 +1,61 @@ +/* + * Catroid: An on-device visual programming system for Android devices + * Copyright (C) 2010-2019 The Catrobat Team + * () + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * An additional term exception under section 7 of the GNU Affero + * General Public License, version 3, is available at + * http://developer.catrobat.org/license_additional_term + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package org.catrobat.catroid.content.bricks; + +import org.catrobat.catroid.R; +import org.catrobat.catroid.content.Sprite; +import org.catrobat.catroid.content.actions.ScriptSequenceAction; +import org.catrobat.catroid.formulaeditor.Formula; + +public class ZigZagStitchBrick extends FormulaBrick { + + private static final long serialVersionUID = 1L; + + public ZigZagStitchBrick() { + addAllowedBrickField(BrickField.ZIGZAG_EMBROIDERY_LENGTH, R.id.brick_zigzag_stitch_edit_text_length); + addAllowedBrickField(BrickField.ZIGZAG_EMBROIDERY_WIDTH, R.id.brick_zigzag_stitch_edit_text_width); + } + + public ZigZagStitchBrick(Formula length, Formula width) { + this(); + setFormulaWithBrickField(BrickField.ZIGZAG_EMBROIDERY_LENGTH, length); + setFormulaWithBrickField(BrickField.ZIGZAG_EMBROIDERY_WIDTH, width); + } + + @Override + public BrickField getDefaultBrickField() { + return BrickField.ZIGZAG_EMBROIDERY_LENGTH; + } + + @Override + public int getViewResource() { + return R.layout.brick_zigzag_stitch; + } + + @Override + public void addActionToSequence(Sprite sprite, ScriptSequenceAction sequence) { + sequence.addAction(sprite.getActionFactory().createZigZagStitchAction(sprite, + getFormulaWithBrickField(BrickField.ZIGZAG_EMBROIDERY_LENGTH), + getFormulaWithBrickField(BrickField.ZIGZAG_EMBROIDERY_WIDTH))); + } +} diff --git a/catroid/src/main/java/org/catrobat/catroid/embroidery/ZigZagRunningStitch.java b/catroid/src/main/java/org/catrobat/catroid/embroidery/ZigZagRunningStitch.java new file mode 100644 index 00000000000..ea491f333fd --- /dev/null +++ b/catroid/src/main/java/org/catrobat/catroid/embroidery/ZigZagRunningStitch.java @@ -0,0 +1,109 @@ +/* + * Catroid: An on-device visual programming system for Android devices + * Copyright (C) 2010-2019 The Catrobat Team + * () + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * An additional term exception under section 7 of the GNU Affero + * General Public License, version 3, is available at + * http://developer.catrobat.org/license_additional_term + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package org.catrobat.catroid.embroidery; + +import org.catrobat.catroid.content.Sprite; +import org.catrobat.catroid.stage.StageActivity; + +public class ZigZagRunningStitch implements RunningStitchType { + private float length; + private float width; + private Sprite sprite; + private float firstX = 0; + private float firstY = 0; + private int direction = -1; + private boolean first = true; + + public ZigZagRunningStitch(Sprite sprite, float length, float width) { + this.sprite = sprite; + this.length = length; + this.width = width; + setStartCoordinates(sprite.look.getXInUserInterfaceDimensionUnit(), + sprite.look.getYInUserInterfaceDimensionUnit()); + } + + @Override + public void setStartCoordinates(float x, float y) { + this.firstX = x; + this.firstY = y; + } + + @Override + public void update(float currentX, float currentY) { + if (sprite != null) { + float distance = getDistanceToPoint(currentX, currentY); + if (distance >= length) { + float surplusPercentage = ((distance - (distance % length)) / distance); + currentX = firstX + (surplusPercentage * (currentX - firstX)); + currentY = firstY + (surplusPercentage * (currentY - firstY)); + distance -= distance % length; + + int interpolationCount = (int) (Math.floor(distance / length)); + interpolateStitches(interpolationCount, currentX, currentY); + setStartCoordinates(currentX, currentY); + } + } + } + + private void interpolateStitches(int interpolationCount, float currentX, float currentY) { + float degrees = sprite.look.getDirectionInUserInterfaceDimensionUnit(); + + if (first) { + first = false; + addPointInDirection(firstX, firstY, degrees); + addPointInDirection(firstX, firstY, degrees); + } + + for (int count = 1; count < interpolationCount; count++) { + float splitFactor = (float) count / interpolationCount; + float x = interpolate(currentX, firstX, splitFactor); + float y = interpolate(currentY, firstY, splitFactor); + addPointInDirection(x, y, degrees); + addPointInDirection(x, y, degrees); + } + + addPointInDirection(currentX, currentY, degrees); + addPointInDirection(currentX, currentY, degrees); + } + + private void addPointInDirection(float x, float y, float degrees) { + float xCoord = (float) (x + (width / 2) * Math.sin(Math.toRadians(degrees + 90)) * direction); + float yCoord = (float) (y + (width / 2) * Math.cos(Math.toRadians(degrees + 90)) * direction); + direction *= (-1); + StageActivity.stageListener.embroideryPatternManager.addStitchCommand(new DSTStitchCommand(xCoord, yCoord, + sprite.look.getZIndex(), sprite)); + } + + private float interpolate(float endValue, float startValue, float percentage) { + float value = Math.round(startValue + percentage * (endValue - startValue)); + return value; + } + + private float getDistanceToPoint(float currentX, float currentY) { + double xDistance = Math.pow(currentX - firstX, 2); + double yDistance = Math.pow(currentY - firstY, 2); + double difference = Math.sqrt(xDistance + yDistance); + return (float) difference; + } +} diff --git a/catroid/src/main/java/org/catrobat/catroid/io/XstreamSerializer.java b/catroid/src/main/java/org/catrobat/catroid/io/XstreamSerializer.java index 27cde680ccc..1a019f14379 100644 --- a/catroid/src/main/java/org/catrobat/catroid/io/XstreamSerializer.java +++ b/catroid/src/main/java/org/catrobat/catroid/io/XstreamSerializer.java @@ -229,6 +229,7 @@ import org.catrobat.catroid.content.bricks.WhenTouchDownBrick; import org.catrobat.catroid.content.bricks.WriteListOnDeviceBrick; import org.catrobat.catroid.content.bricks.WriteVariableOnDeviceBrick; +import org.catrobat.catroid.content.bricks.ZigZagStitchBrick; import org.catrobat.catroid.exceptions.LoadingProjectException; import org.catrobat.catroid.formulaeditor.UserList; import org.catrobat.catroid.formulaeditor.UserVariable; @@ -514,6 +515,7 @@ private void prepareXstream(Class projectClass, Class sceneClass) { xstream.alias("brick", StitchBrick.class); xstream.alias("brick", StopRunningStitchBrick.class); xstream.alias("brick", RunningStitchBrick.class); + xstream.alias("brick", ZigZagStitchBrick.class); xstream.alias("brick", WaitTillIdleBrick.class); xstream.alias("brick", WhenRaspiPinChangedBrick.class); xstream.alias("brick", WhenTouchDownBrick.class); diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/CategoryBricksFactory.java b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/CategoryBricksFactory.java index a44c69540b9..1583e05c1d2 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/CategoryBricksFactory.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/CategoryBricksFactory.java @@ -200,6 +200,7 @@ import org.catrobat.catroid.content.bricks.WhenTouchDownBrick; import org.catrobat.catroid.content.bricks.WriteListOnDeviceBrick; import org.catrobat.catroid.content.bricks.WriteVariableOnDeviceBrick; +import org.catrobat.catroid.content.bricks.ZigZagStitchBrick; import org.catrobat.catroid.formulaeditor.Formula; import org.catrobat.catroid.formulaeditor.FormulaElement; import org.catrobat.catroid.formulaeditor.Operators; @@ -649,6 +650,8 @@ private List setupEmbroideryCategoryList() { List embroideryBrickList = new ArrayList<>(); embroideryBrickList.add(new StitchBrick()); embroideryBrickList.add(new RunningStitchBrick(new Formula(BrickValues.STITCH_LENGTH))); + embroideryBrickList.add(new ZigZagStitchBrick(new Formula(BrickValues.ZIGZAG_STITCH_LENGTH), + new Formula(BrickValues.ZIGZAG_STITCH_WIDTH))); embroideryBrickList.add(new StopRunningStitchBrick()); return embroideryBrickList; } diff --git a/catroid/src/main/res/layout/brick_zigzag_stitch.xml b/catroid/src/main/res/layout/brick_zigzag_stitch.xml new file mode 100644 index 00000000000..a1f9302b612 --- /dev/null +++ b/catroid/src/main/res/layout/brick_zigzag_stitch.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/catroid/src/main/res/values/strings.xml b/catroid/src/main/res/values/strings.xml index fa4ed03aae8..3bcde6083d5 100644 --- a/catroid/src/main/res/values/strings.xml +++ b/catroid/src/main/res/values/strings.xml @@ -1173,6 +1173,8 @@ Stitch Start running stitch with length + Start zigzag stitch with length + and width Stop current stitch From ab9fc19834f5e1388f91871825af9be15db4cb54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20St=C3=B6glehner?= Date: Sun, 16 Feb 2020 19:41:57 +0100 Subject: [PATCH 12/16] CATROID-374 Implement sharing WebView Login automatically --- .../catrobat/catroid/ui/WebViewActivity.java | 29 +++++++++++++ .../java/org/catrobat/catroid/web/Cookie.java | 41 +++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 catroid/src/main/java/org/catrobat/catroid/web/Cookie.java diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/WebViewActivity.java b/catroid/src/main/java/org/catrobat/catroid/ui/WebViewActivity.java index c5309da5939..72624cde310 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/WebViewActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/WebViewActivity.java @@ -27,11 +27,13 @@ import android.app.ProgressDialog; import android.content.Context; import android.content.Intent; +import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.graphics.Bitmap; import android.net.Uri; import android.os.Bundle; import android.os.Environment; +import android.preference.PreferenceManager; import android.util.Log; import android.view.KeyEvent; import android.webkit.CookieManager; @@ -46,10 +48,13 @@ import org.catrobat.catroid.utils.MediaDownloader; import org.catrobat.catroid.utils.ToastUtil; import org.catrobat.catroid.utils.Utils; +import org.catrobat.catroid.web.Cookie; import org.catrobat.catroid.web.GlobalProjectDownloadQueue; import org.catrobat.catroid.web.ProjectDownloader; import java.io.File; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; import androidx.appcompat.app.AppCompatActivity; import androidx.core.content.res.ResourcesCompat; @@ -96,6 +101,7 @@ protected void onCreate(Bundle savedInstanceState) { webView.getSettings().setUserAgentString("Catrobat/" + language + " " + flavor + "/" + version + " Platform/" + platform + " BuildType/" + BuildConfig.BUILD_TYPE); + setLoginCookies(url); webView.loadUrl(url); webView.setDownloadListener((downloadUrl, userAgent, contentDisposition, mimetype, contentLength) -> { @@ -249,6 +255,29 @@ private String getExtensionFromContentDisposition(String contentDisposition) { return extension; } + public void setLoginCookies(String url) { + SharedPreferences sharedPreferences = + PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + String username = sharedPreferences.getString(Constants.USERNAME, Constants.NO_USERNAME); + String token = sharedPreferences.getString(Constants.TOKEN, Constants.NO_TOKEN); + + if (username.equals(Constants.NO_USERNAME) || token.equals(Constants.NO_TOKEN)) { + return; + } + + String encodedUsername = null; + try { + encodedUsername = URLEncoder.encode(username, "UTF-8"); + } catch (UnsupportedEncodingException e) { + Log.e(TAG, Log.getStackTraceString(e)); + } + + Cookie usernameCookie = new Cookie(Cookie.USERNAME_COOKIE, encodedUsername); + Cookie tokenCookie = new Cookie(Cookie.TOKEN_COOKIE, token); + CookieManager.getInstance().setCookie(url, usernameCookie.generateCookieString()); + CookieManager.getInstance().setCookie(url, tokenCookie.generateCookieString()); + } + public static void clearCookies() { CookieManager.getInstance().removeAllCookies(null); CookieManager.getInstance().flush(); diff --git a/catroid/src/main/java/org/catrobat/catroid/web/Cookie.java b/catroid/src/main/java/org/catrobat/catroid/web/Cookie.java new file mode 100644 index 00000000000..aca4f9d32a2 --- /dev/null +++ b/catroid/src/main/java/org/catrobat/catroid/web/Cookie.java @@ -0,0 +1,41 @@ +/* + * Catroid: An on-device visual programming system for Android devices + * Copyright (C) 2010-2020 The Catrobat Team + * () + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * An additional term exception under section 7 of the GNU Affero + * General Public License, version 3, is available at + * http://developer.catrobat.org/license_additional_term + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package org.catrobat.catroid.web; + +public class Cookie { + public static final String USERNAME_COOKIE = "CATRO_LOGIN_USER"; + public static final String TOKEN_COOKIE = "CATRO_LOGIN_TOKEN"; + + private String name; + private String value; + + public Cookie(String name, String value) { + this.name = name; + this.value = value; + } + + public String generateCookieString() { + return this.name + "=" + this.value; + } +} From f14993a6f2f7c161ff88fd0b07ebe74d6e5a29a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20St=C3=B6glehner?= Date: Sat, 15 Feb 2020 19:38:25 +0100 Subject: [PATCH 13/16] CATROID-464 Refactor string resource 'Place Visually' Refactor the variable name of the string resource as it is now possible that the GlideToBrick can be placed visually as well. In order to prevent misleading. --- .../brick/app/VisualPlacementBrickTest.java | 22 +++++++++++++------ .../SpriteActivityVisualPlacementTest.java | 6 ++--- .../content/bricks/VisualPlacementBrick.java | 2 +- .../recyclerview/fragment/ScriptFragment.java | 4 ++-- .../VisualPlacementActivity.java | 2 +- catroid/src/main/res/values-af/strings.xml | 2 +- catroid/src/main/res/values-ar/strings.xml | 2 +- catroid/src/main/res/values-az/strings.xml | 2 +- catroid/src/main/res/values-bg/strings.xml | 2 +- catroid/src/main/res/values-bn/strings.xml | 2 +- catroid/src/main/res/values-bs/strings.xml | 2 +- catroid/src/main/res/values-ca/strings.xml | 2 +- catroid/src/main/res/values-cs/strings.xml | 2 +- catroid/src/main/res/values-da/strings.xml | 2 +- catroid/src/main/res/values-de/strings.xml | 2 +- catroid/src/main/res/values-el/strings.xml | 2 +- .../src/main/res/values-en-rAU/strings.xml | 2 +- .../src/main/res/values-en-rCA/strings.xml | 2 +- .../src/main/res/values-en-rGB/strings.xml | 2 +- catroid/src/main/res/values-es/strings.xml | 2 +- catroid/src/main/res/values-fa/strings.xml | 2 +- catroid/src/main/res/values-fi/strings.xml | 2 +- catroid/src/main/res/values-fr/strings.xml | 2 +- catroid/src/main/res/values-gl/strings.xml | 2 +- catroid/src/main/res/values-gu/strings.xml | 2 +- catroid/src/main/res/values-ha/strings.xml | 2 +- catroid/src/main/res/values-hi/strings.xml | 2 +- catroid/src/main/res/values-hr/strings.xml | 2 +- catroid/src/main/res/values-hu/strings.xml | 2 +- catroid/src/main/res/values-ig/strings.xml | 2 +- catroid/src/main/res/values-in/strings.xml | 2 +- catroid/src/main/res/values-it/strings.xml | 2 +- catroid/src/main/res/values-iw/strings.xml | 2 +- catroid/src/main/res/values-ja/strings.xml | 2 +- catroid/src/main/res/values-kk/strings.xml | 2 +- catroid/src/main/res/values-kn/strings.xml | 2 +- catroid/src/main/res/values-ko/strings.xml | 2 +- catroid/src/main/res/values-lt/strings.xml | 2 +- catroid/src/main/res/values-mk/strings.xml | 2 +- catroid/src/main/res/values-ml/strings.xml | 2 +- catroid/src/main/res/values-ms/strings.xml | 2 +- catroid/src/main/res/values-nl/strings.xml | 2 +- catroid/src/main/res/values-no/strings.xml | 2 +- catroid/src/main/res/values-pl/strings.xml | 2 +- catroid/src/main/res/values-ps/strings.xml | 2 +- .../src/main/res/values-pt-rBR/strings.xml | 2 +- catroid/src/main/res/values-pt/strings.xml | 2 +- catroid/src/main/res/values-ro/strings.xml | 2 +- catroid/src/main/res/values-ru/strings.xml | 2 +- catroid/src/main/res/values-sd/strings.xml | 2 +- catroid/src/main/res/values-si/strings.xml | 2 +- catroid/src/main/res/values-sk/strings.xml | 2 +- catroid/src/main/res/values-sl/strings.xml | 2 +- catroid/src/main/res/values-sq/strings.xml | 2 +- .../src/main/res/values-sr-rCS/strings.xml | 2 +- .../src/main/res/values-sr-rSP/strings.xml | 2 +- catroid/src/main/res/values-sr/strings.xml | 2 +- catroid/src/main/res/values-sv/strings.xml | 2 +- catroid/src/main/res/values-sw/strings.xml | 2 +- catroid/src/main/res/values-ta/strings.xml | 2 +- catroid/src/main/res/values-te/strings.xml | 2 +- catroid/src/main/res/values-th/strings.xml | 2 +- catroid/src/main/res/values-tr/strings.xml | 2 +- catroid/src/main/res/values-tw/strings.xml | 2 +- catroid/src/main/res/values-uk/strings.xml | 2 +- catroid/src/main/res/values-ur/strings.xml | 2 +- catroid/src/main/res/values-vi/strings.xml | 2 +- .../src/main/res/values-zh-rCN/strings.xml | 2 +- .../src/main/res/values-zh-rTW/strings.xml | 2 +- catroid/src/main/res/values/strings.xml | 2 +- 70 files changed, 87 insertions(+), 79 deletions(-) diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/VisualPlacementBrickTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/VisualPlacementBrickTest.java index 1e9610919e2..df377b5aba9 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/VisualPlacementBrickTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/content/brick/app/VisualPlacementBrickTest.java @@ -23,6 +23,8 @@ package org.catrobat.catroid.uiespresso.content.brick.app; +import android.util.Log; + import org.catrobat.catroid.R; import org.catrobat.catroid.content.Script; import org.catrobat.catroid.content.bricks.GlideToBrick; @@ -44,6 +46,7 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; +import java.io.IOException; import java.util.Arrays; import java.util.Collection; @@ -64,6 +67,7 @@ @Category({Cat.AppUi.class, Level.Smoke.class}) @RunWith(Parameterized.class) public class VisualPlacementBrickTest { + private static final String TAG = VisualPlacementBrickTest.class.getSimpleName(); @Rule public FragmentActivityTestRule baseActivityTestRule = new @@ -87,11 +91,15 @@ public static Collection data() { public VisualPlacementBrick brick; @After - public void tearDown() throws Exception { + public void tearDown() { Intents.release(); resetFormulaFields(); baseActivityTestRule.finishActivity(); - TestUtils.deleteProjects(VisualPlacementBrickTest.class.getSimpleName()); + try { + TestUtils.deleteProjects(VisualPlacementBrickTest.class.getSimpleName()); + } catch (IOException e) { + Log.e(TAG, Log.getStackTraceString(e)); + } } private void resetFormulaFields() { @@ -113,7 +121,7 @@ public void testIsVisualPlacementShownForEditTextX() { onBrickAtPosition(1).checkShowsText(brickString); onView(withId(brick.getXEditTextId())) .perform(click()); - onView(withText(R.string.brick_place_at_option_place_visually)) + onView(withText(R.string.brick_option_place_visually)) .check(matches(isDisplayed())); onView(withText(R.string.brick_context_dialog_formula_edit_brick)) .check(matches(isDisplayed())); @@ -123,7 +131,7 @@ public void testIsVisualPlacementShownForEditTextX() { public void testIsVisualPlacementShownForEditTextY() { onView(withId(brick.getYEditTextId())) .perform(click()); - onView(withText(R.string.brick_place_at_option_place_visually)) + onView(withText(R.string.brick_option_place_visually)) .check(matches(isDisplayed())); onView(withText(R.string.brick_context_dialog_formula_edit_brick)) .check(matches(isDisplayed())); @@ -132,7 +140,7 @@ public void testIsVisualPlacementShownForEditTextY() { @Test public void testIsVisualPlacementShownOnBrickClick() { onBrickAtPosition(1).performClick(); - onView(withText(R.string.brick_place_at_option_place_visually)) + onView(withText(R.string.brick_option_place_visually)) .check(matches(isDisplayed())); } @@ -163,7 +171,7 @@ public void testVisualPlacementAfterNumberEntered() { onView(withId(brick.getXEditTextId())) .check(matches(withText("42 "))) .perform(click()); - onView(withText(R.string.brick_place_at_option_place_visually)) + onView(withText(R.string.brick_option_place_visually)) .check(matches(isDisplayed())); onView(withText(R.string.brick_context_dialog_formula_edit_brick)) .check(matches(isDisplayed())); @@ -173,7 +181,7 @@ public void testVisualPlacementAfterNumberEntered() { public void testIsVisualPlacementActivityShown() { onView(withId(brick.getXEditTextId())) .perform(click()); - onView(withText(R.string.brick_place_at_option_place_visually)) + onView(withText(R.string.brick_option_place_visually)) .perform(click()); intended(hasComponent(VisualPlacementActivity.class.getName())); } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/visualplacement/SpriteActivityVisualPlacementTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/visualplacement/SpriteActivityVisualPlacementTest.java index 2f7d78f9d23..da18c680dbc 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/visualplacement/SpriteActivityVisualPlacementTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/intents/visualplacement/SpriteActivityVisualPlacementTest.java @@ -100,7 +100,7 @@ public void testCorrectIntentsSend() { intending(anyIntent()).respondWith(intentResult); onView(withId(R.id.brick_place_at_edit_text_x)).perform(click()); - onView(withText(R.string.brick_place_at_option_place_visually)).perform(click()); + onView(withText(R.string.brick_option_place_visually)).perform(click()); intended(allOf(hasComponent(VisualPlacementActivity.class.getName()), hasExtra(EXTRA_X_TRANSFORM, XPOS))); intended(allOf(hasComponent(VisualPlacementActivity.class.getName()), hasExtra(EXTRA_Y_TRANSFORM, YPOS))); @@ -119,7 +119,7 @@ public void testCoordinatesSetAfterActivity() { intending(anyIntent()).respondWith(intentResult); onView(withId(R.id.brick_place_at_edit_text_x)).perform(click()); - onView(withText(R.string.brick_place_at_option_place_visually)).perform(click()); + onView(withText(R.string.brick_option_place_visually)).perform(click()); onView(withId(R.id.brick_place_at_edit_text_x)).check(matches(withText(XRETURN + " "))); onView(withId(R.id.brick_place_at_edit_text_y)).check(matches(withText(YRETURN + " "))); @@ -138,7 +138,7 @@ public void testNotInterpretableInput() { intending(anyIntent()).respondWith(intentResult); onView(withText(R.string.brick_place_at)).perform(click()); - onView(withText(R.string.brick_place_at_option_place_visually)).perform(click()); + onView(withText(R.string.brick_option_place_visually)).perform(click()); intended(allOf(hasComponent(VisualPlacementActivity.class.getName()), hasExtra(EXTRA_X_TRANSFORM, 0))); intended(allOf(hasComponent(VisualPlacementActivity.class.getName()), hasExtra(EXTRA_Y_TRANSFORM, 0))); } diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/VisualPlacementBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/VisualPlacementBrick.java index 101ee8b59cc..052a580c45d 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/bricks/VisualPlacementBrick.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/VisualPlacementBrick.java @@ -54,7 +54,7 @@ public void showFormulaEditorToEditFormula(View view) { if (showVisualPlacementDialog(view)) { String[] optionStrings = { - context.getString(R.string.brick_place_at_option_place_visually), + context.getString(R.string.brick_option_place_visually), context.getString(R.string.brick_context_dialog_formula_edit_brick)}; new AlertDialog.Builder(context).setItems(optionStrings, (dialog, which) -> { diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/ScriptFragment.java b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/ScriptFragment.java index 75ca40a5c13..d83a171ed0c 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/ScriptFragment.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/ScriptFragment.java @@ -495,7 +495,7 @@ private List getContextMenuItems(Brick brick) { ? R.string.brick_context_dialog_comment_in : R.string.brick_context_dialog_comment_out); if (brick instanceof VisualPlacementBrick) { - items.add(R.string.brick_place_at_option_place_visually); + items.add(R.string.brick_option_place_visually); } if (brick instanceof FormulaBrick) { items.add(R.string.brick_context_dialog_formula_edit_brick); @@ -547,7 +547,7 @@ private void handleContextMenuItemClick(int itemId, Brick brick, int position) { } adapter.notifyDataSetChanged(); break; - case R.string.brick_place_at_option_place_visually: + case R.string.brick_option_place_visually: VisualPlacementBrick visualPlacementBrick = (VisualPlacementBrick) brick; visualPlacementBrick.placeVisually(visualPlacementBrick.getXBrickField(), visualPlacementBrick.getYBrickField()); diff --git a/catroid/src/main/java/org/catrobat/catroid/visualplacement/VisualPlacementActivity.java b/catroid/src/main/java/org/catrobat/catroid/visualplacement/VisualPlacementActivity.java index 6c6474f1234..6f526f0f39e 100644 --- a/catroid/src/main/java/org/catrobat/catroid/visualplacement/VisualPlacementActivity.java +++ b/catroid/src/main/java/org/catrobat/catroid/visualplacement/VisualPlacementActivity.java @@ -140,7 +140,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { Toolbar toolbar = findViewById(R.id.transparent_toolbar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); - getSupportActionBar().setTitle(R.string.brick_place_at_option_place_visually); + getSupportActionBar().setTitle(R.string.brick_option_place_visually); File projectDir = new File(DEFAULT_ROOT_DIRECTORY, currentProject.getName()); File sceneDir = new File(projectDir, currentlyPlayingScene.getName()); diff --git a/catroid/src/main/res/values-af/strings.xml b/catroid/src/main/res/values-af/strings.xml index 5a91fb8ce88..244efce0dfe 100644 --- a/catroid/src/main/res/values-af/strings.xml +++ b/catroid/src/main/res/values-af/strings.xml @@ -958,7 +958,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "Set x to" diff --git a/catroid/src/main/res/values-ar/strings.xml b/catroid/src/main/res/values-ar/strings.xml index a65b1321064..20bd1e13127 100644 --- a/catroid/src/main/res/values-ar/strings.xml +++ b/catroid/src/main/res/values-ar/strings.xml @@ -1216,7 +1216,7 @@ "تحديد موقع الكائن في " - تحديد الموقع بصرياً + تحديد الموقع بصرياً "س: " "ص: " "تعيين قيمة س الى " diff --git a/catroid/src/main/res/values-az/strings.xml b/catroid/src/main/res/values-az/strings.xml index 4a953a82b9f..9d6d7c8e59d 100644 --- a/catroid/src/main/res/values-az/strings.xml +++ b/catroid/src/main/res/values-az/strings.xml @@ -948,7 +948,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "Set x to" diff --git a/catroid/src/main/res/values-bg/strings.xml b/catroid/src/main/res/values-bg/strings.xml index fef05f009ec..a68652becce 100644 --- a/catroid/src/main/res/values-bg/strings.xml +++ b/catroid/src/main/res/values-bg/strings.xml @@ -948,7 +948,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "Set x to" diff --git a/catroid/src/main/res/values-bn/strings.xml b/catroid/src/main/res/values-bn/strings.xml index e8d6c036e61..db787bc3fe7 100644 --- a/catroid/src/main/res/values-bn/strings.xml +++ b/catroid/src/main/res/values-bn/strings.xml @@ -913,7 +913,7 @@ "এ স্থান" - দর্শনীয়ভাবে রাখুন + দর্শনীয়ভাবে রাখুন "x:" "y:" "X সেট করুন" diff --git a/catroid/src/main/res/values-bs/strings.xml b/catroid/src/main/res/values-bs/strings.xml index 4bb7b282c16..43a23eecb5a 100644 --- a/catroid/src/main/res/values-bs/strings.xml +++ b/catroid/src/main/res/values-bs/strings.xml @@ -1006,7 +1006,7 @@ "Postavi na " - Place visually + Place visually "X: " "Y: " "Postavi X na " diff --git a/catroid/src/main/res/values-ca/strings.xml b/catroid/src/main/res/values-ca/strings.xml index 2eb8cc7acc9..c675d5fe885 100644 --- a/catroid/src/main/res/values-ca/strings.xml +++ b/catroid/src/main/res/values-ca/strings.xml @@ -948,7 +948,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "Set x to" diff --git a/catroid/src/main/res/values-cs/strings.xml b/catroid/src/main/res/values-cs/strings.xml index 77b796433f8..7f3dfef142e 100644 --- a/catroid/src/main/res/values-cs/strings.xml +++ b/catroid/src/main/res/values-cs/strings.xml @@ -1089,7 +1089,7 @@ "Umístěte na " - Place visually + Place visually "X: " "Y: " "Nastav x na " diff --git a/catroid/src/main/res/values-da/strings.xml b/catroid/src/main/res/values-da/strings.xml index 546a7095ed0..5e09d5e8262 100644 --- a/catroid/src/main/res/values-da/strings.xml +++ b/catroid/src/main/res/values-da/strings.xml @@ -948,7 +948,7 @@ "Placér ved" - Place visually + Place visually "X:" "Y:" "Sæt X til" diff --git a/catroid/src/main/res/values-de/strings.xml b/catroid/src/main/res/values-de/strings.xml index a9747b96f34..6a0eca9eefe 100644 --- a/catroid/src/main/res/values-de/strings.xml +++ b/catroid/src/main/res/values-de/strings.xml @@ -936,7 +936,7 @@ "Setze an Position " - Visuell platzieren + Visuell platzieren "x: " "y: " "Setze X auf" diff --git a/catroid/src/main/res/values-el/strings.xml b/catroid/src/main/res/values-el/strings.xml index cd18f2dab59..11a15a7709b 100644 --- a/catroid/src/main/res/values-el/strings.xml +++ b/catroid/src/main/res/values-el/strings.xml @@ -942,7 +942,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "Set x to" diff --git a/catroid/src/main/res/values-en-rAU/strings.xml b/catroid/src/main/res/values-en-rAU/strings.xml index 0147fe4c312..8ae86d909a5 100644 --- a/catroid/src/main/res/values-en-rAU/strings.xml +++ b/catroid/src/main/res/values-en-rAU/strings.xml @@ -948,7 +948,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "Set x to" diff --git a/catroid/src/main/res/values-en-rCA/strings.xml b/catroid/src/main/res/values-en-rCA/strings.xml index 13c266bfbd5..512e1b19a24 100644 --- a/catroid/src/main/res/values-en-rCA/strings.xml +++ b/catroid/src/main/res/values-en-rCA/strings.xml @@ -948,7 +948,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "Set x to" diff --git a/catroid/src/main/res/values-en-rGB/strings.xml b/catroid/src/main/res/values-en-rGB/strings.xml index d908a138fb4..9d67f198c04 100644 --- a/catroid/src/main/res/values-en-rGB/strings.xml +++ b/catroid/src/main/res/values-en-rGB/strings.xml @@ -948,7 +948,7 @@ "Place at " - Place visually + Place visually "X: " "Y: " "Set X to " diff --git a/catroid/src/main/res/values-es/strings.xml b/catroid/src/main/res/values-es/strings.xml index fedc246eb94..261851b3504 100644 --- a/catroid/src/main/res/values-es/strings.xml +++ b/catroid/src/main/res/values-es/strings.xml @@ -940,7 +940,7 @@ "Coloque en " - Place visually + Place visually "X: " "Y: " "Establezca X" diff --git a/catroid/src/main/res/values-fa/strings.xml b/catroid/src/main/res/values-fa/strings.xml index e5150b1e4b1..813487c0ea8 100644 --- a/catroid/src/main/res/values-fa/strings.xml +++ b/catroid/src/main/res/values-fa/strings.xml @@ -875,7 +875,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "Set x to" diff --git a/catroid/src/main/res/values-fi/strings.xml b/catroid/src/main/res/values-fi/strings.xml index 9a984bf9737..08192914f6e 100644 --- a/catroid/src/main/res/values-fi/strings.xml +++ b/catroid/src/main/res/values-fi/strings.xml @@ -948,7 +948,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "Set x to" diff --git a/catroid/src/main/res/values-fr/strings.xml b/catroid/src/main/res/values-fr/strings.xml index 0fbe3f879fe..ab2d744d5b4 100644 --- a/catroid/src/main/res/values-fr/strings.xml +++ b/catroid/src/main/res/values-fr/strings.xml @@ -944,7 +944,7 @@ "Positionner à " - Place visually + Place visually "x : " "y : " "Mettre X à " diff --git a/catroid/src/main/res/values-gl/strings.xml b/catroid/src/main/res/values-gl/strings.xml index 5b15635a616..7ba61d075b8 100644 --- a/catroid/src/main/res/values-gl/strings.xml +++ b/catroid/src/main/res/values-gl/strings.xml @@ -948,7 +948,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "Set x to" diff --git a/catroid/src/main/res/values-gu/strings.xml b/catroid/src/main/res/values-gu/strings.xml index 7babe871456..1920ae1a738 100644 --- a/catroid/src/main/res/values-gu/strings.xml +++ b/catroid/src/main/res/values-gu/strings.xml @@ -948,7 +948,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "Set x to" diff --git a/catroid/src/main/res/values-ha/strings.xml b/catroid/src/main/res/values-ha/strings.xml index 5a91fb8ce88..244efce0dfe 100644 --- a/catroid/src/main/res/values-ha/strings.xml +++ b/catroid/src/main/res/values-ha/strings.xml @@ -958,7 +958,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "Set x to" diff --git a/catroid/src/main/res/values-hi/strings.xml b/catroid/src/main/res/values-hi/strings.xml index 742bb875a1d..4178f82c289 100644 --- a/catroid/src/main/res/values-hi/strings.xml +++ b/catroid/src/main/res/values-hi/strings.xml @@ -945,7 +945,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "Set x to" diff --git a/catroid/src/main/res/values-hr/strings.xml b/catroid/src/main/res/values-hr/strings.xml index e8f38bbddb4..b6aac4d88e9 100644 --- a/catroid/src/main/res/values-hr/strings.xml +++ b/catroid/src/main/res/values-hr/strings.xml @@ -1013,7 +1013,7 @@ Ako se ne osjecate ugodno kako bi to ucinili, mozete koristiti nase besplatne we "Postavi na " - Place visually + Place visually "X: " "Y: " "Postavi X na " diff --git a/catroid/src/main/res/values-hu/strings.xml b/catroid/src/main/res/values-hu/strings.xml index 252b836b66c..53a1ec80a5e 100644 --- a/catroid/src/main/res/values-hu/strings.xml +++ b/catroid/src/main/res/values-hu/strings.xml @@ -948,7 +948,7 @@ "Ugorj " - Place visually + Place visually "X: " "Y: " "X legyen " diff --git a/catroid/src/main/res/values-ig/strings.xml b/catroid/src/main/res/values-ig/strings.xml index e5150b1e4b1..813487c0ea8 100644 --- a/catroid/src/main/res/values-ig/strings.xml +++ b/catroid/src/main/res/values-ig/strings.xml @@ -875,7 +875,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "Set x to" diff --git a/catroid/src/main/res/values-in/strings.xml b/catroid/src/main/res/values-in/strings.xml index b6026f6c845..80b6461f94d 100644 --- a/catroid/src/main/res/values-in/strings.xml +++ b/catroid/src/main/res/values-in/strings.xml @@ -873,7 +873,7 @@ "Tempatkan di " - Place visually + Place visually "X: " "Y: " "Set X ke " diff --git a/catroid/src/main/res/values-it/strings.xml b/catroid/src/main/res/values-it/strings.xml index 8a66d0fa2d2..b793ffe8d1e 100644 --- a/catroid/src/main/res/values-it/strings.xml +++ b/catroid/src/main/res/values-it/strings.xml @@ -947,7 +947,7 @@ "Posiziona a " - Posiziona in modo visuale + Posiziona in modo visuale "X: " "Y: " "Imposta X a " diff --git a/catroid/src/main/res/values-iw/strings.xml b/catroid/src/main/res/values-iw/strings.xml index 64b356c280a..223974e64e7 100644 --- a/catroid/src/main/res/values-iw/strings.xml +++ b/catroid/src/main/res/values-iw/strings.xml @@ -1094,7 +1094,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "קבע מיקום על ציר X " diff --git a/catroid/src/main/res/values-ja/strings.xml b/catroid/src/main/res/values-ja/strings.xml index 23d2d5ba704..46a88a71107 100644 --- a/catroid/src/main/res/values-ja/strings.xml +++ b/catroid/src/main/res/values-ja/strings.xml @@ -870,7 +870,7 @@ "配置:" - Place visually + Place visually "X:" "Y:" "Xを設定:" diff --git a/catroid/src/main/res/values-kk/strings.xml b/catroid/src/main/res/values-kk/strings.xml index 9a984bf9737..08192914f6e 100644 --- a/catroid/src/main/res/values-kk/strings.xml +++ b/catroid/src/main/res/values-kk/strings.xml @@ -948,7 +948,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "Set x to" diff --git a/catroid/src/main/res/values-kn/strings.xml b/catroid/src/main/res/values-kn/strings.xml index b73547aab44..c7e184fe29f 100644 --- a/catroid/src/main/res/values-kn/strings.xml +++ b/catroid/src/main/res/values-kn/strings.xml @@ -948,7 +948,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "Set x to" diff --git a/catroid/src/main/res/values-ko/strings.xml b/catroid/src/main/res/values-ko/strings.xml index f343530c3e9..5cc515ea74f 100644 --- a/catroid/src/main/res/values-ko/strings.xml +++ b/catroid/src/main/res/values-ko/strings.xml @@ -842,7 +842,7 @@ https://share.catrob.at/ website 여기를 통해 계정과 정보를 삭제할 "위치 설정" - 보이게 위치 + 보이게 위치 "X:" "Y:" "X좌표 정하기 :" diff --git a/catroid/src/main/res/values-lt/strings.xml b/catroid/src/main/res/values-lt/strings.xml index be458468013..9d50c1ac9b4 100644 --- a/catroid/src/main/res/values-lt/strings.xml +++ b/catroid/src/main/res/values-lt/strings.xml @@ -1094,7 +1094,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "Set x to" diff --git a/catroid/src/main/res/values-mk/strings.xml b/catroid/src/main/res/values-mk/strings.xml index 8d487093e06..954afa56e5f 100644 --- a/catroid/src/main/res/values-mk/strings.xml +++ b/catroid/src/main/res/values-mk/strings.xml @@ -948,7 +948,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "Set x to" diff --git a/catroid/src/main/res/values-ml/strings.xml b/catroid/src/main/res/values-ml/strings.xml index 8ba4ed8c009..062314eb632 100644 --- a/catroid/src/main/res/values-ml/strings.xml +++ b/catroid/src/main/res/values-ml/strings.xml @@ -948,7 +948,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "Set x to" diff --git a/catroid/src/main/res/values-ms/strings.xml b/catroid/src/main/res/values-ms/strings.xml index 442d11e6b95..e533f32f45b 100644 --- a/catroid/src/main/res/values-ms/strings.xml +++ b/catroid/src/main/res/values-ms/strings.xml @@ -875,7 +875,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "Set x to" diff --git a/catroid/src/main/res/values-nl/strings.xml b/catroid/src/main/res/values-nl/strings.xml index c7d95f4aeec..3e54c86bfc9 100644 --- a/catroid/src/main/res/values-nl/strings.xml +++ b/catroid/src/main/res/values-nl/strings.xml @@ -948,7 +948,7 @@ "Plaats op:" - Place visually + Place visually "X:" "Y:" "Maak X:" diff --git a/catroid/src/main/res/values-no/strings.xml b/catroid/src/main/res/values-no/strings.xml index 809a6472b8a..5898e6b1eb8 100644 --- a/catroid/src/main/res/values-no/strings.xml +++ b/catroid/src/main/res/values-no/strings.xml @@ -943,7 +943,7 @@ "Plasser " - Place visually + Place visually "X: " "Y: " "Sett X til " diff --git a/catroid/src/main/res/values-pl/strings.xml b/catroid/src/main/res/values-pl/strings.xml index f23cc6d537f..038577a4c55 100644 --- a/catroid/src/main/res/values-pl/strings.xml +++ b/catroid/src/main/res/values-pl/strings.xml @@ -1055,7 +1055,7 @@ "Idź do " - Place visually + Place visually "X: " "Y: " "Ustaw X na " diff --git a/catroid/src/main/res/values-ps/strings.xml b/catroid/src/main/res/values-ps/strings.xml index 1ab2eaded41..83fd2ba60da 100644 --- a/catroid/src/main/res/values-ps/strings.xml +++ b/catroid/src/main/res/values-ps/strings.xml @@ -948,7 +948,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "Set x to" diff --git a/catroid/src/main/res/values-pt-rBR/strings.xml b/catroid/src/main/res/values-pt-rBR/strings.xml index e4f45e9bfd3..2084c37fdde 100644 --- a/catroid/src/main/res/values-pt-rBR/strings.xml +++ b/catroid/src/main/res/values-pt-rBR/strings.xml @@ -944,7 +944,7 @@ "Colocar em " - Place visually + Place visually "X: " "Y: " "Definir X como " diff --git a/catroid/src/main/res/values-pt/strings.xml b/catroid/src/main/res/values-pt/strings.xml index ba1d064667f..15114e34523 100644 --- a/catroid/src/main/res/values-pt/strings.xml +++ b/catroid/src/main/res/values-pt/strings.xml @@ -944,7 +944,7 @@ "Posicionar em " - Place visually + Place visually "X: " "Y: " "Definir X como " diff --git a/catroid/src/main/res/values-ro/strings.xml b/catroid/src/main/res/values-ro/strings.xml index 2f090f75d95..d40bc1e9293 100644 --- a/catroid/src/main/res/values-ro/strings.xml +++ b/catroid/src/main/res/values-ro/strings.xml @@ -1021,7 +1021,7 @@ "Pune la " - Place visually + Place visually "X: " "Y:" "Setează X la:" diff --git a/catroid/src/main/res/values-ru/strings.xml b/catroid/src/main/res/values-ru/strings.xml index dcdffd2b847..bf456e75bcd 100644 --- a/catroid/src/main/res/values-ru/strings.xml +++ b/catroid/src/main/res/values-ru/strings.xml @@ -1091,7 +1091,7 @@ "Поместить в " - Поместить на глаз + Поместить на глаз "X: " "Y:" "Установить X в " diff --git a/catroid/src/main/res/values-sd/strings.xml b/catroid/src/main/res/values-sd/strings.xml index 8a34524c499..5b824c6bab9 100644 --- a/catroid/src/main/res/values-sd/strings.xml +++ b/catroid/src/main/res/values-sd/strings.xml @@ -948,7 +948,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "Set x to" diff --git a/catroid/src/main/res/values-si/strings.xml b/catroid/src/main/res/values-si/strings.xml index 0d587e0ed6b..3b356278ea0 100644 --- a/catroid/src/main/res/values-si/strings.xml +++ b/catroid/src/main/res/values-si/strings.xml @@ -948,7 +948,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "Set x to" diff --git a/catroid/src/main/res/values-sk/strings.xml b/catroid/src/main/res/values-sk/strings.xml index 943652acf08..6457de5c6a1 100644 --- a/catroid/src/main/res/values-sk/strings.xml +++ b/catroid/src/main/res/values-sk/strings.xml @@ -1089,7 +1089,7 @@ "Umiestni na " - Place visually + Place visually "X: " "Y: " "Nastav X na " diff --git a/catroid/src/main/res/values-sl/strings.xml b/catroid/src/main/res/values-sl/strings.xml index b2a592dd6c6..c3c90c7a264 100644 --- a/catroid/src/main/res/values-sl/strings.xml +++ b/catroid/src/main/res/values-sl/strings.xml @@ -1094,7 +1094,7 @@ "Natsavi na " - Place visually + Place visually "X: " "Y: " "Nastavi X " diff --git a/catroid/src/main/res/values-sq/strings.xml b/catroid/src/main/res/values-sq/strings.xml index 2af2fb50eda..2a13c153d54 100644 --- a/catroid/src/main/res/values-sq/strings.xml +++ b/catroid/src/main/res/values-sq/strings.xml @@ -948,7 +948,7 @@ "Place at" - Place visually + Place visually "X: " "Y: " "Set x to" diff --git a/catroid/src/main/res/values-sr-rCS/strings.xml b/catroid/src/main/res/values-sr-rCS/strings.xml index e52e98c85a6..38302bba5fb 100644 --- a/catroid/src/main/res/values-sr-rCS/strings.xml +++ b/catroid/src/main/res/values-sr-rCS/strings.xml @@ -1021,7 +1021,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "Set x to" diff --git a/catroid/src/main/res/values-sr-rSP/strings.xml b/catroid/src/main/res/values-sr-rSP/strings.xml index cdc9f5d9fbb..26ffaa468a3 100644 --- a/catroid/src/main/res/values-sr-rSP/strings.xml +++ b/catroid/src/main/res/values-sr-rSP/strings.xml @@ -1010,7 +1010,7 @@ "Постави на" - Постави визуално + Постави визуално "x:" "y:" "Постави x на" diff --git a/catroid/src/main/res/values-sr/strings.xml b/catroid/src/main/res/values-sr/strings.xml index 40e6e2d65b1..d44ff19dd3c 100644 --- a/catroid/src/main/res/values-sr/strings.xml +++ b/catroid/src/main/res/values-sr/strings.xml @@ -1031,7 +1031,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "Set x to" diff --git a/catroid/src/main/res/values-sv/strings.xml b/catroid/src/main/res/values-sv/strings.xml index 92743e7d74e..d1a3eb17d6f 100644 --- a/catroid/src/main/res/values-sv/strings.xml +++ b/catroid/src/main/res/values-sv/strings.xml @@ -948,7 +948,7 @@ "Placera vid " - Place visually + Place visually "X: " "Y: " "Sätt X till " diff --git a/catroid/src/main/res/values-sw/strings.xml b/catroid/src/main/res/values-sw/strings.xml index ebf7b7789c0..13a3867cdc5 100644 --- a/catroid/src/main/res/values-sw/strings.xml +++ b/catroid/src/main/res/values-sw/strings.xml @@ -943,7 +943,7 @@ "Weka " - Place visually + Place visually "X: " "Y: " "Weka X iwe" diff --git a/catroid/src/main/res/values-ta/strings.xml b/catroid/src/main/res/values-ta/strings.xml index ada4826958b..f9f9de206d1 100644 --- a/catroid/src/main/res/values-ta/strings.xml +++ b/catroid/src/main/res/values-ta/strings.xml @@ -937,7 +937,7 @@ "இடத்தில்" - பார்வைக்கு வைக்கவும் + பார்வைக்கு வைக்கவும் "x:" "y:" "Set x to" diff --git a/catroid/src/main/res/values-te/strings.xml b/catroid/src/main/res/values-te/strings.xml index b212d600926..9ea5bb608a9 100644 --- a/catroid/src/main/res/values-te/strings.xml +++ b/catroid/src/main/res/values-te/strings.xml @@ -948,7 +948,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "Set x to" diff --git a/catroid/src/main/res/values-th/strings.xml b/catroid/src/main/res/values-th/strings.xml index 2dfbe1efdf5..0a6b9bc9077 100644 --- a/catroid/src/main/res/values-th/strings.xml +++ b/catroid/src/main/res/values-th/strings.xml @@ -813,7 +813,7 @@ A-8010 กราซ, ออสเตรีย \n "วางที่" - วางสายตา + วางสายตา "X: " "Y: " "ตั้งค่า X เป็น" diff --git a/catroid/src/main/res/values-tr/strings.xml b/catroid/src/main/res/values-tr/strings.xml index cedb68977ef..229da626f5b 100644 --- a/catroid/src/main/res/values-tr/strings.xml +++ b/catroid/src/main/res/values-tr/strings.xml @@ -945,7 +945,7 @@ "Yerleştirin " - Place visually + Place visually "X: " "Y: " " X'e deger ver" diff --git a/catroid/src/main/res/values-tw/strings.xml b/catroid/src/main/res/values-tw/strings.xml index 5a91fb8ce88..244efce0dfe 100644 --- a/catroid/src/main/res/values-tw/strings.xml +++ b/catroid/src/main/res/values-tw/strings.xml @@ -958,7 +958,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "Set x to" diff --git a/catroid/src/main/res/values-uk/strings.xml b/catroid/src/main/res/values-uk/strings.xml index c2ee7241eb1..df2687a31cc 100644 --- a/catroid/src/main/res/values-uk/strings.xml +++ b/catroid/src/main/res/values-uk/strings.xml @@ -1094,7 +1094,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "Set x to" diff --git a/catroid/src/main/res/values-ur/strings.xml b/catroid/src/main/res/values-ur/strings.xml index 06857af2d29..378773177e2 100644 --- a/catroid/src/main/res/values-ur/strings.xml +++ b/catroid/src/main/res/values-ur/strings.xml @@ -1004,7 +1004,7 @@ "جگہ رکھیں" - بظاہر جگہ رکھیں + بظاہر جگہ رکھیں "ایکس:" "وائے: " "ایکس سیٹ کریں" diff --git a/catroid/src/main/res/values-vi/strings.xml b/catroid/src/main/res/values-vi/strings.xml index 499c3db58c3..b8fcfe0fab1 100644 --- a/catroid/src/main/res/values-vi/strings.xml +++ b/catroid/src/main/res/values-vi/strings.xml @@ -875,7 +875,7 @@ "Đặt tại " - Place visually + Place visually "X: " "Y: " "Thiết lập X tới " diff --git a/catroid/src/main/res/values-zh-rCN/strings.xml b/catroid/src/main/res/values-zh-rCN/strings.xml index e2defd3d06f..19ceed9012c 100644 --- a/catroid/src/main/res/values-zh-rCN/strings.xml +++ b/catroid/src/main/res/values-zh-rCN/strings.xml @@ -862,7 +862,7 @@ "放在 " - Place visually + Place visually "X: " "Y: " "设置X坐标为 " diff --git a/catroid/src/main/res/values-zh-rTW/strings.xml b/catroid/src/main/res/values-zh-rTW/strings.xml index 48f06ca6e8d..83b14f28df7 100644 --- a/catroid/src/main/res/values-zh-rTW/strings.xml +++ b/catroid/src/main/res/values-zh-rTW/strings.xml @@ -875,7 +875,7 @@ "放置座標 " - Place visually + Place visually "X: " "Y: " "更改 X 座標到 " diff --git a/catroid/src/main/res/values/strings.xml b/catroid/src/main/res/values/strings.xml index fa4ed03aae8..a8680623426 100644 --- a/catroid/src/main/res/values/strings.xml +++ b/catroid/src/main/res/values/strings.xml @@ -1054,7 +1054,7 @@ "Place at" - Place visually + Place visually "x:" "y:" "Set x to" From b3921ec0c133f4652c28ff8eefcda6cfdaddc3fe Mon Sep 17 00:00:00 2001 From: Michelle Perkonigg Date: Sun, 3 Nov 2019 14:26:33 +0100 Subject: [PATCH 14/16] CATROID-396 Start triple stitch with length 10 --- .../catroid/test/BricksHelpUrlTest.java | 2 + .../content/bricks/BrickCategoryTest.java | 2 + .../bricks/BrickFormulaDefaultValueTest.java | 2 + .../embroidery/TripleRunningStitchTest.java | 91 ++++++++++++++++ .../catrobat/catroid/common/Constants.java | 2 +- .../catroid/content/ActionFactory.java | 8 ++ .../content/actions/TripleStitchAction.java | 61 +++++++++++ .../content/bricks/TripleStitchBrick.java | 59 +++++++++++ .../embroidery/TripleRunningStitch.java | 100 ++++++++++++++++++ .../catroid/io/XstreamSerializer.java | 4 +- .../ui/fragment/CategoryBricksFactory.java | 2 + .../main/res/layout/brick_triple_stitch.xml | 60 +++++++++++ catroid/src/main/res/values/strings.xml | 1 + 13 files changed, 392 insertions(+), 2 deletions(-) create mode 100644 catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/TripleRunningStitchTest.java create mode 100644 catroid/src/main/java/org/catrobat/catroid/content/actions/TripleStitchAction.java create mode 100644 catroid/src/main/java/org/catrobat/catroid/content/bricks/TripleStitchBrick.java create mode 100644 catroid/src/main/java/org/catrobat/catroid/embroidery/TripleRunningStitch.java create mode 100644 catroid/src/main/res/layout/brick_triple_stitch.xml diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/BricksHelpUrlTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/BricksHelpUrlTest.java index a500e56d93f..7e4498aec63 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/BricksHelpUrlTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/BricksHelpUrlTest.java @@ -384,6 +384,8 @@ public class BricksHelpUrlTest { "https://wiki.catrobat.org/bin/view/Documentation/Brick%20Documentation/Embroidery%20Bricks/#StopRunningStitchBrick"); brickToHelpUrlMapping.put("org.catrobat.catroid.content.bricks.ZigZagStitchBrick", "https://wiki.catrobat.org/bin/view/Documentation/Brick%20Documentation/Embroidery%20Bricks/#ZigZagStitchBrick"); + brickToHelpUrlMapping.put("org.catrobat.catroid.content.bricks.TripleStitchBrick", + "https://wiki.catrobat.org/bin/view/Documentation/Brick%20Documentation/Embroidery%20Bricks/#TripleStitchBrick"); } @Parameterized.Parameters(name = "{0}") diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickCategoryTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickCategoryTest.java index cdb25f21fa5..f9a8911d0f6 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickCategoryTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickCategoryTest.java @@ -168,6 +168,7 @@ import org.catrobat.catroid.content.bricks.TapAtBrick; import org.catrobat.catroid.content.bricks.ThinkBubbleBrick; import org.catrobat.catroid.content.bricks.ThinkForBubbleBrick; +import org.catrobat.catroid.content.bricks.TripleStitchBrick; import org.catrobat.catroid.content.bricks.TurnLeftBrick; import org.catrobat.catroid.content.bricks.TurnLeftSpeedBrick; import org.catrobat.catroid.content.bricks.TurnRightBrick; @@ -239,6 +240,7 @@ public static Collection data() { {"Embroidery", Arrays.asList(StitchBrick.class, RunningStitchBrick.class, ZigZagStitchBrick.class, + TripleStitchBrick.class, StopRunningStitchBrick.class)}, {"Event", Arrays.asList(WhenStartedBrick.class, WhenBrick.class, diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickFormulaDefaultValueTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickFormulaDefaultValueTest.java index 02f8acfa2ac..cf7244c3164 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickFormulaDefaultValueTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/content/bricks/BrickFormulaDefaultValueTest.java @@ -92,6 +92,7 @@ import org.catrobat.catroid.content.bricks.ShowTextBrick; import org.catrobat.catroid.content.bricks.ThinkBubbleBrick; import org.catrobat.catroid.content.bricks.ThinkForBubbleBrick; +import org.catrobat.catroid.content.bricks.TripleStitchBrick; import org.catrobat.catroid.content.bricks.TurnLeftBrick; import org.catrobat.catroid.content.bricks.TurnRightBrick; import org.catrobat.catroid.content.bricks.VibrationBrick; @@ -211,6 +212,7 @@ public static Collection data() { {"ZigZagStitchBrick - R.id.brick_zigzag_stitch_edit_text_density", "Embroidery", ZigZagStitchBrick.class, R.id.brick_zigzag_stitch_edit_text_length, "2 "}, {"ZigZagStitchBrick - R.id.brick_zigzag_stitch_edit_text_height", "Embroidery", ZigZagStitchBrick.class, R.id.brick_zigzag_stitch_edit_text_width, "10 "}, {"RunningStitchBrick - R.id.brick_running_stitch_edit_text_steps", "Embroidery", RunningStitchBrick.class, R.id.brick_running_stitch_edit_text_length, "10 "}, + {"RunningStitchBrick - R.id.brick_running_stitch_edit_text_steps", "Embroidery", TripleStitchBrick.class, R.id.brick_triple_stitch_edit_text_steps, "10 "}, }); } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/TripleRunningStitchTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/TripleRunningStitchTest.java new file mode 100644 index 00000000000..85a6b21dea7 --- /dev/null +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/embroidery/TripleRunningStitchTest.java @@ -0,0 +1,91 @@ +/* + * Catroid: An on-device visual programming system for Android devices + * Copyright (C) 2010-2019 The Catrobat Team + * () + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * An additional term exception under section 7 of the GNU Affero + * General Public License, version 3, is available at + * http://developer.catrobat.org/license_additional_term + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package org.catrobat.catroid.test.embroidery; + +import org.catrobat.catroid.content.Look; +import org.catrobat.catroid.content.Sprite; +import org.catrobat.catroid.embroidery.EmbroideryPatternManager; +import org.catrobat.catroid.embroidery.TripleRunningStitch; +import org.catrobat.catroid.stage.StageActivity; +import org.catrobat.catroid.stage.StageListener; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; + +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +@RunWith(AndroidJUnit4.class) +public class TripleRunningStitchTest { + private Sprite sprite; + private TripleRunningStitch tripleRunningStitch; + private EmbroideryPatternManager embroideryPatternManager; + + @Before + public void setUp() { + sprite = Mockito.mock(Sprite.class); + sprite.look = Mockito.mock(Look.class); + embroideryPatternManager = Mockito.mock(EmbroideryPatternManager.class); + StageActivity.stageListener = Mockito.mock(StageListener.class); + StageActivity.stageListener.embroideryPatternManager = embroideryPatternManager; + } + + @After + public void tearDown() { + StageActivity.stageListener = null; + } + + @Test + public void testNoMoveOfRunningStitch() { + final int steps = 10; + tripleRunningStitch = new TripleRunningStitch(sprite, steps); + tripleRunningStitch.update(0, 0); + + verify(embroideryPatternManager, times(0)).addStitchCommand(any()); + } + + @Test + public void testSimpleMoveOfRunningStitch() { + final int steps = 10; + tripleRunningStitch = new TripleRunningStitch(sprite, steps); + tripleRunningStitch.update(10, 10); + + verify(embroideryPatternManager, times(4)).addStitchCommand(any()); + } + + @Test + public void testSetStartCoordinates() { + final int steps = 10; + tripleRunningStitch = new TripleRunningStitch(sprite, steps); + tripleRunningStitch.setStartCoordinates(20, 20); + tripleRunningStitch.update(0, 0); + + verify(embroideryPatternManager, times(7)).addStitchCommand(any()); + } +} diff --git a/catroid/src/main/java/org/catrobat/catroid/common/Constants.java b/catroid/src/main/java/org/catrobat/catroid/common/Constants.java index 52e23ceb7b9..7828ad29304 100644 --- a/catroid/src/main/java/org/catrobat/catroid/common/Constants.java +++ b/catroid/src/main/java/org/catrobat/catroid/common/Constants.java @@ -38,7 +38,7 @@ public final class Constants { - public static final float CURRENT_CATROBAT_LANGUAGE_VERSION = 0.99996f; + public static final float CURRENT_CATROBAT_LANGUAGE_VERSION = 0.99997f; public static final String REMOTE_DISPLAY_APP_ID = "CEBB9229"; public static final int CAST_CONNECTION_TIMEOUT = 5000; //in milliseconds diff --git a/catroid/src/main/java/org/catrobat/catroid/content/ActionFactory.java b/catroid/src/main/java/org/catrobat/catroid/content/ActionFactory.java index 81c379f5753..76189ae3b80 100644 --- a/catroid/src/main/java/org/catrobat/catroid/content/ActionFactory.java +++ b/catroid/src/main/java/org/catrobat/catroid/content/ActionFactory.java @@ -157,6 +157,7 @@ import org.catrobat.catroid.content.actions.StopThisScriptAction; import org.catrobat.catroid.content.actions.TapAtAction; import org.catrobat.catroid.content.actions.ThinkSayBubbleAction; +import org.catrobat.catroid.content.actions.TripleStitchAction; import org.catrobat.catroid.content.actions.TurnLeftAction; import org.catrobat.catroid.content.actions.TurnRightAction; import org.catrobat.catroid.content.actions.VibrateAction; @@ -867,6 +868,13 @@ public Action createRunningStitchAction(Sprite sprite, Formula length) { return action; } + public Action createTripleStitchAction(Sprite sprite, Formula steps) { + TripleStitchAction action = Actions.action(TripleStitchAction.class); + action.setSprite(sprite); + action.setSteps(steps); + return action; + } + public Action createZigZagStitchAction(Sprite sprite, Formula length, Formula width) { ZigZagStitchAction action = Actions.action(ZigZagStitchAction.class); action.setSprite(sprite); diff --git a/catroid/src/main/java/org/catrobat/catroid/content/actions/TripleStitchAction.java b/catroid/src/main/java/org/catrobat/catroid/content/actions/TripleStitchAction.java new file mode 100644 index 00000000000..48ced637393 --- /dev/null +++ b/catroid/src/main/java/org/catrobat/catroid/content/actions/TripleStitchAction.java @@ -0,0 +1,61 @@ +/* + * Catroid: An on-device visual programming system for Android devices + * Copyright (C) 2010-2018 The Catrobat Team + * () + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * An additional term exception under section 7 of the GNU Affero + * General Public License, version 3, is available at + * http://developer.catrobat.org/license_additional_term + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package org.catrobat.catroid.content.actions; + +import android.util.Log; + +import com.badlogic.gdx.scenes.scene2d.actions.TemporalAction; + +import org.catrobat.catroid.content.Sprite; +import org.catrobat.catroid.embroidery.TripleRunningStitch; +import org.catrobat.catroid.formulaeditor.Formula; +import org.catrobat.catroid.formulaeditor.InterpretationException; + +public class TripleStitchAction extends TemporalAction { + + private Sprite sprite; + private Formula steps; + + @Override + protected void update(float delta) { + int stepsInterpretation = 0; + try { + if (steps != null) { + stepsInterpretation = steps.interpretInteger(sprite); + } + } catch (InterpretationException interpretationException) { + stepsInterpretation = 0; + Log.d(getClass().getSimpleName(), "Formula interpretation for this specific Brick failed.", interpretationException); + } + this.sprite.runningStitch.activateStitching(sprite, new TripleRunningStitch(sprite, + stepsInterpretation)); + } + + public void setSprite(Sprite sprite) { + this.sprite = sprite; + } + + public void setSteps(Formula steps) { + this.steps = steps; + } +} diff --git a/catroid/src/main/java/org/catrobat/catroid/content/bricks/TripleStitchBrick.java b/catroid/src/main/java/org/catrobat/catroid/content/bricks/TripleStitchBrick.java new file mode 100644 index 00000000000..78578ded451 --- /dev/null +++ b/catroid/src/main/java/org/catrobat/catroid/content/bricks/TripleStitchBrick.java @@ -0,0 +1,59 @@ +/* + * Catroid: An on-device visual programming system for Android devices + * Copyright (C) 2010-2018 The Catrobat Team + * () + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * An additional term exception under section 7 of the GNU Affero + * General Public License, version 3, is available at + * http://developer.catrobat.org/license_additional_term + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package org.catrobat.catroid.content.bricks; + +import org.catrobat.catroid.R; +import org.catrobat.catroid.content.Sprite; +import org.catrobat.catroid.content.actions.ScriptSequenceAction; +import org.catrobat.catroid.formulaeditor.Formula; + +public class TripleStitchBrick extends FormulaBrick { + + private static final long serialVersionUID = 1L; + + public TripleStitchBrick() { + addAllowedBrickField(BrickField.EMBROIDERY_LENGTH, + R.id.brick_triple_stitch_edit_text_steps); + } + + public TripleStitchBrick(Formula steps) { + this(); + setFormulaWithBrickField(BrickField.EMBROIDERY_LENGTH, steps); + } + + @Override + public BrickField getDefaultBrickField() { + return BrickField.EMBROIDERY_LENGTH; + } + + @Override + public int getViewResource() { + return R.layout.brick_triple_stitch; + } + + @Override + public void addActionToSequence(Sprite sprite, ScriptSequenceAction sequence) { + sequence.addAction(sprite.getActionFactory().createTripleStitchAction(sprite, + getFormulaWithBrickField(BrickField.EMBROIDERY_LENGTH))); + } +} diff --git a/catroid/src/main/java/org/catrobat/catroid/embroidery/TripleRunningStitch.java b/catroid/src/main/java/org/catrobat/catroid/embroidery/TripleRunningStitch.java new file mode 100644 index 00000000000..22024a335a2 --- /dev/null +++ b/catroid/src/main/java/org/catrobat/catroid/embroidery/TripleRunningStitch.java @@ -0,0 +1,100 @@ +/* + * Catroid: An on-device visual programming system for Android devices + * Copyright (C) 2010-2019 The Catrobat Team + * () + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * An additional term exception under section 7 of the GNU Affero + * General Public License, version 3, is available at + * http://developer.catrobat.org/license_additional_term + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package org.catrobat.catroid.embroidery; + +import org.catrobat.catroid.content.Sprite; +import org.catrobat.catroid.stage.StageActivity; + +public class TripleRunningStitch implements RunningStitchType { + private Sprite sprite; + private int steps; + private boolean first; + private float firstX = 0; + private float firstY = 0; + + public TripleRunningStitch(Sprite sprite, int steps) { + this.sprite = sprite; + this.steps = steps; + first = true; + setStartCoordinates(sprite.look.getXInUserInterfaceDimensionUnit(), + sprite.look.getYInUserInterfaceDimensionUnit()); + } + + @Override + public void setStartCoordinates(float x, float y) { + this.firstX = x; + this.firstY = y; + } + + @Override + public void update(float currentX, float currentY) { + float distance = getDistanceToPoint(currentX, currentY); + if (distance >= steps) { + float surplusPercentage = ((distance - (distance % steps)) / distance); + currentX = firstX + (surplusPercentage * (currentX - firstX)); + currentY = firstY + (surplusPercentage * (currentY - firstY)); + distance -= distance % steps; + + int interpolationCount = (int) (Math.floor(distance / steps)); + interpolateStitches(interpolationCount, currentX, currentY); + setStartCoordinates(currentX, currentY); + } + } + + private void interpolateStitches(int interpolationCount, float currentX, float currentY) { + if (first) { + first = false; + StageActivity.stageListener.embroideryPatternManager.addStitchCommand(new DSTStitchCommand(firstX, firstY, + sprite.look.getZIndex(), sprite)); + } + float previousX = firstX; + float previousY = firstY; + + for (int count = 1; count <= interpolationCount; count++) { + float splitFactor = (float) count / interpolationCount; + float x = interpolate(currentX, firstX, splitFactor); + float y = interpolate(currentY, firstY, splitFactor); + StageActivity.stageListener.embroideryPatternManager.addStitchCommand(new DSTStitchCommand(x, y, + sprite.look.getZIndex(), sprite)); + StageActivity.stageListener.embroideryPatternManager.addStitchCommand(new DSTStitchCommand(previousX, previousY, + sprite.look.getZIndex(), sprite)); + StageActivity.stageListener.embroideryPatternManager.addStitchCommand(new DSTStitchCommand(x, y, + sprite.look.getZIndex(), sprite)); + previousX = x; + previousY = y; + } + } + + private float interpolate(float endValue, float startValue, float percentage) { + float value = Math.round(startValue + percentage * (endValue - startValue)); + return value; + } + + private float getDistanceToPoint(float currentX, float currentY) { + double xDistance = Math.pow(currentX - firstX, 2); + double yDistance = Math.pow(currentY - firstY, 2); + double difference = Math.sqrt(xDistance + yDistance); + return (float) difference; + } +} diff --git a/catroid/src/main/java/org/catrobat/catroid/io/XstreamSerializer.java b/catroid/src/main/java/org/catrobat/catroid/io/XstreamSerializer.java index 1a019f14379..1353a8c5287 100644 --- a/catroid/src/main/java/org/catrobat/catroid/io/XstreamSerializer.java +++ b/catroid/src/main/java/org/catrobat/catroid/io/XstreamSerializer.java @@ -206,6 +206,7 @@ import org.catrobat.catroid.content.bricks.TapAtBrick; import org.catrobat.catroid.content.bricks.ThinkBubbleBrick; import org.catrobat.catroid.content.bricks.ThinkForBubbleBrick; +import org.catrobat.catroid.content.bricks.TripleStitchBrick; import org.catrobat.catroid.content.bricks.TurnLeftBrick; import org.catrobat.catroid.content.bricks.TurnLeftSpeedBrick; import org.catrobat.catroid.content.bricks.TurnRightBrick; @@ -513,9 +514,10 @@ private void prepareXstream(Class projectClass, Class sceneClass) { xstream.alias("brick", SetTextBrick.class); xstream.alias("brick", ShowTextColorSizeAlignmentBrick.class); xstream.alias("brick", StitchBrick.class); - xstream.alias("brick", StopRunningStitchBrick.class); xstream.alias("brick", RunningStitchBrick.class); + xstream.alias("brick", StopRunningStitchBrick.class); xstream.alias("brick", ZigZagStitchBrick.class); + xstream.alias("brick", TripleStitchBrick.class); xstream.alias("brick", WaitTillIdleBrick.class); xstream.alias("brick", WhenRaspiPinChangedBrick.class); xstream.alias("brick", WhenTouchDownBrick.class); diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/CategoryBricksFactory.java b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/CategoryBricksFactory.java index 1583e05c1d2..4ad0966b0e6 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/CategoryBricksFactory.java +++ b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/CategoryBricksFactory.java @@ -179,6 +179,7 @@ import org.catrobat.catroid.content.bricks.TapAtBrick; import org.catrobat.catroid.content.bricks.ThinkBubbleBrick; import org.catrobat.catroid.content.bricks.ThinkForBubbleBrick; +import org.catrobat.catroid.content.bricks.TripleStitchBrick; import org.catrobat.catroid.content.bricks.TurnLeftBrick; import org.catrobat.catroid.content.bricks.TurnLeftSpeedBrick; import org.catrobat.catroid.content.bricks.TurnRightBrick; @@ -652,6 +653,7 @@ private List setupEmbroideryCategoryList() { embroideryBrickList.add(new RunningStitchBrick(new Formula(BrickValues.STITCH_LENGTH))); embroideryBrickList.add(new ZigZagStitchBrick(new Formula(BrickValues.ZIGZAG_STITCH_LENGTH), new Formula(BrickValues.ZIGZAG_STITCH_WIDTH))); + embroideryBrickList.add(new TripleStitchBrick(new Formula(BrickValues.STITCH_LENGTH))); embroideryBrickList.add(new StopRunningStitchBrick()); return embroideryBrickList; } diff --git a/catroid/src/main/res/layout/brick_triple_stitch.xml b/catroid/src/main/res/layout/brick_triple_stitch.xml new file mode 100644 index 00000000000..68248d13206 --- /dev/null +++ b/catroid/src/main/res/layout/brick_triple_stitch.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/catroid/src/main/res/values/strings.xml b/catroid/src/main/res/values/strings.xml index 3bcde6083d5..19fc68181fa 100644 --- a/catroid/src/main/res/values/strings.xml +++ b/catroid/src/main/res/values/strings.xml @@ -1175,6 +1175,7 @@ Start running stitch with length Start zigzag stitch with length and width + Start triple stitch with length Stop current stitch From 712e5127d309c524d46cdc7d626eca0d5d96ead1 Mon Sep 17 00:00:00 2001 From: Dominik Scheiber Date: Thu, 20 Feb 2020 13:08:56 +0100 Subject: [PATCH 15/16] Increased version code and number --- catroid/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/catroid/build.gradle b/catroid/build.gradle index 734dbe55eff..d28bf808ff8 100644 --- a/catroid/build.gradle +++ b/catroid/build.gradle @@ -133,8 +133,8 @@ android { targetSdkVersion 28 applicationId appId testInstrumentationRunner 'org.catrobat.catroid.runner.UiTestApplicationRunner' - versionCode 72 - versionName "0.9.68" + versionCode 73 + versionName "0.9.69" println "VersionCode is $versionCode" println "VersionName is $versionName" multiDexEnabled true From f2649ab727ff6daacb511b5a7ba302806989df96 Mon Sep 17 00:00:00 2001 From: Dominik Scheiber Date: Thu, 20 Feb 2020 13:16:12 +0100 Subject: [PATCH 16/16] Import latest Crowdin translations --- catroid/src/main/res/values-ar/strings.xml | 8 +- catroid/src/main/res/values-az/strings.xml | 6 +- catroid/src/main/res/values-bg/strings.xml | 6 +- catroid/src/main/res/values-bs/strings.xml | 153 +- catroid/src/main/res/values-ca/strings.xml | 6 +- catroid/src/main/res/values-cs/strings.xml | 6 +- catroid/src/main/res/values-da/strings.xml | 6 +- catroid/src/main/res/values-de/strings.xml | 139 +- catroid/src/main/res/values-el/strings.xml | 6 +- .../src/main/res/values-en-rAU/strings.xml | 6 +- .../src/main/res/values-en-rCA/strings.xml | 6 +- .../src/main/res/values-en-rGB/strings.xml | 6 +- catroid/src/main/res/values-es/strings.xml | 61 +- catroid/src/main/res/values-fa/strings.xml | 6 +- catroid/src/main/res/values-fi/strings.xml | 6 +- catroid/src/main/res/values-fr/strings.xml | 6 +- catroid/src/main/res/values-gl/strings.xml | 6 +- catroid/src/main/res/values-gu/strings.xml | 6 +- catroid/src/main/res/values-hi/strings.xml | 6 +- catroid/src/main/res/values-hr/strings.xml | 6 +- catroid/src/main/res/values-hu/strings.xml | 6 +- catroid/src/main/res/values-ig/strings.xml | 6 +- catroid/src/main/res/values-in/strings.xml | 6 +- catroid/src/main/res/values-it/strings.xml | 116 +- catroid/src/main/res/values-iw/strings.xml | 6 +- catroid/src/main/res/values-ja/strings.xml | 6 +- catroid/src/main/res/values-kk/strings.xml | 6 +- catroid/src/main/res/values-kn/strings.xml | 6 +- catroid/src/main/res/values-ko/strings.xml | 12 +- catroid/src/main/res/values-lt/strings.xml | 6 +- catroid/src/main/res/values-mk/strings.xml | 6 +- catroid/src/main/res/values-ml/strings.xml | 6 +- catroid/src/main/res/values-ms/strings.xml | 6 +- catroid/src/main/res/values-nl/strings.xml | 6 +- catroid/src/main/res/values-no/strings.xml | 6 +- catroid/src/main/res/values-pl/strings.xml | 6 +- catroid/src/main/res/values-ps/strings.xml | 6 +- .../src/main/res/values-pt-rBR/strings.xml | 28 +- catroid/src/main/res/values-pt/strings.xml | 6 +- catroid/src/main/res/values-ro/strings.xml | 6 +- catroid/src/main/res/values-ru/strings.xml | 10 +- catroid/src/main/res/values-sd/strings.xml | 6 +- catroid/src/main/res/values-sk/strings.xml | 6 +- catroid/src/main/res/values-sl/strings.xml | 6 +- catroid/src/main/res/values-sq/strings.xml | 6 +- .../src/main/res/values-sr-rCS/strings.xml | 6 +- .../src/main/res/values-sr-rSP/strings.xml | 8 +- catroid/src/main/res/values-sv/strings.xml | 6 +- catroid/src/main/res/values-sw/strings.xml | 6 +- catroid/src/main/res/values-ta/strings.xml | 1321 ++++++++--------- catroid/src/main/res/values-te/strings.xml | 6 +- catroid/src/main/res/values-th/strings.xml | 10 +- catroid/src/main/res/values-tr/strings.xml | 6 +- catroid/src/main/res/values-uk/strings.xml | 6 +- catroid/src/main/res/values-ur/strings.xml | 8 +- catroid/src/main/res/values-vi/strings.xml | 6 +- .../src/main/res/values-zh-rCN/strings.xml | 288 ++-- .../src/main/res/values-zh-rTW/strings.xml | 6 +- 58 files changed, 1289 insertions(+), 1143 deletions(-) diff --git a/catroid/src/main/res/values-ar/strings.xml b/catroid/src/main/res/values-ar/strings.xml index 20bd1e13127..1ee2eb09cb3 100644 --- a/catroid/src/main/res/values-ar/strings.xml +++ b/catroid/src/main/res/values-ar/strings.xml @@ -1,5 +1,4 @@ - "تحديد موقع الكائن في " - تحديد الموقع بصرياً + Place visually "س: " "ص: " "تعيين قيمة س الى " @@ -1331,6 +1330,11 @@ حياكة + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch عند بدء تشغيل البرنامج diff --git a/catroid/src/main/res/values-az/strings.xml b/catroid/src/main/res/values-az/strings.xml index 9d6d7c8e59d..8a2fa8856c1 100644 --- a/catroid/src/main/res/values-az/strings.xml +++ b/catroid/src/main/res/values-az/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-bg/strings.xml b/catroid/src/main/res/values-bg/strings.xml index a68652becce..44079b449d7 100644 --- a/catroid/src/main/res/values-bg/strings.xml +++ b/catroid/src/main/res/values-bg/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-bs/strings.xml b/catroid/src/main/res/values-bs/strings.xml index 43a23eecb5a..6f79dc3fd1f 100644 --- a/catroid/src/main/res/values-bs/strings.xml +++ b/catroid/src/main/res/values-bs/strings.xml @@ -1,5 +1,4 @@ - Parrot AR.Drone 2.0 ekstenzija Omogućiti aplikaciji kontrolu Parrot ARDrone 2.0 quadcopter-a - Parrot Jumping Sumo extension - Allow the app to control Parrot\'s Jumping Sumo robots - Lego Mindstorms NXT extension - Lego Mindstorms EV3 extension + Parrot Jumping Sumo ekstenzija + Dozvolite aplikaciji da kontroliše Jumping Sumo robote Parrota + Lego Mindstorms NXT ekstenzija + Lego Mindstorms EV3 ekstenzija Dopusti aplikaciji da kontroliše Lego Mindstorms NXT robote Dopusti aplikaciji da kontroliše Lego Mindstorms EV3 robote Lego NXT Senzori Lego EV3 Senzori - Parrot AR.Drone 2.0 configuration + Parrot AR.Dron 2.0 konfiguracija RobotixEdu Phiro ekstenzija Dopusti aplikaciji da kontroliše RobotixEdu Phiro robote Arduino ekstenzija Dopusti aplikaciji da kontroliše Arduino ploče - Embroidery extension + Ekstenzija za vez Create patterns for stitching machines Chromecast extension Show cast button and enable cast projects @@ -155,7 +154,7 @@ Sending anonymous crash reports Allow the app to send crash reports automatically - Raspberry Pi extension + Raspberry Pi ekstenzija Allow the app to control Raspberry Pi computers Omogućite blokove i senzore Pomoć / prvi koraci @@ -468,9 +467,9 @@ - Delete %d data item - Delete %d data items - Delete %d data items + Obrišite %d stavku + Obrišite %d stavke + Obrišite %d stavki Nova scena @@ -569,7 +568,7 @@ Spakovano %d zvukova u ruksak. Spakovano %d zvukova u ruksak. - Spakovana 1 grupa skripti u ruksak. + Grupna skripta upakovana u ruksak. Otpakovana %d scena. @@ -860,7 +859,7 @@ Nema mreže Učitaj - Upload project + Postavite projekat Opis: Molimo izaberite do tri kategorije @@ -924,7 +923,7 @@ Prijavite se preko Google Prazno korisničko ime Email adrese se ne mogu koristiti kao korisnička imena - Korisničko ime treba da sadrži samo slova (a–z), brojeve (0–9), crte (-), donje crte(_), i tačke (.). + Korisničko ime treba da sadrži samo slova (a–z), brojeve (0–9), crte (-), donje crte(_), i tačke (.). Korisničko ime ne treba da počinje sa crtama (-), donjim crtama (_) ili tačkama (.). Pogrešan format emaila Polje za šifru je prazno @@ -945,18 +944,17 @@ Traka 1 - Text-to-Speech engine not installed!\nDo you want to - install it? + Tekst-U-Govor mašina nije instalirana!\nŽelite li je instalirati? Komponenta nije dostupna Nažalost ovaj projekat ne radi na Vašem uređaju. Sljedeće komponente nisu dostupne: \n\n Another device is connected to the Jumping Sumo. Make sure you are the one connected to the drone. - \u2022 Vibration\n - \u2022 Acceleration sensor\n - \u2022 Inclination sensor\n - \u2022 Compass\n - \u2022 Geolocation\n - \u2022 Text-To-Speech engine\n + \u2022 Vibracija\n + \u2022 Senzor ubrzanja\n + \u2022 Senzor nagiba\n + \u2022 Kompas\n + \u2022 Geolokacija\n + \u2022 Tekst-U-Govor mašina\n \u2022 Rear camera\n \u2022 Prepoznavanje lica\n \u2022 Jumping Sumo\n @@ -972,9 +970,9 @@ Pokreni ponovo Prikažite ose Nemojte prikazivati ose - Maximize/\nstretch + Maksimizirajte/\nrazvucite Pregled - Embroidery + Vez Nova poruka @@ -985,7 +983,7 @@ Kategorije - Embroidery + Vez Kretanje Izgledi Olovka @@ -1014,7 +1012,7 @@ "Promjeni X za " "Promjeni Y za " Idi nazad - "Set rotation style" + "Postavite stil rotacije" lijevo-desno samo all-around ne rotiraj @@ -1033,7 +1031,7 @@ Skreni lijevo Skreni desno - Point in direction + Usmjerite u pravcu Pokazati prema Klizati prema X: @@ -1055,8 +1053,8 @@ stepeni/sekundi "Set friction to" "Set bounce factor to" - "Spin left" - "Spin right" + "Okrenite lijevo" + "Okrenite desno" Prebaci na izgled Pređite na poziciju broj @@ -1071,8 +1069,8 @@ Prikaži "Postavite transparentnost" "Promijenite transparentnost" - "Set brightness" - "Change brightness" + "Postavite osvijetljenost" + "Promijenite osvijetljenost" "Postavite boju" "Promijenite boju" od @@ -1115,6 +1113,11 @@ Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch Kada scena počinje @@ -1157,7 +1160,7 @@ jednako očekivanom: Sačekajte dok sve ostale skripte prestanu raditi "Jedan pritisak na" - Finish stage + Zadnja faza vrijeme vremena @@ -1221,7 +1224,7 @@ Moj prvi AR. dron 2.0 projekat Take off - Flip + Preokrenite Gore Dole Lijevo @@ -1266,7 +1269,7 @@ Prikažite sačuvanu sliku Otkažite preuzimanje projekta Otkazano preuzimanje/konvertovanje projekata - "Uploading" + "Postavljanje" "Look at" Preuzimanje u toku Preuzimanje uspješno @@ -1296,7 +1299,7 @@ Camera brick needs access to the device\'s camera, the \"location\" formula elem device\'s geolocation sensor, and in order to import and export projects from and to the local memory, the app needs read and write access to it. You can always change permissions through your device\'s settings. - Something went wrong while uploading the project. + Nešto je pošlo po zlu pri postavljanju projekta. Došlo je do greške prilikom preuzimanja programa. "Project %s already in queue." "Your download could not be @@ -1307,9 +1310,8 @@ needs read and write access to it. You can always change permissions through you Something went wrong while saving the preview image. Došlo je do greške. Provjeri vezu sa internetom. The project is not compatible with this version of the app. - This app version is outdated. Update now? - You cannot upload a project with the name \"My first project\". - Please rename the project. + Ova verzija aplikacije je zastarila. Želite li je ažurirati? + Ne možete postaviti projekat sa nazivom \"Moj prvi projekat\". Molimo promijenite naziv. Ne možete objaviti nepromijenjen primjer projekat. Molimo Vas da promijenite nešto i pokušate ponovo. Došlo je do greške prilikom dodavanja ovog bloka Došlo je do greške prilikom kopiranja ovog bloka @@ -1320,19 +1322,18 @@ needs read and write access to it. You can always change permissions through you We cannot run a Jumping Sumo project on your device. Cannot find Jumping Sumo Connect your wifi to the Jumping Sumo and try again. - Jumping Sumo battery low + Jumping Sumo baterija slaba Ubaci napunjenu bateriju i pokušaj ponovo. - No Jumping Sumo support + Nema Jumping Sumo podrške Nema AR. dron 2.0 podrške. Ne možemo pokrenuti AR. dron projekat na Vašem uređaju. Mijenjanje naziva neodgovarajućeg projekta nije moguće. - Something went wrong while sharing the embroidery file. - Something went wrong. - Geolocation data is not available. - Something went wrong while saving the new description. - WhatsApp not installed - This script can\'t be added to a Chromecast - project. + Nešto je pošlo po zlu pri dijeljenju datoteke za vez. + Nešto je pošlo po zlu. + Podaci geolokacije nisu dostupni. + Nešto je pošlo po zlu pri spremanju novog opisa. + WhatsApp nije instaliran + Ova skripta ne može biti dodana u Chromecast projekat. Can\'t enable Bluetooth, please try turning it off and on again. @@ -1422,7 +1423,7 @@ needs read and write access to it. You can always change permissions through you EV3 infracrveni senzor EV3 senzor boja Ambijent EV3 senzora boja - Ev3 color sensor reflected + Ev3 senzor za boje reflektovan HiTechnic senzor boja NXT senzor temperature (°C) NXT senzor temperature (°F) @@ -1440,18 +1441,18 @@ needs read and write access to it. You can always change permissions through you za Jačina zvuka % - Stop EV3 motor - Set EV3 motor - Turn EV3 motor + Isključite EV3 motor + Postavite EV3 motor + Uključite EV3 motor od - Set EV3 LED status - Off + Postavite EV3 LED status + Isključen Zelena Crvena - Orange - Green flashing - Red flashing - Orange flashing + Narandžasto + Zeleno bljeskajuće + Crveno bljeskajuće + Narandžasto bljeskajuće Green pulse Red pulse Orange pulse @@ -1459,10 +1460,10 @@ needs read and write access to it. You can always change permissions through you Take off / land AR.Drone 2.0 Play AR.Drone 2.0 flash animation - Flip AR.Drone 2.0 - Move AR.Drone 2.0 left - Move AR.Drone 2.0 right - Move AR.Drone 2.0 forward + Preokrenite AR.Dron 2.0 + Pomjerite AR.Dron 2.0 lijevo + Pomjerite AR. dron 2.0 desno + Pomjerite AR. dron 2.0 naprijed Pomjerite AR. dron 2.0 nazad Pomjerite AR. dron 2.0 gore Pomjerite AR. dron 2.0 dolje @@ -1472,8 +1473,8 @@ needs read and write access to it. You can always change permissions through you Set config AR.Drone 2.0 Switch AR.Drone 2.0 camera Altitude limit - Vertical speed limit - Rotation speed limit + Vertikalno ograničenje brzine + Rotaciono ograničenje brzine Tilt limit sa snaga @@ -1501,20 +1502,20 @@ needs read and write access to it. You can always change permissions through you Left red right green Blink standard - Move Jumping Sumo forward - Move Jumping Sumo backward - Animations Jumping Sumo - No Jumping Sumo sound + Pomjerite Jumping Sumo naprijed + Pomjerite Jumping Sumo nazad + Animacije Jumping Sumo + Nema Jumping Sumo zvuka Jump Jumping Sumo long Jump Jumping Sumo high - Turn Jumping Sumo left - Turn Jumping Sumo right + Okrenite Jumping Sumo lijevo + Okrenite Jumping Sumo desno stepeni - Flip Jumping Sumo + Preokrenite Jumping Sumo Taking picture Jumping Sumo - My first Jumping Sumo project + Moj prvi Jumping Sumo projekat Jumping Sumo video Naprijed Nazad @@ -1525,11 +1526,11 @@ needs read and write access to it. You can always change permissions through you Skačite visoko Skreni lijevo Skreni desno - Flip + Preokrenite Slikanje - Spin + Zavrtjeti Tab Slowshake Metronome @@ -1546,8 +1547,8 @@ needs read and write access to it. You can always change permissions through you - Stop Phiro motor - Move Phiro motor forward + Zaustavite Phiro motor + Pomjerite Phiro motor naprijed Pomjerite Phiro motor nazad Brzina diff --git a/catroid/src/main/res/values-ca/strings.xml b/catroid/src/main/res/values-ca/strings.xml index c675d5fe885..0b1dd967a4e 100644 --- a/catroid/src/main/res/values-ca/strings.xml +++ b/catroid/src/main/res/values-ca/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-cs/strings.xml b/catroid/src/main/res/values-cs/strings.xml index 7f3dfef142e..c1116b8fc1b 100644 --- a/catroid/src/main/res/values-cs/strings.xml +++ b/catroid/src/main/res/values-cs/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch Při spuštění programu diff --git a/catroid/src/main/res/values-da/strings.xml b/catroid/src/main/res/values-da/strings.xml index 5e09d5e8262..9d76c7ae2da 100644 --- a/catroid/src/main/res/values-da/strings.xml +++ b/catroid/src/main/res/values-da/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-de/strings.xml b/catroid/src/main/res/values-de/strings.xml index 6a0eca9eefe..4dc491b1f8f 100644 --- a/catroid/src/main/res/values-de/strings.xml +++ b/catroid/src/main/res/values-de/strings.xml @@ -1,5 +1,4 @@ - Es existieren keine Einträge in der Liste. Bitte füge zuerst neue hinzu. - No merging is done. Exactly 2 projects need to be selected to merge. + Es wird keine Zusammenlegung durchgeführt. Es müssen genau 2 Projekte ausgewählt werden, welche zusammengeführt werden sollen. Einpacken Auspacken Kopieren Löschen Umbenennen Konvertieren - Merge + Zusammenführen Du kannst das nicht rückgängig machen! Figuren und Objekte @@ -282,7 +281,7 @@ Kopieren Löschen Umbenennen - Merge + Zusammenführen Details anzeigen Details verbergen @@ -308,8 +307,8 @@ Konvertieren von %d Projekte - Merge %d project - Merge %d projects + Lösche %d Projekt + Lösche %d Projekte @@ -482,7 +481,7 @@ Name Letzter Zugriff: %s, Größe: %s - today, %s + Heute, %s Figuren und Objekte: %d, Aussehen: %d, Klänge: %d Bausteine: %d, Aussehen: %d, Klänge: %d Abmessungen: %s, Größe: %s @@ -666,8 +665,8 @@ Bildschirm: - Merged project - These two projects cannot yet be merged + Projekt zusammengeführt + Diese beiden Projekte können noch nicht zusammengeführt werden Neue Figur oder Objekt @@ -714,67 +713,28 @@ Datenschutz-Vereinbarung Willkommen! Bevor du mit der App loslegen kannst, lese und akzeptiere bitte unsere Datenschutzvereinbarung: - To offer you all the benefits of our services and the associated account, - it is necessary to collect certain data from you.\n\n + Um Ihnen alle Vorteile unserer Services und dem damit verbundenen Konto anbieten zu können, ist es notwendig, bestimmte Daten von Ihnen zu erfassen.\n\n - • To maintain and improve our services (apps and websites) and to do scientific research on ICT and - STEM/STEAM education, we use Google Analytics, Crashlytics, and Firebase, all by Google LLC (USA), - as well as Dynatrace by Dynatrace LLC (USA) to get - metadata about the usage of our services, e.g., crash information, timestamps, visited pages/screens, - usage of our apps and services, used operating system, and information about the network provider. This - analysis and the collected data is not linked to your profile and does not contain any personal - information (last bits of the IP address get anonymized). However, the collected data will get - transferred to the service-provider (Google LLC, USA and Dynatrace LLC, USA). - Data processing is based on agreements with Google LLC and Dynatrace LLC. - This relationship to the service provider conforms to the European Union\'s General Data - Protection Regulation (EU GDPR) and EU-USA \"Privacy Shield\" agreement.\n\n - • To create and use an account in our systems, and to inform you about necessary changes about your - account per e-mail, e.g., updates or violations of our Terms of Use and Service, our community rules, or - our policies, we will store your username and, if provided by you, your e-mail address. If you have - connected your account via your Google or Facebook account, we additionally store an identification key connected - to your account on these services. We will not use this data for any other (e.g., marketing) purposes, - unless you explicitly allowed us to do so.\n\n - • On a voluntary basis, you can give us your country of residence through your account page on the sharing - site. This will get displayed on your public profile and only be used for statistical and research - purposes by us. It can be removed at any time in your profile settings.\n\n - • You can withdraw the usage of the personal data belonging to your account at any time by deleting your - account through your profile page on https://share.catrob.at. After deleting your account you will still - be able to use the provided services, but not to collaborate, e.g., through uploading programs, - commenting, or liking. Also, all provided content linked to your account, e.g., uploaded programs, - comments, etc., will be deleted.\n\n - • To avoid misuse of our services, e.g., through user contributed uploads or comments for illegal - purposes, all user generated public data (uploads, comments) will be stored internally in a database, - together with a timestamp and the used internet address. This data will not be used by or forwarded to - any institutions, unless sufficiently illegal actions are reasonably suspected and officially entitled - legal institutions request it based on applicable law. Each case will be thoroughly checked on an - individual basis by us first.\n\n - • You can voluntarily subscribe to the Catrobat Newsletter, on https://catrob.at/newsletter provided - by us through the MailChimp service (The Rocket Science Group LLC d/b/a MailChimp, USA). You will then - receive updates on the Catrobat project and its services to your provided e-mail address. You can withdraw - the newsletter at any time by using the \"unsubscribe\" link in the footer of every newsletter. This - newsletter is provided by MailChimp with whom we do have a data-processing agreement and who committed to - the EU General Data Protection Regulation and EU-USA \"Privacy Shield\". For further details on MailChimp - please also look up MailChimp\'s Privacy Policy and Terms of Use.\n\n - • All Services are provided by the free open source Catrobat project under the umbrella of the - International Catrobat Association – Verein zur Förderung freier Software, a non-profit NGO incorporated - in Graz, Austria (European Union). Our policies pay respect to EU and Austrian data protection law - (GDPR). To get in touch with us, please send an e-mail to contact@catrobat.org or mail us to Catrobat,\n - c/o\n - Institute of Software Technology,\n - Graz University of Technology,\n - Inffeldgasse 16b,\n - A-8010 Graz, Austria\n - (European Union).\n\n - In case you are below the age of 14, this policy must be accepted by a legal guardian (usually a parent).\n\n +- Damit wir unsere Dienste (Apps und Websites) erhalten und verbessern können und wissenschaftliche Forschung über ICT und STEM/STEAM-Ausbildung betreiben können, verwenden wir Google Analytics, Crashlytics und Firebase, alle von Google LLC (USA), sowie Dynatrace von Dynatrace LLC (USA), um Metadaten über die Nutzung unserer Dienste zu erhalten, z.B. Absturzinformationen, Zeitstempel, besuchte Seiten/Bildschirme, Nutzung unserer Apps und Dienste, verwendetes Betriebssystem und Informationen über den Netzwerkanbieter. Diese Analyse und die gesammelten Daten werden nicht mit Ihrem Profil verknüpft und enthalten keine persönlichen Informationen (die letzten Bits der IP-Adresse werden anonymisiert). Die gesammelten Daten werden jedoch an den Service-Provider (Google LLC, USA und Dynatrace LLC, USA) übermittelt. Die Datenverarbeitung basiert auf Vereinbarungen mit Google LLC und Dynatrace LLC. Diese Beziehung zum Dienstanbieter entspricht der Allgemeinen Datenschutzverordnung der Europäischen Union (EU GDPR) und dem Abkommen zwischen der EU und den USA \"Privacy Shield\".\n\n +- Um ein Konto in unseren Systemen erstellen und nutzen zu können und um Sie über notwendige Änderungen an Ihrem Konto per E-Mail informieren zu können, z.B. über Aktualisierungen oder Verstöße gegen unsere Nutzungs- und Servicebedingungen, unsere Community-Regeln oder unsere Richtlinien, speichern wir Ihren Benutzernamen und, falls von Ihnen angegeben, Ihre E-Mail-Adresse. Wenn Sie Ihr Konto über Ihr Google- oder Facebook-Konto verbunden haben, speichern wir zusätzlich einen Identifikationsschlüssel verbunden mit Ihrem Konto auf diesen Diensten. Wir werden diese Daten nicht für andere (z.B. Marketing) Zwecke verwenden, es sei denn, Sie haben uns dies ausdrücklich erlaubt.\n\n +- Auf freiwilliger Basis können Sie uns Ihr Wohnsitzland über Ihr Konto auf der Sharing-Site mitteilen. Dies wird in Ihrem öffentlichen Profil angezeigt und von uns nur für statistische und Forschungszwecke verwendet. Das kann jederzeit in Ihren Profileinstellungen entfernt werden.\n\n +- Sie können die Verwendung der zu Ihrem Konto gehörenden persönlichen Daten jederzeit widerrufen, indem Sie Ihr Konto über Ihre Profilseite auf https://share.catrob.at löschen. Nach der Löschung Ihres Kontos können Sie weiterhin die angebotenen Dienste nutzen, aber nicht mehr zusammenarbeiten, z.B. durch Hochladen von Programmen, Kommentieren oder Liken. Außerdem werden alle bereitgestellten Inhalte, die mit Ihrem Konto verknüpft sind, z.B. hochgeladene Programme, Kommentare usw., gelöscht.\n\n +- Um einen Missbrauch unserer Dienste zu vermeiden, z.B. durch von Nutzern beigetragene Uploads oder Kommentare für illegale Zwecke, werden alle von Nutzern generierten öffentlichen Daten (Uploads, Kommentare) intern in einer Datenbank zusammen mit einem Zeitstempel und der verwendeten Internetadresse gespeichert. Diese Daten werden weder von Institutionen verwendet, noch an Institutionen weitergeleitet, es sei denn, es besteht ein hinreichender Verdacht auf illegale Handlungen und offiziell berechtigte Rechtsinstitutionen fordern diese Daten aufgrund des geltenden Rechts. Jeder Fall wird zunächst von uns individuell und gründlich geprüft.\n\n +- Sie können sich freiwillig für den Catrobat-Newsletter unter https://catrob.at/newsletter anmelden, bereitgestellt von uns über den MailChimp-Dienst (The Rocket Science Group LLC d/b/a MailChimp, USA). Sie werden dann Updates zum Catrobat-Projekt und seinen Diensten an die von Ihnen angegebene E-Mail-Adresse erhalten. Sie können den Newsletter jederzeit über den Link \"Abbestellen\" in der Fußzeile jedes Newsletters abbestellen. Der Newsletter wird von MailChimp zur Verfügung gestellt, mit dem wir ein Datenverarbeitungsabkommen haben und der sich verpflichtet hat die allgemeine EU-Datenschutzverordnung und den \"Privacy Shield\" der EU und der USA zu befolgen. Für weitere Details über MailChimp schauen Sie auch in MailChimp\'s Datenschutzrichtlinie und Nutzungsbedingungen nach.\n\n +- Alle Dienste werden vom kostenlosen Open-Source-Projekt Catrobat unter dem Dach der International Catrobat Association - Verein zur Förderung freier Software, einer gemeinnützigen NGO mit Sitz in Graz, Österreich (Europäische Union), bereitgestellt. Unsere Politik respektiert die EU und das österreichische Datenschutzgesetz (GDPR). Um mit uns in Kontakt zu treten, senden Sie bitte eine E-Mail an contact@catrobat.org oder senden Sie uns eine Nachricht an Catrobat,\n +c\o\n +Institut für Softwaretechnologie,\n +Technische Universität Graz,\n +Inffeldgasse 16b,\n +A-8010 Graz, Österreich\n +(Europäische Union).\n\n +Falls Sie unter 14 Jahre alt sind, muss diese Richtlinie von einem Erziehungsberechtigten (normalerweise einem Elternteil) akzeptiert werden.\n\n - Catrobat\'s official English language privacy policy is available on the web under - https://catrob.at/privacypolicy.\n\n +Die offizielle englischsprachige Datenschutzerklärung von Catrobat ist im Internet unter https://catrob.at/privacypolicy verfügbar.\n\n - Version 2.2, 17 October 2019\n\n +Version 2.2, 17 Oktober 2019\n\n - Find the previous, outdated, version of our privacy policy (2.0) here: - http://developer.catrobat.org/privacy_policy_2-0 - +Die vorangegangene, veraltete Version unserer Datenschutzrichtlinie (2.0) finden Sie hier: http://developer.catrobat.org/privacy_policy_2-0 Es ist notwendig unserer Datenschutzvereinbarung zuzustimmen um ein Benutzerkonto anzulegen oder weiter zu benutzen. Falls du damit nicht einverstanden bist, kannst du dein Konto jederzeit über deine Profilseite auf unserer Webseite löschen. Danach kannst du weiterhin alle Funktionen nutzen für die kein Benutzerkonto notwendig ist. @@ -851,7 +811,7 @@ Passwort anzeigen Beim Anmelden ist etwas schief gelaufen. Google Sign-In Fehler. Status: %s - Session expired, please log in. + Sitzung abgelaufen, bitte erneut einloggen. Mit Goggle einloggen Leerer Benuzername E-Mail-Adressen können nicht als Benutzername verwendet werden. @@ -922,7 +882,7 @@ Klang Steuerung Event - Your bricks + Deine Bausteine Daten Lego NXT LEGO EV3 @@ -932,7 +892,7 @@ Arduino Cast Raspberry Pi - Testing + Testen "Setze an Position " @@ -1043,6 +1003,11 @@ Stich + Starte Laufstich mit Länge + Starte Zickzack Stich mit Länge + und Breite + Starte Dreifachstich mit Länge + Beende aktuellen Stich Wenn Programm startet @@ -1081,10 +1046,10 @@ Wenn ich als Klon entstehe Lösche diesen Klon Assert: - equal to expected: - Wait until all other scripts have stopped - "Single tap at" - Finish stage + gleich wie erwartet + Warten bis alle anderen Skripte gestoppt sind + "Einfaches tippen auf" + Stufe beenden mal mal @@ -1096,10 +1061,10 @@ sonst Ende Setze Variable Ändere Variable - Write variable on device - Read variable from device - Write list on device - Read list from device + Variable auf Gerät schreiben + Variable von Gerät lesen + Liste auf Gerät schreiben + Liste von Gerät lesen Kommentar hier hinzufügen… Hmmmm! Hallo! @@ -1114,8 +1079,8 @@ Element in Liste ersetzen auf Position mit - Send web request to - and store answer in + Webanfrage senden an + und speichere Antwort in https://official-joke-api.appspot.com/random_joke @@ -1220,9 +1185,8 @@ Beim Hochladen des Projekts ist ein Fehler aufgetreten. Beim Herunterladen des Projekts ist ein Fehler aufgetreten. - "Project %s already in queue." - "Your download could not be - started, seems there is a problem with our server." + "Projekt %s bereits in Warteschlange." + "Der Download konnte nicht gestartet werden, es scheint als gäbe es ein Problem mit unserem Server." Beim Erstellen des neuen Projekts ist ein Fehler aufgetreten. Beim Umbenennen der Szene ist ein Fehler aufgetreten. Beim Laden des Projektes ist ein Fehler aufgetreten. @@ -1248,7 +1212,7 @@ Keine Unterstützung für AR.Drone 2.0. Leider können wir kein AR.Dronen Projekt auf deinem Gerät ausführen. Es ist nicht möglich ein inkompatibles Projekt umzubenennen. - Something went wrong while sharing the embroidery file. + Während dem Teilen der Stickdatei ist etwas schief gelaufen. Ein unbekannter Fehler ist aufgetreten. Fehler, GPS ist nicht verfügbar. Fehler beim Speichern der neuen Beschreibung. @@ -1578,8 +1542,8 @@ (1,\'Hallo Welt\') verbinde (\'Hallo\',\'Welt\') - regular expression - (\' an? ([^ .]+)\',\'I am a panda.\') + regulärer Ausdruck + (\' an? ([^ .]+)\',\'Ich bin ein Panda.\') Arduino Digital Pin Arduino Analog Pin Raspberry Pi Pin @@ -1776,7 +1740,7 @@ mittig links rechts - Pick color + Farbe auswählen Schalte Kamera @@ -1812,8 +1776,7 @@ Ja, trotzdem löschen! Dein Projekt wird nun auf unsere Community Seite hochgeladen. Hier können andere dein Projekt verwenden und herunterladen. Du kannst dein Projekt auch als eigenständige App herunterladen. - Upload failed. Please check your internet connection and try - again! + Upload fehlgeschlagen. Bitte überprüfe deine Internetverbindung und versuche es erneut! Projekt anzeigen diff --git a/catroid/src/main/res/values-el/strings.xml b/catroid/src/main/res/values-el/strings.xml index 11a15a7709b..d173eb29229 100644 --- a/catroid/src/main/res/values-el/strings.xml +++ b/catroid/src/main/res/values-el/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-en-rAU/strings.xml b/catroid/src/main/res/values-en-rAU/strings.xml index 8ae86d909a5..f009f9320de 100644 --- a/catroid/src/main/res/values-en-rAU/strings.xml +++ b/catroid/src/main/res/values-en-rAU/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-en-rCA/strings.xml b/catroid/src/main/res/values-en-rCA/strings.xml index 512e1b19a24..3f1bd460175 100644 --- a/catroid/src/main/res/values-en-rCA/strings.xml +++ b/catroid/src/main/res/values-en-rCA/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-en-rGB/strings.xml b/catroid/src/main/res/values-en-rGB/strings.xml index 9d67f198c04..7cbca2c93b4 100644 --- a/catroid/src/main/res/values-en-rGB/strings.xml +++ b/catroid/src/main/res/values-en-rGB/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-es/strings.xml b/catroid/src/main/res/values-es/strings.xml index 261851b3504..e10429193d5 100644 --- a/catroid/src/main/res/values-es/strings.xml +++ b/catroid/src/main/res/values-es/strings.xml @@ -1,5 +1,4 @@ - @@ -256,14 +255,14 @@ However, if you don\’t feel comfortable to do so, you can use our free web-services on An unexpected error occurred: I could not restore the sample project. - An error occurred while copying project + Se ha producido un error al copiar el proyecto - This name is already in use, please choose another one. - You only put spaces into the text field, please enter a text - using letters, numbers or other special characters. + Este nombre ya está en uso. Por favor, escoja otro nombre. + Solo pone espacios en el campo de texto, por favor ingrese texto + usando letras, números u otros caracteres especiales. Por favor introduce el texto - There are no items in this list yet. Please add some first. + Todavía no hay elementos en esta lista. Por favor, añada algunos primero. No merging is done. Exactly 2 projects need to be selected to merge. Empacar Desempacar @@ -681,7 +680,7 @@ Añadir sonido Grabar Sonido Seleccione Archivo - Compositor musical + Compositor Evaluar Pocket Code If you enjoy this app, please rate us on the App store. @@ -796,7 +795,7 @@ Descripción: Please choose up to three categories - Save project to external storage + Guardar proyecto en almacenamiento externo " " Guardando proyecto en almacenamiento externo. " " @@ -852,7 +851,7 @@ Mostrar Contraseña Something went wrong during sign in. Google sign-in error. Status: %s - Session expired, please log in. + La sesión expiró. Por favor inicie sesión de nuevo. Acceder con Google Nombre de usuario vacío Email address cannot be used as user names @@ -1020,12 +1019,12 @@ Vibrar por Preguntar y almacenar la respuesta escrita en - What\'s your name? + ¿Cómo te llamas? "Escribe tu respuesta:" Enviar respuesta Preguntar y almacenar la respuesta dicha en - What\'s your name? + ¿Cómo te llamas? Bajar Lápiz (Escribir) @@ -1047,6 +1046,11 @@ Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch Cuando comience el programa @@ -1206,7 +1210,7 @@ "Descargando " Descarga en progreso Descarga exitosa - "Abierto " + "Abrir" Attention. Battery is low. Current status is %d Tamaño: Batería está baja (descanso automático). @@ -1549,22 +1553,22 @@ necesita acceso de lectura y escritura a ella. Siempre puedes cambiar los permis Pi color - RCUAD - (0) + raiz cuadrada + (4) valor aleatorio desde hasta (0,1) ABS (0) - REDONDEAR - (0) + redondear + (1.6) mod (1,1) arcsen - (0) + (0.5) ARccOS (0) arctan - (0) + (1) arctangent2 (-1, 0) exp @@ -1573,15 +1577,15 @@ necesita acceso de lectura y escritura a ella. Siempre puedes cambiar los permis (2,3) suelo (0.7) - ceil + techo (0,3) - máx + máximo de (0,1) - min - (0,1) - VERDADERO - FALSO - Largo + mínimo de + (7,2) + verdadero + falso + longitud (\'Hola mundo\') letra (1, \'Hola mundo\') @@ -1774,7 +1778,7 @@ necesita acceso de lectura y escritura a ella. Siempre puedes cambiar los permis centrado izquierda derecha - Pick color + Escoger color Girar la cámara @@ -1820,8 +1824,7 @@ necesita acceso de lectura y escritura a ella. Siempre puedes cambiar los permis Mostrar sugerencias Todos los ladrillos se clasifican en categorías. Elija la categoría que buscas. Para agregar un bloque a su secuencia de comandos pulse en el bloque que desea utilizar. - The script defines the behavior of your actor or object. To add bricks to the script, - tap the \"+\" symbol. + La secuencia de comandos define el comportamiento de su objeto. Para agregar ladrillos a la secuencia de comandos pulse en el símbolo \"+\". Here you can find the different appearances of your actor or object. To add a new look, tap the \"+\" symbol. Here you can add new sounds to your actor or object. Remember using a brick from the diff --git a/catroid/src/main/res/values-fa/strings.xml b/catroid/src/main/res/values-fa/strings.xml index 813487c0ea8..f172c7c1d14 100644 --- a/catroid/src/main/res/values-fa/strings.xml +++ b/catroid/src/main/res/values-fa/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-fi/strings.xml b/catroid/src/main/res/values-fi/strings.xml index 08192914f6e..4ebbde78fe4 100644 --- a/catroid/src/main/res/values-fi/strings.xml +++ b/catroid/src/main/res/values-fi/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-fr/strings.xml b/catroid/src/main/res/values-fr/strings.xml index ab2d744d5b4..315e7a25897 100644 --- a/catroid/src/main/res/values-fr/strings.xml +++ b/catroid/src/main/res/values-fr/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch Quand le programme démarre diff --git a/catroid/src/main/res/values-gl/strings.xml b/catroid/src/main/res/values-gl/strings.xml index 7ba61d075b8..636649935d1 100644 --- a/catroid/src/main/res/values-gl/strings.xml +++ b/catroid/src/main/res/values-gl/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-gu/strings.xml b/catroid/src/main/res/values-gu/strings.xml index 1920ae1a738..4428ac49c47 100644 --- a/catroid/src/main/res/values-gu/strings.xml +++ b/catroid/src/main/res/values-gu/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-hi/strings.xml b/catroid/src/main/res/values-hi/strings.xml index 4178f82c289..e3f013605ca 100644 --- a/catroid/src/main/res/values-hi/strings.xml +++ b/catroid/src/main/res/values-hi/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-hr/strings.xml b/catroid/src/main/res/values-hr/strings.xml index b6aac4d88e9..699c7d5855f 100644 --- a/catroid/src/main/res/values-hr/strings.xml +++ b/catroid/src/main/res/values-hr/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch Kada prizor krene diff --git a/catroid/src/main/res/values-hu/strings.xml b/catroid/src/main/res/values-hu/strings.xml index 53a1ec80a5e..71d3249b23f 100644 --- a/catroid/src/main/res/values-hu/strings.xml +++ b/catroid/src/main/res/values-hu/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-ig/strings.xml b/catroid/src/main/res/values-ig/strings.xml index 813487c0ea8..f172c7c1d14 100644 --- a/catroid/src/main/res/values-ig/strings.xml +++ b/catroid/src/main/res/values-ig/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-in/strings.xml b/catroid/src/main/res/values-in/strings.xml index 80b6461f94d..760469c6a94 100644 --- a/catroid/src/main/res/values-in/strings.xml +++ b/catroid/src/main/res/values-in/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch Saat program dimulai diff --git a/catroid/src/main/res/values-it/strings.xml b/catroid/src/main/res/values-it/strings.xml index b793ffe8d1e..963b0dd65ba 100644 --- a/catroid/src/main/res/values-it/strings.xml +++ b/catroid/src/main/res/values-it/strings.xml @@ -1,5 +1,4 @@ - "Posiziona a " - Posiziona in modo visuale + Place visually "X: " "Y: " "Imposta X a " @@ -1054,6 +1051,11 @@ Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch Quando il programma inizia @@ -1095,7 +1097,7 @@ uguale al previsto: Attendi che tutti gli altri script siano stati fermati "Tocco singolo su" - Finish stage + Stage finale volta volte @@ -1109,8 +1111,8 @@ Cambia variabile Scrivi la variabile sul dispositivo Leggi la variabile dal dispositivo - Write list on device - Read list from device + Scrivi la lista sul dispositivo + Leggi la lista dal dispositivo aggiungi qui un commento… Hmmmm! Ciao! @@ -1235,9 +1237,9 @@ deve poter accedere sia in lettura che in scrittura ad essa. Puoi sempre modific Errore durante il caricamento del programma. Errore durante il download del programma. - "Project %s already in queue." - "Your download could not be - started, seems there is a problem with our server." + "Il progetto %s è già in coda." + "Il download non può essere avviato, + sembra che ci sia un problema con il nostro server." Errore durante la creazione di un nuovo programma. Errore durante il cambiamento di nome della scena. Errore durante il caricamento del programma. diff --git a/catroid/src/main/res/values-iw/strings.xml b/catroid/src/main/res/values-iw/strings.xml index 223974e64e7..f30f0273ab8 100644 --- a/catroid/src/main/res/values-iw/strings.xml +++ b/catroid/src/main/res/values-iw/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-ja/strings.xml b/catroid/src/main/res/values-ja/strings.xml index 46a88a71107..1203606c4ee 100644 --- a/catroid/src/main/res/values-ja/strings.xml +++ b/catroid/src/main/res/values-ja/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch プログラムがはじまると diff --git a/catroid/src/main/res/values-kk/strings.xml b/catroid/src/main/res/values-kk/strings.xml index 08192914f6e..4ebbde78fe4 100644 --- a/catroid/src/main/res/values-kk/strings.xml +++ b/catroid/src/main/res/values-kk/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-kn/strings.xml b/catroid/src/main/res/values-kn/strings.xml index c7e184fe29f..f65a13f1427 100644 --- a/catroid/src/main/res/values-kn/strings.xml +++ b/catroid/src/main/res/values-kn/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-ko/strings.xml b/catroid/src/main/res/values-ko/strings.xml index 5cc515ea74f..ab828d0451a 100644 --- a/catroid/src/main/res/values-ko/strings.xml +++ b/catroid/src/main/res/values-ko/strings.xml @@ -1,5 +1,4 @@ - "위치 설정" - 보이게 위치 + Place visually "X:" "Y:" "X좌표 정하기 :" @@ -947,6 +946,11 @@ https://share.catrob.at/ website 여기를 통해 계정과 정보를 삭제할 스티치 + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch 시작할 때 @@ -987,7 +991,7 @@ https://share.catrob.at/ website 여기를 통해 계정과 정보를 삭제할 예상: 다른 스크립트가 정지할 때까지 기다리기 "한 번 누르기" - Finish stage + 마지막 스테이지 @@ -1122,7 +1126,7 @@ https://share.catrob.at/ website 여기를 통해 계정과 정보를 삭제할 프로그램을 업로드하는 중에 오류가 발생했습니다. 프로그램을 다운로드하는 동안 오류가 발생했습니다. - %s 프로그램이 대기중. + "프로그램이 %s 대기중." "다운로드 되지 않습니다, 우리 서버에 문제가 있습니다." 새로운 프로그램을 생성하는 동안 오류가 발생했습니다. 장면 이름 변경하는 동안 오류가 발생했습니다. diff --git a/catroid/src/main/res/values-lt/strings.xml b/catroid/src/main/res/values-lt/strings.xml index 9d50c1ac9b4..892c440dbd8 100644 --- a/catroid/src/main/res/values-lt/strings.xml +++ b/catroid/src/main/res/values-lt/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-mk/strings.xml b/catroid/src/main/res/values-mk/strings.xml index 954afa56e5f..3496ffc3385 100644 --- a/catroid/src/main/res/values-mk/strings.xml +++ b/catroid/src/main/res/values-mk/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-ml/strings.xml b/catroid/src/main/res/values-ml/strings.xml index 062314eb632..76a97376dd8 100644 --- a/catroid/src/main/res/values-ml/strings.xml +++ b/catroid/src/main/res/values-ml/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-ms/strings.xml b/catroid/src/main/res/values-ms/strings.xml index e533f32f45b..dbbae86c95d 100644 --- a/catroid/src/main/res/values-ms/strings.xml +++ b/catroid/src/main/res/values-ms/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-nl/strings.xml b/catroid/src/main/res/values-nl/strings.xml index 3e54c86bfc9..a1a94b31c05 100644 --- a/catroid/src/main/res/values-nl/strings.xml +++ b/catroid/src/main/res/values-nl/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-no/strings.xml b/catroid/src/main/res/values-no/strings.xml index 5898e6b1eb8..984c71ffaf2 100644 --- a/catroid/src/main/res/values-no/strings.xml +++ b/catroid/src/main/res/values-no/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch Når programmet starter diff --git a/catroid/src/main/res/values-pl/strings.xml b/catroid/src/main/res/values-pl/strings.xml index 038577a4c55..41031a3fe95 100644 --- a/catroid/src/main/res/values-pl/strings.xml +++ b/catroid/src/main/res/values-pl/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch Kiedy program startuje diff --git a/catroid/src/main/res/values-ps/strings.xml b/catroid/src/main/res/values-ps/strings.xml index 83fd2ba60da..70bd964ea0e 100644 --- a/catroid/src/main/res/values-ps/strings.xml +++ b/catroid/src/main/res/values-ps/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-pt-rBR/strings.xml b/catroid/src/main/res/values-pt-rBR/strings.xml index 2084c37fdde..18b872f1ec8 100644 --- a/catroid/src/main/res/values-pt-rBR/strings.xml +++ b/catroid/src/main/res/values-pt-rBR/strings.xml @@ -1,5 +1,4 @@ - - Palco + Estágio Reproduzir Configurações Refazer @@ -42,7 +41,7 @@ Concordar Discordar Selecionar tudo - Desseleccionar tudo + Desmarcar todos ignorar Aviso Erro @@ -50,10 +49,10 @@ Por favor, aguarde Procurar… Adicionar à mochila - Compartilhar.catrob.at + share.catrob.at Verificando dados de login… - Trocando dados de entrada com o Google… + Trocando dados de login do Google… O login do Google em nosso servidor foi completado… Excluir minha conta Logout bem sucedido @@ -78,12 +77,12 @@ Login Encerrar Sessão Conversor de Scratch - Loja de aplicações não encontrada + Loja de aplicativos não encontrada Criado com Detalhes sobre este aplicativo - Avalie-nos no Google Play + Mais aplicativos na Play store Configurações Idioma @@ -95,7 +94,7 @@ Perfis Perfis predefinidos Escolha um perfil de acessibilidade predefinido - Aparência do texto + Aparência de texto Manuseamento Ícones grandes Aumentar tamanho do ícone. @@ -142,7 +141,7 @@ Allow the app to control Lego Mindstorms NXT robots Allow the app to control Lego Mindstorms EV3 robots Sensores Lego NXT - Lego EV3 Sensors + Sensores Lego EV3 Parrot AR.Drone 2.0 configuration Blocos Phiro Allow the app to control RobotixEdu\'s Phiro robots @@ -217,9 +216,9 @@ Completed: %d jobs Conversão falhou! - A fazer download… - Download concluído! - Transferência cancelada! + Fazendo download… + Download completo. + Download cancelado! In progress Converted projects by %1$s @@ -1051,6 +1050,11 @@ Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-pt/strings.xml b/catroid/src/main/res/values-pt/strings.xml index 15114e34523..1e963b490ff 100644 --- a/catroid/src/main/res/values-pt/strings.xml +++ b/catroid/src/main/res/values-pt/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-ro/strings.xml b/catroid/src/main/res/values-ro/strings.xml index d40bc1e9293..6e27e705e3f 100644 --- a/catroid/src/main/res/values-ro/strings.xml +++ b/catroid/src/main/res/values-ro/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-ru/strings.xml b/catroid/src/main/res/values-ru/strings.xml index bf456e75bcd..0a8540abd81 100644 --- a/catroid/src/main/res/values-ru/strings.xml +++ b/catroid/src/main/res/values-ru/strings.xml @@ -1,5 +1,4 @@ - "Поместить в " - Поместить на глаз + Place visually "X: " "Y:" "Установить X в " @@ -1202,6 +1201,11 @@ Прикрепить + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch При старте @@ -1245,7 +1249,7 @@ equal to expected: Wait until all other scripts have stopped "Single tap at" - Finish stage + Завершить этап раз разa diff --git a/catroid/src/main/res/values-sd/strings.xml b/catroid/src/main/res/values-sd/strings.xml index 5b824c6bab9..5f3529cd0ee 100644 --- a/catroid/src/main/res/values-sd/strings.xml +++ b/catroid/src/main/res/values-sd/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-sk/strings.xml b/catroid/src/main/res/values-sk/strings.xml index 6457de5c6a1..2ae75514db6 100644 --- a/catroid/src/main/res/values-sk/strings.xml +++ b/catroid/src/main/res/values-sk/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch Pri spustení programu diff --git a/catroid/src/main/res/values-sl/strings.xml b/catroid/src/main/res/values-sl/strings.xml index c3c90c7a264..60488bd4058 100644 --- a/catroid/src/main/res/values-sl/strings.xml +++ b/catroid/src/main/res/values-sl/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-sq/strings.xml b/catroid/src/main/res/values-sq/strings.xml index 2a13c153d54..b97e1d1a1ce 100644 --- a/catroid/src/main/res/values-sq/strings.xml +++ b/catroid/src/main/res/values-sq/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-sr-rCS/strings.xml b/catroid/src/main/res/values-sr-rCS/strings.xml index 38302bba5fb..dce37f4c3a5 100644 --- a/catroid/src/main/res/values-sr-rCS/strings.xml +++ b/catroid/src/main/res/values-sr-rCS/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-sr-rSP/strings.xml b/catroid/src/main/res/values-sr-rSP/strings.xml index 26ffaa468a3..ac9e6793aa3 100644 --- a/catroid/src/main/res/values-sr-rSP/strings.xml +++ b/catroid/src/main/res/values-sr-rSP/strings.xml @@ -1,5 +1,4 @@ - "Постави на" - Постави визуално + Place visually "x:" "y:" "Постави x на" @@ -1119,6 +1118,11 @@ Шав + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch Када сцена почне diff --git a/catroid/src/main/res/values-sv/strings.xml b/catroid/src/main/res/values-sv/strings.xml index d1a3eb17d6f..dd563a682d1 100644 --- a/catroid/src/main/res/values-sv/strings.xml +++ b/catroid/src/main/res/values-sv/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-sw/strings.xml b/catroid/src/main/res/values-sw/strings.xml index 13a3867cdc5..99f8ab136dd 100644 --- a/catroid/src/main/res/values-sw/strings.xml +++ b/catroid/src/main/res/values-sw/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch Programu itakapoanza diff --git a/catroid/src/main/res/values-ta/strings.xml b/catroid/src/main/res/values-ta/strings.xml index f9f9de206d1..ab38e5f1ff0 100644 --- a/catroid/src/main/res/values-ta/strings.xml +++ b/catroid/src/main/res/values-ta/strings.xml @@ -1,5 +1,4 @@ - - Pack %d sound + பேக் %d ஒலி Pack %d sounds - Unpack %d sound + %d ஒலியைத் திறக்கவும் Unpack %d sounds - Copy %d sound + %d காட்சியை நகலெடுக்கவும் Copy %d sounds - Delete %d sound + %d இந்த ஒலியைத் நீக்கு Delete %d sounds - Rename %d sound + %d ஒலியை மறுபெயரிடுங்கள் Rename %d sounds - Copy %d NFC tag + %d NFC குறிச்சொல்லை நகலெடுக்கவும் Copy %d NFC tags - Delete %d NFC tag + %d NFC குறிச்சொல்லை நீக்கு Delete %d NFC tags - Rename %d NFC tag + %d NFC குறிச்சொல்லை மறுபெயரிடுங்கள் Rename %d NFC tags - Pack %d brick + பேக் %d செங்கல் Pack %d bricks - Unpack %d script + %d ஸ்கிரிப்டைத் திறக்கவும் Unpack %d scripts - Copy %d brick + %d செங்கலை நகலெடுக்கவும் Copy %d bricks - Delete %d brick + %d செங்கலை நீக்கு Delete %d bricks - Delete %d script + %d ஸ்கிரிப்டை நீக்கு Delete %d scripts - Delete %d data item + %d தரவை நீக்கு Delete %d data items - New scene + புதிய காட்சி - Delete this project? + இந்த திட்டத்தை நீக்கவா? Delete these projects? - Delete this scene? + இந்த காட்சியை நீக்கவா? Delete these scenes? - Delete this actor or object? + இந்த நடிகர் அல்லது பொருளை நீக்கவா? Delete these actors or objects? - Delete this look? + இந்த தோற்றத்தை நீக்கவா? Delete these looks? - Delete this sound? + இந்த ஒலியைத் நீக்கவா? Delete these sounds? - Delete this tag? - Delete these tags? + இந்த இணைப்பை நீக்கவா? + இந்த டேக்கை நீக்கவா? - Delete this script? + இந்த ஸ்கிரிப்டை நீக்கவா? Delete these scripts? - Delete this brick? + இந்த செங்களை நீக்கவா? Delete these bricks? - Project name - Scene name - Actor or object name + செயற்திட்டத்தின் பெயர் + காட்சி பெயர் + நடிகர் அல்லது பொருளின் பெயர் குழு பெயர் ஸ்கிரிப்ட் குழு பெயர் Look பெயர் @@ -480,8 +478,7 @@ இன்று %s நடிகர்கள் %d மற்றும் %d பொருள்கள் %d செங்கல் %d தோற்றம் %d ஒலி %d - தீர்மானம் %s -அளவு %s + தீர்மானம் %s அளவு %s கால அளவு:%1$s கால அளவு:%s, அளவு:%s @@ -709,67 +706,65 @@ தனிமனித உரிமை கொள்கை வருக! நீங்கள் குறியீட்டைத் தொடங்குவதற்கு முன், தயவுசெய்து எங்கள் தனியுரிமையைப் படித்து ஏற்றுக்கொள்ளுங்கள் பயன்பாட்டைப் பயன்படுத்துவதற்கான கொள்கை: - To offer you all the benefits of our services and the associated account, - it is necessary to collect certain data from you.\n\n + எங்கள் சேவைகள் மற்றும் அதனுடன் தொடர்புடைய கணக்கின் அனைத்து நன்மைகளையும் உங்களுக்கு வழங்க, +         உங்களிடமிருந்து சில தரவைச் சேகரிப்பது அவசியம். \n\n - • To maintain and improve our services (apps and websites) and to do scientific research on ICT and - STEM/STEAM education, we use Google Analytics, Crashlytics, and Firebase, all by Google LLC (USA), - as well as Dynatrace by Dynatrace LLC (USA) to get - metadata about the usage of our services, e.g., crash information, timestamps, visited pages/screens, - usage of our apps and services, used operating system, and information about the network provider. This - analysis and the collected data is not linked to your profile and does not contain any personal - information (last bits of the IP address get anonymized). However, the collected data will get - transferred to the service-provider (Google LLC, USA and Dynatrace LLC, USA). - Data processing is based on agreements with Google LLC and Dynatrace LLC. - This relationship to the service provider conforms to the European Union\'s General Data - Protection Regulation (EU GDPR) and EU-USA \"Privacy Shield\" agreement.\n\n - • To create and use an account in our systems, and to inform you about necessary changes about your - account per e-mail, e.g., updates or violations of our Terms of Use and Service, our community rules, or - our policies, we will store your username and, if provided by you, your e-mail address. If you have - connected your account via your Google or Facebook account, we additionally store an identification key connected - to your account on these services. We will not use this data for any other (e.g., marketing) purposes, - unless you explicitly allowed us to do so.\n\n - • On a voluntary basis, you can give us your country of residence through your account page on the sharing - site. This will get displayed on your public profile and only be used for statistical and research - purposes by us. It can be removed at any time in your profile settings.\n\n - • You can withdraw the usage of the personal data belonging to your account at any time by deleting your - account through your profile page on https://share.catrob.at. After deleting your account you will still - be able to use the provided services, but not to collaborate, e.g., through uploading programs, - commenting, or liking. Also, all provided content linked to your account, e.g., uploaded programs, - comments, etc., will be deleted.\n\n - • To avoid misuse of our services, e.g., through user contributed uploads or comments for illegal - purposes, all user generated public data (uploads, comments) will be stored internally in a database, - together with a timestamp and the used internet address. This data will not be used by or forwarded to - any institutions, unless sufficiently illegal actions are reasonably suspected and officially entitled - legal institutions request it based on applicable law. Each case will be thoroughly checked on an - individual basis by us first.\n\n - • You can voluntarily subscribe to the Catrobat Newsletter, on https://catrob.at/newsletter provided - by us through the MailChimp service (The Rocket Science Group LLC d/b/a MailChimp, USA). You will then - receive updates on the Catrobat project and its services to your provided e-mail address. You can withdraw - the newsletter at any time by using the \"unsubscribe\" link in the footer of every newsletter. This - newsletter is provided by MailChimp with whom we do have a data-processing agreement and who committed to - the EU General Data Protection Regulation and EU-USA \"Privacy Shield\". For further details on MailChimp - please also look up MailChimp\'s Privacy Policy and Terms of Use.\n\n - • All Services are provided by the free open source Catrobat project under the umbrella of the - International Catrobat Association – Verein zur Förderung freier Software, a non-profit NGO incorporated - in Graz, Austria (European Union). Our policies pay respect to EU and Austrian data protection law - (GDPR). To get in touch with us, please send an e-mail to contact@catrobat.org or mail us to Catrobat,\n - c/o\n - Institute of Software Technology,\n - Graz University of Technology,\n - Inffeldgasse 16b,\n - A-8010 Graz, Austria\n - (European Union).\n\n - In case you are below the age of 14, this policy must be accepted by a legal guardian (usually a parent).\n\n +         Services எங்கள் சேவைகளை (பயன்பாடுகள் மற்றும் வலைத்தளங்கள்) பராமரிக்கவும் மேம்படுத்தவும் மற்றும் ஐ.சி.டி மற்றும் விஞ்ஞான ஆராய்ச்சி செய்யவும் +             STEM / STEAM கல்வி, நாங்கள் Google Analytics, Crashlytics மற்றும் Firebase ஐப் பயன்படுத்துகிறோம், இவை அனைத்தும் Google LLC (USA), +             அத்துடன் டைனட்ரேஸ் எல்.எல்.ஏ (யு.எஸ்.ஏ) வழங்கும் டைனட்ரேஸ் +             எங்கள் சேவைகளின் பயன்பாடு பற்றிய மெட்டாடேட்டா, எ.கா., செயலிழப்பு தகவல், நேர முத்திரைகள், பார்வையிட்ட பக்கங்கள் / திரைகள், +             எங்கள் பயன்பாடுகள் மற்றும் சேவைகளின் பயன்பாடு, பயன்படுத்தப்பட்ட இயக்க முறைமை மற்றும் பிணைய வழங்குநரைப் பற்றிய தகவல்கள். இந்த +             பகுப்பாய்வு மற்றும் சேகரிக்கப்பட்ட தரவு உங்கள் சுயவிவரத்துடன் இணைக்கப்படவில்லை மற்றும் தனிப்பட்டவை எதுவும் இல்லை +             தகவல் (ஐபி முகவரியின் கடைசி பிட்கள் அநாமதேயமாக்கப்படுகின்றன). இருப்பினும், சேகரிக்கப்பட்ட தரவு கிடைக்கும் +             சேவை வழங்குநருக்கு மாற்றப்பட்டது (கூகிள் எல்.எல்.சி, அமெரிக்கா மற்றும் டைனட்ரேஸ் எல்.எல்.சி, அமெரிக்கா). +             கூகிள் எல்.எல்.சி மற்றும் டைனட்ரேஸ் எல்.எல்.சி உடனான ஒப்பந்தங்களின் அடிப்படையில் தரவு செயலாக்கம் செய்யப்படுகிறது. +             சேவை வழங்குநருடனான இந்த உறவு ஐரோப்பிய ஒன்றியத்தின் பொது தரவுகளுடன் ஒத்துப்போகிறது +             பாதுகாப்பு ஒழுங்குமுறை (EU GDPR) மற்றும் EU-USA \"தனியுரிமை கேடயம்\" ஒப்பந்தம். \n\n +         Systems எங்கள் கணினிகளில் ஒரு கணக்கை உருவாக்கி பயன்படுத்தவும், உங்களைப் பற்றிய தேவையான மாற்றங்களைப் பற்றி உங்களுக்குத் தெரிவிக்கவும் +             ஒரு மின்னஞ்சலுக்கான கணக்கு, எ.கா., எங்கள் பயன்பாட்டு விதிமுறைகள் மற்றும் சேவை விதிமுறைகள், எங்கள் சமூக விதிகள், அல்லது +             எங்கள் கொள்கைகள், நாங்கள் உங்கள் பயனர்பெயரை சேமிப்போம், நீங்கள் வழங்கியிருந்தால், உங்கள் மின்னஞ்சல் முகவரி. உன்னிடம் இருந்தால் +             உங்கள் கூகிள் அல்லது பேஸ்புக் கணக்கு வழியாக உங்கள் கணக்கை இணைத்துள்ளோம், கூடுதலாக இணைக்கப்பட்ட அடையாள விசையை நாங்கள் சேமிக்கிறோம் +             இந்த சேவைகளில் உங்கள் கணக்கில். இந்தத் தரவை வேறு எந்த (எ.கா., சந்தைப்படுத்தல்) நோக்கங்களுக்காகவும் நாங்கள் பயன்படுத்த மாட்டோம், +             அவ்வாறு செய்ய நீங்கள் எங்களை வெளிப்படையாக அனுமதிக்காவிட்டால். \n\n +         A தன்னார்வ அடிப்படையில், பகிர்வில் உங்கள் கணக்கு பக்கத்தின் மூலம் நீங்கள் வசிக்கும் நாட்டை எங்களுக்கு வழங்கலாம் +             தளம். இது உங்கள் பொது சுயவிவரத்தில் காண்பிக்கப்படும் மற்றும் புள்ளிவிவர மற்றும் ஆராய்ச்சிக்கு மட்டுமே பயன்படுத்தப்படும் +             எங்களால் நோக்கங்கள். உங்கள் சுயவிவர அமைப்புகளில் எந்த நேரத்திலும் இதை அகற்றலாம். \n\n +         Account உங்கள் கணக்கிற்கு சொந்தமான தனிப்பட்ட தரவின் பயன்பாட்டை எந்த நேரத்திலும் நீக்குவதன் மூலம் திரும்பப் பெறலாம் +             https://share.catrob.at இல் உங்கள் சுயவிவரப் பக்கத்தின் மூலம் கணக்கு. உங்கள் கணக்கை நீக்கிய பிறகு நீங்கள் இன்னும் இருப்பீர்கள் +             வழங்கப்பட்ட சேவைகளைப் பயன்படுத்த முடியும், ஆனால் ஒத்துழைக்க முடியாது, எ.கா., பதிவேற்றும் நிரல்கள் மூலம், +             கருத்து தெரிவித்தல் அல்லது விரும்புவது. மேலும், உங்கள் கணக்கில் இணைக்கப்பட்ட அனைத்து உள்ளடக்கங்களும், எ.கா., பதிவேற்றிய நிரல்கள், +             கருத்துகள் போன்றவை நீக்கப்படும். \n\n +         Services எங்கள் சேவைகளை தவறாகப் பயன்படுத்துவதைத் தவிர்க்க, எ.கா., பயனர் பங்களித்த பதிவேற்றங்கள் அல்லது சட்டவிரோதமான கருத்துகள் மூலம் +             நோக்கங்களுக்காக, பயனர் உருவாக்கிய அனைத்து பொது தரவுகளும் (பதிவேற்றங்கள், கருத்துகள்) ஒரு தரவுத்தளத்தில் உள்நாட்டில் சேமிக்கப்படும், +             நேர முத்திரை மற்றும் பயன்படுத்தப்பட்ட இணைய முகவரியுடன். இந்தத் தரவு பயன்படுத்தப்படாது அல்லது அனுப்பப்படாது +             எந்தவொரு நிறுவனமும், போதுமான சட்டவிரோத நடவடிக்கைகள் நியாயமான முறையில் சந்தேகிக்கப்பட்டு அதிகாரப்பூர்வமாக உரிமை பெறாவிட்டால் +             சட்ட நிறுவனங்கள் பொருந்தக்கூடிய சட்டத்தின் அடிப்படையில் அதைக் கோருகின்றன. ஒவ்வொரு வழக்கும் ஒரு மீது முழுமையாக சோதிக்கப்படும் +             முதலில் எங்களால் தனிப்பட்ட அடிப்படையில். \n\n +         Http வழங்கப்பட்ட https://catrob.at/newsletter இல் நீங்கள் தானாக முன்வந்து கேட்ரோபாட் செய்திமடலுக்கு குழுசேரலாம். +             MailChimp சேவையின் மூலம் (தி ராக்கெட் சயின்ஸ் குரூப் LLC d / b / a MailChimp, USA). நீங்கள் அப்போது செய்வீர்கள் +             நீங்கள் வழங்கிய மின்னஞ்சல் முகவரிக்கு கேட்ரோபாட் திட்டம் மற்றும் அதன் சேவைகள் குறித்த புதுப்பிப்புகளைப் பெறுக. நீங்கள் திரும்பப் பெறலாம் +             ஒவ்வொரு செய்திமடலின் அடிக்குறிப்பிலும் \"குழுவிலக\" இணைப்பைப் பயன்படுத்தி எந்த நேரத்திலும் செய்திமடல். இந்த +             செய்திமடல் MailChimp ஆல் வழங்கப்படுகிறது, அவருடன் தரவு செயலாக்க ஒப்பந்தம் உள்ளது, யார் உறுதிபூண்டுள்ளனர் +             ஐரோப்பிய ஒன்றிய பொது தரவு பாதுகாப்பு ஒழுங்குமுறை மற்றும் EU-USA \"தனியுரிமை கேடயம்\". MailChimp பற்றிய கூடுதல் விவரங்களுக்கு +             MailChimp இன் தனியுரிமைக் கொள்கை மற்றும் பயன்பாட்டு விதிமுறைகளையும் பார்க்கவும். \n\n +         Services அனைத்து சேவைகளும் குடையின் கீழ் இலவச திறந்த மூல கேட்ரோபாட் திட்டத்தால் வழங்கப்படுகின்றன +             இன்டர்நேஷனல் கேட்ரோபாட் அசோசியேஷன் - வெரீன் ஸுர் ஃபுர்டெருங் ஃப்ரீயர் மென்பொருள், ஒரு இலாப நோக்கற்ற என்ஜிஓ +             கிராஸ், ஆஸ்திரியாவில் (ஐரோப்பிய ஒன்றியம்). எங்கள் கொள்கைகள் ஐரோப்பிய ஒன்றியம் மற்றும் ஆஸ்திரிய தரவு பாதுகாப்பு சட்டத்திற்கு மரியாதை செலுத்துகின்றன +             (GDPR). எங்களுடன் தொடர்பு கொள்ள, தயவுசெய்து contact@catrobat.org க்கு ஒரு மின்னஞ்சல் அனுப்பவும் அல்லது எங்களை Catrobat க்கு அனுப்பவும்,\n +                 மென்பொருள் தொழில்நுட்ப நிறுவனம்,. \n +                 கிராஸ் தொழில்நுட்ப பல்கலைக்கழகம்,. \n +                 இன்ஃபெல்ட்காஸ் 16 பி,. \n +                 ஏ -8010 கிராஸ், ஆஸ்திரியா \n +                 (ஐரோப்பிய ஒன்றியம்). \n\n +         நீங்கள் 14 வயதிற்குட்பட்டவராக இருந்தால், இந்தக் கொள்கையை சட்டப்பூர்வ பாதுகாவலர் (பொதுவாக பெற்றோர்) ஏற்றுக்கொள்ள வேண்டும். \n\n - Catrobat\'s official English language privacy policy is available on the web under - https://catrob.at/privacypolicy.\n\n +         கேட்ரோபாட்டின் அதிகாரப்பூர்வ ஆங்கில மொழி தனியுரிமைக் கொள்கை இணையத்தில் கிடைக்கிறது +         https://catrob.at/privacypolicy.\n\n - Version 2.2, 17 October 2019\n\n +         பதிப்பு 2.2, 17 அக்டோபர் 2019 \n\n - Find the previous, outdated, version of our privacy policy (2.0) here: - http://developer.catrobat.org/privacy_policy_2-0 - +         எங்கள் தனியுரிமைக் கொள்கையின் (2.0) முந்தைய, காலாவதியான, பதிப்பை இங்கே காணலாம்: +         http://developer.catrobat.org/privacy_policy_2-0 பதிவு செய்ய அல்லது தனியுரிமைக் கொள்கையை ஒப்புக்கொள்வது அவசியம் உங்கள் கணக்கைப் பயன்படுத்துவதைத் தொடரவும். இந்தத் தரவை நாங்கள் சேகரிக்க விரும்பவில்லை என்றால், நீங்கள் நீக்கலாம் எங்கள் https://share.catrob.at/ இணையதளத்தில் உங்கள் சுயவிவரப் பக்கத்தின் வழியாக கணக்கு. @@ -795,8 +790,7 @@ " " திட்டத்தை வெளிப்புற சேமிப்பகத்தில் சேமிக்கிறது. " " - திட்டத்தை சேமித்தது - %1$s + "திட்டத்தை சேமித்தது %1$s" திட்டத்தைச் சேமிப்பதில் தோல்வி, போதுமான நினைவகம் கிடைக்கவில்லை! @@ -930,42 +924,42 @@ AR.Drone 2.0 ஜம்பிங் சுமோ Phiro - Arduino + ஆர்டுயினோ Chromecast ராஸ்பெர்ரி பை சோதனை "இடத்தில்" - பார்வைக்கு வைக்கவும் + Place visually "x:" "y:" - "Set x to" - "Set y to" - "Change x by" - "Change y by" - Go back - "Set rotation style" - left-right only - all-around - don\'t rotate + "X ஐ அமைக்கவும்" + "Y ஐ அமைக்கவும்" + "X ஐ மாற்றவும்" + "Y ஐ மாற்றவும்" + பின்னால் செல் + "சுழற்சி பாணியை அமைக்கவும்" + இடது-வலது மட்டும் + அனைத்தையும் சுற்றி + சுழற்ற வேண்டாம் - layer + அடுக்கு layers - Go to front - If on edge, bounce - Move + முன் செல்லுங்கள் + விளிம்பில் இருந்தால், துள்ளவும் + நகர்த்து - step + படி steps - Turn left + இடப்பக்கம் திரும்பு வலதுபுறம் திரும்ப - Point in direction - Point towards + திசையில் புள்ளி + நோக்கி சுட்டிக்காட்டவும் சறுக்கு - to x: + x க்கு: செல்லுங்கள் தொடு நிலை சீரற்ற நிலை @@ -974,11 +968,11 @@ உங்கள் இயக்க வகையை அமைக்கவும் ஈர்ப்பு கீழ் நகரும் மற்றும் துள்ளல் ஈர்ப்பு விசையின் கீழ் நகரவில்லை, ஆனால் மற்றவர்கள் ஈர்ப்பு விசையின் கீழ் உங்களைத் துரத்துகிறார்கள் - not moving or bouncing under gravity (default) - "Set mass to" + ஈர்ப்பு (இயல்புநிலை) கீழ் நகரவோ அல்லது எதிர்க்கவோ இல்லை + "வெகுஜனத்தை அமைக்கவும்" கிலோகிராம் "அனைத்து நடிகர்களுக்கும் பொருள்களுக்கும் ஈர்ப்பு அமைக்கவும்" - steps/second² + படிகள் / வினாடி² "வேகத்தை அமைக்கவும்" படிகள் / இரண்டாவது டிகிரி / இரண்டாவது @@ -1005,7 +999,7 @@ "வண்ணத்தை அமைக்கவும்" "நிறத்தை மாற்றவும்" மூலம் - to + க்கு கிராஃபிக் விளைவுகளை அழிக்கவும் அடுத்த பார்வை அடுத்த பின்னணி @@ -1014,65 +1008,70 @@ ஒளிரும் விளக்கை இயக்கவும் மீது ஆஃப் - Vibrate for - Ask - and store written answer in - What\'s your name? - "Enter your answer:" - Submit answer - Ask - and store spoken answer in - What\'s your name? + க்கு அதிர்வு + கேட்க + மற்றும் எழுதப்பட்ட பதிலை சேமிக்கவும் + உங்கள் பெயர் என்ன? + "உங்கள் பதிலை உள்ளிடவும்:" + பதிலை சமர்ப்பிக்கவும் + கேட்க + பேசும் பதிலை சேமிக்கவும் + உங்கள் பெயர் என்ன? - Pen down - Pen up - Set pen size to - Set pen color to - Clear - Stamp + பேனா கீழே + பேனா கீழே + பேனா அளவை அமைக்கவும் + பேனா நிறத்தை அமைக்கவும் + அழி + முத்திரை - Start sound - Start sound and wait - Stop all sounds - Set volume to - Change volume by - Speak - Hello! - and wait + ஒலியைத் தொடங்குங்கள் + ஒலியைத் தொடங்கி காத்திருங்கள் + எல்லா ஒலிகளையும் நிறுத்துங்கள் + அளவை அமைக்கவும் + அளவை மாற்றவும் + பேசு + வணக்கம்! + காத்திருங்கள் - Stitch + தைத்து + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch - When scene starts - When tapped - When - becomes true - Wait - When gamepad button - tapped - When NFC - Stop - this script - all scripts - other scripts of this actor or object + காட்சி தொடங்கும் போது + தட்டும்போது + எப்பொழுது + உண்மை ஆகிறது + காத்திருக்கவும் + கேம்பேட் பொத்தான் போது + தட்டப்பட்டது + NFC போது + நிறுத்து + இந்த ஸ்கிரிப்ட் + எல்லா ஸ்க்ரிப்ட் + இந்த நடிகர் அல்லது பொருளின் பிற ஸ்கிரிப்ட்கள் - "second" + "வினாடி" "seconds" - When you bounce off - any edge, actor, or object - When you receive - Broadcast - Broadcast and wait - Continue scene + நீங்கள் துள்ளும்போது + எந்த விளிம்பு, நடிகர் அல்லது பொருள் + நீங்கள் பெறும்போது + ஒளிபரப்பு + ஒளிபரப்பி காத்திருங்கள் + காட்சியைத் தொடரவும் காட்சியைத் தொடங்குங்கள் குறிப்பு சிந்தியுங்கள் சொல் - for + ஆக என்றென்றும் மீண்டும் வரை மீண்டும் செய்யவும் @@ -1085,9 +1084,9 @@ எதிர்பார்த்ததற்கு சமம்: மற்ற எல்லா ஸ்கிரிப்டுகளும் நிறுத்தப்படும் வரை காத்திருங்கள் "இல் ஒற்றை தட்டு" - Finish stage + நிலையை முடிக்க - time + நேரம் times வளையத்தின் முடிவு @@ -1126,66 +1125,66 @@ மேகங்கள் மேகங்கள் Clouds2 - Animal - Wings up - Wings down - Tweet1 - Tweet2 + விலங்கு + சிறகுகள் மேலே + சிறகுகள் கீழே + ட்வீட்1 + ட்வீட்2 பின்னணி மேகங்கள் மேகங்கள் Clouds2 - Bird - Bird Wings up - Bird Wings down - Bird Wings up left - Bird Wings down left - Tweet1 - Tweet2 - direction - My first Chromecast project + பறவை + பறவை சிறகுகள் மேலே + பறவை சிறகுகள் கீழே + பறவை சிறகுகள் இடது மேல்புரம் + பறவை சிறகுகள் இடது கீழ்புரம் + ட்வீட்1 + ட்வீட்2 + திசை + எனது முதல் Chromecast திட்டம் - My first AR.Drone 2.0 project - Take off - Flip - Up - Down - Left - Right - Forward + எனது முதல் AR.Drone 2.0 திட்டம் + பரக்கவும் + திருப்பு + மேலே + கீழே + இடது + வலது + முன்னோக்கி பின் - Turn left + இடப்பக்கம் திரும்பு வலதுபுறம் திரும்ப - Emergency - Text + அவசரம் + உரை X: - indoor with hull - indoor without hull - outdoor with hull - outdoor without hull + ஹல்லுடன் உட்புறம் + ஹல் இல்லாமல் உட்புறம் + ஹல்லுடன் வெளிபுரம் + ஹல் இல்லாமல் வெளிபுரம் - 3 meters - 5 meters - 10 meters - 100 meters + 3 மீட்டர் + 5 மீட்டர் + 10 மீட்டர் + 100 மீட்டர் - 200 mm/s - 700 mm/s - 1000 mm/s - 2000 mm/s + 200 மிமீ / வி + 700 மிமீ / வி + 1000 மிமீ / வி + 2000 மிமீ / வி - 40 degrees/s - 100 degrees/s - 200 degrees/s - 350 degrees/s + 40 டிகிரி / வி + 100 டிகிரி / வி + 200 டிகிரி / வி + 350 டிகிரி / வி - 5 degrees - 12 degrees - 20 degrees - 30 degrees + 5 டிகிரி + 12 டிகிரி + 20 டிகிரி + 30 டிகிரி %1$s அறிவிப்பு சேனல் @@ -1204,8 +1203,7 @@ பதிவிறக்கம் செயலில் உள்ளது பதிவிறக்கம் வெற்றிகரமாக "திறந்த" - கவனம். பேட்டரி குறைவாக உள்ளது. தற்போதைய - நிலை %d + கவனம். பேட்டரி குறைவாக உள்ளது. தற்போதைய நிலை %d அளவு: பேட்டரி குறைவாக உள்ளது (தானியங்கி தரையிறக்கம்). ஒன்று அல்லது அதற்கு மேற்பட்ட கேமராக்கள் பதிலளிக்கவில்லை. @@ -1219,10 +1217,7 @@ அவசரம் - This app needs the requested permissions to function properly. E.g., the -Camera brick needs access to the device\'s camera, the \"location\" formula element needs access to the -device\'s geolocation sensor, and in order to import and export projects from and to the local memory, the app -needs read and write access to it. You can always change permissions through your device\'s settings. + இந்த பயன்பாடு சரியாக செயல்பட கோரப்பட்ட அனுமதிகள் தேவை. எ.கா., கேமரா செங்கலுக்கு சாதனத்தின் கேமராவிற்கு அணுகல் தேவை, \"இருப்பிடம்\" சூத்திர உறுப்புக்கு சாதனத்தின் புவிஇருப்பிட சென்சார் அணுகல் தேவை, மேலும் உள்ளூர் நினைவகம் மற்றும் பயன்பாட்டிலிருந்து திட்டங்களை இறக்குமதி மற்றும் ஏற்றுமதி செய்ய. திட்டத்தை பதிவேற்றும் போது ஏதோ தவறு ஏற்பட்டது. திட்டத்தைப் பதிவிறக்கும் போது ஏதோ தவறு ஏற்பட்டது. @@ -1248,294 +1243,287 @@ needs read and write access to it. You can always change permissions through you உங்கள் வைஃபை ஜம்பிங் சுமோவுடன் இணைத்து மீண்டும் முயற்சிக்கவும். ஜம்பிங் சுமோ பேட்டரி குறைவாக சார்ஜ் செய்யப்பட்ட பேட்டரியைச் செருகவும், மீண்டும் முயற்சிக்கவும். - No Jumping Sumo support - No AR.Drone 2.0 support. - We cannot run an AR.Drone 2.0 project on your device. - Renaming an incompatible project is not possible. - Something went wrong while sharing the embroidery file. - Something went wrong. - Geolocation data is not available. - Something went wrong while saving the new description. - WhatsApp not installed - This script can\'t be added to a Chromecast - project. + ஜம்பிங் சுமோ ஆதரவு இல்லை + AR.Drone 2.0 ஆதரவு இல்லை. + உங்கள் சாதனத்தில் AR.Drone 2.0 திட்டத்தை எங்களால் இயக்க முடியாது. + பொருந்தாத திட்டத்தை மறுபெயரிடுவது சாத்தியமில்லை. + எம்பிராய்டரி கோப்பைப் பகிரும்போது ஏதோ தவறு ஏற்பட்டது. + ஏதோ தவறு நடைபெற்றிருக்கிறது. + புவிஇருப்பிட தரவு கிடைக்கவில்லை. + புதிய விளக்கத்தைச் சேமிக்கும்போது ஏதோ தவறு ஏற்பட்டது. + வாட்ஸ்அப் நிறுவப்படவில்லை + இந்த ஸ்கிரிப்டை Chromecast திட்டத்தில் சேர்க்க முடியாது. - Can\'t enable Bluetooth, please try turning it off and on again. - Paired devices - New devices - Looking for devices… - Search Bluetooth devices - Select device: - Connecting to your device.\nPlease wait… + புளூடூத்தை இயக்க முடியாது, தயவுசெய்து அதை அணைக்க முயற்சிக்கவும். + இணைக்கப்பட்ட சாதனங்கள் + புதிய சாதனம் + சாதனங்களைத் தேடுகிறது… + புளூடூத் சாதனங்களைத் தேடுங்கள் + சாதனத்தை தேர்ந்தெடு: + உங்கள் சாதனத்துடன் இணைக்கிறது. \n காத்திருங்கள்… - Connection to device failed! - No unpaired devices found - No paired devices found + சாதனத்துக்கான இணைப்பு தோல்வியடைந்தது! + இணைக்கப்படாத சாதனங்கள் எதுவும் கிடைக்கவில்லை + இணைக்கப்பட்ட சாதனங்கள் எதுவும் கிடைக்கவில்லை - Set Arduino digital pin - Set Arduino PWM~ pin - to + Arduino டிஜிட்டல் முள் அமைக்கவும் + Arduino PWM ~ pin ஐ அமைக்கவும் + க்கு - Set Raspberry Pi pin - to + ராஸ்பெர்ரி பை முள் அமைக்கவும் + க்கு If Raspberry Pi pin உண்மை, பின்னர் - When Raspberry Pi pin - changes to - high - low - Set Raspberry Pi PWM pin + ராஸ்பெர்ரி பை முள் போது + இதற்கு மாற்றப்பட்டது + உயர் + தாழ்ந்த + ராஸ்பெர்ரி பை முள் அமைக்கவும் - Raspberry Pi settings - GPIO Version - Error: Could not connect to %s : %d + ராஸ்பெர்ரி பை அமைப்புகள் + GPIO பதிப்பு + பிழை: %s உடன் இணைக்க முடியவில்லை: %d - Set NXT motor - to - speed - Turn NXT motor + NXT மோட்டார் அமைக்கவும் + க்கு + வேகம் + NXT மோட்டாரைத் திருப்புங்கள் மூலம் - Stop NXT motor - Play NXT tone - Duration - Frequency + NXT மோட்டாரை நிறுத்துங்கள் + NXT தொனியை இயக்கு + கால அளவு + அதிர்வலை ×100Hz A B C B+C - All - Sensor connected on port 1 - Sensor connected on port 2 - Sensor connected on port 3 - Sensor connected on port 4 - none - NXT touch sensor - NXT sound sensor - NXT light sensor - NXT light sensor active - NXT ultrasonic sensor - Sensor not found! - NXT sensor configuration - Disable info dialog - Project specific NXT settings are not shown when - opening a project. - The mapping of NXT sensors to ports is project - specific and can only be configured for opened projects. - The current project uses Lego Mindstorms NXT bricks or sensors. For - proper functionality please connect the sensors to the robot as follows - Port 1 - Port 2 - Port 3 - Port 4 - Do not show this message again. - Choose a port for connecting to %1$s. - EV3 sensor configuration - Project specific EV3 settings are not shown when - opening a project. - The mapping of EV3 sensors to ports is project - specific and can only be configured for opened projects. - The current project uses Lego Mindstorms EV3 bricks or sensors. For - proper functionality please connect the sensors to the robot as follows - Sensor connected on port 1 - Sensor connected on port 2 - Sensor connected on port 3 - Sensor connected on port 4 - none - EV3 touch sensor - EV3 infrared sensor - EV3 color sensor - EV3 color sensor ambient - Ev3 color sensor reflected - HiTechnic color sensor - NXT temperature sensor (°C) - NXT temperature sensor (°F) - NXT light sensor - NXT light sensor active - NXT sound sensor - NXT ultrasonic sensor + அனைத்தும் + போர்ட் 1 இல் சென்சார் இணைக்கப்பட்டுள்ளது + போர்ட் 2 இல் சென்சார் இணைக்கப்பட்டுள்ளது + போர்ட் 3 இல் சென்சார் இணைக்கப்பட்டுள்ளது + போர்ட் 4 இல் சென்சார் இணைக்கப்பட்டுள்ளது + எதுவுமில்லை + NXT தொடு உணரி + NXT ஒலி சென்சார் + NXT ஒளி சென்சார் + NXT லைட் சென்சார் செயலில் உள்ளது + NXT மீயொலி சென்சார் + சென்சார் கிடைக்கவில்லை! + NXT சென்சார் உள்ளமைவு + தகவல் உரையாடலை முடக்கு + திட்ட குறிப்பிட்ட NXT அமைப்புகள் எப்போது காட்டப்படாது ஒரு திட்டத்தைத் திறக்கிறது. + துறைமுகங்களுக்கு NXT சென்சார்களின் மேப்பிங் திட்டம் குறிப்பிட்ட மற்றும் திறந்த திட்டங்களுக்கு மட்டுமே கட்டமைக்க முடியும். + தற்போதைய திட்டம் லெகோ மைண்ட்ஸ்டார்ம்ஸ் என்எக்ஸ்டி செங்கற்கள் அல்லது சென்சார்களைப் பயன்படுத்துகிறது. ஐந்து சரியான செயல்பாடு பின்வருமாறு சென்சார்களை ரோபோவுடன் இணைக்கவும் + போர்ட் 1 + போர்ட் 2 + போர்ட் 3 + போர்ட் 4 + இச்செய்தியை மீண்டும் காட்ட வேண்டாம். + இணைக்க ஒரு துறைமுகத்தைத் தேர்வுசெய்க %1$s. + EV3 சென்சார் உள்ளமைவு + திட்ட குறிப்பிட்ட EV3 அமைப்புகள் ஒரு திட்டத்தைத் திறக்கிறபொழுது காட்டப்படாது. + துறைமுகங்களுக்கு EV3 சென்சார்களின் மேப்பிங் திட்டம் குறிப்பிட்ட மற்றும் திறந்த திட்டங்களுக்கு மட்டுமே கட்டமைக்க முடியும். + தற்போதைய திட்டம் லெகோ மைண்ட்ஸ்டார்ம்ஸ் EV3 செங்கற்கள் அல்லது சென்சார்களைப் பயன்படுத்துகிறது. ஐந்து சரியான செயல்பாடு பின்வருமாறு சென்சார்களை ரோபோவுடன் இணைக்கவும் + போர்ட் 1 இல் சென்சார் இணைக்கப்பட்டுள்ளது + போர்ட் 2 இல் சென்சார் இணைக்கப்பட்டுள்ளது + போர்ட் 3 இல் சென்சார் இணைக்கப்பட்டுள்ளது + போர்ட் 4 இல் சென்சார் இணைக்கப்பட்டுள்ளது + எதுவுமில்லை + EV3 தொடு உணரி + EV3 அகச்சிவப்பு சென்சார் + EV3 வண்ண சென்சார் + EV3 வண்ண சென்சார் சுற்றுப்புறம் + Ev3 வண்ண சென்சார் பிரதிபலித்தது + ஹைடெக்னிக் வண்ண சென்சார் + NXT வெப்பநிலை சென்சார் செல்சியஸ் + NXT வெப்பநிலை சென்சார் பாரன்ஹீட் + NXT ஒளி சென்சார் + NXT லைட் சென்சார் செயலில் உள்ளது + NXT ஒலி சென்சார் + NXT மீயொலி சென்சார் A B C - D + டி B+C - All - Play EV3 tone - for - Volume - % - Stop EV3 motor - Set EV3 motor - Turn EV3 motor + அனைத்தும் + EV3 தொனியை இயக்கு + ஆக + தொகுதி + சதவிதம் + EV3 மோட்டாரை நிறுத்துங்கள் + EV3 மோட்டார் அமைக்கவும் + EV3 மோட்டாரைத் திருப்புங்கள் மூலம் - Set EV3 LED status - Off + EV3 LED நிலையை அமைக்கவும் + ஆஃப் பச்சை சிவப்பு - Orange - Green flashing - Red flashing - Orange flashing - Green pulse - Red pulse - Orange pulse + ஆரஞ்சு + பச்சை ஒளிர்கிறது + சிவப்பு ஒளிர்கிறது + ஆரஞ்சு ஒளிரும் + பச்சை துடிப்பு + சிவப்பு துடிப்பு + ஆரஞ்சு துடிப்பு - Take off / land AR.Drone 2.0 - Play AR.Drone 2.0 flash animation - Flip AR.Drone 2.0 - Move AR.Drone 2.0 left - Move AR.Drone 2.0 right - Move AR.Drone 2.0 forward - Move AR.Drone 2.0 backward - Move AR.Drone 2.0 up - Move AR.Drone 2.0 down - Emergency AR.Drone 2.0 - Turn AR.Drone 2.0 right - Turn AR.Drone 2.0 left - Set config AR.Drone 2.0 - Switch AR.Drone 2.0 camera - Altitude limit - Vertical speed limit - Rotation speed limit - Tilt limit + AR.Drone 2.0 ஐ எடுத்துக் கொள்ளுங்கள் + AR.Drone 2.0 ஃபிளாஷ் அனிமேஷனை இயக்கு + AR.Drone 2.0 ஐ புரட்டுங்கள் + AR.Drone 2.0 ஐ இடதுபுறமாக நகர்த்தவும் + AR.Drone 2.0 ஐ வலதுபுறமாக நகர்த்தவும் + AR.Drone 2.0 ஐ முன்னோக்கி நகர்த்தவும் + AR.Drone 2.0 ஐ பின்னோக்கி நகர்த்தவும் + AR.Drone 2.0 ஐ மேலே நகர்த்தவும் + AR.Drone 2.0 ஐ கீழே நகர்த்தவும் + அவசர AR.Drone 2.0 + AR.Drone 2.0 ஐ வலதுபுறம் திருப்பவும் + AR.Drone 2.0 இடதுபுறம் திரும்பவும் + கட்டமைப்பு AR.Drone 2.0 ஐ அமைக்கவும் + AR.Drone 2.0 கேமராவை மாற்றவும் + உயர வரம்பு + செங்குத்து வேக வரம்பு + சுழற்சி வேக வரம்பு + சாய்வு வரம்பு உடன் - power + ஆற்றல் - Blink green red - Blink green - Blink red - Blink orange - Snake green red - Fire - Standard + பச்சை சிவப்பு சிமிட்டல் + பச்சை சிமிட்டல் + சிவப்பு சிமிட்டல் + ஆரஞ்சு சிமிட்டல் + பாம்பு பச்சை சிவப்பு + தீ + வழக்கமான சிவப்பு பச்சை - Red snake - Blank - Right missile - Left missile - Double missile - Front left green others red - Front right green others red - Rear right green others red - Rear left green others red - Left green right red - Left red right green - Blink standard + சிவப்பு பாம்பு + வெற்று + வலது ஏவுகணை + இடது ஏவுகணை + இரட்டை ஏவுகணை + முன் இடது பச்சை மற்றது சிவப்பு + முன் வலது பச்சை மற்றது சிவப்பு + பின் வலது பச்சை மற்றது சிவப்பு + பின் இடது பச்சை மற்றது சிவப்பு + இடது பச்சை வலது சிவப்பு + இடது சிவப்பு வலது பச்சை + ஒளிரும் தரநிலை - Move Jumping Sumo forward - Move Jumping Sumo backward - Animations Jumping Sumo - No Jumping Sumo sound - Jump Jumping Sumo long - Jump Jumping Sumo high - Turn Jumping Sumo left - Turn Jumping Sumo right + ஜம்பிங் சுமோவை முன்னோக்கி நகர்த்தவும் + ஜம்பிங் சுமோவை பின்னோக்கி நகர்த்தவும் + அனிமேஷன்ஸ் ஜம்பிங் சுமோ + ஜம்பிங் சுமோ ஒலி இல்லை + ஜம்பிங் சுமோ தாண்டும் நீளம் + ஜம்பிங் சுமோ தாண்டும் உயரம் + ஜம்பிங் சுமோவை இடது பக்கம் திருப்புங்கள் + ஜம்பிங் சுமோவை வலது பக்கம் திருப்புங்கள் டிகிரிக்கள் - Flip Jumping Sumo - Taking picture Jumping Sumo + ஃபிளிப் ஜம்பிங் சுமோ + படம் எடுக்கும் ஜம்பிங் சுமோ - My first Jumping Sumo project - Jumping Sumo video - Forward - Backward - Animations + எனது முதல் ஜம்பிங் சுமோ திட்டம் + ஜம்பிங் சுமோ வீடியோ + முன்னோக்கி + பின்னோக்கி + அசைவூட்டங்கள் ஒலி - No sound - Jump long - Jump high - Turn left + சத்தம் இல்லை + நீளமாக ஜம்ப் செய்யவும் + உயரமாக ஜம்ப் செய்யவும் + இடப்பக்கம் திரும்பு வலதுபுறம் திரும்ப - Flip - Taking pictures + திருப்பு + படம் எடுக்க - Spin - Tab + சுழல் + தத்தல் Slowshake - Metronome - Ondulation - Spinjump - Spiral - Slalom + கால அளவு சாதனம் + ஆண்டுலேசென் + ஸ்பின்ஜம்ப் + சுழல் + ஸ்லாலோம் - Volume - Normal - Robot - Insect - Monster + தொகுதி + இயல்பு + ரோபோ + பூச்சி + மான்ஸ்டர் - Stop Phiro motor - Move Phiro motor forward - Move Phiro motor backward - Speed + பைரோ மோட்டாரை நிறுத்துங்கள் + பைரோ மோட்டாரை முன்னோக்கி நகர்த்தவும் + பைரோ மோட்டாரை பின்னோக்கி நகர்த்தவும் + வேகம் - If Phiro - is activated + ஃபிரோ என்றால் + செயல்படுத்தப்பட்டது - Play Phiro music\n - Duration - tone - seconds + பைரோ இசையை வாசிக்கவும்\n + கால அளவு + தொனி + விநாடிகள் - Set Phiro light + பைரோ ஒளியை அமைக்கவும் சிவப்பு பச்சை நீலம் - Do - Re - Mi - Fa - So - La - Ti + டோ + ரே + மி + ஃபா + சோ + லா + தீ - Left - Right - Both + இடது + வலது + இரண்டும் - Left - Right - Both + இடது + வலது + இரண்டும் - Front Left Sensor - Front Right Sensor - Side Left Sensor - Side Right Sensor - Bottom Left Sensor - Bottom Right Sensor + முன் இடது சென்சார் + முன் வலது சென்சார் + இடது பக்க சென்சார் + வலது பக்க சென்சார் + கீழ் இடது சென்சார் + கீழ் வலது சென்சார் - red - green - blue + சிவப்பு + பச்சை + நீலம் தகவல்கள் - true - false + சரி + தவறு . - Formula editor - Changes saved. - Changes discarded! - Formula is not valid! - Define input value - Formula too long! - Properties of this actor or object + சூத்திரத் தொகுப்பி + மாற்றங்கள் சேமிக்கப்பட்டன. + மாற்றங்கள் நிராகரிக்கப்பட்டன! + சூத்திரம் செல்லுபடியாகாது! + உள்ளீட்டு மதிப்பை வரையறுக்கவும் + ஃபார்முலா மிக நீளமானது! + இந்த நடிகர் அல்லது பொருளின் பண்புகள் ( ) sine @@ -1550,14 +1538,14 @@ needs read and write access to it. You can always change permissions through you (10) pi - color - square root + நிறம் + வர்க்க மூலம் (4) - random value from to + சீரற்ற மதிப்பு முதல் வரை (1,6) absolute value (1) - round + சுற்று (1.6) modulo (3,2) @@ -1571,161 +1559,161 @@ needs read and write access to it. You can always change permissions through you (-1, 0) exponent (1) - power + ஆற்றல் (2,3) - floor + தரை (0.7) - ceiling + உட்கூரை (0.3) - maximum of + அதிகபட்சம் (5,4) - minimum of + குறைந்தபட்சம் (7,2) - true - false - length + சரி + தவறு + நீளம் (\'hello world\') - letter + கடிதம் (1,\'hello world\') - join + சேர் (\'hello\',\' world\') - regular expression - (\' an? ([^ .]+)\',\'I am a panda.\') - arduino digital pin - arduino analog pin - raspberry pi pin + வழக்கமான வெளிப்பாடு + (\'an? ([^.] +)\', \'நான் ஒரு பாண்டா.\') + arduino டிஜிட்டல் முள் + arduino அனலாக் முள் + ராஸ்பெர்ரி பை முள் (3) - stage touch x - stage touch y - stage is touched - stage touch x - stage touch y - stage is touched - last stage touch index + நிலை தொடு x + நிலை தொடு y + மேடை தொட்டது + நிலை தொடு x + நிலை தொடு y + மேடை தொட்டது + கடைசி நிலை தொடு குறியீடு (1) - item - (1,*list name*) - contains - (*list name*,1) - number of items - (*list name*) - touches actor or object - touches edge - touches finger - acceleration x - acceleration y - acceleration z - compass direction - latitude - longitude - location accuracy - altitude - inclination x - inclination y - loudness - year - month - day - weekday - hour - minute - second - drone battery status - drone emergency state - drone flying - drone initialized - drone usb active - drone usb remaining time - drone camera ready - drone record ready - drone camera recording - drone camera number of frames - NXT sensor 1 - NXT sensor 2 - NXT sensor 3 - NXT sensor 4 - EV3 sensor 1 - EV3 sensor 2 - EV3 sensor 3 - EV3 sensor 4 - NXT touch - NXT sound - NXT light - NXT light active - NXT ultrasonic - EV3 touch - EV3 infrared - EV3 color - EV3 ambient color - EV3 reflected color - EV3 hitechnic color - EV3 NXT temperature in °C - EV3 NXT temperature in °F - EV3 NXT light - EV3 NXT light active - EV3 NXT sound - EV3 NXT ultrasonic - gamepad A pressed - gamepad B pressed - gamepad up pressed - gamepad down pressed - gamepad left pressed - gamepad right pressed - phiro front left sensor - phiro front right sensor - phiro side left sensor - phiro side right sensor - phiro bottom left sensor - phiro bottom right sensor - nfc tag id - nfc tag message - position x - position y - transparency - brightness - size - direction - layer - x velocity - y velocity - angular velocity - look number - look name - background number - background name - distance to touch position - Compute + உருப்படி + (1, * பட்டியல் பெயர் *) + உள் அடக்கி வை + ( * பட்டியல் பெயர் *,1) + பொருட்களின் எண்ணிக்கை + ( * பட்டியல் பெயர் *) + நடிகர் அல்லது பொருளைத் தொடும் + விளிம்பைத் தொடும் + விரலைத் தொடும் + முடுக்கம் x + முடுக்கம் y + முடுக்கம் z + திசைகாட்டி திசை + அட்ச ரேகை + தீர்க்கரேகை + இருப்பிட துல்லியம் + உயரம் + சாய்வு x + சாய்வு y + உரப்பு + ஆண்டு + மாதம் + நாள் + வாரநாட்கள் + மணிநேரம் + நிமிடம் + வினாடி + ட்ரோன் பேட்டரி நிலை + ட்ரோன் அவசர நிலை + ட்ரோன் பறக்கும் + ட்ரோன் துவக்கப்பட்டது + ட்ரோன் யு. எஸ். பி செயலில் உள்ளது + ட்ரோன் யு. எஸ். பி மீதமுள்ள நேரம் + ட்ரோன் கேமரா தயார் + ட்ரோன் பதிவு தயாராக உள்ளது + ட்ரோன் கேமரா பதிவாகிரது + ட்ரோன் கேமரா பிரேம்களின் எண்ணிக்கை + NXT சென்சார் 1 + NXT சென்சார் 2 + NXT சென்சார் 3 + NXT சென்சார் 4 + EV3 சென்சார் 1 + EV3 சென்சார் 2 + EV3 சென்சார் 3 + EV3 சென்சார் 4 + NXT தொடுதல் + NXT ஒலி + NXT ஒளி + NXT ஒளி செயலில் உள்ளது + NXT மீயொலி + EV3 தொடுதல் + EV3 அகச்சிவப்பு + EV3 நிறம் + EV3 சுற்றுப்புற நிறம் + EV3 நிறத்தை பிரதிபலித்தது + EV3 ஹைடெக்னிக் நிறம் + செல்சியஸில் EV3 NXT வெப்பநிலை + பாரன்ஹீட்டில் EV3 NXT வெப்பநிலை + EV3 NXT ஒளி + EV3 NXT ஒளி செயலில் உள்ளது + EV3 NXT ஒலி + EV3 NXT மீயொலி + கேம்பேட் ஏ அழுத்தப்பட்டது + கேம்பேட் பீ அழுத்தப்பட்டது + கேம்பேட் மேல் அழுத்தப்பட்டது + கேம்பேட் கீழ் அழுத்தப்பட்டது + கேம்பேட் இடது அழுத்தப்பட்டது + கேம்பேட் வலது அழுத்தப்பட்டது + பைரோ முன் இடது சென்சார் + பைரோ முன் வலது சென்சார் + பைரோ இடது பக்க சென்சார் + பைரோ வலது பக்க சென்சார் + பைரோ கீழ் இடது சென்சார் + பைரோ கீழ் வலது சென்சார் + nfc டேக் ஐடி + nfc குறிச்சொல் செய்தி + நிலை x + நிலை y + வெளிப்படைத்தன்மை + பிரகாசம் + அளவு + திசை + அடுக்கு + x வேகம் + y வேகம் + கோண வேகம் + எண் பார் + பெயர் பார் + பின்னணி எண் + பின்னணி பெயர் + தொடுவதற்கான தூரம் + கம்ப்யூட் பொருள் - Functions - Logic + பணிகள் + தர்க்கம் சென்ஸார்ஸ் - Device sensors - Maths - Text - Lists - Logical (Boolean) operators and constants - Comparison operators - General properties - Motion properties - Face detection - Date and time - Touch detection - Lego Mindstorms NXT - Lego Mindstorms EV3 - Arduino + சாதன உணரிகள் + கணிதம் + உரை + பட்டியல்கள் + தருக்க (பூலியன்) ஆபரேட்டர்கள் மற்றும் மாறிலிகள் + ஒப்பீட்டு ஆபரேட்டர்கள் + பொது பண்புகள் + இயக்க பண்புகள் + முகம் கண்டறிதல் + தேதி மற்றும் நேரம் + தொடு கண்டறிதல் + லெகோ மைண்ட்ஸ்டார்ம்ஸ் என்.எக்ஸ்.டி. + லெகோ மைண்ட்ஸ்டார்ம்ஸ் ஈ.வி 3 + ஆர்டுயினோ Phiro ராஸ்பெர்ரி பை - Drone + ட்ரோன் NFC Chromecast Abc < > - and - or - not + மற்றும் + அல்லது + இல்லை = @@ -1734,122 +1722,107 @@ needs read and write access to it. You can always change permissions through you - ÷ ^ - delete - New variable - New list - Do you want to save your changes? - Save changes? - New text - Change text - current items - Make it a list - face is visible - face size - face x position - face y position - Formula editor - With the formula editor you can create mathematical and - logical formulas that you can use in your bricks.\n\nYou can continue through this little intro by tapping - the \"Next\" button in the bottom right corner, and you can skip it by clicking the \"SKIP\" button in the - bottom left corner. - Input field - Here you can see and edit your formula. + அழித்துவிடு + புதிய மாறி + புதிய பட்டியல் + மாற்றங்களைச் சேமிக்க விரும்புகிறீர்களா? + மாற்றங்களை சேமிக்க வேண்டுமா? + புதிய உரை + பெரிய உரை + தற்போதைய உருப்படிகள் + அதை ஒரு பட்டியலாக ஆக்குங்கள் + முகம் தெரியும் + முகம் அளவு + முகம் x நிலை + முகம் y நிலை + சூத்திரத் தொகுப்பி + ஃபார்முலா எடிட்டர் மூலம் நீங்கள் கணிதத்தை உருவாக்கலாம் மற்றும் + உங்கள் செங்கற்களில் நீங்கள் பயன்படுத்தக்கூடிய தருக்க சூத்திரங்கள்.\n\nதட்டுவதன் மூலம் இந்த சிறிய அறிமுகத்தை நீங்கள் தொடரலாம் கீழ் வலது மூலையில் உள்ள \"அடுத்து\" பொத்தானை, மேலும் \"ஸ்கிப்\" பொத்தானைக் கிளிக் செய்வதன் மூலம் அதைத் தவிர்க்கலாம் கீழ் இடது மூலையில். + உள்ளீட்டுப் புலம் + இங்கே நீங்கள் உங்கள் சூத்திரத்தைக் காணலாம் மற்றும் திருத்தலாம். விசைப்பலகை - This is where you can create - your formula, just like on a calculator. - Compute - To show your formula\'s current result, you can - use \"Compute\". + இங்குதான் நீங்கள் உங்கள் சூத்திரத்தை உருவாக்க முடியும், ஒரு கால்குலேட்டரைப் போலவே. + கம்ப்யூட் + உங்கள் சூத்திரத்தின் (விதிமுறை) தற்போதைய முடிவைக் காட்ட, \"கணக்கிடு\" பயன்படுத்தவும். பொருள் - This is a collection of values that describe the properties of your - current actor or object. Examples are the x- and y-coordinates, or the current speed. - Functions - Like a calculator, the formula editor offers - many mathematical functions.\nYou can find trigonometric functions such as \"sin\" and \"cos\", - a random number generator, and text and list functions. - Logic - Logic is used to compare values and combine logical formulas.\nTo - compare values you can use logical operations such as \">\" (greater than) or \"=\" (equals).\nTo combine - logical formulas you can use logical operations such as \"AND\", \"OR\" and \"NOT\". + இது உங்கள் தற்போதைய நடிகர் அல்லது பொருள்களின் பண்புகளை விவரிக்கும் மதிப்புத் தொகுப்பாகும். எடுத்துக்காட்டுகள் x- மற்றும் y- ஆயத்தொகுப்புகள் அல்லது தற்போதைய வேகம். + பணிகள் + ஒரு கால்குலேட்டரைப் போல, ஃபார்முலா எடிட்டர் வழங்குகிறது +         பல கணித செயல்பாடுகள். \n \"சைன்\" மற்றும் \"காஸ்\" போன்ற முக்கோணவியல் செயல்பாடுகளை நீங்கள் காணலாம், +         ஒரு சீரற்ற எண் ஜெனரேட்டர் மற்றும் உரை மற்றும் பட்டியல் செயல்பாடுகள். + தர்க்கம் + மதிப்புகளை ஒப்பிடுவதற்கும் தருக்க சூத்திரங்களை இணைப்பதற்கும் தர்க்கம் பயன்படுத்தப்படுகிறது. \n \">\" (விட பெரியது) அல்லது \"=\" (சமம்) போன்ற தருக்க செயல்பாடுகளை நீங்கள் பயன்படுத்தக்கூடிய மதிப்புகளை ஒப்பிடுங்கள். \n தருக்க சூத்திரங்களை இணைக்க நீங்கள் \"AND\", \"OR\" மற்றும் \"NOT\" போன்ற தருக்க செயல்பாடுகளைப் பயன்படுத்தலாம். சென்ஸார்ஸ் - In \"Sensors\" you can find information that your - device records.\nFor example, the tilt of your device, or the loudness of your surroundings. + \"சென்சார்கள்\" இல் உங்கள் சாதனம் பதிவுசெய்யும் தகவலைக் காணலாம். \n எடுத்துக்காட்டாக, உங்கள் சாதனத்தின் சாய்வு அல்லது உங்கள் சுற்றுப்புறங்களின் சத்தம். தகவல்கள் - Variables and lists that are used in your project can be found here. - \nYou can simply insert these in your formula, or add new ones. + உங்கள் திட்டத்தில் பயன்படுத்தப்படும் மாறிகள் மற்றும் பட்டியல்களை இங்கே காணலாம். \n நீங்கள் இதை உங்கள் சூத்திரத்தில் செருகலாம் அல்லது புதியவற்றைச் சேர்க்கலாம். - Show variable - Hide variable - at - size: - color: - aligned - centered - left - right - Pick color + மாறியை காட்டுக + மாறியை மறைக்கவும் + இல் + அளவு: + நிறம்: + சீரமைக்கப்பட்டது + மையம் + இடது + வலது + வண்ணம் தேர்ந்தெடுக்கவும் - Turn camera + கேமராவைத் திருப்புங்கள் மீது ஆஃப் - Use camera - front - rear - Wait until - is true + கேமராவைப் பயன்படுத்துங்கள் + முன் + பின் + அதுவரை காத்திரு + உண்மை A B - up - down - left - right - Please connect to your Chromecast first - Your project uses Chromecast bricks and can\'t be started - locally - Cast to - Cast button - Ready to cast to - Chromecast features disabled. Please enable cast features in the settings. - Searching for Chromecast devices - .\nDon\'t see your device? Try turning your device\'s Wifi off - and on. - Connection timeout. Please try again. - Paused + மேலே + கீழே + இடது + வலது + முதலில் உங்கள் Chromecast உடன் இணைக்கவும் + உங்கள் திட்டம் Chromecast செங்கற்களைப் பயன்படுத்துகிறது, ஆகவே உள்நாட்டில் தொடங்க முடியாது + ஒப்படைக்கவும் + வார்ப்பு பொத்தான் + ஒளிபரப்பத் தயாராக உள்ளது + Chromecast அம்சங்கள் முடக்கப்பட்டுள்ளன. அமைப்புகளில் வார்ப்பு அம்சங்களை இயக்கவும். + Chromecast சாதனங்களைத் தேடுகிறது + \nஉங்கள் சாதனத்தைப் காணவில்லையா? உங்கள் சாதனத்தின் வைஃபை அணைத்து ஆண் செய்து மீண்டும் முயற்சிக்கவும். + இணைப்பு நேரம் முடிந்தது. தயவு செய்து மீண்டும் முயற்சிக்கவும். + இடை நிறுத்தப்பட்டது - Warning! - Deleting a variable that is still in use is dangerous. Are you sure? - Yes, delete anyway! + எச்சரிக்கை! + இன்னும் பயன்பாட்டில் உள்ள ஒரு மாறியை நீக்குவது ஆபத்தானது. உறுதியாக நீக்கவேண்டுமா? + ஆம், நீக்குக! - Your project gets uploaded to the app\’s sharing site where others - can use and download it. You can also download your project as a standalone app. - Upload failed. Please check your internet connection and try - again! - Show project + உங்கள் திட்டம் பயன்பாட்டின் பகிர்வு தளத்தில் பதிவேற்றப்படும் +மற்றவர்கள் அதைப் பயன்படுத்தலாம் மற்றும் பதிவிறக்கலாம். உங்கள் திட்டத்தை முழுமையான செயலியாகவும் பதிவிறக்கலாம். + பதிவேற்றம் தோல்வி. உங்களுடைய இணைப்பை சரி பார்த்து மீண்டும் முயற்சி செய்யவும்! + திட்டத்தைக் காண்பிக்கவும் - Got it - Enable to show hints - Show hints - All bricks are sorted in categories. Choose the category you are looking for. - To add a brick to your script, tap on the brick you want to use. - The script defines the behavior of your actor or object. To add bricks to the script, - tap the \"+\" symbol. - Here you can find the different appearances of your actor or object. To add a new look, - tap the \"+\" symbol. - Here you can add new sounds to your actor or object. Remember using a brick from the - sound category. - Your program consists of different actors and objects that can interact with each other. - To add a new actor or object, tap the \"+\" symbol. + புரிந்தது + குறிப்புகளைக் காட்ட இயக்கவும் + உதவிக் குறிப்பைக் காட்டவும் + அனைத்து செங்கற்களும் வகைகளாக வரிசைப்படுத்தப்படுகின்றன. நீங்கள் தேடும் வகையைத் தேர்வுசெய்க. + உங்கள் ஸ்கிரிப்ட்டில் ஒரு செங்கலைச் சேர்க்க, நீங்கள் பயன்படுத்த விரும்பும் செங்கலைத் தட்டவும். + ஸ்கிரிப்ட் உங்கள் நடிகர் அல்லது பொருளின் நடத்தையை வரையறுக்கிறது. ஸ்கிரிப்ட்டில் செங்கற்களைச் சேர்க்க, \"+\" சின்னத்தைத் தட்டவும். + உங்கள் நடிகர் அல்லது பொருளின் வெவ்வேறு தோற்றங்களை இங்கே காணலாம். புதிய தோற்றத்தைச் சேர்க்க, \"+\" சின்னத்தைத் தட்டவும். + இங்கே நீங்கள் உங்கள் நடிகர் அல்லது பொருளுக்கு புதிய ஒலிகளைச் சேர்க்கலாம். ஒலி வகையிலிருந்து ஒரு செங்கலைப் பயன்படுத்துவதை நினைவில் கொள்க. + உங்கள் நிரல் ஒருவருக்கொருவர் தொடர்பு கொள்ளக்கூடிய வெவ்வேறு நடிகர்கள் மற்றும் பொருள்களைக் கொண்டுள்ளது. +   புதிய நடிகர் அல்லது பொருளைச் சேர்க்க, \"+\" சின்னத்தைத் தட்டவும். - Your device\'s language + உங்கள் சாதனத்தின் மொழி - % - + சதவீதம் + (ஹெர்ட்ஸ்) அதிர்வெண் diff --git a/catroid/src/main/res/values-te/strings.xml b/catroid/src/main/res/values-te/strings.xml index 9ea5bb608a9..e5e0b05e13c 100644 --- a/catroid/src/main/res/values-te/strings.xml +++ b/catroid/src/main/res/values-te/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-th/strings.xml b/catroid/src/main/res/values-th/strings.xml index 0a6b9bc9077..7816df1c8d7 100644 --- a/catroid/src/main/res/values-th/strings.xml +++ b/catroid/src/main/res/values-th/strings.xml @@ -1,5 +1,4 @@ - "วางที่" - วางสายตา + Place visually "X: " "Y: " "ตั้งค่า X เป็น" @@ -918,6 +917,11 @@ A-8010 กราซ, ออสเตรีย \n ตะเข็บ + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch เมื่อฉากเริ่ม @@ -1130,7 +1134,7 @@ A-8010 กราซ, ออสเตรีย \n ไม่สามารถเปิดใช้งานบลูทูธ ได้โปรดลองปิดและเปิดใหม่อีกครั้ง อุปกรณ์ที่จับคู่ไว้ อุปกรณ์ใหม่ - กำลังมองหาอุปกรณ์… + กำลังมองหาอุปกรณ… ค้นหาอุปกรณ์ Bluetooth เลือกอุปกรณ์: กำลังเชื่อมต่อกับอุปกรณ์ \nกรุณารอ… diff --git a/catroid/src/main/res/values-tr/strings.xml b/catroid/src/main/res/values-tr/strings.xml index 229da626f5b..5c78dfe528c 100644 --- a/catroid/src/main/res/values-tr/strings.xml +++ b/catroid/src/main/res/values-tr/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch Program başladığında diff --git a/catroid/src/main/res/values-uk/strings.xml b/catroid/src/main/res/values-uk/strings.xml index df2687a31cc..1c5c2f39d38 100644 --- a/catroid/src/main/res/values-uk/strings.xml +++ b/catroid/src/main/res/values-uk/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-ur/strings.xml b/catroid/src/main/res/values-ur/strings.xml index 378773177e2..3cc7edeb3c4 100644 --- a/catroid/src/main/res/values-ur/strings.xml +++ b/catroid/src/main/res/values-ur/strings.xml @@ -1,5 +1,4 @@ - "جگہ رکھیں" - بظاہر جگہ رکھیں + Place visually "ایکس:" "وائے: " "ایکس سیٹ کریں" @@ -1111,6 +1110,11 @@ سلائی + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch جب منظر شروع ہوتا ہے diff --git a/catroid/src/main/res/values-vi/strings.xml b/catroid/src/main/res/values-vi/strings.xml index b8fcfe0fab1..99099a0b227 100644 --- a/catroid/src/main/res/values-vi/strings.xml +++ b/catroid/src/main/res/values-vi/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts diff --git a/catroid/src/main/res/values-zh-rCN/strings.xml b/catroid/src/main/res/values-zh-rCN/strings.xml index 19ceed9012c..64686b73947 100644 --- a/catroid/src/main/res/values-zh-rCN/strings.xml +++ b/catroid/src/main/res/values-zh-rCN/strings.xml @@ -1,5 +1,4 @@ - 此名称已被使用,请另选一个。 - You only put spaces into the text field, please enter a text - using letters, numbers or other special characters. + 您只能在空格放入文本字段,请使用字母、数字或其它特殊字符. +。 请输入文本 此列表中还没有项目。请先添加一些项目。 @@ -260,7 +259,7 @@ 转换 合并 您无法撤消! - 行为者和物体 + 对象和物体 背包 复制 @@ -291,109 +290,109 @@ - Pack %d scenes + 包 %d 场景 - Unpack %d scenes + 解包 %d 场景 复制 %d 个场景 - Delete %d scenes + 删除 %d 个场景 - Rename %d scenes + 重命名 %d 场景 - Pack %d actors or objects + 包 %d 个对象或物体 - Unpack %d actors or objects + 解包 %d 个对象或物体 - Copy %d actors or objects + 复制 %d 个对象或物体 - Delete %d actors or objects + 删除 %d 个对象或物体 - Rename %d actors or objects + 重命名 %d 个对象或物体 - Pack %d looks + 包 %d 外观 - Unpack %d looks + 解包 %d 外观 - Copy %d looks + 复制 %d 个外观 - Delete %d looks + 删除 %d 个外观 - Rename %d looks + 重命名 %d 外观 - Pack %d sounds + 包 %d 音响 - Unpack %d sounds + 解包 %d 音响 - Copy %d sounds + 复制 %d 音响 - Delete %d sounds + 删除 %d 个音响 - Rename %d sounds + 重命名 %d 音响 - Copy %d NFC tags + 复制 %d NFC 标签 - Delete %d NFC tags + 删除 %d NFC 标签 - Rename %d NFC tags + 重命名 %d NFC 标签 - Pack %d bricks + 包 %d 积木 - Unpack %d scripts + 解包 %d 个脚本 - Copy %d bricks + 复制 %d 个积木。 - Delete %d bricks + 删除 %d 砖块 - Delete %d scripts + 删除 %d 个脚本 - Delete %d data items + 删除 %d 个数据项 - New scene + 新场景 - Delete these projects? + 删除这些项目? - Delete these scenes? + 删除这些场景吗? - Delete these actors or objects? + 删除这些对象或物体? 删除这些外观吗? @@ -402,32 +401,32 @@ 删除这些声音吗? - Delete these tags? + 删除这些标签? - Delete these scripts? + 删除这些脚本? - Delete these bricks? + 删除这些积木吗? - Project name - Scene name - Actor or object name - Group name - Script group name - Look name - Sound name - NFC tag name + 项目名称 + 场景名称 + 对象或物体名称 + 群组名称 + 脚本组名称 + 外观名称 + 音响名称 + NFC 标签名称 文本 名称 - Last access: %s, size: %s - today, %s - Actors and objects: %d, looks: %d, sounds: %d - Bricks: %d, looks: %d, sounds: %d - Resolution: %s, size: %s - Duration: %s + 最后访问: %s,大小: %s + 今天, %s + 对象和物体: %d, 外观: %d, 音响: %d + 积木: %d, 外观: %d, 声音: %d + 分辨率: %s, 大小: %s + 时长:%s Duration: %s, size: %s @@ -441,7 +440,7 @@ 新建组 - New scene + 新场景 @@ -696,10 +695,7 @@ Find the previous, outdated, version of our privacy policy (2.0) here: http://developer.catrobat.org/privacy_policy_2-0 - It is necessary to agree to the Privacy Policy to register or to - continue using your account. If you do not want us to collect this data, you can delete your - account via your profile page on our https://share.catrob.at/ website. - + 必须同意隐私政策才能注册或继续使用您的帐户。 如果您不希望我们收集此数据,则可以删除您的账号通过我们的https://share.catrob.at/网站。 关于本应用 @@ -716,14 +712,14 @@ 上传 上传程序 描述: - Please choose up to three categories + 请选择最多三个类别 - Save project to external storage + 保存项目到外部存储 " " - Saving project to external storage. + 保存项目到外部存储。 " " - "Saved project to %1$s" - Failed to save project, not enough memory is available! + "项目保存到 %1$s" + 保存项目失败,可用内存量不够! 录音机 @@ -733,33 +729,33 @@ 移动积木 - Move script + 移动脚本 删除积木 复制积木 - Copy script + 复制脚本 编辑公式 删除脚本 启用积木 禁用积木 - Highlight brick parts - Enable script - Disable script + 明亮积木部分 + 启用脚本 + 禁用脚本 帮助 禁用/启用 游戏场景: 第一个场景 (%1$s) - Current scene (%1$s) + 当前场景(%1$s) 登录 用户名 密码 - Forgot your password? + 忘记您的密码? 新账户已创建 登录成功! - Login invalid + 登录无效 注册代表你同意我们的 使用与服务条例 登录 @@ -768,43 +764,43 @@ 邮箱 感谢您的注册 ! 请选择一个用户名: - Please enter a username. + 请输入用户名。 用户名不建议使用您的真实姓名。 - Someone else already uses this name. Please choose a different one! + 其他人已经使用了这个名字。请选择一个不同的名字! 显示密码 - Something went wrong during sign in. - Google sign-in error. Status: %s - Session expired, please log in. - Sign in with Google - Empty username - Email address cannot be used as user names - Username should only contain letters (a–z), numbers (0–9), - dashes (-), underscores (_), and periods (.). - Username should not start with dashes (-), underscores (_), or - periods (.). - Invalid email format - Password field is empty - Password should be at least 6 characters + 在登录时发生了错误。 + 谷歌登录错误。状态: %s + 您的会话已过期,请登录。 + 通过 Google 登录 + 用户名为空 + 电子邮件地址不能用作用户名 + 用户名只能包含字母 (a-z), 数字 (0-9), +dash(-), 下划线 (_), 和 句号(.). + 用户名不应以破折号 (-), 下划线 (_), 或 +句号(.). + 电子邮件格式无效 + 密码字段为空 + 密码长度必须至少为6个字符 密码不匹配 - Confirm password field is empty - Username already exists - Email address already exists + 确认密码字段为空 + 用户名已存在 + 电子邮件地址已存在 - Project exists. - A project with this name already exists. - Overwrite project + 项目已存在。 + 有一个同名的项目已存在。 + 覆写项目 重命名已下载的程序 - Untitled song - Track 1 + 无标题歌曲 + 曲目 1 文字转语音引擎未安装!\n你要安装它么? 组件不可用 - Unfortunately this project does not work on your device. - The following components are unavailable:\n\n + 不幸此项目无法在您的设备上运行。 +以下组件不可用:\n\n 另一台设备连接到Jumping Sumo。当然, 你是无人机的唯一控制者。 \u2022 震动器\n \u2022 加速度传感器\n @@ -812,15 +808,14 @@ \u2022 电子罗盘\n \u2022 GPS\n \u2022 文字转语音引擎\n - \u2022 Rear camera\n + \u2022 后置摄像头\n \u2022 人脸侦测\n \u2022 Jumping Sumo\n - \u2022 Front camera\n + \u2022 前置摄像头\n \u2022 未知部件\n NFC 不可用 - Please activate NFC and press Back to return to the app. - Using NFC and face detection at the same time might lead to performance - issues. + 请激活 NFC 并按回车返回应用程序。 + 同时使用 NFC 和面部检测可能会导致性能问题。 后退 @@ -830,7 +825,7 @@ 隐藏坐标轴 最大化/\n拉伸 预览 - Embroidery + 刺绣 新消息 @@ -841,14 +836,14 @@ 类别 - Embroidery + 刺绣 运动 外观 画笔 声音 控制 事件 - Your bricks + 您的砖块 数据 乐高NXT 乐高EV3 @@ -858,7 +853,7 @@ Arduino Cast 树莓派 - Testing + 测试中 "放在 " @@ -914,7 +909,7 @@ 切换外观至编号 并等待 设置背景 - Set background and wait + 设置背景并等待 设置背景为编号 当背景更改为 设置大小为 @@ -940,12 +935,12 @@ 震动,持续 询问 并将输入的答案存储于 - What\'s your name? + 您的名字是什么? "输入您的答案:" 提交答案 询问 并将输入的答案存储于 - What\'s your name? + 您的名字是什么? 落笔 @@ -967,6 +962,11 @@ Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch 当程序启动 @@ -1331,21 +1331,21 @@ needs read and write access to it. You can always change permissions through you Blink orange Snake green red Fire - Standard + 标准 红色 绿色 - Red snake - Blank - Right missile - Left missile - Double missile - Front left green others red - Front right green others red - Rear right green others red - Rear left green others red - Left green right red - Left red right green - Blink standard + 红蛇 + 空白 + 右导弹 + 左导弹 + 双式导弹 + 前左绿色其它红色 + 前右绿色其它红色 + 右后绿色其它红色 + 左后绿色其它红色 + 左绿右红 + 左红右绿 + 闪光标准 向前移动Jumping Sumo 向后移动Jumping Sumo @@ -1505,9 +1505,9 @@ needs read and write access to it. You can always change permissions through you 字母 (1,\'你好,世界\') 连接 - (\'hello\',\' world\') - regular expression - (\' an? ([^ .]+)\',\'I am a panda.\') + (\'你好\',\'世界\') + 正则表达式 + (\' an? ([^.]+)\',\'我是一个熊猫.\') arduino数字端口 arduino模拟端口 树莓派端口 @@ -1576,13 +1576,13 @@ needs read and write access to it. You can always change permissions through you EV3颜色传感器 EV3环境颜色传感器 EV3反射颜色传感器 - EV3 hitechnic color - EV3 NXT temperature in °C - EV3 NXT temperature in °F - EV3 NXT light - EV3 NXT light active - EV3 NXT sound - EV3 NXT ultrasonic + EV3 高技术颜色 + EV3 NXT 温度在°C + EV3 NXT 温度在°F + EV3 NXT 光 + EV3 NXT 灯光激活 + EV3 NXT 音响 + EV3 NXT 超声波器 游戏操作杆a键被按下 游戏操作杆b键被按下 游戏操作杆向上键被按下 @@ -1678,7 +1678,7 @@ needs read and write access to it. You can always change permissions through you 像一个计算器,公式编辑器提供了大量的数学函数。 \n您可以找到三角函数例如\"sin\"和\"cos\",也能找到随机数生成器或文本和列表函数。 逻辑 逻辑用于比较值和组合逻辑公式。 \n为了比较值可以使用逻辑操作,如\">\"(大于) 或\"=\"(等于)。 \n为了组合逻辑公式,您可以使用逻辑操作如\"与\"、\"或\"和\"否\"。 - Sensors + 传感器 在\"设备\"中您可以找到您的智能手机或平板电脑记录的信息。 \n例如您的设备的倾斜角度或您周围环境的响度。 数据 在这里可以找到程序中使用的变量和列表。\n它们可以被方便地插入公式,或随时创建新的变量或列表。 @@ -1687,13 +1687,13 @@ needs read and write access to it. You can always change permissions through you 显示变量 隐藏变量 - size: - color: - aligned - centered + 大小: + 颜色: + 对齐 + 居中 - Pick color + 选取颜色 设置相机状态 @@ -1701,7 +1701,7 @@ needs read and write access to it. You can always change permissions through you 使用相机 前置 - rear + 后方 保持等待,直到 为真 @@ -1719,8 +1719,7 @@ needs read and write access to it. You can always change permissions through you 已准备好连接到cast设备 Cast功能被禁用。请在设置中启用cast功能。 正在搜索cast设备 - .\nDon\'t see your device? Try turning your device\'s Wifi off - and on. + .\n看不到您的设备吗? 尝试关闭和打开设备的Wifi. 网络连接超时,请再试一次。 已暂停 @@ -1729,8 +1728,7 @@ needs read and write access to it. You can always change permissions through you 是,确定删除 ! 您的程序被上传到了这个应用程序的共享网站,其他人可以使用并下载它。 您也可以将你的程序作为一个独立的应用程序下载。 - Upload failed. Please check your internet connection and try - again! + 上传失败. 请检查网络连接后重试. 显示程序 @@ -1739,10 +1737,8 @@ needs read and write access to it. You can always change permissions through you 显示提示 所有的积木都已按类别排列好。请选择您需要的类别。 要将积木添加到您的脚本,请点击您要使用的积木。 - The script defines the behavior of your actor or object. To add bricks to the script, - tap the \"+\" symbol. - Here you can find the different appearances of your actor or object. To add a new look, - tap the \"+\" symbol. + 脚本定义了对象和物体的行为。若要将积木添加到脚本,请点击\"+\"符号。 + 在这里您可以找到您的对象的不同外观。要添加一个新的外观,请点击\"+\"符号。 Here you can add new sounds to your actor or object. Remember using a brick from the sound category. Your program consists of different actors and objects that can interact with each other. diff --git a/catroid/src/main/res/values-zh-rTW/strings.xml b/catroid/src/main/res/values-zh-rTW/strings.xml index 83b14f28df7..cd0469ba4b8 100644 --- a/catroid/src/main/res/values-zh-rTW/strings.xml +++ b/catroid/src/main/res/values-zh-rTW/strings.xml @@ -1,5 +1,4 @@ - Stitch + Start running stitch with length + Start zigzag stitch with length + and width + Start triple stitch with length + Stop current stitch When scene starts