summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/testing
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2015-09-18 12:11:16 -0700
committerAdam Cohen <adamcohen@google.com>2015-09-18 12:11:16 -0700
commit141b20e0b31a241b4193ae650421a396e6966cbb (patch)
tree42a708e5724d4a73f3db4160539b8b06141bc97c /src/com/android/launcher3/testing
parent0f196e6939ee9f23ea24d046e74fd1d1d3fc953f (diff)
downloadandroid_packages_apps_Trebuchet-141b20e0b31a241b4193ae650421a396e6966cbb.tar.gz
android_packages_apps_Trebuchet-141b20e0b31a241b4193ae650421a396e6966cbb.tar.bz2
android_packages_apps_Trebuchet-141b20e0b31a241b4193ae650421a396e6966cbb.zip
Add fake CustomContent screen for testing Launcher interface
Change-Id: I5f2aee1768fe59ee3079d069ff0be21cdf9282ea
Diffstat (limited to 'src/com/android/launcher3/testing')
-rw-r--r--src/com/android/launcher3/testing/LauncherExtension.java32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/com/android/launcher3/testing/LauncherExtension.java b/src/com/android/launcher3/testing/LauncherExtension.java
index 8702877bf..dac279afa 100644
--- a/src/com/android/launcher3/testing/LauncherExtension.java
+++ b/src/com/android/launcher3/testing/LauncherExtension.java
@@ -5,11 +5,13 @@ import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.content.ComponentName;
import android.content.Intent;
+import android.graphics.Color;
import android.graphics.Rect;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.FrameLayout;
import com.android.launcher3.AppInfo;
import com.android.launcher3.InsettableFrameLayout;
@@ -210,13 +212,39 @@ public class LauncherExtension extends Launcher {
public void startVoice() {
}
+ CustomContentCallbacks mCustomContentCallbacks = new CustomContentCallbacks() {
+
+ // Custom content is completely shown. {@code fromResume} indicates whether this was caused
+ // by a onResume or by scrolling otherwise.
+ public void onShow(boolean fromResume) {
+ }
+
+ // Custom content is completely hidden
+ public void onHide() {
+ }
+
+ // Custom content scroll progress changed. From 0 (not showing) to 1 (fully showing).
+ public void onScrollProgressChanged(float progress) {
+
+ }
+
+ // Indicates whether the user is allowed to scroll away from the custom content.
+ public boolean isScrollingAllowed() {
+ return true;
+ }
+
+ };
+
@Override
public boolean hasCustomContentToLeft() {
- return false;
+ return true;
}
@Override
public void populateCustomContentContainer() {
+ FrameLayout customContent = new FrameLayout(LauncherExtension.this);
+ customContent.setBackgroundColor(Color.GRAY);
+ addToCustomContentPage(customContent, mCustomContentCallbacks, "");
}
@Override
@@ -281,7 +309,7 @@ public class LauncherExtension extends Launcher {
@Override
public boolean hasLauncherOverlay() {
- return true;
+ return false;
}
@Override