Permalink
Browse files

Adds horizontal flipping parameter

  • Loading branch information...
1 parent d75e17e commit 7808dcce355d895b74e315df95de82d1004d0b75 Alex Medearis committed Nov 8, 2012
View
BIN .DS_Store
Binary file not shown.
View
BIN FlipView/.DS_Store
Binary file not shown.
View
4 FlipView/Demo/.classpath
@@ -1,8 +1,8 @@
<?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="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="gen"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
View
3 FlipView/Demo/AndroidManifest.xml
@@ -19,7 +19,8 @@
<activity android:name="com.aphidmobile.flip.demo.FlipTextViewActivity"/>
<activity android:name="com.aphidmobile.flip.demo.FlipButtonActivity"/>
<activity android:name="com.aphidmobile.flip.demo.FlipComplexLayoutActivity"/>
-
+ <activity android:name="com.aphidmobile.flip.demo.FlipHorizontalLayoutActivity"/>
+
</application>
</manifest>
View
148 FlipView/Demo/src/com/aphidmobile/flip/demo/FlipHorizontalLayoutActivity.java
@@ -0,0 +1,148 @@
+/*
+Copyright 2012 Aphid Mobile
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+ */
+
+package com.aphidmobile.flip.demo;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Bundle;
+import android.text.Html;
+import android.view.*;
+import android.widget.*;
+import com.aphidmobile.flip.FlipViewController;
+import com.aphidmobile.flipview.demo.R;
+import com.aphidmobile.utils.AphidLog;
+import com.aphidmobile.utils.IO;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class FlipHorizontalLayoutActivity extends Activity {
+ private FlipViewController flipView;
+
+ /**
+ * Called when the activity is first created.
+ */
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ setTitle(R.string.activity_title);
+
+ flipView = new FlipViewController(this, false);
+
+ flipView.setAdapter(new MyBaseAdapter(this));
+
+ setContentView(flipView);
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+ flipView.onResume();
+ }
+
+ @Override
+ protected void onPause() {
+ super.onPause();
+ flipView.onPause();
+ }
+
+ private static class MyBaseAdapter extends BaseAdapter {
+ private static List<Data> IMG_DESCRIPTIONS = new ArrayList<Data>();
+
+ static {
+ IMG_DESCRIPTIONS.add(new Data("Potala Palace", "potala_palace.jpg", "http://en.wikipedia.org/wiki/Potala_Palace", "The <b>Potala Palace</b> is located in Lhasa, Tibet Autonomous Region, China. It is named after Mount Potalaka, the mythical abode of Chenresig or Avalokitesvara."));
+ IMG_DESCRIPTIONS.add(new Data("Drepung Monastery", "drepung_monastery.jpg", "http://en.wikipedia.org/wiki/Drepung", "<b>Drepung Monastery</b>, located at the foot of Mount Gephel, is one of the \"great three\" Gelukpa university monasteries of Tibet."));
+ IMG_DESCRIPTIONS.add(new Data("Sera Monastery", "sera_monastery.jpg", "http://en.wikipedia.org/wiki/Sera_Monastery", "<b>Sera Monastery</b> is one of the 'great three' Gelukpa university monasteries of Tibet, located 1.25 miles (2.01 km) north of Lhasa."));
+ IMG_DESCRIPTIONS.add(new Data("Samye Monastery", "samye_monastery.jpg", "http://en.wikipedia.org/wiki/Samye", "<b>Samye Monastery</b> is the first Buddhist monastery built in Tibet, was most probably first constructed between 775 and 779 CE."));
+ IMG_DESCRIPTIONS.add(new Data("Tashilunpo Monastery", "tashilunpo_monastery.jpg", "http://en.wikipedia.org/wiki/Tashilhunpo_Monastery", "<b>Tashilhunpo Monastery</b>, founded in 1447 by Gendun Drup, the First Dalai Lama, is a historic and culturally important monastery next to Shigatse, the second-largest city in Tibet."));
+ IMG_DESCRIPTIONS.add(new Data("Zhangmu Port", "zhangmu_port.jpg", "http://en.wikipedia.org/wiki/Zhangmu", "<b>Zhangmu/Dram</b> is a customs town and port of entry located in Nyalam County on the Nepal-China border, just uphill and across the Bhote Koshi River from the Nepalese town of Kodari."));
+ IMG_DESCRIPTIONS.add(new Data("Kathmandu", "kathmandu.jpg", "http://en.wikipedia.org/wiki/Kathmandu", "<b>Kathmandu</b> is the capital and, with more than one million inhabitants, the largest metropolitan city of Nepal."));
+ IMG_DESCRIPTIONS.add(new Data("Pokhara", "pokhara.jpg", "http://en.wikipedia.org/wiki/Pokhara", "<b>Pokhara Sub-Metropolitan City</b> is the second largest city of Nepal with approximately 250,000 inhabitants and is situated about 200 km west of the capital Kathmandu."));
+ IMG_DESCRIPTIONS.add(new Data("Patan", "patan.jpg", "http://en.wikipedia.org/wiki/Patan,_Nepal", "<b>Patan</b>, officially Lalitpur Sub-Metropolitan City, is one of the major cities of Nepal located in the south-central part of Kathmandu Valley."));
+ }
+
+ private LayoutInflater inflater;
+
+ private MyBaseAdapter(Context context) {
+ inflater = LayoutInflater.from(context);
+ }
+
+ @Override
+ public int getCount() {
+ return IMG_DESCRIPTIONS.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return position;
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ View layout = convertView;
+ if (convertView == null)
+ layout = inflater.inflate(R.layout.complex1, null);
+
+ final Data data = IMG_DESCRIPTIONS.get(position);
+
+ TextView titleView = (TextView) layout.findViewById(R.id.title);
+ titleView.setText(AphidLog.format("%d. %s", position, data.title));
+
+ ImageView photoView = (ImageView) layout.findViewById(R.id.photo);
+ photoView.setImageBitmap(IO.readBitmap(inflater.getContext().getAssets(), data.imageFilename));
+
+ TextView textView = (TextView) layout.findViewById(R.id.description);
+ textView.setText(Html.fromHtml(data.description));
+
+ Button wikipedia = (Button) layout.findViewById(R.id.wikipedia);
+ wikipedia.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Intent intent = new Intent(
+ Intent.ACTION_VIEW,
+ Uri.parse(data.link)
+ );
+ inflater.getContext().startActivity(intent);
+ }
+ });
+
+ return layout;
+ }
+
+ private static class Data {
+ public String title;
+ public String imageFilename;
+ public String link;
+ public String description;
+
+ private Data(String title, String imageFilename, String link, String description) {
+ this.title = title;
+ this.imageFilename = imageFilename;
+ this.link = link;
+ this.description = description;
+ }
+ }
+ }
+}
View
1 FlipView/Demo/src/com/aphidmobile/flip/demo/MainActivity.java
@@ -68,6 +68,7 @@ protected void onListItemClick(ListView l, View v, int position, long id) {
addItem(data, "Flip Text Views", FlipTextViewActivity.class);
addItem(data, "Flip Buttons", FlipButtonActivity.class);
addItem(data, "Flip Complex Layouts", FlipComplexLayoutActivity.class);
+ addItem(data, "Flip Horizontal", FlipHorizontalLayoutActivity.class);
return data;
}
View
4 FlipView/FlipLibrary/.classpath
@@ -1,8 +1,8 @@
<?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="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="gen"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
View
2 FlipView/FlipLibrary/.project
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>Aphid-FlipView-Library</name>
+ <name>FlipLibrary</name>
<comment></comment>
<projects>
</projects>
View
107 FlipView/FlipLibrary/src/com/aphidmobile/flip/Card.java
@@ -49,6 +49,8 @@
private int axis = AXIS_TOP;
+ private boolean orientationVertical = true;
+
private boolean dirty = false;
public Texture getTexture() {
@@ -89,6 +91,10 @@ public void setAxis(int axis) {
this.axis = axis;
}
+ public void setOrientation(boolean orientationVertical) {
+ this.orientationVertical = orientationVertical;
+ }
+
public void draw(GL10 gl) {
if (dirty)
updateVertices();
@@ -121,17 +127,33 @@ public void draw(GL10 gl) {
gl.glPushMatrix();
- if (angle > 0) {
- if (axis == AXIS_TOP) {
- gl.glTranslatef(0, cardVertices[1], 0f);
- gl.glRotatef(-angle, 1f, 0f, 0f);
- gl.glTranslatef(0, -cardVertices[1], 0f);
- } else {
- gl.glTranslatef(0, cardVertices[7], 0f);
- gl.glRotatef(angle, 1f, 0f, 0f);
- gl.glTranslatef(0, -cardVertices[7], 0f);
+ if(orientationVertical){
+ if (angle > 0) {
+ if (axis == AXIS_TOP) {
+ gl.glTranslatef(0, cardVertices[1], 0f);
+ gl.glRotatef(-angle, 1f, 0f, 0f);
+ gl.glTranslatef(0, -cardVertices[1], 0f);
+ } else {
+ gl.glTranslatef(0, cardVertices[7], 0f);
+ gl.glRotatef(angle, 1f, 0f, 0f);
+ gl.glTranslatef(0, -cardVertices[7], 0f);
+ }
+ }
+ } else {
+ if (angle > 0) {
+ if (axis == AXIS_TOP) {
+ gl.glTranslatef(cardVertices[0], 0, 0f);
+ gl.glRotatef(-angle, 0f, 1f, 0f);
+ gl.glTranslatef(-cardVertices[0], 0, 0f);
+ } else {
+ gl.glTranslatef(cardVertices[6], 0, 0f);
+ gl.glRotatef(angle, 0f, 1f, 0f);
+ gl.glTranslatef(-cardVertices[6], 0, 0f);
+ }
}
+
}
+
gl.glVertexPointer(3, GL_FLOAT, 0, vertexBuffer);
gl.glDrawElements(GL_TRIANGLES, indices.length, GL_UNSIGNED_SHORT, indexBuffer);
@@ -150,32 +172,61 @@ public void draw(GL10 gl) {
gl.glDisable(GL_DEPTH_TEST);
if (axis == AXIS_TOP) {
- float w = cardVertices[9] - cardVertices[0];
- float h = (cardVertices[1] - cardVertices[4]) * (1f - FloatMath.cos(d2r(angle)));
- float z = (cardVertices[1] - cardVertices[4]) * FloatMath.sin(d2r(angle));
- float[] shadowVertices = new float[]{
- cardVertices[0], h + cardVertices[4], z,
- cardVertices[3], cardVertices[4], 0f,
- w, cardVertices[7], 0f,
- w, h + cardVertices[4], z
- };
+ float w,h,z;
+ float[] shadowVertices;
+ if(orientationVertical){
+ w = cardVertices[9] - cardVertices[0];
+ h = (cardVertices[1] - cardVertices[4]) * (1f - FloatMath.cos(d2r(angle)));
+ z = (cardVertices[1] - cardVertices[4]) * FloatMath.sin(d2r(angle));
+ shadowVertices = new float[]{
+ cardVertices[0], h + cardVertices[4], z,
+ cardVertices[3], cardVertices[4], 0f,
+ w, cardVertices[7], 0f,
+ w, h + cardVertices[4], z
+ };
+ } else {
+ w = (cardVertices[9] - cardVertices[0]) * (1f - FloatMath.cos(d2r(angle)));
+ h = (cardVertices[1] - cardVertices[4]);
+ z = (cardVertices[1] - cardVertices[4]) * FloatMath.sin(d2r(angle));
+
+ shadowVertices = new float[]{
+ cardVertices[9] - w, cardVertices[1], z,
+ cardVertices[6] - w, cardVertices[4], z,
+ cardVertices[6], cardVertices[7], 0f,
+ cardVertices[9], cardVertices[10], 0f
+ };
+
+ }
float alpha = 1f * (90f - angle) / 90f;
gl.glColor4f(0f, 0.0f, 0f, alpha);
gl.glVertexPointer(3, GL_FLOAT, 0, toFloatBuffer(shadowVertices));
gl.glDrawElements(GL_TRIANGLES, indices.length, GL_UNSIGNED_SHORT, indexBuffer);
} else {
- float w = cardVertices[9] - cardVertices[0];
- float h = (cardVertices[1] - cardVertices[4]) * (1f - FloatMath.cos(d2r(angle)));
- float z = (cardVertices[1] - cardVertices[4]) * FloatMath.sin(d2r(angle));
- float[] shadowVertices = new float[]{
- cardVertices[0], cardVertices[1], 0f,
- cardVertices[3], cardVertices[1] - h, z,
- w, cardVertices[1] - h, z,
- w, cardVertices[1], 0f
- };
-
+ float w,h,z;
+ float[] shadowVertices;
+ if(orientationVertical){
+ w = cardVertices[9] - cardVertices[0];
+ h = (cardVertices[1] - cardVertices[4]) * (1f - FloatMath.cos(d2r(angle)));
+ z = (cardVertices[1] - cardVertices[4]) * FloatMath.sin(d2r(angle));
+ shadowVertices = new float[]{
+ cardVertices[0], cardVertices[1], 0f,
+ cardVertices[3], cardVertices[1] - h, z,
+ w, cardVertices[1] - h, z,
+ w, cardVertices[1], 0f
+ };
+ } else {
+ w = (cardVertices[9] - cardVertices[0]) * (1f - FloatMath.cos(d2r(angle)));
+ h = (cardVertices[1] - cardVertices[4]);
+ z = (cardVertices[1] - cardVertices[4]) * FloatMath.sin(d2r(angle));
+ shadowVertices = new float[]{
+ cardVertices[0], cardVertices[1], 0f,
+ cardVertices[3], cardVertices[4], 0f,
+ cardVertices[0] + w, cardVertices[7], z,
+ cardVertices[3] + w, cardVertices[10], z
+ };
+ }
float alpha = 1f * (90f - angle) / 90f;
gl.glColor4f(0f, 0.0f, 0f, alpha);
View
41 FlipView/FlipLibrary/src/com/aphidmobile/flip/FlipCards.java
@@ -41,7 +41,9 @@
private int animatedFrame = 0;
private int state = STATE_INIT;
+ private boolean orientationVertical = true;
private float lastY = -1;
+ private float lastX = -1;
@SuppressWarnings("unused")
private VelocityTracker velocityTracker;
@@ -51,12 +53,12 @@
private boolean visible = false;
- public FlipCards(FlipViewController controller) {
+ public FlipCards(FlipViewController controller, boolean orientationVertical) {
this.controller = controller;
- frontCards = new ViewDualCards();
- backCards = new ViewDualCards();
-
+ frontCards = new ViewDualCards(orientationVertical);
+ backCards = new ViewDualCards(orientationVertical);
+ this.orientationVertical = orientationVertical;
resetAxises();
}
@@ -67,6 +69,7 @@ public boolean isVisible() {
public void setVisible(boolean visible) {
this.visible = visible;
}
+
public void reloadTexture(int frontIndex, View frontView, int backIndex, View backView) {
synchronized (this) {
@@ -208,15 +211,24 @@ public synchronized boolean handleTouchEvent(MotionEvent event, boolean isOnTouc
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
lastY = event.getY();
+ lastX = event.getX();
return isOnTouchEvent;
case MotionEvent.ACTION_MOVE:
- delta = lastY - event.getY();
+ if(orientationVertical){
+ delta = lastY - event.getY();
+ } else {
+ delta = lastX - event.getX();
+ }
if (Math.abs(delta) > controller.getTouchSlop())
setState(STATE_TOUCH); //XXX: initialize views?
if (state == STATE_TOUCH) {
controller.showFlipAnimation();
-
- final float angleDelta = 180 * delta / controller.getContentHeight() * MOVEMENT_RATE;
+ final float angleDelta ;
+ if(orientationVertical){
+ angleDelta = 180 * delta / controller.getContentHeight() * MOVEMENT_RATE;
+ } else {
+ angleDelta = 180 * delta / controller.getContentWidth() * MOVEMENT_RATE;
+ }
angle += angleDelta;
if (backCards.getIndex() == -1) {
if (angle >= MAX_TIP_ANGLE)
@@ -237,7 +249,11 @@ public synchronized boolean handleTouchEvent(MotionEvent event, boolean isOnTouc
angle += 180;
}
}
- lastY = event.getY();
+ if(orientationVertical){
+ lastY = event.getY();
+ } else {
+ lastX = event.getX();
+ }
controller.getSurfaceView().requestRender();
return true;
}
@@ -246,8 +262,13 @@ public synchronized boolean handleTouchEvent(MotionEvent event, boolean isOnTouc
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
if (state == STATE_TOUCH) {
- delta = lastY - event.getY();
- rotateBy(180 * delta / controller.getContentHeight() * MOVEMENT_RATE);
+ if(orientationVertical){
+ delta = lastY - event.getY();
+ rotateBy(180 * delta / controller.getContentHeight() * MOVEMENT_RATE);
+ } else {
+ delta = lastX - event.getX();
+ rotateBy(180 * delta / controller.getContentWidth() * MOVEMENT_RATE);
+ }
forward = angle >= 90;
setState(STATE_AUTO_ROTATE);
controller.getSurfaceView().requestRender();
View
14 FlipView/FlipLibrary/src/com/aphidmobile/flip/FlipViewController.java
@@ -32,6 +32,9 @@
import java.util.LinkedList;
public class FlipViewController extends AdapterView<Adapter> {
+
+ public static final int ORIENTATION_VERTICAL = 0;
+ public static final int ORIENTATION_HORIZONTAL = 1;
private static final int MSG_SURFACE_CREATED = 1;
private Handler handler = new Handler(new Handler.Callback() {
@@ -53,6 +56,8 @@ public boolean handleMessage(Message msg) {
private int contentWidth;
private int contentHeight;
+
+ private boolean orientationVertical;
private boolean enableFlipAnimation = true;
@@ -87,11 +92,16 @@ public void onChanged() {
private float maxVelocity;
public FlipViewController(Context context) {
+ this(context, true);
+ }
+
+
+ public FlipViewController(Context context, boolean orientationVertical) {
super(context);
ViewConfiguration configuration = ViewConfiguration.get(getContext());
touchSlop = configuration.getScaledTouchSlop();
maxVelocity = configuration.getScaledMaximumFlingVelocity();
-
+ this.orientationVertical = orientationVertical;
setupSurfaceView();
}
@@ -261,7 +271,7 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
private void setupSurfaceView() {
surfaceView = new GLSurfaceView(getContext());
- cards = new FlipCards(this);
+ cards = new FlipCards(this, orientationVertical);
renderer = new FlipRenderer(this, cards);
surfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
View
92 FlipView/FlipLibrary/src/com/aphidmobile/flip/ViewDualCards.java
@@ -38,6 +38,14 @@
private Card topCard = new Card();
private Card bottomCard = new Card();
+ private boolean orientationVertical = true;
+
+ public ViewDualCards(boolean orientationVertical) {
+ topCard.setOrientation(orientationVertical);
+ bottomCard.setOrientation(orientationVertical);
+ this.orientationVertical = orientationVertical;
+ }
+
public int getIndex() {
return index;
}
@@ -49,7 +57,8 @@ public View getView() {
public boolean setView(int index, View view) {
UI.assertInMainThread();
this.index = index;
- if (getView() == view && (screenshot != null || TextureUtils.isValidTexture(texture)))
+ if (getView() == view
+ && (screenshot != null || TextureUtils.isValidTexture(texture)))
return false;
viewRef = null;
if (texture != null) {
@@ -106,33 +115,60 @@ public void buildTexture(FlipRenderer renderer, GL10 gl) {
final float textureHeight = texture.getHeight();
final float textureWidth = texture.getWidth();
- topCard.setCardVertices(new float[]{
- 0f, viewHeight, 0f, //top left
- 0f, viewHeight / 2.0f, 0f, //bottom left
- viewWidth, viewHeight / 2f, 0f, //bottom right
- viewWidth, viewHeight, 0f //top right
- });
-
- topCard.setTextureCoordinates(new float[]{
- 0f, 0f,
- 0f, viewHeight / 2f / textureHeight,
- viewWidth / textureWidth, viewHeight / 2f / textureHeight,
- viewWidth / textureWidth, 0f
- });
-
- bottomCard.setCardVertices(new float[]{
- 0f, viewHeight / 2f, 0f, //top left
- 0f, 0f, 0f, //bottom left
- viewWidth, 0f, 0f, //bottom right
- viewWidth, viewHeight / 2f, 0f //top right
- });
-
- bottomCard.setTextureCoordinates(new float[]{
- 0f, viewHeight / 2f / textureHeight,
- 0f, viewHeight / textureHeight,
- viewWidth / textureWidth, viewHeight / textureHeight,
- viewWidth / textureWidth, viewHeight / 2f / textureHeight
- });
+ if (orientationVertical) {
+ topCard.setCardVertices(new float[] { 0f, viewHeight, 0f, // top
+ // left
+ 0f, viewHeight / 2.0f, 0f, // bottom left
+ viewWidth, viewHeight / 2f, 0f, // bottom right
+ viewWidth, viewHeight, 0f // top right
+ });
+
+ topCard.setTextureCoordinates(new float[] { 0f, 0f, 0f,
+ viewHeight / 2f / textureHeight,
+ viewWidth / textureWidth,
+ viewHeight / 2f / textureHeight,
+ viewWidth / textureWidth, 0f });
+
+ bottomCard.setCardVertices(new float[] { 0f, viewHeight / 2f,
+ 0f, // top left
+ 0f, 0f, 0f, // bottom left
+ viewWidth, 0f, 0f, // bottom right
+ viewWidth, viewHeight / 2f, 0f // top right
+ });
+
+ bottomCard.setTextureCoordinates(new float[] { 0f,
+ viewHeight / 2f / textureHeight, 0f,
+ viewHeight / textureHeight, viewWidth / textureWidth,
+ viewHeight / textureHeight, viewWidth / textureWidth,
+ viewHeight / 2f / textureHeight });
+ } else {
+ topCard.setCardVertices(new float[] { 0f, viewHeight, 0f, // top
+ // left
+ 0f, 0f, 0f, // bottom left
+ viewWidth / 2f, 0f, 0f, // bottom right
+ viewWidth / 2f, viewHeight, 0f // top right
+ });
+
+ topCard.setTextureCoordinates(new float[] { 0f, 0f, 0f,
+ viewHeight / textureHeight,
+ viewWidth / 2f / textureWidth,
+ viewHeight / textureHeight,
+ viewWidth / 2f / textureWidth, 0f });
+
+ bottomCard.setCardVertices(new float[] { viewWidth / 2f,
+ viewHeight, 0f, // top left
+ viewWidth / 2f, 0f, 0f, // bottom left
+ viewWidth, 0f, 0f, // bottom right
+ viewWidth, viewHeight, 0f // top right
+ });
+
+ bottomCard.setTextureCoordinates(new float[] {
+ viewWidth / 2f / textureWidth, 0f,
+ viewWidth / 2f / textureWidth,
+ viewHeight / textureHeight, viewWidth / textureWidth,
+ viewHeight / textureHeight, viewWidth / textureWidth,
+ 0f });
+ }
checkError(gl);
}
View
4 Legacy/Demo-Animation/.classpath
@@ -1,8 +1,8 @@
<?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="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="gen"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>

0 comments on commit 7808dcc

Please sign in to comment.