List of usage examples for android.transition Slide Slide
public Slide(int slideEdge)
From source file:org.gateshipone.malp.application.activities.MainActivity.java
@Override public void onAlbumSelected(MPDAlbum album) { if (mNowPlayingDragStatus == DRAG_STATUS.DRAGGED_UP) { NowPlayingView nowPlayingView = (NowPlayingView) findViewById(R.id.now_playing_layout); if (nowPlayingView != null) { View coordinatorLayout = findViewById(R.id.main_coordinator_layout); coordinatorLayout.setVisibility(View.VISIBLE); nowPlayingView.minimize();// w w w.j a v a2 s. c o m } } // Create fragment and give it an argument for the selected article AlbumTracksFragment newFragment = new AlbumTracksFragment(); Bundle args = new Bundle(); args.putParcelable(AlbumTracksFragment.BUNDLE_STRING_EXTRA_ALBUM, album); newFragment.setArguments(args); android.support.v4.app.FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); // 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 newFragment.setEnterTransition(new Slide(Gravity.BOTTOM)); newFragment.setExitTransition(new Slide(Gravity.TOP)); transaction.replace(R.id.fragment_container, newFragment, AlbumTracksFragment.TAG); transaction.addToBackStack("AlbumTracksFragment"); NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); navigationView.setCheckedItem(R.id.nav_library); // Commit the transaction transaction.commit(); }
From source file:org.gateshipone.malp.application.activities.MainActivity.java
@Override public void onArtistSelected(MPDArtist artist) { if (mNowPlayingDragStatus == DRAG_STATUS.DRAGGED_UP) { NowPlayingView nowPlayingView = (NowPlayingView) findViewById(R.id.now_playing_layout); if (nowPlayingView != null) { View coordinatorLayout = findViewById(R.id.main_coordinator_layout); coordinatorLayout.setVisibility(View.VISIBLE); nowPlayingView.minimize();//from w ww . j a v a 2 s .c om } } // Create fragment and give it an argument for the selected article AlbumsFragment newFragment = new AlbumsFragment(); Bundle args = new Bundle(); args.putString(AlbumsFragment.BUNDLE_STRING_EXTRA_ARTISTNAME, artist.getArtistName()); args.putParcelable(AlbumsFragment.BUNDLE_STRING_EXTRA_ARTIST, artist); newFragment.setArguments(args); android.support.v4.app.FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); 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, AlbumsFragment.TAG); transaction.addToBackStack("ArtistAlbumsFragment"); NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); navigationView.setCheckedItem(R.id.nav_library); // Commit the transaction transaction.commit(); }
From source file:org.gateshipone.malp.application.activities.MainActivity.java
@Override public void editProfile(MPDServerProfile profile) { if (null == profile) { profile = new MPDServerProfile(getString(R.string.fragment_profile_default_name), true); addProfile(profile);//from w ww . j a v a 2 s . co m } // Create fragment and give it an argument for the selected article EditProfileFragment newFragment = new EditProfileFragment(); Bundle args = new Bundle(); if (null != profile) { args.putParcelable(EditProfileFragment.EXTRA_PROFILE, profile); } newFragment.setArguments(args); android.support.v4.app.FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); newFragment.setEnterTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.START, getResources().getConfiguration().getLayoutDirection()))); newFragment.setExitTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.END, getResources().getConfiguration().getLayoutDirection()))); // 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, EditProfileFragment.TAG); transaction.addToBackStack("EditProfileFragment"); // Commit the transaction transaction.commit(); }
From source file:org.gateshipone.malp.application.activities.MainActivity.java
@Override public void openPlaylist(String name) { // Create fragment and give it an argument for the selected article PlaylistTracksFragment newFragment = new PlaylistTracksFragment(); Bundle args = new Bundle(); args.putString(PlaylistTracksFragment.EXTRA_PLAYLIST_NAME, name); newFragment.setArguments(args);/*from ww w .j ava 2 s . c om*/ android.support.v4.app.FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); newFragment.setEnterTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.START, getResources().getConfiguration().getLayoutDirection()))); newFragment.setExitTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.END, getResources().getConfiguration().getLayoutDirection()))); // 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(); }
From source file:org.gateshipone.odyssey.activities.OdysseyMainActivity.java
@Override public void onArtistSelected(String artist, long artistID) { // Create fragment and give it an argument for the selected article ArtistAlbumsFragment newFragment = new ArtistAlbumsFragment(); Bundle args = new Bundle(); args.putString(ArtistAlbumsFragment.ARG_ARTISTNAME, artist); args.putLong(ArtistAlbumsFragment.ARG_ARTISTID, artistID); newFragment.setArguments(args);/* w w w .j a v a2 s.co m*/ android.support.v4.app.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(); }
From source file:org.gateshipone.odyssey.activities.OdysseyMainActivity.java
@Override public void onAlbumSelected(String albumKey, String albumTitle, String albumArtURL, String artistName) { // Create fragment and give it an argument for the selected article AlbumTracksFragment newFragment = new AlbumTracksFragment(); Bundle args = new Bundle(); args.putString(AlbumTracksFragment.ARG_ALBUMKEY, albumKey); args.putString(AlbumTracksFragment.ARG_ALBUMTITLE, albumTitle); args.putString(AlbumTracksFragment.ARG_ALBUMART, albumArtURL); args.putString(AlbumTracksFragment.ARG_ALBUMARTIST, artistName); newFragment.setArguments(args);//from ww w .j a va 2 s . c om android.support.v4.app.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(); }
From source file:org.gateshipone.odyssey.activities.OdysseyMainActivity.java
@Override public void onDirectorySelected(String dirPath, boolean isRootDirectory) { // Create fragment and give it an argument for the selected directory FilesFragment newFragment = new FilesFragment(); Bundle args = new Bundle(); args.putString(FilesFragment.ARG_DIRECTORYPATH, dirPath); args.putBoolean(FilesFragment.ARG_ISROOTDIRECTORY, isRootDirectory); newFragment.setArguments(args);//from ww w. j a v a 2 s . c o m FragmentManager fragmentManager = getSupportFragmentManager(); android.support.v4.app.FragmentTransaction transaction = fragmentManager.beginTransaction(); if (!isRootDirectory) { // no root directory so set a enter / exit transition newFragment.setEnterTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.START, getResources().getConfiguration().getLayoutDirection()))); newFragment.setExitTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.END, getResources().getConfiguration().getLayoutDirection()))); } transaction.replace(R.id.fragment_container, newFragment); // Commit the transaction transaction.commit(); }
From source file:org.gateshipone.malp.application.activities.MainActivity.java
@Override public void openPath(String path) { // Create fragment and give it an argument for the selected directory FilesFragment newFragment = new FilesFragment(); Bundle args = new Bundle(); args.putString(FilesFragment.EXTRA_FILENAME, path); newFragment.setArguments(args);// ww w .jav a2s . c om FragmentManager fragmentManager = getSupportFragmentManager(); android.support.v4.app.FragmentTransaction transaction = fragmentManager.beginTransaction(); newFragment.setEnterTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.START, getResources().getConfiguration().getLayoutDirection()))); newFragment.setExitTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.END, getResources().getConfiguration().getLayoutDirection()))); transaction.addToBackStack("FilesFragment" + path); transaction.replace(R.id.fragment_container, newFragment); // Commit the transaction transaction.commit(); }
From source file:nu.yona.app.ui.YonaActivity.java
private void profileIcon() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Slide slideTransition = new Slide(Gravity.RIGHT); slideTransition.setDuration(getResources().getInteger(R.integer.anim_duration_medium)); ChangeBounds changeBoundsTransition = new ChangeBounds(); changeBoundsTransition.setDuration(getResources().getInteger(R.integer.anim_duration_medium)); mContent.setEnterTransition(slideTransition); mContent.setAllowEnterTransitionOverlap(true); mContent.setAllowReturnTransitionOverlap(true); mContent.setSharedElementEnterTransition(changeBoundsTransition); }/*from w w w. j ava 2 s. co m*/ }
From source file:org.gateshipone.odyssey.activities.OdysseyMainActivity.java
@Override public void onPlaylistSelected(String playlistTitle, long playlistID) { // Create fragment and give it an argument for the selected playlist PlaylistTracksFragment newFragment = new PlaylistTracksFragment(); Bundle args = new Bundle(); args.putString(PlaylistTracksFragment.ARG_PLAYLISTTITLE, playlistTitle); args.putLong(PlaylistTracksFragment.ARG_PLAYLISTID, playlistID); newFragment.setArguments(args);/*from w w w . j ava 2 s.c om*/ android.support.v4.app.FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); // set enter / exit animation newFragment.setEnterTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.START, getResources().getConfiguration().getLayoutDirection()))); newFragment.setExitTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.END, getResources().getConfiguration().getLayoutDirection()))); // 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(); }