Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 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 | |
| 17 | package com.android.systemui.statusbar.stack; |
| 18 | |
| 19 | import android.content.Context; |
Christoph Studer | 6e3eceb | 2014-04-01 18:40:27 +0200 | [diff] [blame] | 20 | import android.util.Log; |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 21 | import android.view.View; |
| 22 | import android.view.ViewGroup; |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 23 | |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 24 | import com.android.systemui.R; |
Selim Cinek | 1685e63 | 2014-04-08 02:27:49 +0200 | [diff] [blame] | 25 | import com.android.systemui.statusbar.ExpandableNotificationRow; |
Jorim Jaggi | be565df | 2014-04-28 17:51:23 +0200 | [diff] [blame] | 26 | import com.android.systemui.statusbar.ExpandableView; |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 27 | |
Jorim Jaggi | d4a5744 | 2014-04-10 02:45:55 +0200 | [diff] [blame] | 28 | import java.util.ArrayList; |
| 29 | |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 30 | /** |
| 31 | * The Algorithm of the {@link com.android.systemui.statusbar.stack |
| 32 | * .NotificationStackScrollLayout} which can be queried for {@link com.android.systemui.statusbar |
| 33 | * .stack.StackScrollState} |
| 34 | */ |
| 35 | public class StackScrollAlgorithm { |
| 36 | |
Christoph Studer | 6e3eceb | 2014-04-01 18:40:27 +0200 | [diff] [blame] | 37 | private static final String LOG_TAG = "StackScrollAlgorithm"; |
| 38 | |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 39 | private static final int MAX_ITEMS_IN_BOTTOM_STACK = 3; |
| 40 | private static final int MAX_ITEMS_IN_TOP_STACK = 3; |
| 41 | |
| 42 | private int mPaddingBetweenElements; |
| 43 | private int mCollapsedSize; |
| 44 | private int mTopStackPeekSize; |
| 45 | private int mBottomStackPeekSize; |
| 46 | private int mZDistanceBetweenElements; |
| 47 | private int mZBasicHeight; |
| 48 | |
| 49 | private StackIndentationFunctor mTopStackIndentationFunctor; |
| 50 | private StackIndentationFunctor mBottomStackIndentationFunctor; |
| 51 | |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 52 | private int mLayoutHeight; |
Jorim Jaggi | 8c1a44b | 2014-04-29 19:04:02 +0200 | [diff] [blame^] | 53 | |
| 54 | /** mLayoutHeight - mTopPadding */ |
| 55 | private int mInnerHeight; |
| 56 | private int mTopPadding; |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 57 | private StackScrollAlgorithmState mTempAlgorithmState = new StackScrollAlgorithmState(); |
Selim Cinek | 1685e63 | 2014-04-08 02:27:49 +0200 | [diff] [blame] | 58 | private boolean mIsExpansionChanging; |
| 59 | private int mFirstChildMaxHeight; |
| 60 | private boolean mIsExpanded; |
Jorim Jaggi | be565df | 2014-04-28 17:51:23 +0200 | [diff] [blame] | 61 | private ExpandableView mFirstChildWhileExpanding; |
Selim Cinek | 1685e63 | 2014-04-08 02:27:49 +0200 | [diff] [blame] | 62 | private boolean mExpandedOnStart; |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 63 | private int mTopStackTotalSize; |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 64 | |
| 65 | public StackScrollAlgorithm(Context context) { |
| 66 | initConstants(context); |
| 67 | } |
| 68 | |
| 69 | private void initConstants(Context context) { |
Jorim Jaggi | fe40f7d | 2014-04-28 15:20:04 +0200 | [diff] [blame] | 70 | mPaddingBetweenElements = context.getResources() |
| 71 | .getDimensionPixelSize(R.dimen.notification_padding); |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 72 | mCollapsedSize = context.getResources() |
Jorim Jaggi | fe40f7d | 2014-04-28 15:20:04 +0200 | [diff] [blame] | 73 | .getDimensionPixelSize(R.dimen.notification_min_height); |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 74 | mTopStackPeekSize = context.getResources() |
| 75 | .getDimensionPixelSize(R.dimen.top_stack_peek_amount); |
| 76 | mBottomStackPeekSize = context.getResources() |
| 77 | .getDimensionPixelSize(R.dimen.bottom_stack_peek_amount); |
| 78 | mZDistanceBetweenElements = context.getResources() |
| 79 | .getDimensionPixelSize(R.dimen.z_distance_between_notifications); |
| 80 | mZBasicHeight = (MAX_ITEMS_IN_BOTTOM_STACK + 1) * mZDistanceBetweenElements; |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 81 | mTopStackTotalSize = mCollapsedSize + mPaddingBetweenElements; |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 82 | mTopStackIndentationFunctor = new PiecewiseLinearIndentationFunctor( |
| 83 | MAX_ITEMS_IN_TOP_STACK, |
| 84 | mTopStackPeekSize, |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 85 | mTopStackTotalSize, |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 86 | 0.5f); |
| 87 | mBottomStackIndentationFunctor = new PiecewiseLinearIndentationFunctor( |
| 88 | MAX_ITEMS_IN_BOTTOM_STACK, |
| 89 | mBottomStackPeekSize, |
Jorim Jaggi | be565df | 2014-04-28 17:51:23 +0200 | [diff] [blame] | 90 | mCollapsedSize + mBottomStackPeekSize + mPaddingBetweenElements, |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 91 | 0.5f); |
| 92 | } |
| 93 | |
| 94 | |
| 95 | public void getStackScrollState(StackScrollState resultState) { |
| 96 | // The state of the local variables are saved in an algorithmState to easily subdivide it |
| 97 | // into multiple phases. |
| 98 | StackScrollAlgorithmState algorithmState = mTempAlgorithmState; |
| 99 | |
| 100 | // First we reset the view states to their default values. |
| 101 | resultState.resetViewStates(); |
| 102 | |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 103 | algorithmState.itemsInTopStack = 0.0f; |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 104 | algorithmState.partialInTop = 0.0f; |
| 105 | algorithmState.lastTopStackIndex = 0; |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 106 | algorithmState.scrolledPixelsTop = 0; |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 107 | algorithmState.itemsInBottomStack = 0.0f; |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 108 | algorithmState.partialInBottom = 0.0f; |
Jorim Jaggi | be565df | 2014-04-28 17:51:23 +0200 | [diff] [blame] | 109 | algorithmState.scrollY = resultState.getScrollY() + mCollapsedSize; |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 110 | |
Jorim Jaggi | d4a5744 | 2014-04-10 02:45:55 +0200 | [diff] [blame] | 111 | updateVisibleChildren(resultState, algorithmState); |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 112 | |
| 113 | // Phase 1: |
| 114 | findNumberOfItemsInTopStackAndUpdateState(resultState, algorithmState); |
| 115 | |
| 116 | // Phase 2: |
| 117 | updatePositionsForState(resultState, algorithmState); |
| 118 | |
| 119 | // Phase 3: |
| 120 | updateZValuesForState(resultState, algorithmState); |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 121 | } |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 122 | |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 123 | /** |
Jorim Jaggi | d4a5744 | 2014-04-10 02:45:55 +0200 | [diff] [blame] | 124 | * Update the visible children on the state. |
| 125 | */ |
| 126 | private void updateVisibleChildren(StackScrollState resultState, |
| 127 | StackScrollAlgorithmState state) { |
| 128 | ViewGroup hostView = resultState.getHostView(); |
| 129 | int childCount = hostView.getChildCount(); |
| 130 | state.visibleChildren.clear(); |
| 131 | state.visibleChildren.ensureCapacity(childCount); |
| 132 | for (int i = 0; i < childCount; i++) { |
Jorim Jaggi | be565df | 2014-04-28 17:51:23 +0200 | [diff] [blame] | 133 | ExpandableView v = (ExpandableView) hostView.getChildAt(i); |
Jorim Jaggi | d4a5744 | 2014-04-10 02:45:55 +0200 | [diff] [blame] | 134 | if (v.getVisibility() != View.GONE) { |
| 135 | state.visibleChildren.add(v); |
| 136 | } |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | /** |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 141 | * Determine the positions for the views. This is the main part of the algorithm. |
| 142 | * |
| 143 | * @param resultState The result state to update if a change to the properties of a child occurs |
| 144 | * @param algorithmState The state in which the current pass of the algorithm is currently in |
| 145 | * and which will be updated |
| 146 | */ |
| 147 | private void updatePositionsForState(StackScrollState resultState, |
| 148 | StackScrollAlgorithmState algorithmState) { |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 149 | |
Selim Cinek | 1685e63 | 2014-04-08 02:27:49 +0200 | [diff] [blame] | 150 | // The starting position of the bottom stack peek |
Jorim Jaggi | 8c1a44b | 2014-04-29 19:04:02 +0200 | [diff] [blame^] | 151 | float bottomPeekStart = mInnerHeight - mBottomStackPeekSize; |
Selim Cinek | 1685e63 | 2014-04-08 02:27:49 +0200 | [diff] [blame] | 152 | |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 153 | // The position where the bottom stack starts. |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 154 | float bottomStackStart = bottomPeekStart - mCollapsedSize; |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 155 | |
| 156 | // The y coordinate of the current child. |
| 157 | float currentYPosition = 0.0f; |
| 158 | |
| 159 | // How far in is the element currently transitioning into the bottom stack. |
| 160 | float yPositionInScrollView = 0.0f; |
| 161 | |
Jorim Jaggi | d4a5744 | 2014-04-10 02:45:55 +0200 | [diff] [blame] | 162 | int childCount = algorithmState.visibleChildren.size(); |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 163 | int numberOfElementsCompletelyIn = (int) algorithmState.itemsInTopStack; |
| 164 | for (int i = 0; i < childCount; i++) { |
Jorim Jaggi | be565df | 2014-04-28 17:51:23 +0200 | [diff] [blame] | 165 | ExpandableView child = algorithmState.visibleChildren.get(i); |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 166 | StackScrollState.ViewState childViewState = resultState.getViewStateForView(child); |
Christoph Studer | 6e3eceb | 2014-04-01 18:40:27 +0200 | [diff] [blame] | 167 | childViewState.location = StackScrollState.ViewState.LOCATION_UNKNOWN; |
Jorim Jaggi | be565df | 2014-04-28 17:51:23 +0200 | [diff] [blame] | 168 | int childHeight = getMaxAllowedChildHeight(child); |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 169 | float yPositionInScrollViewAfterElement = yPositionInScrollView |
| 170 | + childHeight |
| 171 | + mPaddingBetweenElements; |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 172 | float scrollOffset = yPositionInScrollView - algorithmState.scrollY + mCollapsedSize; |
| 173 | |
| 174 | if (i == algorithmState.lastTopStackIndex + 1) { |
| 175 | // Normally the position of this child is the position in the regular scrollview, |
| 176 | // but if the two stacks are very close to each other, |
| 177 | // then have have to push it even more upwards to the position of the bottom |
| 178 | // stack start. |
| 179 | currentYPosition = Math.min(scrollOffset, bottomStackStart); |
| 180 | } |
| 181 | childViewState.yTranslation = currentYPosition; |
| 182 | |
| 183 | // The y position after this element |
| 184 | float nextYPosition = currentYPosition + childHeight + |
| 185 | mPaddingBetweenElements; |
| 186 | |
| 187 | if (i <= algorithmState.lastTopStackIndex) { |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 188 | // Case 1: |
| 189 | // We are in the top Stack |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 190 | updateStateForTopStackChild(algorithmState, |
| 191 | numberOfElementsCompletelyIn, i, childHeight, childViewState, scrollOffset); |
| 192 | clampYTranslation(childViewState, childHeight); |
| 193 | // check if we are overlapping with the bottom stack |
| 194 | if (childViewState.yTranslation + childHeight + mPaddingBetweenElements |
| 195 | >= bottomStackStart && !mIsExpansionChanging) { |
| 196 | // TODO: handle overlapping sizes with end stack better |
| 197 | // we just collapse this element |
| 198 | childViewState.height = mCollapsedSize; |
| 199 | } |
| 200 | } else if (nextYPosition >= bottomStackStart) { |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 201 | // Case 2: |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 202 | // We are in the bottom stack. |
| 203 | if (currentYPosition >= bottomStackStart) { |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 204 | // According to the regular scroll view we are fully translated out of the |
| 205 | // bottom of the screen so we are fully in the bottom stack |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 206 | updateStateForChildFullyInBottomStack(algorithmState, |
| 207 | bottomStackStart, childViewState, childHeight); |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 208 | } else { |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 209 | // According to the regular scroll view we are currently translating out of / |
| 210 | // into the bottom of the screen |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 211 | updateStateForChildTransitioningInBottom(algorithmState, |
| 212 | bottomStackStart, bottomPeekStart, currentYPosition, |
| 213 | childViewState, childHeight); |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 214 | } |
Christoph Studer | 6e3eceb | 2014-04-01 18:40:27 +0200 | [diff] [blame] | 215 | } else { |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 216 | // Case 3: |
| 217 | // We are in the regular scroll area. |
Christoph Studer | 6e3eceb | 2014-04-01 18:40:27 +0200 | [diff] [blame] | 218 | childViewState.location = StackScrollState.ViewState.LOCATION_MAIN_AREA; |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 219 | clampYTranslation(childViewState, childHeight); |
Christoph Studer | 6e3eceb | 2014-04-01 18:40:27 +0200 | [diff] [blame] | 220 | } |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 221 | |
Christoph Studer | 6e3eceb | 2014-04-01 18:40:27 +0200 | [diff] [blame] | 222 | // The first card is always rendered. |
| 223 | if (i == 0) { |
| 224 | childViewState.alpha = 1.0f; |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 225 | childViewState.yTranslation = 0; |
Christoph Studer | 6e3eceb | 2014-04-01 18:40:27 +0200 | [diff] [blame] | 226 | childViewState.location = StackScrollState.ViewState.LOCATION_FIRST_CARD; |
| 227 | } |
| 228 | if (childViewState.location == StackScrollState.ViewState.LOCATION_UNKNOWN) { |
| 229 | Log.wtf(LOG_TAG, "Failed to assign location for child " + i); |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 230 | } |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 231 | currentYPosition = childViewState.yTranslation + childHeight + mPaddingBetweenElements; |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 232 | yPositionInScrollView = yPositionInScrollViewAfterElement; |
Jorim Jaggi | 8c1a44b | 2014-04-29 19:04:02 +0200 | [diff] [blame^] | 233 | |
| 234 | childViewState.yTranslation += mTopPadding; |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 235 | } |
| 236 | } |
| 237 | |
Selim Cinek | 1685e63 | 2014-04-08 02:27:49 +0200 | [diff] [blame] | 238 | /** |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 239 | * Clamp the yTranslation both up and down to valid positions. |
Selim Cinek | 1685e63 | 2014-04-08 02:27:49 +0200 | [diff] [blame] | 240 | * |
Selim Cinek | 1685e63 | 2014-04-08 02:27:49 +0200 | [diff] [blame] | 241 | * @param childViewState the view state of the child |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 242 | * @param childHeight the height of this child |
Selim Cinek | 1685e63 | 2014-04-08 02:27:49 +0200 | [diff] [blame] | 243 | */ |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 244 | private void clampYTranslation(StackScrollState.ViewState childViewState, int childHeight) { |
| 245 | clampPositionToBottomStackStart(childViewState, childHeight); |
| 246 | clampPositionToTopStackEnd(childViewState, childHeight); |
| 247 | } |
| 248 | |
| 249 | /** |
| 250 | * Clamp the yTranslation of the child down such that its end is at most on the beginning of |
| 251 | * the bottom stack. |
| 252 | * |
| 253 | * @param childViewState the view state of the child |
| 254 | * @param childHeight the height of this child |
| 255 | */ |
| 256 | private void clampPositionToBottomStackStart(StackScrollState.ViewState childViewState, |
| 257 | int childHeight) { |
| 258 | childViewState.yTranslation = Math.min(childViewState.yTranslation, |
Jorim Jaggi | 8c1a44b | 2014-04-29 19:04:02 +0200 | [diff] [blame^] | 259 | mInnerHeight - mBottomStackPeekSize - childHeight); |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 260 | } |
| 261 | |
| 262 | /** |
| 263 | * Clamp the yTranslation of the child up such that its end is at lest on the end of the top |
Jorim Jaggi | be565df | 2014-04-28 17:51:23 +0200 | [diff] [blame] | 264 | * stack.get |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 265 | * |
| 266 | * @param childViewState the view state of the child |
| 267 | * @param childHeight the height of this child |
| 268 | */ |
| 269 | private void clampPositionToTopStackEnd(StackScrollState.ViewState childViewState, |
| 270 | int childHeight) { |
| 271 | childViewState.yTranslation = Math.max(childViewState.yTranslation, |
| 272 | mCollapsedSize - childHeight); |
Selim Cinek | 1685e63 | 2014-04-08 02:27:49 +0200 | [diff] [blame] | 273 | } |
| 274 | |
| 275 | private int getMaxAllowedChildHeight(View child) { |
| 276 | if (child instanceof ExpandableNotificationRow) { |
| 277 | ExpandableNotificationRow row = (ExpandableNotificationRow) child; |
| 278 | return row.getMaximumAllowedExpandHeight(); |
Jorim Jaggi | be565df | 2014-04-28 17:51:23 +0200 | [diff] [blame] | 279 | } else if (child instanceof ExpandableView) { |
| 280 | ExpandableView expandableView = (ExpandableView) child; |
| 281 | return expandableView.getActualHeight(); |
Selim Cinek | 1685e63 | 2014-04-08 02:27:49 +0200 | [diff] [blame] | 282 | } |
Jorim Jaggi | be565df | 2014-04-28 17:51:23 +0200 | [diff] [blame] | 283 | return child == null? mCollapsedSize : child.getHeight(); |
Selim Cinek | 1685e63 | 2014-04-08 02:27:49 +0200 | [diff] [blame] | 284 | } |
| 285 | |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 286 | private void updateStateForChildTransitioningInBottom(StackScrollAlgorithmState algorithmState, |
| 287 | float transitioningPositionStart, float bottomPeakStart, float currentYPosition, |
| 288 | StackScrollState.ViewState childViewState, int childHeight) { |
Christoph Studer | 6e3eceb | 2014-04-01 18:40:27 +0200 | [diff] [blame] | 289 | |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 290 | // This is the transitioning element on top of bottom stack, calculate how far we are in. |
| 291 | algorithmState.partialInBottom = 1.0f - ( |
| 292 | (transitioningPositionStart - currentYPosition) / (childHeight + |
| 293 | mPaddingBetweenElements)); |
| 294 | |
| 295 | // the offset starting at the transitionPosition of the bottom stack |
| 296 | float offset = mBottomStackIndentationFunctor.getValue(algorithmState.partialInBottom); |
| 297 | algorithmState.itemsInBottomStack += algorithmState.partialInBottom; |
Jorim Jaggi | fe40f7d | 2014-04-28 15:20:04 +0200 | [diff] [blame] | 298 | childViewState.yTranslation = transitioningPositionStart + offset - childHeight |
| 299 | - mPaddingBetweenElements; |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 300 | |
| 301 | // We want at least to be at the end of the top stack when collapsing |
| 302 | clampPositionToTopStackEnd(childViewState, childHeight); |
| 303 | childViewState.location = StackScrollState.ViewState.LOCATION_MAIN_AREA; |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 304 | } |
| 305 | |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 306 | private void updateStateForChildFullyInBottomStack(StackScrollAlgorithmState algorithmState, |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 307 | float transitioningPositionStart, StackScrollState.ViewState childViewState, |
| 308 | int childHeight) { |
| 309 | |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 310 | float currentYPosition; |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 311 | algorithmState.itemsInBottomStack += 1.0f; |
| 312 | if (algorithmState.itemsInBottomStack < MAX_ITEMS_IN_BOTTOM_STACK) { |
| 313 | // We are visually entering the bottom stack |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 314 | currentYPosition = transitioningPositionStart |
Jorim Jaggi | fe40f7d | 2014-04-28 15:20:04 +0200 | [diff] [blame] | 315 | + mBottomStackIndentationFunctor.getValue(algorithmState.itemsInBottomStack) |
| 316 | - mPaddingBetweenElements; |
Christoph Studer | 6e3eceb | 2014-04-01 18:40:27 +0200 | [diff] [blame] | 317 | childViewState.location = StackScrollState.ViewState.LOCATION_BOTTOM_STACK_PEEKING; |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 318 | } else { |
| 319 | // we are fully inside the stack |
| 320 | if (algorithmState.itemsInBottomStack > MAX_ITEMS_IN_BOTTOM_STACK + 2) { |
| 321 | childViewState.alpha = 0.0f; |
| 322 | } else if (algorithmState.itemsInBottomStack |
| 323 | > MAX_ITEMS_IN_BOTTOM_STACK + 1) { |
| 324 | childViewState.alpha = 1.0f - algorithmState.partialInBottom; |
| 325 | } |
Christoph Studer | 6e3eceb | 2014-04-01 18:40:27 +0200 | [diff] [blame] | 326 | childViewState.location = StackScrollState.ViewState.LOCATION_BOTTOM_STACK_HIDDEN; |
Jorim Jaggi | 8c1a44b | 2014-04-29 19:04:02 +0200 | [diff] [blame^] | 327 | currentYPosition = mInnerHeight; |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 328 | } |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 329 | childViewState.yTranslation = currentYPosition - childHeight; |
| 330 | clampPositionToTopStackEnd(childViewState, childHeight); |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 331 | } |
| 332 | |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 333 | private void updateStateForTopStackChild(StackScrollAlgorithmState algorithmState, |
| 334 | int numberOfElementsCompletelyIn, int i, int childHeight, |
| 335 | StackScrollState.ViewState childViewState, float scrollOffset) { |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 336 | |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 337 | |
| 338 | // First we calculate the index relative to the current stack window of size at most |
| 339 | // {@link #MAX_ITEMS_IN_TOP_STACK} |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 340 | int paddedIndex = i - 1 |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 341 | - Math.max(numberOfElementsCompletelyIn - MAX_ITEMS_IN_TOP_STACK, 0); |
| 342 | if (paddedIndex >= 0) { |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 343 | |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 344 | // We are currently visually entering the top stack |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 345 | float distanceToStack = childHeight - algorithmState.scrolledPixelsTop; |
| 346 | if (i == algorithmState.lastTopStackIndex && distanceToStack > mTopStackTotalSize) { |
| 347 | |
| 348 | // Child is currently translating into stack but not yet inside slow down zone. |
| 349 | // Handle it like the regular scrollview. |
| 350 | childViewState.yTranslation = scrollOffset; |
Christoph Studer | 6e3eceb | 2014-04-01 18:40:27 +0200 | [diff] [blame] | 351 | } else { |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 352 | // Apply stacking logic. |
| 353 | float numItemsBefore; |
| 354 | if (i == algorithmState.lastTopStackIndex) { |
| 355 | numItemsBefore = 1.0f - (distanceToStack / mTopStackTotalSize); |
| 356 | } else { |
| 357 | numItemsBefore = algorithmState.itemsInTopStack - i; |
| 358 | } |
| 359 | // The end position of the current child |
| 360 | float currentChildEndY = mCollapsedSize + mTopStackTotalSize - |
| 361 | mTopStackIndentationFunctor.getValue(numItemsBefore); |
| 362 | childViewState.yTranslation = currentChildEndY - childHeight; |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 363 | } |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 364 | childViewState.location = StackScrollState.ViewState.LOCATION_TOP_STACK_PEEKING; |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 365 | } else { |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 366 | if (paddedIndex == -1) { |
| 367 | childViewState.alpha = 1.0f - algorithmState.partialInTop; |
| 368 | } else { |
| 369 | // We are hidden behind the top card and faded out, so we can hide ourselves. |
| 370 | childViewState.alpha = 0.0f; |
| 371 | } |
| 372 | childViewState.yTranslation = mCollapsedSize - childHeight; |
Christoph Studer | 6e3eceb | 2014-04-01 18:40:27 +0200 | [diff] [blame] | 373 | childViewState.location = StackScrollState.ViewState.LOCATION_TOP_STACK_HIDDEN; |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 374 | } |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 375 | |
| 376 | |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 377 | } |
| 378 | |
| 379 | /** |
| 380 | * Find the number of items in the top stack and update the result state if needed. |
| 381 | * |
| 382 | * @param resultState The result state to update if a height change of an child occurs |
| 383 | * @param algorithmState The state in which the current pass of the algorithm is currently in |
| 384 | * and which will be updated |
| 385 | */ |
| 386 | private void findNumberOfItemsInTopStackAndUpdateState(StackScrollState resultState, |
| 387 | StackScrollAlgorithmState algorithmState) { |
| 388 | |
| 389 | // The y Position if the element would be in a regular scrollView |
| 390 | float yPositionInScrollView = 0.0f; |
Jorim Jaggi | d4a5744 | 2014-04-10 02:45:55 +0200 | [diff] [blame] | 391 | int childCount = algorithmState.visibleChildren.size(); |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 392 | |
| 393 | // find the number of elements in the top stack. |
| 394 | for (int i = 0; i < childCount; i++) { |
Jorim Jaggi | be565df | 2014-04-28 17:51:23 +0200 | [diff] [blame] | 395 | ExpandableView child = algorithmState.visibleChildren.get(i); |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 396 | StackScrollState.ViewState childViewState = resultState.getViewStateForView(child); |
Jorim Jaggi | be565df | 2014-04-28 17:51:23 +0200 | [diff] [blame] | 397 | int childHeight = getMaxAllowedChildHeight(child); |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 398 | float yPositionInScrollViewAfterElement = yPositionInScrollView |
| 399 | + childHeight |
| 400 | + mPaddingBetweenElements; |
| 401 | if (yPositionInScrollView < algorithmState.scrollY) { |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 402 | if (i == 0 && algorithmState.scrollY == mCollapsedSize) { |
| 403 | |
| 404 | // The starting position of the bottom stack peek |
Jorim Jaggi | 8c1a44b | 2014-04-29 19:04:02 +0200 | [diff] [blame^] | 405 | int bottomPeekStart = mInnerHeight - mBottomStackPeekSize; |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 406 | // Collapse and expand the first child while the shade is being expanded |
| 407 | float maxHeight = mIsExpansionChanging && child == mFirstChildWhileExpanding |
| 408 | ? mFirstChildMaxHeight |
| 409 | : childHeight; |
| 410 | childViewState.height = (int) Math.max(Math.min(bottomPeekStart, maxHeight), |
| 411 | mCollapsedSize); |
| 412 | algorithmState.itemsInTopStack = 1.0f; |
| 413 | |
| 414 | } else if (yPositionInScrollViewAfterElement < algorithmState.scrollY) { |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 415 | // According to the regular scroll view we are fully off screen |
| 416 | algorithmState.itemsInTopStack += 1.0f; |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 417 | if (i == 0) { |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 418 | childViewState.height = mCollapsedSize; |
| 419 | } |
| 420 | } else { |
| 421 | // According to the regular scroll view we are partially off screen |
| 422 | // If it is expanded we have to collapse it to a new size |
| 423 | float newSize = yPositionInScrollViewAfterElement |
| 424 | - mPaddingBetweenElements |
| 425 | - algorithmState.scrollY; |
| 426 | |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 427 | if (i == 0) { |
| 428 | newSize += mCollapsedSize; |
| 429 | } |
| 430 | |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 431 | // How much did we scroll into this child |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 432 | algorithmState.scrolledPixelsTop = childHeight - newSize; |
| 433 | algorithmState.partialInTop = (algorithmState.scrolledPixelsTop) / (childHeight |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 434 | + mPaddingBetweenElements); |
| 435 | |
| 436 | // Our element can be expanded, so this can get negative |
| 437 | algorithmState.partialInTop = Math.max(0.0f, algorithmState.partialInTop); |
| 438 | algorithmState.itemsInTopStack += algorithmState.partialInTop; |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 439 | newSize = Math.max(mCollapsedSize, newSize); |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 440 | if (i == 0) { |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 441 | childViewState.height = (int) newSize; |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 442 | } |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 443 | algorithmState.lastTopStackIndex = i; |
| 444 | break; |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 445 | } |
| 446 | } else { |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 447 | algorithmState.lastTopStackIndex = i - 1; |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 448 | // We are already past the stack so we can end the loop |
| 449 | break; |
| 450 | } |
| 451 | yPositionInScrollView = yPositionInScrollViewAfterElement; |
| 452 | } |
| 453 | } |
| 454 | |
| 455 | /** |
| 456 | * Calculate the Z positions for all children based on the number of items in both stacks and |
| 457 | * save it in the resultState |
| 458 | * |
| 459 | * @param resultState The result state to update the zTranslation values |
| 460 | * @param algorithmState The state in which the current pass of the algorithm is currently in |
| 461 | */ |
| 462 | private void updateZValuesForState(StackScrollState resultState, |
| 463 | StackScrollAlgorithmState algorithmState) { |
Jorim Jaggi | d4a5744 | 2014-04-10 02:45:55 +0200 | [diff] [blame] | 464 | int childCount = algorithmState.visibleChildren.size(); |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 465 | for (int i = 0; i < childCount; i++) { |
Jorim Jaggi | d4a5744 | 2014-04-10 02:45:55 +0200 | [diff] [blame] | 466 | View child = algorithmState.visibleChildren.get(i); |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 467 | StackScrollState.ViewState childViewState = resultState.getViewStateForView(child); |
| 468 | if (i < algorithmState.itemsInTopStack) { |
| 469 | float stackIndex = algorithmState.itemsInTopStack - i; |
| 470 | stackIndex = Math.min(stackIndex, MAX_ITEMS_IN_TOP_STACK + 2); |
| 471 | childViewState.zTranslation = mZBasicHeight |
| 472 | + stackIndex * mZDistanceBetweenElements; |
| 473 | } else if (i > (childCount - 1 - algorithmState.itemsInBottomStack)) { |
| 474 | float numItemsAbove = i - (childCount - 1 - algorithmState.itemsInBottomStack); |
| 475 | float translationZ = mZBasicHeight |
| 476 | - numItemsAbove * mZDistanceBetweenElements; |
| 477 | childViewState.zTranslation = translationZ; |
| 478 | } else { |
| 479 | childViewState.zTranslation = mZBasicHeight; |
| 480 | } |
| 481 | } |
| 482 | } |
| 483 | |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 484 | public void setLayoutHeight(int layoutHeight) { |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 485 | this.mLayoutHeight = layoutHeight; |
Jorim Jaggi | 8c1a44b | 2014-04-29 19:04:02 +0200 | [diff] [blame^] | 486 | updateInnerHeight(); |
| 487 | } |
| 488 | |
| 489 | public void setTopPadding(int topPadding) { |
| 490 | mTopPadding = topPadding; |
| 491 | updateInnerHeight(); |
| 492 | } |
| 493 | |
| 494 | private void updateInnerHeight() { |
| 495 | mInnerHeight = mLayoutHeight - mTopPadding; |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 496 | } |
| 497 | |
Selim Cinek | 1685e63 | 2014-04-08 02:27:49 +0200 | [diff] [blame] | 498 | public void onExpansionStarted(StackScrollState currentState) { |
| 499 | mIsExpansionChanging = true; |
| 500 | mExpandedOnStart = mIsExpanded; |
| 501 | ViewGroup hostView = currentState.getHostView(); |
| 502 | updateFirstChildHeightWhileExpanding(hostView); |
| 503 | } |
| 504 | |
| 505 | private void updateFirstChildHeightWhileExpanding(ViewGroup hostView) { |
Jorim Jaggi | be565df | 2014-04-28 17:51:23 +0200 | [diff] [blame] | 506 | mFirstChildWhileExpanding = (ExpandableView) findFirstVisibleChild(hostView); |
Jorim Jaggi | 9f347ae | 2014-04-11 00:47:18 +0200 | [diff] [blame] | 507 | if (mFirstChildWhileExpanding != null) { |
Selim Cinek | 1685e63 | 2014-04-08 02:27:49 +0200 | [diff] [blame] | 508 | if (mExpandedOnStart) { |
| 509 | |
| 510 | // We are collapsing the shade, so the first child can get as most as high as the |
| 511 | // current height. |
Jorim Jaggi | be565df | 2014-04-28 17:51:23 +0200 | [diff] [blame] | 512 | mFirstChildMaxHeight = mFirstChildWhileExpanding.getActualHeight(); |
Selim Cinek | 1685e63 | 2014-04-08 02:27:49 +0200 | [diff] [blame] | 513 | } else { |
| 514 | |
| 515 | // We are expanding the shade, expand it to its full height. |
Selim Cinek | b6e0e12 | 2014-04-23 17:24:37 +0200 | [diff] [blame] | 516 | if (mFirstChildWhileExpanding.getWidth() == 0) { |
| 517 | |
| 518 | // This child was not layouted yet, wait for a layout pass |
| 519 | mFirstChildWhileExpanding |
| 520 | .addOnLayoutChangeListener(new View.OnLayoutChangeListener() { |
| 521 | @Override |
| 522 | public void onLayoutChange(View v, int left, int top, int right, |
| 523 | int bottom, int oldLeft, int oldTop, int oldRight, |
| 524 | int oldBottom) { |
Selim Cinek | 2ba5f1f | 2014-04-28 20:23:30 +0200 | [diff] [blame] | 525 | if (mFirstChildWhileExpanding != null) { |
| 526 | mFirstChildMaxHeight = getMaxAllowedChildHeight( |
| 527 | mFirstChildWhileExpanding); |
| 528 | } else { |
| 529 | mFirstChildMaxHeight = 0; |
| 530 | } |
| 531 | v.removeOnLayoutChangeListener(this); |
Selim Cinek | b6e0e12 | 2014-04-23 17:24:37 +0200 | [diff] [blame] | 532 | } |
| 533 | }); |
| 534 | } else { |
| 535 | mFirstChildMaxHeight = getMaxAllowedChildHeight(mFirstChildWhileExpanding); |
| 536 | } |
Selim Cinek | 1685e63 | 2014-04-08 02:27:49 +0200 | [diff] [blame] | 537 | } |
| 538 | } else { |
Selim Cinek | 1685e63 | 2014-04-08 02:27:49 +0200 | [diff] [blame] | 539 | mFirstChildMaxHeight = 0; |
| 540 | } |
| 541 | } |
| 542 | |
Jorim Jaggi | 9f347ae | 2014-04-11 00:47:18 +0200 | [diff] [blame] | 543 | private View findFirstVisibleChild(ViewGroup container) { |
| 544 | int childCount = container.getChildCount(); |
| 545 | for (int i = 0; i < childCount; i++) { |
| 546 | View child = container.getChildAt(i); |
| 547 | if (child.getVisibility() != View.GONE) { |
| 548 | return child; |
| 549 | } |
| 550 | } |
| 551 | return null; |
| 552 | } |
| 553 | |
Selim Cinek | 1685e63 | 2014-04-08 02:27:49 +0200 | [diff] [blame] | 554 | public void onExpansionStopped() { |
| 555 | mIsExpansionChanging = false; |
| 556 | mFirstChildWhileExpanding = null; |
| 557 | } |
| 558 | |
| 559 | public void setIsExpanded(boolean isExpanded) { |
| 560 | this.mIsExpanded = isExpanded; |
| 561 | } |
| 562 | |
| 563 | public void notifyChildrenChanged(ViewGroup hostView) { |
| 564 | if (mIsExpansionChanging) { |
| 565 | updateFirstChildHeightWhileExpanding(hostView); |
| 566 | } |
| 567 | } |
| 568 | |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 569 | class StackScrollAlgorithmState { |
| 570 | |
| 571 | /** |
| 572 | * The scroll position of the algorithm |
| 573 | */ |
| 574 | public int scrollY; |
| 575 | |
| 576 | /** |
| 577 | * The quantity of items which are in the top stack. |
| 578 | */ |
| 579 | public float itemsInTopStack; |
| 580 | |
| 581 | /** |
| 582 | * how far in is the element currently transitioning into the top stack |
| 583 | */ |
| 584 | public float partialInTop; |
| 585 | |
| 586 | /** |
Selim Cinek | 343e6e2 | 2014-04-11 21:23:30 +0200 | [diff] [blame] | 587 | * The number of pixels the last child in the top stack has scrolled in to the stack |
| 588 | */ |
| 589 | public float scrolledPixelsTop; |
| 590 | |
| 591 | /** |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 592 | * The last item index which is in the top stack. |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 593 | */ |
| 594 | public int lastTopStackIndex; |
| 595 | |
| 596 | /** |
| 597 | * The quantity of items which are in the bottom stack. |
| 598 | */ |
| 599 | public float itemsInBottomStack; |
| 600 | |
| 601 | /** |
| 602 | * how far in is the element currently transitioning into the bottom stack |
| 603 | */ |
| 604 | public float partialInBottom; |
Jorim Jaggi | d4a5744 | 2014-04-10 02:45:55 +0200 | [diff] [blame] | 605 | |
| 606 | /** |
| 607 | * The children from the host view which are not gone. |
| 608 | */ |
Jorim Jaggi | be565df | 2014-04-28 17:51:23 +0200 | [diff] [blame] | 609 | public final ArrayList<ExpandableView> visibleChildren = new ArrayList<ExpandableView>(); |
Selim Cinek | 67b2260 | 2014-03-10 15:40:16 +0100 | [diff] [blame] | 610 | } |
| 611 | |
| 612 | } |