Give more space to the close button, and highlight separately from tab.
Fix for http://b/issue?id=2126503 and http://b/issue?id=2124781
Change-Id: I4a83223477e553d124ed667d92bc4970a3ebca0e
diff --git a/res/drawable/close_background.xml b/res/drawable/close_background.xml
new file mode 100644
index 0000000..627712f
--- /dev/null
+++ b/res/drawable/close_background.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item android:state_window_focused="false"
+ android:drawable="@android:color/transparent" />
+ <item android:state_focused="false" android:state_pressed="true"
+ android:drawable="@*android:drawable/list_selector_background_transition" />
+ <item android:state_focused="false" android:state_pressed="false"
+ android:drawable="@color/black"/>
+</selector>
diff --git a/res/layout/tab_view.xml b/res/layout/tab_view.xml
index 167621e..1f01d79 100644
--- a/res/layout/tab_view.xml
+++ b/res/layout/tab_view.xml
@@ -58,11 +58,13 @@
android:layout_marginTop="5dip"
android:layout_marginBottom="5dip"
/>
- <ImageView android:id="@+id/close"
- android:src="@drawable/ic_btn_close_panel"
+ <view class="com.android.browser.ActiveTabsPage$CloseHolder" android:id="@+id/close"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="8dip"
- android:layout_marginRight="8dip"
+ android:layout_height="fill_parent"
+ android:paddingLeft="18dip"
+ android:paddingRight="18dip"
+ android:background="@drawable/close_background"
+ android:src="@drawable/ic_btn_close_panel"
+ android:scaleType="center"
/>
</LinearLayout>