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

Prevent crash on Android 2.x

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