I want to know if this kind of gradient color is possible in android? If possible then how? http://www.techandall.com/wp-content/uploads/2013/10/techandall_mobile-analytics-UI-concept_preview1.jpg
Thanks, Bskania.
I want to know if this kind of gradient color is possible in android? If possible then how? http://www.techandall.com/wp-content/uploads/2013/10/techandall_mobile-analytics-UI-concept_preview1.jpg
Thanks, Bskania.
Here you have an online tool for creating gradient shapes for android:
http://angrytools.com/gradient/
By clicking on the android tab, you get xml with shape(s) :
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<gradient
android:type="linear"
android:centerX="47%"
android:startColor="#FF70C1FF"
android:centerColor="#FFBDC9FF"
android:endColor="#FF734080"
android:angle="45"/>
</shape>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<gradient
android:type="radial"
android:centerX="50%"
android:centerY="50%"
android:startColor="#FF70C1FF"
android:centerColor="#FFBDC9FF"
android:endColor="#FF734080"
android:gradientRadius="47"/>
</shape>
int startColor=Color.parseColor("#a6c1de");
//you can add as many gradient colors as you want here
//and include it in the int array while initializing GradientDrawable
int endColor=Color.parseColor("#aa82b7");
GradientDrawable mDrawable=new GradientDrawable(Orientation.LEFT_RIGHT,
new int[] {startColor,endColor});
LinearLayout mLayout=(LinearLayout)findViewById(R.id.your_id);
mLayout.setBackgroundDrawable(mDrawable);
new int[] startColor,centerColor, endColor}