diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index a15c130076..4d0379d462 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -315,7 +315,7 @@
4dp
10dp
-
+ 100dp
9dp
6dp
diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java
index 967af053fb..996c5e7f55 100644
--- a/src/com/android/launcher3/folder/Folder.java
+++ b/src/com/android/launcher3/folder/Folder.java
@@ -18,6 +18,7 @@ package com.android.launcher3.folder;
import static android.text.TextUtils.isEmpty;
+import static com.android.launcher3.Flags.enableLauncherVisualRefresh;
import static com.android.launcher3.LauncherAnimUtils.SPRING_LOADED_EXIT_DELAY;
import static com.android.launcher3.LauncherState.EDIT_MODE;
import static com.android.launcher3.LauncherState.NORMAL;
@@ -299,6 +300,13 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
mContent.setFolder(this);
mPageIndicator = findViewById(R.id.folder_page_indicator);
+ if (enableLauncherVisualRefresh()) {
+ MarginLayoutParams params = ((MarginLayoutParams) mPageIndicator.getLayoutParams());
+ int horizontalMargin = getContext().getResources()
+ .getDimensionPixelSize(R.dimen.folder_footer_horiz_padding);
+ params.setMarginStart(horizontalMargin);
+ params.setMarginEnd(horizontalMargin);
+ }
mFooter = findViewById(R.id.folder_footer);
mFooterHeight = dp.folderFooterHeightPx;
mFolderName = findViewById(R.id.folder_name);
@@ -312,7 +320,6 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
| InputType.TYPE_TEXT_FLAG_CAP_WORDS);
mFolderName.forceDisableSuggestions(true);
-
mKeyboardInsetAnimationCallback = new KeyboardInsetAnimationCallback(this);
setWindowInsetsAnimationCallback(mKeyboardInsetAnimationCallback);
}
@@ -1269,6 +1276,23 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
setMeasuredDimension(folderWidth, folderHeight);
}
+ /**
+ * If the Folder Title has less than 100dp of available width, we hide it. The reason we do this
+ * calculation in onSizeChange is because this callback is called 1x when the folder is opened.
+ *
+ * The PageIndicator and the Folder Title share the same horizontal linear layout, but both
+ * are dynamically sized. Therefore, we are setting visibility of the folder title AFTER the
+ * layout is measured.
+ */
+ @Override
+ protected void onSizeChanged(int w, int h, int oldw, int oldh) {
+ super.onSizeChanged(w, h, oldw, oldh);
+ int minTitleWidth = getResources().getDimensionPixelSize(R.dimen.folder_title_min_width);
+ if (enableLauncherVisualRefresh() && mFolderName.getMeasuredWidth() < minTitleWidth) {
+ mFolderName.setVisibility(View.GONE);
+ }
+ }
+
/**
* Rearranges the children based on their rank.
*/