diff --git a/lawnchair/res/layout/smartspace_text_template.xml b/lawnchair/res/layout/smartspace_text_template.xml
new file mode 100644
index 0000000000..d7d4dd3d47
--- /dev/null
+++ b/lawnchair/res/layout/smartspace_text_template.xml
@@ -0,0 +1,5 @@
+
+
diff --git a/lawnchair/res/values/dimens.xml b/lawnchair/res/values/dimens.xml
index 89590cab72..64389ad2f2 100644
--- a/lawnchair/res/values/dimens.xml
+++ b/lawnchair/res/values/dimens.xml
@@ -21,17 +21,14 @@
62dp
15dp
24dp
-
8dp
2dp
0dp
34dp
- 16dp
- 56dp
-
24dp
+
36dp
30dp
16dp
@@ -41,7 +38,10 @@
6dp
64dp
56dp
+ 16dp
+ 56dp
+
60dp
52dp
1dp
@@ -53,4 +53,10 @@
16dp
4dp
88dp
+
+
+ 1.5dp
+ 2dp
+ 0.5dp
+ 0.02
diff --git a/lawnchair/res/values/styles.xml b/lawnchair/res/values/styles.xml
index c9a0e26e47..689dbb147c 100644
--- a/lawnchair/res/values/styles.xml
+++ b/lawnchair/res/values/styles.xml
@@ -166,4 +166,15 @@
+
+
diff --git a/lawnchair/src/app/lawnchair/nexuslauncher/ThemedSmartSpaceHostView.kt b/lawnchair/src/app/lawnchair/nexuslauncher/ThemedSmartSpaceHostView.kt
index d4ccfe9091..13d2f3aac5 100644
--- a/lawnchair/src/app/lawnchair/nexuslauncher/ThemedSmartSpaceHostView.kt
+++ b/lawnchair/src/app/lawnchair/nexuslauncher/ThemedSmartSpaceHostView.kt
@@ -4,6 +4,7 @@ import android.content.Context
import android.graphics.Bitmap
import android.graphics.Canvas
import android.graphics.drawable.BitmapDrawable
+import android.view.LayoutInflater
import android.widget.ImageView
import android.widget.RemoteViews
import android.widget.TextView
@@ -13,6 +14,7 @@ import com.android.launcher3.R
import com.android.launcher3.ResourceUtils
import com.android.launcher3.icons.ShadowGenerator
import com.android.launcher3.util.Themes
+import com.android.launcher3.views.DoubleShadowBubbleTextView
class ThemedSmartSpaceHostView(context: Context) : SmartSpaceHostView(context) {
@@ -20,6 +22,9 @@ class ThemedSmartSpaceHostView(context: Context) : SmartSpaceHostView(context) {
private val workspaceTextColor = Themes.getAttrColor(context, R.attr.workspaceTextColor)
private val shadowGenerator = ShadowGenerator(ResourceUtils.pxFromDp(48f, resources.displayMetrics))
+ private val templateTextView = LayoutInflater.from(context)
+ .inflate(R.layout.smartspace_text_template, this, false) as DoubleShadowBubbleTextView
+
override fun updateAppWidget(remoteViews: RemoteViews?) {
super.updateAppWidget(remoteViews)
val images = mutableListOf()
@@ -41,6 +46,14 @@ class ThemedSmartSpaceHostView(context: Context) : SmartSpaceHostView(context) {
private fun overrideTextView(tv: TextView) {
if (isWorkspaceDarkText) {
tv.paint.clearShadowLayer()
+ } else {
+ val shadowInfo = templateTextView.shadowInfo
+ tv.paint.setShadowLayer(
+ shadowInfo.ambientShadowBlur,
+ shadowInfo.keyShadowOffsetX,
+ shadowInfo.keyShadowOffsetY,
+ shadowInfo.ambientShadowColor
+ )
}
tv.setTextColor(workspaceTextColor)
FontManager.INSTANCE.get(context).setCustomFont(tv, R.id.font_heading)
diff --git a/src/com/android/launcher3/views/DoubleShadowBubbleTextView.java b/src/com/android/launcher3/views/DoubleShadowBubbleTextView.java
index a309e6e95e..50b491ff06 100644
--- a/src/com/android/launcher3/views/DoubleShadowBubbleTextView.java
+++ b/src/com/android/launcher3/views/DoubleShadowBubbleTextView.java
@@ -133,4 +133,8 @@ public class DoubleShadowBubbleTextView extends BubbleTextView {
return setColorAlphaBound(shadowColor,
Math.round(Color.alpha(shadowColor) * textAlpha / 255f));
}
+
+ public ShadowInfo getShadowInfo() {
+ return mShadowInfo;
+ }
}