Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Austin Jones - Animation Lab #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions starter-code/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions starter-code/.idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions starter-code/.idea/copyright/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions starter-code/.idea/dictionaries/chrisjones.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions starter-code/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

160 changes: 160 additions & 0 deletions starter-code/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions starter-code/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions starter-code/.idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions starter-code/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -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


}
}
13 changes: 10 additions & 3 deletions starter-code/app/src/main/res/anim/animation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@
android:shareInterpolator="false"
android:fillAfter="false" >
<alpha
<!--TODO: finish fading animation-->
android:duration="1000"
android:fromAlpha="0.0"
android:toAlpha="1.0"
/>

<!--TODO: finish fading animation-->
<rotate
android:duration="1000"
android:fromDegrees="0"
android:toDegrees="360"
android:pivotX="50%"
android:pivotY="50%"/>
<!--TODO: finish rotating animation-->
/>

</set>
Binary file added starter-code/app/src/main/res/drawable/genie.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 36 additions & 1 deletion starter-code/app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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">

<!-- TODO: add edit text, button, text view and a view group-->
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/editText"
android:hint="Your Wish Is My Command"
android:layout_alignParentTop="true" />

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ADD A WISH"
android:id="@+id/button"
android:layout_below="@+id/editText"
android:layout_centerHorizontal="true" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/textView"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:textStyle="bold"
style="@android:style/TextAppearance.Large" />

<LinearLayout
android:id="@+id/wishlist"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
style="@android:style/TextAppearance.Large"
android:layout_below="@+id/textView"
android:paddingTop="15dp"
android:theme="@android:style/TextAppearance.Medium"></LinearLayout>
</RelativeLayout>
2 changes: 1 addition & 1 deletion starter-code/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">StarterCode</string>
<string name="app_name">Wish List</string>
</resources>