Add support for landscape theme previews.
diff --git a/src/com/tmobile/themes/provider/ThemeItem.java b/src/com/tmobile/themes/provider/ThemeItem.java
index 56b5659..a3156e2 100644
--- a/src/com/tmobile/themes/provider/ThemeItem.java
+++ b/src/com/tmobile/themes/provider/ThemeItem.java
@@ -245,10 +245,18 @@
/**
* A theme may specify a preview image to represent a theme.
+ *
+ * @param orientation the screen orientation for which a preview image is
+ * desired. Orientation values come from {@link android.content.res.Configuration}
* @return the preview image uri, or null if this theme doesn't specify one.
*/
- public Uri getPreviewUri() {
- return parseUriNullSafe(mCursor.getString(mColumnPreviewUri));
+ public Uri getPreviewUri(int orientation) {
+ Uri uri = parseUriNullSafe(mCursor.getString(mColumnPreviewUri));
+ if (null != uri) {
+ uri = uri.buildUpon().appendQueryParameter(Themes.KEY_ORIENTATION,
+ String.valueOf(orientation)).build();
+ }
+ return uri;
}
/** @deprecated */
diff --git a/src/com/tmobile/themes/provider/Themes.java b/src/com/tmobile/themes/provider/Themes.java
index 674e57d..c1c3b03 100644
--- a/src/com/tmobile/themes/provider/Themes.java
+++ b/src/com/tmobile/themes/provider/Themes.java
@@ -37,6 +37,8 @@
public static final Uri CONTENT_URI =
Uri.parse("content://" + AUTHORITY);
+ public static final String KEY_ORIENTATION = "orientation";
+
private Themes() {}
/**