Added 'home' button to tab drawer

This commit is contained in:
ByteHamster 2015-10-06 19:07:52 +02:00
parent 0672b87ec7
commit b8058ad345
2 changed files with 23 additions and 1 deletions

View File

@ -340,6 +340,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
setupFrameLayoutButton(R.id.action_forward, R.id.icon_forward); setupFrameLayoutButton(R.id.action_forward, R.id.icon_forward);
setupFrameLayoutButton(R.id.action_toggle_desktop, R.id.icon_desktop); setupFrameLayoutButton(R.id.action_toggle_desktop, R.id.icon_desktop);
setupFrameLayoutButton(R.id.action_reading, R.id.icon_reading); setupFrameLayoutButton(R.id.action_reading, R.id.icon_reading);
setupFrameLayoutButton(R.id.action_home, R.id.icon_home);
// create the search EditText in the ToolBar // create the search EditText in the ToolBar
mSearch = (AutoCompleteTextView) customView.findViewById(R.id.search); mSearch = (AutoCompleteTextView) customView.findViewById(R.id.search);
@ -2321,6 +2322,10 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
case R.id.new_tab_button: case R.id.new_tab_button:
newTab(null, true); newTab(null, true);
break; break;
case R.id.action_home:
mCurrentView.loadHomepage();
closeDrawers();
break;
case R.id.button_next: case R.id.button_next:
mWebView.findNext(false); mWebView.findNext(false);
break; break;

View File

@ -58,7 +58,7 @@
android:background="?attr/dividerColor" android:background="?attr/dividerColor"
android:baselineAligned="false" android:baselineAligned="false"
android:orientation="horizontal" android:orientation="horizontal"
android:weightSum="3"> android:weightSum="4">
<FrameLayout <FrameLayout
android:id="@+id/action_back" android:id="@+id/action_back"
@ -94,6 +94,23 @@
android:src="@drawable/ic_action_plus" /> android:src="@drawable/ic_action_plus" />
</FrameLayout> </FrameLayout>
<FrameLayout
android:id="@+id/action_home"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="?attr/actionBarItemBackground"
android:clickable="true">
<ImageView
android:id="@+id/icon_home"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:contentDescription="@string/action_homepage"
android:src="@drawable/ic_action_home" />
</FrameLayout>
<FrameLayout <FrameLayout
android:id="@+id/action_forward" android:id="@+id/action_forward"
android:layout_width="match_parent" android:layout_width="match_parent"