Exemplo n.º 1
0
  @Override
  public void onViewCreated(View mParent, Bundle savedInstanceState) {
    super.onViewCreated(mParent, savedInstanceState);
    Logger.LogDebug("Carousel onViewCreated!");
    mView.getHolder().setFormat(PixelFormat.RGBA_8888);
    mPaint.setColor(0xffffffff);

    final Resources res = getResources();
    mHelper.setCarouselView(mView);
    mView.setSlotCount(CARD_SLOTS);
    mView.createCards(INCREMENTAL_ADD ? 1 : size());
    mView.setVisibleSlots(SLOTS_VISIBLE);
    mView.setStartAngle((float) -(2.0f * Math.PI * 5 / CARD_SLOTS));
    mBorder = BitmapFactory.decodeResource(res, R.drawable.border);
    mView.setDefaultBitmap(mBorder);
    mView.setLoadingBitmap(mBorder);
    // mView.setDetailTextureAlignment(CarouselView.DetailAlignment.CENTER_VERTICAL |
    // CarouselView.DetailAlignment.LEFT);
    mView.setBackgroundColor(0.25f, 0.25f, 0.5f, 0.25f);
    // Theme t = getActivity().getTheme();
    // mView.setBackgroundDrawable(getResources().getDrawable(android.R.drawable.screen_background_dark));
    mView.setRezInCardCount(3.0f);
    mView.setFadeInDuration(200);
    mView.setVisibleDetails(VISIBLE_DETAIL_COUNT);
    mView.setDragModel(CarouselView.DRAG_MODEL_PLANE);
    if (INCREMENTAL_ADD) {
      mView.postDelayed(mAddCardRunnable, 2000);
    }

    try {
      mGlossyOverlay = BitmapFactory.decodeResource(res, R.drawable.glossy_overlay);
    } catch (OutOfMemoryError e) {
      Logger.LogError("Out of memory!", e);
      mGlossyOverlay = null;
    }
  }
Exemplo n.º 2
0
 public void run() {
   if (mView.getCardCount() < size()) {
     mView.createCards(mView.getCardCount() + 1);
     mView.postDelayed(mAddCardRunnable, 2000);
   }
 }