diff options
author | Chris Wren <cwren@android.com> | 2012-11-15 11:53:41 -0500 |
---|---|---|
committer | Chris Wren <cwren@android.com> | 2012-11-15 11:59:51 -0500 |
commit | 85756a88f29b41c29bf6ad10a32379f80f0df4d5 (patch) | |
tree | f6963754bee3000f47369d0fa4328ab49d6d4e1e /src | |
parent | c39ee4748b1398080241955f3ed09915afe31c5f (diff) | |
download | android_packages_screensavers_PhotoTable-85756a88f29b41c29bf6ad10a32379f80f0df4d5.tar.gz android_packages_screensavers_PhotoTable-85756a88f29b41c29bf6ad10a32379f80f0df4d5.tar.bz2 android_packages_screensavers_PhotoTable-85756a88f29b41c29bf6ad10a32379f80f0df4d5.zip |
remove padding on table, also lifecycle cleanup.
Bug: 7195054
Change-Id: I1270642fc19c9ccc5fe19fbf395f729371d0ee94
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dreams/phototable/PhotoTableDream.java | 30 |
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); } |