Bug 824501: Support for AllCaps in TextView. [r=mfinkle] [a=bbajaj]
authorSriram Ramasubramanian <sriram@mozilla.com>
Thu, 10 Jan 2013 11:25:30 -0800
changeset 127274 8f82e0ec113c7d9e9f6a4e127c06e30f74933996
parent 127273 e638e4db2e662d3c4ba59d17a7ab8081da4dd5ac
child 127275 db530424953a685b9c8e67f05a8de2af66b49ae3
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle, bbajaj
bugs824501
milestone20.0a2
Bug 824501: Support for AllCaps in TextView. [r=mfinkle] [a=bbajaj]
mobile/android/base/AllCapsTextView.java
mobile/android/base/GeckoViewsFactory.java
mobile/android/base/Makefile.in
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/AllCapsTextView.java
@@ -0,0 +1,20 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+package org.mozilla.gecko;
+
+import android.content.Context;
+import android.util.AttributeSet;
+
+public class AllCapsTextView extends GeckoTextView {
+
+    public AllCapsTextView(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    @Override
+    public void setText(CharSequence text, BufferType type) {
+        super.setText(text.toString().toUpperCase(), type);
+    }
+}
--- a/mobile/android/base/GeckoViewsFactory.java
+++ b/mobile/android/base/GeckoViewsFactory.java
@@ -86,16 +86,18 @@ public final class GeckoViewsFactory imp
             else if (TextUtils.equals(viewName, "TabsPanel"))
                 return new TabsPanel(context, attrs);
             else if (TextUtils.equals(viewName, "TabsTray"))
                 return new TabsTray(context, attrs);
             else if (TextUtils.equals(viewName, "TextSelectionHandle"))
                 return new TextSelectionHandle(context, attrs);
             else if (TextUtils.equals(viewName, "gfx.LayerView"))
                 return new LayerView(context, attrs);
+            else if (TextUtils.equals(viewName, "AllCapsTextView"))
+                return new AllCapsTextView(context, attrs);
             else if (TextUtils.equals(viewName, "Button"))
                 return new GeckoButton(context, attrs);
             else if (TextUtils.equals(viewName, "EditText"))
                 return new GeckoEditText(context, attrs);
             else if (TextUtils.equals(viewName, "FrameLayout"))
                 return new GeckoFrameLayout(context, attrs);
             else if (TextUtils.equals(viewName, "ImageButton"))
                 return new GeckoImageButton(context, attrs);
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -39,16 +39,17 @@ FENNEC_JAVA_FILES = \
   AboutHomeContent.java \
   AboutHomePromoBox.java \
   AboutHomeSection.java \
   ActivityHandlerHelper.java \
   AndroidImport.java \
   AndroidImportPreference.java \
   AnimatorProxy.java \
   AlertNotification.java \
+  AllCapsTextView.java \
   AnimatedHeightLayout.java \
   AwesomeBar.java \
   AwesomebarResultHandler.java \
   AwesomeBarTabs.java \
   awesomebar/AwesomeBarTab.java \
   awesomebar/AllPagesTab.java \
   awesomebar/BookmarksTab.java \
   awesomebar/HistoryTab.java \