アンドロイド素材デザインのパレット機能を使用しようとしていますが、適用に問題があります。Android適用パレット
パレットを正常に生成しましたが、パレットを適用する関数にパレットを渡そうとしています。 関数にパレットを渡したときに、palette.getDarkMutedColor().getRgb() , palette.getVibrantColor().getRgb()
のようなメソッドのどれもがパレットの値で設定されていないという問題があります。
これは、発電機の機能と応用機能である私はdidntはその後、関数にパレットを渡し、他の何かを言及し、次し、そうすることで方法が
を埋められるチュートリアル、いずれかのことができますなぜこのisntの作業を参照してください?
コード
private void colorize(Bitmap photo) {
Palette palette = new Palette.Builder(photo).generate();
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());
}
getRgb()関数を削除してみます。 –
いいえ、それでも同じエラーが表示されません – Hayes121
「機能しない」という色機能を使用しているときの意味を明確にしてください。 – stkent