当前位置: 首页>>代码示例>>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;未经允许,请勿转载。