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