Introduce FolderNameInfo class.

* Introduce FolderNameInfo class for passing down the folder name
suggestions from FolderNameProvider.
* Use FolderNameInfo for storing the serialized suggested names for
Folders. It is parsed and used in FolderEdit.

Bug: 148417030
Bug: 148916551
Bug: 148432151

Change-Id: Idaa81e203cc42889be15d0845230b4508521041c
This commit is contained in:
jayaprakashs
2020-02-07 20:06:34 -08:00
parent 93d3117295
commit e534d3b5f9
7 changed files with 186 additions and 61 deletions

View File

@@ -59,6 +59,7 @@ import com.android.launcher3.WorkspaceItemInfo;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.folder.Folder;
import com.android.launcher3.folder.FolderGridOrganizer;
import com.android.launcher3.folder.FolderNameInfo;
import com.android.launcher3.folder.FolderNameProvider;
import com.android.launcher3.icons.ComponentWithLabelAndIcon;
import com.android.launcher3.icons.ComponentWithLabelAndIcon.ComponentWithIconCachingLogic;
@@ -925,11 +926,13 @@ public class LoaderTask implements Runnable {
synchronized (mBgDataModel) {
for (int i = 0; i < mBgDataModel.folders.size(); i++) {
String[] suggestedOut = new String[FolderNameProvider.SUGGEST_MAX];
FolderNameInfo[] suggestionInfos =
new FolderNameInfo[FolderNameProvider.SUGGEST_MAX];
FolderInfo info = mBgDataModel.folders.valueAt(i);
if (info.suggestedFolderNames == null) {
provider.getSuggestedFolderName(mApp.getContext(), info.contents, suggestedOut);
info.suggestedFolderNames = new Intent().putExtra("suggest", suggestedOut);
provider.getSuggestedFolderName(mApp.getContext(), info.contents,
suggestionInfos);
info.suggestedFolderNames = new Intent().putExtra("suggest", suggestionInfos);
}
}
}