Add "overview" menu item to navigation drawer.

This commit is contained in:
Sebastian Kaspari 2015-04-04 13:06:14 +02:00
parent b374f2972d
commit fc6516e1d3
4 changed files with 31 additions and 4 deletions

View File

@ -81,7 +81,7 @@ public class MainActivity extends ActionBarActivity implements OverviewFragment.
drawer.setDrawerListener(toggle);
LinearLayout drawerContent = (LinearLayout) findViewById(R.id.drawer_content);
LinearLayout serverContainer = (LinearLayout) findViewById(R.id.server_container);
for (final Server server : Yaaic.getInstance().getServersAsArrayList()) {
TextView serverView = (TextView) getLayoutInflater().inflate(R.layout.item_drawer_server, drawer, false);
@ -96,7 +96,7 @@ public class MainActivity extends ActionBarActivity implements OverviewFragment.
}
});
drawerContent.addView(serverView, 0);
serverContainer.addView(serverView, 0);
}
}

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"
<?xml version="1.0" encoding="utf-8"?>
<!--
Yaaic - Yet Another Android IRC Client

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?><!--
<?xml version="1.0" encoding="utf-8"?>
<!--
Yaaic - Yet Another Android IRC Client
Copyright 2009-2015 Sebastian Kaspari
@ -35,6 +36,31 @@ along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@drawable/navigation_item_background"
android:clickable="true"
android:fontFamily="sans-serif-medium"
android:gravity="center_vertical"
android:onClick="onOverview"
android:paddingLeft="16dp"
android:text="@string/navigation_overview"
android:textSize="14sp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="4dp"
android:layout_marginTop="4dp"
android:background="@color/divider" />
<LinearLayout
android:id="@+id/server_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"

View File

@ -3,6 +3,7 @@
<string name="add_server_menu">Add server</string>
<string name="add_server_list">Add server</string>
<string name="navigation_overview">Overview</string>
<string name="navigation_settings">Settings</string>
<string name="navigation_about">About</string>
<string name="disconnect_menu">Disconnect all</string>