Android Open Source - MaterialNavigationDrawer Main Activity






From Project

Back to project page MaterialNavigationDrawer.

License

The source code is released under:

Apache License

If you think the Android project MaterialNavigationDrawer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package it.neokree.example;
//from   w  w  w  .  j  a  v a  2  s .co  m
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;

import java.util.ArrayList;

import it.neokree.example.backpattern.BackAnywhere;
import it.neokree.example.backpattern.BackPatternCustom;
import it.neokree.example.backpattern.BackToFirst;
import it.neokree.example.functionalities.CustomAccountSection;
import it.neokree.example.functionalities.KitkatStatusBar;
import it.neokree.example.functionalities.MultiPane;
import it.neokree.example.functionalities.RealColorSections;
import it.neokree.example.functionalities.RippleBackport;
import it.neokree.example.functionalities.UniqueToolbarColor;
import it.neokree.example.functionalities.master_child.MasterChildActivity;
import it.neokree.example.light.Accounts;
import it.neokree.example.light.CustomDrawerHeader;
import it.neokree.example.light.ImageDrawerHeader;
import it.neokree.example.light.MockedAccount;
import it.neokree.example.light.NoDrawerHeader;
import it.neokree.example.test.Test;

/**
 * Created by neokree on 30/12/14.
 */
public class MainActivity extends ListActivity implements AdapterView.OnItemClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ArrayList<String> list = new ArrayList<String>();

        list.add("Light - Mocked Account");
        list.add("Dark  - Mocked Account");

        list.add("Light - Accounts");
        list.add("Dark  - Accounts");

        list.add("Light - Drawer Header Image");
        list.add("Dark  - Drawer Header Image");

        list.add("Light - No Drawer Header");
        list.add("Dark  - No Drawer Header");

        list.add("Light - Custom Drawer Header");
        list.add("Dark  - Custom Drawer Header");

        list.add("Functionality: unique Toolbar Color");
        list.add("Functionality: ripple backport support");
        list.add("Functionality: multi pane support for tablet");
        list.add("Functionality: custom section under account list");
        list.add("Functionality: Kitkat trasluncent status bar");
        list.add("Functionality: Master/Child example");
        list.add("Functionality: section not pre-rendered");

        list.add("Back Pattern: Back To first");
        list.add("Back Pattern: Back Anywhere");
        list.add("Back Pattern: Custom");

        //list.add("Test");

        this.setListAdapter(new ArrayAdapter<>(this,android.R.layout.simple_list_item_1,list));
        this.getListView().setOnItemClickListener(this);
    }

    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        Intent intent;
        switch(position) {
            case 0:
                intent = new Intent(this,MockedAccount.class);
                break;
            case 1:
                intent = new Intent(this, it.neokree.example.dark.MockedAccount.class);
                break;
            case 2:
                intent = new Intent(this,Accounts.class);
                break;
            case 3:
                intent = new Intent(this, it.neokree.example.dark.Accounts.class);
                break;
            case 4:
                intent = new Intent(this,ImageDrawerHeader.class);
                break;
            case 5:
                intent = new Intent(this, it.neokree.example.dark.ImageDrawerHeader.class);
                break;
            case 6:
                intent = new Intent(this,NoDrawerHeader.class);
                break;
            case 7:
                intent = new Intent(this, it.neokree.example.dark.NoDrawerHeader.class);
                break;
            case 8:
                intent = new Intent(this, CustomDrawerHeader.class);
                break;
            case 9:
                intent = new Intent(this, it.neokree.example.dark.CustomDrawerHeader.class);
                break;
            case 10:
                intent = new Intent(this, UniqueToolbarColor.class);
                break;
            case 11:
                intent = new Intent(this, RippleBackport.class);
                break;
            case 12:
                intent = new Intent(this, MultiPane.class);
                break;
            case 13:
                intent = new Intent(this, CustomAccountSection.class);
                break;
            case 14:
                intent = new Intent(this, KitkatStatusBar.class);
                break;
            case 15:
                intent = new Intent(this, MasterChildActivity.class);
                break;
            case 16:
                intent = new Intent(this, RealColorSections.class);
                break;
            case 17:
                intent = new Intent(this, BackToFirst.class);
                break;
            case 18:
                intent = new Intent(this, BackAnywhere.class);
                break;
            case 19:
                intent = new Intent(this, BackPatternCustom.class);
                break;
            case 20:
                intent = new Intent(this, Test.class);
                break;
            default:
                intent = null;
        }
        startActivity(intent);
    }
}




Java Source Code List

it.neokree.example.MainActivity.java
it.neokree.example.backpattern.BackAnywhere.java
it.neokree.example.backpattern.BackPatternCustom.java
it.neokree.example.backpattern.BackToFirst.java
it.neokree.example.dark.Accounts.java
it.neokree.example.dark.CustomDrawerHeader.java
it.neokree.example.dark.ImageDrawerHeader.java
it.neokree.example.dark.MockedAccount.java
it.neokree.example.dark.NoDrawerHeader.java
it.neokree.example.functionalities.CustomAccountSection.java
it.neokree.example.functionalities.KitkatStatusBar.java
it.neokree.example.functionalities.MultiPane.java
it.neokree.example.functionalities.RealColorSections.java
it.neokree.example.functionalities.RippleBackport.java
it.neokree.example.functionalities.UniqueToolbarColor.java
it.neokree.example.functionalities.master_child.ChildFragment.java
it.neokree.example.functionalities.master_child.MasterChildActivity.java
it.neokree.example.functionalities.master_child.MasterFragment.java
it.neokree.example.light.Accounts.java
it.neokree.example.light.CustomDrawerHeader.java
it.neokree.example.light.ImageDrawerHeader.java
it.neokree.example.light.MockedAccount.java
it.neokree.example.light.NoDrawerHeader.java
it.neokree.example.mockedActivity.Profile.java
it.neokree.example.mockedActivity.Settings.java
it.neokree.example.mockedFragments.FragmentButton.java
it.neokree.example.mockedFragments.FragmentIndex.java
it.neokree.example.mockedFragments.FragmentList.java
it.neokree.materialnavigationdrawer.MaterialNavigationDrawer.java
it.neokree.materialnavigationdrawer.elements.MaterialAccount.java
it.neokree.materialnavigationdrawer.elements.MaterialSection.java
it.neokree.materialnavigationdrawer.elements.MaterialSubheader.java
it.neokree.materialnavigationdrawer.elements.listeners.MaterialAccountListener.java
it.neokree.materialnavigationdrawer.elements.listeners.MaterialSectionListener.java
it.neokree.materialnavigationdrawer.util.MaterialActionBarDrawerToggle.java
it.neokree.materialnavigationdrawer.util.MaterialDrawerLayout.java
it.neokree.materialnavigationdrawer.util.TypefaceManager.java
it.neokree.materialnavigationdrawer.util.Utils.java