summaryrefslogtreecommitdiffstats
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
parent8e9254b9e9edadb380c452306835114e623fee7d (diff)
parent948a38658241c8379e6efc743cd3a70a71d37421 (diff)
downloadandroid_packages_screensavers_PhotoTable-mr1.1-staging.tar.gz
android_packages_screensavers_PhotoTable-mr1.1-staging.tar.bz2
android_packages_screensavers_PhotoTable-mr1.1-staging.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
-rw-r--r--res/drawable/table.xml5
-rw-r--r--res/layout/table.xml20
-rw-r--r--src/com/android/dreams/phototable/PhotoTableDream.java30
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);
}