AllAppsRow.java 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright (C) 2018 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.view.View;
  18. import android.view.ViewGroup;
  19. import com.android.systemui.plugins.annotations.ProvidesInterface;
  20. /**
  21. * Implement this plugin interface to add a row of views to the top of the all apps drawer.
  22. */
  23. @ProvidesInterface(action = AllAppsRow.ACTION, version = AllAppsRow.VERSION)
  24. public interface AllAppsRow extends Plugin {
  25. String ACTION = "com.android.systemui.action.PLUGIN_ALL_APPS_ACTIONS";
  26. int VERSION = 1;
  27. /**
  28. * Setup the row and return the parent view.
  29. * @param parent The ViewGroup to which launcher will add this row.
  30. */
  31. View setup(ViewGroup parent);
  32. /**
  33. * @return The height to reserve in all apps for your views.
  34. */
  35. int getExpectedHeight();
  36. /**
  37. * Update launcher whenever {@link #getExpectedHeight()} changes.
  38. */
  39. void setOnHeightUpdatedListener(OnHeightUpdatedListener onHeightUpdatedListener);
  40. interface OnHeightUpdatedListener {
  41. void onHeightUpdated();
  42. }
  43. }