Fixing the sections not getting created the first time
Change-Id: I9b8888d1633eba29e9ec79924d26cff0fce33ead
This commit is contained in:
@@ -758,6 +758,7 @@ public class ManageApplications extends InstrumentedFragment
|
||||
protected void publishResults(CharSequence constraint, FilterResults results) {
|
||||
mCurFilterPrefix = constraint;
|
||||
mEntries = (ArrayList<ApplicationsState.AppEntry>) results.values;
|
||||
rebuildSections();
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
};
|
||||
@@ -891,8 +892,30 @@ public class ManageApplications extends InstrumentedFragment
|
||||
mBaseEntries = entries;
|
||||
if (mBaseEntries != null) {
|
||||
mEntries = applyPrefixFilter(mCurFilterPrefix, mBaseEntries);
|
||||
rebuildSections();
|
||||
} else {
|
||||
mEntries = null;
|
||||
mSections = EMPTY_SECTIONS;
|
||||
mPositionToSectionIndex = null;
|
||||
}
|
||||
|
||||
if (mManageApplications.mListView.isFastScrollEnabled()) {
|
||||
notifyDataSetChanged();
|
||||
|
||||
if (mSession.getAllApps().size() != 0
|
||||
&& mManageApplications.mListContainer.getVisibility() != View.VISIBLE) {
|
||||
Utils.handleLoadingContainer(mManageApplications.mLoadingContainer,
|
||||
mManageApplications.mListContainer, true, true);
|
||||
}
|
||||
if (mManageApplications.mListType == LIST_TYPE_USAGE_ACCESS) {
|
||||
// No enabled or disabled filters for usage access.
|
||||
return;
|
||||
}
|
||||
|
||||
mManageApplications.setHasDisabled(mState.haveDisabledApps());
|
||||
}
|
||||
|
||||
private void rebuildSections() {
|
||||
if (mEntries!= null && mManageApplications.mListView.isFastScrollEnabled()) {
|
||||
// Rebuild sections
|
||||
if (mIndex == null) {
|
||||
LocaleList locales = mContext.getResources().getConfiguration().getLocales();
|
||||
@@ -928,25 +951,6 @@ public class ManageApplications extends InstrumentedFragment
|
||||
mSections = EMPTY_SECTIONS;
|
||||
mPositionToSectionIndex = null;
|
||||
}
|
||||
} else {
|
||||
mEntries = null;
|
||||
mSections = EMPTY_SECTIONS;
|
||||
mPositionToSectionIndex = null;
|
||||
}
|
||||
|
||||
notifyDataSetChanged();
|
||||
|
||||
if (mSession.getAllApps().size() != 0
|
||||
&& mManageApplications.mListContainer.getVisibility() != View.VISIBLE) {
|
||||
Utils.handleLoadingContainer(mManageApplications.mLoadingContainer,
|
||||
mManageApplications.mListContainer, true, true);
|
||||
}
|
||||
if (mManageApplications.mListType == LIST_TYPE_USAGE_ACCESS) {
|
||||
// No enabled or disabled filters for usage access.
|
||||
return;
|
||||
}
|
||||
|
||||
mManageApplications.setHasDisabled(mState.haveDisabledApps());
|
||||
}
|
||||
|
||||
private void updateLoading() {
|
||||
|
Reference in New Issue
Block a user