Skip to content

Conversation

@fornewid
Copy link
Collaborator

⚠️ Breaking Changes

onReadMoreClick, onReadLessClick slots are removed.
So, if you are already using this attribute, you need to change your code like this:

foundation:

  val (expanded, onExpandedChange) = rememberSaveable { mutableStateOf(false) }
  BasicReadMoreText(
      text = "text",
      expanded = expanded,
+     onExpandedChange = onExpandedChange,
      ...
-     onReadMoreClick = {
-         onExpandedChange(true)
-     },
      readLessText = stringResource(id = R.string.read_less),
-     onReadLessClick = {
-         onExpandedChange(false)
-     },
+     toggleArea = ToggleArea.More,
  )

material, material3:

  val (expanded, onExpandedChange) = rememberSaveable { mutableStateOf(false) }
  ReadMoreText(
      text = "text",
      expanded = expanded,
+     onExpandedChange = onExpandedChange,
      ...
-     onReadMoreClick = {
-         onExpandedChange(true)
-     },
      readLessText = stringResource(id = R.string.read_less),
-     onReadLessClick = {
-         onExpandedChange(false)
-     },
+     toggleArea = ToggleArea.More,
  )

`onReadMoreClick`, `onReadLessClick` slots are removed.
@fornewid fornewid requested a review from hyeonu1258 as a code owner February 14, 2023 02:17
@fornewid fornewid merged commit 8b1a158 into main Feb 14, 2023
@fornewid fornewid deleted the compose-toggle-area branch February 14, 2023 04:48
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.

2 participants