mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 887269 - Add "Open all previous tabs" button (r=sriram)
This commit is contained in:
parent
d76b618369
commit
58c12b54e1
@ -119,6 +119,14 @@ public class LastTabsPage extends HomeFragment {
|
||||
});
|
||||
|
||||
registerForContextMenu(mList);
|
||||
|
||||
final View openAllTabsButton = view.findViewById(R.id.open_all_tabs_button);
|
||||
openAllTabsButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
openAllTabs();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -142,6 +150,21 @@ public class LastTabsPage extends HomeFragment {
|
||||
getLoaderManager().initLoader(LAST_TABS_LOADER_ID, null, mCursorLoaderCallbacks);
|
||||
}
|
||||
|
||||
private void openAllTabs() {
|
||||
final Cursor c = mAdapter.getCursor();
|
||||
if (c == null || !c.moveToFirst()) {
|
||||
return;
|
||||
}
|
||||
|
||||
final String[] urls = new String[c.getCount()];
|
||||
|
||||
do {
|
||||
urls[c.getPosition()] = c.getString(c.getColumnIndexOrThrow(Combined.URL));
|
||||
} while (c.moveToNext());
|
||||
|
||||
mNewTabsListener.onNewTabs(urls);
|
||||
}
|
||||
|
||||
private static class LastTabsCursorLoader extends SimpleCursorLoader {
|
||||
public LastTabsCursorLoader(Context context) {
|
||||
super(context);
|
||||
|
@ -11,4 +11,15 @@
|
||||
|
||||
<include layout="@layout/home_list_with_title"/>
|
||||
|
||||
<LinearLayout android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/background_light">
|
||||
|
||||
<Button android:id="@+id/open_all_tabs_button"
|
||||
style="@style/Widget.Home.ActionButton"
|
||||
android:text="@string/home_last_tabs_open"
|
||||
android:gravity="center"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -184,6 +184,10 @@
|
||||
<item name="android:paddingRight">10dip</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Home.ActionButton" parent="Widget.Home.PageButton">
|
||||
<item name="android:textAppearance">@style/TextAppearance.Widget.Home.PageAction</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Home.PageTitle">
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
<item name="android:layout_height">32dp</item>
|
||||
@ -303,6 +307,10 @@
|
||||
|
||||
<style name="TextAppearance.Widget.Home.PageTitle" parent="TextAppearance.Medium" />
|
||||
|
||||
<style name="TextAppearance.Widget.Home.PageAction" parent="TextAppearance.Small">
|
||||
<item name="android:textColor">#00ACFF</item>
|
||||
</style>
|
||||
|
||||
<!-- BrowserToolbar -->
|
||||
<style name="BrowserToolbar">
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
|
Loading…
Reference in New Issue
Block a user