Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <shape xmlns:android="http://schemas.android.com/apk/res/android"
- android:shape="rectangle" >
- <gradient
- android:id="@+id/radGrad"
- android:centerColor="#ecd473"
- android:centerY="0%"
- android:centerX="0%"
- android:endColor="#000000"
- android:gradientRadius="600"
- android:innerRadiusRatio="2"
- android:startColor="#f9f7a8"
- android:type="radial" >
- </gradient>
- </shape>
- View backgroundView;
- GradientDrawable background;
- background = this.getWindow().getDecorView();
- submitButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- color = new int[3];
- color[0]=0xecd473; //these values will eventually be changed by the slider
- color[1]=0xf9f7a8;
- color[2]=0xffffff;
- background = new GradientDrawable(GradientDrawable.Orientation.BL_TR, color);
- background.mutate();
- background.setGradientType(GradientDrawable.RADIAL_GRADIENT);
- background.setGradientRadius(600);
- background.setGradientCenter(0,0);
- background.setShape(GradientDrawable.RECTANGLE);
- background.setCornerRadius(50f);
- background.setColors(color);
- backgroundView.setBackground(background);
- progressTextView.setText("Hue: " + hueValue + " Brightness: " + brightValue + " Saturation: " + satValue);
- }
- });
- }
Add Comment
Please, Sign In to add comment