Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CATROID-464 Refactor string resource 'Place Visually' #3478

Merged
merged 1 commit into from
Feb 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand All @@ -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<SpriteActivity> baseActivityTestRule = new
Expand All @@ -87,11 +91,15 @@ public static Collection<Object[]> 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() {
Expand All @@ -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()));
Expand All @@ -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()));
Expand All @@ -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()));
}

Expand Down Expand Up @@ -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()));
Expand All @@ -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()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand All @@ -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 + " ")));
Expand All @@ -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)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ private List<Integer> 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);
Expand Down Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion catroid/src/main/res/values-af/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@
<!-- -->
<!-- Motion bricks -->
<string name="brick_place_at">"Place at"</string>
<string name="brick_place_at_option_place_visually">Place visually</string>
<string name="brick_option_place_visually">Place visually</string>
<string name="x_label">"x:"</string>
<string name="y_label">"y:"</string>
<string name="brick_set_x">"Set x to"</string>
Expand Down
2 changes: 1 addition & 1 deletion catroid/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,7 @@
<!-- -->
<!-- Motion bricks -->
<string name="brick_place_at">"تحديد موقع الكائن في "</string>
<string name="brick_place_at_option_place_visually">تحديد الموقع بصرياً</string>
<string name="brick_option_place_visually">تحديد الموقع بصرياً</string>
<string name="x_label">"س: "</string>
<string name="y_label">"ص: "</string>
<string name="brick_set_x">"تعيين قيمة س الى "</string>
Expand Down
2 changes: 1 addition & 1 deletion catroid/src/main/res/values-az/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@
<!-- -->
<!-- Motion bricks -->
<string name="brick_place_at">"Place at"</string>
<string name="brick_place_at_option_place_visually">Place visually</string>
<string name="brick_option_place_visually">Place visually</string>
<string name="x_label">"x:"</string>
<string name="y_label">"y:"</string>
<string name="brick_set_x">"Set x to"</string>
Expand Down
2 changes: 1 addition & 1 deletion catroid/src/main/res/values-bg/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@
<!-- -->
<!-- Motion bricks -->
<string name="brick_place_at">"Place at"</string>
<string name="brick_place_at_option_place_visually">Place visually</string>
<string name="brick_option_place_visually">Place visually</string>
<string name="x_label">"x:"</string>
<string name="y_label">"y:"</string>
<string name="brick_set_x">"Set x to"</string>
Expand Down
2 changes: 1 addition & 1 deletion catroid/src/main/res/values-bn/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@
<!-- -->
<!-- Motion bricks -->
<string name="brick_place_at">"এ স্থান"</string>
<string name="brick_place_at_option_place_visually">দর্শনীয়ভাবে রাখুন</string>
<string name="brick_option_place_visually">দর্শনীয়ভাবে রাখুন</string>
<string name="x_label">"x:"</string>
<string name="y_label">"y:"</string>
<string name="brick_set_x">"X সেট করুন"</string>
Expand Down
2 changes: 1 addition & 1 deletion catroid/src/main/res/values-bs/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@
<!-- -->
<!-- Motion bricks -->
<string name="brick_place_at">"Postavi na "</string>
<string name="brick_place_at_option_place_visually">Place visually</string>
<string name="brick_option_place_visually">Place visually</string>
<string name="x_label">"X: "</string>
<string name="y_label">"Y: "</string>
<string name="brick_set_x">"Postavi X na "</string>
Expand Down
2 changes: 1 addition & 1 deletion catroid/src/main/res/values-ca/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@
<!-- -->
<!-- Motion bricks -->
<string name="brick_place_at">"Place at"</string>
<string name="brick_place_at_option_place_visually">Place visually</string>
<string name="brick_option_place_visually">Place visually</string>
<string name="x_label">"x:"</string>
<string name="y_label">"y:"</string>
<string name="brick_set_x">"Set x to"</string>
Expand Down
2 changes: 1 addition & 1 deletion catroid/src/main/res/values-cs/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,7 @@
<!-- -->
<!-- Motion bricks -->
<string name="brick_place_at">"Umístěte na "</string>
<string name="brick_place_at_option_place_visually">Place visually</string>
<string name="brick_option_place_visually">Place visually</string>
<string name="x_label">"X: "</string>
<string name="y_label">"Y: "</string>
<string name="brick_set_x">"Nastav x na "</string>
Expand Down
2 changes: 1 addition & 1 deletion catroid/src/main/res/values-da/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@
<!-- -->
<!-- Motion bricks -->
<string name="brick_place_at">"Placér ved"</string>
<string name="brick_place_at_option_place_visually">Place visually</string>
<string name="brick_option_place_visually">Place visually</string>
<string name="x_label">"X:"</string>
<string name="y_label">"Y:"</string>
<string name="brick_set_x">"Sæt X til"</string>
Expand Down
2 changes: 1 addition & 1 deletion catroid/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@
<!-- -->
<!-- Motion bricks -->
<string name="brick_place_at">"Setze an Position "</string>
<string name="brick_place_at_option_place_visually">Visuell platzieren</string>
<string name="brick_option_place_visually">Visuell platzieren</string>
<string name="x_label">"x: "</string>
<string name="y_label">"y: "</string>
<string name="brick_set_x">"Setze X auf"</string>
Expand Down
2 changes: 1 addition & 1 deletion catroid/src/main/res/values-el/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@
<!-- -->
<!-- Motion bricks -->
<string name="brick_place_at">"Place at"</string>
<string name="brick_place_at_option_place_visually">Place visually</string>
<string name="brick_option_place_visually">Place visually</string>
<string name="x_label">"x:"</string>
<string name="y_label">"y:"</string>
<string name="brick_set_x">"Set x to"</string>
Expand Down
2 changes: 1 addition & 1 deletion catroid/src/main/res/values-en-rAU/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@
<!-- -->
<!-- Motion bricks -->
<string name="brick_place_at">"Place at"</string>
<string name="brick_place_at_option_place_visually">Place visually</string>
<string name="brick_option_place_visually">Place visually</string>
<string name="x_label">"x:"</string>
<string name="y_label">"y:"</string>
<string name="brick_set_x">"Set x to"</string>
Expand Down
2 changes: 1 addition & 1 deletion catroid/src/main/res/values-en-rCA/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@
<!-- -->
<!-- Motion bricks -->
<string name="brick_place_at">"Place at"</string>
<string name="brick_place_at_option_place_visually">Place visually</string>
<string name="brick_option_place_visually">Place visually</string>
<string name="x_label">"x:"</string>
<string name="y_label">"y:"</string>
<string name="brick_set_x">"Set x to"</string>
Expand Down
2 changes: 1 addition & 1 deletion catroid/src/main/res/values-en-rGB/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@
<!-- -->
<!-- Motion bricks -->
<string name="brick_place_at">"Place at "</string>
<string name="brick_place_at_option_place_visually">Place visually</string>
<string name="brick_option_place_visually">Place visually</string>
<string name="x_label">"X: "</string>
<string name="y_label">"Y: "</string>
<string name="brick_set_x">"Set X to "</string>
Expand Down
2 changes: 1 addition & 1 deletion catroid/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@
<!-- -->
<!-- Motion bricks -->
<string name="brick_place_at">"Coloque en "</string>
<string name="brick_place_at_option_place_visually">Place visually</string>
<string name="brick_option_place_visually">Place visually</string>
<string name="x_label">"X: "</string>
<string name="y_label">"Y: "</string>
<string name="brick_set_x">"Establezca X"</string>
Expand Down
2 changes: 1 addition & 1 deletion catroid/src/main/res/values-fa/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@
<!-- -->
<!-- Motion bricks -->
<string name="brick_place_at">"Place at"</string>
<string name="brick_place_at_option_place_visually">Place visually</string>
<string name="brick_option_place_visually">Place visually</string>
<string name="x_label">"x:"</string>
<string name="y_label">"y:"</string>
<string name="brick_set_x">"Set x to"</string>
Expand Down
2 changes: 1 addition & 1 deletion catroid/src/main/res/values-fi/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@
<!-- -->
<!-- Motion bricks -->
<string name="brick_place_at">"Place at"</string>
<string name="brick_place_at_option_place_visually">Place visually</string>
<string name="brick_option_place_visually">Place visually</string>
<string name="x_label">"x:"</string>
<string name="y_label">"y:"</string>
<string name="brick_set_x">"Set x to"</string>
Expand Down
2 changes: 1 addition & 1 deletion catroid/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@
<!-- -->
<!-- Motion bricks -->
<string name="brick_place_at">"Positionner à "</string>
<string name="brick_place_at_option_place_visually">Place visually</string>
<string name="brick_option_place_visually">Place visually</string>
<string name="x_label">"x : "</string>
<string name="y_label">"y : "</string>
<string name="brick_set_x">"Mettre X à "</string>
Expand Down
2 changes: 1 addition & 1 deletion catroid/src/main/res/values-gl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@
<!-- -->
<!-- Motion bricks -->
<string name="brick_place_at">"Place at"</string>
<string name="brick_place_at_option_place_visually">Place visually</string>
<string name="brick_option_place_visually">Place visually</string>
<string name="x_label">"x:"</string>
<string name="y_label">"y:"</string>
<string name="brick_set_x">"Set x to"</string>
Expand Down
2 changes: 1 addition & 1 deletion catroid/src/main/res/values-gu/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@
<!-- -->
<!-- Motion bricks -->
<string name="brick_place_at">"Place at"</string>
<string name="brick_place_at_option_place_visually">Place visually</string>
<string name="brick_option_place_visually">Place visually</string>
<string name="x_label">"x:"</string>
<string name="y_label">"y:"</string>
<string name="brick_set_x">"Set x to"</string>
Expand Down
2 changes: 1 addition & 1 deletion catroid/src/main/res/values-ha/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@
<!-- -->
<!-- Motion bricks -->
<string name="brick_place_at">"Place at"</string>
<string name="brick_place_at_option_place_visually">Place visually</string>
<string name="brick_option_place_visually">Place visually</string>
<string name="x_label">"x:"</string>
<string name="y_label">"y:"</string>
<string name="brick_set_x">"Set x to"</string>
Expand Down
2 changes: 1 addition & 1 deletion catroid/src/main/res/values-hi/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@
<!-- -->
<!-- Motion bricks -->
<string name="brick_place_at">"Place at"</string>
<string name="brick_place_at_option_place_visually">Place visually</string>
<string name="brick_option_place_visually">Place visually</string>
<string name="x_label">"x:"</string>
<string name="y_label">"y:"</string>
<string name="brick_set_x">"Set x to"</string>
Expand Down
2 changes: 1 addition & 1 deletion catroid/src/main/res/values-hr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,7 @@ Ako se ne osjecate ugodno kako bi to ucinili, mozete koristiti nase besplatne we
<!-- -->
<!-- Motion bricks -->
<string name="brick_place_at">"Postavi na "</string>
<string name="brick_place_at_option_place_visually">Place visually</string>
<string name="brick_option_place_visually">Place visually</string>
<string name="x_label">"X: "</string>
<string name="y_label">"Y: "</string>
<string name="brick_set_x">"Postavi X na "</string>
Expand Down
2 changes: 1 addition & 1 deletion catroid/src/main/res/values-hu/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@
<!-- -->
<!-- Motion bricks -->
<string name="brick_place_at">"Ugorj "</string>
<string name="brick_place_at_option_place_visually">Place visually</string>
<string name="brick_option_place_visually">Place visually</string>
<string name="x_label">"X: "</string>
<string name="y_label">"Y: "</string>
<string name="brick_set_x">"X legyen "</string>
Expand Down
2 changes: 1 addition & 1 deletion catroid/src/main/res/values-ig/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@
<!-- -->
<!-- Motion bricks -->
<string name="brick_place_at">"Place at"</string>
<string name="brick_place_at_option_place_visually">Place visually</string>
<string name="brick_option_place_visually">Place visually</string>
<string name="x_label">"x:"</string>
<string name="y_label">"y:"</string>
<string name="brick_set_x">"Set x to"</string>
Expand Down
2 changes: 1 addition & 1 deletion catroid/src/main/res/values-in/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@
<!-- -->
<!-- Motion bricks -->
<string name="brick_place_at">"Tempatkan di "</string>
<string name="brick_place_at_option_place_visually">Place visually</string>
<string name="brick_option_place_visually">Place visually</string>
<string name="x_label">"X: "</string>
<string name="y_label">"Y: "</string>
<string name="brick_set_x">"Set X ke "</string>
Expand Down
2 changes: 1 addition & 1 deletion catroid/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@
<!-- -->
<!-- Motion bricks -->
<string name="brick_place_at">"Posiziona a "</string>
<string name="brick_place_at_option_place_visually">Posiziona in modo visuale</string>
<string name="brick_option_place_visually">Posiziona in modo visuale</string>
<string name="x_label">"X: "</string>
<string name="y_label">"Y: "</string>
<string name="brick_set_x">"Imposta X a "</string>
Expand Down
Loading