diff --git a/catroid/build.gradle b/catroid/build.gradle index 2365120ba2e..1b2b918550c 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-2022 The Catrobat Team + * Copyright (C) 2010-2023 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -361,7 +361,7 @@ dependencies { implementation 'androidx.constraintlayout:constraintlayout:2.1.4' // Kotlin - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version" testImplementation project(path: ':catroid') androidTestImplementation project(path: ':catroid') diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/test/stage/SearchParameterTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/test/stage/SearchParameterTest.java index e8b3801d64e..6199a0472cc 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/test/stage/SearchParameterTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/test/stage/SearchParameterTest.java @@ -157,7 +157,6 @@ public void tobBarVisibleAfterSelectingBrickFieldTest() { onView(withId(R.id.find)).perform(click()); BrickDataInteractionWrapper.onBrickAtPosition(1).onFormulaTextField(R.id.brick_set_x_edit_text).perform(click()); pressBack(); - pressBack(); onView(withId(R.id.toolbar)).check(matches(isDisplayed())); } 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 0b4460c3e5b..9c1e5a450e4 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 @@ -219,7 +219,6 @@ public void testDoesFormulaFragmentReturnCorrectlyAfterVisualPlacement() { onFormulaEditor() .check(matches(isDisplayed())); pressBack(); - pressBack(); isBackInScriptFragment(); } @@ -228,7 +227,6 @@ public void testNoRecursiveOpeningOfFormulaEditors() { openFormulaEditorFragmentFromEditTextX(); openFormulaEditorFragmentFromEditTextX(); pressBack(); - pressBack(); isBackInScriptFragment(); } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/ClipboardTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/ClipboardTest.java deleted file mode 100644 index 36729b3f64b..00000000000 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/ClipboardTest.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2022 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.uiespresso.formulaeditor; - -import org.catrobat.catroid.ProjectManager; -import org.catrobat.catroid.R; -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 org.catrobat.catroid.content.bricks.SetVariableBrick; -import org.catrobat.catroid.formulaeditor.UserVariable; -import org.catrobat.catroid.test.utils.TestUtils; -import org.catrobat.catroid.ui.SpriteActivity; -import org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper; -import org.catrobat.catroid.uiespresso.util.rules.FragmentActivityTestRule; -import org.junit.After; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; - -import java.io.IOException; - -import androidx.test.core.app.ApplicationProvider; -import androidx.test.espresso.matcher.ViewMatchers; -import androidx.test.ext.junit.runners.AndroidJUnit4; - -import static org.catrobat.catroid.WaitForConditionAction.waitFor; -import static org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper.onFormulaEditor; -import static org.hamcrest.Matchers.not; - -import static androidx.test.espresso.Espresso.onView; -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.doesNotExist; -import static androidx.test.espresso.assertion.ViewAssertions.matches; -import static androidx.test.espresso.matcher.RootMatchers.isPlatformPopup; -import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; -import static androidx.test.espresso.matcher.ViewMatchers.isEnabled; -import static androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility; -import static androidx.test.espresso.matcher.ViewMatchers.withId; - -@RunWith(AndroidJUnit4.class) -public class ClipboardTest { - - private static final String PROJECT_NAME = "ClipboardTest"; - - @Rule - public FragmentActivityTestRule baseActivityTestRule = new - FragmentActivityTestRule<>(SpriteActivity.class, SpriteActivity.EXTRA_FRAGMENT_POSITION, SpriteActivity.FRAGMENT_SCRIPTS); - - public static Project createProject() { - Project project = new Project(ApplicationProvider.getApplicationContext(), PROJECT_NAME); - Sprite sprite = new Sprite("testSprite"); - Script script = new StartScript(); - - SetVariableBrick setVariableBrick = new SetVariableBrick(); - UserVariable userVariable = new UserVariable("testVariable"); - project.addUserVariable(userVariable); - setVariableBrick.setUserVariable(userVariable); - - script.addBrick(setVariableBrick); - sprite.addScript(script); - project.getDefaultScene().addSprite(sprite); - - ProjectManager.getInstance().setCurrentProject(project); - ProjectManager.getInstance().setCurrentSprite(sprite); - - return project; - } - - @Before - public void setUp() throws Exception { - createProject(); - baseActivityTestRule.launchActivity(); - } - - @Test - public void hideCutCopyWhenNothingSelectedTest() { - onView(withId(R.id.brick_set_variable_edit_text)).perform(click()); - onFormulaEditor().performBackspace(); - onView(withId(R.id.formula_editor_edit_field)).perform(longClick()); - onView(withId(R.id.copy)).check(doesNotExist()); - onView(withId(R.id.cut)).check(doesNotExist()); - } - - @Test - public void hidePasteWhenClipboardIsEmptyTest() { - onView(withId(R.id.brick_set_variable_edit_text)).perform(click()); - onView(withId(R.id.formula_editor_edit_field)).perform(doubleClick()); - onView(withId(R.id.copy)).inRoot(isPlatformPopup()).perform(waitFor(isDisplayed(), 5000)); - onView(withId(R.id.copy)).inRoot(isPlatformPopup()).check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))); - onView(withId(R.id.cut)).inRoot(isPlatformPopup()).check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))); - onView(withId(R.id.paste)).inRoot(isPlatformPopup()).check(matches(withEffectiveVisibility(ViewMatchers.Visibility.GONE))); - } - - @Test - public void cutCopyPasteVisibleOnDoubleClickWhenClipboardIsNotEmptyTest() { - onView(withId(R.id.brick_set_variable_edit_text)).perform(click()); - onView(withId(R.id.formula_editor_edit_field)).perform(longClick()); - onView(withId(R.id.copy)).inRoot(isPlatformPopup()).check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))); - onView(withId(R.id.cut)).inRoot(isPlatformPopup()).check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))); - onView(withId(R.id.copy)).inRoot(isPlatformPopup()).perform(click()); - onView(withId(R.id.formula_editor_edit_field)).perform(doubleClick()); - onView(withId(R.id.paste)).inRoot(isPlatformPopup()).check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))); - } - - @Test - public void copyAndPasteTest() { - onView(withId(R.id.brick_set_variable_edit_text)).perform(click()); - onFormulaEditor().performEnterNumber(12345); - onView(withId(R.id.formula_editor_edit_field)).perform(doubleClick()); - onView(withId(R.id.copy)).inRoot(isPlatformPopup()).perform(click()); - onFormulaEditor().performBackspace(); - onView(withId(R.id.formula_editor_edit_field)).perform(longClick()); - onView(withId(R.id.paste)).inRoot(isPlatformPopup()).perform(click()); - onFormulaEditor().checkShows("12345"); - } - - @Test - public void cutAndPasteTest() { - onView(withId(R.id.brick_set_variable_edit_text)).perform(click()); - onFormulaEditor().performEnterNumber(12345); - onView(withId(R.id.formula_editor_edit_field)).perform(doubleClick()); - onView(withId(R.id.cut)).inRoot(isPlatformPopup()).perform(click()); - onFormulaEditor().checkShows(""); - onView(withId(R.id.formula_editor_edit_field)).perform(click()); - onView(withId(R.id.formula_editor_edit_field)).perform(longClick()); - onView(withId(R.id.paste)).inRoot(isPlatformPopup()).perform(click()); - onFormulaEditor().checkShows("12345"); - } - - @Test - public void checkUndoVisibleAfterCutOperation() { - onView(withId(R.id.brick_set_variable_edit_text)).perform(click()); - onView(withId(R.id.menu_undo)).check(matches(not(isEnabled()))); - onView(withId(R.id.cut)).inRoot(isPlatformPopup()).perform(click()); - onFormulaEditor().checkShows(""); - onView(withId(R.id.menu_undo)).check(matches(isEnabled())); - } - - @Test - public void cutWithoutFirstParameterTest() { - onView(withId(R.id.brick_set_variable_edit_text)).perform(click()); - onFormulaEditor() - .performOpenCategory(FormulaEditorWrapper.Category.FUNCTIONS) - .performSelect("power(2,3)"); - onFormulaEditor().performBackspace(); - onView(withId(R.id.formula_editor_edit_field)).perform(doubleClick()); - onView(withId(R.id.cut)).inRoot(isPlatformPopup()).perform(click()); - onView(withId(R.id.formula_editor_edit_field)).perform(longClick()); - onView(withId(R.id.paste)).inRoot(isPlatformPopup()).perform(click()); - onFormulaEditor().checkValue("power( , 3 )"); - } - - @After - public void tearDown() throws IOException { - baseActivityTestRule.finishActivity(); - TestUtils.deleteProjects(PROJECT_NAME); - } -} diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/ClipboardTest.kt b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/ClipboardTest.kt new file mode 100644 index 00000000000..8be7d5a29c0 --- /dev/null +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/ClipboardTest.kt @@ -0,0 +1,107 @@ +/* + * Catroid: An on-device visual programming system for Android devices + * Copyright (C) 2010-2023 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.uiespresso.formulaeditor + +import androidx.test.core.app.ApplicationProvider +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.action.ViewActions.click +import androidx.test.espresso.action.ViewActions.doubleClick +import androidx.test.espresso.action.ViewActions.longClick +import androidx.test.espresso.matcher.ViewMatchers.withId +import androidx.test.ext.junit.runners.AndroidJUnit4 +import org.catrobat.catroid.ProjectManager +import org.catrobat.catroid.R +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 org.catrobat.catroid.content.bricks.SetVariableBrick +import org.catrobat.catroid.formulaeditor.UserVariable +import org.catrobat.catroid.test.utils.TestUtils +import org.catrobat.catroid.ui.SpriteActivity +import org.catrobat.catroid.uiespresso.formulaeditor.utils.FormulaEditorWrapper +import org.catrobat.catroid.uiespresso.util.rules.FragmentActivityTestRule +import org.junit.After +import org.junit.Before +import org.junit.Rule +import org.junit.Test +import org.junit.runner.RunWith +import org.koin.java.KoinJavaComponent.inject + +@RunWith(AndroidJUnit4::class) +class ClipboardTest { + + val projectManager: ProjectManager by inject(ProjectManager::class.java) + + @JvmField + @Rule + var baseActivityTestRule = FragmentActivityTestRule( + SpriteActivity::class.java, + SpriteActivity.EXTRA_FRAGMENT_POSITION, + SpriteActivity.FRAGMENT_SCRIPTS + ) + + @Before + fun setUp() { + createProject() + baseActivityTestRule.launchActivity() + } + + @Test + fun copyAndPasteTest() { + onView(withId(R.id.brick_set_variable_edit_text)).perform(click()) + FormulaEditorWrapper.onFormulaEditor().performEnterNumber(12_345) + onView(withId(R.id.formula_editor_edit_field)).perform(doubleClick()) + onView(withId(R.id.formula_editor_keyboard_copy)).perform(click()) + FormulaEditorWrapper.onFormulaEditor().performBackspace() + onView(withId(R.id.formula_editor_edit_field)).perform(longClick()) + onView(withId(R.id.formula_editor_keyboard_paste)).perform(click()) + FormulaEditorWrapper.onFormulaEditor().checkShows("12345") + } + + @After + fun tearDown() { + baseActivityTestRule.finishActivity() + TestUtils.deleteProjects(PROJECT_NAME) + } + + private fun createProject(): Project { + val project = Project(ApplicationProvider.getApplicationContext(), PROJECT_NAME) + val sprite = Sprite("testSprite") + val script: Script = StartScript() + val setVariableBrick = SetVariableBrick() + val userVariable = UserVariable("testVariable") + project.addUserVariable(userVariable) + setVariableBrick.userVariable = userVariable + script.addBrick(setVariableBrick) + sprite.addScript(script) + project.defaultScene.addSprite(sprite) + projectManager.currentProject = project + projectManager.currentSprite = sprite + return project + } + + companion object { + private const val PROJECT_NAME = "ClipboardTest" + } +} diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorUndoTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorUndoTest.java index 6882a8c87c6..dd9c8b730c0 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorUndoTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/formulaeditor/FormulaEditorUndoTest.java @@ -147,7 +147,6 @@ public void testUndoFormulaWithNoChanges() { .perform(click()); pressBack(); - pressBack(); onView(withId(R.id.menu_undo)) .check(doesNotExist()); @@ -178,10 +177,8 @@ public void testUndoFormulaWithRevertedChanges() { onView(withId(R.id.brick_place_at_edit_text_x)) .perform(click()); - onView(withText(R.string.brick_context_dialog_formula_edit_brick)) - .perform(click()); - onFormulaEditor() - .performEnterFormula("0"); + onView(withText(R.string.brick_context_dialog_formula_edit_brick)).perform(click()); + onFormulaEditor().performEnterFormula("0"); pressBack(); @@ -290,26 +287,14 @@ public void testUndoFormulaDeleteVariable() { @Test public void testUndoFormulaRenameVariable() { onBrickAtPosition(brickPosition).checkShowsText(R.string.brick_place_at); - - onView(withId(R.id.brick_place_at_edit_text_x)) - .perform(click()); - onView(withText(R.string.brick_context_dialog_formula_edit_brick)) - .perform(click()); - - onFormulaEditor() - .performOpenDataFragment(); - - onDataList().onVariableAtPosition(0) - .performRename(NEW_VARIABLE_NAME); - - onDataList() - .performClose(); - - pressBack(); + onView(withId(R.id.brick_place_at_edit_text_x)).perform(click()); + onView(withText(R.string.brick_context_dialog_formula_edit_brick)).perform(click()); + onFormulaEditor().performOpenDataFragment(); + onDataList().onVariableAtPosition(0).performRename(NEW_VARIABLE_NAME); + onDataList().performClose(); pressBack(); - onView(withId(R.id.menu_undo)) - .check(matches(isDisplayed())); + onView(withId(R.id.menu_undo)).check(matches(isDisplayed())); assertNull(ProjectManager.getInstance().getCurrentProject().getUserVariable(VARIABLE_NAME)); assertNotNull(ProjectManager.getInstance().getCurrentProject().getUserVariable(NEW_VARIABLE_NAME)); 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 7e3748b5d21..7a0ad97b631 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 @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2022 The Catrobat Team + * Copyright (C) 2010-2023 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -38,12 +38,12 @@ 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.Espresso.pressBack; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.matcher.ViewMatchers.withId; @@ -65,17 +65,10 @@ public void setUp() throws Exception { @Test public void actionBarScriptTitleOneSceneProjectTest() { String currentSpriteName = ProjectManager.getInstance().getCurrentSprite().getName(); - - onActionBar() - .checkTitleMatches(currentSpriteName); - onView(withId(R.id.brick_change_size_by_edit_text)) - .perform(click()); - onActionBar() - .checkTitleMatches(R.string.formula_editor_title); - - Espresso.pressBack(); - Espresso.pressBack(); - onActionBar() - .checkTitleMatches(currentSpriteName); + onActionBar().checkTitleMatches(currentSpriteName); + onView(withId(R.id.brick_change_size_by_edit_text)).perform(click()); + onActionBar().checkTitleMatches(R.string.formula_editor_title); + pressBack(); + onActionBar().checkTitleMatches(currentSpriteName); } } 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 0e83e235896..ec59fd01e2f 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-2022 The Catrobat Team + * Copyright (C) 2010-2023 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -38,11 +38,13 @@ import org.junit.runner.RunWith; import androidx.test.espresso.Espresso; +import androidx.test.core.app.ApplicationProvider; 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.Espresso.pressBack; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.matcher.ViewMatchers.withId; @@ -77,16 +79,11 @@ public void actionBarScriptTitleTwoScenesProjectTest() { String currentSpriteName = ProjectManager.getInstance().getCurrentSprite().getName(); String scriptsTitle = currentSceneName + ": " + currentSpriteName; - onActionBar() - .checkTitleMatches(scriptsTitle); - onView(withId(R.id.brick_change_size_by_edit_text)) - .perform(click()); - onActionBar() - .checkTitleMatches(R.string.formula_editor_title); + onActionBar().checkTitleMatches(scriptsTitle); + onView(withId(R.id.brick_change_size_by_edit_text)).perform(click()); + onActionBar().checkTitleMatches(R.string.formula_editor_title); - Espresso.pressBack(); - Espresso.pressBack(); - onActionBar() - .checkTitleMatches(scriptsTitle); + pressBack(); + onActionBar().checkTitleMatches(scriptsTitle); } } diff --git a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RemoveTabsTest.java b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RemoveTabsTest.java index 64d38740281..e60898ec031 100644 --- a/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RemoveTabsTest.java +++ b/catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/RemoveTabsTest.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2022 The Catrobat Team + * Copyright (C) 2010-2023 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -47,6 +47,7 @@ import static androidx.test.espresso.Espresso.onIdle; 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; @@ -68,7 +69,7 @@ public void testRemoveTabsInCategoryFragmentTest() { assertTabLayoutIsShown(FRAGMENT_SCRIPTS); onView(withId(R.id.button_add)).perform(click()); assertTabLayoutIsNotShown(); - Espresso.pressBack(); + pressBack(); assertTabLayoutIsShown(FRAGMENT_SCRIPTS); } @@ -77,8 +78,7 @@ public void testRemoveTabsInFormulaEditorFragmentTest() { assertTabLayoutIsShown(FRAGMENT_SCRIPTS); onView(withId(R.id.brick_set_variable_edit_text)).perform(click()); assertTabLayoutIsNotShown(); - Espresso.pressBack(); - Espresso.pressBack(); + pressBack(); assertTabLayoutIsShown(FRAGMENT_SCRIPTS); } diff --git a/catroid/src/main/java/org/catrobat/catroid/formulaeditor/FormulaEditorEditText.java b/catroid/src/main/java/org/catrobat/catroid/formulaeditor/FormulaEditorEditText.java index 95456731c43..5a56a05e17e 100644 --- a/catroid/src/main/java/org/catrobat/catroid/formulaeditor/FormulaEditorEditText.java +++ b/catroid/src/main/java/org/catrobat/catroid/formulaeditor/FormulaEditorEditText.java @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2022 The Catrobat Team + * Copyright (C) 2010-2023 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -38,7 +38,6 @@ import org.catrobat.catroid.content.bricks.Brick; import org.catrobat.catroid.formulaeditor.InternFormula.TokenSelectionType; -import org.catrobat.catroid.ui.FormulaEditorPopupMenu; import org.catrobat.catroid.ui.fragment.FormulaEditorFragment; import java.util.List; @@ -54,31 +53,17 @@ public class FormulaEditorEditText extends EditText implements OnTouchListener { private int absoluteCursorPosition = 0; private InternFormula internFormula; private Context context; - private Paint paint = new Paint(); - - private FormulaEditorPopupMenu popupMenu; - private int[] locationOnScreen = new int[2]; - private int popupMenuBottom; - private boolean popupMenuShown = false; + private final Paint paint = new Paint(); final GestureDetector gestureDetector = new GestureDetector(context, new GestureDetector.SimpleOnGestureListener() { @Override public boolean onDoubleTap(MotionEvent event) { internFormula.setCursorAndSelection(absoluteCursorPosition, true); history.updateCurrentSelection(internFormula.getSelection()); - locationOnScreen[0] = (int) event.getRawX(); - locationOnScreen[1] = (int) event.getRawY(); highlightSelection(); return true; } - @Override - public void onLongPress(MotionEvent event) { - super.onLongPress(event); - popupMenu.show((int) event.getRawX(), (int) event.getRawY(), - internFormula.getSelection() != null); - } - @Override public boolean onSingleTapUp(MotionEvent motion) { Layout layout = getLayout(); @@ -97,10 +82,8 @@ public boolean onSingleTapUp(MotionEvent motion) { int numberOfVisibleLines = (int) (getHeight() / lineHeight); if (yCoordinate <= lineHeight - firstLineSize) { - scrollBy(0, (int) (initialScrollY > lineHeight ? -1 * (firstLineSize + lineHeight / 2) : -1 * firstLineSize)); - cursorY = 0; } else if (yCoordinate >= numberOfVisibleLines * lineHeight - lineHeight / 2) { if (!(yCoordinate > layout.getLineCount() * lineHeight - getScrollY() - getPaddingTop())) { scrollBy(0, (int) (lineHeight - firstLineSize + lineHeight / 2)); @@ -147,8 +130,6 @@ public boolean onSingleTapUp(MotionEvent motion) { } }); - private boolean doNotMoveCursorOnTab = false; - public FormulaEditorEditText(Context context) { super(context); this.context = context; @@ -159,6 +140,7 @@ public FormulaEditorEditText(Context context, AttributeSet attrs) { this.context = context; } + @SuppressLint("ClickableViewAccessibility") public void init(FormulaEditorFragment formulaEditorFragment) { this.formulaEditorFragment = formulaEditorFragment; this.setOnTouchListener(this); @@ -166,7 +148,6 @@ public void init(FormulaEditorFragment formulaEditorFragment) { this.setSelectAllOnFocus(false); this.setCursorVisible(false); cursorAnimation.run(); - initPopupMenu(); } public List getSelectedTokens() { @@ -181,34 +162,14 @@ private void pushToHistoryAndRefreshPreviewString() { formulaEditorFragment.refreshFormulaPreviewString(resultingText); } - public void deleteSelection() { - internFormula.deleteSelection(context); - pushToHistoryAndRefreshPreviewString(); - } - public void addTokens(List tokens) { internFormula.addTokens(context, tokens); pushToHistoryAndRefreshPreviewString(); } - private void initPopupMenu() { - popupMenu = new FormulaEditorPopupMenu(context, this); - popupMenu.setOnUpdateListener(() -> { - pushToHistoryAndRefreshPreviewString(); - formulaEditorFragment.updateButtonsOnKeyboardAndInvalidateOptionsMenu(); - }); - } - @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); - if (!popupMenuShown) { - getLocationOnScreen(locationOnScreen); - this.popupMenuBottom = bottom; - popupMenu.show(locationOnScreen[0], locationOnScreen[1] + bottom, - internFormula.getSelection() != null); - popupMenuShown = true; - } } public void enterNewFormula(UndoState state) { @@ -259,7 +220,7 @@ public void updateListReferences(String oldName, String newName) { formulaEditorFragment.refreshFormulaPreviewString(resultingText); } - private Runnable cursorAnimation = new Runnable() { + private final Runnable cursorAnimation = new Runnable() { @Override public void run() { paint.setColor((paint.getColor() == 0x00000000) ? 0xff000000 : 0x00000000); @@ -307,9 +268,6 @@ public void highlightSelection() { highlightSpan.setSpan(COLOR_ERROR, selectionStartIndex, selectionEndIndex, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); } - if (internFormula.getSelection() != null && popupMenu != null) { - popupMenu.show(locationOnScreen[0], locationOnScreen[1] + popupMenuBottom, true); - } } public void setParseErrorCursorAndSelection() { @@ -418,7 +376,7 @@ public InternFormulaParser getFormulaParser() { } public boolean isDoNotMoveCursorOnTab() { - return doNotMoveCursorOnTab; + return false; } public FormulaEditorHistory getHistory() { @@ -440,14 +398,4 @@ public void setSelectionToFirstParamOfRegularExpressionAtInternalIndex(int index internFormula.setSelectionToFirstParamOfRegularExpressionAtInternalIndex(indexOfRegularExpression); highlightSelection(); } - - public boolean isPopupMenuVisible() { - return popupMenu.isVisible(); - } - - public void dismissPopupMenu() { - popupMenu.dismiss(); - internFormula.setCursorAndSelection(absoluteCursorPosition, false); - highlightSelection(); - } } diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/FormulaEditorClipboard.kt b/catroid/src/main/java/org/catrobat/catroid/ui/FormulaEditorClipboard.kt new file mode 100644 index 00000000000..92a64f291cd --- /dev/null +++ b/catroid/src/main/java/org/catrobat/catroid/ui/FormulaEditorClipboard.kt @@ -0,0 +1,60 @@ +/* + * Catroid: An on-device visual programming system for Android devices + * Copyright (C) 2010-2023 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.ui + +import android.annotation.SuppressLint +import androidx.annotation.VisibleForTesting +import org.catrobat.catroid.formulaeditor.FormulaEditorEditText +import org.catrobat.catroid.formulaeditor.InternToken + +import java.util.ArrayList + +@SuppressLint("InflateParams") +class FormulaEditorClipboard(private val formulaEditorEditText: FormulaEditorEditText) { + + @VisibleForTesting + var clipboard: List? = null + + private fun cloneTokens(tokens: List): List { + val clonedTokens = ArrayList() + tokens.forEach { token -> clonedTokens.add(token.deepCopy()) } + return clonedTokens + } + + private fun copyTokens(tokens: List?) { + clipboard = if (tokens != null) { + cloneTokens(tokens) + } else { + null + } + } + + fun copy() { + copyTokens(formulaEditorEditText.selectedTokens) + } + + fun paste() { + clipboard?.let { formulaEditorEditText.addTokens(cloneTokens(it)); } + } +} diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/FormulaEditorPopupMenu.java b/catroid/src/main/java/org/catrobat/catroid/ui/FormulaEditorPopupMenu.java deleted file mode 100644 index db6c338a1e2..00000000000 --- a/catroid/src/main/java/org/catrobat/catroid/ui/FormulaEditorPopupMenu.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2022 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.ui; - -import android.annotation.SuppressLint; -import android.content.Context; -import android.view.Gravity; -import android.view.LayoutInflater; -import android.view.MotionEvent; -import android.view.View; -import android.widget.PopupWindow; - -import org.catrobat.catroid.R; -import org.catrobat.catroid.formulaeditor.FormulaEditorEditText; -import org.catrobat.catroid.formulaeditor.InternToken; - -import java.util.ArrayList; -import java.util.List; - -import static android.content.Context.LAYOUT_INFLATER_SERVICE; -import static android.view.View.GONE; -import static android.view.View.VISIBLE; -import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; - -public class FormulaEditorPopupMenu { - private final PopupWindow popupWindow; - - private final View formulaEditorEditText; - private OnUpdateListener onUpdateListener; - - private final View cut; - private final View copy; - private final View paste; - - private List clipboard; - - @SuppressLint("InflateParams") - public FormulaEditorPopupMenu(Context context, FormulaEditorEditText formulaEditorEditText) { - this.formulaEditorEditText = formulaEditorEditText; - - LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(LAYOUT_INFLATER_SERVICE); - View popupView = layoutInflater.inflate(R.layout.formula_editor_pop_up_menu, null); - - popupWindow = new PopupWindow(popupView, WRAP_CONTENT, WRAP_CONTENT, false); - popupWindow.setOutsideTouchable(true); - popupWindow.setElevation(10); - - cut = popupView.findViewById(R.id.cut); - copy = popupView.findViewById(R.id.copy); - paste = popupView.findViewById(R.id.paste); - - cut.setOnClickListener(v -> { - copyTokens(formulaEditorEditText.getSelectedTokens()); - formulaEditorEditText.deleteSelection(); - if (onUpdateListener != null) { - onUpdateListener.onUpdate(); - } - popupWindow.dismiss(); - }); - - copy.setOnClickListener(v -> { - copyTokens(formulaEditorEditText.getSelectedTokens()); - popupWindow.dismiss(); - }); - - paste.setOnClickListener(v -> { - if (clipboard != null && clipboard.size() > 0) { - formulaEditorEditText.addTokens(cloneTokens(clipboard)); - if (onUpdateListener != null) { - onUpdateListener.onUpdate(); - } - } - popupWindow.dismiss(); - }); - - View.OnTouchListener onTouchListener = getOnTouchListener(); - cut.setOnTouchListener(onTouchListener); - copy.setOnTouchListener(onTouchListener); - paste.setOnTouchListener(onTouchListener); - popupWindow.getContentView().setOnTouchListener(onTouchListener); - } - - private View.OnTouchListener getOnTouchListener() { - return new View.OnTouchListener() { - private int initialX; - private int initialY; - private float initialTouchX; - private float initialTouchY; - - @Override - public boolean onTouch(View v, MotionEvent event) { - switch (event.getAction()) { - case MotionEvent.ACTION_DOWN: - int[] location = new int[2]; - popupWindow.getContentView().getLocationOnScreen(location); - initialX = location[0]; - initialY = location[1]; - initialTouchX = event.getRawX(); - initialTouchY = event.getRawY(); - return true; - case MotionEvent.ACTION_UP: - if (Math.abs(event.getRawX() - initialTouchX) <= 5 && Math.abs(event.getRawY() - initialTouchY) <= 5) { - v.performClick(); - } - return true; - case MotionEvent.ACTION_MOVE: - int x = initialX + (int) (event.getRawX() - initialTouchX); - int y = initialY + (int) (event.getRawY() - initialTouchY); - popupWindow.update(x, y, -1, -1, true); - return true; - } - return false; - } - }; - } - - private List cloneTokens(List tokens) { - List t = new ArrayList<>(); - for (InternToken token : tokens) { - t.add(token.deepCopy()); - } - return t; - } - - private void copyTokens(List tokens) { - clipboard = cloneTokens(tokens); - } - - public void setOnUpdateListener(OnUpdateListener onUpdateListener) { - this.onUpdateListener = onUpdateListener; - } - - public void show(int x, int y, boolean isHighlighted) { - boolean isClipboardEmpty = (clipboard == null || clipboard.isEmpty()); - - if (isClipboardEmpty && !isHighlighted) { - return; - } - - if (isClipboardEmpty) { - paste.setVisibility(GONE); - } else { - paste.setVisibility(VISIBLE); - } - - if (isHighlighted) { - copy.setVisibility(VISIBLE); - cut.setVisibility(VISIBLE); - } else { - copy.setVisibility(GONE); - cut.setVisibility(GONE); - } - - popupWindow.showAtLocation(formulaEditorEditText, Gravity.NO_GRAVITY, x, y); - } - - public interface OnUpdateListener { - void onUpdate(); - } - - public boolean isVisible() { - return popupWindow.isShowing(); - } - - public void dismiss() { - popupWindow.dismiss(); - } -} 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 0f5d4a72ee3..38cf6363b18 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 @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2022 The Catrobat Team + * Copyright (C) 2010-2023 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -74,6 +74,7 @@ import org.catrobat.catroid.formulaeditor.UserVariable; import org.catrobat.catroid.io.XstreamSerializer; import org.catrobat.catroid.ui.BottomBar; +import org.catrobat.catroid.ui.FormulaEditorClipboard; import org.catrobat.catroid.ui.SpriteActivity; import org.catrobat.catroid.ui.UiUtils; import org.catrobat.catroid.ui.dialogs.FormulaEditorComputeDialog; @@ -154,6 +155,7 @@ public class FormulaEditorFragment extends Fragment implements ViewTreeObserver. private CategoryListRVAdapter.CategoryListItem chosenCategoryItem = null; private UserData chosenUserDataItem = null; + private FormulaEditorClipboard formulaEditorClipboard; @Override public void onCreate(Bundle savedInstanceState) { @@ -287,6 +289,8 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, formulaEditorBrick = fragmentView.findViewById(R.id.formula_editor_brick_space); formulaEditorEditText = fragmentView.findViewById(R.id.formula_editor_edit_field); formulaEditorKeyboard = fragmentView.findViewById(R.id.formula_editor_keyboardview); + formulaEditorClipboard = + new FormulaEditorClipboard(formulaEditorEditText); updateBrickView(); @@ -392,6 +396,12 @@ public boolean onTouch(View view, MotionEvent event) { case R.id.formula_editor_keyboard_color_picker: showColorPickerDialog(view); return true; + case R.id.formula_editor_keyboard_paste: + formulaEditorClipboard.paste(); + return true; + case R.id.formula_editor_keyboard_copy: + formulaEditorClipboard.copy(); + return true; default: formulaEditorEditText.handleKeyEvent(view.getId(), ""); return true; @@ -898,10 +908,6 @@ private boolean hasFileChanged() { } public void exitFormulaEditorFragment() { - if (formulaEditorEditText.isPopupMenuVisible()) { - formulaEditorEditText.dismissPopupMenu(); - return; - } ((SpriteActivity) getActivity()).setUndoMenuItemVisibility(false); if (hasFormulaBeenChanged || formulaEditorEditText.hasChanges()) { if (saveFormulaIfPossible()) { diff --git a/catroid/src/main/res/drawable/formula_editor_category_button.xml b/catroid/src/main/res/drawable/formula_editor_category_button.xml index 3e4d7a028e1..86be00a3055 100644 --- a/catroid/src/main/res/drawable/formula_editor_category_button.xml +++ b/catroid/src/main/res/drawable/formula_editor_category_button.xml @@ -1,7 +1,7 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/catroid/src/main/res/drawable/formula_editor_keyboard_button.xml b/catroid/src/main/res/drawable/formula_editor_symbol_button.xml similarity index 90% rename from catroid/src/main/res/drawable/formula_editor_keyboard_button.xml rename to catroid/src/main/res/drawable/formula_editor_symbol_button.xml index ea6d65c087e..d747f833ba9 100644 --- a/catroid/src/main/res/drawable/formula_editor_keyboard_button.xml +++ b/catroid/src/main/res/drawable/formula_editor_symbol_button.xml @@ -1,7 +1,7 @@ + + + diff --git a/catroid/src/main/res/drawable/ic_formula_editor_content_paste.xml b/catroid/src/main/res/drawable/ic_formula_editor_content_paste.xml new file mode 100644 index 00000000000..b935567ce45 --- /dev/null +++ b/catroid/src/main/res/drawable/ic_formula_editor_content_paste.xml @@ -0,0 +1,32 @@ + + + + + diff --git a/catroid/src/main/res/drawable/ic_input_delete.xml b/catroid/src/main/res/drawable/ic_input_delete.xml index 5b0d0f15884..36850a43703 100644 --- a/catroid/src/main/res/drawable/ic_input_delete.xml +++ b/catroid/src/main/res/drawable/ic_input_delete.xml @@ -1,6 +1,6 @@ + android:fillColor="@color/formula_editor_icon"/> diff --git a/catroid/src/main/res/drawable/ic_keyboard_toggle_caret_down.xml b/catroid/src/main/res/drawable/ic_keyboard_toggle_caret_down.xml index b224339a527..ce843c47a8d 100644 --- a/catroid/src/main/res/drawable/ic_keyboard_toggle_caret_down.xml +++ b/catroid/src/main/res/drawable/ic_keyboard_toggle_caret_down.xml @@ -1,6 +1,6 @@ - + diff --git a/catroid/src/main/res/layout/formula_editor_keyboard.xml b/catroid/src/main/res/layout/formula_editor_keyboard.xml index c79e25ce64c..f048b23eb3d 100644 --- a/catroid/src/main/res/layout/formula_editor_keyboard.xml +++ b/catroid/src/main/res/layout/formula_editor_keyboard.xml @@ -1,7 +1,7 @@ - - - - - - - - - - - diff --git a/catroid/src/main/res/values-af/strings.xml b/catroid/src/main/res/values-af/strings.xml index c5c3e50ca6f..a4265c58f81 100644 --- a/catroid/src/main/res/values-af/strings.xml +++ b/catroid/src/main/res/values-af/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-ar/strings.xml b/catroid/src/main/res/values-ar/strings.xml index 707b1d19dc4..de79d1d80b2 100644 --- a/catroid/src/main/res/values-ar/strings.xml +++ b/catroid/src/main/res/values-ar/strings.xml @@ -1,7 +1,7 @@ تتلاشى تأثير الجسيمات diff --git a/catroid/src/main/res/values-az/strings.xml b/catroid/src/main/res/values-az/strings.xml index 4ea63c99471..28f639311a9 100644 --- a/catroid/src/main/res/values-az/strings.xml +++ b/catroid/src/main/res/values-az/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-bg/strings.xml b/catroid/src/main/res/values-bg/strings.xml index 80000ab6c53..78c2ed19d40 100644 --- a/catroid/src/main/res/values-bg/strings.xml +++ b/catroid/src/main/res/values-bg/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-bn/strings.xml b/catroid/src/main/res/values-bn/strings.xml index 5237002fc1e..dd1849aa2e4 100644 --- a/catroid/src/main/res/values-bn/strings.xml +++ b/catroid/src/main/res/values-bn/strings.xml @@ -1,7 +1,7 @@ বিবর্ণ কণা প্রভাব diff --git a/catroid/src/main/res/values-bs/strings.xml b/catroid/src/main/res/values-bs/strings.xml index d0cc94f5640..67c7e4ee891 100644 --- a/catroid/src/main/res/values-bs/strings.xml +++ b/catroid/src/main/res/values-bs/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-ca/strings.xml b/catroid/src/main/res/values-ca/strings.xml index c93592faba8..871f31d35ae 100644 --- a/catroid/src/main/res/values-ca/strings.xml +++ b/catroid/src/main/res/values-ca/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-chr/strings.xml b/catroid/src/main/res/values-chr/strings.xml index 50d9b713a42..221ee3176d0 100644 --- a/catroid/src/main/res/values-chr/strings.xml +++ b/catroid/src/main/res/values-chr/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-cs/strings.xml b/catroid/src/main/res/values-cs/strings.xml index d2b842a97ab..c56ce32d8fe 100644 --- a/catroid/src/main/res/values-cs/strings.xml +++ b/catroid/src/main/res/values-cs/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-da/strings.xml b/catroid/src/main/res/values-da/strings.xml index 2a55cd86de3..7ae0b8c8a49 100644 --- a/catroid/src/main/res/values-da/strings.xml +++ b/catroid/src/main/res/values-da/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-de/strings.xml b/catroid/src/main/res/values-de/strings.xml index afe24bd3b44..2ca52f9b283 100644 --- a/catroid/src/main/res/values-de/strings.xml +++ b/catroid/src/main/res/values-de/strings.xml @@ -1,7 +1,7 @@ Blende Partikeleffekt diff --git a/catroid/src/main/res/values-el/strings.xml b/catroid/src/main/res/values-el/strings.xml index 48e5e22d0f5..373d7190849 100644 --- a/catroid/src/main/res/values-el/strings.xml +++ b/catroid/src/main/res/values-el/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-en-rAU/strings.xml b/catroid/src/main/res/values-en-rAU/strings.xml index 6783889f474..52a437c910c 100644 --- a/catroid/src/main/res/values-en-rAU/strings.xml +++ b/catroid/src/main/res/values-en-rAU/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-en-rCA/strings.xml b/catroid/src/main/res/values-en-rCA/strings.xml index e0572cb280a..6ecf5f3c860 100644 --- a/catroid/src/main/res/values-en-rCA/strings.xml +++ b/catroid/src/main/res/values-en-rCA/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-en-rGB/strings.xml b/catroid/src/main/res/values-en-rGB/strings.xml index 7a89bae1910..80ff0ab922b 100644 --- a/catroid/src/main/res/values-en-rGB/strings.xml +++ b/catroid/src/main/res/values-en-rGB/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-es/strings.xml b/catroid/src/main/res/values-es/strings.xml index 538a42ce620..c3f123ce1ce 100644 --- a/catroid/src/main/res/values-es/strings.xml +++ b/catroid/src/main/res/values-es/strings.xml @@ -1,7 +1,7 @@ Efecto de partículas desvanecidas diff --git a/catroid/src/main/res/values-eu-rES/strings.xml b/catroid/src/main/res/values-eu-rES/strings.xml index f6520071760..ac516a5c9ee 100644 --- a/catroid/src/main/res/values-eu-rES/strings.xml +++ b/catroid/src/main/res/values-eu-rES/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-fa-rIR/strings.xml b/catroid/src/main/res/values-fa-rIR/strings.xml index 9f9b0a864ec..42733b689e9 100644 --- a/catroid/src/main/res/values-fa-rIR/strings.xml +++ b/catroid/src/main/res/values-fa-rIR/strings.xml @@ -1,7 +1,7 @@ اثر ذرات محو diff --git a/catroid/src/main/res/values-fa/strings.xml b/catroid/src/main/res/values-fa/strings.xml index 24d74f1266c..dcd46c6156f 100644 --- a/catroid/src/main/res/values-fa/strings.xml +++ b/catroid/src/main/res/values-fa/strings.xml @@ -1,7 +1,7 @@ اثر ذرات محو diff --git a/catroid/src/main/res/values-fi/strings.xml b/catroid/src/main/res/values-fi/strings.xml index bfc5d81e029..290629ecbd7 100644 --- a/catroid/src/main/res/values-fi/strings.xml +++ b/catroid/src/main/res/values-fi/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-fr/strings.xml b/catroid/src/main/res/values-fr/strings.xml index c757840d651..8e74afad5dd 100644 --- a/catroid/src/main/res/values-fr/strings.xml +++ b/catroid/src/main/res/values-fr/strings.xml @@ -1,7 +1,7 @@ Effet de particules diff --git a/catroid/src/main/res/values-gl/strings.xml b/catroid/src/main/res/values-gl/strings.xml index b4441e500a3..4cb2a8b01e9 100644 --- a/catroid/src/main/res/values-gl/strings.xml +++ b/catroid/src/main/res/values-gl/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-gu/strings.xml b/catroid/src/main/res/values-gu/strings.xml index ff951c0dba2..8f348194911 100644 --- a/catroid/src/main/res/values-gu/strings.xml +++ b/catroid/src/main/res/values-gu/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-ha/strings.xml b/catroid/src/main/res/values-ha/strings.xml index c5c3e50ca6f..a4265c58f81 100644 --- a/catroid/src/main/res/values-ha/strings.xml +++ b/catroid/src/main/res/values-ha/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-hi/strings.xml b/catroid/src/main/res/values-hi/strings.xml index 3d90fe195dc..fea956d8be6 100644 --- a/catroid/src/main/res/values-hi/strings.xml +++ b/catroid/src/main/res/values-hi/strings.xml @@ -1,7 +1,7 @@ फीका कण प्रभाव diff --git a/catroid/src/main/res/values-hr/strings.xml b/catroid/src/main/res/values-hr/strings.xml index 886380d92c7..6e14d87cfc2 100644 --- a/catroid/src/main/res/values-hr/strings.xml +++ b/catroid/src/main/res/values-hr/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-hu/strings.xml b/catroid/src/main/res/values-hu/strings.xml index bd468f6d6b6..0b8eac06b1e 100644 --- a/catroid/src/main/res/values-hu/strings.xml +++ b/catroid/src/main/res/values-hu/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-ig/strings.xml b/catroid/src/main/res/values-ig/strings.xml index 3ebda6e365f..8bd30486901 100644 --- a/catroid/src/main/res/values-ig/strings.xml +++ b/catroid/src/main/res/values-ig/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-in/strings.xml b/catroid/src/main/res/values-in/strings.xml index 7787136ac76..73829c59183 100644 --- a/catroid/src/main/res/values-in/strings.xml +++ b/catroid/src/main/res/values-in/strings.xml @@ -1,7 +1,7 @@ Efek partikel pudar diff --git a/catroid/src/main/res/values-it/strings.xml b/catroid/src/main/res/values-it/strings.xml index 14789156e44..79be2132936 100644 --- a/catroid/src/main/res/values-it/strings.xml +++ b/catroid/src/main/res/values-it/strings.xml @@ -1,7 +1,7 @@ Effetto particella in dissolvenza diff --git a/catroid/src/main/res/values-iw/strings.xml b/catroid/src/main/res/values-iw/strings.xml index ee57bfa7020..9fd1ed1d93b 100644 --- a/catroid/src/main/res/values-iw/strings.xml +++ b/catroid/src/main/res/values-iw/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-ja/strings.xml b/catroid/src/main/res/values-ja/strings.xml index f012fcfe528..1e774985ea8 100644 --- a/catroid/src/main/res/values-ja/strings.xml +++ b/catroid/src/main/res/values-ja/strings.xml @@ -1,7 +1,7 @@ パーティクル効果を diff --git a/catroid/src/main/res/values-ka/strings.xml b/catroid/src/main/res/values-ka/strings.xml index e86a112363c..c118d7ea9d7 100644 --- a/catroid/src/main/res/values-ka/strings.xml +++ b/catroid/src/main/res/values-ka/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-kab/strings.xml b/catroid/src/main/res/values-kab/strings.xml index 2c3db942a1a..f6f17b818b2 100644 --- a/catroid/src/main/res/values-kab/strings.xml +++ b/catroid/src/main/res/values-kab/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-kk/strings.xml b/catroid/src/main/res/values-kk/strings.xml index a7f5aa07af8..bfd72919095 100644 --- a/catroid/src/main/res/values-kk/strings.xml +++ b/catroid/src/main/res/values-kk/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-kn/strings.xml b/catroid/src/main/res/values-kn/strings.xml index 3510766a22f..ffc6f314693 100644 --- a/catroid/src/main/res/values-kn/strings.xml +++ b/catroid/src/main/res/values-kn/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-ko/strings.xml b/catroid/src/main/res/values-ko/strings.xml index 935e76c1c4e..01c98c8f3d3 100644 --- a/catroid/src/main/res/values-ko/strings.xml +++ b/catroid/src/main/res/values-ko/strings.xml @@ -1,7 +1,7 @@ 페이드 파티클 효과 diff --git a/catroid/src/main/res/values-lt/strings.xml b/catroid/src/main/res/values-lt/strings.xml index ba1517a8b3d..10eaf1f0013 100644 --- a/catroid/src/main/res/values-lt/strings.xml +++ b/catroid/src/main/res/values-lt/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-mk/strings.xml b/catroid/src/main/res/values-mk/strings.xml index 95d32e61b0c..7ed778589f9 100644 --- a/catroid/src/main/res/values-mk/strings.xml +++ b/catroid/src/main/res/values-mk/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-ml-rIN/strings.xml b/catroid/src/main/res/values-ml-rIN/strings.xml index d07beb4b264..b562861f0cb 100644 --- a/catroid/src/main/res/values-ml-rIN/strings.xml +++ b/catroid/src/main/res/values-ml-rIN/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-ms/strings.xml b/catroid/src/main/res/values-ms/strings.xml index 302353fd505..9256c949438 100644 --- a/catroid/src/main/res/values-ms/strings.xml +++ b/catroid/src/main/res/values-ms/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-nl/strings.xml b/catroid/src/main/res/values-nl/strings.xml index 073b4e38ed3..32209af641b 100644 --- a/catroid/src/main/res/values-nl/strings.xml +++ b/catroid/src/main/res/values-nl/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-no/strings.xml b/catroid/src/main/res/values-no/strings.xml index 4978ebe4db1..5107bfd04c5 100644 --- a/catroid/src/main/res/values-no/strings.xml +++ b/catroid/src/main/res/values-no/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-pa-rIN/strings.xml b/catroid/src/main/res/values-pa-rIN/strings.xml index 8ce0f17b833..7e20b9c6efb 100644 --- a/catroid/src/main/res/values-pa-rIN/strings.xml +++ b/catroid/src/main/res/values-pa-rIN/strings.xml @@ -1,7 +1,7 @@ ਫੇਡ ਕਣ ਪ੍ਰਭਾਵ diff --git a/catroid/src/main/res/values-pl/strings.xml b/catroid/src/main/res/values-pl/strings.xml index e79544cd91c..7e72f99788a 100644 --- a/catroid/src/main/res/values-pl/strings.xml +++ b/catroid/src/main/res/values-pl/strings.xml @@ -1,7 +1,7 @@ Efekt zanikania cząstek diff --git a/catroid/src/main/res/values-ps/strings.xml b/catroid/src/main/res/values-ps/strings.xml index bb8f4a133c8..c79f4749186 100644 --- a/catroid/src/main/res/values-ps/strings.xml +++ b/catroid/src/main/res/values-ps/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-pt-rBR/strings.xml b/catroid/src/main/res/values-pt-rBR/strings.xml index b6f456a4744..2ba49bde7a7 100644 --- a/catroid/src/main/res/values-pt-rBR/strings.xml +++ b/catroid/src/main/res/values-pt-rBR/strings.xml @@ -1,7 +1,7 @@ Efeito de partícula desvanecer diff --git a/catroid/src/main/res/values-pt/strings.xml b/catroid/src/main/res/values-pt/strings.xml index 7e7ec3dc7dd..47851247c5b 100644 --- a/catroid/src/main/res/values-pt/strings.xml +++ b/catroid/src/main/res/values-pt/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-ro/strings.xml b/catroid/src/main/res/values-ro/strings.xml index a943de7ed5b..b5cc94146b4 100644 --- a/catroid/src/main/res/values-ro/strings.xml +++ b/catroid/src/main/res/values-ro/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-ru/strings.xml b/catroid/src/main/res/values-ru/strings.xml index 57260779b83..95a4f13c046 100644 --- a/catroid/src/main/res/values-ru/strings.xml +++ b/catroid/src/main/res/values-ru/strings.xml @@ -1,7 +1,7 @@ Эффект затухающих частиц diff --git a/catroid/src/main/res/values-sd/strings.xml b/catroid/src/main/res/values-sd/strings.xml index 4e15014b11d..3f9825e6349 100644 --- a/catroid/src/main/res/values-sd/strings.xml +++ b/catroid/src/main/res/values-sd/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-si/strings.xml b/catroid/src/main/res/values-si/strings.xml index 8dd3dcbebc1..c074f9592cd 100644 --- a/catroid/src/main/res/values-si/strings.xml +++ b/catroid/src/main/res/values-si/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-sk/strings.xml b/catroid/src/main/res/values-sk/strings.xml index 678521d7aef..fb5309df1b9 100644 --- a/catroid/src/main/res/values-sk/strings.xml +++ b/catroid/src/main/res/values-sk/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-sl/strings.xml b/catroid/src/main/res/values-sl/strings.xml index 941a0c85eb3..e5534d8b4fa 100644 --- a/catroid/src/main/res/values-sl/strings.xml +++ b/catroid/src/main/res/values-sl/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-sq/strings.xml b/catroid/src/main/res/values-sq/strings.xml index fb44bd4657f..9da7ad5eba1 100644 --- a/catroid/src/main/res/values-sq/strings.xml +++ b/catroid/src/main/res/values-sq/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-sr-rCS/strings.xml b/catroid/src/main/res/values-sr-rCS/strings.xml index 6c1d34a7753..15ae55177b3 100644 --- a/catroid/src/main/res/values-sr-rCS/strings.xml +++ b/catroid/src/main/res/values-sr-rCS/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-sr-rSP/strings.xml b/catroid/src/main/res/values-sr-rSP/strings.xml index 0866520301f..7e69bd55a2b 100644 --- a/catroid/src/main/res/values-sr-rSP/strings.xml +++ b/catroid/src/main/res/values-sr-rSP/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-sv/strings.xml b/catroid/src/main/res/values-sv/strings.xml index f523e509739..9b1166d1510 100644 --- a/catroid/src/main/res/values-sv/strings.xml +++ b/catroid/src/main/res/values-sv/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-sw/strings.xml b/catroid/src/main/res/values-sw/strings.xml index 68f1e534eb8..4d7d48c8c48 100644 --- a/catroid/src/main/res/values-sw/strings.xml +++ b/catroid/src/main/res/values-sw/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-ta/strings.xml b/catroid/src/main/res/values-ta/strings.xml index 1f60857865d..66b6ac11c91 100644 --- a/catroid/src/main/res/values-ta/strings.xml +++ b/catroid/src/main/res/values-ta/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-te/strings.xml b/catroid/src/main/res/values-te/strings.xml index 43c2c18d569..189143e3416 100644 --- a/catroid/src/main/res/values-te/strings.xml +++ b/catroid/src/main/res/values-te/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-th/strings.xml b/catroid/src/main/res/values-th/strings.xml index 4406c33420d..3b35e54fc21 100644 --- a/catroid/src/main/res/values-th/strings.xml +++ b/catroid/src/main/res/values-th/strings.xml @@ -1,7 +1,7 @@ เอฟเฟกต์อนุภาคจาง diff --git a/catroid/src/main/res/values-tl/strings.xml b/catroid/src/main/res/values-tl/strings.xml index 28cdea29794..589aa195954 100644 --- a/catroid/src/main/res/values-tl/strings.xml +++ b/catroid/src/main/res/values-tl/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-tr/strings.xml b/catroid/src/main/res/values-tr/strings.xml index 47a3491028c..17baaca4067 100644 --- a/catroid/src/main/res/values-tr/strings.xml +++ b/catroid/src/main/res/values-tr/strings.xml @@ -1,7 +1,7 @@ Soluk parçacık efekti diff --git a/catroid/src/main/res/values-tw/strings.xml b/catroid/src/main/res/values-tw/strings.xml index 18950f665d3..03330778775 100644 --- a/catroid/src/main/res/values-tw/strings.xml +++ b/catroid/src/main/res/values-tw/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-uk/strings.xml b/catroid/src/main/res/values-uk/strings.xml index 4fda6daa154..6eb8dcbb1b0 100644 --- a/catroid/src/main/res/values-uk/strings.xml +++ b/catroid/src/main/res/values-uk/strings.xml @@ -1,7 +1,7 @@ Ефект згасання частинок diff --git a/catroid/src/main/res/values-ur/strings.xml b/catroid/src/main/res/values-ur/strings.xml index b6848dd60dd..339f54236e6 100644 --- a/catroid/src/main/res/values-ur/strings.xml +++ b/catroid/src/main/res/values-ur/strings.xml @@ -1,7 +1,7 @@ دھندلا ذرہ اثر diff --git a/catroid/src/main/res/values-uz/strings.xml b/catroid/src/main/res/values-uz/strings.xml index 50d9b713a42..221ee3176d0 100644 --- a/catroid/src/main/res/values-uz/strings.xml +++ b/catroid/src/main/res/values-uz/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-v25/styles.xml b/catroid/src/main/res/values-v25/styles.xml index ea4b69ccfdc..25ccc7c6db8 100644 --- a/catroid/src/main/res/values-v25/styles.xml +++ b/catroid/src/main/res/values-v25/styles.xml @@ -1,6 +1,6 @@ Fade particle effect diff --git a/catroid/src/main/res/values-yo-rNG/strings.xml b/catroid/src/main/res/values-yo-rNG/strings.xml index 915bad58ae3..c80d9d12392 100644 --- a/catroid/src/main/res/values-yo-rNG/strings.xml +++ b/catroid/src/main/res/values-yo-rNG/strings.xml @@ -1,7 +1,7 @@ Fade particle effect diff --git a/catroid/src/main/res/values-zh-rCN/strings.xml b/catroid/src/main/res/values-zh-rCN/strings.xml index d319ba4f4c8..2279fe595b4 100644 --- a/catroid/src/main/res/values-zh-rCN/strings.xml +++ b/catroid/src/main/res/values-zh-rCN/strings.xml @@ -1,7 +1,7 @@ 淡出粒子效果 diff --git a/catroid/src/main/res/values-zh-rTW/strings.xml b/catroid/src/main/res/values-zh-rTW/strings.xml index 192677e2267..c15d87584ae 100644 --- a/catroid/src/main/res/values-zh-rTW/strings.xml +++ b/catroid/src/main/res/values-zh-rTW/strings.xml @@ -1,7 +1,7 @@ 淡化粒子效果 diff --git a/catroid/src/main/res/values/colors.xml b/catroid/src/main/res/values/colors.xml index 5eb53f35b71..207b3845b73 100644 --- a/catroid/src/main/res/values/colors.xml +++ b/catroid/src/main/res/values/colors.xml @@ -1,7 +1,7 @@ - #D3D3D3 - #A9A9A9 - #242424 - #E9E9E9 - #A9A9A9 - #242424 - #D3D3D3 - #A9A9A9 - #242424 - #D3D3D3 - #A9A9A9 - #242424 - #E9E9E9 - #A9A9A9 - #242424 + #FFF + #FFF + #008B96 + #00A6B3 + #FFAB08 + #FFC953 + #008B96 + #00A6B3 + #008B96 + #00A6B3 + #FFAB08 + #FFC953 + #004156 + #00536B #000 diff --git a/catroid/src/main/res/values/dimens.xml b/catroid/src/main/res/values/dimens.xml index 8f6ee147e28..e72cb8dabc3 100644 --- a/catroid/src/main/res/values/dimens.xml +++ b/catroid/src/main/res/values/dimens.xml @@ -1,7 +1,7 @@ diff --git a/catroid/src/main/res/values/strings.xml b/catroid/src/main/res/values/strings.xml index adf38b92f30..6b31ef7870b 100644 --- a/catroid/src/main/res/values/strings.xml +++ b/catroid/src/main/res/values/strings.xml @@ -1,7 +1,7 @@ diff --git a/catroid/src/main/res/values/styles.xml b/catroid/src/main/res/values/styles.xml index 63d788753b4..1b28e644e0a 100644 --- a/catroid/src/main/res/values/styles.xml +++ b/catroid/src/main/res/values/styles.xml @@ -1,6 +1,6 @@