Commit 3c389093 authored by Geoffrey Métais's avatar Geoffrey Métais

Prevent crash on Android 2.x

parent e291a5c0
......@@ -104,7 +104,8 @@ public class DirectoryViewFragment extends ListFragment implements IRefreshable,
listView.setNextFocusUpId(R.id.ml_menu_search);
listView.setNextFocusLeftId(android.R.id.list);
listView.setNextFocusRightId(android.R.id.list);
listView.setNextFocusForwardId(android.R.id.list);
if (LibVlcUtil.isHoneycombOrLater())
listView.setNextFocusForwardId(android.R.id.list);
focusHelper(mDirectoryAdapter.getCount() == 0);
listView.requestFocus();
listView.setOnItemLongClickListener(new OnItemLongClickListener() {
......
......@@ -21,6 +21,7 @@
package org.videolan.vlc.gui;
import org.videolan.libvlc.LibVLC;
import org.videolan.libvlc.LibVlcUtil;
import org.videolan.vlc.R;
import org.videolan.vlc.audio.AudioServiceController;
import org.videolan.vlc.interfaces.IRefreshable;
......@@ -75,7 +76,8 @@ public class HistoryFragment extends ListFragment implements IRefreshable {
listView.setNextFocusUpId(R.id.ml_menu_search);
listView.setNextFocusLeftId(android.R.id.list);
listView.setNextFocusRightId(android.R.id.list);
listView.setNextFocusForwardId(android.R.id.list);
if (LibVlcUtil.isHoneycombOrLater())
listView.setNextFocusForwardId(android.R.id.list);
focusHelper(mHistoryAdapter.getCount() == 0);
listView.requestFocus();
registerForContextMenu(listView);
......
......@@ -772,15 +772,15 @@ public class MainActivity extends ActionBarActivity {
(v.getNextFocusDownId() == -1) &&
(v.getNextFocusUpId() == -1) &&
(v.getNextFocusLeftId() == -1) &&
(v.getNextFocusRightId() == -1) &&
(v.getNextFocusForwardId() == -1)) {
(v.getNextFocusRightId() == -1)) {
mActionBarIconId = Util.generateViewId();
v.setId(mActionBarIconId);
v.setNextFocusUpId(mActionBarIconId);
v.setNextFocusDownId(mActionBarIconId);
v.setNextFocusLeftId(mActionBarIconId);
v.setNextFocusRightId(R.id.ml_menu_search);
v.setNextFocusForwardId(mActionBarIconId);
if (LibVlcUtil.isHoneycombOrLater())
v.setNextFocusForwardId(mActionBarIconId);
findViewById(R.id.ml_menu_search).setNextFocusLeftId(
mActionBarIconId);
}
......
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