diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2018-11-01 16:37:03 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2018-11-06 14:50:16 -0800 |
commit | dcf917b1336dd21a9cfdfcf1d7c61c98b3f949d1 (patch) | |
tree | 7b8de6da300106b987b9c464a7df2ae7fbb5aa27 /src/com/android/launcher3/allapps/FloatingHeaderRow.java | |
parent | 066ace1b8897229445c0fb3515156ef70bdb05e2 (diff) | |
download | android_packages_apps_Trebuchet-dcf917b1336dd21a9cfdfcf1d7c61c98b3f949d1.tar.gz android_packages_apps_Trebuchet-dcf917b1336dd21a9cfdfcf1d7c61c98b3f949d1.tar.bz2 android_packages_apps_Trebuchet-dcf917b1336dd21a9cfdfcf1d7c61c98b3f949d1.zip |
Adding an interface to allow adding custom views in FloatingHeaderView
Bug: 109828640
Change-Id: I9bde5d4fab47eb3e5787bbb741b5b9051a15c0c2
Diffstat (limited to 'src/com/android/launcher3/allapps/FloatingHeaderRow.java')
-rw-r--r-- | src/com/android/launcher3/allapps/FloatingHeaderRow.java | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/com/android/launcher3/allapps/FloatingHeaderRow.java b/src/com/android/launcher3/allapps/FloatingHeaderRow.java new file mode 100644 index 000000000..922e4f1a3 --- /dev/null +++ b/src/com/android/launcher3/allapps/FloatingHeaderRow.java @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.android.launcher3.allapps; + +import android.graphics.Rect; +import android.view.animation.Interpolator; + +import com.android.launcher3.DeviceProfile; +import com.android.launcher3.anim.PropertySetter; + +/** + * A abstract representation of a row in all-apps view + */ +public interface FloatingHeaderRow { + + FloatingHeaderRow[] NO_ROWS = new FloatingHeaderRow[0]; + + void setup(FloatingHeaderView parent, FloatingHeaderRow[] allRows, boolean tabsHidden); + + void setInsets(Rect insets, DeviceProfile grid); + + int getExpectedHeight(); + + /** + * Returns true if the row should draw based on its current position and layout. + */ + boolean shouldDraw(); + + /** + * Returns true if the view has anything worth drawing. This is different than + * {@link #shouldDraw()} as this is called earlier in the layout to determine the view + * position. + */ + boolean hasVisibleContent(); + + void setContentVisibility(boolean hasHeaderExtra, boolean hasContent, + PropertySetter setter, Interpolator fadeInterpolator); + + /** + * Scrolls the content vertically. + */ + void setVerticalScroll(int scroll, boolean isScrolledOut); + + Class<? extends FloatingHeaderRow> getTypeClass(); +} |