Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 919d2c1a authored by Daichi Hirono's avatar Daichi Hirono Committed by android-build-merger
Browse files

Merge "Don't add other's child as header or footer" into oc-dev am: 9e37a2e4

am: 92273348

Change-Id: I07df9ddb7136e7018b0be1d2dfaa1c7f589e0df2
parents dfcb87cd 92273348
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ import android.view.accessibility.AccessibilityNodeProvider;
import android.widget.RemoteViews.RemoteView;

import com.android.internal.R;
import com.android.internal.util.Preconditions;

import com.google.android.collect.Lists;

@@ -335,6 +336,11 @@ public class ListView extends AbsListView {
     * @param isSelectable whether the item is selectable
     */
    public void addHeaderView(View v, Object data, boolean isSelectable) {
        Preconditions.checkState(
                v.getParent() == null,
                "The specified child already has a parent. "
                + "You must call removeView() on the child's parent first.");

        final FixedViewInfo info = new FixedViewInfo();
        info.view = v;
        info.data = data;
@@ -429,6 +435,11 @@ public class ListView extends AbsListView {
     * @param isSelectable true if the footer view can be selected
     */
    public void addFooterView(View v, Object data, boolean isSelectable) {
        Preconditions.checkState(
                v.getParent() == null,
                "The specified child already has a parent. "
                + "You must call removeView() on the child's parent first.");

        final FixedViewInfo info = new FixedViewInfo();
        info.view = v;
        info.data = data;