Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0c322fae authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "More logging for the widgets scroll bug" into ub-launcher3-master

parents 688cc03c b35bdbc8
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -20,8 +20,10 @@ import android.util.Log;

import androidx.recyclerview.widget.RecyclerView;

import com.android.launcher3.Utilities;
import com.android.launcher3.icons.IconCache;
import com.android.launcher3.model.data.PackageItemInfo;
import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.widget.WidgetsListAdapter.WidgetListRowEntryComparator;

import java.util.ArrayList;
@@ -32,8 +34,8 @@ import java.util.Iterator;
 * methods accordingly.
 */
public class WidgetsDiffReporter {
    private static final boolean DEBUG = false;
    private static final String TAG = "WidgetsDiffReporter";
    private static final boolean DEBUG = Utilities.IS_RUNNING_IN_TEST_HARNESS; // b/160238801
    private static final String TAG = TestProtocol.NO_SCROLL_END_WIDGETS;

    private final IconCache mIconCache;
    private final RecyclerView.Adapter mListener;
+7 −0
Original line number Diff line number Diff line
@@ -120,6 +120,9 @@ public class WidgetsRecyclerView extends BaseRecyclerView implements OnItemTouch
    public int getCurrentScrollY() {
        // Skip early if widgets are not bound.
        if (isModelNotReady() || getChildCount() == 0) {
            if (Utilities.IS_RUNNING_IN_TEST_HARNESS) {
                Log.d(TestProtocol.NO_SCROLL_END_WIDGETS, "getCurrentScrollY: -1");
            }
            return -1;
        }

@@ -128,6 +131,10 @@ public class WidgetsRecyclerView extends BaseRecyclerView implements OnItemTouch
        int y = (child.getMeasuredHeight() * rowIndex);
        int offset = getLayoutManager().getDecoratedTop(child);

        if (Utilities.IS_RUNNING_IN_TEST_HARNESS) {
            Log.d(TestProtocol.NO_SCROLL_END_WIDGETS,
                    "getCurrentScrollY: " + (getPaddingTop() + y - offset));
        }
        return getPaddingTop() + y - offset;
    }