summaryrefslogtreecommitdiff
path: root/java/src
diff options
context:
space:
mode:
author Andrey Epin <ayepin@google.com> 2024-06-17 17:32:10 -0700
committer Andrey Epin <ayepin@google.com> 2024-06-17 17:32:10 -0700
commit53d920eccd9efeddae4a36c41ab31717cbc330ec (patch)
tree0e0f03bb9838724a65cb060919255a32b72fa413 /java/src
parent468ae8749759dfdb58175e5ea431ca36a588876e (diff)
Reclalculate drawer offset even when the targets list has not changed
Shareousel has a variable-sized preview that affects the overall drawer offset. Therefore, we cannot early return from the offset calcualtion based solely on the condition that the targets list has not changed. Empirically, this introduces a minor overhead of the offset recalculation when the drawor is snapped to/from the top. Fix: 347316548 Test: manual testing with injected debug logging Flag: com.android.intentresolver.fix_missing_drawer_offset_calculation Change-Id: I69ec7a5e05fad0d6607e3614208b30910a3a17ba
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/intentresolver/ChooserActivity.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/java/src/com/android/intentresolver/ChooserActivity.java b/java/src/com/android/intentresolver/ChooserActivity.java
index a5516fde..0fa5e758 100644
--- a/java/src/com/android/intentresolver/ChooserActivity.java
+++ b/java/src/com/android/intentresolver/ChooserActivity.java
@@ -2258,7 +2258,8 @@ public class ChooserActivity extends Hilt_ChooserActivity implements
if (isLayoutUpdated
|| insetsChanged
- || mLastNumberOfChildren != recyclerView.getChildCount()) {
+ || mLastNumberOfChildren != recyclerView.getChildCount()
+ || mFeatureFlags.fixMissingDrawerOffsetCalculation()) {
mCurrAvailableWidth = availableWidth;
if (isLayoutUpdated) {
// It is very important we call setAdapter from here. Otherwise in some cases
@@ -2277,7 +2278,8 @@ public class ChooserActivity extends Hilt_ChooserActivity implements
return;
}
- if (mLastNumberOfChildren == recyclerView.getChildCount() && !insetsChanged) {
+ if (mLastNumberOfChildren == recyclerView.getChildCount() && !insetsChanged
+ && !mFeatureFlags.fixMissingDrawerOffsetCalculation()) {
return;
}