From 4533e6f246ef728e9847943d5f65fa48fec8d82d Mon Sep 17 00:00:00 2001 From: Sriram Ramasubramanian Date: Thu, 18 Jul 2013 14:11:49 -0700 Subject: [PATCH] Bug 880047: Kill LinkTextView in old about:home [r=margaret] --HG-- extra : rebase_source : 01c1761d615e9f877ee04742bf107cb68dd1fcbc --- mobile/android/base/Makefile.in | 3 -- .../color/abouthome_section_more_text.xml | 18 ------- .../resources/layout/abouthome_section.xml | 8 --- .../android/base/resources/values/attrs.xml | 1 - .../android/base/widget/AboutHomeSection.java | 25 --------- mobile/android/base/widget/LinkTextView.java | 53 ------------------- 6 files changed, 108 deletions(-) delete mode 100644 mobile/android/base/resources/color/abouthome_section_more_text.xml delete mode 100644 mobile/android/base/widget/LinkTextView.java diff --git a/mobile/android/base/Makefile.in b/mobile/android/base/Makefile.in index f005d33d16f..aa21f1449df 100644 --- a/mobile/android/base/Makefile.in +++ b/mobile/android/base/Makefile.in @@ -262,7 +262,6 @@ FENNEC_JAVA_FILES = \ widget/GeckoPopupMenu.java \ widget/GeckoActionProvider.java \ widget/IconTabWidget.java \ - widget/LinkTextView.java \ widget/PromoBox.java \ widget/TabRow.java \ widget/ThumbnailView.java \ @@ -1029,7 +1028,6 @@ RES_DRAWABLE_XLARGE_XHDPI_V11 = \ $(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 \ @@ -1045,7 +1043,6 @@ RES_COLOR = \ $(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 \ diff --git a/mobile/android/base/resources/color/abouthome_section_more_text.xml b/mobile/android/base/resources/color/abouthome_section_more_text.xml deleted file mode 100644 index b3ac4d7a8b6..00000000000 --- a/mobile/android/base/resources/color/abouthome_section_more_text.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/mobile/android/base/resources/layout/abouthome_section.xml b/mobile/android/base/resources/layout/abouthome_section.xml index ef75c9e5ea0..be88a587334 100644 --- a/mobile/android/base/resources/layout/abouthome_section.xml +++ b/mobile/android/base/resources/layout/abouthome_section.xml @@ -34,12 +34,4 @@ android:isScrollContainer="false" android:duplicateParentState="true"/> - - diff --git a/mobile/android/base/resources/values/attrs.xml b/mobile/android/base/resources/values/attrs.xml index 764cd98dd6c..7e0b604484d 100644 --- a/mobile/android/base/resources/values/attrs.xml +++ b/mobile/android/base/resources/values/attrs.xml @@ -34,7 +34,6 @@ - diff --git a/mobile/android/base/widget/AboutHomeSection.java b/mobile/android/base/widget/AboutHomeSection.java index 8d3d60adcf6..20705a3607b 100644 --- a/mobile/android/base/widget/AboutHomeSection.java +++ b/mobile/android/base/widget/AboutHomeSection.java @@ -22,7 +22,6 @@ 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); @@ -34,12 +33,10 @@ public class AboutHomeSection extends GeckoLinearLayout { 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(); } @@ -65,20 +62,6 @@ public class AboutHomeSection extends GeckoLinearLayout { } } - 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); @@ -99,12 +82,4 @@ public class AboutHomeSection extends GeckoLinearLayout { public void hide() { setVisibility(View.GONE); } - - public void showMoreText() { - mMoreText.setVisibility(View.VISIBLE); - } - - public void hideMoreText() { - mMoreText.setVisibility(View.GONE); - } } diff --git a/mobile/android/base/widget/LinkTextView.java b/mobile/android/base/widget/LinkTextView.java deleted file mode 100644 index 3a7525ddb8d..00000000000 --- 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); - } - } - } -}