From fff81cad6963dfa977fa8063efa3d29797d9d8c2 Mon Sep 17 00:00:00 2001 From: nebkat Date: Sun, 23 Dec 2012 14:25:45 +0000 Subject: Launcher actions Change-Id: Ica0699f99d68b9f89d6f103eaadc56e632d87101 --- src/com/cyanogenmod/trebuchet/PagedViewWidget.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/com/cyanogenmod/trebuchet/PagedViewWidget.java') diff --git a/src/com/cyanogenmod/trebuchet/PagedViewWidget.java b/src/com/cyanogenmod/trebuchet/PagedViewWidget.java index 5f2b800..b821b6f 100644 --- a/src/com/cyanogenmod/trebuchet/PagedViewWidget.java +++ b/src/com/cyanogenmod/trebuchet/PagedViewWidget.java @@ -127,6 +127,18 @@ public class PagedViewWidget extends LinearLayout { } } + public void applyFromLauncherActionInfo(LauncherActionInfo info) { + mIsAppWidget = false; + final ImageView image = (ImageView) findViewById(R.id.widget_preview); + image.setContentDescription(getContext().getResources().getString(info.action.getString())); + final TextView name = (TextView) findViewById(R.id.widget_name); + name.setText(info.title); + final TextView dims = (TextView) findViewById(R.id.widget_dims); + if (dims != null) { + dims.setText(String.format(mDimensionsFormatString, 1, 1)); + } + } + public int[] getPreviewSize() { final ImageView i = (ImageView) findViewById(R.id.widget_preview); int[] maxSize = new int[2]; -- cgit v1.1