Lines Matching refs:card

57  * during card transitions.
79 CardView card;
83 card = new WeatherCard(getContext(), this /* priority listener */);
86 card = new MediaCard(getContext(), this /* priority listener */);
89 card = new CallCard(getContext(), this /* priority listener */);
92 card = new NavCard(getContext(), this /* priority listener */);
95 card = new MessageCard(getContext(), this /* priority listener */);
98 card = new CardView(getContext(), cardType, this /* priority listener */);
102 card.setLayoutParams(params);
103 return (E) card;
111 CardView card = createIncomingCallCard(contactImage, contactName);
112 enqueueCard(card);
120 CardView card = createDialingCallCard(contactImage, contactName);
121 enqueueCard(card);
125 CallCard card = getCallCard();
126 if (card != null) {
127 card.setContactName(contactName);
132 CallCard card = getCallCard();
133 if (card != null) {
134 updateContactImage(card, image);
147 MessageCard card = createCard(CardType.HANGOUT);
148 card.setContactName(contactName);
151 card.setBackgroundColor(c);
152 card.setLeftIcon(BitmapUtils.circleCropBitmap(contactImage));
154 enqueueCard(card);
161 CallCard card = getCallCard();
162 if (card != null) {
164 Log.d(TAG, "handleCallConnected, call status: " + card.getCallStatus());
167 if (card.getCallStatus() == CallStatus.INCOMING_OR_DIALING) {
168 card.animateCallConnected(connectedTimestamp);
195 MediaCard card = createCard(CardType.MEDIA);
196 int iconSize = card.getIconSize();
201 card.setLeftIcon(albumIcon);
212 card.setBackground(backgroundImage, c);
218 card.setRightIcon(mediaApp);
219 card.setProgressColor(appColor);
220 card.setTitle(title);
221 card.setSubtitle(subtitle);
222 return card;
230 CardView card;
231 card = createCard(CardType.WEATHER);
232 card.setBackgroundColor(getResources().getColor(R.color.weather_blue_sky, null));
233 return card;
237 CallCard card = createCard(CardType.PHONE_CALL);
238 updateContactImage(card, contactImage);
239 card.setContactName(contactName);
240 card.setStatusLabel(getContext().getString(R.string.incoming_call));
241 return card;
245 CallCard card = createCard(CardType.PHONE_CALL);
247 updateContactImage(card, contactImage);
248 card.setContactName(contactName);
249 card.setStatusLabel(getContext().getString(R.string.dialing));
250 return card;
257 private void updateContactImage(CardView card, Bitmap contactImage) {
261 card.setLeftIcon(contactImageCircle);
272 card.setBackground(contactImage, c);
275 public boolean cardExists(CardView card) {
276 return mCardPanel.childViewExists(card);
279 public void removeCard(final CardView card) {
281 Log.d(TAG, "removeCard, card: " + card);
284 if (currentlyShownCard == card) {
286 mQueue.remove(card);
287 mCardPanel.markViewToBeRemoved(card);
292 Log.d(TAG, "card to show: " + cardToShow + ", animation: " + animation);
301 playUnrevealAnimation(card, new Runnable() {
304 removeCardInternal(card);
310 Log.d(TAG, "removeCard, card is not on the screen, remove it immediately");
311 removeCardInternal(card);
316 public void enqueueCard(final CardView card) {
318 Log.d(TAG, "enqueueCard, card: " + card);
321 boolean cardIsOnTheScreen = card == currentCard;
323 boolean cardExisted = mQueue.remove(card);
324 mQueue.offer(card);
327 boolean shouldDisplayCard = activeCard == card;
330 Log.d(TAG, "enqueueCard, card: " + card + ", onScreen: "
339 // animation and show underlying card.
347 // this card using unreveal animation.
348 showCardWithUnrevealAnimation(card);
353 showCardWithRevealAnimation(card);
355 // We want to add the card to the panel, but do not want to show it.
357 Log.d(TAG, "Adding hidden card");
359 card.setVisibility(GONE);
360 mCardPanel.addView(card, 0);
365 removeInvisibleDuplicatedCard(card); // Remove invisible cards with the same card type.
372 Log.d(TAG, "showCardWithRevealAnimation, card: " + cardToShow);
382 private void removeInvisibleDuplicatedCard(CardView card) {
383 Log.d(TAG, "removeInvisibleDuplicatedCard, card: " + card);
384 // Remove cards that has the same card type and not visible on the screen.
387 if (child.getCardType() == card.getCardType()
388 && child != card
398 Log.d(TAG, "showCardWithFadeoutAnimation, card: " + cardToShow);
400 // Place card behind the top card, it will become visible once fade out animation for the
401 // top card starts to play.
405 // Hide top card with animation.
411 Log.d(TAG, "showCardWithUnrevealAnimation, card: " + cardToShow);
415 // animation to unreveal this card.
426 RemoveOrHideCard(ClusterView clusterView, CardView card) {
427 mCard = card;
441 Log.d(TAG, "RemoveOrHideCard, card has garbage priority");
446 Log.d(TAG, "RemoveOrHideCard, hiding card: " + mCard);
455 private void removeCardInternal(CardView card) {
457 Log.d(TAG, "removeCardInternal, card: " + card);
459 mCardPanel.removeView(card);
460 mQueue.remove(card);
466 public void onPriorityChanged(CardView card, int priority) {
468 Log.d(TAG, "onPriorityChanged, card: " + card + ", priority: " + priority);
470 if (cardExists(card)) {
471 enqueueCard(card);
503 private void playAlphaAnimation(final CardView card, float targetAlpha, long duration,
505 Animation animation = new AlphaAnimation(card.getAlpha(), targetAlpha);
525 card.setAnimation(animation);
533 private void playFadeOutAndSlideOutAnimation(final CardView card) {
534 Animation animation = new TranslateAnimation(0, card.getWidth(), 0, 0) {
535 private final float mFromAlpha = card.getAlpha();
558 new RemoveOrHideCard(ClusterView.this, card)
562 card.setTranslationX(0);
568 card.setAnimation(animation);
572 /** Hides given card and reveals underlying card */
573 private void playUnrevealAnimation(final CardView card, final Runnable unrevealCompleteAction) {
575 Log.d(TAG, "playUnrevealAnimation, card: " + card);
578 final Animator anim = createRevealAnimator(card,
606 card.onPlayUnrevealAnimation();
609 private Animator createRevealAnimator(CardView card, Interpolator interpolator, boolean show) {
614 Animator anim = ViewAnimationUtils.createCircularReveal(card, radius, centerY,