Example #1
0
  public void reloadTexture(int frontIndex, View frontView, int backIndex, View backView) {
    synchronized (this) {
      if (frontView != null) {
        if (backCards.getView() == frontView) {
          frontCards.setView(-1, null);
          swapCards();
        }
      }

      if (backView != null) {
        if (frontCards.getView() == backView) {
          backCards.setView(-1, null);
          swapCards();
        }
      }

      boolean frontChanged = frontCards.setView(frontIndex, frontView);
      boolean backChanged = backCards.setView(backIndex, backView);

      if (AphidLog.ENABLE_DEBUG)
        AphidLog.d(
            "reloading texture: %s and %s; old views: %s, %s, front changed %s, back changed %s",
            frontView,
            backView,
            frontCards.getView(),
            backCards.getView(),
            frontChanged,
            backChanged);

      if (frontIndex == activeIndex) {
        if (angle >= 180) angle -= 180;
        else if (angle < 0) angle += 180;
      } else if (backIndex == activeIndex) {
        if (angle < 0) angle += 180;
      }

      //			AphidLog.i("View changed: front (%d, %s), back (%d, %s), angle %s, activeIndex %d",
      // frontIndex, frontView, backIndex, backView, angle, activeIndex);
    }
  }
Example #2
0
 void refreshPageView(View view) {
   if (frontCards.getView() == view) frontCards.markForceReload();
   if (backCards.getView() == view) backCards.markForceReload();
 }