CamelCase for KeyboardType enums
Also removed unused TextIndent.NONE
Test: ./gradlew ui-text:test
Test: ./gradlew ui-text:connectedAndroidTest
Test: ./gradlew ui-platform:test
Test: ./gradlew ui-platform:connectedAndroidTest
Test: ./gradlew ui-framework:test
Test: ./gradlew ui-framework:connectedAndroidTest
Bug: 135546322
Change-Id: I5e7ff602f3274629b086ee2071c7d8d22a867523
diff --git a/ui/framework/src/main/java/androidx/ui/core/InputField.kt b/ui/framework/src/main/java/androidx/ui/core/InputField.kt
index 846e087..964dbe2 100644
--- a/ui/framework/src/main/java/androidx/ui/core/InputField.kt
+++ b/ui/framework/src/main/java/androidx/ui/core/InputField.kt
@@ -82,7 +82,7 @@
*
* Note that this input type is honored by IME and shows corresponding keyboard but this is not
* guaranteed. For example, some IME may send non-ASCII character even if you set
- * {@link KeyboardType.KEYBOARD_TYPE_ASCII}
+ * [KeyboardType.Ascii]
*/
keyboardType: KeyboardType = KeyboardType.Text,
diff --git a/ui/platform/src/main/java/androidx/ui/core/input/TextInputServiceAndroid.kt b/ui/platform/src/main/java/androidx/ui/core/input/TextInputServiceAndroid.kt
index 6d6e0d5..776a15f 100644
--- a/ui/platform/src/main/java/androidx/ui/core/input/TextInputServiceAndroid.kt
+++ b/ui/platform/src/main/java/androidx/ui/core/input/TextInputServiceAndroid.kt
@@ -119,13 +119,13 @@
private fun fillEditorInfo(keyboardType: KeyboardType, outInfo: EditorInfo) {
when (keyboardType) {
KeyboardType.Text -> outInfo.inputType = InputType.TYPE_CLASS_TEXT
- KeyboardType.ASCII -> {
+ KeyboardType.Ascii -> {
outInfo.inputType = InputType.TYPE_CLASS_TEXT
outInfo.imeOptions = EditorInfo.IME_FLAG_FORCE_ASCII
}
KeyboardType.Number -> outInfo.inputType = InputType.TYPE_CLASS_NUMBER
KeyboardType.Phone -> outInfo.inputType = InputType.TYPE_CLASS_PHONE
- KeyboardType.URI ->
+ KeyboardType.Uri ->
outInfo.inputType = InputType.TYPE_CLASS_TEXT or EditorInfo.TYPE_TEXT_VARIATION_URI
KeyboardType.Email ->
outInfo.inputType =
diff --git a/ui/platform/src/test/java/androidx/ui/core/input/TextInputServiceAndroidTest.kt b/ui/platform/src/test/java/androidx/ui/core/input/TextInputServiceAndroidTest.kt
index ccb7425..3609daa9 100644
--- a/ui/platform/src/test/java/androidx/ui/core/input/TextInputServiceAndroidTest.kt
+++ b/ui/platform/src/test/java/androidx/ui/core/input/TextInputServiceAndroidTest.kt
@@ -68,7 +68,7 @@
fun test_fill_editor_info_ascii() {
textInputService.startInput(
EditorState(""),
- KeyboardType.ASCII,
+ KeyboardType.Ascii,
>
>
@@ -111,7 +111,7 @@
fun test_fill_editor_info_uri() {
textInputService.startInput(
EditorState(""),
- KeyboardType.URI,
+ KeyboardType.Uri,
>
>
diff --git a/ui/text/api/1.0.0-alpha01.txt b/ui/text/api/1.0.0-alpha01.txt
index a483636..640a682 100644
--- a/ui/text/api/1.0.0-alpha01.txt
+++ b/ui/text/api/1.0.0-alpha01.txt
@@ -12,12 +12,12 @@
}
public enum KeyboardType {
- enum_constant public static final androidx.ui.input.KeyboardType ASCII;
+ enum_constant public static final androidx.ui.input.KeyboardType Ascii;
enum_constant public static final androidx.ui.input.KeyboardType Email;
enum_constant public static final androidx.ui.input.KeyboardType Number;
enum_constant public static final androidx.ui.input.KeyboardType Phone;
enum_constant public static final androidx.ui.input.KeyboardType Text;
- enum_constant public static final androidx.ui.input.KeyboardType URI;
+ enum_constant public static final androidx.ui.input.KeyboardType Uri;
}
}
@@ -415,12 +415,6 @@
method public androidx.ui.text.style.TextIndent copy(androidx.ui.core.Px firstLine, androidx.ui.core.Px restLine);
method public androidx.ui.core.Px getFirstLine();
method public androidx.ui.core.Px getRestLine();
- field public static final androidx.ui.text.style.TextIndent.Companion! Companion;
- }
-
- public static final class TextIndent.Companion {
- method public androidx.ui.text.style.TextIndent getNONE();
- property public final androidx.ui.text.style.TextIndent NONE;
}
public final class TextIndentKt {
diff --git a/ui/text/api/current.txt b/ui/text/api/current.txt
index a483636..640a682 100644
--- a/ui/text/api/current.txt
+++ b/ui/text/api/current.txt
@@ -12,12 +12,12 @@
}
public enum KeyboardType {
- enum_constant public static final androidx.ui.input.KeyboardType ASCII;
+ enum_constant public static final androidx.ui.input.KeyboardType Ascii;
enum_constant public static final androidx.ui.input.KeyboardType Email;
enum_constant public static final androidx.ui.input.KeyboardType Number;
enum_constant public static final androidx.ui.input.KeyboardType Phone;
enum_constant public static final androidx.ui.input.KeyboardType Text;
- enum_constant public static final androidx.ui.input.KeyboardType URI;
+ enum_constant public static final androidx.ui.input.KeyboardType Uri;
}
}
@@ -415,12 +415,6 @@
method public androidx.ui.text.style.TextIndent copy(androidx.ui.core.Px firstLine, androidx.ui.core.Px restLine);
method public androidx.ui.core.Px getFirstLine();
method public androidx.ui.core.Px getRestLine();
- field public static final androidx.ui.text.style.TextIndent.Companion! Companion;
- }
-
- public static final class TextIndent.Companion {
- method public androidx.ui.text.style.TextIndent getNONE();
- property public final androidx.ui.text.style.TextIndent NONE;
}
public final class TextIndentKt {
diff --git a/ui/text/integration-tests/text-demos/src/main/java/androidx/ui/text/demos/CraneInputField.kt b/ui/text/integration-tests/text-demos/src/main/java/androidx/ui/text/demos/CraneInputField.kt
index 75dcf29..a7e2235 100644
--- a/ui/text/integration-tests/text-demos/src/main/java/androidx/ui/text/demos/CraneInputField.kt
+++ b/ui/text/integration-tests/text-demos/src/main/java/androidx/ui/text/demos/CraneInputField.kt
@@ -33,7 +33,7 @@
val KEYBOARD_TYPES = listOf(
Pair(KeyboardType.Text, "Text"),
- Pair(KeyboardType.ASCII, "ASCII"),
+ Pair(KeyboardType.Ascii, "Ascii"),
Pair(KeyboardType.Number, "Number"),
Pair(KeyboardType.Email, "Email"),
Pair(KeyboardType.Phone, "Phone")
diff --git a/ui/text/src/main/java/androidx/ui/input/KeyboardType.kt b/ui/text/src/main/java/androidx/ui/input/KeyboardType.kt
index afd9574..1cd2750 100644
--- a/ui/text/src/main/java/androidx/ui/input/KeyboardType.kt
+++ b/ui/text/src/main/java/androidx/ui/input/KeyboardType.kt
@@ -28,7 +28,7 @@
/**
* A keyboard type used to request an IME that is capable of inputting ASCII characters.
*/
- ASCII,
+ Ascii,
/**
* A keyboard type used to request an that is capable of inputting digits.
@@ -36,17 +36,17 @@
Number,
/**
- * A keyboard type used to request an IME is capable of inputting phone numbers.
+ * A keyboard type used to request an IME that is capable of inputting phone numbers.
*/
Phone,
/**
- * A keyboard type used to request an IME is capable of inputting URIs.
+ * A keyboard type used to request an IME that is capable of inputting URIs.
*/
- URI,
+ Uri,
/**
- * A keyboard type used to request an IME is capable of inputting email addresses.
+ * A keyboard type used to request an IME that is capable of inputting email addresses.
*/
Email
}
diff --git a/ui/text/src/main/java/androidx/ui/text/style/TextIndent.kt b/ui/text/src/main/java/androidx/ui/text/style/TextIndent.kt
index 502e362..fee85c0 100644
--- a/ui/text/src/main/java/androidx/ui/text/style/TextIndent.kt
+++ b/ui/text/src/main/java/androidx/ui/text/style/TextIndent.kt
@@ -29,11 +29,7 @@
data class TextIndent(
val firstLine: Px = 0.px,
val restLine: Px = 0.px
-) {
- companion object {
- val NONE = TextIndent(0.px, 0.px)
- }
-}
+)
fun lerp(a: TextIndent, b: TextIndent, t: Float): TextIndent {
return TextIndent(