Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

set top corner of shape radius programmatically android

 GradientDrawable shape =  new GradientDrawable();
 shape.setCornerRadius( 8 );

 // add some color
 // You can add your random color generator here
 // and set color
 if (i % 2 == 0) {
  shape.setColor(Color.RED);
 } else {
  shape.setColor(Color.BLUE);
 }

 // now find your view and add background to it
 View view = (LinearLayout) findViewById( R.id.my_view );
 view.setBackground(shape);
Comment

PREVIOUS NEXT
Code Example
Java :: assert multiple junit 
Java :: enhanced for loop with arraylist 
Java :: java first character string number 
Java :: json array get json object 
Java :: how to initialize an empty array in java 
Java :: how to break switch case in java 
Java :: how to make arraylist character 
Java :: java time 
Java :: sorting list in java 
Java :: H2 enabling remote database creation first 
Java :: integer palindrome in java 
Java :: get list data in java 
Java :: class declaration in java 
Java :: Conversion from Java List to Array 
Java :: multiple condition inside for loop java 
Java :: Area of a Circle in Java Programming 
Java :: Java Looping Through Array Elements 
Java :: string.indexof java 
Java :: fibonacci series in java 
Java :: how to sort arraylist 
Java :: reversing the linked list 
Java :: hide app after install android studio 
Java :: java 8 stream option 
Java :: java comparing-two-csv-files-in-java 
Java :: java map keyset to list 
Java :: arrays.sum 
Java :: java equal string 
Java :: declare function in java 
Java :: single dex file error android 
Java :: an internal error occurred during initializing java tooling . java.lang.nullpointerexception 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =