本文整理汇总了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);
}