android - can change color when OnScrollListener() be implemented in change colors -
am working on basic flashlight app , colors of screen change scroll thru screen. have been looking examples on how have had no luck. hoping point me in right direction. far know have use onscrolllistener() thank you
this taken mindtherobot
paint paint = new paint(); int color = 0x00000000; float position = getrelativetemperatureposition(); if (position < 0) { color |= (int) ((0xf0) * -position); // blue } else { color |= ((int) ((0xf0) * position)) << 16; // red } //log.d(tag, "*** " + integer.tohexstring(color)); lightingcolorfilter logofilter = new lightingcolorfilter(0xff338822, color); paint.setcolorfilter(logofilter);
Comments
Post a Comment