mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-17 17:48:20 +00:00
Merge "split the scrolling logging into work,personal, and search" into tm-qpr-dev am: 994bed564e
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20929664 Change-Id: I3651960990a9f4ffbee6e3036683528bb917c894 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -17,11 +17,15 @@ package com.android.launcher3.allapps;
|
||||
|
||||
import static com.android.launcher3.logger.LauncherAtom.ContainerInfo;
|
||||
import static com.android.launcher3.logger.LauncherAtom.SearchResultContainer;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_SCROLLED_DOWN;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_PERSONAL_SCROLLED_DOWN;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_PERSONAL_SCROLLED_UP;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_SCROLLED_UNKNOWN_DIRECTION;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_SCROLLED_UP;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_SEARCH_SCROLLED_DOWN;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_SEARCH_SCROLLED_UP;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_VERTICAL_SWIPE_BEGIN;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_VERTICAL_SWIPE_END;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_WORK_FAB_BUTTON_COLLAPSE;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_WORK_FAB_BUTTON_EXTEND;
|
||||
import static com.android.launcher3.util.LogConfig.SEARCH_LOGGING;
|
||||
|
||||
import android.content.Context;
|
||||
@@ -275,17 +279,37 @@ public class AllAppsRecyclerView extends FastScrollRecyclerView {
|
||||
private void logCumulativeVerticalScroll() {
|
||||
ActivityContext context = ActivityContext.lookupContext(getContext());
|
||||
StatsLogManager mgr = context.getStatsLogManager();
|
||||
ExtendedEditText editText = context.getAppsView().getSearchUiManager().getEditText();
|
||||
ActivityAllAppsContainerView<?> appsView = context.getAppsView();
|
||||
ExtendedEditText editText = appsView.getSearchUiManager().getEditText();
|
||||
ContainerInfo containerInfo = ContainerInfo.newBuilder().setSearchResultContainer(
|
||||
SearchResultContainer
|
||||
.newBuilder()
|
||||
.setQueryLength((editText == null) ? -1 : editText.length())).build();
|
||||
|
||||
// mCumulativeVerticalScroll == 0 when user comes back to original position, we don't
|
||||
// know the direction of scrolling.
|
||||
mgr.logger().withContainerInfo(containerInfo).log(
|
||||
mCumulativeVerticalScroll == 0 ? LAUNCHER_ALLAPPS_SCROLLED_UNKNOWN_DIRECTION
|
||||
: (mCumulativeVerticalScroll > 0) ? LAUNCHER_ALLAPPS_SCROLLED_DOWN
|
||||
: LAUNCHER_ALLAPPS_SCROLLED_UP);
|
||||
if (mCumulativeVerticalScroll == 0) {
|
||||
// mCumulativeVerticalScroll == 0 when user comes back to original position, we
|
||||
// don't know the direction of scrolling.
|
||||
mgr.logger().withContainerInfo(containerInfo).log(
|
||||
LAUNCHER_ALLAPPS_SCROLLED_UNKNOWN_DIRECTION);
|
||||
return;
|
||||
} else if (appsView.isSearching()) {
|
||||
// In search results page
|
||||
mgr.logger().withContainerInfo(containerInfo).log((mCumulativeVerticalScroll > 0)
|
||||
? LAUNCHER_ALLAPPS_SEARCH_SCROLLED_DOWN
|
||||
: LAUNCHER_ALLAPPS_SEARCH_SCROLLED_UP);
|
||||
return;
|
||||
} else if (appsView.mViewPager != null) {
|
||||
int currentPage = appsView.mViewPager.getCurrentPage();
|
||||
if (currentPage == BaseAllAppsContainerView.AdapterHolder.WORK) {
|
||||
// In work A-Z list
|
||||
mgr.logger().withContainerInfo(containerInfo).log((mCumulativeVerticalScroll > 0)
|
||||
? LAUNCHER_WORK_FAB_BUTTON_COLLAPSE
|
||||
: LAUNCHER_WORK_FAB_BUTTON_EXTEND);
|
||||
return;
|
||||
}
|
||||
}
|
||||
// In personal A-Z list
|
||||
mgr.logger().withContainerInfo(containerInfo).log((mCumulativeVerticalScroll > 0)
|
||||
? LAUNCHER_ALLAPPS_PERSONAL_SCROLLED_DOWN
|
||||
: LAUNCHER_ALLAPPS_PERSONAL_SCROLLED_UP);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,12 +203,10 @@ public class WorkModeSwitch extends LinearLayout implements Insettable,
|
||||
|
||||
public void extend() {
|
||||
mTextView.setVisibility(VISIBLE);
|
||||
mStatsLogManager.logger().log(LAUNCHER_WORK_FAB_BUTTON_EXTEND);
|
||||
}
|
||||
|
||||
public void shrink(){
|
||||
mTextView.setVisibility(GONE);
|
||||
mStatsLogManager.logger().log(LAUNCHER_WORK_FAB_BUTTON_COLLAPSE);
|
||||
}
|
||||
|
||||
public int getScrollThreshold() {
|
||||
|
||||
@@ -558,14 +558,11 @@ public class StatsLogManager implements ResourceBasedOverride {
|
||||
+ "result page etc.")
|
||||
LAUNCHER_ALLAPPS_SCROLLED(985),
|
||||
|
||||
@UiEvent(doc = "User scrolled up on one of the all apps surfaces such as A-Z list, search "
|
||||
+ "result page etc.")
|
||||
LAUNCHER_ALLAPPS_SCROLLED_UP(1229),
|
||||
@UiEvent(doc = "User scrolled up on the all apps personal A-Z list.")
|
||||
LAUNCHER_ALLAPPS_PERSONAL_SCROLLED_UP(1287),
|
||||
|
||||
@UiEvent(doc =
|
||||
"User scrolled down on one of the all apps surfaces such as A-Z list, search "
|
||||
+ "result page etc.")
|
||||
LAUNCHER_ALLAPPS_SCROLLED_DOWN(1230),
|
||||
@UiEvent(doc = "User scrolled down on the all apps personal A-Z list.")
|
||||
LAUNCHER_ALLAPPS_PERSONAL_SCROLLED_DOWN(1288),
|
||||
|
||||
@UiEvent(doc = "User scrolled on one of the all apps surfaces such as A-Z list, search "
|
||||
+ "result page etc and we don't know the direction since user came back to "
|
||||
@@ -626,11 +623,19 @@ public class StatsLogManager implements ResourceBasedOverride {
|
||||
@UiEvent(doc = "User has invoked split to left half with a keyboard shortcut.")
|
||||
LAUNCHER_KEYBOARD_SHORTCUT_SPLIT_LEFT_TOP(1233),
|
||||
|
||||
@UiEvent(doc = "User has collapsed the work FAB button by swiping down")
|
||||
@UiEvent(doc = "User has collapsed the work FAB button by scrolling down in the all apps"
|
||||
+ " work A-Z list.")
|
||||
LAUNCHER_WORK_FAB_BUTTON_COLLAPSE(1276),
|
||||
|
||||
@UiEvent(doc = "User has collapsed the work FAB button by swiping up")
|
||||
@UiEvent(doc = "User has collapsed the work FAB button by scrolling up in the all apps"
|
||||
+ " work A-Z list.")
|
||||
LAUNCHER_WORK_FAB_BUTTON_EXTEND(1277),
|
||||
|
||||
@UiEvent(doc = "User scrolled down on the search result page.")
|
||||
LAUNCHER_ALLAPPS_SEARCH_SCROLLED_DOWN(1285),
|
||||
|
||||
@UiEvent(doc = "User scrolled up on the search result page.")
|
||||
LAUNCHER_ALLAPPS_SEARCH_SCROLLED_UP(1286),
|
||||
;
|
||||
|
||||
// ADD MORE
|
||||
|
||||
Reference in New Issue
Block a user