helper method to handle when the drawer should be shown on launch
496964
private void handleShowOnLaunch() {
        //check if it should be shown on launch (and we have a drawerLayout)
        if (mActivity != null && mDrawerLayout != null) {
            if (mShowDrawerOnFirstLaunch || mShowDrawerUntilDraggedOpened) {
                final SharedPreferences preferences = mSharedPreferences != null ? mSharedPreferences : PreferenceManager.getDefaultSharedPreferences(mActivity);

                if (mShowDrawerOnFirstLaunch && !preferences.getBoolean(Drawer.PREF_USER_LEARNED_DRAWER, false)) {
                    //if it was not shown yet
                    //open the drawer
                    mDrawerLayout.openDrawer(mSliderLayout);

                    //save that it showed up once ;)
                    SharedPreferences.Editor editor = preferences.edit();
                    editor.putBoolean(Drawer.PREF_USER_LEARNED_DRAWER, true);
                    editor.apply();

                } else if (mShowDrawerUntilDraggedOpened && !preferences.getBoolean(Drawer.PREF_USER_OPENED_DRAWER_BY_DRAGGING, false)) {
                    // open the drawer since the user has not dragged it open yet
                    mDrawerLayout.openDrawer(mSliderLayout);

                    // add a listener to detect dragging
                    mDrawerLayout.addDrawerListener(new DrawerLayout.SimpleDrawerListener() {
                        boolean hasBeenDragged = false;

                        @Override
                        public void onDrawerStateChanged(int newState) {
                            if (newState == DrawerLayout.STATE_DRAGGING) {
                                // save that the user was dragging
                                hasBeenDragged = true;

                            } else if (newState == DrawerLayout.STATE_IDLE) {
                                // check if the user was dragging and if that resulted in an open drawer
                                if (hasBeenDragged && mDrawerLayout.isDrawerOpen(mDrawerGravity)) {
                                    // Save that the user has dragged it open
                                    SharedPreferences.Editor editor = preferences.edit();
                                    editor.putBoolean(Drawer.PREF_USER_OPENED_DRAWER_BY_DRAGGING, true);
                                    editor.apply();
                                } else {
                                    // reset the drag boolean
                                    hasBeenDragged = false;
                                }
                            }
                        }
                    });
                }
            }
        }
    }
158312
private void handleSelectionView(IProfile profile, boolean on) {
        if (on) {
            if (Build.VERSION.SDK_INT >= 23) {
                mAccountHeaderContainer.setForeground(AppCompatResources.getDrawable(mAccountHeaderContainer.getContext(), mAccountHeaderTextSectionBackgroundResource));
            } else {
                // todo foreground thing?
            }
            mAccountHeaderContainer.setOnClickListener(onSelectionClickListener);
            mAccountHeaderContainer.setTag(R.id.material_drawer_profile_header, profile);
        } else {
            if (Build.VERSION.SDK_INT >= 23) {
                mAccountHeaderContainer.setForeground(null);
            } else {
                // TODO foreground reset
            }
            mAccountHeaderContainer.setOnClickListener(null);
        }
    }
724240
private void resetDrawerContent(Context ctx) {
        if (mDrawer != null) {
            mDrawer.resetDrawerContent();
        }

        mAccountSwitcherArrow.clearAnimation();
        ViewCompat.animate(mAccountSwitcherArrow).rotation(0).start();
        //mAccountSwitcherArrow.setImageDrawable(new IconicsDrawable(ctx, MaterialDrawerFont.Icon.mdf_arrow_drop_down).sizeRes(R.dimen.material_drawer_account_header_dropdown).paddingRes(R.dimen.material_drawer_account_header_dropdown_padding).color(ColorHolder.color(mTextColor, ctx, R.attr.material_drawer_header_selection_text, R.color.material_drawer_header_selection_text)));
    }
67193
public static void onFooterDrawerItemClick(DrawerBuilder drawer, IDrawerItem drawerItem, View v, Boolean fireOnClick) {
        boolean checkable = !(drawerItem != null && drawerItem instanceof Selectable && !drawerItem.isSelectable());
        if (checkable) {
            drawer.resetStickyFooterSelection();

            v.setActivated(true);
            v.setSelected(true);

            //remove the selection in the list
            drawer.getAdapter().deselect();

            //find the position of the clicked footer item
            if (drawer.mStickyFooterView != null && drawer.mStickyFooterView instanceof LinearLayout) {
                LinearLayout footer = (LinearLayout) drawer.mStickyFooterView;
                for (int i = 0; i < footer.getChildCount(); i++) {
                    if (footer.getChildAt(i) == v) {
                        drawer.mCurrentStickyFooterSelection = i;
                        break;
                    }
                }
            }
        }


        if (fireOnClick != null) {
            boolean consumed = false;

            if (fireOnClick) {
                if (drawerItem instanceof AbstractDrawerItem && ((AbstractDrawerItem) drawerItem).getOnDrawerItemClickListener() != null) {
                    consumed = ((AbstractDrawerItem) drawerItem).getOnDrawerItemClickListener().onItemClick(v, -1, drawerItem);
                }

                if (drawer.mOnDrawerItemClickListener != null) {
                    consumed = drawer.mOnDrawerItemClickListener.onItemClick(v, -1, drawerItem);
                }
            }

            if (!consumed) {
                //close the drawer after click
                drawer.closeDrawerDelayed();
            }
        }
    }
647973
function () {
        var self = this, startPos;

        setTimeout(function () {
          self.classes.add('in');
          self.fire('open');
        }, 0);

        self._super();

        if (self.statusbar) {
          self.statusbar.postRender();
        }

        self.focus();

        this.dragHelper = new DragHelper(self._id + '-dragh', {
          start: function () {
            startPos = {
              x: self.layoutRect().x,
              y: self.layoutRect().y
            };
          },

          drag: function (e) {
            self.moveTo(startPos.x + e.deltaX, startPos.y + e.deltaY);
          }
        });

        self.on('submit', function (e) {
          if (!e.isDefaultPrevented()) {
            self.close();
          }
        });

        windows.push(self);
        toggleFullScreenState(true);
      }
322468
@Override
    public boolean onPrepareOptionsMenu(Menu menu) {

        if(layout.isDrawerOpen(drawer) && !deviceSupportMultiPane()) {
            menu.clear();
        }

        return super.onPrepareOptionsMenu(menu);
    }
628908
function handleShowInOS() {
        var entry = ProjectManager.getSelectedItem();
        if (entry) {
            brackets.app.showOSFolder(entry.fullPath, function (err) {
                if (err) {
                    console.error("Error showing '" + entry.fullPath + "' in OS folder:", err);
                }
            });
        }
    }
38474
private void onNavDrawerItemClicked(final int itemId) {
        if (itemId == mSelectedItem) {
            mDrawerLayout.closeDrawer(GravityCompat.START);
            return;
        }

        if (isSpecialItem(itemId)) {
            goToNavDrawerItem(itemId);
        } else {
            // launch the target Activity after a short delay, to allow the close animation to play
            mHandler.postDelayed(new Runnable() {
                @Override
                public void run() {
                    goToNavDrawerItem(itemId);
                }
            }, mConfig.getLaunchDelay());

            // change the active item on the list so the user can see the item changed
            setSelectedNavDrawerItem(itemId);

            // fade out the main content
//            if (mMainContent != null && mConfig.getFadeOutDuration() != -1) {
//                mMainContent.animate().alpha(0).setDuration(mConfig.getFadeOutDuration());
//            }
        }

        mDrawerLayout.closeDrawer(GravityCompat.START);
    }
1151014
function (element, options) {
		this.$element      = $(element)
		this.options       = $.extend({}, Drawer.DEFAULTS, options)
		this.$trigger      = $(this.options.trigger).filter('[href="#' + element.id + '"], [data-target="#' + element.id + '"]')
		this.transitioning = null

		if (this.options.parent) {
			this.$parent = this.getParent()
		} else {
			this.addAriaAndDrawerdClass(this.$element, this.$trigger)
		}

		if (this.options.toggle) this.toggle()
	}
1253979
public static void bindDragHandle(final RecyclerView.ViewHolder holder, final IExtendedDraggable item) {
        // if necessary, init the drag handle, which will start the drag when touched
        if (item.getTouchHelper() != null && item.getDragView(holder) != null) {
            item.getDragView(holder).setOnTouchListener(new View.OnTouchListener() {
                @Override
                public boolean onTouch(View v, MotionEvent event) {
                    if (MotionEventCompat.getActionMasked(event) == MotionEvent.ACTION_DOWN) {
                        if (item.isDraggable())
                            item.getTouchHelper().startDrag(holder);
                    }
                    return false;
                }
            });
        }
    }
847550
public void onResume() {
		if (requestPermissionOnStart && firstTime) {
			checkPermission(false);
			firstTime = false;
		} else if (pendingAppInfoDialog) {
			pendingAppInfoDialog = false;
			showAppInfoDialog();
		}
	}
833429
public void animateOpen() {
        prepareContent();

        if (onDrawerScrollListener != null) {
            onDrawerScrollListener.onScrollStarted();
        }

        animateOpen(vertical ? viewHandle.getTop() : viewHandle.getLeft());

        sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);

        if (onDrawerScrollListener != null) {
            onDrawerScrollListener.onScrollEnded();
        }
    }
1107117
@Override protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_place_sample);
    ButterKnife.inject(this);
    initializeFragments();
    initializeListView();
    initializeDraggablePanel();
    configNavigationDrawer();
  }
322269
private void onProfileImageClick(View v, boolean current) {
        IProfile profile = (IProfile) v.getTag(R.id.material_drawer_profile_header);

        boolean consumed = false;
        if (mOnAccountHeaderProfileImageListener != null) {
            consumed = mOnAccountHeaderProfileImageListener.onProfileImageClick(v, profile, current);
        }

        //if the event was already consumed by the click don't continue. note that this will also stop the profile change event
        if (!consumed) {
            onProfileClick(v, current);
        }
    }
858922
public void onItemClick() {
        if (selected) {
            selected = false;
            getView().reset();

            if (onResetCommand != null) {
                onResetCommand.execute();
            }
        }
        else {
            selected = true;
            getView().select();

            if (onSelectCommand != null) {
                onSelectCommand.execute();
            }
        }
    }
791998
private void initializeToolbar() {
        Condition.INSTANCE.ensureTrue(getSupportActionBar() == null,
                "An action bar is already attached to the activity. Use the theme " +
                        "\"@style/Theme.MaterialComponents.NoActionBar\" or " +
                        "\"@style/Theme.MaterialComponents.Light.NoActionBar\" as the activity's theme",
                IllegalStateException.class);
        if (isSplitScreen()) {
            toolbarLarge.setVisibility(View.VISIBLE);
        } else {
            toolbar.setVisibility(View.VISIBLE);
        }

        setSupportActionBar(toolbar);
        resetTitle();
    }
509775
private void initializeList() {
    mListView = (ListView) findViewById(R.id.drawer_list);
    mListAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1);
    mListView.setAdapter(mListAdapter);
    mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
      @Override
      public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
        mFragmentSwitcher.setCurrentItem(position);
        mDrawerLayout.closeDrawer(Gravity.START);
      }
    });
  }