本文整理匯總了Java中android.transition.Explode.setDuration方法的典型用法代碼示例。如果您正苦於以下問題:Java Explode.setDuration方法的具體用法?Java Explode.setDuration怎麽用?Java Explode.setDuration使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.transition.Explode
的用法示例。
在下文中一共展示了Explode.setDuration方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: openTaskDetail
import android.transition.Explode; //導入方法依賴的package包/類
public void openTaskDetail(){
Task clickedTask = adapter.getTask(mTaskViewPager.getCurrentItem());
Fragment taskDetailFragment = new TaskDetailFragment();
((TaskDetailFragment)taskDetailFragment).setDisplayedTask(clickedTask);
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.LOLLIPOP) {
Explode explode = new Explode();
explode.setDuration(300);
Fade fade = new Fade();
fade.setDuration(400);
taskDetailFragment.setEnterTransition(fade);
setExitTransition(explode);
setReenterTransition(explode);
}
getActivity().getSupportFragmentManager()
.beginTransaction()
.replace(R.id.content_frame, taskDetailFragment)
.addToBackStack(null)
.commit();
}
示例2: onClick
import android.transition.Explode; //導入方法依賴的package包/類
@OnClick({R.id.bt_go, R.id.fab})
public void onClick(View view) {
switch (view.getId()) {
case R.id.fab:
getWindow().setExitTransition(null);
getWindow().setEnterTransition(null);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
ActivityOptions options =
ActivityOptions.makeSceneTransitionAnimation(this, fab, fab.getTransitionName());
startActivity(new Intent(this, RegisterActivity.class), options.toBundle());
} else {
startActivity(new Intent(this, RegisterActivity.class));
}
break;
case R.id.bt_go:
Explode explode = new Explode();
explode.setDuration(500);
getWindow().setExitTransition(explode);
getWindow().setEnterTransition(explode);
ActivityOptionsCompat oc2 = ActivityOptionsCompat.makeSceneTransitionAnimation(this);
Intent i2 = new Intent(this,LoginSuccessActivity.class);
startActivity(i2, oc2.toBundle());
break;
}
}
示例3: onCreate
import android.transition.Explode; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login_success);
Explode explode = new Explode();
explode.setDuration(500);
getWindow().setExitTransition(explode);
getWindow().setEnterTransition(explode);
}
示例4: setupWindowAnimations
import android.transition.Explode; //導入方法依賴的package包/類
private void setupWindowAnimations() {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
Fade fade = new Fade();
fade.setDuration(1000);
getWindow().setEnterTransition(fade);
Toast.makeText(this, "Animation", Toast.LENGTH_SHORT).show();
Explode slide = new Explode();
slide.setDuration(1000);
getWindow().setReenterTransition(slide);
}
}
示例5: setupWindowAnimations
import android.transition.Explode; //導入方法依賴的package包/類
private void setupWindowAnimations() {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
Explode slide = new Explode();
slide.setDuration(1000);
getWindow().setExitTransition(slide);
}
}
示例6: onCreate
import android.transition.Explode; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
getWindow().setAllowEnterTransitionOverlap(true);
getWindow().setAllowReturnTransitionOverlap(true);
Explode explode = new Explode();
explode.setDuration(1000);
getWindow().setEnterTransition(explode);
getWindow().setExitTransition(explode);
setContentView(R.layout.activity_animation);
}
示例7: setUpEnterTransition
import android.transition.Explode; //導入方法依賴的package包/類
private void setUpEnterTransition() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Explode transition = new Explode();
transition.setDuration(TRANSITION_DURATION);
getWindow().setEnterTransition(transition);
}
}
示例8: setTransition
import android.transition.Explode; //導入方法依賴的package包/類
private void setTransition() {
Explode explode = new Explode();
explode.setDuration(500);
explode.setMode(Explode.MODE_IN);
Explode explode1 = new Explode();
explode1.setDuration(500);
explode1.setMode(Explode.MODE_OUT);
getWindow().setEnterTransition(explode);
getWindow().setReturnTransition(explode1);
}
示例9: getExplodeTransition
import android.transition.Explode; //導入方法依賴的package包/類
/**
* returns Explode Transition
*
* @param listener transition listener
* @param duration duration for transition
* @return returns explode transition (null if API level 14 is less than LOLLIPOP)
*/
public static Transition getExplodeTransition(Transition.TransitionListener listener, int
duration)
{
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
{
Explode explode = new Explode();
explode.setDuration(duration);
explode.addListener(listener);
return explode;
}
return null;
}
示例10: setupWindowAnimations
import android.transition.Explode; //導入方法依賴的package包/類
private void setupWindowAnimations() {
Explode explode = new Explode();
explode.setDuration(2000);
getWindow().setExitTransition(explode);
Fade fade = new Fade();
getWindow().setReenterTransition(fade);
}
示例11: onClick
import android.transition.Explode; //導入方法依賴的package包/類
@OnClick({R.id.bt_go, R.id.fab})
public void onClick(View view) {
switch (view.getId()) {
case R.id.fab:
getWindow().setExitTransition(null);
getWindow().setEnterTransition(null);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
ActivityOptions options =
ActivityOptions.makeSceneTransitionAnimation(this, fab, fab.getTransitionName());
startActivity(new Intent(this, RegisterActivity.class), options.toBundle());
} else {
startActivity(new Intent(this, RegisterActivity.class));
}
break;
case R.id.bt_go:
Explode explode = new Explode();
explode.setDuration(500);
getWindow().setExitTransition(explode);
getWindow().setEnterTransition(explode);
ActivityOptionsCompat oc2 = ActivityOptionsCompat.makeSceneTransitionAnimation(this);
String username = etUsername.getText().toString();//用戶名
String password = etPassword.getText().toString();//密碼
if (!TextUtils.isEmpty(username) && !TextUtils.isEmpty(password)) {
//RequestApiData.getInstance().getLoginData(username, password, UserBaseInfo.class, LoginActivity.this);
//AppBus.getInstance().post(new BusEventData("somebody alive"));
new login().execute(UrlConstance.APP_URL + UrlConstance.KEY_LOGIN_INFO + "?username=" + username + "&password=" + password + "&usertype=0");
} else {
Toast.makeText(LoginActivity.this, "賬號或者密碼有誤", Toast.LENGTH_SHORT).show();
}
// overridePendingTransition(android.R.anim.slide_in_left,
// android.R.anim.slide_out_right);
// Intent i2 = new Intent(this, LoginSuccessActivity.class);
// startActivity(i2, oc2.toBundle());
break;
}
}
示例12: buildEnterTransition
import android.transition.Explode; //導入方法依賴的package包/類
private Transition buildEnterTransition() {
Explode enterTransition = new Explode();
enterTransition.setDuration(getResources().getInteger(R.integer.anim_duration_long));
return enterTransition;
}
示例13: setupWindowAnimations
import android.transition.Explode; //導入方法依賴的package包/類
private void setupWindowAnimations() {
Explode explode = new Explode();
explode.setDuration(2000);
getWindow().setEnterTransition(explode);
}