本文整理匯總了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();
}