IDE-28: Add "Your Functions" Button to Formula Editor Keyboard#5172
Draft
harshsomankar123-tech wants to merge 5 commits intoCatrobat:developfrom
Draft
IDE-28: Add "Your Functions" Button to Formula Editor Keyboard#5172harshsomankar123-tech wants to merge 5 commits intoCatrobat:developfrom
harshsomankar123-tech wants to merge 5 commits intoCatrobat:developfrom
Conversation
|
| import android.view.View; | ||
| import android.view.ViewGroup; | ||
|
|
||
| import org.catrobat.catroid.BuildConfig; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
This PR implements a "Your functions" button within the Formula Editor's keyboard. This allows users to insert user-defined reporter functions (
UserDefinedBrickscontaining aReportBrick) directly into their formulas.Scope of this initial implementation:
FEATURE_USER_REPORTERS_ENABLEDis true (currently enabled in debug builds).USER_DEFINED_BRICK_FUNCTIONusing the brick's UUID, placing0as the default value for any inputs.0.0. The actual evaluation logic is out of scope for this PR and will be handled in a subsequent task (CATROID-909).Changes
UI / UX
formula_editor_keyboard_your_functionsbutton in the second row of category buttons.[Insert Class/View Name]that dynamically lists reporter user-defined bricks present in the current sprite.label input label(0, 0, ...)where0placeholders represent inputs.Formula Engine
USER_DEFINED_BRICK_FUNCTIONto theFunctionsenum.[Insert Class Name]to support building token lists for UUID-based user-defined function calls.[Insert Class Name]to recognize and interpret the new function type (temporarily hardcoded to return0.0).Build & Config
BuildConfig.FEATURE_USER_REPORTERS_ENABLED.formula_editor_your_functionsfor localization.Verification
Automated Tests
ParserFunctionTest.java: Added[Insert Method Name]to verify that the formula parser correctly recognizes the new user-defined function type and safely returns0.0.Manual Testing Steps
0.checklist for this pull request
Please review the contributing guidelines and wiki pages of this repository.