当前位置: 首页>>代码示例>>Java>>正文


Java Explode.setDuration方法代码示例

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

}
 
开发者ID:gincos,项目名称:BeHealthy,代码行数:24,代码来源:MainFragment.java

示例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;
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:28,代码来源:MainActivity.java

示例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);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:LoginSuccessActivity.java

示例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);
    }


}
 
开发者ID:HitRoxxx,项目名称:FloatingNew,代码行数:14,代码来源:SelectedApplication.java

示例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);
        }

    }
 
开发者ID:HitRoxxx,项目名称:FloatingNew,代码行数:10,代码来源:MainActivity.java

示例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);
}
 
开发者ID:JamesKing9,项目名称:learn-newFeatures_Android_5.0,代码行数:15,代码来源:ExplodeActivity.java

示例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);
    }
}
 
开发者ID:blstream,项目名称:StudyBox_Android,代码行数:8,代码来源:BaseExamActivity.java

示例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);
    }
 
开发者ID:Art2Cat,项目名称:MoonlightNote,代码行数:14,代码来源:MoonlightActivity.java

示例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;
}
 
开发者ID:carrot,项目名称:android-animation-arsenal,代码行数:20,代码来源:AnimationArsenal.java

示例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);
}
 
开发者ID:cymcsg,项目名称:UltimateAndroid,代码行数:9,代码来源:MaterialAnimationActivity.java

示例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;
        }
    }
 
开发者ID:ligongzai,项目名称:QianXun,代码行数:44,代码来源:LoginActivity.java

示例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;
}
 
开发者ID:shenhuanet,项目名称:AndroidOpen,代码行数:6,代码来源:TransitionActivity2.java

示例13: setupWindowAnimations

import android.transition.Explode; //导入方法依赖的package包/类
private void setupWindowAnimations() {
    Explode explode = new Explode();
    explode.setDuration(2000);
    getWindow().setEnterTransition(explode);
}
 
开发者ID:cymcsg,项目名称:UltimateAndroid,代码行数:6,代码来源:DetailActivity1.java


注:本文中的android.transition.Explode.setDuration方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。