diff options
author | Chris Wren <cwren@android.com> | 2012-11-28 11:05:59 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-11-28 11:05:59 -0800 |
commit | 0c220c90e5cd805c98f8c82b16007a27791c1ba8 (patch) | |
tree | ca95440abeffdd11aeefd3db48b5e0f59c6b888c | |
parent | a978261764bdc18224c67d2f699945c8e598d4f0 (diff) | |
parent | 1d136862c9b6d0c013527b29d7799ae3da2d9a82 (diff) | |
download | android_packages_screensavers_PhotoTable-0c220c90e5cd805c98f8c82b16007a27791c1ba8.tar.gz android_packages_screensavers_PhotoTable-0c220c90e5cd805c98f8c82b16007a27791c1ba8.tar.bz2 android_packages_screensavers_PhotoTable-0c220c90e5cd805c98f8c82b16007a27791c1ba8.zip |
am 1d136862: am 6e7f0eed: am 85756a88: remove padding on table, also lifecycle cleanup.
* commit '1d136862c9b6d0c013527b29d7799ae3da2d9a82':
remove padding on table, also lifecycle cleanup.
-rw-r--r-- | res/drawable/table.xml | 5 | ||||
-rw-r--r-- | res/layout/table.xml | 20 | ||||
-rw-r--r-- | src/com/android/dreams/phototable/PhotoTableDream.java | 30 |
3 files changed, 27 insertions, 28 deletions
diff --git a/res/drawable/table.xml b/res/drawable/table.xml index 4663f51..6c22af8 100644 --- a/res/drawable/table.xml +++ b/res/drawable/table.xml @@ -22,9 +22,4 @@ android:endColor="@color/tabletop_dark" android:type="linear" /> - <padding - android:left="10dp" - android:top="10dp" - android:right="10dp" - android:bottom="10dp" /> </shape> diff --git a/res/layout/table.xml b/res/layout/table.xml index 3a2b34b..b5663cb 100644 --- a/res/layout/table.xml +++ b/res/layout/table.xml @@ -16,20 +16,24 @@ <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" - android:layout_height="match_parent" > + android:layout_height="match_parent" + > <com.android.dreams.phototable.PhotoTable - android:background="@+drawable/table" - android:id="@+id/table" - android:layout_width="match_parent" - android:layout_height="match_parent" /> + android:background="@+drawable/table" + android:id="@+id/table" + android:layout_width="match_parent" + android:layout_height="match_parent" + /> <!-- View android:background="@+drawable/vignette_br" android:layout_gravity="bottom|right" android:layout_width="300dp" - android:layout_height="300dp" /> - <View + android:layout_height="300dp" + / --> + <!-- View android:background="@+drawable/vignette_tl" android:layout_gravity="top|left" android:layout_width="300dp" - android:layout_height="300dp" / --> + android:layout_height="300dp" + / --> </FrameLayout> 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); } |