mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1060345: Create a way of dynamically inflating the correct tab layout (r=lucasr)
This commit is contained in:
parent
1588fe4cbe
commit
c5c80e62bc
@ -237,6 +237,8 @@ public class BrowserApp extends GeckoApp
|
||||
final View view;
|
||||
if (BrowserToolbar.class.getName().equals(name)) {
|
||||
view = BrowserToolbar.create(context, attrs);
|
||||
} else if (TabsPanel.TabsLayout.class.getName().equals(name)) {
|
||||
view = TabsPanel.createTabsLayout(context, attrs);
|
||||
} else {
|
||||
view = super.onCreateView(name, context, attrs);
|
||||
}
|
||||
|
@ -32,13 +32,14 @@
|
||||
android:layout_height="0dip"
|
||||
android:layout_weight="1.0">
|
||||
|
||||
<org.mozilla.gecko.tabs.TabsListLayout android:id="@+id/normal_tabs"
|
||||
style="@style/TabsList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:choiceMode="singleChoice"
|
||||
android:visibility="gone"
|
||||
gecko:tabs="tabs_normal"/>
|
||||
<view class="org.mozilla.gecko.tabs.TabsPanel$TabsLayout"
|
||||
android:id="@+id/normal_tabs"
|
||||
style="@style/TabsList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:choiceMode="singleChoice"
|
||||
android:visibility="gone"
|
||||
gecko:tabs="tabs_normal"/>
|
||||
|
||||
<org.mozilla.gecko.tabs.PrivateTabsPanel
|
||||
android:id="@+id/private_tabs_panel"
|
||||
|
@ -47,11 +47,12 @@
|
||||
|
||||
<!-- Note: for an unknown reason, scrolling in the TabsListLayout
|
||||
does not work unless it is laid out after the empty view. -->
|
||||
<org.mozilla.gecko.tabs.TabsListLayout android:id="@+id/private_tabs_tray"
|
||||
style="@style/TabsList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:choiceMode="singleChoice"
|
||||
gecko:tabs="tabs_private"/>
|
||||
<view class="org.mozilla.gecko.tabs.TabsPanel$TabsLayout"
|
||||
android:id="@+id/private_tabs_tray"
|
||||
style="@style/TabsList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:choiceMode="singleChoice"
|
||||
gecko:tabs="tabs_private"/>
|
||||
|
||||
</merge>
|
||||
|
@ -31,13 +31,14 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<org.mozilla.gecko.tabs.TabsListLayout android:id="@+id/normal_tabs"
|
||||
style="@style/TabsList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:choiceMode="singleChoice"
|
||||
android:visibility="gone"
|
||||
gecko:tabs="tabs_normal"/>
|
||||
<view class="org.mozilla.gecko.tabs.TabsPanel$TabsLayout"
|
||||
android:id="@+id/normal_tabs"
|
||||
style="@style/TabsList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:choiceMode="singleChoice"
|
||||
android:visibility="gone"
|
||||
gecko:tabs="tabs_normal"/>
|
||||
|
||||
<org.mozilla.gecko.tabs.PrivateTabsPanel
|
||||
android:id="@+id/private_tabs_panel"
|
||||
|
@ -65,6 +65,10 @@ public class TabsPanel extends LinearLayout
|
||||
public void setEmptyView(View view);
|
||||
}
|
||||
|
||||
public static View createTabsLayout(final Context context, final AttributeSet attrs) {
|
||||
return new TabsListLayout(context, attrs);
|
||||
}
|
||||
|
||||
public static interface TabsLayoutChangeListener {
|
||||
public void onTabsLayoutChange(int width, int height);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user