Search in sources :

Example 11 with AdaptableItem

use of com.simplecity.amp_library.model.AdaptableItem 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)

Example 12 with AdaptableItem

use of com.simplecity.amp_library.model.AdaptableItem in project Shuttle by timusus.

the class FolderFragment method showCheckboxes.

public void showCheckboxes(boolean show) {
    mShowCheckboxes = show;
    List<AdaptableItem> folderViews = Stream.of(mAdapter.items).filter(adaptableItem -> adaptableItem instanceof FolderView).collect(Collectors.toList());
    for (AdaptableItem adaptableItem : folderViews) {
        ((FolderView) adaptableItem).setShowCheckboxes(mShowCheckboxes);
        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) FolderView(com.simplecity.amp_library.ui.modelviews.FolderView) AdaptableItem(com.simplecity.amp_library.model.AdaptableItem)

Example 13 with AdaptableItem

use of com.simplecity.amp_library.model.AdaptableItem in project Shuttle by timusus.

the class ItemAdapter method moveItem.

/**
     * Moves an item from {@param fromPosition} to {@param toPosition}
     *
     * @param fromPosition int
     * @param toPosition   int
     */
public void moveItem(int fromPosition, int toPosition) {
    final AdaptableItem model = items.remove(fromPosition);
    items.add(toPosition, model);
    notifyItemMoved(fromPosition, toPosition);
}
Also used : AdaptableItem(com.simplecity.amp_library.model.AdaptableItem)

Aggregations

AdaptableItem (com.simplecity.amp_library.model.AdaptableItem)13 RecyclerView (android.support.v7.widget.RecyclerView)11 Context (android.content.Context)10 View (android.view.View)10 Stream (com.annimon.stream.Stream)10 R (com.simplecity.amp_library.R)10 List (java.util.List)10 AndroidSchedulers (rx.android.schedulers.AndroidSchedulers)10 LayoutInflater (android.view.LayoutInflater)9 Collectors (com.annimon.stream.Collectors)9 Song (com.simplecity.amp_library.model.Song)9 ArrayList (java.util.ArrayList)9 Schedulers (rx.schedulers.Schedulers)9 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)8 Toast (android.widget.Toast)8 Observable (rx.Observable)8 Intent (android.content.Intent)7 Bundle (android.os.Bundle)7 PopupMenu (android.support.v7.widget.PopupMenu)7 Glide (com.bumptech.glide.Glide)7