當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。