Manual revert due to conflict:

am: d31dcbcc7c

* commit 'd31dcbcc7c7901959c65c4e635e59274a1d4c334':
  Manual revert due to conflict:
This commit is contained in:
Hyunyoung Song authored and android-build-merger committed 2016-02-23 19:56:32 +00:00
commit dfaeff757d
3 files changed
+33 -51

No files matched your search

@@ -137,23 +137,32 @@ public class WidgetCell extends LinearLayout implements OnLayoutChangeListener {
}
/**
* Apply the widget provider info or the resolve info to the view.
* Apply the widget provider info to the view.
*/
public void applyFromInfo(Object info, CharSequence label,
WidgetPreviewLoader loader) {
public void applyFromAppWidgetProviderInfo(LauncherAppWidgetProviderInfo info,
WidgetPreviewLoader loader) {
InvariantDeviceProfile profile =
LauncherAppState.getInstance().getInvariantDeviceProfile();
mInfo = info;
// TODO(hyunyoungs): setup a cache for these labels.
mWidgetName.setText(AppWidgetManagerCompat.getInstance(getContext()).loadLabel(info));
int hSpan = Math.min(info.spanX, profile.numColumns);
int vSpan = Math.min(info.spanY, profile.numRows);
mWidgetDims.setText(String.format(mDimensionsFormatString, hSpan, vSpan));
mWidgetPreviewLoader = loader;
}
/**
* Apply the resolve info to the view.
*/
public void applyFromResolveInfo(
PackageManager pm, ResolveInfo info, WidgetPreviewLoader loader) {
mInfo = info;
CharSequence label = info.loadLabel(pm);
mWidgetName.setText(label);
mWidgetDims.setText(String.format(mDimensionsFormatString, 1, 1));
mWidgetPreviewLoader = loader;
if (info instanceof LauncherAppWidgetProviderInfo) {
InvariantDeviceProfile profile =
LauncherAppState.getInstance().getInvariantDeviceProfile();
int hSpan = Math.min(((LauncherAppWidgetProviderInfo)info).spanX, profile.numColumns);
int vSpan = Math.min(((LauncherAppWidgetProviderInfo)info).spanY, profile.numRows);
mWidgetDims.setText(String.format(mDimensionsFormatString, hSpan, vSpan));
}
if (info instanceof ResolveInfo) {
mWidgetDims.setText(String.format(mDimensionsFormatString, 1, 1));
}
}
public int[] getPreviewSize() {