Browse Source

Added 'home' button to tab drawer

master
ByteHamster 9 years ago
parent
commit
b8058ad345
  1. 5
      app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java
  2. 19
      app/src/main/res/layout/tab_drawer.xml

5
app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java

@ -340,6 +340,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements @@ -340,6 +340,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
setupFrameLayoutButton(R.id.action_forward, R.id.icon_forward);
setupFrameLayoutButton(R.id.action_toggle_desktop, R.id.icon_desktop);
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
mSearch = (AutoCompleteTextView) customView.findViewById(R.id.search);
@ -2321,6 +2322,10 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements @@ -2321,6 +2322,10 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
case R.id.new_tab_button:
newTab(null, true);
break;
case R.id.action_home:
mCurrentView.loadHomepage();
closeDrawers();
break;
case R.id.button_next:
mWebView.findNext(false);
break;

19
app/src/main/res/layout/tab_drawer.xml

@ -58,7 +58,7 @@ @@ -58,7 +58,7 @@
android:background="?attr/dividerColor"
android:baselineAligned="false"
android:orientation="horizontal"
android:weightSum="3">
android:weightSum="4">
<FrameLayout
android:id="@+id/action_back"
@ -94,6 +94,23 @@ @@ -94,6 +94,23 @@
android:src="@drawable/ic_action_plus" />
</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
android:id="@+id/action_forward"
android:layout_width="match_parent"

Loading…
Cancel
Save