diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dreams/phototable/PhotoDreamSettingsReceiver.java | 3 | ||||
-rw-r--r-- | src/com/android/dreams/phototable/PhotoTable.java | 8 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/com/android/dreams/phototable/PhotoDreamSettingsReceiver.java b/src/com/android/dreams/phototable/PhotoDreamSettingsReceiver.java index d1a6199..208441b 100644 --- a/src/com/android/dreams/phototable/PhotoDreamSettingsReceiver.java +++ b/src/com/android/dreams/phototable/PhotoDreamSettingsReceiver.java @@ -28,6 +28,7 @@ public class PhotoDreamSettingsReceiver extends BroadcastReceiver { private static final String TAG = "PhotoDreamSettingsReceiver"; private static final String LOCAL_AUTHORITY = "media"; private static final String INTERNAL = "internal"; + private static final boolean DEBUG = false; public static final String ACTION_ADD_ALBUM = "add"; public static final String ACTION_REMOVE_ALBUM = "remove"; @@ -59,7 +60,7 @@ public class PhotoDreamSettingsReceiver extends BroadcastReceiver { albumId = PicasaSource.constructId(path.get(1)); } } - + if (DEBUG) Log.d(TAG, "receive: " + albumId + " is " + shown); for (int idx = 0; idx < settings.length; idx++) { settings[idx].setAlbumEnabled(albumId, shown); } diff --git a/src/com/android/dreams/phototable/PhotoTable.java b/src/com/android/dreams/phototable/PhotoTable.java index 1ba95b9..5cdd70f 100644 --- a/src/com/android/dreams/phototable/PhotoTable.java +++ b/src/com/android/dreams/phototable/PhotoTable.java @@ -286,7 +286,9 @@ public class PhotoTable extends FrameLayout { } public void setDefaultFocus() { - setFocus(mOnTable.getLast()); + if (mOnTable.size() > 0) { + setFocus(mOnTable.getLast()); + } } public void setFocus(View focus) { @@ -356,7 +358,9 @@ public class PhotoTable extends FrameLayout { public View moveFocus(View focus, float direction, float angle) { if (focus == null) { - setFocus(mOnTable.getLast()); + if (mOnTable.size() > 0) { + setFocus(mOnTable.getLast()); + } } else { final double alpha = Math.toRadians(direction); final double beta = Math.toRadians(Math.min(angle, 180f) / 2f); |