Skip to content

Commit 110d7ae

Browse files
committed
fix: Change stroke_alpha range from 0-100 to 0-255
Updates the `stroke_alpha` attribute to use the standard Android alpha range of 0-255 instead of 0-100. - Changes the default value of `stroke_alpha` to 255 in `ShadowLayout`. - Updates the README to reflect the new range (0-255) and the new default value (255) for `stroke_alpha`.
1 parent d554347 commit 110d7ae

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ app:shadow_array="{10,0,4,10,#c8c8c8}, {10,0,4,10,#000000}"
179179
app:stroke_type="INSIDE"
180180
app:stroke_blur="10dp"
181181
app:stroke_blur_type="INNER"
182-
app:stroke_alpha="100">
182+
app:stroke_alpha="255">
183183

184184
<androidx.appcompat.widget.AppCompatTextView
185185
android:layout_width="wrap_content"
@@ -193,14 +193,14 @@ app:shadow_array="{10,0,4,10,#c8c8c8}, {10,0,4,10,#000000}"
193193

194194
## Attributes
195195

196-
| Attribute | Description |
197-
|------------------------|--------------------------------------------------------------------------------------------------------------|
198-
| `app:stroke_color` | The color of the stroke. Supports any valid color value, such as HEX codes. Example: `#c8c8c8`. |
199-
| `app:stroke_width` | The width of the stroke in density-independent pixels (dp). Example: `4dp`. |
196+
| Attribute | Description |
197+
|------------------------|-----------------------------------------------------------------------------------------------------------------------------|
198+
| `app:stroke_color` | The color of the stroke. Supports any valid color value, such as HEX codes. Example: `#c8c8c8`. |
199+
| `app:stroke_width` | The width of the stroke in density-independent pixels (dp). Example: `4dp`. |
200200
| `app:stroke_type` | Defines where the stroke is drawn relative to the view boundary. Options: `INSIDE`, `CENTER`, `OUTSIDE`. Default: `CENTER`. |
201-
| `app:stroke_blur` | The blur radius applied to the stroke. Example: `10dp`. |
202-
| `app:stroke_blur_type` | Type of blur applied to the stroke. Options: `INNER`, `OUTER`, `SOLID`. Default: `INNER`. |
203-
| `app:stroke_alpha` | The transparency level of the stroke, ranging from `0` (completely transparent) to `100` (fully opaque). Default: `100`. |
201+
| `app:stroke_blur` | The blur radius applied to the stroke. Example: `10dp`. |
202+
| `app:stroke_blur_type` | Type of blur applied to the stroke. Options: `INNER`, `OUTER`, `SOLID`. Default: `INNER`. |
203+
| `app:stroke_alpha` | The transparency level of the stroke, ranging from `0` (completely transparent) to `255` (fully opaque). Default: `255`. |
204204

205205
### Stroke Type
206206
- **INSIDE**: The stroke is drawn inside the view boundary, reducing the available space for the content.
@@ -230,7 +230,7 @@ app:shadow_array="{10,0,4,10,#c8c8c8}, {10,0,4,10,#000000}"
230230
Defines the type of blur effect for the stroke.
231231

232232
- **`updateStrokeAlpha(alpha: Int)`**
233-
Sets the transparency level of the stroke. Accepts a value between `0` (fully transparent) and `100` (fully opaque).
233+
Sets the transparency level of the stroke. Accepts a value between `0` (fully transparent) and `255` (fully opaque).
234234

235235
---
236236

library/src/main/java/com/sonsation/library/ShadowLayout.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class ShadowLayout : FrameLayout {
114114
StrokeType.INSIDE.type
115115
)
116116
} ?: StrokeType.INSIDE,
117-
strokeAlpha = a.getInteger(R.styleable.ShadowLayout_stroke_alpha, 100)
117+
strokeAlpha = a.getInteger(R.styleable.ShadowLayout_stroke_alpha, 255)
118118
).apply {
119119
this.blurType = BlurMaskFilter.Blur.entries.find {
120120
it.ordinal == a.getInteger(

0 commit comments

Comments
 (0)