1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2024-11-24 09:52:18 -05:00

Link settings and about activity from navigation drawer.

This commit is contained in:
Sebastian Kaspari 2015-03-26 18:31:38 +01:00
parent 0e0b2bb199
commit 4aca69e765
4 changed files with 70 additions and 6 deletions

View File

@ -30,6 +30,7 @@ import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBarDrawerToggle; import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View;
import org.yaaic.R; import org.yaaic.R;
import org.yaaic.fragment.OverviewFragment; import org.yaaic.fragment.OverviewFragment;
@ -44,6 +45,7 @@ import org.yaaic.model.Status;
*/ */
public class MainActivity extends ActionBarActivity implements OverviewFragment.Callback, ServiceConnection { public class MainActivity extends ActionBarActivity implements OverviewFragment.Callback, ServiceConnection {
private ActionBarDrawerToggle toggle; private ActionBarDrawerToggle toggle;
private DrawerLayout drawer;
private IRCBinder binder; private IRCBinder binder;
@Override @Override
@ -55,7 +57,7 @@ public class MainActivity extends ActionBarActivity implements OverviewFragment.
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer); drawer = (DrawerLayout) findViewById(R.id.drawer);
toggle = new ActionBarDrawerToggle(this, drawer, toolbar, 0, 0); toggle = new ActionBarDrawerToggle(this, drawer, toolbar, 0, 0);
drawer.setDrawerListener(toggle); drawer.setDrawerListener(toggle);
@ -113,6 +115,18 @@ public class MainActivity extends ActionBarActivity implements OverviewFragment.
} }
public void onSettings(View view) {
drawer.closeDrawers();
startActivity(new Intent(this, SettingsActivity.class));
}
public void onAbout(View view) {
drawer.closeDrawers();
startActivity(new Intent(this, AboutActivity.class));
}
@Override @Override
public IRCBinder getBinder() { public IRCBinder getBinder() {
return binder; return binder;

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="#dddddd">
<item>
<shape android:shape="rectangle">
<solid android:color="#ffffff" />
</shape>
</item>
</ripple>

View File

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?><!--
<!--
Yaaic - Yet Another Android IRC Client Yaaic - Yet Another Android IRC Client
Copyright 2009-2015 Sebastian Kaspari Copyright 2009-2015 Sebastian Kaspari
@ -27,4 +26,46 @@ along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
android:background="@android:color/white" android:background="@android:color/white"
android:clickable="true" android:clickable="true"
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
app:insetForeground="#4000" /> android:paddingTop="24dp"
app:insetForeground="#4000">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="4dp"
android:layout_marginTop="4dp"
android:background="@color/divider" />
<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="onSettings"
android:paddingLeft="16dp"
android:text="@string/navigation_settings"
android:textSize="14sp" />
<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="onAbout"
android:paddingLeft="16dp"
android:text="@string/navigation_about"
android:textSize="14sp" />
</LinearLayout>
</org.yaaic.view.ScrimInsetsFrameLayout>

View File

@ -3,8 +3,8 @@
<string name="add_server_menu">Add server</string> <string name="add_server_menu">Add server</string>
<string name="add_server_list">Add server</string> <string name="add_server_list">Add server</string>
<string name="settings_menu">Settings</string> <string name="navigation_settings">Settings</string>
<string name="about_menu">About</string> <string name="navigation_about">About</string>
<string name="disconnect_menu">Disconnect all</string> <string name="disconnect_menu">Disconnect all</string>
<string name="about_label">About</string> <string name="about_label">About</string>