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.

AppIntroFragment.newInstance() not using background color passed in

See original GitHub issue

In CustomIntro.java you have

addSlide(AppIntroFragment.newInstance("Title here", "Description here...\nYeah, I've added this fragment programmatically",
            R.drawable.ic_slide1, R.color.material_blue_grey_800));

but the color you passed in is not being used for the background. I have tried this in my own app and the color I pass int still doesn’t work either. I am on nexus 5 emulator running API 21.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Jul 29, 2015

Have you tried passing the resolved color? (Context.getResources().getColor(int))

In the code you provided you pass the resource reference into AppIntroFragment.newInstance(String, String, int, int). I think it is shown wrong in the sample app. Internally the color is set with View.setBackgroundColor(int) which takes a resolved int for the color but the compiler doesn’t complain because the reference to a color resource is an int as well.

0reactions
paolorotolocommented, Jul 30, 2015

Ah, @porokoro I got it now :
I thought #374745 was the right color (material_blue_grey).

Anyway, thank you all. Closing…

Read more comments on GitHub >

github_iconTop Results From Across the Web

AppIntroFragment.newInstance() not using background color ...
Hi @rajohns08, I can't reproduce this bug on my emulator/device. Try to pass "Color.parseColor("#FFFFFF")" as parameter: is the background white ...
Read more >
Unable to change background color of a fragment
If i remove android:background from xml - fragment, this code works but not with color. java · android · android-fragments · Share.
Read more >
Print background color or image - Microsoft Support
Under Printing Options select Print background colors and images. The Print background colors and images check box in the Word options dialog box....
Read more >
Can't work out a way to set background color for a new build in ...
UnityLoader.instantiate appears to overwrite the style set on the game div with a background color (#222C36) it's pulling from mygame.json ...
Read more >
background-color - CSS: Cascading Style Sheets | MDN
Color contrast ratio is determined by comparing the luminance of the text and background color values. In order to meet current Web Content ......
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