└── NavigationDrawer
├── .classpath
├── .project
├── AndroidManifest.xml
├── bin
├── AndroidManifest.xml
├── NavigationDrawer.apk
├── classes.dex
├── classes
│ └── com
│ │ └── example
│ │ └── navigationdrawer
│ │ ├── BuildConfig.class
│ │ ├── FragmentOne.class
│ │ ├── FragmentThree.class
│ │ ├── FragmentTwo.class
│ │ ├── MainActivity$1$1.class
│ │ ├── MainActivity$1.class
│ │ ├── MainActivity.class
│ │ ├── R$attr.class
│ │ ├── R$dimen.class
│ │ ├── R$drawable.class
│ │ ├── R$id.class
│ │ ├── R$layout.class
│ │ ├── R$menu.class
│ │ ├── R$string.class
│ │ ├── R$style.class
│ │ └── R.class
├── dexedLibs
│ └── android-support-v4-f11e297ce25edeaa40d66629c0f212df.jar
├── res
│ ├── drawable-hdpi
│ │ └── ic_launcher.png
│ ├── drawable-mdpi
│ │ └── ic_launcher.png
│ ├── drawable-xhdpi
│ │ └── ic_launcher.png
│ └── drawable-xxhdpi
│ │ └── ic_launcher.png
└── resources.ap_
├── gen
└── com
│ └── example
│ └── navigationdrawer
│ ├── BuildConfig.java
│ └── R.java
├── ic_launcher-web.png
├── libs
└── android-support-v4.jar
├── proguard-project.txt
├── project.properties
├── res
├── drawable-hdpi
│ └── ic_launcher.png
├── drawable-mdpi
│ └── ic_launcher.png
├── drawable-xhdpi
│ └── ic_launcher.png
├── drawable-xxhdpi
│ └── ic_launcher.png
├── layout
│ ├── activity_main.xml
│ ├── fragment_one.xml
│ ├── fragment_three.xml
│ └── fragment_two.xml
├── menu
│ └── main.xml
├── values-sw600dp
│ └── dimens.xml
├── values-sw720dp-land
│ └── dimens.xml
├── values-v11
│ └── styles.xml
├── values-v14
│ └── styles.xml
└── values
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
└── src
└── com
└── example
└── navigationdrawer
├── FragmentOne.java
├── FragmentThree.java
├── FragmentTwo.java
└── MainActivity.java
/NavigationDrawer/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/NavigationDrawer/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | NavigationDrawer
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/NavigationDrawer/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
16 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/NavigationDrawer/bin/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
16 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/NavigationDrawer/bin/NavigationDrawer.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/bin/NavigationDrawer.apk
--------------------------------------------------------------------------------
/NavigationDrawer/bin/classes.dex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/bin/classes.dex
--------------------------------------------------------------------------------
/NavigationDrawer/bin/classes/com/example/navigationdrawer/BuildConfig.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/bin/classes/com/example/navigationdrawer/BuildConfig.class
--------------------------------------------------------------------------------
/NavigationDrawer/bin/classes/com/example/navigationdrawer/FragmentOne.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/bin/classes/com/example/navigationdrawer/FragmentOne.class
--------------------------------------------------------------------------------
/NavigationDrawer/bin/classes/com/example/navigationdrawer/FragmentThree.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/bin/classes/com/example/navigationdrawer/FragmentThree.class
--------------------------------------------------------------------------------
/NavigationDrawer/bin/classes/com/example/navigationdrawer/FragmentTwo.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/bin/classes/com/example/navigationdrawer/FragmentTwo.class
--------------------------------------------------------------------------------
/NavigationDrawer/bin/classes/com/example/navigationdrawer/MainActivity$1$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/bin/classes/com/example/navigationdrawer/MainActivity$1$1.class
--------------------------------------------------------------------------------
/NavigationDrawer/bin/classes/com/example/navigationdrawer/MainActivity$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/bin/classes/com/example/navigationdrawer/MainActivity$1.class
--------------------------------------------------------------------------------
/NavigationDrawer/bin/classes/com/example/navigationdrawer/MainActivity.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/bin/classes/com/example/navigationdrawer/MainActivity.class
--------------------------------------------------------------------------------
/NavigationDrawer/bin/classes/com/example/navigationdrawer/R$attr.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/bin/classes/com/example/navigationdrawer/R$attr.class
--------------------------------------------------------------------------------
/NavigationDrawer/bin/classes/com/example/navigationdrawer/R$dimen.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/bin/classes/com/example/navigationdrawer/R$dimen.class
--------------------------------------------------------------------------------
/NavigationDrawer/bin/classes/com/example/navigationdrawer/R$drawable.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/bin/classes/com/example/navigationdrawer/R$drawable.class
--------------------------------------------------------------------------------
/NavigationDrawer/bin/classes/com/example/navigationdrawer/R$id.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/bin/classes/com/example/navigationdrawer/R$id.class
--------------------------------------------------------------------------------
/NavigationDrawer/bin/classes/com/example/navigationdrawer/R$layout.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/bin/classes/com/example/navigationdrawer/R$layout.class
--------------------------------------------------------------------------------
/NavigationDrawer/bin/classes/com/example/navigationdrawer/R$menu.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/bin/classes/com/example/navigationdrawer/R$menu.class
--------------------------------------------------------------------------------
/NavigationDrawer/bin/classes/com/example/navigationdrawer/R$string.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/bin/classes/com/example/navigationdrawer/R$string.class
--------------------------------------------------------------------------------
/NavigationDrawer/bin/classes/com/example/navigationdrawer/R$style.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/bin/classes/com/example/navigationdrawer/R$style.class
--------------------------------------------------------------------------------
/NavigationDrawer/bin/classes/com/example/navigationdrawer/R.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/bin/classes/com/example/navigationdrawer/R.class
--------------------------------------------------------------------------------
/NavigationDrawer/bin/dexedLibs/android-support-v4-f11e297ce25edeaa40d66629c0f212df.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/bin/dexedLibs/android-support-v4-f11e297ce25edeaa40d66629c0f212df.jar
--------------------------------------------------------------------------------
/NavigationDrawer/bin/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/bin/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/NavigationDrawer/bin/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/bin/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/NavigationDrawer/bin/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/bin/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/NavigationDrawer/bin/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/bin/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/NavigationDrawer/bin/resources.ap_:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/bin/resources.ap_
--------------------------------------------------------------------------------
/NavigationDrawer/gen/com/example/navigationdrawer/BuildConfig.java:
--------------------------------------------------------------------------------
1 | /** Automatically generated file. DO NOT MODIFY */
2 | package com.example.navigationdrawer;
3 |
4 | public final class BuildConfig {
5 | public final static boolean DEBUG = true;
6 | }
--------------------------------------------------------------------------------
/NavigationDrawer/gen/com/example/navigationdrawer/R.java:
--------------------------------------------------------------------------------
1 | /* AUTO-GENERATED FILE. DO NOT MODIFY.
2 | *
3 | * This class was automatically generated by the
4 | * aapt tool from the resource data it found. It
5 | * should not be modified by hand.
6 | */
7 |
8 | package com.example.navigationdrawer;
9 |
10 | public final class R {
11 | public static final class attr {
12 | }
13 | public static final class dimen {
14 | /** Default screen margins, per the Android Design guidelines.
15 |
16 | Customize dimensions originally defined in res/values/dimens.xml (such as
17 | screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here.
18 |
19 | */
20 | public static final int activity_horizontal_margin=0x7f040000;
21 | public static final int activity_vertical_margin=0x7f040001;
22 | }
23 | public static final class drawable {
24 | public static final int ic_launcher=0x7f020000;
25 | }
26 | public static final class id {
27 | public static final int action_settings=0x7f080004;
28 | public static final int drawer=0x7f080002;
29 | public static final int drawer_layout=0x7f080000;
30 | public static final int main=0x7f080001;
31 | public static final int textView1=0x7f080003;
32 | }
33 | public static final class layout {
34 | public static final int activity_main=0x7f030000;
35 | public static final int fragment_one=0x7f030001;
36 | public static final int fragment_three=0x7f030002;
37 | public static final int fragment_two=0x7f030003;
38 | }
39 | public static final class menu {
40 | public static final int main=0x7f070000;
41 | }
42 | public static final class string {
43 | public static final int action_settings=0x7f050001;
44 | public static final int app_name=0x7f050000;
45 | public static final int hello_world=0x7f050002;
46 | }
47 | public static final class style {
48 | /**
49 | Base application theme, dependent on API level. This theme is replaced
50 | by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
51 |
52 |
53 | Theme customizations available in newer API levels can go in
54 | res/values-vXX/styles.xml, while customizations related to
55 | backward-compatibility can go here.
56 |
57 |
58 | Base application theme for API 11+. This theme completely replaces
59 | AppBaseTheme from res/values/styles.xml on API 11+ devices.
60 |
61 | API 11 theme customizations can go here.
62 |
63 | Base application theme for API 14+. This theme completely replaces
64 | AppBaseTheme from BOTH res/values/styles.xml and
65 | res/values-v11/styles.xml on API 14+ devices.
66 |
67 | API 14 theme customizations can go here.
68 | */
69 | public static final int AppBaseTheme=0x7f060000;
70 | /** Application theme.
71 | All customizations that are NOT specific to a particular API-level can go here.
72 | */
73 | public static final int AppTheme=0x7f060001;
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/NavigationDrawer/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/ic_launcher-web.png
--------------------------------------------------------------------------------
/NavigationDrawer/libs/android-support-v4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/libs/android-support-v4.jar
--------------------------------------------------------------------------------
/NavigationDrawer/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/NavigationDrawer/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-17
15 |
--------------------------------------------------------------------------------
/NavigationDrawer/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/NavigationDrawer/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/NavigationDrawer/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/NavigationDrawer/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manishkpr/AndroidNavigationDrawer/14fca42084d058d7ad93bdf3a017a8b0e8e7041d/NavigationDrawer/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/NavigationDrawer/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
12 |
13 |
14 |
21 |
22 |
--------------------------------------------------------------------------------
/NavigationDrawer/res/layout/fragment_one.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/NavigationDrawer/res/layout/fragment_three.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/NavigationDrawer/res/layout/fragment_two.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/NavigationDrawer/res/menu/main.xml:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/NavigationDrawer/res/values-sw600dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/NavigationDrawer/res/values-sw720dp-land/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 | 128dp
8 |
9 |
10 |
--------------------------------------------------------------------------------
/NavigationDrawer/res/values-v11/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/NavigationDrawer/res/values-v14/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/NavigationDrawer/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 16dp
5 | 16dp
6 |
7 |
8 |
--------------------------------------------------------------------------------
/NavigationDrawer/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | NavigationDrawer
5 | Settings
6 | Hello world!
7 |
8 |
9 |
--------------------------------------------------------------------------------
/NavigationDrawer/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
14 |
15 |
16 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/NavigationDrawer/src/com/example/navigationdrawer/FragmentOne.java:
--------------------------------------------------------------------------------
1 | package com.example.navigationdrawer;
2 |
3 | import android.content.Context;
4 | import android.os.Bundle;
5 | import android.support.v4.app.Fragment;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 |
10 | public class FragmentOne extends Fragment {
11 |
12 | public static Fragment newInstance(Context context) {
13 | FragmentOne f = new FragmentOne();
14 |
15 | return f;
16 | }
17 |
18 | @Override
19 | public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
20 | ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_one, null);
21 | return root;
22 | }
23 |
24 | }
--------------------------------------------------------------------------------
/NavigationDrawer/src/com/example/navigationdrawer/FragmentThree.java:
--------------------------------------------------------------------------------
1 | package com.example.navigationdrawer;
2 |
3 | import android.content.Context;
4 | import android.os.Bundle;
5 | import android.support.v4.app.Fragment;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 |
10 | public class FragmentThree extends Fragment {
11 |
12 | public static Fragment newInstance(Context context) {
13 | FragmentThree f = new FragmentThree();
14 |
15 | return f;
16 | }
17 |
18 | @Override
19 | public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
20 | ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_three, null);
21 | return root;
22 | }
23 |
24 | }
--------------------------------------------------------------------------------
/NavigationDrawer/src/com/example/navigationdrawer/FragmentTwo.java:
--------------------------------------------------------------------------------
1 | package com.example.navigationdrawer;
2 |
3 | import android.content.Context;
4 | import android.os.Bundle;
5 | import android.support.v4.app.Fragment;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 |
10 | public class FragmentTwo extends Fragment {
11 |
12 | public static Fragment newInstance(Context context) {
13 | FragmentTwo f = new FragmentTwo();
14 |
15 | return f;
16 | }
17 |
18 | @Override
19 | public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
20 | ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_two, null);
21 | return root;
22 | }
23 |
24 | }
--------------------------------------------------------------------------------
/NavigationDrawer/src/com/example/navigationdrawer/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.navigationdrawer;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.app.Fragment;
5 | import android.support.v4.app.FragmentActivity;
6 | import android.support.v4.app.FragmentTransaction;
7 | import android.support.v4.widget.DrawerLayout;
8 | import android.view.View;
9 | import android.widget.AdapterView;
10 | import android.widget.AdapterView.OnItemClickListener;
11 | import android.widget.ArrayAdapter;
12 | import android.widget.ListView;
13 |
14 | public class MainActivity extends FragmentActivity {
15 | final String[] data ={"one","two","three"};
16 | final String[] fragments ={
17 | "com.example.navigationdrawer.FragmentOne",
18 | "com.example.navigationdrawer.FragmentTwo",
19 | "com.example.navigationdrawer.FragmentThree"};
20 | @Override
21 | protected void onCreate(Bundle savedInstanceState) {
22 | super.onCreate(savedInstanceState);
23 | setContentView(R.layout.activity_main);
24 |
25 | ArrayAdapter adapter = new ArrayAdapter(getActionBar().getThemedContext(), android.R.layout.simple_list_item_1, data);
26 |
27 | final DrawerLayout drawer = (DrawerLayout)findViewById(R.id.drawer_layout);
28 | final ListView navList = (ListView) findViewById(R.id.drawer);
29 | navList.setAdapter(adapter);
30 | navList.setOnItemClickListener(new OnItemClickListener(){
31 | @Override
32 | public void onItemClick(AdapterView> parent, View view, final int pos,long id){
33 | drawer.setDrawerListener( new DrawerLayout.SimpleDrawerListener(){
34 | @Override
35 | public void onDrawerClosed(View drawerView){
36 | super.onDrawerClosed(drawerView);
37 | FragmentTransaction tx = getSupportFragmentManager().beginTransaction();
38 | tx.replace(R.id.main, Fragment.instantiate(MainActivity.this, fragments[pos]));
39 | tx.commit();
40 | }
41 | });
42 | drawer.closeDrawer(navList);
43 | }
44 | });
45 | FragmentTransaction tx = getSupportFragmentManager().beginTransaction();
46 | tx.replace(R.id.main,Fragment.instantiate(MainActivity.this, fragments[0]));
47 | tx.commit();
48 | }
49 |
50 |
51 |
52 | }
53 |
--------------------------------------------------------------------------------