[go: nahoru, domu]

Modifier.drawBackground -> Modifier.background

This CL renamed drawBackground modifier to just background for better readability.

While renaming API, this CL also cuts unnecessary APIs from this modifiers that might confuse users, like alpha in color version or fill type, as background always fills

Relnote: Modifier.drawBackground has been renamed to Modifier.background
Fixes: 159612389
Test: renamed and should pass
Change-Id: I1367723fce0e07418ed4ab391fe20c69aa092f53
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/DrawerTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/DrawerTest.kt
index 01d845c..a6f4e69 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/DrawerTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/DrawerTest.kt
@@ -25,8 +25,8 @@
 import androidx.ui.core.onPositioned
 import androidx.ui.core.testTag
 import androidx.ui.foundation.Box
+import androidx.ui.foundation.background
 import androidx.ui.foundation.clickable
-import androidx.ui.foundation.drawBackground
 import androidx.ui.geometry.Offset
 import androidx.ui.graphics.Color
 import androidx.ui.layout.fillMaxSize
@@ -341,10 +341,10 @@
             Box(Modifier.testTag("Drawer")) {
                 ModalDrawerLayout(drawerState.value, { drawerState.value = it },
                     drawerContent = {
-                        Box(Modifier.fillMaxSize().drawBackground(Color.Magenta))
+                        Box(Modifier.fillMaxSize().background(color = Color.Magenta))
                     },
                     bodyContent = {
-                        Box(Modifier.fillMaxSize().drawBackground(Color.Red))
+                        Box(Modifier.fillMaxSize().background(color = Color.Red))
                     })
             }
         }
@@ -372,10 +372,10 @@
             Box(Modifier.testTag("Drawer").rtl) {
                 ModalDrawerLayout(drawerState.value, { drawerState.value = it },
                     drawerContent = {
-                        Box(Modifier.fillMaxSize().drawBackground(Color.Magenta))
+                        Box(Modifier.fillMaxSize().background(color = Color.Magenta))
                     },
                     bodyContent = {
-                        Box(Modifier.fillMaxSize().drawBackground(Color.Red))
+                        Box(Modifier.fillMaxSize().background(color = Color.Red))
                     })
             }
         }
@@ -403,10 +403,10 @@
             Box(Modifier.testTag("Drawer")) {
                 BottomDrawerLayout(drawerState.value, { drawerState.value = it },
                     drawerContent = {
-                        Box(Modifier.fillMaxSize().drawBackground(Color.Magenta))
+                        Box(Modifier.fillMaxSize().background(color = Color.Magenta))
                     },
                     bodyContent = {
-                        Box(Modifier.fillMaxSize().drawBackground(Color.Red))
+                        Box(Modifier.fillMaxSize().background(color = Color.Red))
                     })
             }
         }
@@ -434,10 +434,10 @@
             Box(Modifier.testTag("Drawer")) {
                 BottomDrawerLayout(drawerState.value, { drawerState.value = it },
                     drawerContent = {
-                        Box(Modifier.fillMaxSize().drawBackground(Color.Magenta))
+                        Box(Modifier.fillMaxSize().background(Color.Magenta))
                     },
                     bodyContent = {
-                        Box(Modifier.fillMaxSize().drawBackground(Color.Red))
+                        Box(Modifier.fillMaxSize().background(Color.Red))
                     })
             }
         }