google / blockly-android

Blockly for Android
Apache License 2.0
671 stars 209 forks source link

Implement (crudely) changing the shape of a BlockView #586

Closed AnmAtAnm closed 7 years ago

AnmAtAnm commented 7 years ago

Implements support for the Block.reshape(..) changes. This crude implementation rebuilds the view from the model, and replaces the original view in the view tree. It looses some minor UI state, like highlight and text selection. Be careful of direct references to BlockViews.

Enables controls_if_mutator and minor fixes to math_is_divisible_mutator.


This change is Reviewable

RoboErikG commented 7 years ago

minor nits then :lgtm_strong:


Review status: 0 of 11 files reviewed at latest revision, 2 unresolved discussions.


blocklylib-core/src/main/java/com/google/blockly/android/ui/mutator/IfElseMutatorFragment.java, line 128 at r2 (raw file):

    private void updateCountString() {
        // Because the user always sees at least one "if", start the count at one.
        String elseIfCount = String.format(mElseIfCountString, mElseIfCount + 1);

update strings.mutator_if_else_ifelse_count to "number of if statements: %d" or similar to match new behavior.


blocklylib-core/src/main/java/com/google/blockly/model/mutator/MathIsDivisibleByMutator.java, line 4 at r2 (raw file):


import android.support.annotation.VisibleForTesting;
import android.util.Log;

unused?


Comments from Reviewable