ExpandableNotificationRow.java revision c27437b7fd04e682ae2abdf0727a99bf5c6e409d
151c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren/*
251c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren * Copyright (C) 2013 The Android Open Source Project
351c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren *
451c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren * Licensed under the Apache License, Version 2.0 (the "License");
551c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren * you may not use this file except in compliance with the License.
651c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren * You may obtain a copy of the License at
751c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren *
851c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren *      http://www.apache.org/licenses/LICENSE-2.0
951c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren *
1051c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren * Unless required by applicable law or agreed to in writing, software
1151c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren * distributed under the License is distributed on an "AS IS" BASIS,
1251c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1351c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren * See the License for the specific language governing permissions and
1451c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren * limitations under the License.
1551c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren */
1651c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren
1751c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wrenpackage com.android.systemui.statusbar;
1851c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren
1951c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wrenimport android.content.Context;
2051c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wrenimport android.util.AttributeSet;
21a5e0f415d351ad1a9c0ffde8d93df91a2384591fDan Sandlerimport android.view.View;
22fe40f7d13bfc1faa35c9a131ce4be5104cb8f6b9Jorim Jaggiimport android.view.accessibility.AccessibilityEvent;
2351c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren
24a5e0f415d351ad1a9c0ffde8d93df91a2384591fDan Sandlerimport com.android.systemui.R;
25a5e0f415d351ad1a9c0ffde8d93df91a2384591fDan Sandler
264222d9a7fb87d73e1443ec1a2de9782b05741af6Jorim Jaggipublic class ExpandableNotificationRow extends ActivatableNotificationView {
271685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    private int mRowMinHeight;
281685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    private int mRowMaxHeight;
2951c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren
301685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    /** Does this row contain layouts that can adapt to row expansion */
3151c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren    private boolean mExpandable;
321685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    /** Has the user actively changed the expansion state of this row */
331685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    private boolean mHasUserChangedExpansion;
341685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    /** If {@link #mHasUserChangedExpansion}, has the user expanded this row */
3551c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren    private boolean mUserExpanded;
361685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    /** Is the user touching this row */
3751c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren    private boolean mUserLocked;
381685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    /** Are we showing the "public" version */
39a5e0f415d351ad1a9c0ffde8d93df91a2384591fDan Sandler    private boolean mShowingPublic;
4051c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren
411685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    /**
421685e634fb0b14033bd436af8d7174436699ffecSelim Cinek     * Is this notification expanded by the system. The expansion state can be overridden by the
431685e634fb0b14033bd436af8d7174436699ffecSelim Cinek     * user expansion.
441685e634fb0b14033bd436af8d7174436699ffecSelim Cinek     */
451685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    private boolean mIsSystemExpanded;
46dce3c4cca5d4df4cc49c1a9f0537e2fecdbc45d2Jorim Jaggi
47dce3c4cca5d4df4cc49c1a9f0537e2fecdbc45d2Jorim Jaggi    /**
48dce3c4cca5d4df4cc49c1a9f0537e2fecdbc45d2Jorim Jaggi     * Whether the notification expansion is disabled. This is the case on Keyguard.
49dce3c4cca5d4df4cc49c1a9f0537e2fecdbc45d2Jorim Jaggi     */
50dce3c4cca5d4df4cc49c1a9f0537e2fecdbc45d2Jorim Jaggi    private boolean mExpansionDisabled;
51dce3c4cca5d4df4cc49c1a9f0537e2fecdbc45d2Jorim Jaggi
52be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi    private NotificationContentView mPublicLayout;
53be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi    private NotificationContentView mPrivateLayout;
541685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    private int mMaxExpandHeight;
55c27437b7fd04e682ae2abdf0727a99bf5c6e409dSelim Cinek    private boolean mIsBelowSpeedBump;
561685e634fb0b14033bd436af8d7174436699ffecSelim Cinek
5751c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren    public ExpandableNotificationRow(Context context, AttributeSet attrs) {
5851c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren        super(context, attrs);
5951c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren    }
6051c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren
61251957d76e57eb6e5f8068b37346144e10e586a4Jorim Jaggi    @Override
62251957d76e57eb6e5f8068b37346144e10e586a4Jorim Jaggi    protected void onFinishInflate() {
63251957d76e57eb6e5f8068b37346144e10e586a4Jorim Jaggi        super.onFinishInflate();
64be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi        mPublicLayout = (NotificationContentView) findViewById(R.id.expandedPublic);
65be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi        mPrivateLayout = (NotificationContentView) findViewById(R.id.expanded);
66fe40f7d13bfc1faa35c9a131ce4be5104cb8f6b9Jorim Jaggi    }
67fe40f7d13bfc1faa35c9a131ce4be5104cb8f6b9Jorim Jaggi
68fe40f7d13bfc1faa35c9a131ce4be5104cb8f6b9Jorim Jaggi    @Override
69fe40f7d13bfc1faa35c9a131ce4be5104cb8f6b9Jorim Jaggi    public boolean onRequestSendAccessibilityEvent(View child, AccessibilityEvent event) {
70fe40f7d13bfc1faa35c9a131ce4be5104cb8f6b9Jorim Jaggi        if (super.onRequestSendAccessibilityEvent(child, event)) {
71fe40f7d13bfc1faa35c9a131ce4be5104cb8f6b9Jorim Jaggi            // Add a record for the entire layout since its content is somehow small.
72fe40f7d13bfc1faa35c9a131ce4be5104cb8f6b9Jorim Jaggi            // The event comes from a leaf view that is interacted with.
73fe40f7d13bfc1faa35c9a131ce4be5104cb8f6b9Jorim Jaggi            AccessibilityEvent record = AccessibilityEvent.obtain();
74fe40f7d13bfc1faa35c9a131ce4be5104cb8f6b9Jorim Jaggi            onInitializeAccessibilityEvent(record);
75fe40f7d13bfc1faa35c9a131ce4be5104cb8f6b9Jorim Jaggi            dispatchPopulateAccessibilityEvent(record);
76fe40f7d13bfc1faa35c9a131ce4be5104cb8f6b9Jorim Jaggi            event.appendRecord(record);
77fe40f7d13bfc1faa35c9a131ce4be5104cb8f6b9Jorim Jaggi            return true;
78fe40f7d13bfc1faa35c9a131ce4be5104cb8f6b9Jorim Jaggi        }
79fe40f7d13bfc1faa35c9a131ce4be5104cb8f6b9Jorim Jaggi        return false;
80c5dc0d0cce373fbf292e13633c114a431d747167Jorim Jaggi    }
8151c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren
821685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    public void setHeightRange(int rowMinHeight, int rowMaxHeight) {
831685e634fb0b14033bd436af8d7174436699ffecSelim Cinek        mRowMinHeight = rowMinHeight;
841685e634fb0b14033bd436af8d7174436699ffecSelim Cinek        mRowMaxHeight = rowMaxHeight;
8551c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren    }
8651c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren
8751c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren    public boolean isExpandable() {
8851c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren        return mExpandable;
8951c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren    }
9051c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren
9151c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren    public void setExpandable(boolean expandable) {
9251c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren        mExpandable = expandable;
9351c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren    }
9451c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren
951685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    /**
961685e634fb0b14033bd436af8d7174436699ffecSelim Cinek     * @return whether the user has changed the expansion state
971685e634fb0b14033bd436af8d7174436699ffecSelim Cinek     */
981685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    public boolean hasUserChangedExpansion() {
991685e634fb0b14033bd436af8d7174436699ffecSelim Cinek        return mHasUserChangedExpansion;
1001685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    }
1011685e634fb0b14033bd436af8d7174436699ffecSelim Cinek
10251c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren    public boolean isUserExpanded() {
10351c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren        return mUserExpanded;
10451c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren    }
10551c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren
1061685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    /**
1071685e634fb0b14033bd436af8d7174436699ffecSelim Cinek     * Set this notification to be expanded by the user
1081685e634fb0b14033bd436af8d7174436699ffecSelim Cinek     *
1091685e634fb0b14033bd436af8d7174436699ffecSelim Cinek     * @param userExpanded whether the user wants this notification to be expanded
1101685e634fb0b14033bd436af8d7174436699ffecSelim Cinek     */
11151c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren    public void setUserExpanded(boolean userExpanded) {
1121685e634fb0b14033bd436af8d7174436699ffecSelim Cinek        mHasUserChangedExpansion = true;
11351c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren        mUserExpanded = userExpanded;
11451c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren    }
11551c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren
11651c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren    public boolean isUserLocked() {
11751c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren        return mUserLocked;
11851c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren    }
11951c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren
12051c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren    public void setUserLocked(boolean userLocked) {
12151c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren        mUserLocked = userLocked;
12251c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren    }
12351c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren
1241685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    /**
1251685e634fb0b14033bd436af8d7174436699ffecSelim Cinek     * @return has the system set this notification to be expanded
1261685e634fb0b14033bd436af8d7174436699ffecSelim Cinek     */
1271685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    public boolean isSystemExpanded() {
1281685e634fb0b14033bd436af8d7174436699ffecSelim Cinek        return mIsSystemExpanded;
1291685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    }
1301685e634fb0b14033bd436af8d7174436699ffecSelim Cinek
1311685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    /**
1321685e634fb0b14033bd436af8d7174436699ffecSelim Cinek     * Set this notification to be expanded by the system.
1331685e634fb0b14033bd436af8d7174436699ffecSelim Cinek     *
1341685e634fb0b14033bd436af8d7174436699ffecSelim Cinek     * @param expand whether the system wants this notification to be expanded.
1351685e634fb0b14033bd436af8d7174436699ffecSelim Cinek     */
1361685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    public void setSystemExpanded(boolean expand) {
1371685e634fb0b14033bd436af8d7174436699ffecSelim Cinek        mIsSystemExpanded = expand;
1389cbadd3c08a7d7dd3412743dd04aecb16c5a1595Jorim Jaggi        notifyHeightChanged();
139dce3c4cca5d4df4cc49c1a9f0537e2fecdbc45d2Jorim Jaggi    }
140dce3c4cca5d4df4cc49c1a9f0537e2fecdbc45d2Jorim Jaggi
141dce3c4cca5d4df4cc49c1a9f0537e2fecdbc45d2Jorim Jaggi    /**
142dce3c4cca5d4df4cc49c1a9f0537e2fecdbc45d2Jorim Jaggi     * @param expansionDisabled whether to prevent notification expansion
143dce3c4cca5d4df4cc49c1a9f0537e2fecdbc45d2Jorim Jaggi     */
144dce3c4cca5d4df4cc49c1a9f0537e2fecdbc45d2Jorim Jaggi    public void setExpansionDisabled(boolean expansionDisabled) {
145dce3c4cca5d4df4cc49c1a9f0537e2fecdbc45d2Jorim Jaggi        mExpansionDisabled = expansionDisabled;
1469cbadd3c08a7d7dd3412743dd04aecb16c5a1595Jorim Jaggi        notifyHeightChanged();
1471685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    }
1481685e634fb0b14033bd436af8d7174436699ffecSelim Cinek
1491685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    /**
1501685e634fb0b14033bd436af8d7174436699ffecSelim Cinek     * Apply an expansion state to the layout.
1511685e634fb0b14033bd436af8d7174436699ffecSelim Cinek     */
152dce3c4cca5d4df4cc49c1a9f0537e2fecdbc45d2Jorim Jaggi    public void applyExpansionToLayout() {
153dce3c4cca5d4df4cc49c1a9f0537e2fecdbc45d2Jorim Jaggi        boolean expand = isExpanded();
15451c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren        if (expand && mExpandable) {
155be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi            setActualHeight(mMaxExpandHeight);
15651c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren        } else {
157be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi            setActualHeight(mRowMinHeight);
15851c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren        }
15951c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren    }
160a5e0f415d351ad1a9c0ffde8d93df91a2384591fDan Sandler
1619cbadd3c08a7d7dd3412743dd04aecb16c5a1595Jorim Jaggi    @Override
1629cbadd3c08a7d7dd3412743dd04aecb16c5a1595Jorim Jaggi    public int getIntrinsicHeight() {
163be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi        if (isUserLocked()) {
164be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi            return getActualHeight();
165be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi        }
1661685e634fb0b14033bd436af8d7174436699ffecSelim Cinek        boolean inExpansionState = isExpanded();
1671685e634fb0b14033bd436af8d7174436699ffecSelim Cinek        if (!inExpansionState) {
1681685e634fb0b14033bd436af8d7174436699ffecSelim Cinek            // not expanded, so we return the collapsed size
1691685e634fb0b14033bd436af8d7174436699ffecSelim Cinek            return mRowMinHeight;
1701685e634fb0b14033bd436af8d7174436699ffecSelim Cinek        }
1711685e634fb0b14033bd436af8d7174436699ffecSelim Cinek
1721685e634fb0b14033bd436af8d7174436699ffecSelim Cinek        return mShowingPublic ? mRowMinHeight : getMaxExpandHeight();
1731685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    }
1741685e634fb0b14033bd436af8d7174436699ffecSelim Cinek
1751685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    /**
1761685e634fb0b14033bd436af8d7174436699ffecSelim Cinek     * Check whether the view state is currently expanded. This is given by the system in {@link
1771685e634fb0b14033bd436af8d7174436699ffecSelim Cinek     * #setSystemExpanded(boolean)} and can be overridden by user expansion or
1781685e634fb0b14033bd436af8d7174436699ffecSelim Cinek     * collapsing in {@link #setUserExpanded(boolean)}. Note that the visual appearance of this
1791685e634fb0b14033bd436af8d7174436699ffecSelim Cinek     * view can differ from this state, if layout params are modified from outside.
1801685e634fb0b14033bd436af8d7174436699ffecSelim Cinek     *
1811685e634fb0b14033bd436af8d7174436699ffecSelim Cinek     * @return whether the view state is currently expanded.
1821685e634fb0b14033bd436af8d7174436699ffecSelim Cinek     */
1831685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    private boolean isExpanded() {
184dce3c4cca5d4df4cc49c1a9f0537e2fecdbc45d2Jorim Jaggi        return !mExpansionDisabled
185dce3c4cca5d4df4cc49c1a9f0537e2fecdbc45d2Jorim Jaggi                && (!hasUserChangedExpansion() && isSystemExpanded() || isUserExpanded());
1861685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    }
1871685e634fb0b14033bd436af8d7174436699ffecSelim Cinek
1881685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    @Override
1891685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
1901685e634fb0b14033bd436af8d7174436699ffecSelim Cinek        super.onLayout(changed, left, top, right, bottom);
191be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi        boolean updateExpandHeight = mMaxExpandHeight == 0;
192be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi        mMaxExpandHeight = mPrivateLayout.getMaxHeight();
193be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi        if (updateExpandHeight) {
194dce3c4cca5d4df4cc49c1a9f0537e2fecdbc45d2Jorim Jaggi            applyExpansionToLayout();
195be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi        }
1961685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    }
1971685e634fb0b14033bd436af8d7174436699ffecSelim Cinek
198a5e0f415d351ad1a9c0ffde8d93df91a2384591fDan Sandler    public void setShowingPublic(boolean show) {
199a5e0f415d351ad1a9c0ffde8d93df91a2384591fDan Sandler        mShowingPublic = show;
200a5e0f415d351ad1a9c0ffde8d93df91a2384591fDan Sandler
201a5e0f415d351ad1a9c0ffde8d93df91a2384591fDan Sandler        // bail out if no public version
2021685e634fb0b14033bd436af8d7174436699ffecSelim Cinek        if (mPublicLayout.getChildCount() == 0) return;
203a5e0f415d351ad1a9c0ffde8d93df91a2384591fDan Sandler
204a5e0f415d351ad1a9c0ffde8d93df91a2384591fDan Sandler        // TODO: animation?
2051685e634fb0b14033bd436af8d7174436699ffecSelim Cinek        mPublicLayout.setVisibility(show ? View.VISIBLE : View.GONE);
2061685e634fb0b14033bd436af8d7174436699ffecSelim Cinek        mPrivateLayout.setVisibility(show ? View.GONE : View.VISIBLE);
207a5e0f415d351ad1a9c0ffde8d93df91a2384591fDan Sandler    }
208251957d76e57eb6e5f8068b37346144e10e586a4Jorim Jaggi
2091685e634fb0b14033bd436af8d7174436699ffecSelim Cinek    public int getMaxExpandHeight() {
2101685e634fb0b14033bd436af8d7174436699ffecSelim Cinek        return mMaxExpandHeight;
211a5e0f415d351ad1a9c0ffde8d93df91a2384591fDan Sandler    }
212584a7aa62c54bcbd654a6696d4fbb56e124874e7Jorim Jaggi
213343e6e258ab6a9f647eabebaed05ce3acafd2ff1Selim Cinek    /**
214343e6e258ab6a9f647eabebaed05ce3acafd2ff1Selim Cinek     * @return the potential height this view could expand in addition.
215343e6e258ab6a9f647eabebaed05ce3acafd2ff1Selim Cinek     */
216343e6e258ab6a9f647eabebaed05ce3acafd2ff1Selim Cinek    public int getExpandPotential() {
2179cbadd3c08a7d7dd3412743dd04aecb16c5a1595Jorim Jaggi        return getIntrinsicHeight() - getActualHeight();
218be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi    }
219be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi
220be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi    @Override
2214222d9a7fb87d73e1443ec1a2de9782b05741af6Jorim Jaggi    public boolean isContentExpandable() {
2224222d9a7fb87d73e1443ec1a2de9782b05741af6Jorim Jaggi        return mPrivateLayout.isContentExpandable();
2234222d9a7fb87d73e1443ec1a2de9782b05741af6Jorim Jaggi    }
2244222d9a7fb87d73e1443ec1a2de9782b05741af6Jorim Jaggi
2254222d9a7fb87d73e1443ec1a2de9782b05741af6Jorim Jaggi    @Override
226d552d9d8e964c102e6832610be46cf2c041e8829Jorim Jaggi    public void setActualHeight(int height, boolean notifyListeners) {
227d552d9d8e964c102e6832610be46cf2c041e8829Jorim Jaggi        mPrivateLayout.setActualHeight(height, notifyListeners);
228be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi        invalidate();
229d552d9d8e964c102e6832610be46cf2c041e8829Jorim Jaggi        super.setActualHeight(height, notifyListeners);
230be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi    }
231be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi
232be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi    @Override
233be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi    public int getMaxHeight() {
234be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi        return mPrivateLayout.getMaxHeight();
235be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi    }
236be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi
237be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi    @Override
2384222d9a7fb87d73e1443ec1a2de9782b05741af6Jorim Jaggi    public int getMinHeight() {
2394222d9a7fb87d73e1443ec1a2de9782b05741af6Jorim Jaggi        return mPrivateLayout.getMinHeight();
2404222d9a7fb87d73e1443ec1a2de9782b05741af6Jorim Jaggi    }
2414222d9a7fb87d73e1443ec1a2de9782b05741af6Jorim Jaggi
2424222d9a7fb87d73e1443ec1a2de9782b05741af6Jorim Jaggi    @Override
243be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi    public void setClipTopAmount(int clipTopAmount) {
244be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi        super.setClipTopAmount(clipTopAmount);
245be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi        mPrivateLayout.setClipTopAmount(clipTopAmount);
246be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi    }
247be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi
248c27437b7fd04e682ae2abdf0727a99bf5c6e409dSelim Cinek    public boolean isBelowSpeedBump() {
249c27437b7fd04e682ae2abdf0727a99bf5c6e409dSelim Cinek        return mIsBelowSpeedBump;
250c27437b7fd04e682ae2abdf0727a99bf5c6e409dSelim Cinek    }
251c27437b7fd04e682ae2abdf0727a99bf5c6e409dSelim Cinek
252c27437b7fd04e682ae2abdf0727a99bf5c6e409dSelim Cinek    public void setIsBelowSpeedBump(boolean isBelow) {
253c27437b7fd04e682ae2abdf0727a99bf5c6e409dSelim Cinek        this.mIsBelowSpeedBump = isBelow;
254c27437b7fd04e682ae2abdf0727a99bf5c6e409dSelim Cinek    }
255c27437b7fd04e682ae2abdf0727a99bf5c6e409dSelim Cinek
256be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi    public void notifyContentUpdated() {
257be565dfc1c17b7ddafa9753851b8f82849fd3f42Jorim Jaggi        mPrivateLayout.notifyContentUpdated();
258343e6e258ab6a9f647eabebaed05ce3acafd2ff1Selim Cinek    }
25951c7510e493680b4aca1ed7695b35c52d2cd63ffChris Wren}
260