{"id":8040,"date":"2015-11-22T01:16:12","date_gmt":"2015-11-22T01:16:12","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2015\/11\/22\/custom-notification-layouts-and-text-colors-open-source-projects-mrmrs-colors\/"},"modified":"2022-08-30T15:03:03","modified_gmt":"2022-08-30T15:03:03","slug":"custom-notification-layouts-and-text-colors-open-source-projects-mrmrs-colors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2015\/11\/22\/custom-notification-layouts-and-text-colors-open-source-projects-mrmrs-colors\/","title":{"rendered":"Custom notification layouts and text colors-open source projects mrmrs\/colors"},"content":{"rendered":"<p>My application shows some notifications, and depending on user preferences it might use a custom layout in a notification. It works well, but there is a small problem &#8212; <strong>text colors<\/strong>. Stock Android and almost all manufacturer skins use black text against a light background for notification text, but Samsung doesn&#8217;t: their notification pulldown has a dark background and the text in the default notification layout is white.<\/p>\n<p>So this causes a problem: the notifications that don&#8217;t use any fancy layouts show up fine, but the one that uses a custom layout is hard to read because the text is black instead of the default white. Even the official documentation just sets a <code>#000<\/code> color for a <code>TextView<\/code>, so I couldn&#8217;t find any pointers there.<\/p>\n<p>A user was kind enough to take a screenshot of the problem:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/znPWN.jpg\" \/><\/p>\n<p>So <strong>how do I use the default notification text color from the device<\/strong> in my layouts? I&#8217;d rather not start dynamically altering the text color based on phone model, since that requires a lot of updating and people with custom ROM&#8217;s might still get the problem, depending on the skin they&#8217;re using.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My application shows some notifications, and depending on user preferences it might use a custom layout in a notification. It works well, but there is a small problem &#8212; text colors. Stock Android and almost all manufacturer skins use black text against a light background for notification text, but Samsung doesn&#8217;t: their notification pulldown has [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-8040","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/8040","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=8040"}],"version-history":[{"count":1,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/8040\/revisions"}],"predecessor-version":[{"id":8671,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/8040\/revisions\/8671"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=8040"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=8040"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=8040"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}