Android : How to gradually change colour of a view with seek bar?

on Saturday, October 25, 2014


I need to change the colour of a layout using the seek bar, from 0xC4DF9B to 0xA2CC61, say & am really struggling. Here is what I have so far:


XML:



<LinearLayout
android:id="@+id/tile1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical"
android:background="#C4DF9B">

</LinearLayout>


Java:



@Override
public void onProgressChanged(SeekBar seekBar, int progress,
boolean fromUser) {

int seekValue = seekBar.getProgress();

tile1.setBackgroundColor() // ???

}

0 comments:

Post a Comment