Commit 6c0db159 authored by Geoffrey Métais's avatar Geoffrey Métais

TV: Save prefetch files list on browsing

parent e5564ff3
......@@ -29,7 +29,9 @@ import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import org.jetbrains.annotations.NotNull;
import org.videolan.medialibrary.media.MediaLibraryItem;
import org.videolan.medialibrary.media.MediaWrapper;
import org.videolan.vlc.ExternalMonitor;
import org.videolan.vlc.viewmodels.browser.BrowserModel;
import org.videolan.vlc.viewmodels.browser.BrowserModelKt;
......@@ -38,6 +40,9 @@ import java.util.List;
import java.util.Map;
import androidx.annotation.Nullable;
import androidx.leanback.widget.Presenter;
import androidx.leanback.widget.Row;
import androidx.leanback.widget.RowPresenter;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;
......@@ -70,4 +75,10 @@ public class DirectoryBrowserFragment extends MediaSortedFragment<BrowserModel>
}
});
}
@Override
public void onItemClicked(@NotNull Presenter.ViewHolder viewHolder, @NotNull Object item, @NotNull RowPresenter.ViewHolder viewHolder1, @NotNull Row row) {
if (item instanceof MediaWrapper && ((MediaWrapper)item).getType() == MediaWrapper.TYPE_DIR) viewModel.saveList((MediaWrapper)item);
super.onItemClicked(viewHolder, item, viewHolder1, row);
}
}
......@@ -31,7 +31,9 @@ import android.content.IntentFilter;
import android.os.Build;
import android.os.Bundle;
import org.jetbrains.annotations.NotNull;
import org.videolan.medialibrary.media.MediaLibraryItem;
import org.videolan.medialibrary.media.MediaWrapper;
import org.videolan.vlc.ExternalMonitor;
import org.videolan.vlc.VLCApplication;
import org.videolan.vlc.gui.dialogs.VlcLoginDialog;
......@@ -41,6 +43,9 @@ import java.util.List;
import java.util.Map;
import androidx.annotation.Nullable;
import androidx.leanback.widget.Presenter;
import androidx.leanback.widget.Row;
import androidx.leanback.widget.RowPresenter;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
......@@ -92,6 +97,12 @@ public class NetworkBrowserFragment extends MediaSortedFragment<NetworkModel> {
LocalBroadcastManager.getInstance(VLCApplication.getAppContext()).unregisterReceiver(mLocalReceiver);
}
@Override
public void onItemClicked(@NotNull Presenter.ViewHolder viewHolder, @NotNull Object item, @NotNull RowPresenter.ViewHolder viewHolder1, @NotNull Row row) {
if (item instanceof MediaWrapper && ((MediaWrapper)item).getType() == MediaWrapper.TYPE_DIR) viewModel.saveList((MediaWrapper)item);
super.onItemClicked(viewHolder, item, viewHolder1, row);
}
private BroadcastReceiver mLocalReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment