|
11 | 11 |
|
12 | 12 | # Showcase Layout Compose |
13 | 13 |
|
14 | | -Create a beautiful animated showcase effect for your compose UIs easily ! |
| 14 | +Create beautiful animated showcase effects for your compose UIs easily! |
15 | 15 |
|
16 | | -**Now with multiplatform support :D** |
| 16 | +**Now with multiplatform support and two different showcase layouts to choose from:** |
| 17 | +- **ShowcaseLayout**: Classic full-screen overlay with cutouts |
| 18 | +- **TargetShowcaseLayout**: Modern targeted highlighting with customizable shapes |
17 | 19 |
|
18 | 20 | ## Web demo |
19 | 21 | [Click here](https://tahaak67.github.io/ShowcaseLayoutCompose/index.html) to try showcase layout for web in your browser! |
20 | 22 |
|
21 | 23 | ## Demo |
22 | 24 |
|
23 | | -<img src="metadata/gif/slc-light.gif" alt="Library demo GIF" width="300" /> |
| 25 | +| ShowcaseLayout | |
| 26 | +|:---------------------------------------------------------------------------:| |
| 27 | +| <img src="metadata/gif/slc-light.gif" alt="Library demo GIF" width="300" /> | |
| 28 | + |
24 | 29 |
|
25 | 30 | <img src="metadata/screenshots/screenshot-13.png" alt="Library demo GIF" width="300" />.<img src="metadata/screenshots/screenshot-14.png" alt="Library demo GIF" width="300" /> |
26 | 31 |
|
|
76 | 81 | modifier = Modifier.showcase( |
77 | 82 | // should start with 1 and increment with 1 for each time you use Modifier.showcase() |
78 | 83 | index = 1, |
79 | | - message = |
| 84 | + message = ShowcaseMsg( |
| 85 | + "This is a showcase message", |
| 86 | + textStyle = TextStyle(color = Color.White) |
| 87 | + ) |
80 | 88 | ), |
81 | 89 | text = "ShowcaseLayout Test 1" |
82 | 90 | ) |
@@ -125,7 +133,96 @@ similarly you can show a greeting using <code>showGreeting</code> and passing th |
125 | 133 | </details> |
126 | 134 |
|
127 | 135 |
|
128 | | -Done, our text is now showcased!, customize it further with Additional parameters |
| 136 | +Done, our text is now showcased!, customize it further with Additional parameters. |
| 137 | + |
| 138 | +## TargetShowcaseLayout (New!) |
| 139 | + |
| 140 | +Starting from version 1.0.6, Showcase Layout Compose now offers a new layout option: `TargetShowcaseLayout`. This layout provides a different visual approach to showcasing UI elements by highlighting specific targets with customizable shapes rather than the full-screen approach of the original ShowcaseLayout. |
| 141 | + |
| 142 | +### Key Features |
| 143 | + |
| 144 | +- Highlights target elements with customizable shapes (circle, rectangle, or rounded rectangle) |
| 145 | +- Smooth animations between targets |
| 146 | +- Pulsing effect around the target for better visibility |
| 147 | +- All the same customization options as the original ShowcaseLayout |
| 148 | + |
| 149 | +### Usage |
| 150 | + |
| 151 | +You can use TargetShowcaseLayout directly: |
| 152 | + |
| 153 | +```kotlin |
| 154 | +var isShowcasing by remember { mutableStateOf(true) } |
| 155 | + |
| 156 | +TargetShowcaseLayout( |
| 157 | + isShowcasing = isShowcasing, |
| 158 | + onFinish = { isShowcasing = false }, |
| 159 | + targetShape = TargetShape.ROUNDED_RECTANGLE, // CIRCLE, RECTANGLE, or ROUNDED_RECTANGLE |
| 160 | + cornerRadius = 8.dp, // Only used with ROUNDED_RECTANGLE |
| 161 | + animateToNextTarget = true, // Smooth animation between targets |
| 162 | + greeting = ShowcaseMsg( |
| 163 | + "Welcome to TargetShowcaseLayout!", |
| 164 | + textStyle = TextStyle(color = Color.White) |
| 165 | + ) |
| 166 | +) { |
| 167 | + // Your UI content here |
| 168 | + Column { |
| 169 | + Text( |
| 170 | + modifier = Modifier.showcase( |
| 171 | + index = 1, |
| 172 | + message = ShowcaseMsg( |
| 173 | + "This element is highlighted with TargetShowcaseLayout", |
| 174 | + textStyle = TextStyle(color = Color.White) |
| 175 | + ) |
| 176 | + ), |
| 177 | + text = "Target Showcase Example" |
| 178 | + ) |
| 179 | + } |
| 180 | +} |
| 181 | +``` |
| 182 | + |
| 183 | +| TargetShowcaseLayout with CIRCLE shape | TargetShowcaseLayout with RECTANGLE shape | TargetShowcaseLayout with ROUNDED_RECTANGLE shape | |
| 184 | +|:------------------------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------:| |
| 185 | +|  |  |  | |
| 186 | + |
| 187 | +### TargetShowcaseLayout vs ShowcaseLayout |
| 188 | + |
| 189 | +| Feature | TargetShowcaseLayout | ShowcaseLayout | |
| 190 | +|---------|---------------------|----------------| |
| 191 | +| Visual style | Highlights specific targets with shapes | Full-screen overlay with cutouts | |
| 192 | +| Target shapes | Circle, Rectangle, Rounded Rectangle | Circle, Rectangle, Rounded Rectangle | |
| 193 | +| Animations | Smooth transitions between targets | Fade transitions | |
| 194 | +| Pulsing effect | Yes | No | |
| 195 | +| Use cases | Focused UI tours, precise element highlighting | General app tours, feature introductions | |
| 196 | + |
| 197 | +### TargetShowcaseLayout Parameters |
| 198 | + |
| 199 | +In addition to the parameters shared with ShowcaseLayout, TargetShowcaseLayout offers: |
| 200 | + |
| 201 | +```kotlin |
| 202 | +TargetShowcaseLayout( |
| 203 | + // Common parameters (same as ShowcaseLayout) |
| 204 | + isShowcasing = isShowcasing, |
| 205 | + isDarkLayout = false, |
| 206 | + initIndex = 0, |
| 207 | + animationDuration = 1000, |
| 208 | + onFinish = { isShowcasing = false }, |
| 209 | + greeting = ShowcaseMsg( |
| 210 | + "Welcome to TargetShowcaseLayout!", |
| 211 | + textStyle = TextStyle(color = Color.White) |
| 212 | + ), |
| 213 | + lineThickness = 5.dp, |
| 214 | + |
| 215 | + // TargetShowcaseLayout specific parameters |
| 216 | + targetShape = TargetShape.CIRCLE, // CIRCLE, RECTANGLE, or ROUNDED_RECTANGLE |
| 217 | + cornerRadius = 8.dp, // Only used with ROUNDED_RECTANGLE |
| 218 | + animateToNextTarget = true // Smooth animation between targets, otherwise shrink and expand on each target |
| 219 | +) { |
| 220 | + // Your UI content here |
| 221 | +} |
| 222 | +``` |
| 223 | + |
| 224 | + |
| 225 | +<!-- SCREENSHOT PLACEHOLDER: Add a side-by-side comparison of the same UI with both layouts --> |
129 | 226 |
|
130 | 227 | #### Additional parameters |
131 | 228 |
|
@@ -297,11 +394,20 @@ In recent releases logs have been disabled by default, to print log statement of |
297 | 394 | ``` |
298 | 395 |
|
299 | 396 |
|
300 | | -## Complete Example |
| 397 | +## Complete Examples |
| 398 | + |
| 399 | +### ShowcaseLayout Example |
| 400 | +For a complete example of the original ShowcaseLayout, check out [MainScreen.kt](https://github.com/tahaak67/ShowcaseLayoutCompose/blob/main/app/src/main/java/ly/com/tahaben/showcaselayoutcompose/ui/MainScreen.kt). |
| 401 | + |
| 402 | +### TargetShowcaseLayout Example |
| 403 | +For an example of the new TargetShowcaseLayout, check out the [App.kt](https://github.com/tahaak67/ShowcaseLayoutCompose/blob/main/composeApp/src/commonMain/kotlin/App.kt) file in the composeApp module. |
| 404 | + |
| 405 | +You can also clone/download this repository and run the demo app to see both layouts in action. |
| 406 | + |
301 | 407 |
|
302 | | -For a complete example check |
303 | | -out [MainScreen.kt](https://github.com/tahaak67/ShowcaseLayoutCompose/blob/main/app/src/main/java/ly/com/tahaben/showcaselayoutcompose/ui/MainScreen.kt) \ |
304 | | -or clone/download this repository and check the app module. |
| 408 | +| Comparison of both layouts | |
| 409 | +|:-------:| |
| 410 | +| [Add your comparison screenshot path here] | |
305 | 411 |
|
306 | 412 | ## Contributing |
307 | 413 |
|
|
0 commit comments