android.transition.Slide Java Examples
The following examples show how to use
android.transition.Slide.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: StreamActivity.java From Twire with GNU General Public License v3.0 | 6 votes |
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) private TransitionSet constructTransitions() { int[] slideTargets = {R.id.ChatRecyclerView, R.id.chat_input, R.id.chat_input_divider}; Transition slideTransition = new Slide(Gravity.BOTTOM); Transition fadeTransition = new Fade(); for (int slideTarget : slideTargets) { slideTransition.addTarget(slideTarget); fadeTransition.excludeTarget(slideTarget, true); } TransitionSet set = new TransitionSet(); set.addTransition(slideTransition); set.addTransition(fadeTransition); return set; }
Example #2
Source File: MainActivity.java From trekarta with GNU General Public License v3.0 | 6 votes |
private void startMapSelection(boolean zoom) { if (mFragmentManager.getBackStackEntryCount() > 0) { popAll(); } if (zoom) { MapPosition mapPosition = mMap.getMapPosition(); mapPosition.setScale(MapCoverageLayer.TEXT_MIN_SCALE + 5f); mapPosition.setBearing(0f); mapPosition.setTilt(0f); mMap.animator().animateTo(MAP_POSITION_ANIMATION_DURATION, mapPosition); } MapSelection fragment = (MapSelection) Fragment.instantiate(this, MapSelection.class.getName()); fragment.setMapIndex(mNativeMapIndex); fragment.setEnterTransition(new Slide()); FragmentTransaction ft = mFragmentManager.beginTransaction(); ft.replace(R.id.contentPanel, fragment, "mapSelection"); ft.addToBackStack("mapSelection"); ft.commit(); updateMapViewArea(); }
Example #3
Source File: MainActivity.java From trekarta with GNU General Public License v3.0 | 6 votes |
@Override public void onRouteDetails(Route route) { Fragment fragment = mFragmentManager.findFragmentByTag("routeInformation"); if (fragment == null) { fragment = Fragment.instantiate(this, RouteInformation.class.getName()); Slide slide = new Slide(mSlideGravity); // Required to sync with FloatingActionButton slide.setDuration(getResources().getInteger(android.R.integer.config_shortAnimTime)); fragment.setEnterTransition(slide); FragmentTransaction ft = mFragmentManager.beginTransaction(); ft.replace(R.id.contentPanel, fragment, "routeInformation"); ft.addToBackStack("routeInformation"); ft.commit(); updateMapViewArea(); } ((RouteInformation) fragment).setRoute(route); mViews.extendPanel.setForeground(getDrawable(R.drawable.dim)); mViews.extendPanel.getForeground().setAlpha(0); ObjectAnimator anim = ObjectAnimator.ofInt(mViews.extendPanel.getForeground(), "alpha", 0, 255); anim.setDuration(500); anim.start(); }
Example #4
Source File: MainActivity.java From trekarta with GNU General Public License v3.0 | 6 votes |
private void onTrackDetails(Track track, boolean current) { Fragment fragment = mFragmentManager.findFragmentByTag("trackInformation"); if (fragment == null) { fragment = Fragment.instantiate(this, TrackInformation.class.getName()); Slide slide = new Slide(mSlideGravity); // Required to sync with FloatingActionButton slide.setDuration(getResources().getInteger(android.R.integer.config_shortAnimTime)); fragment.setEnterTransition(slide); FragmentTransaction ft = mFragmentManager.beginTransaction(); ft.replace(R.id.contentPanel, fragment, "trackInformation"); ft.addToBackStack("trackInformation"); ft.commit(); updateMapViewArea(); } ((TrackInformation) fragment).setTrack(track, current); mViews.extendPanel.setForeground(getDrawable(R.drawable.dim)); mViews.extendPanel.getForeground().setAlpha(0); ObjectAnimator anim = ObjectAnimator.ofInt(mViews.extendPanel.getForeground(), "alpha", 0, 255); anim.setDuration(500); anim.start(); }
Example #5
Source File: MainActivity.java From trekarta with GNU General Public License v3.0 | 6 votes |
@Override public void showMarkerInformation(@NonNull GeoPoint point, @Nullable String name) { if (mFragmentManager.getBackStackEntryCount() > 0) { popAll(); } Bundle args = new Bundle(3); args.putDouble(MarkerInformation.ARG_LATITUDE, point.getLatitude()); args.putDouble(MarkerInformation.ARG_LONGITUDE, point.getLongitude()); args.putString(MarkerInformation.ARG_NAME, name); Fragment fragment = Fragment.instantiate(this, MarkerInformation.class.getName(), args); fragment.setEnterTransition(new Slide()); FragmentTransaction ft = mFragmentManager.beginTransaction(); ft.replace(R.id.contentPanel, fragment, "markerInformation"); ft.addToBackStack("markerInformation"); ft.commit(); updateMapViewArea(); }
Example #6
Source File: MainActivity.java From Easy_xkcd with Apache License 2.0 | 6 votes |
void showBrowserFragment(boolean animate) { FragmentManager fragmentManager = getSupportFragmentManager(); if (prefHelper.fabDisabledComicBrowser()) mFab.hide(); else mFab.show(); ComicFragment comicFragment = fullOffline ? new OfflineFragment() : new ComicBrowserFragment(); final FragmentTransaction transaction = fragmentManager.beginTransaction(); if (animate) { Fragment oldFragment = fragmentManager.findFragmentByTag(FRAGMENT_TAG); if (oldFragment != null) { Slide slideOut = new Slide(Gravity.BOTTOM); slideOut.setInterpolator(new AccelerateInterpolator(2.0f)); oldFragment.setExitTransition(slideOut); } Slide slideIn = new Slide(Gravity.TOP); slideIn.setInterpolator(new OvershootInterpolator(1.5f)); comicFragment.setEnterTransition(slideIn); comicFragment.setAllowEnterTransitionOverlap(false); } transaction.replace(R.id.flContent, comicFragment, FRAGMENT_TAG); currentFragment = CurrentFragment.Browser; transaction.commitNowAllowingStateLoss(); }
Example #7
Source File: MainActivity.java From Easy_xkcd with Apache License 2.0 | 6 votes |
void showFavoritesFragment(boolean animate) { FragmentManager fragmentManager = getSupportFragmentManager(); //mFab.setVisibility(prefHelper.fabDisabledFavorites() ? View.GONE : View.VISIBLE); FavoritesFragment favoritesFragment = new FavoritesFragment(); final FragmentTransaction transaction = fragmentManager.beginTransaction(); if (animate) { Fragment oldFragment = fragmentManager.findFragmentByTag(FRAGMENT_TAG); if (oldFragment != null) { Slide slideOut = new Slide(currentFragment == CurrentFragment.Browser ? Gravity.TOP : Gravity.BOTTOM); slideOut.setInterpolator(new AccelerateInterpolator(2.0f)); oldFragment.setExitTransition(slideOut); } Slide slideIn = new Slide(currentFragment == CurrentFragment.Browser ? Gravity.BOTTOM : Gravity.TOP); slideIn.setInterpolator(new OvershootInterpolator(1.5f)); favoritesFragment.setEnterTransition(slideIn); favoritesFragment.setAllowEnterTransitionOverlap(false); } transaction .replace(R.id.flContent, favoritesFragment, FRAGMENT_TAG); currentFragment = CurrentFragment.Favorites; transaction.commitNowAllowingStateLoss(); }
Example #8
Source File: OverviewListFragment.java From Easy_xkcd with Apache License 2.0 | 6 votes |
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { setupVariables(); View v = inflater.inflate(R.layout.overview_list, container, false); list = (ListView) v.findViewById(R.id.list); list.setFastScrollEnabled(true); setupAdapter(); if (savedInstanceState == null) { animateToolbar(); postponeEnterTransition(); } setEnterTransition(new Slide(Gravity.LEFT)); setSharedElementEnterTransition(TransitionInflater.from(getContext()).inflateTransition(R.transition.image_shared_element_transition)); return v; }
Example #9
Source File: OdysseyMainActivity.java From odyssey with GNU General Public License v3.0 | 6 votes |
@Override public void onRecentAlbumsSelected() { // Create fragment RecentAlbumsFragment newFragment = RecentAlbumsFragment.newInstance(); FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); // set enter / exit animation newFragment.setEnterTransition(new Slide(Gravity.BOTTOM)); newFragment.setExitTransition(new Slide(Gravity.TOP)); // Replace whatever is in the fragment_container view with this // fragment, // and add the transaction to the back stack so the user can navigate // back transaction.replace(R.id.fragment_container, newFragment); transaction.addToBackStack("RecentAlbumsFragment"); // Commit the transaction transaction.commit(); }
Example #10
Source File: OdysseyMainActivity.java From odyssey with GNU General Public License v3.0 | 6 votes |
@Override public void openArtworkSettings() { // Create fragment and give it an argument for the selected directory ArtworkSettingsFragment newFragment = ArtworkSettingsFragment.newInstance(); FragmentManager fragmentManager = getSupportFragmentManager(); FragmentTransaction transaction = fragmentManager.beginTransaction(); // set enter / exit animation final int layoutDirection = getResources().getConfiguration().getLayoutDirection(); newFragment.setEnterTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.START, layoutDirection))); newFragment.setExitTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.END, layoutDirection))); transaction.addToBackStack("ArtworkSettingsFragment"); transaction.replace(R.id.fragment_container, newFragment); // Commit the transaction transaction.commit(); }
Example #11
Source File: OdysseyMainActivity.java From odyssey with GNU General Public License v3.0 | 6 votes |
@Override public void onPlaylistFileSelected(String name, String path) { // Create fragment and give it an argument for the selected playlist PlaylistTracksFragment newFragment = PlaylistTracksFragment.newInstance(name, path); FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); // set enter / exit animation final int layoutDirection = getResources().getConfiguration().getLayoutDirection(); newFragment.setEnterTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.START, layoutDirection))); newFragment.setExitTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.END, layoutDirection))); // Replace whatever is in the fragment_container view with this // fragment, // and add the transaction to the back stack so the user can navigate // back transaction.replace(R.id.fragment_container, newFragment); transaction.addToBackStack("PlaylistTracksFragment"); // Commit the transaction transaction.commit(); }
Example #12
Source File: OdysseyMainActivity.java From odyssey with GNU General Public License v3.0 | 6 votes |
@Override public void onPlaylistSelected(String playlistTitle, long playlistID) { // Create fragment and give it an argument for the selected playlist PlaylistTracksFragment newFragment = PlaylistTracksFragment.newInstance(playlistTitle, playlistID); FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); // set enter / exit animation final int layoutDirection = getResources().getConfiguration().getLayoutDirection(); newFragment.setEnterTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.START, layoutDirection))); newFragment.setExitTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.END, layoutDirection))); // Replace whatever is in the fragment_container view with this // fragment, // and add the transaction to the back stack so the user can navigate // back transaction.replace(R.id.fragment_container, newFragment); transaction.addToBackStack("PlaylistTracksFragment"); // Commit the transaction transaction.commit(); }
Example #13
Source File: OdysseyMainActivity.java From odyssey with GNU General Public License v3.0 | 6 votes |
private void onDirectorySelected(final String dirPath, final boolean isRootDirectory, final boolean addToBackStack) { // Create fragment and give it an argument for the selected directory final FilesFragment newFragment = FilesFragment.newInstance(dirPath, isRootDirectory); final FragmentManager fragmentManager = getSupportFragmentManager(); final FragmentTransaction transaction = fragmentManager.beginTransaction(); if (!isRootDirectory) { // no root directory so set a enter / exit transition final int layoutDirection = getResources().getConfiguration().getLayoutDirection(); newFragment.setEnterTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.START, layoutDirection))); newFragment.setExitTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.END, layoutDirection))); } transaction.replace(R.id.fragment_container, newFragment); if (!isRootDirectory && addToBackStack) { // add fragment only to the backstack if it's not a root directory transaction.addToBackStack("FilesFragment"); } // Commit the transaction transaction.commit(); }
Example #14
Source File: OdysseyMainActivity.java From odyssey with GNU General Public License v3.0 | 6 votes |
@Override public void onAlbumSelected(AlbumModel album, Bitmap bitmap) { // Create fragment and give it an argument for the selected article AlbumTracksFragment newFragment = AlbumTracksFragment.newInstance(album, bitmap); FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); // set enter / exit animation newFragment.setEnterTransition(new Slide(Gravity.BOTTOM)); newFragment.setExitTransition(new Slide(Gravity.TOP)); // Replace whatever is in the fragment_container view with this // fragment, // and add the transaction to the back stack so the user can navigate // back transaction.replace(R.id.fragment_container, newFragment); transaction.addToBackStack("AlbumTracksFragment"); // Commit the transaction transaction.commit(); }
Example #15
Source File: OdysseyMainActivity.java From odyssey with GNU General Public License v3.0 | 6 votes |
@Override public void onArtistSelected(ArtistModel artist, Bitmap bitmap) { // Create fragment and give it an argument for the selected article ArtistAlbumsFragment newFragment = ArtistAlbumsFragment.newInstance(artist, bitmap); FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); // set enter / exit animation newFragment.setEnterTransition(new Slide(Gravity.BOTTOM)); newFragment.setExitTransition(new Slide(Gravity.TOP)); // Replace whatever is in the fragment_container view with this // fragment, // and add the transaction to the back stack so the user can navigate // back transaction.replace(R.id.fragment_container, newFragment); transaction.addToBackStack("ArtistFragment"); // Commit the transaction transaction.commit(); }
Example #16
Source File: SampleTransitionAnimationProvider.java From Alligator with MIT License | 6 votes |
@SuppressLint("RtlHardcoded") private TransitionAnimation createSlideAnimation(boolean forward, AnimationData animationData) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Transition enterTransition = forward ? new Slide(Gravity.RIGHT) : new Slide(Gravity.LEFT); Transition exitTransition = forward ? new Slide(Gravity.LEFT) : new Slide(Gravity.RIGHT); LollipopTransitionAnimation animation = new LollipopTransitionAnimation(enterTransition, exitTransition); animation.setAllowEnterTransitionOverlap(false); Fragment currentFragment = mActivity.getSupportFragmentManager().findFragmentById(R.id.fragment_container); if (currentFragment instanceof SharedElementProvider) { SharedElementProvider sharedElementProvider = (SharedElementProvider) currentFragment; View sharedElement = sharedElementProvider.getSharedElement(animationData); String shareElementName = sharedElementProvider.getSharedElementName(animationData); animation.addSharedElement(sharedElement, shareElementName); Transition moveTransition = TransitionInflater.from(mActivity).inflateTransition(android.R.transition.move); moveTransition.setDuration(600); animation.setSharedElementTransition(moveTransition); } return animation; } else { int enterAnimRes = forward ? R.anim.slide_in_right : R.anim.slide_in_left; int exitAnimRes = forward ? R.anim.slide_out_left : R.anim.slide_out_right; return new SimpleTransitionAnimation(enterAnimRes, exitAnimRes); } }
Example #17
Source File: LiveStreamActivity.java From Pocket-Plays-for-Twitch with GNU General Public License v3.0 | 6 votes |
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) private TransitionSet constructTransitions() { int[] slideTargets = {R.id.ChatRecyclerView, R.id.chat_input, R.id.chat_input_divider}; Transition slideTransition = new Slide(Gravity.BOTTOM); Transition fadeTransition = new Fade(); for (int slideTarget : slideTargets) { slideTransition.addTarget(slideTarget); fadeTransition.excludeTarget(slideTarget, true); } TransitionSet set = new TransitionSet(); set.addTransition(slideTransition); set.addTransition(fadeTransition); return set; }
Example #18
Source File: DetailActivity.java From animation-samples with Apache License 2.0 | 6 votes |
@Override protected void onCreate(Bundle savedInstanceState) { setContentView(R.layout.activity_detail); postponeEnterTransition(); TransitionSet transitions = new TransitionSet(); Slide slide = new Slide(Gravity.BOTTOM); slide.setInterpolator(AnimationUtils.loadInterpolator(this, android.R.interpolator.linear_out_slow_in)); slide.setDuration(getResources().getInteger(android.R.integer.config_shortAnimTime)); transitions.addTransition(slide); transitions.addTransition(new Fade()); getWindow().setEnterTransition(transitions); Intent intent = getIntent(); sharedElementCallback = new DetailSharedElementEnterCallback(intent); setEnterSharedElementCallback(sharedElementCallback); initialItem = intent.getIntExtra(IntentUtil.SELECTED_ITEM_POSITION, 0); setUpViewPager(intent.<Photo>getParcelableArrayListExtra(IntentUtil.PHOTO)); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); toolbar.setNavigationOnClickListener(navigationOnClickListener); super.onCreate(savedInstanceState); }
Example #19
Source File: FragmentSelect.java From imageres_resolution with MIT License | 6 votes |
private void switchToPreview(Uri uri) { Fragment fragment = FragmentPreview.instance(uri); if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) { int duration = getResources().getInteger(android.R.integer.config_mediumAnimTime); Slide slideTransition = new Slide(Gravity.LEFT); slideTransition.setDuration(duration); setExitTransition(slideTransition); Slide slideTransition2 = new Slide(Gravity.RIGHT); slideTransition2.setDuration(duration); fragment.setEnterTransition(slideTransition2); TransitionInflater inflater = TransitionInflater.from(getContext()); Transition transition = inflater.inflateTransition(R.transition.transition_default); fragment.setSharedElementEnterTransition(transition); } getFragmentManager() .beginTransaction() .replace(R.id.frg_docker, fragment) .addSharedElement(mBtnFindWrapper, ViewCompat.getTransitionName(mBtnFindWrapper)) .addToBackStack("select") .commitAllowingStateLoss(); }
Example #20
Source File: MainActivity.java From Study_Android_Demo with Apache License 2.0 | 5 votes |
private void setupWindowAnimations() { Slide slide = new Slide(); slide.setSlideEdge(Gravity.LEFT); slide.setDuration(1000); getWindow().setReenterTransition(slide); getWindow().setExitTransition(slide); }
Example #21
Source File: SlidingAnimationActivity.java From AndroidDemoProjects with Apache License 2.0 | 5 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS); getWindow().setEnterTransition( new Slide() ); getWindow().setExitTransition( new Slide() ); setContentView(R.layout.activity_sliding_animation); }
Example #22
Source File: MovieDetailsActivity.java From AndroidSchool with Apache License 2.0 | 5 votes |
private void prepareWindowForAnimation() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Slide transition = new Slide(); transition.excludeTarget(android.R.id.statusBarBackground, true); getWindow().setStatusBarColor(Color.TRANSPARENT); getWindow().setEnterTransition(transition); getWindow().setReturnTransition(transition); } }
Example #23
Source File: MovieDetailsActivity.java From AndroidSchool with Apache License 2.0 | 5 votes |
private void prepareTransition() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Slide transition = new Slide(); transition.excludeTarget(android.R.id.statusBarBackground, true); getWindow().setStatusBarColor(Color.TRANSPARENT); getWindow().setEnterTransition(transition); getWindow().setReturnTransition(transition); } }
Example #24
Source File: MovieDetailsActivity.java From AndroidSchool with Apache License 2.0 | 5 votes |
private void prepareWindowForAnimation() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Slide transition = new Slide(); transition.excludeTarget(android.R.id.statusBarBackground, true); getWindow().setStatusBarColor(Color.TRANSPARENT); getWindow().setEnterTransition(transition); getWindow().setReturnTransition(transition); } }
Example #25
Source File: MovieDetailsActivity.java From AndroidSchool with Apache License 2.0 | 5 votes |
private void prepareWindowForAnimation() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Slide transition = new Slide(); transition.excludeTarget(android.R.id.statusBarBackground, true); getWindow().setStatusBarColor(Color.TRANSPARENT); getWindow().setEnterTransition(transition); getWindow().setReturnTransition(transition); } }
Example #26
Source File: OfflineDownloadBaseActivity.java From HHComicViewer with Apache License 2.0 | 5 votes |
@TargetApi(Build.VERSION_CODES.LOLLIPOP) protected Visibility buildEnterTransition() { Slide enterTransition = new Slide(); enterTransition.setDuration(getResources().getInteger(R.integer.anim_duration_medium)); enterTransition.setSlideEdge(Gravity.RIGHT); //从右边滑动进入 return enterTransition; }
Example #27
Source File: PlayActivity.java From Yuan-SxMusic with Apache License 2.0 | 5 votes |
@Override protected void initView() { super.initView(); EventBus.getDefault().register(this); CommonUtil.hideStatusBar(this, true); //设置进入退出动画 getWindow().setEnterTransition(new Slide()); getWindow().setExitTransition(new Slide()); //判断播放状态 mPlayStatus = getIntent().getIntExtra(Constant.PLAYER_STATUS, 2); //绑定服务,播放和下载的服务 Intent playIntent = new Intent(PlayActivity.this, PlayerService.class); Intent downIntent = new Intent(PlayActivity.this, DownloadService.class); bindService(playIntent, mPlayConnection, Context.BIND_AUTO_CREATE); bindService(downIntent, mDownloadConnection, Context.BIND_AUTO_CREATE); //界面填充 mSong = FileUtil.getSong(); mListType = mSong.getListType(); mSingerTv.setText(mSong.getSinger()); mSongTv.setText(mSong.getSongName()); mCurrentTimeTv.setText(MediaUtil.formatTime(mSong.getCurrentTime())); mSeekBar.setMax((int) mSong.getDuration()); mSeekBar.setProgress((int) mSong.getCurrentTime()); mDownLoadIv.setVisibility(mSong.isOnline() ? View.VISIBLE : View.GONE); //下载按钮是否隐藏 mDownLoadIv.setImageDrawable(mSong.isDownload() ? getDrawable(R.drawable.downloaded) : getDrawable(R.drawable.download_song)); mPlayMode = mPresenter.getPlayMode();//得到播放模式 if (mPlayMode == Constant.PLAY_ORDER) { mPlayModeBtn.setBackground(getDrawable(R.drawable.play_mode_order)); } else if (mPlayMode == Constant.PLAY_RANDOM) { mPlayModeBtn.setBackground(getDrawable(R.drawable.play_mode_random)); } else { mPlayModeBtn.setBackground(getDrawable(R.drawable.play_mode_single)); } }
Example #28
Source File: MainActivity.java From Android-Animation-Set with Apache License 2.0 | 5 votes |
private void setupWindowAnimations() { Slide slide = new Slide(); slide.setSlideEdge(Gravity.LEFT); slide.setDuration(1000); getWindow().setReenterTransition(slide); getWindow().setExitTransition(slide); }
Example #29
Source File: DetailActivity.java From MaterializeYourApp with Apache License 2.0 | 5 votes |
private void initActivityTransitions() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Slide transition = new Slide(); transition.excludeTarget(android.R.id.statusBarBackground, true); getWindow().setEnterTransition(transition); getWindow().setReturnTransition(transition); } }
Example #30
Source File: ViewActivity.java From recurrence with GNU General Public License v3.0 | 5 votes |
public void setupTransitions() { // Add shared element transition animation if on Lollipop or later if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { // Enter transitions TransitionSet setEnter = new TransitionSet(); Transition slideDown = new Explode(); slideDown.addTarget(headerView); slideDown.excludeTarget(scrollView, true); slideDown.setDuration(500); setEnter.addTransition(slideDown); Transition fadeOut = new Slide(Gravity.BOTTOM); fadeOut.addTarget(scrollView); fadeOut.setDuration(500); setEnter.addTransition(fadeOut); // Exit transitions TransitionSet setExit = new TransitionSet(); Transition slideDown2 = new Explode(); slideDown2.addTarget(headerView); slideDown2.setDuration(570); setExit.addTransition(slideDown2); Transition fadeOut2 = new Slide(Gravity.BOTTOM); fadeOut2.addTarget(scrollView); fadeOut2.setDuration(280); setExit.addTransition(fadeOut2); getWindow().setEnterTransition(setEnter); getWindow().setReturnTransition(setExit); } }