Skip to content

Fix stale ColorPickerController API examples in README and docs site - #192

Open
iprashantpanwar wants to merge 1 commit into
skydoves:mainfrom
iprashantpanwar:fix/stale-controller-api-docs
Open

Fix stale ColorPickerController API examples in README and docs site#192
iprashantpanwar wants to merge 1 commit into
skydoves:mainfrom
iprashantpanwar:fix/stale-controller-api-docs

Conversation

@iprashantpanwar

Copy link
Copy Markdown
Contributor
  • README.md: replace removed setWheelRadius/setWheelColor/setWheelAlpha/setWheelImageBitmap calls with direct property assignment (wheelRadius, wheelColor, wheelAlpha, wheelBitmap)
  • README.md: replace removed setPaletteContentScale controller method with the paletteContentScale parameter on ImageColorPicker
  • docs/ApiControllerScreen.kt: same wheel property fix
  • docs/ApiImageColorPickerScreen.kt: same paletteContentScale fix

馃幆 Goal

ColorPickerController's public API was refactored at some point, the wheel
customization functions (setWheelRadius, setWheelColor, setWheelAlpha,
setWheelImageBitmap) became plain properties, and setPaletteContentScale
was replaced by a paletteContentScale parameter on ImageColorPicker. The
README and the documentation website were never updated to match, so
copy-pasting these examples currently fails to compile. This PR brings both
docs surfaces back in sync with the current API.

馃洜 Implementation details

  • README.md "Custom Wheel" section: replaced the four .setWheelXxx(...)
    calls with direct property assignment on the controller
    (controller.wheelRadius = ..., etc.)
  • README.md "PaletteContentScale" section: replaced
    controller.setPaletteContentScale(...) with the paletteContentScale
    parameter on the ImageColorPicker composable
  • docs/src/wasmJsMain/kotlin/docs/screen/ApiControllerScreen.kt: applied
    the same wheel property fix to the live docs site's code sample
  • docs/src/wasmJsMain/kotlin/docs/screen/ApiImageColorPickerScreen.kt:
    applied the same paletteContentScale fix to the live docs site's code
    sample

No functional/library code was changed this PR only touches documentation
(README.md) and the docs website's Kotlin/Wasm source (docs/ module).

鉁嶏笍 Explain examples

Before ((unresolved reference - these methods don't exist on ColorPickerController):

controller.setWheelRadius(40.dp)
controller.setWheelColor(Color.Blue)
controller.setWheelAlpha(0.5f)
controller.setWheelImageBitmap(imageBitmap)

After:

controller.wheelRadius = 40.dp
controller.wheelColor = Color.Blue
controller.wheelAlpha = 0.5f
controller.wheelBitmap = imageBitmap

- README.md: replace removed setWheelRadius/setWheelColor/setWheelAlpha/setWheelImageBitmap
  calls with direct property assignment (wheelRadius, wheelColor, wheelAlpha, wheelBitmap)
- README.md: replace removed setPaletteContentScale controller method with the
  paletteContentScale parameter on ImageColorPicker
- docs/ApiControllerScreen.kt: same wheel property fix
- docs/ApiImageColorPickerScreen.kt: same paletteContentScale fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant