Guest User

Untitled

a guest
Nov 23rd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. <shape xmlns:android="http://schemas.android.com/apk/res/android"
  2. android:shape="rectangle" >
  3.  
  4. <gradient
  5. android:id="@+id/radGrad"
  6. android:centerColor="#ecd473"
  7. android:centerY="0%"
  8. android:centerX="0%"
  9. android:endColor="#000000"
  10. android:gradientRadius="600"
  11. android:innerRadiusRatio="2"
  12. android:startColor="#f9f7a8"
  13. android:type="radial" >
  14. </gradient>
  15. </shape>
  16.  
  17. View backgroundView;
  18. GradientDrawable background;
  19. background = this.getWindow().getDecorView();
  20.  
  21. submitButton.setOnClickListener(new View.OnClickListener() {
  22. @Override
  23. public void onClick(View view) {
  24. color = new int[3];
  25. color[0]=0xecd473; //these values will eventually be changed by the slider
  26. color[1]=0xf9f7a8;
  27. color[2]=0xffffff;
  28. background = new GradientDrawable(GradientDrawable.Orientation.BL_TR, color);
  29. background.mutate();
  30. background.setGradientType(GradientDrawable.RADIAL_GRADIENT);
  31. background.setGradientRadius(600);
  32. background.setGradientCenter(0,0);
  33. background.setShape(GradientDrawable.RECTANGLE);
  34. background.setCornerRadius(50f);
  35. background.setColors(color);
  36. backgroundView.setBackground(background);
  37. progressTextView.setText("Hue: " + hueValue + " Brightness: " + brightValue + " Saturation: " + satValue);
  38. }
  39. });
  40.  
  41. }
Add Comment
Please, Sign In to add comment