{"action":"created","comment":{"url":"https://api.github.com/repos/Catrobat/Catroid/pulls/comments/72037428","id":72037428,"diff_hunk":"@@ -0,0 +1,266 @@\n+/*\n+ * Catroid: An on-device visual programming system for Android devices\n+ * Copyright (C) 2010-2016 The Catrobat Team\n+ * (<http://developer.catrobat.org/credits>)\n+ *\n+ * This program is free software: you can redistribute it and/or modify\n+ * it under the terms of the GNU Affero General Public License as\n+ * published by the Free Software Foundation, either version 3 of the\n+ * License, or (at your option) any later version.\n+ *\n+ * An additional term exception under section 7 of the GNU Affero\n+ * General Public License, version 3, is available at\n+ * http://developer.catrobat.org/license_additional_term\n+ *\n+ * This program is distributed in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n+ * GNU Affero General Public License for more details.\n+ *\n+ * You should have received a copy of the GNU Affero General Public License\n+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n+ */\n+package org.catrobat.catroid.content.bricks;\n+\n+import android.app.Activity;\n+import android.content.Context;\n+import android.content.res.ColorStateList;\n+import android.view.MotionEvent;\n+import android.view.View;\n+import android.view.View.OnTouchListener;\n+import android.widget.AdapterView;\n+import android.widget.AdapterView.OnItemSelectedListener;\n+import android.widget.BaseAdapter;\n+import android.widget.CompoundButton;\n+import android.widget.CompoundButton.OnCheckedChangeListener;\n+import android.widget.Spinner;\n+import android.widget.TextView;\n+\n+import com.badlogic.gdx.scenes.scene2d.actions.SequenceAction;\n+\n+import org.catrobat.catroid.ProjectManager;\n+import org.catrobat.catroid.R;\n+import org.catrobat.catroid.content.Project;\n+import org.catrobat.catroid.content.Sprite;\n+import org.catrobat.catroid.formulaeditor.Formula;\n+import org.catrobat.catroid.formulaeditor.InternToExternGenerator;\n+import org.catrobat.catroid.formulaeditor.UserVariable;\n+import org.catrobat.catroid.ui.adapter.DataAdapter;\n+import org.catrobat.catroid.ui.adapter.UserVariableAdapterWrapper;\n+import org.catrobat.catroid.ui.dialogs.NewDataDialog;\n+import org.catrobat.catroid.ui.fragment.FormulaEditorFragment;\n+\n+import java.util.List;\n+\n+public class AskBrick extends UserVariableBrick {\n+\n+\tprivate static final long serialVersionUID = 1L;\n+\tprivate transient AdapterView<?> adapterView;\n+\n+\tprivate transient String defaultPrototypeToken = null;\n+\n+\tpublic AskBrick(Formula questionFormula, UserVariable answerVariable) {\n+\t\tthis.userVariable = answerVariable;\n+\t\tinitializeBrickFields(questionFormula);\n+\t}\n+\n+\tpublic AskBrick(String questionText) {\n+\t\tthis.userVariable = null;\n+\t\tinitializeBrickFields(new Formula(questionText));\n+\t}\n+\n+\tprivate void initializeBrickFields(Formula questionFormula) {\n+\t\taddAllowedBrickField(BrickField.ASK_QUESTION);\n+\t\tsetFormulaWithBrickField(BrickField.ASK_QUESTION, questionFormula);\n+\t}\n+\n+\t@Override\n+\tpublic int getRequiredResources() {\n+\t\treturn getFormulaWithBrickField(BrickField.ASK_QUESTION).getRequiredResources();\n+\t}\n+\n+\t@Override\n+\tpublic List<SequenceAction> addActionToSequence(Sprite sprite, SequenceAction sequence) {\n+\t\tsequence.addAction(sprite.getActionFactory().createAskAction(sprite,\n+\t\t\t\tgetFormulaWithBrickField(BrickField.ASK_QUESTION), userVariable));\n+\t\treturn null;","path":"catroid/src/org/catrobat/catroid/content/bricks/AskBrick.java","position":86,"original_position":86,"commit_id":"3b609dd12d0650ba99f4543bf94e28c47926b8c5","original_commit_id":"3b609dd12d0650ba99f4543bf94e28c47926b8c5","user":{"login":"p4p4","id":1523187,"avatar_url":"https://avatars.githubusercontent.com/u/1523187?v=3","gravatar_id":"","url":"https://api.github.com/users/p4p4","html_url":"https://github.com/p4p4","followers_url":"https://api.github.com/users/p4p4/followers","following_url":"https://api.github.com/users/p4p4/following{/other_user}","gists_url":"https://api.github.com/users/p4p4/gists{/gist_id}","starred_url":"https://api.github.com/users/p4p4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/p4p4/subscriptions","organizations_url":"https://api.github.com/users/p4p4/orgs","repos_url":"https://api.github.com/users/p4p4/repos","events_url":"https://api.github.com/users/p4p4/events{/privacy}","received_events_url":"https://api.github.com/users/p4p4/received_events","type":"User","site_admin":false},"body":"I suggest returning `Collections.emptyList()` as the preferred way if the returned list is not modified\r\n\r\n","created_at":"2016-07-25T09:56:43Z","updated_at":"2016-07-25T09:56:43Z","html_url":"https://github.com/Catrobat/Catroid/pull/1810#discussion_r72037428","pull_request_url":"https://api.github.com/repos/Catrobat/Catroid/pulls/1810","_links":{"self":{"href":"https://api.github.com/repos/Catrobat/Catroid/pulls/comments/72037428"},"html":{"href":"https://github.com/Catrobat/Catroid/pull/1810#discussion_r72037428"},"pull_request":{"href":"https://api.github.com/repos/Catrobat/Catroid/pulls/1810"}}},"pull_request":{"url":"https://api.github.com/repos/Catrobat/Catroid/pulls/1810","id":78572264,"html_url":"https://github.com/Catrobat/Catroid/pull/1810","diff_url":"https://github.com/Catrobat/Catroid/pull/1810.diff","patch_url":"https://github.com/Catrobat/Catroid/pull/1810.patch","issue_url":"https://api.github.com/repos/Catrobat/Catroid/issues/1810","number":1810,"state":"open","locked":false,"title":"CAT-1937 Ask Brick","user":{"login":"p4p4","id":1523187,"avatar_url":"https://avatars.githubusercontent.com/u/1523187?v=3","gravatar_id":"","url":"https://api.github.com/users/p4p4","html_url":"https://github.com/p4p4","followers_url":"https://api.github.com/users/p4p4/followers","following_url":"https://api.github.com/users/p4p4/following{/other_user}","gists_url":"https://api.github.com/users/p4p4/gists{/gist_id}","starred_url":"https://api.github.com/users/p4p4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/p4p4/subscriptions","organizations_url":"https://api.github.com/users/p4p4/orgs","repos_url":"https://api.github.com/users/p4p4/repos","events_url":"https://api.github.com/users/p4p4/events{/privacy}","received_events_url":"https://api.github.com/users/p4p4/received_events","type":"User","site_admin":false},"body":"- ask a user defined question\r\n- answer is entered in a dialog by the user\r\n- program is paused while user enters answer\r\n- program is resumed as soon as an answer is provided by the user","created_at":"2016-07-23T13:31:36Z","updated_at":"2016-07-25T09:56:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"588dcac6498d35cbffa3f7dc2a9ea84d6582a7ca","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Catrobat/Catroid/pulls/1810/commits","review_comments_url":"https://api.github.com/repos/Catrobat/Catroid/pulls/1810/comments","review_comment_url":"https://api.github.com/repos/Catrobat/Catroid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Catrobat/Catroid/issues/1810/comments","statuses_url":"https://api.github.com/repos/Catrobat/Catroid/statuses/3b609dd12d0650ba99f4543bf94e28c47926b8c5","head":{"label":"p4p4:CAT-1937","ref":"CAT-1937","sha":"3b609dd12d0650ba99f4543bf94e28c47926b8c5","user":{"login":"p4p4","id":1523187,"avatar_url":"https://avatars.githubusercontent.com/u/1523187?v=3","gravatar_id":"","url":"https://api.github.com/users/p4p4","html_url":"https://github.com/p4p4","followers_url":"https://api.github.com/users/p4p4/followers","following_url":"https://api.github.com/users/p4p4/following{/other_user}","gists_url":"https://api.github.com/users/p4p4/gists{/gist_id}","starred_url":"https://api.github.com/users/p4p4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/p4p4/subscriptions","organizations_url":"https://api.github.com/users/p4p4/orgs","repos_url":"https://api.github.com/users/p4p4/repos","events_url":"https://api.github.com/users/p4p4/events{/privacy}","received_events_url":"https://api.github.com/users/p4p4/received_events","type":"User","site_admin":false},"repo":{"id":44253206,"name":"Catroid","full_name":"p4p4/Catroid","owner":{"login":"p4p4","id":1523187,"avatar_url":"https://avatars.githubusercontent.com/u/1523187?v=3","gravatar_id":"","url":"https://api.github.com/users/p4p4","html_url":"https://github.com/p4p4","followers_url":"https://api.github.com/users/p4p4/followers","following_url":"https://api.github.com/users/p4p4/following{/other_user}","gists_url":"https://api.github.com/users/p4p4/gists{/gist_id}","starred_url":"https://api.github.com/users/p4p4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/p4p4/subscriptions","organizations_url":"https://api.github.com/users/p4p4/orgs","repos_url":"https://api.github.com/users/p4p4/repos","events_url":"https://api.github.com/users/p4p4/events{/privacy}","received_events_url":"https://api.github.com/users/p4p4/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/p4p4/Catroid","description":"Writing programs on an Android device without prior knowledge.","fork":true,"url":"https://api.github.com/repos/p4p4/Catroid","forks_url":"https://api.github.com/repos/p4p4/Catroid/forks","keys_url":"https://api.github.com/repos/p4p4/Catroid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/p4p4/Catroid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/p4p4/Catroid/teams","hooks_url":"https://api.github.com/repos/p4p4/Catroid/hooks","issue_events_url":"https://api.github.com/repos/p4p4/Catroid/issues/events{/number}","events_url":"https://api.github.com/repos/p4p4/Catroid/events","assignees_url":"https://api.github.com/repos/p4p4/Catroid/assignees{/user}","branches_url":"https://api.github.com/repos/p4p4/Catroid/branches{/branch}","tags_url":"https://api.github.com/repos/p4p4/Catroid/tags","blobs_url":"https://api.github.com/repos/p4p4/Catroid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/p4p4/Catroid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/p4p4/Catroid/git/refs{/sha}","trees_url":"https://api.github.com/repos/p4p4/Catroid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/p4p4/Catroid/statuses/{sha}","languages_url":"https://api.github.com/repos/p4p4/Catroid/languages","stargazers_url":"https://api.github.com/repos/p4p4/Catroid/stargazers","contributors_url":"https://api.github.com/repos/p4p4/Catroid/contributors","subscribers_url":"https://api.github.com/repos/p4p4/Catroid/subscribers","subscription_url":"https://api.github.com/repos/p4p4/Catroid/subscription","commits_url":"https://api.github.com/repos/p4p4/Catroid/commits{/sha}","git_commits_url":"https://api.github.com/repos/p4p4/Catroid/git/commits{/sha}","comments_url":"https://api.github.com/repos/p4p4/Catroid/comments{/number}","issue_comment_url":"https://api.github.com/repos/p4p4/Catroid/issues/comments{/number}","contents_url":"https://api.github.com/repos/p4p4/Catroid/contents/{+path}","compare_url":"https://api.github.com/repos/p4p4/Catroid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/p4p4/Catroid/merges","archive_url":"https://api.github.com/repos/p4p4/Catroid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/p4p4/Catroid/downloads","issues_url":"https://api.github.com/repos/p4p4/Catroid/issues{/number}","pulls_url":"https://api.github.com/repos/p4p4/Catroid/pulls{/number}","milestones_url":"https://api.github.com/repos/p4p4/Catroid/milestones{/number}","notifications_url":"https://api.github.com/repos/p4p4/Catroid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/p4p4/Catroid/labels{/name}","releases_url":"https://api.github.com/repos/p4p4/Catroid/releases{/id}","deployments_url":"https://api.github.com/repos/p4p4/Catroid/deployments","created_at":"2015-10-14T14:28:49Z","updated_at":"2016-01-16T18:36:01Z","pushed_at":"2016-07-23T14:11:30Z","git_url":"git://github.com/p4p4/Catroid.git","ssh_url":"git@github.com:p4p4/Catroid.git","clone_url":"https://github.com/p4p4/Catroid.git","svn_url":"https://github.com/p4p4/Catroid","homepage":"https://share.catrob.at/pocketcode","size":97535,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"develop"}},"base":{"label":"Catrobat:develop","ref":"develop","sha":"dba80632feb54a4ef9dada08c46e94df57d518dd","user":{"login":"Catrobat","id":1747223,"avatar_url":"https://avatars.githubusercontent.com/u/1747223?v=3","gravatar_id":"","url":"https://api.github.com/users/Catrobat","html_url":"https://github.com/Catrobat","followers_url":"https://api.github.com/users/Catrobat/followers","following_url":"https://api.github.com/users/Catrobat/following{/other_user}","gists_url":"https://api.github.com/users/Catrobat/gists{/gist_id}","starred_url":"https://api.github.com/users/Catrobat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Catrobat/subscriptions","organizations_url":"https://api.github.com/users/Catrobat/orgs","repos_url":"https://api.github.com/users/Catrobat/repos","events_url":"https://api.github.com/users/Catrobat/events{/privacy}","received_events_url":"https://api.github.com/users/Catrobat/received_events","type":"Organization","site_admin":false},"repo":{"id":4475999,"name":"Catroid","full_name":"Catrobat/Catroid","owner":{"login":"Catrobat","id":1747223,"avatar_url":"https://avatars.githubusercontent.com/u/1747223?v=3","gravatar_id":"","url":"https://api.github.com/users/Catrobat","html_url":"https://github.com/Catrobat","followers_url":"https://api.github.com/users/Catrobat/followers","following_url":"https://api.github.com/users/Catrobat/following{/other_user}","gists_url":"https://api.github.com/users/Catrobat/gists{/gist_id}","starred_url":"https://api.github.com/users/Catrobat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Catrobat/subscriptions","organizations_url":"https://api.github.com/users/Catrobat/orgs","repos_url":"https://api.github.com/users/Catrobat/repos","events_url":"https://api.github.com/users/Catrobat/events{/privacy}","received_events_url":"https://api.github.com/users/Catrobat/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Catrobat/Catroid","description":"Writing programs on an Android device without prior knowledge.","fork":false,"url":"https://api.github.com/repos/Catrobat/Catroid","forks_url":"https://api.github.com/repos/Catrobat/Catroid/forks","keys_url":"https://api.github.com/repos/Catrobat/Catroid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Catrobat/Catroid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Catrobat/Catroid/teams","hooks_url":"https://api.github.com/repos/Catrobat/Catroid/hooks","issue_events_url":"https://api.github.com/repos/Catrobat/Catroid/issues/events{/number}","events_url":"https://api.github.com/repos/Catrobat/Catroid/events","assignees_url":"https://api.github.com/repos/Catrobat/Catroid/assignees{/user}","branches_url":"https://api.github.com/repos/Catrobat/Catroid/branches{/branch}","tags_url":"https://api.github.com/repos/Catrobat/Catroid/tags","blobs_url":"https://api.github.com/repos/Catrobat/Catroid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Catrobat/Catroid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Catrobat/Catroid/git/refs{/sha}","trees_url":"https://api.github.com/repos/Catrobat/Catroid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Catrobat/Catroid/statuses/{sha}","languages_url":"https://api.github.com/repos/Catrobat/Catroid/languages","stargazers_url":"https://api.github.com/repos/Catrobat/Catroid/stargazers","contributors_url":"https://api.github.com/repos/Catrobat/Catroid/contributors","subscribers_url":"https://api.github.com/repos/Catrobat/Catroid/subscribers","subscription_url":"https://api.github.com/repos/Catrobat/Catroid/subscription","commits_url":"https://api.github.com/repos/Catrobat/Catroid/commits{/sha}","git_commits_url":"https://api.github.com/repos/Catrobat/Catroid/git/commits{/sha}","comments_url":"https://api.github.com/repos/Catrobat/Catroid/comments{/number}","issue_comment_url":"https://api.github.com/repos/Catrobat/Catroid/issues/comments{/number}","contents_url":"https://api.github.com/repos/Catrobat/Catroid/contents/{+path}","compare_url":"https://api.github.com/repos/Catrobat/Catroid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Catrobat/Catroid/merges","archive_url":"https://api.github.com/repos/Catrobat/Catroid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Catrobat/Catroid/downloads","issues_url":"https://api.github.com/repos/Catrobat/Catroid/issues{/number}","pulls_url":"https://api.github.com/repos/Catrobat/Catroid/pulls{/number}","milestones_url":"https://api.github.com/repos/Catrobat/Catroid/milestones{/number}","notifications_url":"https://api.github.com/repos/Catrobat/Catroid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Catrobat/Catroid/labels{/name}","releases_url":"https://api.github.com/repos/Catrobat/Catroid/releases{/id}","deployments_url":"https://api.github.com/repos/Catrobat/Catroid/deployments","created_at":"2012-05-29T00:18:04Z","updated_at":"2016-07-09T14:22:06Z","pushed_at":"2016-07-25T08:33:47Z","git_url":"git://github.com/Catrobat/Catroid.git","ssh_url":"git@github.com:Catrobat/Catroid.git","clone_url":"https://github.com/Catrobat/Catroid.git","svn_url":"https://github.com/Catrobat/Catroid","homepage":"https://share.catrob.at/pocketcode","size":390458,"stargazers_count":128,"watchers_count":128,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":167,"mirror_url":null,"open_issues_count":129,"forks":167,"open_issues":129,"watchers":128,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Catrobat/Catroid/pulls/1810"},"html":{"href":"https://github.com/Catrobat/Catroid/pull/1810"},"issue":{"href":"https://api.github.com/repos/Catrobat/Catroid/issues/1810"},"comments":{"href":"https://api.github.com/repos/Catrobat/Catroid/issues/1810/comments"},"review_comments":{"href":"https://api.github.com/repos/Catrobat/Catroid/pulls/1810/comments"},"review_comment":{"href":"https://api.github.com/repos/Catrobat/Catroid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Catrobat/Catroid/pulls/1810/commits"},"statuses":{"href":"https://api.github.com/repos/Catrobat/Catroid/statuses/3b609dd12d0650ba99f4543bf94e28c47926b8c5"}}}}
{"actor":{"display_login":"p4p4"}}