1--- prebuilts/sdk/current/androidx/m2repository/androidx/core/core/1.13.0-beta01/core-1.13.0-beta01-sources.jar!/androidx/core/widget/NestedScrollView.java 1980-02-01 00:00:00.000000000 -0800 2+++ packages/modules/IntentResolver/java/src/com/android/intentresolver/widget/NestedScrollView.java 2024-03-04 17:17:47.357059016 -0800 3@@ -1,5 +1,5 @@ 4 /* 5- * Copyright (C) 2015 The Android Open Source Project 6+ * Copyright 2024 The Android Open Source Project 7 * 8 * Licensed under the Apache License, Version 2.0 (the "License"); 9 * you may not use this file except in compliance with the License. 10@@ -15,10 +15,9 @@ 11 */ 12 13 14-package androidx.core.widget; 15+package com.android.intentresolver.widget; 16 17 import static androidx.annotation.RestrictTo.Scope.LIBRARY; 18-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX; 19 20 import android.content.Context; 21 import android.content.res.TypedArray; 22@@ -67,13 +66,19 @@ 23 import androidx.core.view.ViewCompat; 24 import androidx.core.view.accessibility.AccessibilityNodeInfoCompat; 25 import androidx.core.view.accessibility.AccessibilityRecordCompat; 26+import androidx.core.widget.EdgeEffectCompat; 27 28 import java.util.List; 29 30 /** 31- * NestedScrollView is just like {@link ScrollView}, but it supports acting 32- * as both a nested scrolling parent and child on both new and old versions of Android. 33- * Nested scrolling is enabled by default. 34+ * A copy of the {@link androidx.core.widget.NestedScrollView} (from 35+ * prebuilts/sdk/current/androidx/m2repository/androidx/core/core/1.13.0-beta01/core-1.13.0-beta01-sources.jar) 36+ * without any functional changes with a pure refactoring of {@link #requestChildFocus(View, View)}: 37+ * the method's body is extracted into the new protected method, 38+ * {@link #onRequestChildFocus(View, View)}. 39+ * <p> 40+ * For the exact change see NestedScrollView.java.patch file. 41+ * </p> 42 */ 43 public class NestedScrollView extends FrameLayout implements NestedScrollingParent3, 44 NestedScrollingChild3, ScrollingView { 45@@ -1858,7 +1863,6 @@ 46 * <p>The scroll range of a scroll view is the overall height of all of its 47 * children.</p> 48 */ 49- @RestrictTo(LIBRARY_GROUP_PREFIX) 50 @Override 51 public int computeVerticalScrollRange() { 52 final int count = getChildCount(); 53@@ -1881,31 +1885,26 @@ 54 return scrollRange; 55 } 56 57- @RestrictTo(LIBRARY_GROUP_PREFIX) 58 @Override 59 public int computeVerticalScrollOffset() { 60 return Math.max(0, super.computeVerticalScrollOffset()); 61 } 62 63- @RestrictTo(LIBRARY_GROUP_PREFIX) 64 @Override 65 public int computeVerticalScrollExtent() { 66 return super.computeVerticalScrollExtent(); 67 } 68 69- @RestrictTo(LIBRARY_GROUP_PREFIX) 70 @Override 71 public int computeHorizontalScrollRange() { 72 return super.computeHorizontalScrollRange(); 73 } 74 75- @RestrictTo(LIBRARY_GROUP_PREFIX) 76 @Override 77 public int computeHorizontalScrollOffset() { 78 return super.computeHorizontalScrollOffset(); 79 } 80 81- @RestrictTo(LIBRARY_GROUP_PREFIX) 82 @Override 83 public int computeHorizontalScrollExtent() { 84 return super.computeHorizontalScrollExtent(); 85@@ -2163,13 +2162,17 @@ 86 87 @Override 88 public void requestChildFocus(View child, View focused) { 89+ onRequestChildFocus(child, focused); 90+ super.requestChildFocus(child, focused); 91+ } 92+ 93+ protected void onRequestChildFocus(View child, View focused) { 94 if (!mIsLayoutDirty) { 95 scrollToChild(focused); 96 } else { 97 // The child may not be laid out yet, we can't compute the scroll yet 98 mChildToScrollTo = focused; 99 } 100- super.requestChildFocus(child, focused); 101 } 102 103 104