protected void onAttachedToWindow() { super.onAttachedToWindow(); resetCardState(); }
protected void onDetachedFromWindow() { super.onDetachedFromWindow(); resetCardState(); }
public void setSelected(boolean selected) { super.setSelected(selected); if (this.mCircle != null) { this.mCircle.animate().alpha(selected ? 1.0f : 0.0f).setDuration((long) this.mAnimDuration).start(); } }
protected void onFinishInflate() { super.onFinishInflate(); this.mCircle = (ImageView) findViewById(R.id.selection_circle); this.mIcon = (ImageView) findViewById(R.id.icon); this.mFocusAnimator = new ViewFocusAnimator(this); this.mDimmer = new ViewDimmer(this); this.mDimmer.addDimTarget(this.mIcon); this.mDimmer.addDimTarget(this.mCircle); this.mDimmer.setDimLevelImmediate(); }
protected void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect) { super.onFocusChanged(gainFocus, direction, previouslyFocusedRect); setSelected(gainFocus); }
protected void onFinishInflate() { super.onFinishInflate(); this.mCircle = (ImageView) findViewById(R.id.selection_circle); this.mIcon = (ImageView) findViewById(R.id.icon); this.mFocusAnimator = new ViewFocusAnimator(this); this.mDimmer = new ViewDimmer(this); this.mDimmer.addDimTarget(this.mIcon); this.mDimmer.addDimTarget(this.mCircle); this.mDimmer.setDimLevelImmediate(); }
protected void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect) { super.onFocusChanged(gainFocus, direction, previouslyFocusedRect); setSelected(gainFocus); }
protected void onDetachedFromWindow() { super.onDetachedFromWindow(); resetCardState(); }
protected void onAttachedToWindow() { super.onAttachedToWindow(); resetCardState(); }
public void setSelected(boolean selected) { super.setSelected(selected); if (this.mCircle != null) { this.mCircle.animate().alpha(selected ? 1.0f : 0.0f).setDuration((long) this.mAnimDuration).start(); } }
protected void onFinishInflate() { super.onFinishInflate(); this.mImageView = (ImageView) findViewById(R.id.art_work); this.mMetadataArea = findViewById(R.id.metadata); this.mSelectedMetadataContainer = (PrescaledLayout) findViewById(R.id.selected_metadata_container); this.mInfoArea = findViewById(R.id.info_field); this.mTitleView = (TextView) findViewById(R.id.title_text); this.mContentView = (TextView) findViewById(R.id.content_text); this.mSourceNameView = (TextView) findViewById(R.id.source_name); this.mBadgeImage = (ImageView) findViewById(R.id.badge); this.mBadgeImageSelected = (ImageView) findViewById(R.id.badge_selected); this.mProgBar = (ProgressBar) findViewById(R.id.progress_bar); Drawable cardBkg = getBackground(); this.mColor = getResources().getColor(R.color.notif_background_color); this.mInfoBackground = new ColorDrawable(this.mColor); this.mInfoArea.setBackground(this.mInfoBackground); this.mDimmer = new ViewDimmer(this); this.mDimmer.addDimTarget(this.mImageView); this.mDimmer.addDimTarget(this.mTitleView); this.mDimmer.addDimTarget(this.mContentView); this.mDimmer.addDimTarget(this.mSourceNameView); this.mDimmer.addDimTarget(cardBkg); this.mDimmer.addDesatDimTarget(this.mBadgeImage); this.mDimmer.addDesatDimTarget(this.mBadgeImageSelected); this.mDimmer.addDimTarget(this.mInfoBackground); this.mDimmer.addDimTarget(this.mProgBar.getProgressDrawable()); this.mDimmer.setDimLevelImmediate(); setClipToOutline(true); }
protected void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect) { super.onFocusChanged(gainFocus, direction, previouslyFocusedRect); setSelected(gainFocus); }
@Override protected void onDetachedFromWindow() { ImageView mImageView = mPreviewCard.getImageView(); mAttachedToWindow = false; mImageView.animate().cancel(); mImageView.setAlpha(1f); super.onDetachedFromWindow(); }
@Override protected void onAttachedToWindow() { super.onAttachedToWindow(); mAttachedToWindow = true; ImageView mImageView = mPreviewCard.getImageView(); if (mImageView.getAlpha() == 0) fadeIn(); }
@Override public void setSelected(boolean selected) { super.setSelected(selected); // change info area bg color based on palette color from image Integer color; if (selected) { color = mSelectedInfoAreaBackgroundColor; if (color == null) { color = mSelectedInfoAreaBackgroundDefaultColor; } } else { color = mInfoAreaBackgroundDefaultColor; } setInfoAreaBackgroundColor(color); }
protected void onFinishInflate() { super.onFinishInflate(); this.mImageView = (ImageView) findViewById(R.id.art_work); this.mMetadataArea = findViewById(R.id.metadata); this.mSelectedMetadataContainer = (PrescaledLayout) findViewById(R.id.selected_metadata_container); this.mInfoArea = findViewById(R.id.info_field); this.mTitleView = (TextView) findViewById(R.id.title_text); this.mContentView = (TextView) findViewById(R.id.content_text); this.mSourceNameView = (TextView) findViewById(R.id.source_name); this.mBadgeImage = (ImageView) findViewById(R.id.badge); this.mBadgeImageSelected = (ImageView) findViewById(R.id.badge_selected); this.mProgBar = (ProgressBar) findViewById(R.id.progress_bar); Drawable cardBkg = getBackground(); this.mColor = ResourcesCompat.getColor(getResources(), R.color.notif_background_color, null); this.mInfoBackground = new ColorDrawable(this.mColor); this.mInfoArea.setBackground(this.mInfoBackground); this.mDimmer.addDimTarget(this.mImageView); this.mDimmer.addDimTarget(this.mTitleView); this.mDimmer.addDimTarget(this.mContentView); this.mDimmer.addDimTarget(this.mSourceNameView); this.mDimmer.addDimTarget(cardBkg); this.mDimmer.addDesatDimTarget(this.mBadgeImage); this.mDimmer.addDesatDimTarget(this.mBadgeImageSelected); this.mDimmer.addDimTarget(this.mInfoBackground); this.mDimmer.addDimTarget(this.mProgBar.getProgressDrawable()); this.mDimmer.setDimLevelImmediate(); setClipToOutline(true); }
protected void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect) { super.onFocusChanged(gainFocus, direction, previouslyFocusedRect); setSelected(gainFocus); }
@Override protected void onDetachedFromWindow() { mAttachedToWindow = false; mImageView.animate().cancel(); mImageView.setAlpha(1f); BusProvider.unregister(this); super.onDetachedFromWindow(); }
@Override protected void onAttachedToWindow() { super.onAttachedToWindow(); mAttachedToWindow = true; if (mImageView.getAlpha() == 0) fadeIn(); BusProvider.getInstance().register(this); }
public void setSelected(boolean selected) { if (selected != isSelected()) { super.setSelected(selected); setMetaDataExpanded(selected); } }