AllAppsSearchPlugin.java 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (C) 2020 The Android Open Source Project
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package com.android.systemui.plugins;
  17. import android.app.Activity;
  18. import android.view.ViewGroup;
  19. import android.widget.EditText;
  20. import com.android.systemui.plugins.annotations.ProvidesInterface;
  21. /**
  22. * Implement this plugin interface to replace the all apps recycler view of the all apps drawer.
  23. */
  24. @ProvidesInterface(action = AllAppsSearchPlugin.ACTION, version = AllAppsSearchPlugin.VERSION)
  25. public interface AllAppsSearchPlugin extends Plugin {
  26. String ACTION = "com.android.systemui.action.PLUGIN_ALL_APPS_SEARCH_ACTIONS";
  27. int VERSION = 3;
  28. /** Following are the order that these methods should be called. */
  29. void setup(ViewGroup parent, Activity activity, float allAppsContainerHeight);
  30. /**
  31. * When drag starts, pass window inset related fields and the progress to indicate
  32. * whether user is swiping down or swiping up
  33. */
  34. void onDragStart(float progress);
  35. /** progress is between [0, 1] 1: down, 0: up */
  36. void setProgress(float progress);
  37. /** Called when container animation stops, so that plugin can perform cleanups */
  38. void onAnimationEnd(float progress);
  39. /** pass over the search box object */
  40. void setEditText(EditText editText);
  41. }