Skip to content

Commit

Permalink
Update 'NavigationDrawer-Full Overlay' sample
Browse files Browse the repository at this point in the history
Signed-off-by: Taeho Kim <[email protected]>
  • Loading branch information
kunny committed Jul 19, 2015
1 parent 74148e8 commit bf01a82
Show file tree
Hide file tree
Showing 14 changed files with 83 additions and 43 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
applicationId "com.androidhuman.example.materialdrawer.fulloverlay"
minSdkVersion 9
targetSdkVersion 21
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
Expand All @@ -21,5 +21,6 @@ android {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:design:22.2.1'
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
package com.androidhuman.example.materialdrawer.fulloverlay;

import android.content.res.Configuration;
import android.graphics.Color;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.support.design.widget.NavigationView;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;


public class MainActivity extends ActionBarActivity {
public class MainActivity extends AppCompatActivity {

Toolbar toolbar;
DrawerLayout dlDrawer;
NavigationView nvNavigation;
ActionBarDrawerToggle dtToggle;

@Override
Expand All @@ -23,9 +25,15 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_main);

toolbar = (Toolbar) findViewById(R.id.toolbar);
//toolbar.setNavigationIcon(R.drawable.ic_menu);

dlDrawer = (DrawerLayout) findViewById(R.id.drawer_layout);

setSupportActionBar(toolbar);
ActionBar ab = getSupportActionBar();
if (null != ab) {
ab.setDisplayHomeAsUpEnabled(true);
}

dtToggle = new ActionBarDrawerToggle(this, dlDrawer, R.string.app_name, R.string.app_name);
dlDrawer.setDrawerListener(dtToggle);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand All @@ -13,25 +14,25 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize" />

android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>

<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#303F9F" />
android:layout_height="match_parent" />

</LinearLayout>

<View
android:id="@+id/drawer"
android:layout_width="240dp"
<android.support.design.widget.NavigationView
android:id="@+id/navigation_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#3F51B5"
android:fitsSystemWindows="true" />

android:fitsSystemWindows="true"
app:menu="@menu/menu_drawer"/>

</android.support.v4.widget.DrawerLayout>

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<group android:checkableBehavior="single">
<item
android:id="@+id/nav_dashboard"
android:icon="@drawable/ic_dashboard_black_24dp"
android:title="Dashboard" />
<item
android:id="@+id/nav_explore"
android:icon="@drawable/ic_explore_black_24dp"
android:title="Explore" />
</group>

<item android:title="Sub menu">
<menu>
<item
android:icon="@drawable/ic_event_black_24dp"
android:title="Event" />
<item
android:icon="@drawable/ic_home_black_24dp"
android:title="Home" />
</menu>
</item>
</menu>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
<style name="AppTheme" parent="BaseTheme">
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">#33000000</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>

</resources>
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
<style name="AppTheme" parent="BaseTheme">
<!-- Customize your theme here. -->
</style>

<style name="BaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">#00BCD4</item>
<item name="colorPrimaryDark">#0097A7</item>
<item name="colorAccent">#FFFF00</item>
</style>

</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.14.2'
classpath 'com.android.tools.build:gradle:1.2.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Apr 10 15:27:10 PDT 2013
#Sun Jul 19 22:21:16 KST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<group android:checkableBehavior="single">
<group android:checkableBehavior="single">
<item
android:id="@+id/nav_dashboard"
android:icon="@drawable/ic_dashboard_black_24dp"
android:title="Dashboard" />
<item
android:id="@+id/nav_explore"
android:icon="@drawable/ic_explore_black_24dp"
android:title="Explore" />
</group>

<item android:title="Sub menu">
<menu>
<item
android:id="@+id/nav_dashboard"
android:icon="@drawable/ic_dashboard_black_24dp"
android:title="Dashboard" />
android:icon="@drawable/ic_event_black_24dp"
android:title="Event" />
<item
android:id="@+id/nav_explore"
android:icon="@drawable/ic_explore_black_24dp"
android:title="Explore" />
</group>

<item android:title="Sub menu">
<menu>
<item
android:icon="@drawable/ic_event_black_24dp"
android:title="Event" />
<item
android:icon="@drawable/ic_home_black_24dp"
android:title="Home" />
</menu>
</item>
android:icon="@drawable/ic_home_black_24dp"
android:title="Home" />
</menu>
</item>
</menu>

0 comments on commit bf01a82

Please sign in to comment.