Status Update
Comments
lp...@google.com <lp...@google.com>
jo...@google.com <jo...@google.com> #2
Branch: androidx-main
commit cb1afd67dacbf14cd22206c6f5b543dbf18cec1f
Author: Tony Mak <tonymak@google.com>
Date: Thu Jan 06 14:52:58 2022
Deprecate all the APIs in textclassifier
Bug: 210509084
Test: Check api/current.txt and ensure all classes are deprecated
Relnote: "Deprecate all the APIs in the textclassifier module"
Change-Id: Idc18063196531c0e926162fefeadf2dc5f559da1
M textclassifier/textclassifier/src/main/java/androidx/textclassifier/TextSelection.java
M textclassifier/textclassifier/src/main/java/androidx/textclassifier/TextLinks.java
M textclassifier/textclassifier/src/main/java/androidx/textclassifier/TextClassificationSessionId.java
M textclassifier/textclassifier/api/public_plus_experimental_current.txt
M textclassifier/textclassifier/src/main/java/androidx/textclassifier/TextClassification.java
M textclassifier/textclassifier/src/main/java/androidx/textclassifier/TextClassificationManager.java
M textclassifier/textclassifier/api/current.txt
M textclassifier/textclassifier/src/main/java/androidx/textclassifier/TextClassificationContext.java
M textclassifier/textclassifier/src/main/java/androidx/textclassifier/TextLinksParams.java
M textclassifier/textclassifier/api/restricted_current.txt
M textclassifier/textclassifier/src/main/java/androidx/textclassifier/ConversationAction.java
M textclassifier/textclassifier/src/main/java/androidx/textclassifier/TextClassifier.java
M textclassifier/textclassifier/src/main/java/androidx/textclassifier/ConversationActions.java
M textclassifier/textclassifier/src/main/java/androidx/textclassifier/ExtrasUtils.java
br...@cfacorp.com <br...@cfacorp.com> #3
Is there any update when the alpha04 will be available? We need it to target api 31 because of the PendingIntent mutability flags missing in alpha03.
ap...@google.com <ap...@google.com> #4
I'll schedule it for the next release. Note that alpha04
is a complete turn-down of the library where all APIs are marked as Deprecated
, so you'll also want to start removing your usages of the library.
jo...@google.com <jo...@google.com>
br...@cfacorp.com <br...@cfacorp.com> #5
Branch: androidx-main
commit 19ed7e69823a09f3c63f8c8cdf339af8ca1645ab
Author: Alan Viverette <alanv@google.com>
Date: Mon Mar 14 15:18:16 2022
Bump textclassifier for final release and turn-down
Bug: 210509084
Change-Id: Ib8b2386903bb49baa3211f7de7fe1587fdda1483
Test: ./gradlew checkApi
M libraryversions.toml
na...@google.com <na...@google.com> #6
Bugjuggler: wait until 2022-03-23
vo...@gmail.com <vo...@gmail.com> #7
br...@cfacorp.com <br...@cfacorp.com> #8
Is there a replacement or should we just abandon TextClassifier for android older than API Level 26 ?
jo...@google.com <jo...@google.com> #9
Abandon. The owning team had no plans to release a replacement library.
at...@gmail.com <at...@gmail.com> #10
cl...@google.com <cl...@google.com>
ap...@google.com <ap...@google.com> #11
Project: platform/frameworks/support
Branch: androidx-main
Author: Jossi Wolf <
Link:
Update AnchoredDraggable target calculation logic
Expand for full commit details
Update AnchoredDraggable target calculation logic
There was a missed case when the velocity was negative.
Test: New tests with more parameter permutations
Fixes: 367660226
Bug: 376931805
Relnote: "Follow-up fix for an issue in AnchoredDraggable's target calculation where it could settle at the wrong anchor for specific swipes."
Change-Id: I23b8773d3a694aa3c8de6a8f34b9d7fb54cfe560
Files:
- M
compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/anchoredDraggable/AnchoredDraggableStateTest.kt
- M
compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/AnchoredDraggable.kt
Hash: 6a23aa4ee37ba171475e4155db0d24c90b358c7e
Date: Fri Nov 08 14:11:31 2024
br...@cfacorp.com <br...@cfacorp.com> #12
What is the fix version?
jo...@google.com <jo...@google.com> #13
We will comment on the issue when it has been included in a release. Until then, you can try the snapshot versions from androidx.dev.
pr...@google.com <pr...@google.com> #14
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.foundation:foundation:1.8.0-alpha07
androidx.compose.foundation:foundation-android:1.8.0-alpha07
androidx.compose.foundation:foundation-jvmstubs:1.8.0-alpha07
androidx.compose.foundation:foundation-linuxx64stubs:1.8.0-alpha07
0x...@gmail.com <0x...@gmail.com> #15
jo...@google.com <jo...@google.com> #16
#15, please report a new issue with a full reproduction case and the versions you are using. Thank you!
0x...@gmail.com <0x...@gmail.com> #17
Running compose foundation 1.8.0-alpha07
I'm using AnchoredDraggable with nested scrolling. When I drag and release the lazy layout sometimes the draggable settles correctly and sometimes it doesn't even when i drag and release past the threshold (positionalThreshold = { distance -> distance / 2f }.
internal fun nestedScrollConnection(
dragState: AnchoredDraggableState<Anchors>,
decayAnimationSpec: DecayAnimationSpec<Float>,
orientation: Orientation = Orientation.Vertical,
): NestedScrollConnection = object : NestedScrollConnection {
override fun onPreScroll(
available: Offset,
source: NestedScrollSource,
): Offset {
val availableDelta = available.toFloat()
return if (
availableDelta < 0f
) dragState.dispatchRawDelta(availableDelta).toOffset()
else Offset.Zero
}
override fun onPostScroll(
consumed: Offset,
available: Offset,
source: NestedScrollSource,
): Offset {
val availableDelta = available.toFloat()
return if (
availableDelta >= 0f
) dragState.dispatchRawDelta(availableDelta).toOffset()
else Offset.Zero
}
override suspend fun onPreFling(
available: Velocity,
): Velocity {
val availableDelta = available.toFloat()
val consumedOffset = if (availableDelta < 0f) dragState.animateToWithDecay(
velocity = availableDelta,
targetValue = Anchors.Collapsed,
decayAnimationSpec = decayAnimationSpec,
) else 0f
return Velocity(
x = 0f,
y = consumedOffset,
)
}
override suspend fun onPostFling(
consumed: Velocity,
available: Velocity,
): Velocity {
val availableDelta = available.toFloat()
if (
availableDelta > 0f
) dragState.animateToWithDecay(
velocity = availableDelta,
targetValue = Anchors.Expanded,
decayAnimationSpec = decayAnimationSpec,
)
dragState.settle(animationSpec = spring())
return Velocity(x = 0f, y = availableDelta)
}
private fun Float.toOffset(): Offset = Offset(
y = if (orientation == Orientation.Vertical) this else 0f,
x = if (orientation == Orientation.Horizontal) this else 0f,
)
@JvmName("offsetToFloat")
private fun Offset.toFloat() = if (orientation == Orientation.Horizontal) x else y
@JvmName("velocityToFloat")
private fun Velocity.toFloat() = if (orientation == Orientation.Horizontal) x else y
}
jo...@google.com <jo...@google.com> #18
Hi, this seems to be a different issue. Please provide a full reproducer in a new issue so we can investigate. Thank you!
sj...@gmail.com <sj...@gmail.com> #19
Or, is there some way to look up which is the first build to contain the change?
jo...@google.com <jo...@google.com> #20
Looking at the release notes (
br...@cfacorp.com <br...@cfacorp.com> #21
Unfortunately, this still does not work. I'm on 1.8.0-alpha07 and when I use 0.9f from the original example it still snaps at 50%.
jo...@google.com <jo...@google.com> #22
#21, are you using exactly the same code shared in #1?
br...@cfacorp.com <br...@cfacorp.com> #23
Yes, I'm the OP.
wl...@gmail.com <wl...@gmail.com> #24
sdkmanager "build-tools;build-tools-version"
jo...@google.com <jo...@google.com> #25
Apologies #23, but I am not able to reproduce the issue with the sample from #1, running on Compose 1.8.0-alpha08. Can you please provide a full reproducer project as a zip? Thanks!
r....@gmail.com <r....@gmail.com> #26
Can confirm that positionalThreshold doesn't work, still snaps at 50%.
Here is composable I'm using to test:
@Composable
fun AnchoredDraggableAnchorsFromCompositionSample() {
val density = LocalDensity.current
val state = rememberSaveable(saver = AnchoredDraggableState.Saver()) {
AnchoredDraggableState(initialValue = DragAnchors.Start)
}
val draggableWidth = 200.dp
val containerWidthPx = with(density) { draggableWidth.toPx() }
// Our anchors depend on the density which is obtained from composition, so we update them using
// updateAnchors whenever they are available
SideEffect {
state.updateAnchors(
DraggableAnchors {
DragAnchors.Start at 0f
DragAnchors.End at containerWidthPx
}
)
}
Box(Modifier.width(draggableWidth).background(Color.Gray)) {
Box(Modifier
.size(50.dp)
.offset { IntOffset(x = state.requireOffset().roundToInt(), y = 0) }
.anchoredDraggable(
state,
Orientation.Horizontal,
flingBehavior =
AnchoredDraggableDefaults.flingBehavior(
state,
positionalThreshold = { distance -> distance * 0.95f }
)
)
.background(Color.Red)
)
}
}
Description
Jetpack Compose version: Compose BOM 2024.9.01
Jetpack Compose component(s) used: AnchoredDraggableState, DraggableState, Boxes, Modifiers, and such
Android Studio Build: Build #AI-241.18034.62.2411.12071903, built on July 10, 2024
Kotlin version: 1.9.24
Steps to Reproduce or Code Sample to Reproduce:
See the positionalThreshold in the AnchoredDraggableState. It doesn't matter what multiple is applied to the distance, it always uses 50%. I've tried a bunch of values, even 1.5! Am I using it wrong?