# ChangeLog Library Customization and Tips There are many ways you can customize the changelog view. * [Custom Header Layout](#custom-header-layout) * [Custom Row Layout](#custom-row-layout) * [Layouts with Material Specs](#layouts-with-material-specs) * [Custom ChangeLog XML](#custom-changeLog-xml) * [Bullet Point](#bullet-point) * [Html Text Markup](#html-text-markup) * [Customize Strings](#customize-strings) * [Use an url to download the changelog.xml file](#use-an-url-to-download-the-changelog.xml-file) * [Bug and improvement tags](#bug-and-improvement-tags) * [Emtpy view](#emtpy-view) The library uses a custom `RecyclerView` to display the changelog. If you would like to use a `ListView`, you have the same features changing the `it.gmariotti.changelibs.library.view.ChangeLogRecyclerView` with `it.gmariotti.changelibs.library.view.ChangeLogListView`. ### Custom Header Layout Library uses `res/layout/changelogrowheader_layout.xml` XML layout for each header.
You can use your own xml layout with `chg:rowHeaderLayoutId` attribute in `ChangeLogRecyclerView` element. ``` xml ``` The quickest way to start with this would be to copy the [`changelogrowheader_layout.xml`](/ChangeLogLibrary/src/main/res/layout-v14/changelogrowheader_layout.xml) layout resource file from this project into your own and modify its contents.
There's a specific set of views you need to have in your layout: 1. A `TextView` with the ID `chg_headerVersion` that display the Version Number 2. A `TextView` with the ID `chg_headerDate` that display the Version Date You can find an example in [`demo_changelogrowheader_layout.xml`](/ChangeLogDemo/src/main/res/layout/demo_changelogrowheader_layout.xml) ### Custom Row Layout Library uses `res/layout/changelogrow_layout.xml` XML layout for each row.
You can use your own xml layout with `chg:rowLayoutId` attribute in `ChangeLogRecyclerView` element. ``` xml ``` The quickest way to start with this would be to copy the [`changelogrow_layout.xml`](/ChangeLogLibrary/src/main/res/layout-v14/changelogrow_layout.xml) layout resource file from this project into your own and modify its contents.
There's a specific set of views you need to have in your layout: 1. A `TextView` with the ID `chg_textbullet` that display the bullet point 2. A `TextView` with the ID `chg_text` that display the actual text that will be displayed as a change in your List You can find an example in [`demo_changelogrow_layout.xml`](/ChangeLogDemo/src/main/res/layout/demo_changelogrow_layout.xml) ### Layouts with Material Specs Library contains also 2 layouts with **Material specs and metrics**: - [`res/layout/changelogrow_material_layout.xml`](/ChangeLogLibrary/src/main/res/layout-v14/changelogrow_material_layout.xml) l XML layout for each row. - [`res/layout/changelogrowheader_material_layout.xml`](/ChangeLogLibrary/src/main/res/layout-v14/changelogrowheader_material_layout.xml) l XML layout for each header. You can use them with a simple: ``` xml ``` You can find an example in [`demo_changelogrow_fragment_material.xml`](/ChangeLogDemo/src/main/res/layout/demo_changelog_fragment_material.xml) You can find a screenshot [here](/ChangeLogDemo/README.md#material-specs). ### Custom ChangeLog XML Library uses `res/raw/changelog.xml`. You can use your own file with `chg:changeLogFileResourceId` attribute in `ChangeLogRecyclerView` element. ``` xml ``` You can find an example in [`demo_changelogrow_fragment_customlayout.xml`](/ChangeLogDemo/src/main/res/layout/demo_changelog_fragment_customlayout.xml) ### Bullet Point The quickest way to customize this character is to specify this resource in your `strings.xml`. ``` xml \u2022" ``` If you don't want a bullet list you can specify it in `changelog.xml` file with `bulletedList="false"` attribute. ``` xml ..... ``` ### Html Text Markup You can use some html text markup as bold and italic in your changelog.xml ``` xml [b]New![/b] Add new attrs to customize header and row layout Fixed log while [i]parsing[/i] performance <b>improvement</b> .... ``` You can use: 1. `[b] text [/b]` for a bold style, or `<b> text </b>` 2. `[i] text [/i]` for an italic style, or `<b> text </i>` If you need a hiperlink you can obtain it with: ```xml Fixed a [a href="http://www.google.it"]number[/a] of bugs with the Gmail and SMS extensions ``` Of course you can use standard android notation: ```xml manual location for weather]]> New! Translations for Greek, Dutch and Brazilian Portuguese]]> ``` ### Customize Strings You can customize `Version` String in header.
The quickest way to customize this character is to specify this resource in your `strings.xml`. ``` xml "Revision " ``` Use string with quotes if you want a space. You can also customize other strings in the same way. See original `res/string.xml` in library. ### Use an url to download the changelog.xml file Library uses `res/raw/changelog.xml`. You can use a url link to download your xml file with `chg:changeLogFileResourceUrl` attribute in `ChangeLogRecyclerView` element. ``` xml ``` Pay attention: To use this feature you have to add these user-permissions to your app: ``` xml ``` ### Bug and improvement tags You can use 2 custom changelogtext tags that will pre-pend the change log text with **Bug:** and **New:** respectively. ``` xml [b]New![/b] Add new attrs to customize header and row layout Option to specify a manual location for weather performance <b>improvement</b> Fixed a number of bugs with the Gmail and SMS extensions ``` You can customize the prefix text in your project overriding these values in strings.xml ``` xml [b]Bug:[/b] [b]New:[/b] ``` You can use the same html text markup described [above](#Html-text-markup). For more detailed information and examples you can read this [document:](/ChangeLogDemo/README.md)