use of com.example.android.io2014.ui.AnimatedPathView in project google-io-2014 by romainguy.
the class DetailActivity method applyPalette.
private void applyPalette(Palette palette) {
getWindow().setBackgroundDrawable(new ColorDrawable(palette.getDarkMutedColor().getRgb()));
TextView titleView = (TextView) findViewById(R.id.title);
titleView.setTextColor(palette.getVibrantColor().getRgb());
TextView descriptionView = (TextView) findViewById(R.id.description);
descriptionView.setTextColor(palette.getLightVibrantColor().getRgb());
colorRipple(R.id.info, palette.getDarkMutedColor().getRgb(), palette.getDarkVibrantColor().getRgb());
colorRipple(R.id.star, palette.getMutedColor().getRgb(), palette.getVibrantColor().getRgb());
View infoView = findViewById(R.id.information_container);
infoView.setBackgroundColor(palette.getLightMutedColor().getRgb());
AnimatedPathView star = (AnimatedPathView) findViewById(R.id.star_container);
star.setFillColor(palette.getVibrantColor().getRgb());
star.setStrokeColor(palette.getLightVibrantColor().getRgb());
}
use of com.example.android.io2014.ui.AnimatedPathView in project google-io-2014 by romainguy.
the class DetailActivity method toggleStarView.
private void toggleStarView() {
final AnimatedPathView starContainer = (AnimatedPathView) findViewById(R.id.star_container);
if (starContainer.getVisibility() == View.INVISIBLE) {
findViewById(R.id.photo).animate().alpha(0.2f);
starContainer.setAlpha(1.0f);
starContainer.setVisibility(View.VISIBLE);
starContainer.reveal();
} else {
findViewById(R.id.photo).animate().alpha(1.0f);
starContainer.animate().alpha(0.0f).withEndAction(new Runnable() {
@Override
public void run() {
starContainer.setVisibility(View.INVISIBLE);
}
});
}
}
Aggregations