꿈소년의 개발 이야기

Color Palette 본문

Android Development

Color Palette

꿈소년 2014. 10. 23. 18:10
반응형

1.     Color palette 관련 (google-io-2014-master.zip)

http://office.pantech.com:80/ohd/pm/disk/linkdown.html?reginfo=20141023150923975360

 

DetailActivity.java 중 부분 발췌

private void colorize(Bitmap photo) {

    Palette palette;

    palette = Palette.generate(photo);

    applyPalette(palette);

}

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());

}

2.     Vector animation 관련

AnimatedVectorDrawable

http://developer.android.com/intl/ko/reference/android/graphics/drawable/AnimatedVectorDrawable.html#AnimatedVectorDrawable()

 

아래 페이지도 같이 참고하시면 될 것 같습니다.

Defining Custom Animations

http://developer.android.com/intl/ko/training/material/animations.html