navigation drawer

As discussed on the forum, I have gone ahead and made a navigation drawer which switches between activities rather than going through and making fragments out of everything. Hopefully we can get to the fragmentization for 2.3, but it's not strictly necessary.

I've tested that it *works* on the emulator with 7" and 10" tablets, as well as on my actual device, but there are almost definitely bugs remaining, and ways to make it work and look better, so please feel free to submit or suggest any improvements!

Obviously a huge acknowledgement is due to @agruenberg who did all of the hard work in bringing in the support libraries, etc.

![untitled](https://cloud.githubusercontent.com/assets/2818274/3197912/f86c69fe-ed50-11e3-8099-b3c09e08ec2b.png)

I'll be curious what this is like on my tablet -- AnkiDroid already had a
left nav panel that did much what this is described to do.


On Fri, Jun 6, 2014 at 5:11 AM, Tim Rae <notifications@github.com> wrote:

> In src/com/ichi2/anki/NavigationDrawerActivity.java:
>
> > +
> > +    /* The click listener for ListView in the navigation drawer */
> > +    private class DrawerItemClickListener implements ListView.OnItemClickListener {
> > +        @Override
> > +        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
> > +            selectNavigationItem(position);
> > +        }
> > +    }
> > +
> > +    protected void selectNavigationItem(int position) {
> > +        // switch to new activity... be careful not to start own activity or we can get stuck in a loop
> > +    	switch (position){
> > +            case DRAWER_DECK_PICKER:
> > +                if (!(this instanceof DeckPicker)) {
> > +                    setResult(0);
> > +                    finishWithoutAnimation();
>
> Fixed it in #375 <https://github.com/ankidroid/Anki-Android/pull/375>
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/ankidroid/Anki-Android/pull/374/files#r13486398>.
>