Search in sources :

Example 1 with DrawerLayout

use of androidx.drawerlayout.widget.DrawerLayout in project orgzly-android by orgzly.

the class MainActivity method setupViewModel.

private void setupViewModel() {
    sharedMainActivityViewModel.getDrawerLockState().observe(this, isLocked -> {
        DrawerLayout layout = mDrawerLayout;
        if (layout != null) {
            if (isLocked == null || !isLocked) {
                layout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED);
            } else {
                layout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
            }
        }
    });
    sharedMainActivityViewModel.getFragmentState().observe(this, state -> {
        if (BuildConfig.LOG_DEBUG)
            LogUtils.d(TAG, "Observed fragment state: " + state);
        if (state != null) {
            getSupportActionBar().setTitle(state.getTitle());
            // Clean up whitespace for multi-line query
            CharSequence subTitle = state.getSubTitle();
            if (subTitle != null) {
                subTitle = subTitle.toString().replaceAll("\\s{2,}", " ");
            }
            getSupportActionBar().setSubtitle(subTitle);
            drawerNavigationView.updateActiveFragment(state.getTag());
            /* Update floating action button. */
            MainFab.updateFab(this, state.getTag(), state.getSelectionCount());
        }
    });
    viewModel.getOpenNoteWithPropertyRequestEvent().observeSingle(this, pair -> {
        if (pair != null) {
            UseCase action = pair.getFirst();
            UseCaseResult result = pair.getSecond();
            if (action instanceof NoteFindWithProperty) {
                NoteFindWithProperty thisAction = (NoteFindWithProperty) action;
                if (result.getUserData() != null) {
                    NoteDao.NoteIdBookId note = (NoteDao.NoteIdBookId) result.getUserData();
                    DisplayManager.displayExistingNote(getSupportFragmentManager(), note.getBookId(), note.getNoteId());
                } else {
                    showSnackbar(getString(R.string.no_such_link_target, thisAction.getName(), thisAction.getValue()));
                }
            }
        }
    });
    viewModel.getOpenFileLinkRequestEvent().observeSingle(this, result -> {
        if (result != null && result.getUserData() != null) {
            Object userData = result.getUserData();
            if (userData instanceof Book) {
                Book book = (Book) userData;
                Intent intent = new Intent(AppIntent.ACTION_OPEN_BOOK);
                intent.putExtra(AppIntent.EXTRA_BOOK_ID, book.getId());
                LocalBroadcastManager.getInstance(this).sendBroadcast(intent);
                if (BuildConfig.LOG_DEBUG)
                    LogUtils.d(TAG, "sending intent", intent);
            } else if (userData instanceof File) {
                File file = (File) userData;
                openFileIfExists(file);
            }
        }
    });
    viewModel.getOpenNoteRequestEvent().observeSingle(this, note -> MainActivity.openSpecificNote(note.getPosition().getBookId(), note.getId()));
    viewModel.getSetBookLinkRequestEvent().observeSingle(this, result -> {
        Book book = result.getBook();
        List<Repo> links = result.getLinks();
        CharSequence[] urls = result.getUrls();
        int checked = result.getSelected();
        if (links.isEmpty()) {
            showSnackbarWithReposLink(getString(R.string.no_repos));
        } else {
            ArrayAdapter<Repo> adapter = new ArrayAdapter<>(this, R.layout.item_repo, R.id.item_repo_url);
            adapter.addAll(links);
            dialog = new AlertDialog.Builder(this).setTitle(R.string.book_link).setSingleChoiceItems(urls, checked, (d, which) -> {
                mSyncFragment.run(new BookLinkUpdate(book.getId(), links.get(which)));
                dialog.dismiss();
                dialog = null;
            }).setNeutralButton(R.string.remove_notebook_link, (dialog, which) -> {
                mSyncFragment.run(new BookLinkUpdate(book.getId()));
            }).setNegativeButton(R.string.cancel, null).show();
        }
    });
    viewModel.getSavedSearchedExportEvent().observeSingle(this, count -> {
        showSnackbar(getResources().getQuantityString(R.plurals.exported_searches, count, count));
    });
    viewModel.getSavedSearchedImportEvent().observeSingle(this, count -> {
        showSnackbar(getResources().getQuantityString(R.plurals.imported_searches, count, count));
    });
    viewModel.getErrorEvent().observeSingle(this, error -> {
        if (error != null) {
            showSnackbar(error.getLocalizedMessage());
        }
    });
}
Also used : Bundle(android.os.Bundle) NonNull(androidx.annotation.NonNull) Uri(android.net.Uri) NoteDelete(com.orgzly.android.usecase.NoteDelete) UseCase(com.orgzly.android.usecase.UseCase) ActivityUtils(com.orgzly.android.ui.util.ActivityUtils) Query(com.orgzly.android.query.Query) Handler(android.os.Handler) Fragment(androidx.fragment.app.Fragment) BookFormat(com.orgzly.android.BookFormat) DrawerNavigationView(com.orgzly.android.ui.drawer.DrawerNavigationView) NoteUpdateState(com.orgzly.android.usecase.NoteUpdateState) NoteFindWithProperty(com.orgzly.android.usecase.NoteFindWithProperty) IntentFilter(android.content.IntentFilter) Set(java.util.Set) SearchView(androidx.appcompat.widget.SearchView) Book(com.orgzly.android.db.entity.Book) BuildConfig(com.orgzly.BuildConfig) CommonActivity(com.orgzly.android.ui.CommonActivity) Note(com.orgzly.android.db.entity.Note) BookImportFromUri(com.orgzly.android.usecase.BookImportFromUri) DottedQueryBuilder(com.orgzly.android.query.user.DottedQueryBuilder) DrawerLayout(androidx.drawerlayout.widget.DrawerLayout) NotePaste(com.orgzly.android.usecase.NotePaste) BookExportToUri(com.orgzly.android.usecase.BookExportToUri) SavedSearchUpdate(com.orgzly.android.usecase.SavedSearchUpdate) NoteDao(com.orgzly.android.db.dao.NoteDao) SavedSearchFragment(com.orgzly.android.ui.savedsearch.SavedSearchFragment) R(com.orgzly.R) SyncService(com.orgzly.android.sync.SyncService) Menu(android.view.Menu) NoteFragment(com.orgzly.android.ui.note.NoteFragment) ActionModeListener(com.orgzly.android.ui.ActionModeListener) BookFragment(com.orgzly.android.ui.notes.book.BookFragment) ViewModelProvider(androidx.lifecycle.ViewModelProvider) NoteDemote(com.orgzly.android.usecase.NoteDemote) IOException(java.io.IOException) SavedSearchMoveUp(com.orgzly.android.usecase.SavedSearchMoveUp) File(java.io.File) ArrayAdapter(android.widget.ArrayAdapter) NotePromote(com.orgzly.android.usecase.NotePromote) Configuration(android.content.res.Configuration) BottomActionBar(com.orgzly.android.ui.BottomActionBar) Notifications(com.orgzly.android.ui.notifications.Notifications) LogUtils(com.orgzly.android.util.LogUtils) SavedSearchCreate(com.orgzly.android.usecase.SavedSearchCreate) BookForceSave(com.orgzly.android.usecase.BookForceSave) NoteUpdateDeadlineTime(com.orgzly.android.usecase.NoteUpdateDeadlineTime) SavedSearchExport(com.orgzly.android.usecase.SavedSearchExport) BookSparseTreeForNote(com.orgzly.android.usecase.BookSparseTreeForNote) ActionBarDrawerToggle(androidx.appcompat.app.ActionBarDrawerToggle) View(android.view.View) NoteMove(com.orgzly.android.usecase.NoteMove) NoteUpdateStateToggle(com.orgzly.android.usecase.NoteUpdateStateToggle) BroadcastReceiver(android.content.BroadcastReceiver) ViewGroup(android.view.ViewGroup) AlertDialog(android.app.AlertDialog) Nullable(org.jetbrains.annotations.Nullable) Repo(com.orgzly.android.db.entity.Repo) List(java.util.List) App(com.orgzly.android.App) BookCreate(com.orgzly.android.usecase.BookCreate) Toolbar(androidx.appcompat.widget.Toolbar) BookPrefaceFragment(com.orgzly.android.ui.notes.book.BookPrefaceFragment) BookImportGettingStarted(com.orgzly.android.usecase.BookImportGettingStarted) SimpleOneLinerDialog(com.orgzly.android.ui.dialogs.SimpleOneLinerDialog) BooksFragment(com.orgzly.android.ui.books.BooksFragment) ReposActivity(com.orgzly.android.ui.repos.ReposActivity) NotNull(org.jetbrains.annotations.NotNull) Snackbar(com.google.android.material.snackbar.Snackbar) OrgDateTime(com.orgzly.org.datetime.OrgDateTime) AutoSync(com.orgzly.android.sync.AutoSync) BookExport(com.orgzly.android.usecase.BookExport) Context(android.content.Context) UseCaseRunner(com.orgzly.android.usecase.UseCaseRunner) SavedSearchMoveDown(com.orgzly.android.usecase.SavedSearchMoveDown) NavigationView(com.google.android.material.navigation.NavigationView) Intent(android.content.Intent) LocalBroadcastManager(androidx.localbroadcastmanager.content.LocalBroadcastManager) DisplayManager(com.orgzly.android.ui.DisplayManager) AppPermissions(com.orgzly.android.util.AppPermissions) MenuItem(android.view.MenuItem) SettingsActivity(com.orgzly.android.ui.settings.SettingsActivity) Lifecycle(androidx.lifecycle.Lifecycle) NoteCut(com.orgzly.android.usecase.NoteCut) AppPreferences(com.orgzly.android.prefs.AppPreferences) LifecycleOwner(androidx.lifecycle.LifecycleOwner) AppIntent(com.orgzly.android.AppIntent) SavedSearchDelete(com.orgzly.android.usecase.SavedSearchDelete) Place(com.orgzly.android.ui.Place) OutputStream(java.io.OutputStream) SavedSearchesFragment(com.orgzly.android.ui.savedsearches.SavedSearchesFragment) NotesClipboard(com.orgzly.android.db.NotesClipboard) BookLinkUpdate(com.orgzly.android.usecase.BookLinkUpdate) GravityCompat(androidx.core.view.GravityCompat) SavedSearch(com.orgzly.android.db.entity.SavedSearch) ActionMode(androidx.appcompat.view.ActionMode) NotePlace(com.orgzly.android.ui.NotePlace) NoteCopy(com.orgzly.android.usecase.NoteCopy) UseCaseResult(com.orgzly.android.usecase.UseCaseResult) BookForceLoad(com.orgzly.android.usecase.BookForceLoad) Condition(com.orgzly.android.query.Condition) BookUpdatePreface(com.orgzly.android.usecase.BookUpdatePreface) NoteUpdateScheduledTime(com.orgzly.android.usecase.NoteUpdateScheduledTime) BookName(com.orgzly.android.BookName) NoteDao(com.orgzly.android.db.dao.NoteDao) DottedQueryBuilder(com.orgzly.android.query.user.DottedQueryBuilder) UseCase(com.orgzly.android.usecase.UseCase) UseCaseResult(com.orgzly.android.usecase.UseCaseResult) Intent(android.content.Intent) AppIntent(com.orgzly.android.AppIntent) NoteFindWithProperty(com.orgzly.android.usecase.NoteFindWithProperty) Repo(com.orgzly.android.db.entity.Repo) Book(com.orgzly.android.db.entity.Book) BookLinkUpdate(com.orgzly.android.usecase.BookLinkUpdate) DrawerLayout(androidx.drawerlayout.widget.DrawerLayout) File(java.io.File) ArrayAdapter(android.widget.ArrayAdapter)

Example 2 with DrawerLayout

use of androidx.drawerlayout.widget.DrawerLayout in project Douya by DreaminginCodeZH.

the class NavigationFragment method reloadForActiveAccountChange.

private void reloadForActiveAccountChange() {
    if (getNavigationHost() == null) {
        return;
    }
    DrawerLayout drawerLayout = getDrawer();
    View drawerView = getView();
    boolean drawerVisible = drawerLayout.isDrawerVisible(drawerView);
    if (!mWillReloadForActiveAccountChange) {
        mWillReloadForActiveAccountChange = true;
        Runnable reloadRunnable = new Runnable() {

            @Override
            public void run() {
                if (getNavigationHost() != null) {
                    getNavigationHost().reloadForActiveAccountChange();
                    mWillReloadForActiveAccountChange = false;
                    mNeedReloadForActiveAccountChange = false;
                }
            }
        };
        if (drawerVisible) {
            ViewUtils.postOnDrawerClosed(drawerLayout, reloadRunnable);
        } else {
            reloadRunnable.run();
        }
    }
    if (drawerVisible) {
        drawerLayout.closeDrawer(drawerView);
    }
}
Also used : DrawerLayout(androidx.drawerlayout.widget.DrawerLayout) NavigationView(com.google.android.material.navigation.NavigationView) BindView(butterknife.BindView) View(android.view.View)

Example 3 with DrawerLayout

use of androidx.drawerlayout.widget.DrawerLayout in project Gadgetbridge by Freeyourgadget.

the class ControlCenterv2 method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    AbstractGBActivity.init(this, AbstractGBActivity.NO_ACTIONBAR);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_controlcenterv2);
    Toolbar toolbar = findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    DrawerLayout drawer = findViewById(R.id.drawer_layout);
    ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, R.string.controlcenter_navigation_drawer_open, R.string.controlcenter_navigation_drawer_close);
    drawer.setDrawerListener(toggle);
    toggle.syncState();
    NavigationView navigationView = findViewById(R.id.nav_view);
    navigationView.setNavigationItemSelectedListener(this);
    // end of material design boilerplate
    deviceManager = ((GBApplication) getApplication()).getDeviceManager();
    deviceListView = findViewById(R.id.deviceListView);
    deviceListView.setHasFixedSize(true);
    deviceListView.setLayoutManager(new LinearLayoutManager(this));
    deviceList = deviceManager.getDevices();
    mGBDeviceAdapter = new GBDeviceAdapterv2(this, deviceList, deviceActivityHashMap);
    // get activity data asynchronously, this fills the deviceActivityHashMap
    // and calls refreshPairedDevices() → notifyDataSetChanged
    createRefreshTask("get activity data", getApplication()).execute();
    deviceListView.setAdapter(this.mGBDeviceAdapter);
    fab = findViewById(R.id.fab);
    fab.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            launchDiscoveryActivity();
        }
    });
    showFabIfNeccessary();
    /* uncomment to enable fixed-swipe to reveal more actions

        ItemTouchHelper swipeToDismissTouchHelper = new ItemTouchHelper(new ItemTouchHelper.SimpleCallback(
                ItemTouchHelper.LEFT , ItemTouchHelper.RIGHT) {
            @Override
            public void onChildDraw(Canvas c, RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) {
                if(dX>50)
                    dX = 50;
                super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive);

            }

            @Override
            public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) {
                GB.toast(getBaseContext(), "onMove", Toast.LENGTH_LONG, GB.ERROR);

                return false;
            }

            @Override
            public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
                GB.toast(getBaseContext(), "onSwiped", Toast.LENGTH_LONG, GB.ERROR);

            }

            @Override
            public void onChildDrawOver(Canvas c, RecyclerView recyclerView,
                                        RecyclerView.ViewHolder viewHolder, float dX, float dY,
                                        int actionState, boolean isCurrentlyActive) {
            }
        });

        swipeToDismissTouchHelper.attachToRecyclerView(deviceListView);
        */
    registerForContextMenu(deviceListView);
    IntentFilter filterLocal = new IntentFilter();
    filterLocal.addAction(GBApplication.ACTION_LANGUAGE_CHANGE);
    filterLocal.addAction(GBApplication.ACTION_QUIT);
    filterLocal.addAction(GBApplication.ACTION_NEW_DATA);
    filterLocal.addAction(DeviceManager.ACTION_DEVICES_CHANGED);
    filterLocal.addAction(DeviceService.ACTION_REALTIME_SAMPLES);
    LocalBroadcastManager.getInstance(this).registerReceiver(mReceiver, filterLocal);
    refreshPairedDevices();
    /*
         * Ask for permission to intercept notifications on first run.
         */
    Prefs prefs = GBApplication.getPrefs();
    pesterWithPermissions = prefs.getBoolean("permission_pestering", true);
    Set<String> set = NotificationManagerCompat.getEnabledListenerPackages(this);
    if (pesterWithPermissions) {
        if (!set.contains(this.getPackageName())) {
            // If notification listener access hasn't been granted
            Intent enableIntent = new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS");
            startActivity(enableIntent);
        }
    }
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        checkAndRequestPermissions();
    }
    ChangeLog cl = createChangeLog();
    if (cl.isFirstRun()) {
        try {
            cl.getLogDialog().show();
        } catch (Exception ignored) {
            GB.toast(getBaseContext(), "Error showing Changelog", Toast.LENGTH_LONG, GB.ERROR);
        }
    }
    GBApplication.deviceService().start();
    if (GB.isBluetoothEnabled() && deviceList.isEmpty() && Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
        startActivity(new Intent(this, DiscoveryActivity.class));
    } else {
        GBApplication.deviceService().requestDeviceInfo();
    }
}
Also used : IntentFilter(android.content.IntentFilter) NavigationView(com.google.android.material.navigation.NavigationView) ActionBarDrawerToggle(androidx.appcompat.app.ActionBarDrawerToggle) GBDeviceAdapterv2(nodomain.freeyourgadget.gadgetbridge.adapter.GBDeviceAdapterv2) Intent(android.content.Intent) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) Prefs(nodomain.freeyourgadget.gadgetbridge.util.Prefs) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) NavigationView(com.google.android.material.navigation.NavigationView) ChangeLog(de.cketti.library.changelog.ChangeLog) DrawerLayout(androidx.drawerlayout.widget.DrawerLayout) Toolbar(androidx.appcompat.widget.Toolbar)

Example 4 with DrawerLayout

use of androidx.drawerlayout.widget.DrawerLayout in project DevRing by LJYcoder.

the class BarUtil method handleFitWindowForDrawer.

private void handleFitWindowForDrawer(Activity activity, boolean fit) {
    ViewGroup parent = activity.findViewById(android.R.id.content);
    for (int i = 0; i < parent.getChildCount(); i++) {
        View childView = parent.getChildAt(i);
        if (childView instanceof DrawerLayout) {
            childView.setFitsSystemWindows(!fit);
            ((ViewGroup) childView).setClipToPadding(!fit);
            View childViewOfDrawer = ((DrawerLayout) childView).getChildAt(0);
            if (childViewOfDrawer instanceof ViewGroup) {
                childViewOfDrawer.setFitsSystemWindows(fit);
                ((ViewGroup) childViewOfDrawer).setClipToPadding(fit);
            }
        }
    }
}
Also used : ViewGroup(android.view.ViewGroup) DrawerLayout(androidx.drawerlayout.widget.DrawerLayout) View(android.view.View)

Example 5 with DrawerLayout

use of androidx.drawerlayout.widget.DrawerLayout in project Slide by ccrama.

the class MainActivity method doDrawer.

public void doDrawer() {
    drawerSubList = (ListView) findViewById(R.id.drawerlistview);
    drawerSubList.setDividerHeight(0);
    drawerSubList.setDescendantFocusability(ListView.FOCUS_BEFORE_DESCENDANTS);
    final LayoutInflater inflater = getLayoutInflater();
    final View header;
    if (Authentication.isLoggedIn && Authentication.didOnline) {
        header = inflater.inflate(R.layout.drawer_loggedin, drawerSubList, false);
        headerMain = header;
        hea = header.findViewById(R.id.back);
        drawerSubList.addHeaderView(header, null, false);
        ((TextView) header.findViewById(R.id.name)).setText(Authentication.name);
        header.findViewById(R.id.multi).setOnClickListener(new OnSingleClickListener() {

            @Override
            public void onSingleClick(View view) {
                if (runAfterLoad == null) {
                    Intent inte = new Intent(MainActivity.this, MultiredditOverview.class);
                    MainActivity.this.startActivity(inte);
                }
            }
        });
        header.findViewById(R.id.multi).setOnLongClickListener(new View.OnLongClickListener() {

            @Override
            public boolean onLongClick(View v) {
                new MaterialDialog.Builder(MainActivity.this).inputRange(3, 20).alwaysCallInputCallback().input(getString(R.string.user_enter), null, new MaterialDialog.InputCallback() {

                    @Override
                    public void onInput(@NonNull MaterialDialog dialog, CharSequence input) {
                        final EditText editText = dialog.getInputEditText();
                        EditTextValidator.validateUsername(editText);
                        if (input.length() >= 3 && input.length() <= 20) {
                            dialog.getActionButton(DialogAction.POSITIVE).setEnabled(true);
                        }
                    }
                }).positiveText(R.string.user_btn_gotomultis).onPositive(new MaterialDialog.SingleButtonCallback() {

                    @Override
                    public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
                        if (runAfterLoad == null) {
                            Intent inte = new Intent(MainActivity.this, MultiredditOverview.class);
                            inte.putExtra(Profile.EXTRA_PROFILE, dialog.getInputEditText().getText().toString());
                            MainActivity.this.startActivity(inte);
                        }
                    }
                }).negativeText(R.string.btn_cancel).show();
                return true;
            }
        });
        header.findViewById(R.id.discover).setOnClickListener(new OnSingleClickListener() {

            @Override
            public void onSingleClick(View view) {
                Intent inte = new Intent(MainActivity.this, Discover.class);
                MainActivity.this.startActivity(inte);
            }
        });
        header.findViewById(R.id.prof_click).setOnClickListener(new OnSingleClickListener() {

            @Override
            public void onSingleClick(View view) {
                Intent inte = new Intent(MainActivity.this, Profile.class);
                inte.putExtra(Profile.EXTRA_PROFILE, Authentication.name);
                MainActivity.this.startActivity(inte);
            }
        });
        header.findViewById(R.id.saved).setOnClickListener(new OnSingleClickListener() {

            @Override
            public void onSingleClick(View view) {
                Intent inte = new Intent(MainActivity.this, Profile.class);
                inte.putExtra(Profile.EXTRA_PROFILE, Authentication.name);
                inte.putExtra(Profile.EXTRA_SAVED, true);
                MainActivity.this.startActivity(inte);
            }
        });
        header.findViewById(R.id.later).setOnClickListener(new OnSingleClickListener() {

            @Override
            public void onSingleClick(View view) {
                Intent inte = new Intent(MainActivity.this, PostReadLater.class);
                MainActivity.this.startActivity(inte);
            }
        });
        header.findViewById(R.id.history).setOnClickListener(new OnSingleClickListener() {

            @Override
            public void onSingleClick(View view) {
                Intent inte = new Intent(MainActivity.this, Profile.class);
                inte.putExtra(Profile.EXTRA_PROFILE, Authentication.name);
                inte.putExtra(Profile.EXTRA_HISTORY, true);
                MainActivity.this.startActivity(inte);
            }
        });
        header.findViewById(R.id.commented).setOnClickListener(new OnSingleClickListener() {

            @Override
            public void onSingleClick(View view) {
                Intent inte = new Intent(MainActivity.this, Profile.class);
                inte.putExtra(Profile.EXTRA_PROFILE, Authentication.name);
                inte.putExtra(Profile.EXTRA_COMMENT, true);
                MainActivity.this.startActivity(inte);
            }
        });
        header.findViewById(R.id.submitted).setOnClickListener(new OnSingleClickListener() {

            @Override
            public void onSingleClick(View view) {
                Intent inte = new Intent(MainActivity.this, Profile.class);
                inte.putExtra(Profile.EXTRA_PROFILE, Authentication.name);
                inte.putExtra(Profile.EXTRA_SUBMIT, true);
                MainActivity.this.startActivity(inte);
            }
        });
        header.findViewById(R.id.upvoted).setOnClickListener(new OnSingleClickListener() {

            @Override
            public void onSingleClick(View view) {
                Intent inte = new Intent(MainActivity.this, Profile.class);
                inte.putExtra(Profile.EXTRA_PROFILE, Authentication.name);
                inte.putExtra(Profile.EXTRA_UPVOTE, true);
                MainActivity.this.startActivity(inte);
            }
        });
        /**
         * If the user is a known mod, show the "Moderation" drawer item quickly to
         * stop the UI from jumping
         */
        if (modOf != null && !modOf.isEmpty() && Authentication.mod) {
            header.findViewById(R.id.mod).setVisibility(View.VISIBLE);
        }
        // update notification badge
        final LinearLayout profStuff = header.findViewById(R.id.accountsarea);
        profStuff.setVisibility(View.GONE);
        findViewById(R.id.back).setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                if (profStuff.getVisibility() == View.GONE) {
                    expand(profStuff);
                    header.setContentDescription(getResources().getString(R.string.btn_collapse));
                    AnimatorUtil.flipAnimator(false, header.findViewById(R.id.headerflip)).start();
                } else {
                    collapse(profStuff);
                    header.setContentDescription(getResources().getString(R.string.btn_expand));
                    AnimatorUtil.flipAnimator(true, header.findViewById(R.id.headerflip)).start();
                }
            }
        });
        for (String s : Authentication.authentication.getStringSet("accounts", new HashSet<String>())) {
            if (s.contains(":")) {
                accounts.put(s.split(":")[0], s.split(":")[1]);
            } else {
                accounts.put(s, "");
            }
        }
        final ArrayList<String> keys = new ArrayList<>(accounts.keySet());
        final LinearLayout accountList = header.findViewById(R.id.accountsarea);
        for (final String accName : keys) {
            LogUtil.v(accName);
            final View t = getLayoutInflater().inflate(R.layout.account_textview_white, accountList, false);
            ((TextView) t.findViewById(R.id.name)).setText(accName);
            LogUtil.v("Adding click to " + ((TextView) t.findViewById(R.id.name)).getText());
            t.findViewById(R.id.remove).setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    new AlertDialog.Builder(MainActivity.this).setTitle(R.string.profile_remove).setMessage(R.string.profile_remove_account).setNegativeButton(R.string.btn_delete, (dialog2, which2) -> {
                        Set<String> accounts2 = Authentication.authentication.getStringSet("accounts", new HashSet<>());
                        Set<String> done = new HashSet<>();
                        for (String s : accounts2) {
                            if (!s.contains(accName)) {
                                done.add(s);
                            }
                        }
                        Authentication.authentication.edit().putStringSet("accounts", done).commit();
                        dialog2.dismiss();
                        accountList.removeView(t);
                        if (accName.equalsIgnoreCase(Authentication.name)) {
                            boolean d = false;
                            for (String s : keys) {
                                if (!s.equalsIgnoreCase(accName)) {
                                    d = true;
                                    LogUtil.v("Switching to " + s);
                                    for (Map.Entry<String, String> e : accounts.entrySet()) {
                                        LogUtil.v(e.getKey() + ":" + e.getValue());
                                    }
                                    if (accounts.containsKey(s) && !accounts.get(s).isEmpty()) {
                                        Authentication.authentication.edit().putString("lasttoken", accounts.get(s)).remove("backedCreds").commit();
                                    } else {
                                        ArrayList<String> tokens = new ArrayList<>(Authentication.authentication.getStringSet("tokens", new HashSet<>()));
                                        int index = keys.indexOf(s);
                                        if (keys.indexOf(s) > tokens.size()) {
                                            index -= 1;
                                        }
                                        Authentication.authentication.edit().putString("lasttoken", tokens.get(index)).remove("backedCreds").commit();
                                    }
                                    Authentication.name = s;
                                    UserSubscriptions.switchAccounts();
                                    Reddit.forceRestart(MainActivity.this, true);
                                    break;
                                }
                            }
                            if (!d) {
                                Authentication.name = "LOGGEDOUT";
                                Authentication.isLoggedIn = false;
                                Authentication.authentication.edit().remove("lasttoken").remove("backedCreds").commit();
                                UserSubscriptions.switchAccounts();
                                Reddit.forceRestart(MainActivity.this, true);
                            }
                        } else {
                            accounts.remove(accName);
                            keys.remove(accName);
                        }
                    }).setPositiveButton(R.string.btn_cancel, null).show();
                }
            });
            t.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    String accName = ((TextView) t.findViewById(R.id.name)).getText().toString();
                    LogUtil.v("Found name is " + accName);
                    if (!accName.equalsIgnoreCase(Authentication.name)) {
                        LogUtil.v("Switching to " + accName);
                        if (!accounts.get(accName).isEmpty()) {
                            LogUtil.v("Using token " + accounts.get(accName));
                            Authentication.authentication.edit().putString("lasttoken", accounts.get(accName)).remove("backedCreds").apply();
                        } else {
                            ArrayList<String> tokens = new ArrayList<>(Authentication.authentication.getStringSet("tokens", new HashSet<String>()));
                            Authentication.authentication.edit().putString("lasttoken", tokens.get(keys.indexOf(accName))).remove("backedCreds").apply();
                        }
                        Authentication.name = accName;
                        UserSubscriptions.switchAccounts();
                        Reddit.forceRestart(MainActivity.this, true);
                    }
                }
            });
            accountList.addView(t);
        }
        header.findViewById(R.id.godown).setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View view) {
                LinearLayout body = header.findViewById(R.id.expand_profile);
                if (body.getVisibility() == View.GONE) {
                    expand(body);
                    AnimatorUtil.flipAnimator(false, view).start();
                    view.findViewById(R.id.godown).setContentDescription(getResources().getString(R.string.btn_collapse));
                } else {
                    collapse(body);
                    AnimatorUtil.flipAnimator(true, view).start();
                    view.findViewById(R.id.godown).setContentDescription(getResources().getString(R.string.btn_expand));
                }
            }
        });
        header.findViewById(R.id.guest_mode).setOnClickListener(new OnSingleClickListener() {

            @Override
            public void onSingleClick(View v) {
                Authentication.name = "LOGGEDOUT";
                Authentication.isLoggedIn = false;
                Authentication.authentication.edit().remove("lasttoken").remove("backedCreds").apply();
                UserSubscriptions.switchAccounts();
                Reddit.forceRestart(MainActivity.this, true);
            }
        });
        header.findViewById(R.id.add).setOnClickListener(new OnSingleClickListener() {

            @Override
            public void onSingleClick(View view) {
                Intent inte = new Intent(MainActivity.this, Login.class);
                MainActivity.this.startActivity(inte);
            }
        });
        header.findViewById(R.id.offline).setOnClickListener(new OnSingleClickListener() {

            @Override
            public void onSingleClick(View view) {
                Reddit.appRestart.edit().putBoolean("forceoffline", true).commit();
                Reddit.forceRestart(MainActivity.this, false);
            }
        });
        header.findViewById(R.id.inbox).setOnClickListener(new OnSingleClickListener() {

            @Override
            public void onSingleClick(View view) {
                Intent inte = new Intent(MainActivity.this, Inbox.class);
                MainActivity.this.startActivityForResult(inte, INBOX_RESULT);
            }
        });
        headerMain = header;
        if (runAfterLoad == null) {
            new AsyncNotificationBadge().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
        }
    } else if (Authentication.didOnline) {
        header = inflater.inflate(R.layout.drawer_loggedout, drawerSubList, false);
        drawerSubList.addHeaderView(header, null, false);
        headerMain = header;
        hea = header.findViewById(R.id.back);
        final LinearLayout profStuff = header.findViewById(R.id.accountsarea);
        profStuff.setVisibility(View.GONE);
        findViewById(R.id.back).setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                if (profStuff.getVisibility() == View.GONE) {
                    expand(profStuff);
                    AnimatorUtil.flipAnimator(false, header.findViewById(R.id.headerflip)).start();
                    header.findViewById(R.id.headerflip).setContentDescription(getResources().getString(R.string.btn_collapse));
                } else {
                    collapse(profStuff);
                    AnimatorUtil.flipAnimator(true, header.findViewById(R.id.headerflip)).start();
                    header.findViewById(R.id.headerflip).setContentDescription(getResources().getString(R.string.btn_expand));
                }
            }
        });
        final HashMap<String, String> accounts = new HashMap<>();
        for (String s : Authentication.authentication.getStringSet("accounts", new HashSet<String>())) {
            if (s.contains(":")) {
                accounts.put(s.split(":")[0], s.split(":")[1]);
            } else {
                accounts.put(s, "");
            }
        }
        final ArrayList<String> keys = new ArrayList<>(accounts.keySet());
        final LinearLayout accountList = header.findViewById(R.id.accountsarea);
        for (final String accName : keys) {
            LogUtil.v(accName);
            final View t = getLayoutInflater().inflate(R.layout.account_textview_white, accountList, false);
            ((TextView) t.findViewById(R.id.name)).setText(accName);
            t.findViewById(R.id.remove).setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    new AlertDialog.Builder(MainActivity.this).setTitle(R.string.profile_remove).setMessage(R.string.profile_remove_account).setNegativeButton(R.string.btn_delete, (dialog2, which2) -> {
                        Set<String> accounts2 = Authentication.authentication.getStringSet("accounts", new HashSet<>());
                        Set<String> done = new HashSet<>();
                        for (String s : accounts2) {
                            if (!s.contains(accName)) {
                                done.add(s);
                            }
                        }
                        Authentication.authentication.edit().putStringSet("accounts", done).commit();
                        dialog2.dismiss();
                        accountList.removeView(t);
                        if (accName.equalsIgnoreCase(Authentication.name)) {
                            boolean d = false;
                            for (String s : keys) {
                                if (!s.equalsIgnoreCase(accName)) {
                                    d = true;
                                    LogUtil.v("Switching to " + s);
                                    if (!accounts.get(s).isEmpty()) {
                                        Authentication.authentication.edit().putString("lasttoken", accounts.get(s)).remove("backedCreds").commit();
                                    } else {
                                        ArrayList<String> tokens = new ArrayList<>(Authentication.authentication.getStringSet("tokens", new HashSet<>()));
                                        Authentication.authentication.edit().putString("lasttoken", tokens.get(keys.indexOf(s))).remove("backedCreds").commit();
                                    }
                                    Authentication.name = s;
                                    UserSubscriptions.switchAccounts();
                                    Reddit.forceRestart(MainActivity.this, true);
                                }
                            }
                            if (!d) {
                                Authentication.name = "LOGGEDOUT";
                                Authentication.isLoggedIn = false;
                                Authentication.authentication.edit().remove("lasttoken").remove("backedCreds").commit();
                                UserSubscriptions.switchAccounts();
                                Reddit.forceRestart(MainActivity.this, true);
                            }
                        } else {
                            accounts.remove(accName);
                            keys.remove(accName);
                        }
                    }).setPositiveButton(R.string.btn_cancel, null).show();
                }
            });
            t.setOnClickListener(new OnSingleClickListener() {

                @Override
                public void onSingleClick(View v) {
                    if (!accName.equalsIgnoreCase(Authentication.name)) {
                        if (!accounts.get(accName).isEmpty()) {
                            Authentication.authentication.edit().putString("lasttoken", accounts.get(accName)).remove("backedCreds").commit();
                        } else {
                            ArrayList<String> tokens = new ArrayList<>(Authentication.authentication.getStringSet("tokens", new HashSet<String>()));
                            Authentication.authentication.edit().putString("lasttoken", tokens.get(keys.indexOf(accName))).remove("backedCreds").commit();
                        }
                        Authentication.isLoggedIn = true;
                        Authentication.name = accName;
                        UserSubscriptions.switchAccounts();
                        Reddit.forceRestart(MainActivity.this, true);
                    }
                }
            });
            accountList.addView(t);
        }
        header.findViewById(R.id.add).setOnClickListener(new OnSingleClickListener() {

            @Override
            public void onSingleClick(View view) {
                Intent inte = new Intent(MainActivity.this, Login.class);
                MainActivity.this.startActivity(inte);
            }
        });
        header.findViewById(R.id.offline).setOnClickListener(new OnSingleClickListener() {

            @Override
            public void onSingleClick(View view) {
                Reddit.appRestart.edit().putBoolean("forceoffline", true).commit();
                Reddit.forceRestart(MainActivity.this, false);
            }
        });
        headerMain = header;
        header.findViewById(R.id.multi).setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View view) {
                new MaterialDialog.Builder(MainActivity.this).inputRange(3, 20).alwaysCallInputCallback().input(getString(R.string.user_enter), null, new MaterialDialog.InputCallback() {

                    @Override
                    public void onInput(@NonNull MaterialDialog dialog, CharSequence input) {
                        final EditText editText = dialog.getInputEditText();
                        EditTextValidator.validateUsername(editText);
                        if (input.length() >= 3 && input.length() <= 20) {
                            dialog.getActionButton(DialogAction.POSITIVE).setEnabled(true);
                        }
                    }
                }).positiveText(R.string.user_btn_gotomultis).onPositive(new MaterialDialog.SingleButtonCallback() {

                    @Override
                    public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
                        if (runAfterLoad == null) {
                            Intent inte = new Intent(MainActivity.this, MultiredditOverview.class);
                            inte.putExtra(Profile.EXTRA_PROFILE, dialog.getInputEditText().getText().toString());
                            MainActivity.this.startActivity(inte);
                        }
                    }
                }).negativeText(R.string.btn_cancel).show();
            }
        });
    } else {
        header = inflater.inflate(R.layout.drawer_offline, drawerSubList, false);
        headerMain = header;
        drawerSubList.addHeaderView(header, null, false);
        hea = header.findViewById(R.id.back);
        header.findViewById(R.id.online).setOnClickListener(new OnSingleClickListener() {

            @Override
            public void onSingleClick(View view) {
                Reddit.appRestart.edit().remove("forceoffline").commit();
                Reddit.forceRestart(MainActivity.this, false);
            }
        });
    }
    final LinearLayout expandSettings = header.findViewById(R.id.expand_settings);
    header.findViewById(R.id.godown_settings).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (expandSettings.getVisibility() == View.GONE) {
                expand(expandSettings);
                header.findViewById(R.id.godown_settings).setContentDescription(getResources().getString(R.string.btn_collapse));
                AnimatorUtil.flipAnimator(false, v).start();
            } else {
                collapse(expandSettings);
                header.findViewById(R.id.godown_settings).setContentDescription(getResources().getString(R.string.btn_expand));
                AnimatorUtil.flipAnimator(true, v).start();
            }
        }
    });
    {
        // Set up quick setting toggles
        final SwitchCompat toggleNightMode = expandSettings.findViewById(R.id.toggle_night_mode);
        if (SettingValues.isPro) {
            toggleNightMode.setVisibility(View.VISIBLE);
            toggleNightMode.setChecked(inNightMode);
            toggleNightMode.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

                @Override
                public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                    SettingValues.forcedNightModeState = isChecked ? SettingValues.ForcedState.FORCED_ON : SettingValues.ForcedState.FORCED_OFF;
                    restartTheme();
                }
            });
        }
        final SwitchCompat toggleImmersiveMode = expandSettings.findViewById(R.id.toggle_immersive_mode);
        toggleImmersiveMode.setChecked(SettingValues.immersiveMode);
        toggleImmersiveMode.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                SettingValues.immersiveMode = isChecked;
                SettingValues.prefs.edit().putBoolean(SettingValues.PREF_IMMERSIVE_MODE, isChecked).apply();
                if (isChecked) {
                    hideDecor();
                } else {
                    showDecor();
                }
            }
        });
        final SwitchCompat toggleNSFW = expandSettings.findViewById(R.id.toggle_nsfw);
        toggleNSFW.setChecked(SettingValues.showNSFWContent);
        toggleNSFW.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                SettingValues.showNSFWContent = isChecked;
                SettingValues.prefs.edit().putBoolean(SettingValues.PREF_SHOW_NSFW_CONTENT, isChecked).apply();
                reloadSubs();
            }
        });
        final SwitchCompat toggleRightThumbnails = expandSettings.findViewById(R.id.toggle_right_thumbnails);
        toggleRightThumbnails.setChecked(SettingValues.switchThumb);
        toggleRightThumbnails.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                SettingValues.switchThumb = isChecked;
                SettingValues.prefs.edit().putBoolean(SettingValues.PREF_SWITCH_THUMB, isChecked).apply();
                reloadSubs();
            }
        });
        final SwitchCompat toggleReaderMode = expandSettings.findViewById(R.id.toggle_reader_mode);
        toggleReaderMode.setChecked(SettingValues.readerMode);
        toggleReaderMode.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                SettingValues.readerMode = isChecked;
                SettingValues.prefs.edit().putBoolean(SettingValues.PREF_READER_MODE, isChecked).apply();
            }
        });
    }
    header.findViewById(R.id.manage).setOnClickListener(new OnSingleClickListener() {

        @Override
        public void onSingleClick(View view) {
            Intent i = new Intent(MainActivity.this, ManageOfflineContent.class);
            startActivity(i);
        }
    });
    if (Authentication.didOnline) {
        View support = header.findViewById(R.id.support);
        if (SettingValues.isPro) {
            support.setVisibility(View.GONE);
        } else {
            support.setOnClickListener(new OnSingleClickListener() {

                @Override
                public void onSingleClick(View view) {
                    ProUtil.proUpgradeMsg(MainActivity.this, R.string.settings_support_slide).setNegativeButton(R.string.btn_no_thanks, (dialog, whichButton) -> dialog.dismiss()).show();
                }
            });
        }
        header.findViewById(R.id.prof).setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View view) {
                new MaterialDialog.Builder(MainActivity.this).inputRange(3, 20).alwaysCallInputCallback().input(getString(R.string.user_enter), null, new MaterialDialog.InputCallback() {

                    @Override
                    public void onInput(@NonNull MaterialDialog dialog, CharSequence input) {
                        final EditText editText = dialog.getInputEditText();
                        EditTextValidator.validateUsername(editText);
                        if (input.length() >= 3 && input.length() <= 20) {
                            dialog.getActionButton(DialogAction.POSITIVE).setEnabled(true);
                        }
                    }
                }).positiveText(R.string.user_btn_goto).onPositive(new MaterialDialog.SingleButtonCallback() {

                    @Override
                    public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
                        Intent inte = new Intent(MainActivity.this, Profile.class);
                        // noinspection ConstantConditions
                        inte.putExtra(Profile.EXTRA_PROFILE, dialog.getInputEditText().getText().toString());
                        MainActivity.this.startActivity(inte);
                    }
                }).negativeText(R.string.btn_cancel).show();
            }
        });
    }
    header.findViewById(R.id.settings).setOnClickListener(new OnSingleClickListener() {

        @Override
        public void onSingleClick(View v) {
            Intent i = new Intent(MainActivity.this, SettingsActivity.class);
            startActivity(i);
            // Cancel sub loading because exiting the settings will reload it anyway
            if (mAsyncGetSubreddit != null)
                mAsyncGetSubreddit.cancel(true);
            drawerLayout.closeDrawers();
        }
    });
    /*  footer.findViewById(R.id.settings).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent inte = new Intent(Overview.this, Setting.class);
                Overview.this.startActivityForResult(inte, 3);
            }
        });*/
    final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    final ActionBarDrawerToggle actionBarDrawerToggle = new ActionBarDrawerToggle(MainActivity.this, drawerLayout, toolbar, R.string.btn_open, R.string.btn_close) {

        @Override
        public void onDrawerSlide(View drawerView, float slideOffset) {
            // this disables the animation
            super.onDrawerSlide(drawerView, 0);
        }

        @Override
        public void onDrawerOpened(View drawerView) {
            super.onDrawerOpened(drawerView);
            if (drawerLayout.isDrawerOpen(GravityCompat.END)) {
                int current = pager.getCurrentItem();
                if (current == toOpenComments && toOpenComments != 0) {
                    current -= 1;
                }
                String compare = usedArray.get(current);
                if (compare.equals("random") || compare.equals("myrandom") || compare.equals("randnsfw")) {
                    if (adapter != null && adapter.getCurrentFragment() != null && ((SubmissionsView) adapter.getCurrentFragment()).adapter.dataSet.subredditRandom != null) {
                        String sub = ((SubmissionsView) adapter.getCurrentFragment()).adapter.dataSet.subredditRandom;
                        doSubSidebarNoLoad(sub);
                        doSubSidebar(sub);
                    }
                } else {
                    doSubSidebar(usedArray.get(current));
                }
            }
        }

        @Override
        public void onDrawerClosed(View view) {
            super.onDrawerClosed(view);
            KeyboardUtil.hideKeyboard(MainActivity.this, drawerLayout.getWindowToken(), 0);
        }
    };
    drawerLayout.addDrawerListener(actionBarDrawerToggle);
    actionBarDrawerToggle.syncState();
    header.findViewById(R.id.back).setBackgroundColor(Palette.getColor("alsdkfjasld"));
    accountsArea = header.findViewById(R.id.accountsarea);
    if (accountsArea != null) {
        accountsArea.setBackgroundColor(Palette.getDarkerColor("alsdkfjasld"));
    }
    setDrawerSubList();
    hideDrawerItems();
}
Also used : Arrays(java.util.Arrays) Bundle(android.os.Bundle) R(me.ccrama.redditslide.R) NonNull(androidx.annotation.NonNull) AnimatorUtil(me.ccrama.redditslide.util.AnimatorUtil) Uri(android.net.Uri) ImageView(android.widget.ImageView) PostMatch(me.ccrama.redditslide.PostMatch) ColorDrawable(android.graphics.drawable.ColorDrawable) ContentType(me.ccrama.redditslide.ContentType) AppCompatCheckBox(androidx.appcompat.widget.AppCompatCheckBox) UserRecordPaginator(net.dean.jraw.paginators.UserRecordPaginator) NeverAgainWhenClickedOnce(org.ligi.snackengage.conditions.NeverAgainWhenClickedOnce) OnSingleClickListener(me.ccrama.redditslide.util.OnSingleClickListener) ShortcutManagerCompat(androidx.core.content.pm.ShortcutManagerCompat) HorizontalScrollView(android.widget.HorizontalScrollView) SubmissionsView(me.ccrama.redditslide.Fragments.SubmissionsView) Manifest(android.Manifest) Handler(android.os.Handler) Map(java.util.Map) Fragment(androidx.fragment.app.Fragment) ClipboardManager(android.content.ClipboardManager) Canvas(android.graphics.Canvas) JsonNode(com.fasterxml.jackson.databind.JsonNode) ContextCompat(androidx.core.content.ContextCompat) ProUtil(me.ccrama.redditslide.util.ProUtil) Log(android.util.Log) CardView(androidx.cardview.widget.CardView) WithLimitedNumberOfTimes(org.ligi.snackengage.conditions.WithLimitedNumberOfTimes) SubredditPosts(me.ccrama.redditslide.Adapters.SubredditPosts) CheckForMail(me.ccrama.redditslide.Notifications.CheckForMail) KeyboardUtil(me.ccrama.redditslide.util.KeyboardUtil) IntentFilter(android.content.IntentFilter) CommentPage(me.ccrama.redditslide.Fragments.CommentPage) SidebarLayout(me.ccrama.redditslide.Views.SidebarLayout) Set(java.util.Set) DensityUtils(me.ccrama.redditslide.ForceTouch.util.DensityUtils) NotificationJobScheduler(me.ccrama.redditslide.Notifications.NotificationJobScheduler) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) Palette(me.ccrama.redditslide.Visuals.Palette) SimpleTextWatcher(me.ccrama.redditslide.util.stubs.SimpleTextWatcher) SubredditPaginator(net.dean.jraw.paginators.SubredditPaginator) Executors(java.util.concurrent.Executors) CatchStaggeredGridLayoutManager(me.ccrama.redditslide.Views.CatchStaggeredGridLayoutManager) SortingUtil(me.ccrama.redditslide.util.SortingUtil) KVManger(com.lusfold.androidkeyvaluestore.core.KVManger) DrawerItemsDialog(me.ccrama.redditslide.Fragments.DrawerItemsDialog) DrawableUtil(me.ccrama.redditslide.util.DrawableUtil) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) BuildConfig(me.ccrama.redditslide.BuildConfig) SubmissionParser(me.ccrama.redditslide.util.SubmissionParser) AfterNumberOfOpportunities(org.ligi.snackengage.conditions.AfterNumberOfOpportunities) ViewDragHelper(androidx.customview.widget.ViewDragHelper) DrawerLayout(androidx.drawerlayout.widget.DrawerLayout) BaseSnack(org.ligi.snackengage.snacks.BaseSnack) HasSeen(me.ccrama.redditslide.HasSeen) ViewPager(androidx.viewpager.widget.ViewPager) Dialog(android.app.Dialog) Editable(android.text.Editable) AccountManager(net.dean.jraw.managers.AccountManager) ArrayList(java.util.ArrayList) MiscUtil(me.ccrama.redditslide.util.MiscUtil) MenuInflater(android.view.MenuInflater) Toast(android.widget.Toast) Menu(android.view.Menu) UserSubscriptions(me.ccrama.redditslide.UserSubscriptions) OpenRedditLink(me.ccrama.redditslide.OpenRedditLink) MultiRedditUpdateRequest(net.dean.jraw.http.MultiRedditUpdateRequest) TimePeriod(net.dean.jraw.paginators.TimePeriod) SettingsThemeFragment(me.ccrama.redditslide.ui.settings.SettingsThemeFragment) StringUtil(me.ccrama.redditslide.util.StringUtil) FragmentManager(androidx.fragment.app.FragmentManager) SettingsSubAdapter(me.ccrama.redditslide.ui.settings.SettingsSubAdapter) Parcelable(android.os.Parcelable) FlairTemplate(net.dean.jraw.models.FlairTemplate) UserSubscriptions.modOf(me.ccrama.redditslide.UserSubscriptions.modOf) Reddit(me.ccrama.redditslide.Reddit) ColorPreferences(me.ccrama.redditslide.Visuals.ColorPreferences) Field(java.lang.reflect.Field) AutoCompleteTextView(android.widget.AutoCompleteTextView) MultiRedditManager(net.dean.jraw.managers.MultiRedditManager) ContextThemeWrapper(androidx.appcompat.view.ContextThemeWrapper) Gravity(android.view.Gravity) MySynccitUpdateTask(me.ccrama.redditslide.Synccit.MySynccitUpdateTask) SharedPreferences(android.content.SharedPreferences) IconCompat(androidx.core.graphics.drawable.IconCompat) Configuration(android.content.res.Configuration) EditText(android.widget.EditText) ValueAnimator(android.animation.ValueAnimator) LinearLayout(android.widget.LinearLayout) ToggleSwipeViewPager(me.ccrama.redditslide.Views.ToggleSwipeViewPager) MultiSubreddit(net.dean.jraw.models.MultiSubreddit) CommentCacheAsync(me.ccrama.redditslide.CommentCacheAsync) SideArrayAdapter(me.ccrama.redditslide.Adapters.SideArrayAdapter) PackageManager(android.content.pm.PackageManager) TimeUtils(me.ccrama.redditslide.util.TimeUtils) EditTextValidator(me.ccrama.redditslide.util.EditTextValidator) Spannable(android.text.Spannable) WindowManager(android.view.WindowManager) SettingsGeneralFragment(me.ccrama.redditslide.ui.settings.SettingsGeneralFragment) Animator(android.animation.Animator) DrawableRes(androidx.annotation.DrawableRes) SpoilerRobotoTextView(me.ccrama.redditslide.SpoilerRobotoTextView) AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) ActionBarDrawerToggle(androidx.appcompat.app.ActionBarDrawerToggle) Locale(java.util.Locale) View(android.view.View) Sorting(net.dean.jraw.paginators.Sorting) SynccitRead(me.ccrama.redditslide.Synccit.SynccitRead) ArgbEvaluator(android.animation.ArgbEvaluator) FragmentStatePagerAdapter(androidx.fragment.app.FragmentStatePagerAdapter) AutoCacheScheduler(me.ccrama.redditslide.Autocache.AutoCacheScheduler) CaseInsensitiveArrayList(me.ccrama.redditslide.CaseInsensitiveArrayList) NetworkStateReceiver(me.ccrama.redditslide.util.NetworkStateReceiver) NotificationManager(android.app.NotificationManager) AsyncTask(android.os.AsyncTask) TabLayout(com.google.android.material.tabs.TabLayout) Authentication(me.ccrama.redditslide.Authentication) ApiException(net.dean.jraw.ApiException) ViewGroup(android.view.ViewGroup) List(java.util.List) NetworkUtil(me.ccrama.redditslide.util.NetworkUtil) TextView(android.widget.TextView) LinearInterpolator(android.view.animation.LinearInterpolator) RelativeLayout(android.widget.RelativeLayout) Toolbar(androidx.appcompat.widget.Toolbar) ListView(android.widget.ListView) CommentOverflow(me.ccrama.redditslide.Views.CommentOverflow) MaterialDialog(com.afollestad.materialdialogs.MaterialDialog) Window(android.view.Window) EditorInfo(android.view.inputmethod.EditorInfo) Snackbar(com.google.android.material.snackbar.Snackbar) RequestPermission(androidx.activity.result.contract.ActivityResultContracts.RequestPermission) LayoutUtils(me.ccrama.redditslide.util.LayoutUtils) Context(android.content.Context) SettingValues(me.ccrama.redditslide.SettingValues) KeyEvent(android.view.KeyEvent) AlertDialog(androidx.appcompat.app.AlertDialog) ResourcesCompat(androidx.core.content.res.ResourcesCompat) ModerationManager(net.dean.jraw.managers.ModerationManager) Submission(net.dean.jraw.models.Submission) Pair(android.util.Pair) Intent(android.content.Intent) HashMap(java.util.HashMap) Constants(me.ccrama.redditslide.Constants) PreCachingLayoutManager(me.ccrama.redditslide.Views.PreCachingLayoutManager) LogUtil(me.ccrama.redditslide.util.LogUtil) MenuItem(android.view.MenuItem) InputMethodManager(android.view.inputmethod.InputMethodManager) ClipData(android.content.ClipData) HashSet(java.util.HashSet) UserRecord(net.dean.jraw.models.UserRecord) ManageOfflineContent(me.ccrama.redditslide.ui.settings.ManageOfflineContent) Build(android.os.Build) ShortcutInfoCompat(androidx.core.content.pm.ShortcutInfoCompat) ExecutorService(java.util.concurrent.ExecutorService) DialogInterface(android.content.DialogInterface) RateSnack(org.ligi.snackengage.snacks.RateSnack) ViewStub(android.view.ViewStub) MultiReddit(net.dean.jraw.models.MultiReddit) SwitchCompat(androidx.appcompat.widget.SwitchCompat) CompoundButton(android.widget.CompoundButton) ActivityResultLauncher(androidx.activity.result.ActivityResultLauncher) LayoutInflater(android.view.LayoutInflater) ImageFlairs(me.ccrama.redditslide.ImageFlairs) GravityCompat(androidx.core.view.GravityCompat) KVStore(com.lusfold.androidkeyvaluestore.KVStore) Point(android.graphics.Point) DialogAction(com.afollestad.materialdialogs.DialogAction) SnackEngage(org.ligi.snackengage.SnackEngage) ResolveInfo(android.content.pm.ResolveInfo) PopupMenu(androidx.appcompat.widget.PopupMenu) ImageUtil(me.ccrama.redditslide.util.ImageUtil) SettingsActivity(me.ccrama.redditslide.ui.settings.SettingsActivity) Bitmap(android.graphics.Bitmap) ViewTreeObserver(android.view.ViewTreeObserver) Subreddit(net.dean.jraw.models.Subreddit) Activity(android.app.Activity) NetworkException(net.dean.jraw.http.NetworkException) Collections(java.util.Collections) LoggedInAccount(net.dean.jraw.models.LoggedInAccount) AlertDialog(androidx.appcompat.app.AlertDialog) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) CaseInsensitiveArrayList(me.ccrama.redditslide.CaseInsensitiveArrayList) NonNull(androidx.annotation.NonNull) AutoCompleteTextView(android.widget.AutoCompleteTextView) SpoilerRobotoTextView(me.ccrama.redditslide.SpoilerRobotoTextView) TextView(android.widget.TextView) HashSet(java.util.HashSet) Toolbar(androidx.appcompat.widget.Toolbar) EditText(android.widget.EditText) MaterialDialog(com.afollestad.materialdialogs.MaterialDialog) DialogAction(com.afollestad.materialdialogs.DialogAction) LayoutInflater(android.view.LayoutInflater) ManageOfflineContent(me.ccrama.redditslide.ui.settings.ManageOfflineContent) SettingsActivity(me.ccrama.redditslide.ui.settings.SettingsActivity) SwitchCompat(androidx.appcompat.widget.SwitchCompat) Set(java.util.Set) HashSet(java.util.HashSet) OnSingleClickListener(me.ccrama.redditslide.util.OnSingleClickListener) ActionBarDrawerToggle(androidx.appcompat.app.ActionBarDrawerToggle) Intent(android.content.Intent) ImageView(android.widget.ImageView) HorizontalScrollView(android.widget.HorizontalScrollView) SubmissionsView(me.ccrama.redditslide.Fragments.SubmissionsView) CardView(androidx.cardview.widget.CardView) AutoCompleteTextView(android.widget.AutoCompleteTextView) SpoilerRobotoTextView(me.ccrama.redditslide.SpoilerRobotoTextView) View(android.view.View) TextView(android.widget.TextView) ListView(android.widget.ListView) Point(android.graphics.Point) SubmissionsView(me.ccrama.redditslide.Fragments.SubmissionsView) LinearLayout(android.widget.LinearLayout) CompoundButton(android.widget.CompoundButton)

Aggregations

DrawerLayout (androidx.drawerlayout.widget.DrawerLayout)14 Intent (android.content.Intent)7 View (android.view.View)7 ActionBarDrawerToggle (androidx.appcompat.app.ActionBarDrawerToggle)6 Toolbar (androidx.appcompat.widget.Toolbar)5 Bundle (android.os.Bundle)4 ViewGroup (android.view.ViewGroup)4 NonNull (androidx.annotation.NonNull)4 Context (android.content.Context)3 IntentFilter (android.content.IntentFilter)3 Configuration (android.content.res.Configuration)3 Uri (android.net.Uri)3 Handler (android.os.Handler)3 MenuItem (android.view.MenuItem)3 AlertDialog (androidx.appcompat.app.AlertDialog)3 Fragment (androidx.fragment.app.Fragment)3 NavigationView (com.google.android.material.navigation.NavigationView)3 SuppressLint (android.annotation.SuppressLint)2 SharedPreferences (android.content.SharedPreferences)2 Menu (android.view.Menu)2