I want to my first page background fade out and then going to next page. I make shape with gradient and use it for background of first page. but when I run my app in genymotion background color of first page is dark gray,I am new to Android development so I don't have much idea to how can handle it. XML :
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<gradient
android:centerX="20%"
android:endColor="#aed36c"
android:startColor="#44c8f5" />
</shape>
MAINACTIVITY XML :
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/linergradiant"
android:id="@+id/firstpage"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/texture" >
<LinearLayout
android:layout_width="200dip"
android:layout_height="200dip"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="116dp"
android:background="@drawable/logo_big2" >
</LinearLayout>
</RelativeLayout>
</LinearLayout>
MAINACTIVITY JAVA
public class MainActivity extends ActionBarActivity {
LinearLayout screen;
Handler handler = new Handler();
int i;
Intent intent;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
screen=(LinearLayout) findViewById(R.id.firstpage);
(new Thread(){
@Override
public void run(){
for(i=0; i<255; i=i+3){
handler.post(new Runnable(){
public void run(){
screen.setBackgroundColor(Color.argb(255, i, i, i));
}
});
try{ sleep(100); }
catch(Exception e){ break; }
}
startActivity(new Intent(getApplicationContext(),BMIcalculator.class));
}
}).start();
}
}
can any one help me? can it solve with transition ??