Search in sources :

Example 1 with AnimatedPathView

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());
}
Also used : ColorDrawable(android.graphics.drawable.ColorDrawable) TextView(android.widget.TextView) AnimatedPathView(com.example.android.io2014.ui.AnimatedPathView) ImageView(android.widget.ImageView) View(android.view.View) AnimatedPathView(com.example.android.io2014.ui.AnimatedPathView) TextView(android.widget.TextView)

Example 2 with AnimatedPathView

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);
            }
        });
    }
}
Also used : AnimatedPathView(com.example.android.io2014.ui.AnimatedPathView)

Aggregations

AnimatedPathView (com.example.android.io2014.ui.AnimatedPathView)2 ColorDrawable (android.graphics.drawable.ColorDrawable)1 View (android.view.View)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1