Bug 880047: Kill LinkTextView in old about:home [r=margaret]
authorSriram Ramasubramanian <sriram@mozilla.com>
Thu, 18 Jul 2013 14:11:49 -0700
changeset 143417 c4599977df51c5e7cb9b1493572d5bd6fda83a0b
parent 143416 13888d1c3b50ea58977072d224bbd2f582761ec9
child 143418 7d2228024886105961ce78d9f63cdfe18aa3cfad
push id25130
push userlrocha@mozilla.com
push dateWed, 21 Aug 2013 09:41:27 +0000
treeherdermozilla-central@b2486721572e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs880047
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 880047: Kill LinkTextView in old about:home [r=margaret]
mobile/android/base/Makefile.in
mobile/android/base/resources/color/abouthome_section_more_text.xml
mobile/android/base/resources/layout/abouthome_section.xml
mobile/android/base/resources/values/attrs.xml
mobile/android/base/widget/AboutHomeSection.java
mobile/android/base/widget/LinkTextView.java
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -257,17 +257,16 @@ FENNEC_JAVA_FILES = \
   widget/ButtonToast.java \
   widget/ArrowPopup.java \
   widget/DateTimePicker.java \
   widget/Divider.java \
   widget/FaviconView.java \
   widget/GeckoPopupMenu.java \
   widget/GeckoActionProvider.java \
   widget/IconTabWidget.java \
-  widget/LinkTextView.java \
   widget/PromoBox.java \
   widget/TabRow.java \
   widget/ThumbnailView.java \
   widget/TwoWayView.java \
   GeckoNetworkManager.java \
   GeckoScreenOrientationListener.java \
   UpdateService.java \
   GeckoUpdateReceiver.java \
@@ -1024,33 +1023,31 @@ RES_DRAWABLE_XLARGE_HDPI_V11 = \
   $(NULL)
 
 RES_DRAWABLE_XLARGE_XHDPI_V11 = \
   res/drawable-xlarge-xhdpi-v11/ic_menu_bookmark_add.png \
   res/drawable-xlarge-xhdpi-v11/ic_menu_bookmark_remove.png \
   $(NULL)
 
 RES_COLOR = \
-  res/color/abouthome_section_more_text.xml \
   res/color/abouthome_section_subtitle.xml \
   res/color/abouthome_section_title.xml \
   res/color/primary_text.xml \
   res/color/primary_text_inverse.xml \
   res/color/secondary_text.xml \
   res/color/secondary_text_inverse.xml \
   res/color/select_item_multichoice.xml \
   res/color/tertiary_text.xml \
   res/color/tertiary_text_inverse.xml \
   res/color/top_bookmark_item_title.xml \
   res/color/url_bar_title.xml \
   res/color/url_bar_title_hint.xml \
   $(NULL)
 
 RES_MENU = \
-  res/menu/abouthome_topsites_contextmenu.xml \
   res/menu/browser_app_menu.xml \
   res/menu/gecko_app_menu.xml \
   res/menu/home_contextmenu.xml \
   res/menu/titlebar_contextmenu.xml \
   res/menu-large-v11/browser_app_menu.xml \
   res/menu-v11/browser_app_menu.xml \
   res/menu-xlarge-v11/browser_app_menu.xml \
   $(NULL)
deleted file mode 100644
--- a/mobile/android/base/resources/color/abouthome_section_more_text.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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/. -->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android"
-          xmlns:gecko="http://schemas.android.com/apk/res-auto">
-
-    <!-- dark theme -->
-    <item gecko:state_dark="true" android:color="#80FFFFFF" />
-
-    <!-- light theme -->
-    <item gecko:state_light="true" android:color="#80222222" />
-
-    <!-- default -->
-    <item android:color="#FF22629E"/>
-
-</selector>
--- a/mobile/android/base/resources/layout/abouthome_section.xml
+++ b/mobile/android/base/resources/layout/abouthome_section.xml
@@ -29,17 +29,9 @@
 
     <LinearLayout android:id="@+id/items_container"
                   android:layout_width="fill_parent"
                   android:layout_height="wrap_content"
                   android:orientation="vertical"
                   android:isScrollContainer="false"
                   android:duplicateParentState="true"/>
 
-    <org.mozilla.gecko.widget.LinkTextView android:id="@+id/more_text"
-                                           android:layout_width="fill_parent"
-                                           android:layout_height="@dimen/abouthome_rowitem_height"
-                                           android:textColor="@color/abouthome_section_more_text"
-                                           android:textSize="12sp"
-                                           android:gravity="center"
-                                           android:focusable="true"/>
-
 </merge>
--- a/mobile/android/base/resources/values/attrs.xml
+++ b/mobile/android/base/resources/values/attrs.xml
@@ -29,17 +29,16 @@
         <!-- Default style for the HomeListView -->
         <attr name="homeListViewStyle" format="reference" />
 
     </declare-styleable>
 
     <declare-styleable name="AboutHomeSection">
         <attr name="title" format="string"/>
         <attr name="subtitle" format="string"/>
-        <attr name="more_text" format="string"/>
     </declare-styleable>
 
     <!-- DoorHangers -->
     <declare-styleable name="DoorHanger">
         <attr name="arrowPopupWidth" format="dimension">
              <enum name="fill_parent" value="-1" />
              <enum name="match_parent" value="-1" />
              <enum name="wrap_content" value="-2" />
--- a/mobile/android/base/widget/AboutHomeSection.java
+++ b/mobile/android/base/widget/AboutHomeSection.java
@@ -17,34 +17,31 @@ import android.view.LayoutInflater;
 import android.view.View;
 import android.widget.LinearLayout;
 import android.widget.TextView;
 
 public class AboutHomeSection extends GeckoLinearLayout {
     private TextView mTitle;
     private TextView mSubtitle;
     private LinearLayout mItemsContainer;
-    private LinkTextView mMoreText;
 
     public AboutHomeSection(Context context, AttributeSet attrs) {
         super(context, attrs);
 
         setOrientation(VERTICAL);
 
         LayoutInflater.from(context).inflate(R.layout.abouthome_section, this);
 
         mTitle = (TextView) this.findViewById(R.id.title);
         mSubtitle = (TextView) this.findViewById(R.id.subtitle);
         mItemsContainer = (LinearLayout) this.findViewById(R.id.items_container);
-        mMoreText = (LinkTextView) this.findViewById(R.id.more_text);
 
         TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.AboutHomeSection);
         setTitle(a.getText(R.styleable.AboutHomeSection_title));
         setSubtitle(a.getText(R.styleable.AboutHomeSection_subtitle));
-        setMoreText(a.getText(R.styleable.AboutHomeSection_more_text));
         a.recycle();
     }
 
     public LinearLayout getItemsContainer() {
         return mItemsContainer;
     }
 
     public void setTitle(CharSequence title) {
@@ -60,30 +57,16 @@ public class AboutHomeSection extends Ge
         if (!TextUtils.isEmpty(subtitle)) {
             mSubtitle.setText(subtitle);
             mSubtitle.setVisibility(View.VISIBLE);
         } else {
             mSubtitle.setVisibility(View.GONE);
         }
     }
 
-    public void setMoreText(CharSequence moreText) {
-        if (!TextUtils.isEmpty(moreText)) {
-            mMoreText.setText(moreText);
-            mMoreText.setVisibility(View.VISIBLE);
-        } else {
-            mMoreText.setVisibility(View.GONE);
-        }
-    }
-
-    public void setOnMoreTextClickListener(View.OnClickListener listener) {
-        mMoreText.setOnClickListener(listener);
-        mMoreText.setOnKeyListener(GamepadUtils.getClickDispatcher());
-    }
-
     public void addItem(View item) {
         mItemsContainer.addView(item);
 
         Divider divider = new Divider(getContext(), null);
         divider.setBackgroundColor(0x3460666E);
 
         mItemsContainer.addView(divider);
     }
@@ -94,17 +77,9 @@ public class AboutHomeSection extends Ge
 
     public void show() {
         setVisibility(View.VISIBLE);
     }
 
     public void hide() {
         setVisibility(View.GONE);
     }
-
-    public void showMoreText() {
-        mMoreText.setVisibility(View.VISIBLE);
-    }
-
-    public void hideMoreText() {
-        mMoreText.setVisibility(View.GONE);
-    }
 }
deleted file mode 100644
--- a/mobile/android/base/widget/LinkTextView.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* 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.widget;
-
-import org.mozilla.gecko.R;
-
-import android.content.Context;
-import android.graphics.Rect;
-import android.text.SpannableString;
-import android.text.style.BackgroundColorSpan;
-import android.text.style.UnderlineSpan;
-import android.util.AttributeSet;
-import android.widget.TextView;
-
-public class LinkTextView extends TextView {
-    private final BackgroundColorSpan mFocusBackgroundSpan;
-    private boolean mFocusApplied;
-
-    public LinkTextView(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        mFocusBackgroundSpan = new BackgroundColorSpan(context.getResources().getColor(R.color.highlight_focused));
-    }
-
-    @Override
-    public void setText(CharSequence text, BufferType type) {
-        SpannableString content = new SpannableString(text + " \u00BB");
-        content.setSpan(new UnderlineSpan(), 0, text.length(), 0);
-
-        super.setText(content, BufferType.SPANNABLE);
-    }
-
-    @Override
-    public void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) {
-        super.onFocusChanged(focused, direction, previouslyFocusedRect);
-
-        if (focused == mFocusApplied) {
-            return;
-        }
-        mFocusApplied = focused;
-
-        CharSequence text = getText();
-        if (text instanceof SpannableString) {
-            SpannableString spannable = (SpannableString)text;
-            if (focused) {
-                spannable.setSpan(mFocusBackgroundSpan, 0, text.length(), 0);
-            } else {
-                spannable.removeSpan(mFocusBackgroundSpan);
-            }
-        }
-    }
-}