當前位置: 首頁>>代碼示例>>Java>>正文


Java Explode類代碼示例

本文整理匯總了Java中android.transition.Explode的典型用法代碼示例。如果您正苦於以下問題:Java Explode類的具體用法?Java Explode怎麽用?Java Explode使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Explode類屬於android.transition包,在下文中一共展示了Explode類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCreate

import android.transition.Explode; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        //轉場動畫
        getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
        getWindow().setEnterTransition(new Explode());
        getWindow().setExitTransition(new Explode());
    }
    setContentView(R.layout.activity_main);
    ClassLoader loader = MainActivity.class.getClassLoader();
    if (loader != null){
        Log.d(TAG, "onCreate: classloader:" + loader.toString());
        Log.d(TAG, "onCreate: classloader:" + loader.getParent().toString());
    }

    ButterKnife.bind(this);
    initViews();
}
 
開發者ID:jiangkang,項目名稱:KTools,代碼行數:20,代碼來源:MainActivity.java

示例2: onClick

import android.transition.Explode; //導入依賴的package包/類
@OnClick(R.id.square2)
public void onClick() {

    FragmentSharedElementTransitionTarget targetFragment = new FragmentSharedElementTransitionTarget();
    // FIXME: 08/02/2017 the shared element transitions to the next fragment below other views while it should be on top as in Activity transitions
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        TransitionSet transitionSet = new TransitionSet();
        transitionSet.addTransition(new ChangeBounds());
        transitionSet.setPathMotion(new ArcMotion());
        targetFragment.setSharedElementEnterTransition(transitionSet);
        targetFragment.setSharedElementReturnTransition(transitionSet);
        targetFragment.setEnterTransition(TransitionInflater.from(getActivity()).inflateTransition(R.transition.slide_bottom));
        targetFragment.setExitTransition(TransitionInflater.from(getActivity()).inflateTransition(R.transition.slide_top_and_fade));
        setExitTransition(new Explode());
        setReenterTransition(new Explode());
        setAllowReturnTransitionOverlap(false);
    }
    getActivity().getSupportFragmentManager()
            .beginTransaction()
            .addSharedElement(square2, getString(R.string.custom_element_transition_name))
            .replace(R.id.fragmentContainer, targetFragment)
            .addToBackStack(null)
            .commit();
}
 
開發者ID:zawadz88,項目名稱:AnimationShowcase,代碼行數:25,代碼來源:FragmentSharedElementTransitionSource.java

示例3: 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

示例4: onCreate

import android.transition.Explode; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        Window window = getWindow();
        window.requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
        window.setEnterTransition(new Explode());
        window.setExitTransition(new Explode());
    }
    setContentView(R.layout.activity_game);

    Mailbox.getInstance().atHome(this);

    mTvTime = (TextView) findViewById(R.id.tv_time);
    mTvStep = (TextView) findViewById(R.id.tv_step);
    mBtnChooseAndStart = (Button) findViewById(R.id.btn_choose_and_start);
}
 
開發者ID:richardchien,項目名稱:jigsaw-android,代碼行數:18,代碼來源:GameActivity.java

示例5: onCreate

import android.transition.Explode; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    // 設置一個exit transition
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
        getWindow().setEnterTransition(new Explode());
        getWindow().setExitTransition(new Explode());
    }
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_fragment);

    newFragment = new VideoFragment();
    FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    transaction.replace(R.id.frameLayout, newFragment);
    transaction.addToBackStack(null);
    transaction.commit();
}
 
開發者ID:CarGuo,項目名稱:GSYVideoPlayer,代碼行數:18,代碼來源:FragmentVideoActivity.java

示例6: GalleryFragment

import android.transition.Explode; //導入依賴的package包/類
public GalleryFragment() {

        final Fade fade = new Fade();
        fade.addTarget(R.id.appbar);

        Explode explode = new Explode();
        explode.excludeTarget(R.id.appbar, true);

        Elevation elevation = new Elevation();
        elevation.addTarget(R.id.gallery_card);
        elevation.setStartDelay(250); // arbitrarily chosen delay

        TransitionSet exit = new TransitionSet();
        exit.addTransition(fade);
        exit.addTransition(explode);
        exit.addTransition(elevation);

        setExitTransition(exit);
    }
 
開發者ID:googlesamples,項目名稱:android-OurStreets,代碼行數:20,代碼來源:GalleryFragment.java

示例7: setAnimation

import android.transition.Explode; //導入依賴的package包/類
public void setAnimation() {
    type = getIntent().getStringExtra("type");

    switch (type) {
        case "1":
            getWindow().setEnterTransition(new Explode());
            getWindow().setExitTransition(new Explode());
            break;
        case "2":
            getWindow().setEnterTransition(new Slide());
            getWindow().setExitTransition(new Slide());
            break;
        case "3":
            getWindow().setEnterTransition(new Fade());
            getWindow().setExitTransition(new Fade());
            break;
    }
}
 
開發者ID:Jenior,項目名稱:-Material-Design,代碼行數:19,代碼來源:LearnTransitionActivityB.java

示例8: onCreate

import android.transition.Explode; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    if(BuildUtil.isLargeThanAPI21()){
        Fade fade = new Fade();
        Explode explode = new Explode();
        fade.setDuration(100);
        getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
        getWindow().setEnterTransition(fade);
        getWindow().setExitTransition(fade);
    }
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_about_us);

    getSupportActionBar().setTitle("關於我們");
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
 
開發者ID:583462423,項目名稱:ihandsw,代碼行數:17,代碼來源:AboutUsActivity.java

示例9: onCreate

import android.transition.Explode; //導入依賴的package包/類
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
            getWindow().setExitTransition(new Explode());
        }
        mDecorView = getWindow().getDecorView();
        mDefaultUIFlag = mDecorView.getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
        getWindow().setStatusBarColor(ContextCompat.getColor(this, R.color.main_background));
//        setAppTheme();
        setContentView(R.layout.activity_main);
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        ButterKnife.bind(this);
        analyseIntent();
        initChildViews(savedInstanceState);
    }
 
開發者ID:4FunApp,項目名稱:4Fun,代碼行數:18,代碼來源:MainActivity.java

示例10: onCreate

import android.transition.Explode; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    getWindow().setEnterTransition(new Explode());
    getWindow().setExitTransition(new Explode());
  }

  setContentView(getLayoutResource());

  Toolbar toolBar = (Toolbar) findViewById(R.id.toolbar);
  if (toolBar != null) {
    toolBar.bringToFront();
    setSupportActionBar(toolBar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setIcon(new ColorDrawable(android.R.color.transparent));
    getSupportActionBar().setTitle(R.string.choose_service);
    setToolBar(toolBar);
  }
}
 
開發者ID:chute,項目名稱:photo-picker-plus-android,代碼行數:22,代碼來源:BaseActivity.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);
            Intent i2 = new Intent(this,LoginSuccessActivity.class);
            startActivity(i2, oc2.toBundle());
            break;
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:28,代碼來源:MainActivity.java

示例12: 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

示例13: initView

import android.transition.Explode; //導入依賴的package包/類
@Override
public void initView(Bundle savedInstanceState, View view) {
    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
        Explode explode = (Explode) TransitionInflater.from(this).inflateTransition(R.transition.explode_1000);
        Fade fade = (Fade) TransitionInflater.from(this).inflateTransition(R.transition.fade_1000);
        getWindow().setEnterTransition(fade);
        getWindow().setExitTransition(explode);
    }
    findViewById(android.R.id.content).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            SharedElementActivityActivity.start(SharedElementActivityActivity.this);
        }
    });
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:16,代碼來源:SharedElementActivityActivity.java

示例14: initView

import android.transition.Explode; //導入依賴的package包/類
@Override
public void initView(Bundle savedInstanceState, View view) {
    getToolBar().setTitle(getString(R.string.demo_activity));
    viewSharedElement = (ImageView) findViewById(R.id.view_shared_element);
    findViewById(R.id.btn_cls).setOnClickListener(this);
    findViewById(R.id.btn_cls_opt_anim).setOnClickListener(this);
    findViewById(R.id.btn_cls_opt_shared).setOnClickListener(this);
    findViewById(R.id.btn_cls_opt_scale_up).setOnClickListener(this);
    findViewById(R.id.btn_cls_opt_thumbnail_scale_up).setOnClickListener(this);
    findViewById(R.id.btn_cls_opt_clip_reveal).setOnClickListener(this);
    findViewById(R.id.btn_cls_anim).setOnClickListener(this);
    findViewById(R.id.btn_shared_element).setOnClickListener(this);
    findViewById(R.id.btn_start_home_activity).setOnClickListener(this);
    findViewById(R.id.btn_finish_all_activity).setOnClickListener(this);
    TextView tvAboutActivity = (TextView) findViewById(R.id.tv_about_activity);
    tvAboutActivity.setText("Is ImageActivity Exists: " + ActivityUtils.isActivityExists(Config.PKG, ImageActivity.class.getName())
            + "\ngetLauncherActivity: " + ActivityUtils.getLauncherActivity(Config.PKG)
            + "\ngetTopActivity: " + ActivityUtils.getTopActivity()
    );
    bitmap = ((BitmapDrawable) viewSharedElement.getDrawable()).getBitmap();

    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
        Explode explode = (Explode) TransitionInflater.from(this).inflateTransition(R.transition.explode_1000);
        Fade fade = (Fade) TransitionInflater.from(this).inflateTransition(R.transition.fade_1000);
        getWindow().setEnterTransition(explode);
        getWindow().setReturnTransition(fade);
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:29,代碼來源:ActivityActivity.java

示例15: onCreate

import android.transition.Explode; //導入依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
        getWindow().setExitTransition(new Explode());
    }
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_search);
    initialise();
    configure();
    setSearchListeners();
}
 
開發者ID:chashmeetsingh,項目名稱:TrackIt-Android,代碼行數:13,代碼來源:SearchActivity.java


注:本文中的android.transition.Explode類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。