- Notifications
You must be signed in to change notification settings - Fork9
Change Log library for Android API 21+
License
furkanakdemir/noticeboard
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
NoticeBoard is a changelog library for Android API 21+. It helps developers display the history of changes in their applications.
It shows a list ofRelease orUnRelease which contains a list ofChange.
It receives a source of changes and config.
You can find a sample code of NoticeBoard in this repository.
NoticeBoardSample app is now available on Google Play.
| ACTIVITY | DIALOG |
|---|---|
![]() | ![]() |
dependencies { implementation "net.furkanakdemir:noticeboard:1.1.0"}Thepin function is used to show a change log list. It receives a lambda to make clients config their noticeboards.
Default configs are the following:
TITLE: NoticeBoard
DISPLAY_IN: Activity
SOURCE_TYPE: Dynamic with empty list
NoticeBoard(this).pin {// configstitle(...)displayIn(...)colorProvider(...)source(...)}
this can beFragment orActivity
The title of a noticeboard can be set bytitle function.
NoticeBoard(this).pin {title("Release Notes")}
The tag of a noticeboard can be set bytag function.
It can be used to reset the number of noticeboard display after an update.
NoticeBoard(this).pin {tag(versionCode)}
NoticeBoard can be displayed in two ways.
| Display Options |
|---|
| ACTIVITY |
| DIALOG |
NoticeBoard(this).pin {displayIn(ACTIVITY)}
The show rule of a noticeboard can be set byshowRule function.
| Show Rules |
|---|
| Once |
| Always |
| Limited |
NoticeBoard(this).pin {showRule(Once)showRule(Always)showRule(Limited(3))}
A color provider can be passed to provide the change type backgrounds.
Override the default color provider
classCustomColorProvider(privatevalcontext:Context) :NoticeBoardColorProvider(context) {overridevarcolorAdded:Int =R.color.colorAccentoverridevarcolorChanged:Int =R.color.colorAccentoverridevarcolorDeprecated:Int =R.color.colorPrimaryoverridevarcolorRemoved:Int =R.color.colorPrimaryoverridevarcolorFixed:Int =R.color.colorPrimaryDarkoverridevarcolorSecurity:Int =R.color.colorPrimaryDarkoverridevarcolorDescriptionText =R.color.colorDescriptionCustomoverridevarcolorBackground:Int =R.color.colorBackgroundCustomoverridevarcolorTitleDialog:Int =R.color.colorTitleCustomoverridevarcolorTitleActivity:Int =R.color.colorTitleCustom}
Or ImplementColorProvider interface
classCustomColorProvider :ColorProvider {overridefungetChangeTypeBackgroundColor(changeType:ChangeType):Int { }overridefungetBackgroundColor():Int { }overridefungetDescriptionColor():Int { }overridefungetTitleColor(displayOptions:DisplayOptions):Int { }}
Finally, a custom color provider can be set bycolorProvider function.
valcustomColorProvider =CustomColorProvider(this)NoticeBoard(this).pin {colorProvider(customColorProvider)}
An unreleased section can be added to a noticeboard.
UnRelease can be created dynamically
or
released field can be set to false in JSON or XML file. (default: true)
The position of the unreleased section can be configured. (default: TOP)
| Position |
|---|
| TOP |
| BOTTOM |
| NONE |
IfTOP orBOTTOM is selected, all of the unreleased items are merged into one list.
IfNONE is selected, the items remains as it is.
NoticeBoard(this).pin {unreleasedPosition(BOTTOM)}
There are currently 6 built-in change types.
| Change Type | Enum |
|---|---|
| ADDED | 0 |
| CHANGED | 1 |
| DEPRECATED | 2 |
| REMOVED | 3 |
| FIXED | 4 |
| SECURITY | 5 |
There are currently 3 data source types.
| Source |
|---|
| Dynamic |
| Json |
| Xml |
Save releases by creating dynamically
valchanges =listOf(Release("30 Sep 2019","1.0.0",listOf(Change("New Login Page",ADDED),Change("Toolbar in Checkout",CHANGED),Change("Old theme will be removed",DEPRECATED),Change("Tutorial page is removed",REMOVED),Change("Crash in Payment",FIXED),Change("HTTPS only requests",SECURITY) ) ) )NoticeBoard(this).pin {source(Dynamic(changes))}
Store releases by creating a json file to the/assets folder.
Here is an example of JSON file
[ {"date":"30 Sep 2019","version":"1.0.0","released":true,"changes": [ {"type":0,"description":"New Login Page" }, {"type":1,"description":"Toolbar in Checkout" }, {"type":2,"description":"Old theme will be removed" }, {"type":3,"description":"Tutorial page is removed" }, {"type":4,"description":"Crash in Payment" }, {"type":5,"description":"HTTPS only requests" } ] }]valfilepath ="sample.json"NoticeBoard(this).pin {source(Json(filepath))}
Store releases by creating a xml file to the/assets folder.
Here is an example of XML file
<?xml version="1.0" encoding="UTF-8" ?><releases> <release> <date>30 Sep 2019</date> <version>1.0.0</version> <released>true</released> <change> <description>New Login Page</description> <type>0</type> </change> <change> <description>Toolbar in Checkout</description> <type>1</type> </change> <change> <description>Old theme will be removed</description> <type>2</type> </change> <change> <description>Tutorial page is removed</description> <type>3</type> </change> <change> <description>Crash in Payment</description> <type>4</type> </change> <change> <description>HTTPS only requests</description> <type>5</type> </change> </release></releases>
valfilepath ="sample.xml"NoticeBoard(this).pin {source(Xml(filepath))}
- Add
Known Issuessection support - Add a custom change types
- Add
MarkdownDataSourcesupport - Add remote data support
- Add a GOTO button
- New Date formats
If you've found an error in the library or sample, please file an issue.
Patches are encouraged, and may be submitted by forking this project and submitting a pull request.
If you contributed tonoticeboard but your name is not in the list, please feel free to add yourself to it!
- Furkan Akdemir - Maintainer
- Nuh Koca - Collaborator, CI Improvements
Copyright 2019 Furkan AkdemirLicensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.About
Change Log library for Android API 21+
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Contributors2
Uh oh!
There was an error while loading.Please reload this page.



