Skip to content
This repository was archived by the owner on Nov 1, 2022. It is now read-only.

Commit 5fe99a8

Browse files
jonalmeidaAmejia481
authored andcommitted
Correct changelog formatting
1 parent 9e8dc31 commit 5fe99a8

File tree

1 file changed

+57
-54
lines changed

1 file changed

+57
-54
lines changed

docs/changelog.md

Lines changed: 57 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -33,73 +33,76 @@ permalink: /changelog/
3333
```
3434
* Added new toolbar APIs:
3535
```kotlin
36+
val toolbar = BrowserToolbar(context)
3637
toolbar.textColor: Int = getColor(R.color.photonRed50)
3738
toolbar.hintColor: Int = getColor(R.color.photonGreen50)
3839
toolbar.textSize: Float = 12f
3940
toolbar.typeface: Typeface = Typeface.createFromFile("fonts/foo.tff")
4041
```
41-
These attributes are also available in XML (except for typeface):
42-
```xml
43-
<mozilla.components.browser.toolbar.BrowserToolbar
44-
android:id="@+id/toolbar"
45-
app:browserToolbarTextColor="#ff0000"
46-
app:browserToolbarHintColor="#00ff00"
47-
app:browserToolbarTextSize="12sp"
48-
android:layout_width="match_parent"
49-
android:layout_height="wrap_content"/>
50-
```
51-
* [Api improvement](https://github.com/mozilla-mobile/android-components/issues/772) for more flexibility to create a `BrowserToolbar.Button`,
42+
These attributes are also available in XML (except for typeface):
43+
44+
```xml
45+
<mozilla.components.browser.toolbar.BrowserToolbar
46+
android:id="@+id/toolbar"
47+
app:browserToolbarTextColor="#ff0000"
48+
app:browserToolbarHintColor="#00ff00"
49+
app:browserToolbarTextSize="12sp"
50+
android:layout_width="match_parent"
51+
android:layout_height="wrap_content"/>
52+
```
53+
54+
* [API improvement](https://github.com/mozilla-mobile/android-components/issues/772) for more flexibility to create a `BrowserToolbar.Button`,
5255
and `BrowserToolbar.ToggleButton`, now you can provide a custom padding:
5356
```kotlin
54-
val padding = Padding(start = 16, top = 16, end = 16, bottom = 16)
55-
val button = BrowserToolbar.Button(mozac_ic_back, "Forward", padding = padding) {}
56-
var toggle = BrowserToolbar.ToggleButton(mozac_ic_pin, mozac_ic_pin_filled, "Pin", "Unpin", padding = padding) {}
57+
val padding = Padding(start = 16, top = 16, end = 16, bottom = 16)
58+
val button = BrowserToolbar.Button(mozac_ic_back, "Forward", padding = padding) {}
59+
var toggle = BrowserToolbar.ToggleButton(mozac_ic_pin, mozac_ic_pin_filled, "Pin", "Unpin", padding = padding) {}
5760
```
5861
* **concept-toolbar**:
59-
* [Api improvement](https://github.com/mozilla-mobile/android-components/issues/772) for more flexibility to create a `Toolbar.ActionToggleButton`,
62+
* [API improvement](https://github.com/mozilla-mobile/android-components/issues/772) for more flexibility to create a `Toolbar.ActionToggleButton`,
6063
`Toolbar.ActionButton`, `Toolbar.ActionSpace` and `Toolbar.ActionImage`, now you can provide a custom padding:
6164
```kotlin
62-
val padding = Padding(start = 16, top = 16, end = 16, bottom = 16)
63-
var toggle = Toolbar.ActionToggleButton(0, mozac_ic_pin_filled, "Pin", "Unpin", padding = padding) {}
64-
val button = Toolbar.ActionButton(mozac_ic_back, "Forward", padding = padding) {}
65-
val space = Toolbar.ActionSpace(pxToDp(128), padding = padding)
66-
val image = Toolbar.ActionImage(brand, padding = padding)
65+
val padding = Padding(start = 16, top = 16, end = 16, bottom = 16)
66+
var toggle = Toolbar.ActionToggleButton(0, mozac_ic_pin_filled, "Pin", "Unpin", padding = padding) {}
67+
val button = Toolbar.ActionButton(mozac_ic_back, "Forward", padding = padding) {}
68+
val space = Toolbar.ActionSpace(pxToDp(128), padding = padding)
69+
val image = Toolbar.ActionImage(brand, padding = padding)
6770
```
6871
* **support-base**:
6972
* A new class add for representing an Android Padding.
7073
```kotlin
71-
val padding = Padding(16, 24, 32, 40)
72-
val (start, top, end, bottom) = padding
74+
val padding = Padding(16, 24, 32, 40)
75+
val (start, top, end, bottom) = padding
7376
```
7477
* **support-ktx**:
7578
* A new extention function that allows you to set `Padding` object to a `View`.
7679
```kotlin
77-
val padding = Padding(16, 24, 32, 40)
78-
val view = View(context)
79-
view.setPadding(padding)
80+
val padding = Padding(16, 24, 32, 40)
81+
val view = View(context)
82+
view.setPadding(padding)
8083
```
8184
* **concept-engine**, **browser-engine-system**, **browser-engine-gecko(-beta/nightly)**
8285
* `RequestInterceptor` was enhanced to support loading an alternative URL.
8386
:warning: **This is a breaking change for the `RequestInterceptor` method signature!**
8487
```kotlin
85-
// To provide alternative content the new InterceptionResponse.Content type needs to be used
86-
requestInterceptor = object : RequestInterceptor {
87-
override fun onLoadRequest(session: EngineSession, uri: String): InterceptionResponse? {
88-
return when (uri) {
89-
"sample:about" -> InterceptionResponse.Content("<h1>I am the sample browser</h1>")
90-
else -> null
91-
}
92-
}
88+
// To provide alternative content the new InterceptionResponse.Content type needs to be used
89+
requestInterceptor = object : RequestInterceptor {
90+
override fun onLoadRequest(session: EngineSession, uri: String): InterceptionResponse? {
91+
return when (uri) {
92+
"sample:about" -> InterceptionResponse.Content("<h1>I am the sample browser</h1>")
93+
else -> null
9394
}
94-
// To provide an alternative URL the new InterceptionResponse.Url type needs to be used
95-
requestInterceptor = object : RequestInterceptor {
96-
override fun onLoadRequest(session: EngineSession, uri: String): InterceptionResponse? {
97-
return when (uri) {
98-
"sample:about" -> InterceptionResponse.Url("sample:aboutNew")
99-
else -> null
100-
}
101-
}
102-
}
95+
}
96+
}
97+
// To provide an alternative URL the new InterceptionResponse.Url type needs to be used
98+
requestInterceptor = object : RequestInterceptor {
99+
override fun onLoadRequest(session: EngineSession, uri: String): InterceptionResponse? {
100+
return when (uri) {
101+
"sample:about" -> InterceptionResponse.Url("sample:aboutNew")
102+
else -> null
103+
}
104+
}
105+
}
103106
```
104107
* **concept-storage**:
105108
* Added a new concept for describing an interface for storing browser data. First iteration includes a description of `HistoryStorage`.
@@ -110,27 +113,27 @@ permalink: /changelog/
110113
Before adding a first session to the engine, initialize the history tracking feature:
111114
```kotlin
112115
val historyTrackingFeature = HistoryTrackingFeature(
113-
components.engine,
114-
components.historyStorage
116+
components.engine,
117+
components.historyStorage
115118
)
116119
```
117120
Once the feature has been initialized, history will be tracked for all subsequently added sessions.
118121
* **sample-browser**:
119122
* Updated the sample browser to track browsing history using an in-memory history storage implementation (how much is actually tracked in practice depends on which engine is being used. As of this release, only `SystemEngine` provides a full set of necessary APIs).
120123
* **lib-crash**
121124
* Added option to display additional message in prompt and define the theme to be used:
122-
```Kotlin
123-
CrashReporter(
124-
promptConfiguration = CrashReporter.PromptConfiguration(
125-
// ..
125+
```kotlin
126+
CrashReporter(
127+
promptConfiguration = CrashReporter.PromptConfiguration(
128+
// ..
126129

127-
// An additional message that will be shown in the prompt
128-
message = "We are very sorry!"
130+
// An additional message that will be shown in the prompt
131+
message = "We are very sorry!"
129132

130-
// Use a custom theme for the prompt (Extend Theme.Mozac.CrashReporter)
131-
theme = android.R.style.Theme_Holo_Dialog
132-
),
133-
// ..
133+
// Use a custom theme for the prompt (Extend Theme.Mozac.CrashReporter)
134+
theme = android.R.style.Theme_Holo_Dialog
135+
)
136+
// ..
134137
).install(applicationContext)
135138
```
136139
* Showing the crash prompt won't play the default activity animation anymore.

0 commit comments

Comments
 (0)