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

Commit 9fcefb4c authored by Michael Kwan's avatar Michael Kwan Committed by android-build-merger
Browse files

Merge "Fixed issue where ListView checked state did not account for ListView...

Merge "Fixed issue where ListView checked state did not account for ListView header." into nyc-mr1-dev
am: 02178609

* commit '02178609':
  Fixed issue where ListView checked state did not account for ListView header.

Change-Id: I6f5fd65a9632a2f262c2e7a807cae487c4d5c0bc
parents 1e34fb31 02178609
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -886,8 +886,8 @@ public class AlertController {
            listView.setAdapter(mAdapter);
            final int checkedItem = mCheckedItem;
            if (checkedItem > -1) {
                listView.setItemChecked(checkedItem, true);
                listView.setSelection(checkedItem);
                listView.setItemChecked(checkedItem + listView.getHeaderViewsCount(), true);
                listView.setSelection(checkedItem + listView.getHeaderViewsCount());
            }
        }
    }
@@ -1066,7 +1066,8 @@ public class AlertController {
                            if (mCheckedItems != null) {
                                boolean isItemChecked = mCheckedItems[position];
                                if (isItemChecked) {
                                    listView.setItemChecked(position, true);
                                    listView.setItemChecked(
                                            position + listView.getHeaderViewsCount(), true);
                                }
                            }
                            return view;
@@ -1087,7 +1088,8 @@ public class AlertController {
                        public void bindView(View view, Context context, Cursor cursor) {
                            CheckedTextView text = (CheckedTextView) view.findViewById(R.id.text1);
                            text.setText(cursor.getString(mLabelIndex));
                            listView.setItemChecked(cursor.getPosition(),
                            listView.setItemChecked(
                                    cursor.getPosition() + listView.getHeaderViewsCount(),
                                    cursor.getInt(mIsCheckedIndex) == 1);
                        }