跳至主要内容

博文

目前显示的是标签为“override”的博文

android overridePendingTransition Slide

92 down vote If you want the transition work for whole application you can create a  rootacivity  and inherit it in the activity you need. In Root Activity's onCreate call  overridePendingTransition  with desired direction. And  onStart  call  overridePendingTransition  with other direction if activity is resumed. Here I am giving full running code below.Correct me if I am wrong. create this xml file on your anim folder anim_slide_in_left.xml <? xml version = "1.0" encoding = "utf-8" ?> <set xmlns:android = "http://schemas.android.com/apk/res/android" > <translate android:duration = "600" android:fromXDelta = "100%" android:toXDelta = "0%" > </translate> </set> anim_slide_in_right.xml <? xml version = "1.0" encoding = "utf-8" ?> <set xmlns:android = "http://schemas.android.com/apk/res/android" ...

android overidePendingTransition Scale

Intent intent= new Intent(MainActivity. this, Main2Activity. class ) ; startActivity(intent) ; overridePendingTransition(R.anim. zoomin , R.anim. zoomout ); @Override public void onBackPressed () { super .onBackPressed() ; overridePendingTransition(R.anim. fade_in , R.anim. fade_out ) ; } XML file : <? xml version= "1.0" encoding= "utf-8" ?> <set xmlns: android = "http://schemas.android.com/apk/res/android" > <scale android :fromXScale= "100%" android :toXScale= "0%" android :fromYScale= "100%" android :toYScale= "0%" android :pivotX= "50%" android :pivotY= "50%" android :duration= "1000" /> </set>