Bug 905328: Shadow of url-bar should be shown always. [r=lucasr]

This commit is contained in:
Sriram Ramasubramanian 2013-08-20 12:12:47 -07:00
parent e9dad1758c
commit 967c4fdf77
11 changed files with 5 additions and 100 deletions

View File

@ -1481,7 +1481,6 @@ abstract public class BrowserApp extends GeckoApp
// FIXME: do animation if animate is true
mHomePager.hide();
mBrowserToolbar.setShadowVisibility(true);
mBrowserToolbar.setNextFocusDownId(R.id.layer_view);
// Refresh toolbar height to possibly restore the toolbar padding

View File

@ -511,13 +511,6 @@ public class BrowserToolbar extends GeckoRelativeLayout
}
});
mShadow = (ImageView) findViewById(R.id.shadow);
mShadow.setOnClickListener(new Button.OnClickListener() {
@Override
public void onClick(View v) {
}
});
float slideWidth = getResources().getDimension(R.dimen.browser_toolbar_lock_width);
LinearLayout.LayoutParams siteSecParams = (LinearLayout.LayoutParams) mSiteSecurity.getLayoutParams();
@ -549,23 +542,6 @@ public class BrowserToolbar extends GeckoRelativeLayout
}
});
}
if (!HardwareUtils.isTablet()) {
// Set a touch delegate to Tabs button, so the touch events on its tail
// are passed to the menu button.
post(new Runnable() {
@Override
public void run() {
int height = mTabs.getHeight();
int width = mTabs.getWidth();
int tail = (width - height) / 2;
Rect bounds = new Rect(0, 0, tail, height);
TailTouchDelegate delegate = new TailTouchDelegate(bounds, mShadow);
mTabs.setTouchDelegate(delegate);
}
});
}
}
public boolean onKey(int keyCode, KeyEvent event) {
@ -1046,11 +1022,6 @@ public class BrowserToolbar extends GeckoRelativeLayout
String url = tab.getURL();
// Only set shadow to visible when not on about screens (except about:blank)
// and when not in editing mode.
visible &= !(url == null || (url.startsWith("about:") &&
!url.equals("about:blank"))) && !isEditing();
if ((mShadow.getVisibility() == View.VISIBLE) != visible) {
mShadow.setVisibility(visible ? View.VISIBLE : View.GONE);
}
@ -1465,8 +1436,6 @@ public class BrowserToolbar extends GeckoRelativeLayout
@Override
public void onPropertyAnimationEnd() {
setShadowVisibility(true);
PropertyAnimator buttonsAnimator = new PropertyAnimator(300);
// Fade toolbar buttons (page actions, stop) after the entry
@ -1699,7 +1668,6 @@ public class BrowserToolbar extends GeckoRelativeLayout
setProgressVisibility(tab.getState() == Tab.STATE_LOADING);
setSecurityMode(tab.getSecurityMode());
setPageActionVisibility(mStop.getVisibility() == View.VISIBLE);
setShadowVisibility(true);
updateBackButton(tab.canDoBack());
updateForwardButton(tab.canDoForward());

View File

@ -154,7 +154,6 @@ FENNEC_JAVA_FILES = \
TabsPanel.java \
TabsTray.java \
TabsAccessor.java \
TailTouchDelegate.java \
Telemetry.java \
TextSelection.java \
TextSelectionHandle.java \
@ -685,7 +684,6 @@ RES_DRAWABLE_MDPI = \
res/drawable-mdpi/tab_thumbnail_shadow.png \
res/drawable-mdpi/tabs_count.png \
res/drawable-mdpi/tabs_count_foreground.png \
res/drawable-mdpi/url_bar_bg_shadow.png \
res/drawable-mdpi/url_bar_entry_default.9.png \
res/drawable-mdpi/url_bar_entry_default_pb.9.png \
res/drawable-mdpi/url_bar_entry_pressed.9.png \
@ -797,7 +795,6 @@ RES_DRAWABLE_HDPI = \
res/drawable-hdpi/tab_thumbnail_shadow.png \
res/drawable-hdpi/tabs_count.png \
res/drawable-hdpi/tabs_count_foreground.png \
res/drawable-hdpi/url_bar_bg_shadow.png \
res/drawable-hdpi/url_bar_entry_default.9.png \
res/drawable-hdpi/url_bar_entry_default_pb.9.png \
res/drawable-hdpi/url_bar_entry_pressed.9.png \
@ -845,7 +842,6 @@ RES_DRAWABLE_XHDPI = \
res/drawable-xhdpi/favicon.png \
res/drawable-xhdpi/folder.png \
res/drawable-xhdpi/abouthome_thumbnail.png \
res/drawable-xhdpi/url_bar_bg_shadow.png \
res/drawable-xhdpi/url_bar_entry_default.9.png \
res/drawable-xhdpi/url_bar_entry_default_pb.9.png \
res/drawable-xhdpi/url_bar_entry_pressed.9.png \
@ -1104,7 +1100,6 @@ RES_DRAWABLE += \
res/drawable/action_bar_button_inverse.xml \
res/drawable/bookmark_thumbnail_bg.xml \
res/drawable/url_bar_bg.xml \
res/drawable/url_bar_bg_shadow_repeat.xml \
res/drawable/url_bar_entry.xml \
res/drawable/url_bar_nav_button.xml \
res/drawable/url_bar_right_edge.xml \

View File

@ -1,47 +0,0 @@
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
* 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.graphics.Rect;
import android.view.MotionEvent;
import android.view.TouchDelegate;
import android.view.View;
/**
* A TouchDelegate to pass the events from one view to another.
* Usually it's better to give half of the tail's width to the other
* view that is being overlapped.
*/
public class TailTouchDelegate extends TouchDelegate {
/**
* Creates a TailTouchDelegate for a view.
*
* @param bounds The rectangular bounds on the view which should delegate events.
* @param delegateView The view that should get the delegated events.
*/
public TailTouchDelegate(Rect bounds, View delegateView) {
super(bounds, delegateView);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
// Android bug 36445: Touch Delegation not reset on ACTION_DOWN.
if (!super.onTouchEvent(event)) {
MotionEvent cancelEvent = MotionEvent.obtain(event);
cancelEvent.setAction(MotionEvent.ACTION_CANCEL);
super.onTouchEvent(cancelEvent);
return false;
} else {
return true;
}
default:
return super.onTouchEvent(event);
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 979 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 973 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 979 B

View File

@ -1,9 +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/. -->
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/url_bar_bg_shadow"
android:tileMode="repeat"
android:dither="false"/>

View File

@ -185,8 +185,7 @@
android:layout_width="fill_parent"
android:layout_height="2dp"
android:layout_alignParentBottom="true"
android:background="@drawable/url_bar_bg_shadow_repeat"
android:contentDescription="@null"
android:visibility="gone"/>
android:background="@color/url_bar_shadow"
android:contentDescription="@null"/>
</merge>

View File

@ -186,8 +186,7 @@
android:layout_width="fill_parent"
android:layout_height="2dp"
android:layout_alignParentBottom="true"
android:background="@drawable/url_bar_bg_shadow_repeat"
android:contentDescription="@null"
android:visibility="gone"/>
android:background="@color/url_bar_shadow"
android:contentDescription="@null"/>
</merge>

View File

@ -87,6 +87,7 @@
<color name="url_bar_domaintext">#000</color>
<color name="url_bar_domaintext_private">#FFF</color>
<color name="url_bar_blockedtext">#b14646</color>
<color name="url_bar_shadow">#12000000</color>
<color name="home_last_tab_bar_bg">#FFF5F7F9</color>