am d93421b1: am afffc5c2: Merge "Remove scroll view from correct parent in AlertController" into lmp-mr1-dev

* commit 'd93421b1438607f7656c7b65163c6681526693b0':
  Remove scroll view from correct parent in AlertController
This commit is contained in:
Alan Viverette
2014-10-31 00:29:29 +00:00
committed by Android Git Automerger

View File

@@ -37,6 +37,7 @@ import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams; import android.view.ViewGroup.LayoutParams;
import android.view.ViewParent;
import android.view.ViewTreeObserver; import android.view.ViewTreeObserver;
import android.view.Window; import android.view.Window;
import android.view.WindowInsets; import android.view.WindowInsets;
@@ -589,9 +590,10 @@ public class AlertController {
mScrollView.removeView(mMessageView); mScrollView.removeView(mMessageView);
if (mListView != null) { if (mListView != null) {
final int childIndex = mScrollView.indexOfChild(mScrollView); final ViewGroup scrollParent = (ViewGroup) mScrollView.getParent();
contentPanel.removeViewAt(childIndex); final int childIndex = scrollParent.indexOfChild(mScrollView);
contentPanel.addView(mListView, childIndex, scrollParent.removeViewAt(childIndex);
scrollParent.addView(mListView, childIndex,
new LayoutParams(MATCH_PARENT, MATCH_PARENT)); new LayoutParams(MATCH_PARENT, MATCH_PARENT));
} else { } else {
contentPanel.setVisibility(View.GONE); contentPanel.setVisibility(View.GONE);