Comments (1)
For anyone looking to implement dark theme support right now, it's already possible (and quite easy) to do so by using a custom ColorProvider.
Example:
class CustomColorProvider : ColorProvider {
override fun getChangeTypeBackgroundColor(changeType: ChangeType): Int {
return when(changeType) {
UNRELEASED -> { R.color.colorChangelogUnreleased }
ADDED -> { R.color.colorChangelogAdded }
CHANGED -> { R.color.colorChangelogChanged }
DEPRECATED -> { R.color.colorChangelogDeprecated }
REMOVED -> { R.color.colorChangelogRemoved }
FIXED -> { R.color.colorChangelogFixed }
SECURITY -> { R.color.colorChangelogSecurity }
}
}
override fun getBackgroundColor(): Int {
return R.color.colorElevatedBackground
}
override fun getDescriptionColor(): Int {
return R.color.colorOnSurface
}
override fun getTitleColor(displayOptions: DisplayOptions): Int {
return R.color.colorOnSurface
}
}
In values\colors.xml
:
<!-- Changelog -->
<color name="colorChangelogUnreleased">#9797A1</color>
<color name="colorChangelogAdded">#58B119</color>
<color name="colorChangelogChanged">#10BDEA</color>
<color name="colorChangelogDeprecated">#E77336</color>
<color name="colorChangelogRemoved">@color/colorElevatedBackground</color>
<color name="colorChangelogFixed">#CB165B</color>
<color name="colorChangelogSecurity">#FF00BD</color>
<color name="colorElevatedBackground">#FFFFFF</color>
<color name="colorOnSurface">#DE000000</color>
In the night
version of your colors.xml
values:
<!-- Changelog -->
<color name="colorChangelogUnreleased">#333337</color>
<color name="colorChangelogAdded">#265406</color>
<color name="colorChangelogChanged">#013949</color>
<color name="colorChangelogDeprecated">#773817</color>
<color name="colorChangelogRemoved">@color/colorElevatedBackground</color>
<color name="colorChangelogFixed">#6A062C</color>
<color name="colorChangelogSecurity">#8F0068</color>
<color name="colorElevatedBackground">#37383b</color>
<color name="colorElevatedBackground">#37383b</color>
Of course you're free to use any colors you'd like.
Finally:
NoticeBoard(this).pin {
// other attributes...
colorProvider(CustomColorProvider())
// other attributes...
}
from noticeboard.
Related Issues (14)
- Add Unreleased support
- Add Unknown Issues support
- Add showing rules
- Add a custom change types
- Add Markdown as a datasource
- Add remote file support
- Add GOTO button
- Enhance Color API
- Add more date formats
- Add translations
- Add Empty and Error images
- Customizable Margin/Padding HOT 2
- IllegalStateException (R.id.versionTextView) must not be null HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from noticeboard.