diff --git a/starter-code/.idea/.name b/starter-code/.idea/.name new file mode 100644 index 0000000..5e37776 --- /dev/null +++ b/starter-code/.idea/.name @@ -0,0 +1 @@ +starter-code \ No newline at end of file diff --git a/starter-code/.idea/compiler.xml b/starter-code/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/starter-code/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/starter-code/.idea/copyright/profiles_settings.xml b/starter-code/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/starter-code/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/starter-code/.idea/dictionaries/chrisjones.xml b/starter-code/.idea/dictionaries/chrisjones.xml new file mode 100644 index 0000000..6e26c3a --- /dev/null +++ b/starter-code/.idea/dictionaries/chrisjones.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/starter-code/.idea/gradle.xml b/starter-code/.idea/gradle.xml new file mode 100644 index 0000000..1bbc21d --- /dev/null +++ b/starter-code/.idea/gradle.xml @@ -0,0 +1,18 @@ + + + + + + \ No newline at end of file diff --git a/starter-code/.idea/misc.xml b/starter-code/.idea/misc.xml new file mode 100644 index 0000000..811fba7 --- /dev/null +++ b/starter-code/.idea/misc.xml @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + Android Lint + + + C/C++ + + + Code style issuesJava + + + Compiler issuesJava + + + Declaration orderC/C++ + + + Finalization issuesJava + + + Groovy + + + Inheritance issuesJava + + + J2ME issuesJava + + + Java + + + Java language level migration aidsJava + + + JavaBeans issuesJava + + + Numeric issuesJava + + + OtherGroovy + + + Performance issuesJava + + + Probable bugsJava + + + Security issuesJava + + + Serialization issuesJava + + + Type checksC/C++ + + + Verbose or redundant code constructsJava + + + + + Android + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.7 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/starter-code/.idea/modules.xml b/starter-code/.idea/modules.xml new file mode 100644 index 0000000..b66c03c --- /dev/null +++ b/starter-code/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/starter-code/.idea/runConfigurations.xml b/starter-code/.idea/runConfigurations.xml new file mode 100644 index 0000000..7f68460 --- /dev/null +++ b/starter-code/.idea/runConfigurations.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/starter-code/.idea/vcs.xml b/starter-code/.idea/vcs.xml new file mode 100644 index 0000000..6564d52 --- /dev/null +++ b/starter-code/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/starter-code/app/src/main/java/generalassembly/yuliyakaleda/startercode/MainActivity.java b/starter-code/app/src/main/java/generalassembly/yuliyakaleda/startercode/MainActivity.java index 55d1d3a..96b1f5d 100644 --- a/starter-code/app/src/main/java/generalassembly/yuliyakaleda/startercode/MainActivity.java +++ b/starter-code/app/src/main/java/generalassembly/yuliyakaleda/startercode/MainActivity.java @@ -1,27 +1,56 @@ package generalassembly.yuliyakaleda.startercode; -import android.support.v7.app.AppCompatActivity; import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; import android.view.View; import android.view.animation.Animation; import android.view.animation.AnimationUtils; +import android.widget.Button; +import android.widget.EditText; +import android.widget.LinearLayout; import android.widget.TextView; public class MainActivity extends AppCompatActivity { + EditText editText; + TextView textView; + Button wishButton; + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); - //TODO: set up all the view and event listeners. + + editText = (EditText)findViewById(R.id.editText); + textView = (TextView)findViewById(R.id.textView); + wishButton = (Button)findViewById(R.id.button); + wishButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + String s = editText.getText().toString(); + textView.setText(s); + Animation animation = AnimationUtils.loadAnimation(MainActivity.this, R.anim.animation); + textView.startAnimation(animation); + LinearLayout wishList = (LinearLayout)findViewById(R.id.wishlist); + TextView newText = new TextView(MainActivity.this); + newText.setText(s); + wishList.addView(newText); + editText.setText(""); + } + }); + + } - @Override + + //@Override public void onClick(View v) { // TODO: 1. get the text from the input field // 2. animate it in the center of the screen // 3. add it to the list wish // 4. clear the input field + + } } diff --git a/starter-code/app/src/main/res/anim/animation.xml b/starter-code/app/src/main/res/anim/animation.xml index 88c2c7c..605e028 100644 --- a/starter-code/app/src/main/res/anim/animation.xml +++ b/starter-code/app/src/main/res/anim/animation.xml @@ -2,10 +2,17 @@ android:shareInterpolator="false" android:fillAfter="false" > + android:duration="1000" + android:fromAlpha="0.0" + android:toAlpha="1.0" /> - + - /> + \ No newline at end of file diff --git a/starter-code/app/src/main/res/drawable/genie.jpg b/starter-code/app/src/main/res/drawable/genie.jpg new file mode 100644 index 0000000..298c246 Binary files /dev/null and b/starter-code/app/src/main/res/drawable/genie.jpg differ diff --git a/starter-code/app/src/main/res/layout/activity_main.xml b/starter-code/app/src/main/res/layout/activity_main.xml index b326849..48b2927 100644 --- a/starter-code/app/src/main/res/layout/activity_main.xml +++ b/starter-code/app/src/main/res/layout/activity_main.xml @@ -8,7 +8,42 @@ android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin" - tools:context="generalassembly.yuliyakaleda.startercode.MainActivity"> + tools:context="generalassembly.yuliyakaleda.startercode.MainActivity" + android:background="@drawable/genie"> + + +