Search in sources :

Example 21 with Slide

use of android.transition.Slide in project Material-Animations by lgvalle.

the class SharedElementActivity method setupLayout.

private void setupLayout(Sample sample) {
    // Transition for fragment1
    Slide slideTransition = new Slide(Gravity.LEFT);
    slideTransition.setDuration(getResources().getInteger(R.integer.anim_duration_long));
    // Create fragment and define some of it transitions
    SharedElementFragment1 sharedElementFragment1 = SharedElementFragment1.newInstance(sample);
    sharedElementFragment1.setReenterTransition(slideTransition);
    sharedElementFragment1.setExitTransition(slideTransition);
    sharedElementFragment1.setSharedElementEnterTransition(new ChangeBounds());
    getSupportFragmentManager().beginTransaction().replace(R.id.sample2_content, sharedElementFragment1).commit();
}
Also used : Slide(android.transition.Slide) ChangeBounds(android.transition.ChangeBounds)

Example 22 with Slide

use of android.transition.Slide in project Material-Animations by lgvalle.

the class SharedElementFragment1 method addNextFragment.

private void addNextFragment(Sample sample, ImageView squareBlue, boolean overlap) {
    SharedElementFragment2 sharedElementFragment2 = SharedElementFragment2.newInstance(sample);
    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));
    sharedElementFragment2.setEnterTransition(slideTransition);
    sharedElementFragment2.setAllowEnterTransitionOverlap(overlap);
    sharedElementFragment2.setAllowReturnTransitionOverlap(overlap);
    sharedElementFragment2.setSharedElementEnterTransition(changeBoundsTransition);
    getFragmentManager().beginTransaction().replace(R.id.sample2_content, sharedElementFragment2).addToBackStack(null).addSharedElement(squareBlue, getString(R.string.square_blue_name)).commit();
}
Also used : Slide(android.transition.Slide) ChangeBounds(android.transition.ChangeBounds)

Example 23 with Slide

use of android.transition.Slide in project atlas by alibaba.

the class DetailActivity method onCreate.

@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);
    try {
        initialItem = Integer.parseInt(intent.getData().getLastPathSegment());
    } catch (NumberFormatException e) {
        initialItem = 0;
    }
    PhotoService.getInstance().getPhotosAsync(new PhotoService.PhotoCallback() {

        @Override
        public void success(ArrayList<Photo> photos) {
            setUpViewPager(photos);
            findViewById(android.R.id.empty).setVisibility(View.GONE);
        }

        @Override
        public void error() {
            finishAfterTransition();
        }
    });
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    toolbar.setNavigationOnClickListener(navigationOnClickListener);
    super.onCreate(savedInstanceState);
}
Also used : DetailSharedElementEnterCallback(com.example.android.unsplash.ui.DetailSharedElementEnterCallback) TransitionSet(android.transition.TransitionSet) Slide(android.transition.Slide) PhotoService(com.example.android.unsplash.data.PhotoService) Intent(android.content.Intent) Photo(com.example.android.unsplash.data.model.Photo) Fade(android.transition.Fade) Toolbar(android.widget.Toolbar)

Example 24 with Slide

use of android.transition.Slide in project TicktockMusic by Lauzy.

the class FragmentAnimUtil method setEnterExitAnim.

public static void setEnterExitAnim(Fragment fragment) {
    Explode explode = new Explode();
    explode.setDuration(350);
    explode.setInterpolator(new DecelerateInterpolator());
    explode.setMode(Visibility.MODE_IN);
    Slide slide = new Slide();
    slide.setSlideEdge(Gravity.LEFT);
    slide.setDuration(200);
    Fade fade = new Fade();
    fade.setDuration(200);
    fragment.setReturnTransition(fade);
    fragment.setEnterTransition(explode);
    fragment.setSharedElementEnterTransition(new FragmentTransition());
    fragment.setSharedElementReturnTransition(new FragmentTransition());
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) Explode(android.transition.Explode) Slide(android.transition.Slide) Fade(android.transition.Fade)

Example 25 with Slide

use of android.transition.Slide in project malp by gateship-one.

the class MainActivity method onArtistSelected.

@Override
public void onArtistSelected(MPDArtist artist, Bitmap bitmap) {
    if (mNowPlayingDragStatus == DRAG_STATUS.DRAGGED_UP) {
        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();
        }
    }
    // 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);
    // Transfer the bitmap to the next fragment
    if (bitmap != null) {
        args.putParcelable(AlbumsFragment.BUNDLE_STRING_EXTRA_BITMAP, bitmap);
    }
    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 = findViewById(R.id.nav_view);
    navigationView.setCheckedItem(R.id.nav_library);
    // Commit the transaction
    transaction.commit();
}
Also used : NowPlayingView(org.gateshipone.malp.application.views.NowPlayingView) NavigationView(android.support.design.widget.NavigationView) Slide(android.transition.Slide) Bundle(android.os.Bundle) AlbumsFragment(org.gateshipone.malp.application.fragments.serverfragments.AlbumsFragment) NavigationView(android.support.design.widget.NavigationView) ImageView(android.widget.ImageView) View(android.view.View) AdapterView(android.widget.AdapterView) CurrentPlaylistView(org.gateshipone.malp.application.views.CurrentPlaylistView) TextView(android.widget.TextView) NowPlayingView(org.gateshipone.malp.application.views.NowPlayingView) FragmentTransaction(android.support.v4.app.FragmentTransaction)

Aggregations

Slide (android.transition.Slide)32 View (android.view.View)11 Fade (android.transition.Fade)9 TextView (android.widget.TextView)9 FragmentTransaction (android.support.v4.app.FragmentTransaction)7 TransitionSet (android.transition.TransitionSet)7 Bundle (android.os.Bundle)6 ActionBar (android.support.v7.app.ActionBar)6 Transition (android.transition.Transition)5 Recolor (android.transition.Recolor)4 TransitionManager (android.transition.TransitionManager)4 ImageView (android.widget.ImageView)4 RequiresApi (android.support.annotation.RequiresApi)3 NavigationView (android.support.design.widget.NavigationView)3 Toolbar (android.support.v7.widget.Toolbar)3 ViewGroup (android.view.ViewGroup)3 ViewTreeObserver (android.view.ViewTreeObserver)3 WindowInsets (android.view.WindowInsets)3 AdapterView (android.widget.AdapterView)3 SwipeBackCoordinatorLayout (us.koller.cameraroll.ui.widget.SwipeBackCoordinatorLayout)3