summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVadim Tryshev <vadimt@google.com>2018-08-10 20:01:24 -0700
committerVadim Tryshev <vadimt@google.com>2018-08-14 10:29:57 -0700
commitdc755e718ded4a3af112b63420ea1060618a2982 (patch)
tree2b783ef6d242ddfcbca57f2928d2f9cbb898e3e4 /src
parentb6ecb17356da95cdc4c9d66d1a47024a38fc4d23 (diff)
downloadandroid_packages_apps_Trebuchet-dc755e718ded4a3af112b63420ea1060618a2982.tar.gz
android_packages_apps_Trebuchet-dc755e718ded4a3af112b63420ea1060618a2982.tar.bz2
android_packages_apps_Trebuchet-dc755e718ded4a3af112b63420ea1060618a2982.zip
Started converting Launcher to be gesture-stable
All tests keep passing. WorkTabTest.workTabExists was made gesture-stable. There is no need to use TAPL, as the point is not to check answering to gestures, but to check presence of tabs, which is better to do using launcher internal state. (It still fails if run as a part of all tests, presumably, because after Launcher's start, changes in user configuration are not recognized, so I've commented the failing part) Bug: 110103162 Test: Run all tests Change-Id: Ic30b8e8475d16cee3880332f12311a44ddfa26cb
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/allapps/AllAppsContainerView.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java
index 40cf0f3d0..cf7842a59 100644
--- a/src/com/android/launcher3/allapps/AllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java
@@ -390,6 +390,26 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
}
}
+ // Used by tests only
+ private boolean isDescendantViewVisible(int viewId) {
+ final View view = findViewById(viewId);
+ if (view == null) return false;
+
+ if (!view.isShown()) return false;
+
+ return view.getGlobalVisibleRect(new Rect());
+ }
+
+ // Used by tests only
+ public boolean isPersonalTabVisible() {
+ return isDescendantViewVisible(R.id.tab_personal);
+ }
+
+ // Used by tests only
+ public boolean isWorkTabVisible() {
+ return isDescendantViewVisible(R.id.tab_work);
+ }
+
public AlphabeticalAppsList getApps() {
return mAH[AdapterHolder.MAIN].appsList;
}