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.

How to add background color transition?

See original GitHub issue

I am trying to enable the background color transition, and this is my code:

public class AppIntro extends AppIntro2 implements ISlideBackgroundColorHolder
{

    @Override
    public int getDefaultBackgroundColor() {
        // Return the default background color of the slide.
        return Color.parseColor("#000000");
    }

    @Override
    public void setBackgroundColor(@ColorInt int backgroundColor) {
        // Set the background color of the view within your slide to which the transition should be applied.
        if (layoutContainer != null) {
            layoutContainer.setBackgroundColor(backgroundColor);
        }
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        showSkipButton(false);
        showStatusBar(false);
        addSlide(AppIntroFragment.newInstance("Hello", "world", R.drawable.bunny, Color.parseColor("#FFB300")));
        
    }

    @Override
    public void onSkipPressed(Fragment currentFragment) {
        super.onSkipPressed(currentFragment);
        finish();
    }

    @Override
    public void onDonePressed(Fragment currentFragment) {
        super.onDonePressed(currentFragment);
        finish();
    }
}

Now the issue is pretty small. ie I cannot resolve layoutContainer in Android Studio. What should I replace it with if I am using AppIntro2 ? I searched the entire repo for layoutContainer, however it is only seen in the readme file it seems.

Kindly help, 😃

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
NovaVipercommented, Feb 5, 2017

I found a way to enable the transition colors, you need to put the setColorTransitionsEnabled to true

0reactions
avluiscommented, Feb 5, 2017

@shaheenkdr Please close your own issues – no need to wait on us…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Transition of background-color - css - Stack Overflow
As far as I know, transitions currently work in Safari, Chrome, Firefox, Opera and Internet Explorer 10+. This should produce a fade effect ......
Read more >
transition | CSS-Tricks
Specifying which properties to transition. Notice that we've called out the background-color property in the transition declaration.
Read more >
How To - Transition on Hover - W3Schools
Learn how to add transition on hover with CSS. ... over a given duration. Add a transition effect (opacity and background color) to...
Read more >
Background Color Animation With CSS (Simple Examples)
Use CSS transition to progressively change the background color. <div id="demo">Demo</div> · Use CSS keyframes to specify a sequence of ...
Read more >
How to Add & Change Background Color in HTML
Scan your HTML code to pinpoint which element you'd like to change. If it's the header, look for the <header> opening tag. If...
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