Skip to content
This repository was archived by the owner on Feb 22, 2022. It is now read-only.

Commit d056dc2

Browse files
committed
Fix the incorrect content during animation.
#16
1 parent 90a5a25 commit d056dc2

File tree

5 files changed

+17
-16
lines changed

5 files changed

+17
-16
lines changed

FlipView/Demo/src/com/aphidmobile/flip/demo/views/NumberTextView.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import android.graphics.Color;
2121
import android.view.Gravity;
2222
import android.widget.TextView;
23-
import com.aphidmobile.utils.AphidLog;
2423

2524
public class NumberTextView extends TextView{
2625
private int number;
@@ -42,12 +41,6 @@ public void setNumber(int number) {
4241
setText(String.valueOf(number));
4342
}
4443

45-
@Override
46-
public void setVisibility(int visibility) {
47-
super.setVisibility(visibility);
48-
AphidLog.i("View %d, visibility %d", number, visibility);
49-
}
50-
5144
@Override
5245
public String toString() {
5346
return "NumberTextView: " + number;

FlipView/FlipLibrary/src/com/aphidmobile/flip/FlipCards.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ public class FlipCards {
4646
private float lastY = -1;
4747
private float lastX = -1;
4848

49-
@SuppressWarnings("unused")
50-
private VelocityTracker velocityTracker;
5149
private FlipViewController controller;
5250

5351
private int activeIndex = -1;

FlipView/FlipLibrary/src/com/aphidmobile/flip/FlipRenderer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public void onSurfaceCreated(GL10 gl, EGLConfig config) {
7272
flipViewController.reloadTexture();
7373

7474
if (AphidLog.ENABLE_DEBUG)
75-
AphidLog.i("onSurfaceCreated");
75+
AphidLog.d("onSurfaceCreated");
7676
}
7777

7878
public static float[] light0Position = {0, 0, 100f, 0f};
@@ -108,7 +108,7 @@ public void onSurfaceChanged(GL10 gl, int width, int height) {
108108
gl.glLightfv(GL_LIGHT0, GL_POSITION, light0Position, 0);
109109

110110
if (AphidLog.ENABLE_DEBUG)
111-
AphidLog.i("onSurfaceChanged: %d, %d", width, height);
111+
AphidLog.d("onSurfaceChanged: %d, %d", width, height);
112112
}
113113

114114
@Override

FlipView/FlipLibrary/src/com/aphidmobile/flip/FlipViewController.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,6 @@ protected void onLayout(boolean changed, int l, int t, int r, int b) {
331331

332332
@Override
333333
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
334-
//Logger.i( String.format("onMeasure: %d, %d, ; child %d", widthMeasureSpec, heightMeasureSpec, flipViews.size()));
335334
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
336335

337336
for (View child : bufferedViews)
@@ -399,7 +398,7 @@ private void setupAdapterView(View view, boolean addToTop, boolean isReusedView)
399398

400399
private void updateVisibleView(int index) {
401400
if (AphidLog.ENABLE_DEBUG)
402-
AphidLog.i("Update visible views, index %d, buffered: %d", index, bufferedViews.size());
401+
AphidLog.d("Update visible views, index %d, buffered: %d", index, bufferedViews.size());
403402

404403
for (int i = 0; i < bufferedViews.size(); i++)
405404
bufferedViews.get(i).setVisibility(index == i ? VISIBLE : INVISIBLE);

FlipView/FlipLibrary/src/com/aphidmobile/flip/ViewDualCards.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import android.graphics.Bitmap;
2323
import android.view.View;
24+
2425
import com.aphidmobile.utils.TextureUtils;
2526
import com.aphidmobile.utils.UI;
2627

@@ -55,10 +56,14 @@ public View getView() {
5556

5657
public boolean setView(int index, View view) {
5758
UI.assertInMainThread();
58-
this.index = index;
59-
if (getView() == view
60-
&& (screenshot != null || TextureUtils.isValidTexture(texture)))
59+
60+
if (this.index == index
61+
&& getView() == view
62+
&& (screenshot != null || TextureUtils.isValidTexture(texture))
63+
)
6164
return false;
65+
66+
this.index = index;
6267
viewRef = null;
6368
if (texture != null) {
6469
texture.postDestroy();
@@ -72,6 +77,7 @@ public boolean setView(int index, View view) {
7277
UI.recycleBitmap(screenshot);
7378
screenshot = null;
7479
}
80+
7581
return true;
7682
}
7783

@@ -178,4 +184,9 @@ public void buildTexture(FlipRenderer renderer, GL10 gl) {
178184
public void abandonTexture() {
179185
texture = null;
180186
}
187+
188+
@Override
189+
public String toString() {
190+
return "ViewDualCards: (" + index + ", view: " + getView() + ")";
191+
}
181192
}

0 commit comments

Comments
 (0)