Backout e9cef5f38fe1 (bug 822422), 531d2eb905d7 (bug 822421) for build failures on a CLOSED TREE
@ -689,23 +689,11 @@ public class AboutHomeContent extends ScrollView
|
||||
|
||||
drawable.setAlpha(255, 0);
|
||||
setBackgroundDrawable(drawable);
|
||||
|
||||
boolean isLight = mActivity.getLightweightTheme().isLightTheme();
|
||||
mAddons.setTheme(isLight);
|
||||
mLastTabs.setTheme(isLight);
|
||||
mRemoteTabs.setTheme(isLight);
|
||||
((GeckoImageView) findViewById(R.id.abouthome_logo)).setTheme(isLight);
|
||||
((GeckoTextView) findViewById(R.id.top_sites_title)).setTheme(isLight);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLightweightThemeReset() {
|
||||
setBackgroundResource(R.drawable.abouthome_bg_repeat);
|
||||
mAddons.resetTheme();
|
||||
mLastTabs.resetTheme();
|
||||
mRemoteTabs.resetTheme();
|
||||
((GeckoImageView) findViewById(R.id.abouthome_logo)).resetTheme();
|
||||
((GeckoTextView) findViewById(R.id.top_sites_title)).resetTheme();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -13,7 +13,7 @@ import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class AboutHomeSection extends GeckoLinearLayout {
|
||||
public class AboutHomeSection extends LinearLayout {
|
||||
private static final String LOGTAG = "GeckoAboutHomeSection";
|
||||
|
||||
private TextView mTitle;
|
||||
|
@ -10,12 +10,8 @@ import android.widget.@VIEWTYPE@;
|
||||
|
||||
public class Gecko@VIEWTYPE@ extends @VIEWTYPE@ {
|
||||
private static final int[] STATE_PRIVATE_MODE = { R.attr.state_private };
|
||||
private static final int[] STATE_LIGHT = { R.attr.state_light };
|
||||
private static final int[] STATE_DARK = { R.attr.state_dark };
|
||||
|
||||
private boolean mIsPrivate = false;
|
||||
private boolean mIsLight = false;
|
||||
private boolean mIsDark = false;
|
||||
|
||||
public Gecko@VIEWTYPE@(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
@ -27,10 +23,6 @@ public class Gecko@VIEWTYPE@ extends @VIEWTYPE@ {
|
||||
|
||||
if (mIsPrivate)
|
||||
mergeDrawableStates(drawableState, STATE_PRIVATE_MODE);
|
||||
else if (mIsLight)
|
||||
mergeDrawableStates(drawableState, STATE_LIGHT);
|
||||
else if (mIsDark)
|
||||
mergeDrawableStates(drawableState, STATE_DARK);
|
||||
|
||||
return drawableState;
|
||||
}
|
||||
@ -44,29 +36,5 @@ public class Gecko@VIEWTYPE@ extends @VIEWTYPE@ {
|
||||
mIsPrivate = isPrivate;
|
||||
refreshDrawableState();
|
||||
}
|
||||
}
|
||||
|
||||
public void setTheme(boolean isLight) {
|
||||
// Set the theme only if it is different from existing theme.
|
||||
if ((isLight && mIsLight != isLight) ||
|
||||
(!isLight && mIsDark == isLight)) {
|
||||
if (isLight) {
|
||||
mIsLight = true;
|
||||
mIsDark = false;
|
||||
} else {
|
||||
mIsLight = false;
|
||||
mIsDark = true;
|
||||
}
|
||||
|
||||
refreshDrawableState();
|
||||
}
|
||||
}
|
||||
|
||||
public void resetTheme() {
|
||||
if (mIsLight || mIsDark) {
|
||||
mIsLight = false;
|
||||
mIsDark = false;
|
||||
refreshDrawableState();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,6 @@ public class LightweightTheme implements GeckoEventListener {
|
||||
private Application mApplication;
|
||||
private Bitmap mBitmap;
|
||||
private int mColor;
|
||||
private boolean mIsLight;
|
||||
|
||||
public static interface OnChangeListener {
|
||||
// This is the View's default post.
|
||||
@ -99,11 +98,6 @@ public class LightweightTheme implements GeckoEventListener {
|
||||
maxWidth, height);
|
||||
mColor = BitmapUtils.getDominantColor(cropped, false);
|
||||
|
||||
double luminance = (0.2125 * ((mColor & 0x00FF0000) >> 16)) +
|
||||
(0.7154 * ((mColor & 0x0000FF00) >> 8)) +
|
||||
(0.0721 * (mColor &0x000000FF));
|
||||
mIsLight = (luminance > 110) ? true : false;
|
||||
|
||||
notifyListeners();
|
||||
} catch(java.net.MalformedURLException e) {
|
||||
mBitmap = null;
|
||||
@ -162,10 +156,6 @@ public class LightweightTheme implements GeckoEventListener {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isLightTheme() {
|
||||
return mIsLight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Crop the image based on the position of the view on the window.
|
||||
* Either the View or one of its ancestors might have scrolled or translated.
|
||||
|
@ -227,12 +227,8 @@ FENNEC_PP_JAVA_FILES = \
|
||||
$(NULL)
|
||||
|
||||
FENNEC_PP_XML_FILES = \
|
||||
res/color/abouthome_section_more_text.xml \
|
||||
res/color/abouthome_section_subtitle.xml \
|
||||
res/color/abouthome_section_title.xml \
|
||||
res/color/awesome_bar_title.xml \
|
||||
res/color/awesome_bar_title_hint.xml \
|
||||
res/drawable/abouthome_logo.xml \
|
||||
res/drawable/address_bar_bg.xml \
|
||||
res/drawable/address_bar_nav_button.xml \
|
||||
res/drawable/address_bar_url.xml \
|
||||
@ -501,8 +497,7 @@ RES_DRAWABLE_BASE = \
|
||||
res/drawable/favicon.png \
|
||||
res/drawable/folder.png \
|
||||
res/drawable/abouthome_icon.png \
|
||||
res/drawable/abouthome_logo_dark.png \
|
||||
res/drawable/abouthome_logo_light.png \
|
||||
res/drawable/abouthome_logo.png \
|
||||
res/drawable/abouthome_promo_box_bg.9.png \
|
||||
res/drawable/abouthome_promo_box_pressed_bg.9.png \
|
||||
res/drawable/abouthome_promo_logo_apps.png \
|
||||
@ -591,8 +586,7 @@ RES_DRAWABLE_HDPI = \
|
||||
res/drawable-hdpi/home_bg.png \
|
||||
res/drawable-hdpi/home_star.png \
|
||||
res/drawable-hdpi/abouthome_icon.png \
|
||||
res/drawable-hdpi/abouthome_logo_dark.png \
|
||||
res/drawable-hdpi/abouthome_logo_light.png \
|
||||
res/drawable-hdpi/abouthome_logo.png \
|
||||
res/drawable-hdpi/abouthome_promo_box_bg.9.png \
|
||||
res/drawable-hdpi/abouthome_promo_box_pressed_bg.9.png \
|
||||
res/drawable-hdpi/abouthome_promo_logo_apps.png \
|
||||
@ -671,8 +665,7 @@ RES_DRAWABLE_XHDPI = \
|
||||
res/drawable-xhdpi/favicon.png \
|
||||
res/drawable-xhdpi/folder.png \
|
||||
res/drawable-xhdpi/abouthome_icon.png \
|
||||
res/drawable-xhdpi/abouthome_logo_dark.png \
|
||||
res/drawable-xhdpi/abouthome_logo_light.png \
|
||||
res/drawable-xhdpi/abouthome_logo.png \
|
||||
res/drawable-xhdpi/abouthome_promo_box_bg.9.png \
|
||||
res/drawable-xhdpi/abouthome_promo_box_pressed_bg.9.png \
|
||||
res/drawable-xhdpi/abouthome_promo_logo_apps.png \
|
||||
|
@ -1,19 +0,0 @@
|
||||
#filter substitution
|
||||
<?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/@ANDROID_PACKAGE_NAME@">
|
||||
|
||||
<!-- 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>
|
@ -1,19 +0,0 @@
|
||||
#filter substitution
|
||||
<?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/@ANDROID_PACKAGE_NAME@">
|
||||
|
||||
<!-- dark theme -->
|
||||
<item gecko:state_dark="true" android:color="#CCFFFFFF" />
|
||||
|
||||
<!-- light theme -->
|
||||
<item gecko:state_light="true" android:color="#CC222222" />
|
||||
|
||||
<!-- default -->
|
||||
<item android:color="#FF666666"/>
|
||||
|
||||
</selector>
|
@ -1,19 +0,0 @@
|
||||
#filter substitution
|
||||
<?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/@ANDROID_PACKAGE_NAME@">
|
||||
|
||||
<!-- dark theme -->
|
||||
<item gecko:state_dark="true" android:color="#FFFFFFFF" />
|
||||
|
||||
<!-- light theme -->
|
||||
<item gecko:state_light="true" android:color="#FF222222" />
|
||||
|
||||
<!-- default -->
|
||||
<item android:color="#FF000000"/>
|
||||
|
||||
</selector>
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 984 B After Width: | Height: | Size: 984 B |
@ -1,19 +0,0 @@
|
||||
#filter substitution
|
||||
<?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/@ANDROID_PACKAGE_NAME@">
|
||||
|
||||
<!-- dark theme -->
|
||||
<item gecko:state_dark="true" android:drawable="@drawable/abouthome_logo_light" />
|
||||
|
||||
<!-- light theme -->
|
||||
<item gecko:state_light="true" android:drawable="@drawable/abouthome_logo_dark" />
|
||||
|
||||
<!-- default -->
|
||||
<item android:drawable="@drawable/abouthome_logo_dark" />
|
||||
|
||||
</selector>
|
Before Width: | Height: | Size: 1.7 KiB |
@ -18,24 +18,23 @@
|
||||
android:layout_marginLeft="@dimen/abouthome_gutter_large"
|
||||
android:layout_marginRight="@dimen/abouthome_gutter_small">
|
||||
|
||||
<Gecko.ImageView android:id="@+id/abouthome_logo"
|
||||
android:src="@drawable/abouthome_logo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="24dip"
|
||||
android:layout_marginTop="16dip"
|
||||
android:layout_marginBottom="10dip"
|
||||
android:layout_marginLeft="12dip"/>
|
||||
<ImageView android:src="@drawable/abouthome_logo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="24dip"
|
||||
android:layout_marginTop="16dip"
|
||||
android:layout_marginBottom="10dip"
|
||||
android:layout_marginLeft="12dip"/>
|
||||
|
||||
<Gecko.TextView android:id="@+id/top_sites_title"
|
||||
android:text="@string/abouthome_top_sites_title"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="26dip"
|
||||
android:background="#34FFFFFF"
|
||||
android:paddingLeft="12dip"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/abouthome_section_title"
|
||||
android:textStyle="bold"
|
||||
android:gravity="left|center_vertical"/>
|
||||
<TextView android:id="@+id/top_sites_title"
|
||||
android:text="@string/abouthome_top_sites_title"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="26dip"
|
||||
android:background="#34FFFFFF"
|
||||
android:paddingLeft="12dip"
|
||||
android:textSize="12sp"
|
||||
android:textColor="#000000"
|
||||
android:textStyle="bold"
|
||||
android:gravity="left|center_vertical"/>
|
||||
|
||||
<view class="org.mozilla.gecko.AboutHomeContent$TopSitesGridView"
|
||||
android:id="@+id/top_sites_grid"
|
||||
|
@ -7,8 +7,7 @@
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="47dip"
|
||||
android:gravity="left|center_vertical"
|
||||
android:background="@drawable/action_bar_button"
|
||||
android:duplicateParentState="true">
|
||||
android:background="@drawable/action_bar_button">
|
||||
|
||||
<ImageView android:id="@+id/addon_icon"
|
||||
android:layout_width="32dp"
|
||||
@ -24,8 +23,7 @@
|
||||
android:layout_marginLeft="12dip"
|
||||
android:gravity="center_vertical"
|
||||
android:textSize="15sp"
|
||||
android:textColor="@color/abouthome_section_title"
|
||||
android:duplicateParentState="true"/>
|
||||
android:textColor="#222222"/>
|
||||
|
||||
<TextView android:id="@+id/addon_version"
|
||||
android:layout_width="wrap_content"
|
||||
@ -35,8 +33,7 @@
|
||||
android:layout_marginLeft="5dip"
|
||||
android:gravity="center_vertical"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/abouthome_section_subtitle"
|
||||
android:duplicateParentState="true"/>
|
||||
android:textColor="#666666"/>
|
||||
|
||||
<View android:layout_width="fill_parent"
|
||||
android:layout_height="1dp"
|
||||
|
@ -12,27 +12,27 @@
|
||||
android:paddingLeft="@dimen/abouthome_gutter_large"
|
||||
android:paddingRight="@dimen/abouthome_gutter_large">
|
||||
|
||||
<Gecko.ImageView android:id="@+id/abouthome_logo"
|
||||
android:src="@drawable/abouthome_logo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="24dip"
|
||||
android:layout_marginTop="16dip"
|
||||
android:layout_marginBottom="10dip"
|
||||
android:layout_marginLeft="12dip"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentLeft="true"/>
|
||||
<ImageView android:id="@+id/abouthome_logo"
|
||||
android:src="@drawable/abouthome_logo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="24dip"
|
||||
android:layout_marginTop="16dip"
|
||||
android:layout_marginBottom="10dip"
|
||||
android:layout_marginLeft="12dip"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentLeft="true"/>
|
||||
|
||||
<Gecko.TextView android:id="@+id/top_sites_title"
|
||||
android:text="@string/abouthome_top_sites_title"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="26dip"
|
||||
android:background="#34FFFFFF"
|
||||
android:paddingLeft="12dip"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/abouthome_section_title"
|
||||
android:textStyle="bold"
|
||||
android:gravity="left|center_vertical"
|
||||
android:layout_below="@id/abouthome_logo"/>
|
||||
<TextView android:id="@+id/top_sites_title"
|
||||
android:text="@string/abouthome_top_sites_title"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="26dip"
|
||||
android:background="#34FFFFFF"
|
||||
android:paddingLeft="12dip"
|
||||
android:textSize="12sp"
|
||||
android:textColor="#000000"
|
||||
android:textStyle="bold"
|
||||
android:gravity="left|center_vertical"
|
||||
android:layout_below="@id/abouthome_logo"/>
|
||||
|
||||
<ImageView android:src="@drawable/abouthome_icon"
|
||||
android:layout_width="180dp"
|
||||
|
@ -8,8 +8,7 @@
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="47dip"
|
||||
android:gravity="left|center_vertical"
|
||||
android:background="@drawable/action_bar_button"
|
||||
android:duplicateParentState="true">
|
||||
android:background="@drawable/action_bar_button">
|
||||
|
||||
<ImageView android:id="@+id/last_tab_favicon"
|
||||
android:layout_width="32dip"
|
||||
@ -27,8 +26,7 @@
|
||||
android:layout_marginRight="12dip"
|
||||
android:textSize="15sp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/abouthome_section_title"
|
||||
android:duplicateParentState="true"/>
|
||||
android:textColor="#222222"/>
|
||||
|
||||
<TextView android:id="@+id/last_tab_url"
|
||||
android:layout_width="wrap_content"
|
||||
@ -39,8 +37,7 @@
|
||||
android:layout_below="@id/last_tab_title"
|
||||
android:textSize="12sp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/abouthome_section_subtitle"
|
||||
android:duplicateParentState="true"/>
|
||||
android:textColor="#666666"/>
|
||||
|
||||
<View android:layout_width="fill_parent"
|
||||
android:layout_height="1dp"
|
||||
|
@ -7,8 +7,7 @@
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="47dip"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/action_bar_button"
|
||||
android:duplicateParentState="true">
|
||||
android:background="@drawable/action_bar_button">
|
||||
|
||||
<TextView android:id="@+id/remote_tab_title"
|
||||
android:layout_width="fill_parent"
|
||||
@ -17,10 +16,9 @@
|
||||
android:paddingRight="12dip"
|
||||
android:gravity="center_vertical"
|
||||
android:textSize="15sp"
|
||||
android:textColor="#222222"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="middle"
|
||||
android:textColor="@color/abouthome_section_title"
|
||||
android:duplicateParentState="true"/>
|
||||
android:ellipsize="middle"/>
|
||||
|
||||
<View android:layout_width="fill_parent"
|
||||
android:layout_height="1dp"
|
||||
|
@ -11,10 +11,9 @@
|
||||
android:background="#34FFFFFF"
|
||||
android:paddingLeft="12dip"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/abouthome_section_title"
|
||||
android:textColor="#000000"
|
||||
android:textStyle="bold"
|
||||
android:gravity="left|center_vertical"
|
||||
android:duplicateParentState="true"/>
|
||||
android:gravity="left|center_vertical"/>
|
||||
|
||||
<TextView android:id="@+id/subtitle"
|
||||
android:layout_width="fill_parent"
|
||||
@ -23,23 +22,20 @@
|
||||
android:background="#34FFFFFF"
|
||||
android:paddingLeft="12dip"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/abouthome_section_subtitle"
|
||||
android:gravity="left|center_vertical"
|
||||
android:duplicateParentState="true"/>
|
||||
android:textColor="#666666"
|
||||
android:gravity="left|center_vertical"/>
|
||||
|
||||
<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"/>
|
||||
android:isScrollContainer="false"/>
|
||||
|
||||
<org.mozilla.gecko.LinkTextView android:id="@+id/more_text"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="47dip"
|
||||
android:textColor="@color/abouthome_section_more_text"
|
||||
android:textColor="#22629e"
|
||||
android:textSize="12sp"
|
||||
android:gravity="center"
|
||||
android:duplicateParentState="true"/>
|
||||
android:gravity="center"/>
|
||||
|
||||
</merge>
|
||||
|
@ -61,10 +61,5 @@
|
||||
<attr name="state_private" format="boolean"/>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="LightweightTheme">
|
||||
<attr name="state_light" format="boolean"/>
|
||||
<attr name="state_dark" format="boolean"/>
|
||||
</declare-styleable>
|
||||
|
||||
</resources>
|
||||
|
||||
|