Search in sources :

Example 1 with BreadcrumbsView

use of com.simplecity.amp_library.ui.modelviews.BreadcrumbsView in project Shuttle by timusus.

the class FolderFragment method changeDir.

@SuppressLint("CheckResult")
public void changeDir(File newDir) {
    if (setItemsDisposable != null) {
        setItemsDisposable.dispose();
    }
    disposables.add(Single.zip(DataManager.getInstance().getIncludeItems().first(Collections.emptyList()), DataManager.getInstance().getExcludeItems().first(Collections.emptyList()), Single.fromCallable(() -> {
        final String path = FileHelper.getPath(newDir);
        if (TextUtils.isEmpty(path)) {
            return new ArrayList<>();
        }
        currentDir = path;
        return fileBrowser.loadDir(new File(path));
    }), (Function3<List<InclExclItem>, List<InclExclItem>, List<BaseFileObject>, List<ViewModel>>) (whitelist, blacklist, baseFileObjects) -> {
        List<ViewModel> items = Stream.of(baseFileObjects).map(baseFileObject -> {
            // Look for an existing FolderView wrapping the BaseFileObject, we'll reuse it if it exists.
            FolderView folderView = (FolderView) Stream.of(adapter.items).filter(viewModel -> viewModel instanceof FolderView && (((FolderView) viewModel).baseFileObject.equals(baseFileObject))).findFirst().orElse(null);
            if (folderView == null) {
                folderView = new FolderView(baseFileObject, Stream.of(whitelist).anyMatch(inclExclItem -> inclExclItem.path.equals(baseFileObject.path)), Stream.of(blacklist).anyMatch(inclExclItem -> inclExclItem.path.equals(baseFileObject.path)));
                folderView.setShowWhitelist(isShowingWhitelist);
                folderView.setShowBlacklist(isShowingBlacklist);
                folderView.setClickListener(FolderFragment.this);
            }
            return folderView;
        }).collect(Collectors.toList());
        if (showBreadcrumbsInList && breadcrumbsView != null) {
            breadcrumbsView.setBreadcrumbsPath(currentDir);
            breadcrumbsView.setListener(FolderFragment.this);
            items.add(0, breadcrumbsView);
        }
        return items;
    }).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(adaptableItems -> {
        if (adapter != null) {
            setItemsDisposable = adapter.setItems(adaptableItems);
        }
        if (breadcrumb != null) {
            breadcrumb.changeBreadcrumbPath(currentDir);
        }
        if (adapter != null) {
            changeBreadcrumbPath();
        }
        updateMenuItems();
    }, error -> LogUtils.logException(TAG, "Error changing dir", error)));
}
Also used : R(com.simplecity.amp_library.R) Bundle(android.os.Bundle) Rx.onErrorLogAndRethrow(com.afollestad.aesthetic.Rx.onErrorLogAndRethrow) ViewModel(com.simplecityapps.recycler_adapter.model.ViewModel) AndroidSchedulers(io.reactivex.android.schedulers.AndroidSchedulers) BindView(butterknife.BindView) Song(com.simplecity.amp_library.model.Song) Aesthetic(com.afollestad.aesthetic.Aesthetic) CheckBox(android.widget.CheckBox) MenuUtils(com.simplecity.amp_library.utils.MenuUtils) View(android.view.View) Schedulers(io.reactivex.schedulers.Schedulers) Unbinder(butterknife.Unbinder) BackPressListener(test.com.androidnavigation.fragment.BackPressListener) LogUtils(com.simplecity.amp_library.utils.LogUtils) ContextualToolbarHelper(com.simplecity.amp_library.utils.ContextualToolbarHelper) SortManager(com.simplecity.amp_library.utils.SortManager) FileHelper(com.simplecity.amp_library.utils.FileHelper) PopupMenu(android.support.v7.widget.PopupMenu) ViewGroup(android.view.ViewGroup) Breadcrumb(com.simplecity.amp_library.interfaces.Breadcrumb) SettingsManager(com.simplecity.amp_library.utils.SettingsManager) MusicUtils(com.simplecity.amp_library.utils.MusicUtils) List(java.util.List) CompositeDisposable(io.reactivex.disposables.CompositeDisposable) Disposable(io.reactivex.disposables.Disposable) InclExclItem(com.simplecity.amp_library.model.InclExclItem) IntStream(com.annimon.stream.IntStream) BreadcrumbListener(com.simplecity.amp_library.interfaces.BreadcrumbListener) FileType(com.simplecity.amp_library.interfaces.FileType) AppBarLayout(android.support.design.widget.AppBarLayout) Stream(com.annimon.stream.Stream) ContextualToolbar(com.simplecity.amp_library.ui.views.ContextualToolbar) RecyclerListener(com.simplecityapps.recycler_adapter.recyclerview.RecyclerListener) ButterKnife(butterknife.ButterKnife) DrawerLockManager(com.simplecity.amp_library.ui.drawer.DrawerLockManager) ViewModelAdapter(com.simplecityapps.recycler_adapter.adapter.ViewModelAdapter) SelectableViewModel(com.simplecity.amp_library.ui.modelviews.SelectableViewModel) Single(io.reactivex.Single) FolderView(com.simplecity.amp_library.ui.modelviews.FolderView) MenuItem(android.view.MenuItem) ArrayList(java.util.ArrayList) SuppressLint(android.annotation.SuppressLint) MenuInflater(android.view.MenuInflater) Toast(android.widget.Toast) Menu(android.view.Menu) ViewBackgroundAction(com.afollestad.aesthetic.ViewBackgroundAction) BaseFileObject(com.simplecity.amp_library.model.BaseFileObject) Observable(io.reactivex.Observable) UpgradeDialog(com.simplecity.amp_library.ui.dialog.UpgradeDialog) ShuttleUtils(com.simplecity.amp_library.utils.ShuttleUtils) Rx.distinctToMainThread(com.afollestad.aesthetic.Rx.distinctToMainThread) Nullable(io.reactivex.annotations.Nullable) Collectors(com.annimon.stream.Collectors) FileBrowser(com.simplecity.amp_library.utils.FileBrowser) LayoutInflater(android.view.LayoutInflater) Function3(io.reactivex.functions.Function3) ThemedStatusBarView(com.simplecity.amp_library.ui.views.ThemedStatusBarView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) TextUtils(android.text.TextUtils) File(java.io.File) RecyclerView(android.support.v7.widget.RecyclerView) Toolbar(android.support.v7.widget.Toolbar) BreadcrumbItem(com.simplecity.amp_library.ui.views.BreadcrumbItem) BreadcrumbsView(com.simplecity.amp_library.ui.modelviews.BreadcrumbsView) DataManager(com.simplecity.amp_library.utils.DataManager) Collections(java.util.Collections) FolderView(com.simplecity.amp_library.ui.modelviews.FolderView) List(java.util.List) ArrayList(java.util.ArrayList) File(java.io.File) SuppressLint(android.annotation.SuppressLint)

Example 2 with BreadcrumbsView

use of com.simplecity.amp_library.ui.modelviews.BreadcrumbsView in project Shuttle by timusus.

the class FolderFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_folder_browser, container, false);
    unbinder = ButterKnife.bind(this, rootView);
    if (displayedInTabs) {
        breadcrumbsView = new BreadcrumbsView(currentDir);
        showBreadcrumbsInList = true;
        changeBreadcrumbPath();
        appBarLayout.setVisibility(View.GONE);
        statusBarView.setVisibility(View.GONE);
    } else {
        showBreadcrumbsInList = false;
        breadcrumb.addBreadcrumbListener(this);
        if (!TextUtils.isEmpty(currentDir)) {
            breadcrumb.changeBreadcrumbPath(currentDir);
        }
    }
    if (!displayedInTabs) {
        toolbar.inflateMenu(R.menu.menu_folders);
        toolbar.setNavigationOnClickListener(v -> getNavigationController().popViewController());
        toolbar.setOnMenuItemClickListener(this);
        updateMenuItems(toolbar.getMenu());
    }
    recyclerView.setRecyclerListener(new RecyclerListener());
    recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    recyclerView.setAdapter(adapter);
    Aesthetic.get(getContext()).colorPrimary().take(1).subscribe(color -> ViewBackgroundAction.create(appBarLayout).accept(color), onErrorLogAndRethrow());
    compositeDisposable.add(Aesthetic.get(getContext()).colorPrimary().compose(distinctToMainThread()).subscribe(color -> ViewBackgroundAction.create(appBarLayout).accept(color), onErrorLogAndRethrow()));
    return rootView;
}
Also used : BreadcrumbsView(com.simplecity.amp_library.ui.modelviews.BreadcrumbsView) R(com.simplecity.amp_library.R) Bundle(android.os.Bundle) Rx.onErrorLogAndRethrow(com.afollestad.aesthetic.Rx.onErrorLogAndRethrow) ViewModel(com.simplecityapps.recycler_adapter.model.ViewModel) AndroidSchedulers(io.reactivex.android.schedulers.AndroidSchedulers) BindView(butterknife.BindView) Song(com.simplecity.amp_library.model.Song) Aesthetic(com.afollestad.aesthetic.Aesthetic) CheckBox(android.widget.CheckBox) MenuUtils(com.simplecity.amp_library.utils.MenuUtils) View(android.view.View) Schedulers(io.reactivex.schedulers.Schedulers) Unbinder(butterknife.Unbinder) BackPressListener(test.com.androidnavigation.fragment.BackPressListener) LogUtils(com.simplecity.amp_library.utils.LogUtils) ContextualToolbarHelper(com.simplecity.amp_library.utils.ContextualToolbarHelper) SortManager(com.simplecity.amp_library.utils.SortManager) FileHelper(com.simplecity.amp_library.utils.FileHelper) PopupMenu(android.support.v7.widget.PopupMenu) ViewGroup(android.view.ViewGroup) Breadcrumb(com.simplecity.amp_library.interfaces.Breadcrumb) SettingsManager(com.simplecity.amp_library.utils.SettingsManager) MusicUtils(com.simplecity.amp_library.utils.MusicUtils) List(java.util.List) CompositeDisposable(io.reactivex.disposables.CompositeDisposable) Disposable(io.reactivex.disposables.Disposable) InclExclItem(com.simplecity.amp_library.model.InclExclItem) IntStream(com.annimon.stream.IntStream) BreadcrumbListener(com.simplecity.amp_library.interfaces.BreadcrumbListener) FileType(com.simplecity.amp_library.interfaces.FileType) AppBarLayout(android.support.design.widget.AppBarLayout) Stream(com.annimon.stream.Stream) ContextualToolbar(com.simplecity.amp_library.ui.views.ContextualToolbar) RecyclerListener(com.simplecityapps.recycler_adapter.recyclerview.RecyclerListener) ButterKnife(butterknife.ButterKnife) DrawerLockManager(com.simplecity.amp_library.ui.drawer.DrawerLockManager) ViewModelAdapter(com.simplecityapps.recycler_adapter.adapter.ViewModelAdapter) SelectableViewModel(com.simplecity.amp_library.ui.modelviews.SelectableViewModel) Single(io.reactivex.Single) FolderView(com.simplecity.amp_library.ui.modelviews.FolderView) MenuItem(android.view.MenuItem) ArrayList(java.util.ArrayList) SuppressLint(android.annotation.SuppressLint) MenuInflater(android.view.MenuInflater) Toast(android.widget.Toast) Menu(android.view.Menu) ViewBackgroundAction(com.afollestad.aesthetic.ViewBackgroundAction) BaseFileObject(com.simplecity.amp_library.model.BaseFileObject) Observable(io.reactivex.Observable) UpgradeDialog(com.simplecity.amp_library.ui.dialog.UpgradeDialog) ShuttleUtils(com.simplecity.amp_library.utils.ShuttleUtils) Rx.distinctToMainThread(com.afollestad.aesthetic.Rx.distinctToMainThread) Nullable(io.reactivex.annotations.Nullable) Collectors(com.annimon.stream.Collectors) FileBrowser(com.simplecity.amp_library.utils.FileBrowser) LayoutInflater(android.view.LayoutInflater) Function3(io.reactivex.functions.Function3) ThemedStatusBarView(com.simplecity.amp_library.ui.views.ThemedStatusBarView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) TextUtils(android.text.TextUtils) File(java.io.File) RecyclerView(android.support.v7.widget.RecyclerView) Toolbar(android.support.v7.widget.Toolbar) BreadcrumbItem(com.simplecity.amp_library.ui.views.BreadcrumbItem) BreadcrumbsView(com.simplecity.amp_library.ui.modelviews.BreadcrumbsView) DataManager(com.simplecity.amp_library.utils.DataManager) Collections(java.util.Collections) RecyclerListener(com.simplecityapps.recycler_adapter.recyclerview.RecyclerListener) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) BindView(butterknife.BindView) View(android.view.View) FolderView(com.simplecity.amp_library.ui.modelviews.FolderView) ThemedStatusBarView(com.simplecity.amp_library.ui.views.ThemedStatusBarView) RecyclerView(android.support.v7.widget.RecyclerView) BreadcrumbsView(com.simplecity.amp_library.ui.modelviews.BreadcrumbsView)

Example 3 with BreadcrumbsView

use of com.simplecity.amp_library.ui.modelviews.BreadcrumbsView in project Shuttle by timusus.

the class FolderFragment method changeDir.

@SuppressLint("CheckResult")
public void changeDir(File newDir) {
    disposables.add(Single.zip(whitelistRepository.getWhitelistItems(songsRepository).first(Collections.emptyList()), blacklistRepository.getBlacklistItems(songsRepository).first(Collections.emptyList()), Single.fromCallable(() -> {
        final String path = FileHelper.getPath(newDir);
        if (TextUtils.isEmpty(path)) {
            return new ArrayList<>();
        }
        currentDir = path;
        return fileBrowser.loadDir(new File(path));
    }), (Function3<List<InclExclItem>, List<InclExclItem>, List<BaseFileObject>, List<ViewModel>>) (whitelist, blacklist, baseFileObjects) -> {
        List<ViewModel> items = Stream.of(baseFileObjects).map(baseFileObject -> {
            // Look for an existing FolderView wrapping the BaseFileObject, we'll reuse it if it exists.
            FolderView folderView = (FolderView) Stream.of(adapter.items).filter(viewModel -> viewModel instanceof FolderView && (((FolderView) viewModel).baseFileObject.equals(baseFileObject))).findFirst().orElse(null);
            if (folderView == null) {
                folderView = new FolderView(baseFileObject, whitelistRepository, blacklistRepository, settingsManager, Stream.of(whitelist).anyMatch(inclExclItem -> inclExclItem.path.equals(baseFileObject.path)), Stream.of(blacklist).anyMatch(inclExclItem -> inclExclItem.path.equals(baseFileObject.path)));
                folderView.setShowWhitelist(isShowingWhitelist);
                folderView.setShowBlacklist(isShowingBlacklist);
                folderView.setClickListener(FolderFragment.this);
            }
            return folderView;
        }).collect(Collectors.toList());
        if (showBreadcrumbsInList && breadcrumbsView != null) {
            breadcrumbsView.setBreadcrumbsPath(currentDir);
            breadcrumbsView.setListener(FolderFragment.this);
            items.add(0, breadcrumbsView);
        }
        return items;
    }).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(adaptableItems -> {
        if (adapter != null) {
            analyticsManager.dropBreadcrumb(TAG, "setItems()");
            setItemsDisposable = adapter.setItems(adaptableItems);
        }
        if (breadcrumb != null) {
            breadcrumb.changeBreadcrumbPath(currentDir);
        }
        if (adapter != null) {
            changeBreadcrumbPath();
        }
        updateMenuItems();
    }, error -> LogUtils.logException(TAG, "Error changing dir", error)));
}
Also used : R(com.simplecity.amp_library.R) Bundle(android.os.Bundle) PlaylistManager(com.simplecity.amp_library.utils.playlists.PlaylistManager) Rx.onErrorLogAndRethrow(com.afollestad.aesthetic.Rx.onErrorLogAndRethrow) ViewModel(com.simplecityapps.recycler_adapter.model.ViewModel) AnalyticsManager(com.simplecity.amp_library.utils.AnalyticsManager) AndroidSchedulers(io.reactivex.android.schedulers.AndroidSchedulers) BindView(butterknife.BindView) Song(com.simplecity.amp_library.model.Song) Aesthetic(com.afollestad.aesthetic.Aesthetic) CheckBox(android.widget.CheckBox) SongInfoDialog(com.simplecity.amp_library.ui.dialog.SongInfoDialog) TaggerDialog(com.simplecity.amp_library.ui.screens.tagger.TaggerDialog) View(android.view.View) RingtoneManager(com.simplecity.amp_library.utils.RingtoneManager) Schedulers(io.reactivex.schedulers.Schedulers) Unbinder(butterknife.Unbinder) BackPressListener(test.com.androidnavigation.fragment.BackPressListener) LogUtils(com.simplecity.amp_library.utils.LogUtils) ContextualToolbarHelper(com.simplecity.amp_library.utils.ContextualToolbarHelper) FileHelper(com.simplecity.amp_library.utils.FileHelper) PopupMenu(android.support.v7.widget.PopupMenu) ViewGroup(android.view.ViewGroup) Breadcrumb(com.simplecity.amp_library.interfaces.Breadcrumb) BaseFragment(com.simplecity.amp_library.ui.common.BaseFragment) SettingsManager(com.simplecity.amp_library.utils.SettingsManager) SongExtKt(com.simplecity.amp_library.utils.extensions.SongExtKt) CompositeDisposable(io.reactivex.disposables.CompositeDisposable) Disposable(io.reactivex.disposables.Disposable) List(java.util.List) Unit(kotlin.Unit) NotNull(org.jetbrains.annotations.NotNull) InclExclItem(com.simplecity.amp_library.model.InclExclItem) IntStream(com.annimon.stream.IntStream) BreadcrumbListener(com.simplecity.amp_library.interfaces.BreadcrumbListener) FileType(com.simplecity.amp_library.interfaces.FileType) AppBarLayout(android.support.design.widget.AppBarLayout) Stream(com.annimon.stream.Stream) ButterKnife(butterknife.ButterKnife) ContextualToolbar(com.simplecity.amp_library.ui.views.ContextualToolbar) RecyclerListener(com.simplecityapps.recycler_adapter.recyclerview.RecyclerListener) ViewModelAdapter(com.simplecityapps.recycler_adapter.adapter.ViewModelAdapter) SelectableViewModel(com.simplecity.amp_library.ui.modelviews.SelectableViewModel) Single(io.reactivex.Single) FolderView(com.simplecity.amp_library.ui.modelviews.FolderView) MenuItem(android.view.MenuItem) ArrayList(java.util.ArrayList) Inject(javax.inject.Inject) SuppressLint(android.annotation.SuppressLint) Repository(com.simplecity.amp_library.data.Repository) MenuInflater(android.view.MenuInflater) Toast(android.widget.Toast) Menu(android.view.Menu) ViewBackgroundAction(com.afollestad.aesthetic.ViewBackgroundAction) BaseFileObject(com.simplecity.amp_library.model.BaseFileObject) Observable(io.reactivex.Observable) Rx.distinctToMainThread(com.afollestad.aesthetic.Rx.distinctToMainThread) Nullable(io.reactivex.annotations.Nullable) MenuUtils(com.simplecity.amp_library.utils.menu.MenuUtils) Collectors(com.annimon.stream.Collectors) FileBrowser(com.simplecity.amp_library.utils.FileBrowser) LayoutInflater(android.view.LayoutInflater) Function3(io.reactivex.functions.Function3) ThemedStatusBarView(com.simplecity.amp_library.ui.views.ThemedStatusBarView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) TextUtils(android.text.TextUtils) SortManager(com.simplecity.amp_library.utils.sorting.SortManager) File(java.io.File) RecyclerView(android.support.v7.widget.RecyclerView) DrawerLockManager(com.simplecity.amp_library.ui.screens.drawer.DrawerLockManager) Toolbar(android.support.v7.widget.Toolbar) BreadcrumbItem(com.simplecity.amp_library.ui.views.BreadcrumbItem) BreadcrumbsView(com.simplecity.amp_library.ui.modelviews.BreadcrumbsView) PlaylistMenuHelper(com.simplecity.amp_library.utils.playlists.PlaylistMenuHelper) FolderMenuUtils(com.simplecity.amp_library.utils.menu.folder.FolderMenuUtils) Collections(java.util.Collections) FolderView(com.simplecity.amp_library.ui.modelviews.FolderView) List(java.util.List) ArrayList(java.util.ArrayList) File(java.io.File) SuppressLint(android.annotation.SuppressLint)

Example 4 with BreadcrumbsView

use of com.simplecity.amp_library.ui.modelviews.BreadcrumbsView in project Shuttle by timusus.

the class FolderFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_folder_browser, container, false);
    unbinder = ButterKnife.bind(this, rootView);
    if (displayedInTabs) {
        breadcrumbsView = new BreadcrumbsView(currentDir);
        showBreadcrumbsInList = true;
        changeBreadcrumbPath();
        appBarLayout.setVisibility(View.GONE);
        statusBarView.setVisibility(View.GONE);
    } else {
        showBreadcrumbsInList = false;
        breadcrumb.addBreadcrumbListener(this);
        if (!TextUtils.isEmpty(currentDir)) {
            breadcrumb.changeBreadcrumbPath(currentDir);
        }
    }
    if (!displayedInTabs) {
        toolbar.inflateMenu(R.menu.menu_folders);
        toolbar.setNavigationOnClickListener(v -> getNavigationController().popViewController());
        toolbar.setOnMenuItemClickListener(this);
        updateMenuItems(toolbar.getMenu());
    }
    recyclerView.setRecyclerListener(new RecyclerListener());
    recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    recyclerView.setAdapter(adapter);
    compositeDisposable.add(Aesthetic.get(getContext()).colorPrimary().compose(distinctToMainThread()).subscribe(color -> ViewBackgroundAction.create(appBarLayout).accept(color), onErrorLogAndRethrow()));
    return rootView;
}
Also used : BreadcrumbsView(com.simplecity.amp_library.ui.modelviews.BreadcrumbsView) R(com.simplecity.amp_library.R) Bundle(android.os.Bundle) PlaylistManager(com.simplecity.amp_library.utils.playlists.PlaylistManager) Rx.onErrorLogAndRethrow(com.afollestad.aesthetic.Rx.onErrorLogAndRethrow) ViewModel(com.simplecityapps.recycler_adapter.model.ViewModel) AnalyticsManager(com.simplecity.amp_library.utils.AnalyticsManager) AndroidSchedulers(io.reactivex.android.schedulers.AndroidSchedulers) BindView(butterknife.BindView) Song(com.simplecity.amp_library.model.Song) Aesthetic(com.afollestad.aesthetic.Aesthetic) CheckBox(android.widget.CheckBox) SongInfoDialog(com.simplecity.amp_library.ui.dialog.SongInfoDialog) TaggerDialog(com.simplecity.amp_library.ui.screens.tagger.TaggerDialog) View(android.view.View) RingtoneManager(com.simplecity.amp_library.utils.RingtoneManager) Schedulers(io.reactivex.schedulers.Schedulers) Unbinder(butterknife.Unbinder) BackPressListener(test.com.androidnavigation.fragment.BackPressListener) LogUtils(com.simplecity.amp_library.utils.LogUtils) ContextualToolbarHelper(com.simplecity.amp_library.utils.ContextualToolbarHelper) FileHelper(com.simplecity.amp_library.utils.FileHelper) PopupMenu(android.support.v7.widget.PopupMenu) ViewGroup(android.view.ViewGroup) Breadcrumb(com.simplecity.amp_library.interfaces.Breadcrumb) BaseFragment(com.simplecity.amp_library.ui.common.BaseFragment) SettingsManager(com.simplecity.amp_library.utils.SettingsManager) SongExtKt(com.simplecity.amp_library.utils.extensions.SongExtKt) CompositeDisposable(io.reactivex.disposables.CompositeDisposable) Disposable(io.reactivex.disposables.Disposable) List(java.util.List) Unit(kotlin.Unit) NotNull(org.jetbrains.annotations.NotNull) InclExclItem(com.simplecity.amp_library.model.InclExclItem) IntStream(com.annimon.stream.IntStream) BreadcrumbListener(com.simplecity.amp_library.interfaces.BreadcrumbListener) FileType(com.simplecity.amp_library.interfaces.FileType) AppBarLayout(android.support.design.widget.AppBarLayout) Stream(com.annimon.stream.Stream) ButterKnife(butterknife.ButterKnife) ContextualToolbar(com.simplecity.amp_library.ui.views.ContextualToolbar) RecyclerListener(com.simplecityapps.recycler_adapter.recyclerview.RecyclerListener) ViewModelAdapter(com.simplecityapps.recycler_adapter.adapter.ViewModelAdapter) SelectableViewModel(com.simplecity.amp_library.ui.modelviews.SelectableViewModel) Single(io.reactivex.Single) FolderView(com.simplecity.amp_library.ui.modelviews.FolderView) MenuItem(android.view.MenuItem) ArrayList(java.util.ArrayList) Inject(javax.inject.Inject) SuppressLint(android.annotation.SuppressLint) Repository(com.simplecity.amp_library.data.Repository) MenuInflater(android.view.MenuInflater) Toast(android.widget.Toast) Menu(android.view.Menu) ViewBackgroundAction(com.afollestad.aesthetic.ViewBackgroundAction) BaseFileObject(com.simplecity.amp_library.model.BaseFileObject) Observable(io.reactivex.Observable) Rx.distinctToMainThread(com.afollestad.aesthetic.Rx.distinctToMainThread) Nullable(io.reactivex.annotations.Nullable) MenuUtils(com.simplecity.amp_library.utils.menu.MenuUtils) Collectors(com.annimon.stream.Collectors) FileBrowser(com.simplecity.amp_library.utils.FileBrowser) LayoutInflater(android.view.LayoutInflater) Function3(io.reactivex.functions.Function3) ThemedStatusBarView(com.simplecity.amp_library.ui.views.ThemedStatusBarView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) TextUtils(android.text.TextUtils) SortManager(com.simplecity.amp_library.utils.sorting.SortManager) File(java.io.File) RecyclerView(android.support.v7.widget.RecyclerView) DrawerLockManager(com.simplecity.amp_library.ui.screens.drawer.DrawerLockManager) Toolbar(android.support.v7.widget.Toolbar) BreadcrumbItem(com.simplecity.amp_library.ui.views.BreadcrumbItem) BreadcrumbsView(com.simplecity.amp_library.ui.modelviews.BreadcrumbsView) PlaylistMenuHelper(com.simplecity.amp_library.utils.playlists.PlaylistMenuHelper) FolderMenuUtils(com.simplecity.amp_library.utils.menu.folder.FolderMenuUtils) Collections(java.util.Collections) RecyclerListener(com.simplecityapps.recycler_adapter.recyclerview.RecyclerListener) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) BindView(butterknife.BindView) View(android.view.View) FolderView(com.simplecity.amp_library.ui.modelviews.FolderView) ThemedStatusBarView(com.simplecity.amp_library.ui.views.ThemedStatusBarView) RecyclerView(android.support.v7.widget.RecyclerView) BreadcrumbsView(com.simplecity.amp_library.ui.modelviews.BreadcrumbsView)

Example 5 with BreadcrumbsView

use of com.simplecity.amp_library.ui.modelviews.BreadcrumbsView in project Shuttle by timusus.

the class FolderFragment method changeBreadcrumbPath.

public void changeBreadcrumbPath() {
    List<AdaptableItem> breadcrumbViews = Stream.of(mAdapter.items).filter(adaptableItem -> adaptableItem instanceof BreadcrumbsView).collect(Collectors.toList());
    for (AdaptableItem adaptableItem : breadcrumbViews) {
        ((BreadcrumbsView) adaptableItem).setBreadcrumbsPath(mCurrentDir);
        mAdapter.notifyItemChanged(mAdapter.items.indexOf(adaptableItem));
    }
}
Also used : R(com.simplecity.amp_library.R) ActionMode(android.view.ActionMode) LinearLayout(android.widget.LinearLayout) Bundle(android.os.Bundle) ProgressBar(android.widget.ProgressBar) PlaylistUtils(com.simplecity.amp_library.utils.PlaylistUtils) DrawableCompat(android.support.v4.graphics.drawable.DrawableCompat) AndroidSchedulers(rx.android.schedulers.AndroidSchedulers) Song(com.simplecity.amp_library.model.Song) FileObject(com.simplecity.amp_library.model.FileObject) Schedulers(rx.schedulers.Schedulers) View(android.view.View) BackPressListener(com.simplecity.amp_library.interfaces.BackPressListener) PreferenceManager(android.preference.PreferenceManager) ActionBarUtils(com.simplecity.amp_library.utils.ActionBarUtils) SortManager(com.simplecity.amp_library.utils.SortManager) AsyncTask(android.os.AsyncTask) Playlist(com.simplecity.amp_library.model.Playlist) MainActivity(com.simplecity.amp_library.ui.activities.MainActivity) FileHelper(com.simplecity.amp_library.utils.FileHelper) PopupMenu(android.support.v7.widget.PopupMenu) SubMenu(android.view.SubMenu) Breadcrumb(com.simplecity.amp_library.interfaces.Breadcrumb) WhitelistHelper(com.simplecity.amp_library.sql.databases.WhitelistHelper) SettingsManager(com.simplecity.amp_library.utils.SettingsManager) ViewGroup(android.view.ViewGroup) ViewUtils(com.simplecity.amp_library.utils.ViewUtils) MusicUtils(com.simplecity.amp_library.utils.MusicUtils) List(java.util.List) TextView(android.widget.TextView) FolderAdapter(com.simplecity.amp_library.ui.adapters.FolderAdapter) AdaptableItem(com.simplecity.amp_library.model.AdaptableItem) MaterialDialog(com.afollestad.materialdialogs.MaterialDialog) BreadcrumbListener(com.simplecity.amp_library.interfaces.BreadcrumbListener) FileType(com.simplecity.amp_library.interfaces.FileType) Context(android.content.Context) Stream(com.annimon.stream.Stream) DrawableUtils(com.simplecity.amp_library.utils.DrawableUtils) FolderView(com.simplecity.amp_library.ui.modelviews.FolderView) MenuItem(android.view.MenuItem) ArrayList(java.util.ArrayList) ThemeUtils(com.simplecity.amp_library.utils.ThemeUtils) ColorUtils(com.simplecity.amp_library.utils.ColorUtils) MenuInflater(android.view.MenuInflater) Toast(android.widget.Toast) BaseFileObject(com.simplecity.amp_library.model.BaseFileObject) Menu(android.view.Menu) CustomMediaScanner(com.simplecity.amp_library.utils.CustomMediaScanner) ShuttleUtils(com.simplecity.amp_library.utils.ShuttleUtils) TaggerDialog(com.simplecity.amp_library.tagger.TaggerDialog) Collectors(com.annimon.stream.Collectors) FileBrowser(com.simplecity.amp_library.utils.FileBrowser) LayoutInflater(android.view.LayoutInflater) FolderObject(com.simplecity.amp_library.model.FolderObject) ProgressDialog(android.app.ProgressDialog) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) TextUtils(android.text.TextUtils) File(java.io.File) DialogUtils(com.simplecity.amp_library.utils.DialogUtils) Color(android.graphics.Color) RecyclerView(android.support.v7.widget.RecyclerView) SharedPreferences(android.content.SharedPreferences) BreadcrumbItem(com.simplecity.amp_library.ui.views.BreadcrumbItem) Toolbar(android.support.v7.widget.Toolbar) BreadcrumbsView(com.simplecity.amp_library.ui.modelviews.BreadcrumbsView) CustomEditText(com.simplecity.amp_library.ui.views.CustomEditText) Collections(java.util.Collections) BreadcrumbsView(com.simplecity.amp_library.ui.modelviews.BreadcrumbsView) AdaptableItem(com.simplecity.amp_library.model.AdaptableItem)

Aggregations

Bundle (android.os.Bundle)5 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)5 PopupMenu (android.support.v7.widget.PopupMenu)5 RecyclerView (android.support.v7.widget.RecyclerView)5 Toolbar (android.support.v7.widget.Toolbar)5 TextUtils (android.text.TextUtils)5 LayoutInflater (android.view.LayoutInflater)5 Menu (android.view.Menu)5 MenuInflater (android.view.MenuInflater)5 MenuItem (android.view.MenuItem)5 View (android.view.View)5 ViewGroup (android.view.ViewGroup)5 Toast (android.widget.Toast)5 Collectors (com.annimon.stream.Collectors)5 Stream (com.annimon.stream.Stream)5 R (com.simplecity.amp_library.R)5 Breadcrumb (com.simplecity.amp_library.interfaces.Breadcrumb)5 BreadcrumbListener (com.simplecity.amp_library.interfaces.BreadcrumbListener)5 FileType (com.simplecity.amp_library.interfaces.FileType)5 BaseFileObject (com.simplecity.amp_library.model.BaseFileObject)5