summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2013-02-12 22:44:18 -0800
committerSteve Kondik <shade@chemlab.org>2013-02-12 22:44:18 -0800
commit1a180510e6421467db8cafa641130fb1dbb6aee7 (patch)
tree4eea55e6a386b530d2853ee21cf7ee72f03445f6 /src
parent8e9254b9e9edadb380c452306835114e623fee7d (diff)
parent948a38658241c8379e6efc743cd3a70a71d37421 (diff)
downloadandroid_packages_screensavers_PhotoTable-cm-10.1.0-RC3.tar.gz
android_packages_screensavers_PhotoTable-cm-10.1.0-RC3.tar.bz2
android_packages_screensavers_PhotoTable-cm-10.1.0-RC3.zip
Merge tag 'android-4.2.2_r1' of https://android.googlesource.com/platform/packages/screensavers/PhotoTable into 1.1cm-10.1.3-RC2cm-10.1.3-RC1cm-10.1.3cm-10.1.2cm-10.1.1cm-10.1.0-RC5cm-10.1.0-RC4cm-10.1.0-RC3cm-10.1.0-RC2cm-10.1.0-RC1cm-10.1.0cm-10.1-M3cm-10.1-M2mr1.1-stagingcm-10.1
Android 4.2.2 release 1
Diffstat (limited to 'src')
-rw-r--r--src/com/android/dreams/phototable/PhotoTableDream.java30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/com/android/dreams/phototable/PhotoTableDream.java b/src/com/android/dreams/phototable/PhotoTableDream.java
index e7cc2ce..37ea019 100644
--- a/src/com/android/dreams/phototable/PhotoTableDream.java
+++ b/src/com/android/dreams/phototable/PhotoTableDream.java
@@ -19,8 +19,6 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.service.dreams.DreamService;
-import android.view.LayoutInflater;
-import android.view.ViewGroup;
import java.util.Set;
@@ -35,28 +33,30 @@ public class PhotoTableDream extends DreamService {
public void onDreamingStarted() {
super.onDreamingStarted();
setInteractive(true);
+
+ BummerView bummer = (BummerView) findViewById(R.id.bummer);
+ if (bummer != null) {
+ Resources resources = getResources();
+ bummer.setAnimationParams(true,
+ resources.getInteger(R.integer.table_drop_period),
+ resources.getInteger(R.integer.fast_drop));
+ }
+
+ PhotoTable table = (PhotoTable) findViewById(R.id.table);
+ if (table != null) {
+ table.setDream(this);
+ }
}
@Override
public void onAttachedToWindow() {
super.onAttachedToWindow();
- LayoutInflater inflater =
- (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
AlbumSettings settings = AlbumSettings.getAlbumSettings(
getSharedPreferences(PhotoTableDreamSettings.PREFS_NAME, 0));
if (settings.isConfigured()) {
- ViewGroup view = (ViewGroup) inflater.inflate(R.layout.table, null);
- PhotoTable table = (PhotoTable) view.findViewById(R.id.table);
- table.setDream(this);
- setContentView(view);
+ setContentView(R.layout.table);
} else {
- Resources resources = getResources();
- ViewGroup view = (ViewGroup) inflater.inflate(R.layout.bummer, null);
- BummerView bummer = (BummerView) view.findViewById(R.id.bummer);
- bummer.setAnimationParams(true,
- resources.getInteger(R.integer.table_drop_period),
- resources.getInteger(R.integer.fast_drop));
- setContentView(view);
+ setContentView(R.layout.bummer);
}
setFullscreen(true);
}