question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I’m doing this,it is not working for me,any pointers guys

@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        setEnterTransition();
        setExitTransition();
      
    }

    @TargetApi(21)
    private void setEnterTransition(){

        Fade fade_transition = new Fade();
        fade_transition.setDuration(1000);
        getWindow().setEnterTransition(fade_transition);
    }

    @TargetApi(21)
    private void setExitTransition(){

        Slide slide_transition = new Slide();
        slide_transition.setDuration(1000);
        getWindow().setExitTransition(slide_transition);
    }

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:5
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
Davids89commented, Apr 19, 2017

Hello @s1mar I think you have to start the activity with this code

ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(MainActivity.this);

startActivity(intent, options.toBundle());
1reaction
daleigecommented, Mar 31, 2020

I’m having the same issues,setExitTransition(Slide)not working,but the enter return and reenter is working

public class OneActivity extends AppCompatActivity implements View.OnClickListener {
    private Button mBack;
    private Button mNext;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_one);
        setupWindowAnimations();
        mBack = findViewById(R.id.btn_back);
        mNext = findViewById(R.id.btn_next);
        mBack.setOnClickListener(this);
        mNext.setOnClickListener(this);
    }

    private void setupWindowAnimations() {
        Slide enter = new Slide();
        enter.setDuration(DURATION);
        enter.setSlideEdge(Gravity.RIGHT);
        enter.setInterpolator(new DecelerateInterpolator());

        Slide exit = new Slide();
        exit.setDuration(DURATION);
        exit.setSlideEdge(Gravity.LEFT);
        exit.setInterpolator(new DecelerateInterpolator());

        Slide reenter = new Slide();
        reenter.setSlideEdge(Gravity.LEFT);
        reenter.setDuration(DURATION);
        reenter.setInterpolator(new DecelerateInterpolator());

        Slide returnT = new Slide();
        returnT.setDuration(DURATION);
        returnT.setSlideEdge(Gravity.RIGHT);
        returnT.setInterpolator(new DecelerateInterpolator());

        getWindow().setReenterTransition(reenter);
        getWindow().setEnterTransition(enter);
        getWindow().setReturnTransition(returnT);
        getWindow().setExitTransition(exit);
        getWindow().setAllowEnterTransitionOverlap(true);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn_back:
                finishAfterTransition();
                break;
            case R.id.btn_next:
                Intent i = new Intent(this, TowActivity.class);
                startActivity(i, ActivityOptionsCompat.makeSceneTransitionAnimation(this).toBundle());
                break;
            default:

        }
    }
}

please help me,thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

138 Synonyms & Antonyms for NOT WORKING - Thesaurus.com
synonyms for not working · baseless · false · inoperative · irrational · null · unreasonable · unscientific · unsound ...
Read more >
Working Not Working
Trusted by over 2000 of the world's most innovative companies to staff their creative projects.
Read more >
Not Working: Cohen, Josh - Amazon.com
'Not Working' is an excellent companion to existentialism or those reading that subject or the subject of work, its philosophy and stress caused...
Read more >
Not Working: Where Have All the Good Jobs Gone?
Not Working is about those who can't find full-time work at a decent wage—the underemployed—and how their plight is contributing to widespread ...
Read more >
Fix an installed Android app that isn't working - Google Support
Try the following steps if an app installed on your phone has any of these problems: Crashing. Won't open. Won't respond. Isn't working...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found