Bug 716095 - Specify a width for the doorhanger popup on tablets. r=sriram

This commit is contained in:
Margaret Leibovic 2012-06-26 14:39:39 -07:00
Родитель 2c723738c5
Коммит 6e435a6325
4 изменённых файлов: 70 добавлений и 1 удалений

Просмотреть файл

@ -39,7 +39,8 @@ public class DoorHangerPopup extends PopupWindow {
private void init() {
setBackgroundDrawable(new BitmapDrawable());
setOutsideTouchable(true);
setWindowLayoutMode(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
setWindowLayoutMode(GeckoApp.mAppContext.isTablet() ? ViewGroup.LayoutParams.WRAP_CONTENT : ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
LayoutInflater inflater = LayoutInflater.from(mContext);
RelativeLayout layout = (RelativeLayout) inflater.inflate(R.layout.doorhangerpopup, null);

Просмотреть файл

@ -291,6 +291,7 @@ RES_LAYOUT_LAND_V14 = \
RES_LAYOUT_XLARGE = \
res/layout-xlarge/browser_toolbar.xml \
res/layout-xlarge/doorhangerpopup.xml \
res/layout-xlarge/gecko_app.xml \
res/layout-xlarge/remote_tabs_child.xml \
res/layout-xlarge/remote_tabs_group.xml \
@ -300,6 +301,7 @@ RES_LAYOUT_XLARGE = \
RES_LAYOUT_SW600DP = \
res/layout-sw600dp/browser_toolbar.xml \
res/layout-sw600dp/doorhangerpopup.xml \
res/layout-sw600dp/gecko_app.xml \
res/layout-sw600dp/remote_tabs_child.xml \
res/layout-sw600dp/remote_tabs_group.xml \

Просмотреть файл

@ -0,0 +1,33 @@
<?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/. -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ScrollView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dip"
android:layout_alignParentTop="true"
android:minWidth="200dip"
android:maxWidth="600dip"
android:background="@drawable/doorhanger_popup_bg">
<LinearLayout android:id="@+id/doorhanger_container"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"/>
</ScrollView>
<ImageView android:layout_width="44dip"
android:layout_height="16dip"
android:layout_marginLeft="4dip"
android:layout_marginTop="9dip"
android:layout_alignParentTop="true"
android:src="@drawable/doorhanger_arrow"
android:scaleType="fitXY"/>
</RelativeLayout>

Просмотреть файл

@ -0,0 +1,33 @@
<?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/. -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ScrollView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dip"
android:layout_alignParentTop="true"
android:minWidth="200dip"
android:maxWidth="600dip"
android:background="@drawable/doorhanger_popup_bg">
<LinearLayout android:id="@+id/doorhanger_container"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"/>
</ScrollView>
<ImageView android:layout_width="44dip"
android:layout_height="16dip"
android:layout_marginLeft="4dip"
android:layout_marginTop="9dip"
android:layout_alignParentTop="true"
android:src="@drawable/doorhanger_arrow"
android:scaleType="fitXY"/>
</RelativeLayout>