Add new tab button to desktop tabs view
This commit is contained in:
parent
7f4cab1e2e
commit
c684472f6e
@ -1023,6 +1023,11 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
|
|||||||
return mPresenter.newTab(url, show);
|
return mPresenter.newTab(url, show);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void newTabClicked() {
|
||||||
|
mPresenter.newTab(null, true);
|
||||||
|
}
|
||||||
|
|
||||||
// TODO move this to presenter
|
// TODO move this to presenter
|
||||||
private synchronized void deleteTab(int position) {
|
private synchronized void deleteTab(int position) {
|
||||||
mPresenter.deleteTab(position);
|
mPresenter.deleteTab(position);
|
||||||
|
@ -53,4 +53,6 @@ public interface UIController {
|
|||||||
|
|
||||||
void showCloseDialog(int position);
|
void showCloseDialog(int position);
|
||||||
|
|
||||||
|
void newTabClicked();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -112,6 +112,14 @@ public class TabsFragment extends Fragment implements View.OnClickListener, View
|
|||||||
} else {
|
} else {
|
||||||
view = inflater.inflate(R.layout.tab_strip, container, false);
|
view = inflater.inflate(R.layout.tab_strip, container, false);
|
||||||
layoutManager = new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false);
|
layoutManager = new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false);
|
||||||
|
ImageView newTab = (ImageView) view.findViewById(R.id.new_tab_button);
|
||||||
|
newTab.setColorFilter(ThemeUtils.getIconDarkThemeColor(getActivity()));
|
||||||
|
newTab.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
mUiController.newTabClicked();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.tabs_list);
|
RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.tabs_list);
|
||||||
recyclerView.setLayoutManager(layoutManager);
|
recyclerView.setLayoutManager(layoutManager);
|
||||||
|
@ -1,9 +1,26 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:background="@color/black"
|
android:background="@color/black"
|
||||||
android:overScrollMode="never"
|
android:orientation="horizontal"
|
||||||
android:scrollbars="none"
|
android:weightSum="1">
|
||||||
android:id="@+id/tabs_list" />
|
|
||||||
|
<android.support.v7.widget.RecyclerView
|
||||||
|
android:id="@+id/tabs_list"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:overScrollMode="never"
|
||||||
|
android:scrollbars="none"
|
||||||
|
android:fadingEdge="horizontal"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/new_tab_button"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="?actionBarItemBackground"
|
||||||
|
android:src="@drawable/ic_action_plus"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user