Commit 988f897d authored by Geoffrey Métais's avatar Geoffrey Métais

TV: Fix directories selection

parent 2f2c5479
......@@ -38,7 +38,7 @@
android:orientation="horizontal"
android:focusable="true"
android:clickable="@{holder != null}"
android:longClickable="@{hasContextMenu}"
android:longClickable="@{hasContextMenu || storage != null}"
android:onClick="@{holder.onClick}"
android:background="@drawable/background_item">
......@@ -49,6 +49,7 @@
android:layout_gravity="center_vertical"
android:layout_marginLeft="15dp"
android:visibility="@{type == 2 ? View.VISIBLE : View.GONE}"
android:focusable="false"
android:enabled="@{checkEnabled}"
android:checked="@{checked}"
android:onClick="@{holder.onCheckBoxClick}"/>
......
......@@ -140,6 +140,13 @@ public class BaseBrowserAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
binding.setHolder(this);
v.findViewById(R.id.layout_item).setTag(R.id.layout_item, this);
v.setTag(binding);
v.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
binding.browserCheckbox.toggle();
return true;
}
});
}
public void setContextMenuListener() {
......
......@@ -36,8 +36,9 @@ import android.view.View;
import android.view.ViewGroup;
import org.videolan.libvlc.Media;
import org.videolan.vlc.media.MediaWrapper;
import org.videolan.vlc.R;
import org.videolan.vlc.VLCApplication;
import org.videolan.vlc.media.MediaWrapper;
import org.videolan.vlc.util.AndroidDevices;
import org.videolan.vlc.util.CustomDirectories;
......@@ -82,6 +83,17 @@ public class StorageBrowserFragment extends FileBrowserFragment {
return v;
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
if (VLCApplication.showTvUi()) {
if (mRoot)
mFAB.requestFocus();
else
mRecyclerView.requestFocus();
}
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
......
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