Merge "Update updateEmptyView"
This commit is contained in:
committed by
Android (Google) Code Review
commit
ad587bf155
@@ -312,12 +312,15 @@ public abstract class SettingsPreferenceFragment extends InstrumentedPreferenceF
|
||||
}
|
||||
}
|
||||
|
||||
private void updateEmptyView() {
|
||||
@VisibleForTesting
|
||||
void updateEmptyView() {
|
||||
if (mEmptyView == null) return;
|
||||
if (getPreferenceScreen() != null) {
|
||||
final View listContainer = getActivity().findViewById(android.R.id.list_container);
|
||||
boolean show = (getPreferenceScreen().getPreferenceCount()
|
||||
- (mHeader != null ? 1 : 0)
|
||||
- (mFooterPreferenceMixin.hasFooter() ? 1 : 0)) <= 0;
|
||||
- (mFooterPreferenceMixin.hasFooter() ? 1 : 0)) <= 0
|
||||
|| (listContainer != null && listContainer.getVisibility() != View.VISIBLE);
|
||||
mEmptyView.setVisibility(show ? View.VISIBLE : View.GONE);
|
||||
} else {
|
||||
mEmptyView.setVisibility(View.VISIBLE);
|
||||
|
Reference in New Issue
Block a user