Skip to content

Commit 6bf6d8f

Browse files
Update README.md
Add video and fix types and update headers
1 parent 22f9620 commit 6bf6d8f

File tree

1 file changed

+23
-26
lines changed

1 file changed

+23
-26
lines changed

README.md

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
# Compose Before-After
22

33
Composables to display Images, or Composables as before and after composables to display
4-
differences or animate progress between 2 layout or Composables with overlay and
4+
differences or animate progress between 2 layouts or Composables with overlay and
55
customization options and progress observe properties for animating before-after progress
66

7+
8+
9+
https://user-images.githubusercontent.com/35650605/180228396-ef6e8af1-14e9-4d69-b505-2d70f9c5c764.mp4
10+
11+
12+
713
## Gradle Setup
814

915
## BeforeAfterImage
@@ -146,28 +152,18 @@ BeforeAfterImage(
146152

147153
### Parameters
148154

149-
* beforeImage image that show initial progress
150-
* afterImage image that show final progress
151-
* enableProgressWithTouch flag to enable drag and change progress with touch
152-
* enableZoom when enabled images are zoomable and pannable
153-
* contentOrder order of images to be drawn
154-
* alignment determines where image will be aligned inside `BoxWithConstraints`
155-
* This is observable when bitmap image/width ratio differs from `Canvas` that draws `ImageBitmap`
156-
* contentDescription text used by accessibility services to describe what this image
157-
* represents. This should always be provided unless this image is used for decorative purposes,
158-
* and does not represent a meaningful action that a user can take. This text should be
159-
* localized, such as by using `androidx.compose.ui.res.stringResource` or similar
160-
* contentScale how image should be scaled inside Canvas to match parent dimensions.
155+
* **beforeImage** image that show initial progress
156+
* **afterImage** image that show final progress
157+
* **enableProgressWithTouch** flag to enable drag and change progress with touch
158+
* **enableZoom** when enabled images are zoomable and pannable
159+
* **contentOrder** order of images to be drawn
160+
* **alignment** determines where image will be aligned inside `BoxWithConstraints`
161+
* **contentScale** how image should be scaled inside Canvas to match parent dimensions.
161162
* `ContentScale.Fit` for instance maintains src ratio and scales image to fit inside the parent.
162-
* alpha Opacity to be applied to `beforeImage` from 0.0f to 1.0f representing
163-
* fully transparent to fully opaque respectively
164-
* colorFilter ColorFilter to apply to the `beforeImage` when drawn into the destination
165-
* filterQuality Sampling algorithm applied to the `beforeImage` when it is scaled and drawn
166-
* into the destination. The default is `FilterQuality.Low` which scales using a bilinear
167-
* sampling algorithm
168-
* overlay is a Composable that can be matched at exact position where `beforeImage``` is drawn.
169-
* This is useful for drawing thumbs, cropping or another layout that should match position
170-
with the image that is scaled is drawn
163+
* **alpha** Opacity to be applied to `beforeImage` from 0.0f to 1.0f representing fully transparent to fully opaque respectively
164+
* **colorFilter** ColorFilter to apply to the `beforeImage` when drawn into the destination
165+
* **filterQuality** Sampling algorithm applied to the `beforeImage` when it is scaled and drawn into the destination. The default is `FilterQuality.Low` which scales using a bilinear sampling algorithm
166+
* **overlay** is a Composable that can be matched at exact position where `beforeImage` is drawn. This is useful for drawing thumbs, cropping or another layout that should match position with the image that is scaled is drawn
171167

172168
## BeforeAfterLayout
173169

@@ -236,7 +232,7 @@ also offers `DefaultOverlayo`
236232
)
237233
```
238234

239-
** Display Layouts with M2 and M3 together
235+
**Display difference between Composables with Material Design2 and M3**
240236

241237
```kotlin
242238
BeforeAfterLayout(
@@ -296,8 +292,9 @@ BeforeAfterLayout(
296292
```
297293

298294
**Display before and after videos with Exoplayer**
299-
Note there is a bug with Exoplayer2. If you have a fix please open a PR or
300-
answer
295+
296+
### ⚠️ Note there is a bug with Exoplayer2.
297+
If you have a fix please open a PR or answer
301298
[this question](https://stackoverflow.com/questions/73061216/exoplayer2-with-before-after-videos-changes-first-video-when-clip-and-shape-used)
302299
Both are appreciated greatly
303300

@@ -322,4 +319,4 @@ BeforeAfterLayout(
322319
},
323320
enableZoom = false
324321
)
325-
```
322+
```

0 commit comments

Comments
 (0)