Bug 851894 - Only update empty state when emptyview is not null (r=mfinkle)
This commit is contained in:
@@ -778,7 +778,10 @@ public class TwoWayView extends AdapterView<ListAdapter> implements
|
|||||||
checkSelectionChanged();
|
checkSelectionChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mEmptyView != null) {
|
||||||
updateEmptyStatus();
|
updateEmptyStatus();
|
||||||
|
}
|
||||||
|
|
||||||
requestLayout();
|
requestLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4623,7 +4626,7 @@ public class TwoWayView extends AdapterView<ListAdapter> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateEmptyStatus() {
|
private void updateEmptyStatus() {
|
||||||
boolean isEmpty = mAdapter == null || mAdapter.isEmpty();
|
final boolean isEmpty = (mAdapter == null || mAdapter.isEmpty());
|
||||||
if (isEmpty) {
|
if (isEmpty) {
|
||||||
if (mEmptyView != null) {
|
if (mEmptyView != null) {
|
||||||
mEmptyView.setVisibility(View.VISIBLE);
|
mEmptyView.setVisibility(View.VISIBLE);
|
||||||
@@ -4641,8 +4644,10 @@ public class TwoWayView extends AdapterView<ListAdapter> implements
|
|||||||
this.onLayout(false, getLeft(), getTop(), getRight(), getBottom());
|
this.onLayout(false, getLeft(), getTop(), getRight(), getBottom());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (mEmptyView != null)
|
if (mEmptyView != null) {
|
||||||
mEmptyView.setVisibility(View.GONE);
|
mEmptyView.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
setVisibility(View.VISIBLE);
|
setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4665,7 +4670,11 @@ public class TwoWayView extends AdapterView<ListAdapter> implements
|
|||||||
} else {
|
} else {
|
||||||
rememberSyncState();
|
rememberSyncState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mEmptyView != null) {
|
||||||
updateEmptyStatus();
|
updateEmptyStatus();
|
||||||
|
}
|
||||||
|
|
||||||
requestLayout();
|
requestLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4691,7 +4700,10 @@ public class TwoWayView extends AdapterView<ListAdapter> implements
|
|||||||
|
|
||||||
mNeedSync = false;
|
mNeedSync = false;
|
||||||
|
|
||||||
|
if (mEmptyView != null) {
|
||||||
updateEmptyStatus();
|
updateEmptyStatus();
|
||||||
|
}
|
||||||
|
|
||||||
requestLayout();
|
requestLayout();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user