Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Linear gradient with small color transition

Linear gradient with small color transition

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Linear gradient with small color transition

Postby sanyiii » Tue Feb 16, 2010 5:25 pm

Hi everybody,

I have a simple problem: i want to create a gradient like in the attachment.
I can do this, if i define a lot of colors in the GradientDrawable object, but i think it's not the best solution.
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. final int[] colors = new int[10];
  3.  
  4.                 colors[0] = Color.BLACK;
  5.  
  6.                 colors[1] = Color.BLACK;
  7.  
  8.                 colors[2] = Color.BLACK;
  9.  
  10.                 colors[3] = Color.BLACK;
  11.  
  12.                 colors[4] = Color.BLACK;
  13.  
  14.                 colors[5] = Color.DKGRAY;
  15.  
  16.                 colors[6] = Color.DKGRAY;
  17.  
  18.                 colors[7] = Color.DKGRAY;
  19.  
  20.                 colors[8] = Color.DKGRAY;
  21.  
  22.                 colors[9] = Color.DKGRAY;
  23.  
  24.  
  25.  
  26.  
  27.  
  28. final GradientDrawable gradient = new GradientDrawable(Orientation.TOP_BOTTOM, colors);
  29.  
  30.  
Parsed in 0.011 seconds, using GeSHi 1.0.8.4


How can i modify the size of the color transition (java and xml code is good for me as well)?

Thanks for the help!
Attachments
gradient.png
gradient.png (19.94 KiB) Viewed 174 times
sanyiii
Developer
Developer
 
Posts: 42
Joined: Wed Jun 10, 2009 9:58 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Google [Bot] and 4 guests