mobile/android/base/resources/layout-v11/new_tablet_tabs_item_cell.xml
author Martyn Haigh <martyn.haigh@gmail.com>
Tue, 04 Nov 2014 18:04:08 +0000
changeset 213980 56f4f58c053bdfa7dbd0ae54b94ce2bfa676301a
parent 213970 6f5199eec3c01d86d22a3f96d2bd00beb2681f5e
child 218030 46b9f69a642f32800cb6ccb3bdaf5877f0f6be27
permissions -rw-r--r--
Bug 1093192 - Align close button in new tab grid (r=lucasr)

<?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/. -->

<org.mozilla.gecko.tabs.TabsLayoutItemView xmlns:android="http://schemas.android.com/apk/res/android"
                                           xmlns:gecko="http://schemas.android.com/apk/res-auto"
                                           style="@style/TabsItem"
                                           android:focusable="true"
                                           android:id="@+id/info"
                                           android:layout_width="wrap_content"
                                           android:layout_height="wrap_content"
                                           android:gravity="center"
                                           android:orientation="vertical"
                                           android:paddingBottom="@dimen/new_tablet_tab_panel_grid_padding">

    <LinearLayout android:layout_width="fill_parent"
                  android:layout_height="wrap_content"
                  android:orientation="horizontal"
                  android:duplicateParentState="true"
                  android:paddingLeft="@dimen/new_tablet_tab_highlight_stroke_width"
                  android:paddingRight="@dimen/new_tablet_tab_highlight_stroke_width"
                  android:paddingBottom="@dimen/new_tablet_tab_highlight_stroke_width">

        <org.mozilla.gecko.widget.FadedTextView android:id="@+id/title"
                                                android:layout_width="0dip"
                                                android:layout_height="wrap_content"
                                                android:layout_weight="1.0"
                                                style="@style/TabLayoutItemTextAppearance"
                                                android:textSize="14sp"
                                                android:textColor="@color/new_tablet_tab_item_title"
                                                android:singleLine="true"
                                                android:duplicateParentState="true"
                                                gecko:fadeWidth="15dp"
                                                android:paddingRight="5dp"/>


        <!-- Use of baselineAlignBottom only supported from API 11+ - if this needs to work on lower API versions
             we'll need to override getBaseLine() and return image height, but we assume this won't happen -->
        <ImageButton android:id="@+id/close"
                     style="@style/TabsItemClose"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:scaleType="center"
                     android:baselineAlignBottom="true"
                     android:background="@android:color/transparent"
                     android:contentDescription="@string/close_tab"
                     android:src="@drawable/new_tablet_tab_item_close_button"
                     android:duplicateParentState="true"/>

    </LinearLayout>

    <RelativeLayout android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:padding="@dimen/new_tablet_tab_highlight_stroke_width"
                    android:background="@drawable/tab_thumbnail"
                    android:duplicateParentState="true">

        <org.mozilla.gecko.widget.ThumbnailView android:id="@+id/thumbnail"
                                                android:layout_width="@dimen/new_tablet_tab_thumbnail_width"
                                                android:layout_height="@dimen/new_tablet_tab_thumbnail_height"
                                                />

    </RelativeLayout>

</org.mozilla.gecko.tabs.TabsLayoutItemView>