summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2010-12-14 17:25:59 -0800
committerWinson Chung <winsonc@google.com>2010-12-14 18:27:50 -0800
commitc3f9f4fcbd3fba3753335d5c9671c0893393b164 (patch)
tree5cd0cee16bdd6ade3f245f315aeaca23532dd7e5 /src/com/android
parenta58f8bb1947af39d4d18d849b3e4d6bd0d3954d7 (diff)
downloadandroid_packages_apps_Trebuchet-c3f9f4fcbd3fba3753335d5c9671c0893393b164.tar.gz
android_packages_apps_Trebuchet-c3f9f4fcbd3fba3753335d5c9671c0893393b164.tar.bz2
android_packages_apps_Trebuchet-c3f9f4fcbd3fba3753335d5c9671c0893393b164.zip
Fixing issue with customize page holographic previews not showing.
- Adding temporary workaround for bad holographic default widget previews. Change-Id: I261045beac3791111f928511435e17e320f2d4a7
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/launcher2/PagedView.java16
-rw-r--r--src/com/android/launcher2/PagedViewWidget.java6
2 files changed, 9 insertions, 13 deletions
diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java
index 856507d64..8483f959f 100644
--- a/src/com/android/launcher2/PagedView.java
+++ b/src/com/android/launcher2/PagedView.java
@@ -595,20 +595,14 @@ public abstract class PagedView extends ViewGroup {
int rightScreen = 0;
while (x <= mScrollX) {
leftScreen++;
- x += pageWidth + mPageSpacing;
- // replace above line with this if you don't assume all pages have same width as 0th
- // page:
- // x += getScaledMeasuredWidth(getChildAt(leftScreen));
+ x += getScaledMeasuredWidth(getChildAt(leftScreen)) + mPageSpacing;
}
rightScreen = leftScreen;
- while (x < mScrollX + screenWidth) {
+ while (x < mScrollX + screenWidth && rightScreen < pageCount) {
rightScreen++;
- x += pageWidth + mPageSpacing;
- // replace above line with this if you don't assume all pages have same width as 0th
- // page:
- //if (rightScreen < pageCount) {
- // x += getScaledMeasuredWidth(getChildAt(rightScreen));
- //}
+ if (rightScreen < pageCount) {
+ x += getScaledMeasuredWidth(getChildAt(rightScreen)) + mPageSpacing;
+ }
}
rightScreen = Math.min(getChildCount() - 1, rightScreen);
diff --git a/src/com/android/launcher2/PagedViewWidget.java b/src/com/android/launcher2/PagedViewWidget.java
index 89ed0ecee..5f5844f44 100644
--- a/src/com/android/launcher2/PagedViewWidget.java
+++ b/src/com/android/launcher2/PagedViewWidget.java
@@ -25,6 +25,8 @@ import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
+import android.graphics.PorterDuffXfermode;
+import android.graphics.PorterDuff.Mode;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.os.HandlerThread;
@@ -78,6 +80,8 @@ public class PagedViewWidget extends LinearLayout {
widget.mPreview.setAlpha(255);
widget.mPreview.draw(widget.mHolographicOutlineCanvas);
widget.mPreview.setAlpha(prevAlpha);
+ // Temporary workaround to make the default widget outlines visible
+ widget.mHolographicOutlineCanvas.drawColor(Color.argb(156, 0, 0, 0), Mode.SRC_OVER);
widget.mHolographicOutlineCanvas.restore();
sHolographicOutlineHelper.applyThickExpensiveOutlineWithBlur(outline,
@@ -120,14 +124,12 @@ public class PagedViewWidget extends LinearLayout {
}
private void queueHolographicOutlineCreation() {
- /* Temporarily disabling holographic outline creation.
// Generate the outline in the background
if (mHolographicOutline == null) {
Message m = sWorker.obtainMessage(MESSAGE_CREATE_HOLOGRAPHIC_OUTLINE);
m.obj = this;
sWorker.sendMessage(m);
}
- */
}
public void applyFromAppWidgetProviderInfo(AppWidgetProviderInfo info,