Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Change Log library for Android API 21+

License

NotificationsYou must be signed in to change notification settings

furkanakdemir/noticeboard

Repository files navigation

NoticeBoard

NoticeBoard

GitHubBintrayCodacyCircleCIMinAPI
Android Arsenal

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.

Screenshot

ACTIVITYDIALOG
ACTIVITYDIALOG

Download

dependencies {    implementation "net.furkanakdemir:noticeboard:1.1.0"}

Usage

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

Title

The title of a noticeboard can be set bytitle function.

NoticeBoard(this).pin {title("Release Notes")}

Tag

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)}

Display Options

NoticeBoard can be displayed in two ways.

Display Options
ACTIVITY
DIALOG
NoticeBoard(this).pin {displayIn(ACTIVITY)}

Show Rules

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))}

Color Provider

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)}

Unreleased Section

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)}

Change Types

There are currently 6 built-in change types.

Change TypeEnum
ADDED0
CHANGED1
DEPRECATED2
REMOVED3
FIXED4
SECURITY5

Source Types

There are currently 3 data source types.

Source
Dynamic
Json
Xml

Dynamic

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))}

Json

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))}

Xml

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))}

Upcoming

  1. AddKnown Issues section support
  2. Add a custom change types
  3. AddMarkdownDataSource support
  4. Add remote data support
  5. Add a GOTO button
  6. New Date formats

Contribution

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!

License

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

Stars

Watchers

Forks

Packages

No packages published

Contributors2

  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp