Merge "Scale bubble bar to the width of the handle" into main

This commit is contained in:
Ats Jenk authored and Android (Google) Code Review committed 2024-08-30 23:06:43 +00:00
commit ba6c9f06ed
5 files changed
+77 -26

No files matched your search

@@ -80,6 +80,7 @@ public class BubbleBarViewController {
// These are exposed to {@link BubbleStashController} to animate for stashing/un-stashing
private final MultiValueAlpha mBubbleBarAlpha;
private final AnimatedFloat mBubbleBarScaleX = new AnimatedFloat(this::updateScaleX);
private final AnimatedFloat mBubbleBarScaleY = new AnimatedFloat(this::updateScaleY);
private final AnimatedFloat mBubbleBarTranslationY = new AnimatedFloat(
this::updateTranslationY);
@@ -257,6 +258,10 @@ public class BubbleBarViewController {
return mBubbleBarAlpha;
}
public AnimatedFloat getBubbleBarScaleX() {
return mBubbleBarScaleX;
}
public AnimatedFloat getBubbleBarScaleY() {
return mBubbleBarScaleY;
}
@@ -265,6 +270,10 @@ public class BubbleBarViewController {
return mBubbleBarTranslationY;
}
public float getBubbleBarCollapsedWidth() {
return mBarView.collapsedWidth();
}
public float getBubbleBarCollapsedHeight() {
return mBarView.getBubbleBarCollapsedHeight();
}
@@ -309,6 +318,14 @@ public class BubbleBarViewController {
return mBarView.getBubbleBarLocation();
}
/**
* @return {@code true} if bubble bar is on the left edge of the screen, {@code false} if on
* the right
*/
public boolean isBubbleBarOnLeft() {
return mBarView.getBubbleBarLocation().isOnLeft(mBarView.isLayoutRtl());
}
/**
* Update bar {@link BubbleBarLocation}
*/
@@ -510,6 +527,10 @@ public class BubbleBarViewController {
+ mBubbleBarStashTranslationY);
}
private void updateScaleX(float scale) {
mBarView.setScaleX(scale);
}
private void updateScaleY(float scale) {
mBarView.setScaleY(scale);
}