Commits

Micha Kops  committed ccb7ccb

Android Animation tutorial sources added

  • Participants
  • Parent commits a80e17a

Comments (0)

Files changed (30)

File animation-sample/.classpath

+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="gen"/>
+	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

File animation-sample/.project

+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>AnimationSample</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.ApkBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

File animation-sample/AndroidManifest.xml

+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+      package="com.hascode.tutorial.android"
+      android:versionCode="1"
+      android:versionName="1.0">
+    <application android:icon="@drawable/icon" android:label="@string/app_name">
+        <activity android:name=".AnimationActivity"
+                  android:label="@string/app_name">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+
+    </application>
+
+
+</manifest> 

File animation-sample/bin/AnimationSample.apk

Binary file added.

File animation-sample/bin/classes.dex

Binary file added.

File animation-sample/bin/com/hascode/tutorial/android/AnimatedButton$1.class

Binary file added.

File animation-sample/bin/com/hascode/tutorial/android/AnimatedButton.class

Binary file added.

File animation-sample/bin/com/hascode/tutorial/android/AnimationActivity.class

Binary file added.

File animation-sample/bin/com/hascode/tutorial/android/R$anim.class

Binary file added.

File animation-sample/bin/com/hascode/tutorial/android/R$attr.class

Binary file added.

File animation-sample/bin/com/hascode/tutorial/android/R$drawable.class

Binary file added.

File animation-sample/bin/com/hascode/tutorial/android/R$id.class

Binary file added.

File animation-sample/bin/com/hascode/tutorial/android/R$layout.class

Binary file added.

File animation-sample/bin/com/hascode/tutorial/android/R$string.class

Binary file added.

File animation-sample/bin/com/hascode/tutorial/android/R.class

Binary file added.

File animation-sample/bin/resources.ap_

Binary file added.

File animation-sample/default.properties

+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+# 
+# This file must be checked in Version Control Systems.
+# 
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-8

File animation-sample/gen/com/hascode/tutorial/android/R.java

+/* AUTO-GENERATED FILE.  DO NOT MODIFY.
+ *
+ * This class was automatically generated by the
+ * aapt tool from the resource data it found.  It
+ * should not be modified by hand.
+ */
+
+package com.hascode.tutorial.android;
+
+public final class R {
+    public static final class anim {
+        public static final int alpha=0x7f040000;
+        public static final int animation=0x7f040001;
+        public static final int rotate=0x7f040002;
+        public static final int scale=0x7f040003;
+        public static final int translate=0x7f040004;
+    }
+    public static final class attr {
+    }
+    public static final class drawable {
+        public static final int icon=0x7f020000;
+    }
+    public static final class id {
+        public static final int root=0x7f060000;
+    }
+    public static final class layout {
+        public static final int main=0x7f030000;
+    }
+    public static final class string {
+        public static final int app_name=0x7f050001;
+        public static final int hello=0x7f050000;
+    }
+}

File animation-sample/res/anim/alpha.xml

+<?xml version="1.0" encoding="utf-8"?>
+<alpha
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:fromAlpha="0.0"
+    android:toAlpha="0.9"
+    android:duration="8000" />

File animation-sample/res/anim/animation.xml

+<?xml version="1.0" encoding="utf-8"?>
+<set xmlns:android="http://schemas.android.com/apk/res/android">
+	<scale android:fromXScale="1.0" android:toXScale="3.0"
+		android:fromYScale="1.0" android:toYScale="3.0" android:pivotX="50%"
+		android:pivotY="50%" android:fillAfter="false" android:duration="5000" />
+	<set>
+		<alpha xmlns:android="http://schemas.android.com/apk/res/android"
+			android:fromAlpha="0.2" android:toAlpha="1.0" android:duration="3000" />
+		<rotate android:fromDegrees="0" android:toDegrees="-360"
+			android:toYScale="0.0" android:pivotX="50%" android:pivotY="50%"
+			android:startOffset="700" android:duration="4000" />
+		<translate android:fromXDelta="100%" android:toXDelta="-20%"
+			android:fromYDelta="60%" android:toYDelta="-30%" android:duration="3000"
+			android:zAdjustment="bottom" />
+	</set>
+</set>

File animation-sample/res/anim/rotate.xml

+<?xml version="1.0" encoding="utf-8"?>
+<rotate xmlns:android="http://schemas.android.com/apk/res/android"
+	android:fromDegrees="0" android:toDegrees="360" android:toYScale="0.0"
+	android:pivotX="40%" android:pivotY="30%" android:duration="4000" />
+

File animation-sample/res/anim/scale.xml

+<?xml version="1.0" encoding="utf-8"?>
+<scale xmlns:android="http://schemas.android.com/apk/res/android"
+	android:fromXScale="4" android:toXScale="1" android:fromYScale="3"
+	android:toYScale="1" android:pivotX="50%" android:pivotY="50%"
+	android:duration="4000" />
+

File animation-sample/res/anim/translate.xml

+<?xml version="1.0" encoding="utf-8"?>
+<translate xmlns:android="http://schemas.android.com/apk/res/android"
+	android:fromXDelta="300%" android:toXDelta="0%" android:fromYDelta="300%"
+	android:toYDelta="0%" android:duration="6000" android:zAdjustment="bottom" />

File animation-sample/res/drawable-hdpi/icon.png

Added
New image

File animation-sample/res/drawable-ldpi/icon.png

Added
New image

File animation-sample/res/drawable-mdpi/icon.png

Added
New image

File animation-sample/res/layout/main.xml

+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout android:id="@+id/root"
+	android:layout_width="fill_parent" android:layout_height="fill_parent"
+	xmlns:android="http://schemas.android.com/apk/res/android">
+</LinearLayout>

File animation-sample/res/values/strings.xml

+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <string name="hello">Visit www.hascode.com!</string>
+    <string name="app_name">hasCode.com - Android Animation Sample</string>
+</resources>

File animation-sample/src/com/hascode/tutorial/android/AnimatedButton.java

+/**
+ * 
+ */
+package com.hascode.tutorial.android;
+
+import android.content.Context;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.animation.Animation;
+import android.view.animation.AnimationUtils;
+import android.widget.Button;
+
+public class AnimatedButton extends Button {
+
+	public AnimatedButton(Context context) {
+		super(context);
+		final Animation buttonAnimation = AnimationUtils.loadAnimation(
+				this.getContext(), R.anim.animation);
+		this.setOnTouchListener(new OnTouchListener() {
+
+			@Override public boolean onTouch(View v, MotionEvent event) {
+				AnimatedButton.this.startAnimation(buttonAnimation);
+				return false;
+			}
+		});
+	}
+}

File animation-sample/src/com/hascode/tutorial/android/AnimationActivity.java

+package com.hascode.tutorial.android;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.widget.LinearLayout;
+
+public class AnimationActivity extends Activity {
+	/** Called when the activity is first created. */
+	@Override public void onCreate(Bundle savedInstanceState) {
+		super.onCreate(savedInstanceState);
+		setContentView(R.layout.main);
+		AnimatedButton button = new AnimatedButton(this);
+		button.setText("What a button");
+		LinearLayout layout = (LinearLayout) findViewById(R.id.root);
+		layout.addView(button);
+	}
+}