Skip to content

Commit

Permalink
Merge pull request #2147 from Catrobat/release-0.9.28
Browse files Browse the repository at this point in the history
Release 0.9.28
  • Loading branch information
thmq authored Mar 1, 2017
2 parents 32b1c2d + 3404ad2 commit 66e4484
Show file tree
Hide file tree
Showing 112 changed files with 13,261 additions and 7,031 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dataSources.ids
# generated files
bin/
gen/
!jniLibs/
jniLibs/

# Local configuration file (sdk path, etc)
local.properties
Expand Down
107 changes: 38 additions & 69 deletions catroid/catroid.iml

Large diffs are not rendered by default.

12 changes: 5 additions & 7 deletions catroid/gradle/standalone_apk_tasks.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,11 @@ def copyScreenshotAsIcon() {
println "Picking automatic screenshot: " + screenshot.getPath()
}

if (screenshot != null && screenshot.exists()) {
copy {
from screenshot.getPath()
into project.ext.resPath
rename { String fileName ->
fileName.replace(screenshot.getName(), 'icon.png')
}
copy {
from screenshot.getPath();
into project.ext.resPath
rename { String fileName ->
fileName.replace(screenshot.getName(), 'splash_screen.png')
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ public void testPrevious2() {
public void testIsSigned1() {
NoteName noteName = NoteName.C1;

assertFalse("Note not signed correctly", noteName.isBlackKey());
assertFalse("Note not signed correctly", noteName.isSigned());
}

public void testIsSigned2() {
NoteName noteName = NoteName.C1S;

assertTrue("Note not signed correctly", noteName.isBlackKey());
assertTrue("Note not signed correctly", noteName.isSigned());
}

public void testGetNoteNameFromMidiValue1() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1827,8 +1827,7 @@ public static void openActionMode(Solo solo, String overflowMenuItemName, int me
} else if (overflowMenuItemName != null) {
solo.waitForText(overflowMenuItemName, 0, 20000, false);

if (overflowMenuItemName.equals(solo.getString(R.string.unpack))
|| overflowMenuItemName.equals(solo.getString(R.string.unpack_keep))) {
if (overflowMenuItemName.equals(solo.getString(R.string.unpack))) {
solo.clickOnActionBarItem(menuItemId);
} else {
solo.clickOnMenuItem(overflowMenuItemName, true);
Expand Down
12 changes: 12 additions & 0 deletions catroid/src/main/java/org/catrobat/catroid/ProjectManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public final class ProjectManager implements OnLoadProjectCompleteListener, OnCh
private Project project;
private Scene currentScene;
private Scene sceneToPlay;
private Scene startScene;
private Script currentScript;
private Sprite currentSprite;
private Sprite previousSprite;
Expand Down Expand Up @@ -364,6 +365,17 @@ public void setSceneToPlay(Scene scene) {
sceneToPlay = scene;
}

public Scene getStartScene() {
if (startScene == null) {
startScene = getCurrentScene();
}
return startScene;
}

public void setStartScene(Scene scene) {
startScene = scene;
}

public Scene getCurrentScene() {
if (currentScene == null) {
currentScene = project.getDefaultScene();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ public Sprite getSpriteBySpriteName(String searchedSprite) {
}

public synchronized void replaceBackgroundSprite(Sprite unpackedSprite) {
unpackedSprite.setName(spriteList.get(0).getName());
spriteList.set(0, unpackedSprite);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,14 @@ public List<SequenceAction> addActionToSequence(Sprite sprite, SequenceAction se

public void showFormulaEditorToEditFormula(View view) {
switch (view.getId()) {
case R.id.brick_arduino_set_digital_pin_edit_text:
FormulaEditorFragment.showFragment(view, this, BrickField.ARDUINO_DIGITAL_PIN_NUMBER);
break;

case R.id.brick_arduino_set_digital_value_edit_text:
FormulaEditorFragment.showFragment(view, this, BrickField.ARDUINO_DIGITAL_PIN_VALUE);
break;

case R.id.brick_arduino_set_digital_pin_edit_text:
default:
FormulaEditorFragment.showFragment(view, this, BrickField.ARDUINO_DIGITAL_PIN_NUMBER);
break;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,14 @@ public List<SequenceAction> addActionToSequence(Sprite sprite, SequenceAction se

public void showFormulaEditorToEditFormula(View view) {
switch (view.getId()) {
case R.id.brick_arduino_set_analog_pin_edit_text:
FormulaEditorFragment.showFragment(view, this, BrickField.ARDUINO_ANALOG_PIN_NUMBER);
break;

case R.id.brick_arduino_set_analog_value_edit_text:
FormulaEditorFragment.showFragment(view, this, BrickField.ARDUINO_ANALOG_PIN_VALUE);
break;

case R.id.brick_arduino_set_analog_pin_edit_text:
default:
FormulaEditorFragment.showFragment(view, this, BrickField.ARDUINO_ANALOG_PIN_NUMBER);
break;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,14 @@ public int getRequiredResources() {
@Override
public void showFormulaEditorToEditFormula(View view) {
switch (view.getId()) {
case R.id.brick_drone_move_edit_text_second:
FormulaEditorFragment.showFragment(view, this, BrickField.DRONE_TIME_TO_FLY_IN_SECONDS);
break;

case R.id.brick_drone_move_edit_text_power:
FormulaEditorFragment.showFragment(view, this, BrickField.DRONE_POWER_IN_PERCENT);
break;

case R.id.brick_drone_move_edit_text_second:
default:
FormulaEditorFragment.showFragment(view, this, BrickField.DRONE_TIME_TO_FLY_IN_SECONDS);
break;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ public void showFormulaEditorToEditFormula(View view) {
break;

case R.id.brick_glide_to_edit_text_duration:
default:
FormulaEditorFragment.showFragment(view, this, BrickField.DURATION_IN_SECONDS);
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,14 @@ public Brick clone() {
@Override
public void showFormulaEditorToEditFormula(View view) {
switch (view.getId()) {
case R.id.brick_insert_item_into_userlist_at_index_edit_text:
FormulaEditorFragment.showFragment(view, this, BrickField.INSERT_ITEM_INTO_USERLIST_INDEX);
break;
case R.id.brick_insert_item_into_userlist_value_edit_text:
FormulaEditorFragment.showFragment(view, this, BrickField.INSERT_ITEM_INTO_USERLIST_VALUE);
break;

case R.id.brick_insert_item_into_userlist_at_index_edit_text:
default:
FormulaEditorFragment.showFragment(view, this, BrickField.INSERT_ITEM_INTO_USERLIST_INDEX);
break;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,13 @@ public void showFormulaEditorToEditFormula(View view) {
case R.id.brick_ev3_tone_freq_edit_text:
FormulaEditorFragment.showFragment(view, this, BrickField.LEGO_EV3_FREQUENCY);
break;
case R.id.brick_ev3_tone_duration_edit_text:
FormulaEditorFragment.showFragment(view, this, BrickField.LEGO_EV3_DURATION_IN_SECONDS);
break;
case R.id.brick_ev3_tone_volume_edit_text:
FormulaEditorFragment.showFragment(view, this, BrickField.LEGO_EV3_VOLUME);
break;
case R.id.brick_ev3_tone_duration_edit_text:
default:
FormulaEditorFragment.showFragment(view, this, BrickField.LEGO_EV3_DURATION_IN_SECONDS);
break;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ public void showFormulaEditorToEditFormula(View view) {
FormulaEditorFragment.showFragment(view, this, BrickField.LEGO_NXT_FREQUENCY);
break;
case R.id.nxt_tone_duration_edit_text:
default:
FormulaEditorFragment.showFragment(view, this, BrickField.LEGO_NXT_DURATION_IN_SECONDS);
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,6 @@ public void onNothingSelected(AdapterView<?> arg0) {

@Override
public void showFormulaEditorToEditFormula(View view) {

BrickField clickedBrickField = getClickedBrickField(view);
if (clickedBrickField == null) {
return;
}

if (areAllBrickFieldsNumbers()) {
FormulaEditorFragment.showCustomFragment(view, this, getClickedBrickField(view));
} else {
Expand All @@ -218,15 +212,14 @@ private boolean areAllBrickFieldsNumbers() {

private BrickField getClickedBrickField(View view) {
switch (view.getId()) {
case R.id.brick_phiro_rgb_led_action_red_edit_text:
return BrickField.PHIRO_LIGHT_RED;
case R.id.brick_phiro_rgb_led_action_green_edit_text:
return BrickField.PHIRO_LIGHT_GREEN;
case R.id.brick_phiro_rgb_led_action_blue_edit_text:
return BrickField.PHIRO_LIGHT_BLUE;
case R.id.brick_phiro_rgb_led_action_red_edit_text:
default:
return BrickField.PHIRO_LIGHT_RED;
}

return null;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,14 @@ public List<SequenceAction> addActionToSequence(Sprite sprite, SequenceAction se

public void showFormulaEditorToEditFormula(View view) {
switch (view.getId()) {
case R.id.brick_place_at_edit_text_x:
FormulaEditorFragment.showFragment(view, this, BrickField.X_POSITION);
break;

case R.id.brick_place_at_edit_text_y:
FormulaEditorFragment.showFragment(view, this, BrickField.Y_POSITION);
break;

case R.id.brick_place_at_edit_text_x:
default:
FormulaEditorFragment.showFragment(view, this, BrickField.X_POSITION);
break;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,18 @@ public List<SequenceAction> addActionToSequence(Sprite sprite, SequenceAction se

public void showFormulaEditorToEditFormula(View view) {
switch (view.getId()) {
case R.id.brick_raspi_pwm_pin_edit_text:
FormulaEditorFragment.showFragment(view, this, BrickField.RASPI_DIGITAL_PIN_NUMBER);
break;

case R.id.brick_raspi_pwm_frequency_edit_text:
FormulaEditorFragment.showFragment(view, this, BrickField.RASPI_PWM_FREQUENCY);
break;

case R.id.brick_raspi_pwm_percentage_edit_text:
FormulaEditorFragment.showFragment(view, this, BrickField.RASPI_PWM_PERCENTAGE);
break;

case R.id.brick_raspi_pwm_pin_edit_text:
default:
FormulaEditorFragment.showFragment(view, this, BrickField.RASPI_DIGITAL_PIN_NUMBER);
break;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,14 @@ public List<SequenceAction> addActionToSequence(Sprite sprite, SequenceAction se

public void showFormulaEditorToEditFormula(View view) {
switch (view.getId()) {
case R.id.brick_raspi_set_digital_pin_edit_text:
FormulaEditorFragment.showFragment(view, this, BrickField.RASPI_DIGITAL_PIN_NUMBER);
break;

case R.id.brick_raspi_set_digital_value_edit_text:
FormulaEditorFragment.showFragment(view, this, BrickField.RASPI_DIGITAL_PIN_VALUE);
break;

case R.id.brick_raspi_set_digital_pin_edit_text:
default:
FormulaEditorFragment.showFragment(view, this, BrickField.RASPI_DIGITAL_PIN_NUMBER);
break;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,14 @@ public Brick clone() {
@Override
public void showFormulaEditorToEditFormula(View view) {
switch (view.getId()) {
case R.id.brick_replace_item_in_userlist_at_index_edit_text:
FormulaEditorFragment.showFragment(view, this, BrickField.REPLACE_ITEM_IN_USERLIST_INDEX);
break;
case R.id.brick_replace_item_in_userlist_value_edit_text:
FormulaEditorFragment.showFragment(view, this, BrickField.REPLACE_ITEM_IN_USERLIST_VALUE);
break;

case R.id.brick_replace_item_in_userlist_at_index_edit_text:
default:
FormulaEditorFragment.showFragment(view, this, BrickField.REPLACE_ITEM_IN_USERLIST_INDEX);
break;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,6 @@ public View getView(Context context, int brickId, BaseAdapter baseAdapter) {

@Override
public void showFormulaEditorToEditFormula(View view) {

BrickField clickedBrickField = getClickedBrickField(view);
if (clickedBrickField == null) {
return;
}

if (areAllBrickFieldsNumbers()) {
FormulaEditorFragment.showCustomFragment(view, this, getClickedBrickField(view));
} else {
Expand All @@ -170,15 +164,14 @@ private boolean areAllBrickFieldsNumbers() {

private BrickField getClickedBrickField(View view) {
switch (view.getId()) {
case R.id.brick_set_pen_color_action_red_edit_text:
return BrickField.PHIRO_LIGHT_RED;
case R.id.brick_set_pen_color_action_green_edit_text:
return BrickField.PHIRO_LIGHT_GREEN;
case R.id.brick_set_pen_color_action_blue_edit_text:
return BrickField.PHIRO_LIGHT_BLUE;
case R.id.brick_set_pen_color_action_red_edit_text:
default:
return BrickField.PHIRO_LIGHT_RED;
}

return null;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ public void showFormulaEditorToEditFormula(View view) {
break;

case R.id.brick_set_text_edit_text:
default:
FormulaEditorFragment.showFragment(view, this, BrickField.STRING);
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,14 @@ public void setYPosition(Formula yPosition) {
@Override
public void showFormulaEditorToEditFormula(View view) {
switch (view.getId()) {
case R.id.brick_show_variable_edit_text_x:
FormulaEditorFragment.showFragment(view, this, BrickField.X_POSITION);
break;

case R.id.brick_show_variable_edit_text_y:
FormulaEditorFragment.showFragment(view, this, BrickField.Y_POSITION);
break;

case R.id.brick_show_variable_edit_text_x:
default:
FormulaEditorFragment.showFragment(view, this, BrickField.X_POSITION);
break;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,14 @@ public void showFormulaEditorToEditFormula(View view) {
return;
}
switch (view.getId()) {
case R.id.brick_set_gravity_edit_text_x:
FormulaEditorFragment.showFragment(view, this, BrickField.PHYSICS_GRAVITY_X);
break;

case R.id.brick_set_gravity_edit_text_y:
FormulaEditorFragment.showFragment(view, this, BrickField.PHYSICS_GRAVITY_Y);
break;

case R.id.brick_set_gravity_edit_text_x:
default:
// nothing to do
FormulaEditorFragment.showFragment(view, this, BrickField.PHYSICS_GRAVITY_X);
break;
}
}

Expand Down
Loading

0 comments on commit 66e4484

Please sign in to comment.