Hello I want to know how I can get background effect like this ? Even the colours are different with different contacts.
I have tried some tutorials.
and others.
But did not get exact effect. Please help. Thanks in advance. :)
Hello I want to know how I can get background effect like this ? Even the colours are different with different contacts.
I have tried some tutorials.
and others.
But did not get exact effect. Please help. Thanks in advance. :)
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="#3B5998"
android:endColor="#00000000"
android:angle="45"/>
</shape>
and then in your main xml
<include
android:id="@+id/include1"
layout="@layout/actionbar" />
for example in XML
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="#2E383E"
android:endColor="#798B97"
android:angle="45"/>
</shape>
Create a TransitionDrawable to change between two drawables that you use for the background.
<?xml version="1.0" encoding="UTF-8"?>
<transition xmlns:android="http://schemas.android.com/apk/res/android">
<!-- use whatever drawables you want, gradients, shapes etc-->
<item android:drawable="@drawable/start" />
<item android:drawable="@drawable/end" />
</transition>
Transition Drawables in Android
TransitionDrawable trans = (TransitionDrawable) myLayout.getBackground();
trans.startTransition(2000);