लागू करें मैं एंड्रॉइड सामग्री डिजाइन के पैलेट फ़ंक्शन का उपयोग करने की कोशिश कर रहा हूं लेकिन मुझे इसे लागू करने में कुछ परेशानी हो रही है।एंड्रॉइड पैलेट
मैंने सफलतापूर्वक पैलेट जेनरेट किया है और अब मैं पैलेट को उस फ़ंक्शन में पास करने की कोशिश कर रहा हूं जो इसे लागू करता है।
मेरी समस्या यह है कि जब मैं पैलेट में applyPalette
फ़ंक्शन में पास करता हूं तो palette.getDarkMutedColor().getRgb() , palette.getVibrantColor().getRgb()
जैसे किसी भी तरीके को पैलेट से मानों के साथ पॉप्युलेट नहीं किया जा रहा है।
ट्यूटोरियल है कि मैं फ्लॉप कुछ उल्लेख पीछा कर रहा था अन्य तो कार्य करने के लिए पैलेट में गुजर, और इतने तरीकों करने में से भरे जाएंगे
यह जनरेटर समारोह और लागू करने के समारोह है, कर सकते हैं किसी भी एक देखो यह क्यों काम नहीं कर रहा है?
कोड
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