summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2011-06-30 18:09:30 -0700
committerWinson Chung <winsonc@google.com>2011-07-01 12:33:32 -0700
commit967289b6d5fec77f5c381d11ffb2319f3bb5e737 (patch)
tree4cee018390432723fb9526a8bf744a5a0a5b9b6a /src/com
parent3ac74c55cf8baef29db80e8c67ab4ab033b04417 (diff)
downloadandroid_packages_apps_Trebuchet-967289b6d5fec77f5c381d11ffb2319f3bb5e737.tar.gz
android_packages_apps_Trebuchet-967289b6d5fec77f5c381d11ffb2319f3bb5e737.tar.bz2
android_packages_apps_Trebuchet-967289b6d5fec77f5c381d11ffb2319f3bb5e737.zip
Adding new assets.
Change-Id: I20c8ceae997290781923caf195f6f87e283b1b7f
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/launcher2/AppsCustomizePagedView.java2
-rw-r--r--src/com/android/launcher2/CellLayout.java6
-rw-r--r--src/com/android/launcher2/DeleteDropTarget.java18
-rw-r--r--src/com/android/launcher2/InfoDropTarget.java17
-rw-r--r--src/com/android/launcher2/Launcher.java2
-rw-r--r--src/com/android/launcher2/Workspace.java4
6 files changed, 19 insertions, 30 deletions
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java
index 35ca3e9a1..2a4af4496 100644
--- a/src/com/android/launcher2/AppsCustomizePagedView.java
+++ b/src/com/android/launcher2/AppsCustomizePagedView.java
@@ -204,7 +204,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
// Save the default widget preview background
Resources resources = context.getResources();
- mDefaultWidgetBackground = resources.getDrawable(R.drawable.default_widget_preview);
+ mDefaultWidgetBackground = resources.getDrawable(R.drawable.default_widget_preview_holo);
mAppIconSize = getResources().getDimensionPixelSize(R.dimen.app_icon_size);
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.PagedView, 0, 0);
diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java
index 99d62aed9..a9cdb8790 100644
--- a/src/com/android/launcher2/CellLayout.java
+++ b/src/com/android/launcher2/CellLayout.java
@@ -163,9 +163,9 @@ public class CellLayout extends ViewGroup {
final Resources res = getResources();
- mNormalBackground = res.getDrawable(R.drawable.homescreen_large_blue);
- mActiveBackground = res.getDrawable(R.drawable.homescreen_large_green);
- mActiveGlowBackground = res.getDrawable(R.drawable.homescreen_large_green_strong);
+ mNormalBackground = res.getDrawable(R.drawable.homescreen_blue_normal_holo);
+ mActiveBackground = res.getDrawable(R.drawable.homescreen_green_normal_holo);
+ mActiveGlowBackground = res.getDrawable(R.drawable.homescreen_green_strong_holo);
mNormalBackgroundMini = res.getDrawable(R.drawable.homescreen_small_blue);
mNormalGlowBackgroundMini = res.getDrawable(R.drawable.homescreen_small_blue_strong);
diff --git a/src/com/android/launcher2/DeleteDropTarget.java b/src/com/android/launcher2/DeleteDropTarget.java
index a30c03e66..6e01bc0c4 100644
--- a/src/com/android/launcher2/DeleteDropTarget.java
+++ b/src/com/android/launcher2/DeleteDropTarget.java
@@ -16,16 +16,14 @@
package com.android.launcher2;
-import android.animation.ObjectAnimator;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
-import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
+import android.graphics.drawable.TransitionDrawable;
import android.util.AttributeSet;
import android.view.View;
-import android.view.ViewGroup;
import android.widget.TextView;
import com.android.launcher.R;
@@ -33,6 +31,7 @@ import com.android.launcher.R;
public class DeleteDropTarget extends ButtonDropTarget {
private TextView mText;
+ private TransitionDrawable mDrawable;
private int mHoverColor = 0xFFFF0000;
public DeleteDropTarget(Context context, AttributeSet attrs) {
@@ -55,8 +54,8 @@ public class DeleteDropTarget extends ButtonDropTarget {
mHoverColor = r.getColor(R.color.delete_target_hover_tint);
mHoverPaint.setColorFilter(new PorterDuffColorFilter(
mHoverColor, PorterDuff.Mode.SRC_ATOP));
- setBackgroundColor(mHoverColor);
- getBackground().setAlpha(0);
+ mDrawable = (TransitionDrawable) mText.getCompoundDrawables()[0];
+ mDrawable.setCrossFadeEnabled(true);
// Remove the text in the Phone UI in landscape
int orientation = getResources().getConfiguration().orientation;
@@ -127,18 +126,13 @@ public class DeleteDropTarget extends ButtonDropTarget {
public void onDragEnter(DragObject d) {
super.onDragEnter(d);
- ObjectAnimator anim = ObjectAnimator.ofInt(getBackground(), "alpha",
- Color.alpha(mHoverColor));
- anim.setDuration(mTransitionDuration);
- anim.start();
+ mDrawable.startTransition(mTransitionDuration);
}
public void onDragExit(DragObject d) {
super.onDragExit(d);
- ObjectAnimator anim = ObjectAnimator.ofInt(getBackground(), "alpha", 0);
- anim.setDuration(mTransitionDuration);
- anim.start();
+ mDrawable.resetTransition();
}
public void onDrop(DragObject d) {
diff --git a/src/com/android/launcher2/InfoDropTarget.java b/src/com/android/launcher2/InfoDropTarget.java
index 76a6bf926..c7812e3de 100644
--- a/src/com/android/launcher2/InfoDropTarget.java
+++ b/src/com/android/launcher2/InfoDropTarget.java
@@ -16,14 +16,13 @@
package com.android.launcher2;
-import android.animation.ObjectAnimator;
import android.content.ComponentName;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
-import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
+import android.graphics.drawable.TransitionDrawable;
import android.util.AttributeSet;
import android.view.View;
import android.widget.TextView;
@@ -33,6 +32,7 @@ import com.android.launcher.R;
public class InfoDropTarget extends ButtonDropTarget {
private TextView mText;
+ private TransitionDrawable mDrawable;
private int mHoverColor = 0xFF0000FF;
public InfoDropTarget(Context context, AttributeSet attrs) {
@@ -54,8 +54,8 @@ public class InfoDropTarget extends ButtonDropTarget {
mHoverColor = r.getColor(R.color.info_target_hover_tint);
mHoverPaint.setColorFilter(new PorterDuffColorFilter(
mHoverColor, PorterDuff.Mode.SRC_ATOP));
- setBackgroundColor(mHoverColor);
- getBackground().setAlpha(0);
+ mDrawable = (TransitionDrawable) mText.getCompoundDrawables()[0];
+ mDrawable.setCrossFadeEnabled(true);
// Remove the text in the Phone UI in landscape
int orientation = getResources().getConfiguration().orientation;
@@ -109,17 +109,12 @@ public class InfoDropTarget extends ButtonDropTarget {
public void onDragEnter(DragObject d) {
super.onDragEnter(d);
- ObjectAnimator anim = ObjectAnimator.ofInt(getBackground(), "alpha",
- Color.alpha(mHoverColor));
- anim.setDuration(mTransitionDuration);
- anim.start();
+ mDrawable.startTransition(mTransitionDuration);
}
public void onDragExit(DragObject d) {
super.onDragExit(d);
- ObjectAnimator anim = ObjectAnimator.ofInt(getBackground(), "alpha", 0);
- anim.setDuration(mTransitionDuration);
- anim.start();
+ mDrawable.resetTransition();
}
}
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 0fb24f6e6..0a57185bb 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -2809,7 +2809,7 @@ public final class Launcher extends Activity
if (activityName != null) {
mAppMarketIntent = intent;
sAppMarketIcon = updateTextButtonWithIconFromExternalActivity(
- R.id.market_button, activityName, R.drawable.app_market_generic);
+ R.id.market_button, activityName, R.drawable.ic_launcher_market_holo);
marketButton.setVisibility(View.VISIBLE);
// Remove the shop icon text in the Phone UI
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index 2b799ee63..e1e26a149 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -1240,11 +1240,11 @@ public class Workspace extends SmoothPagedView
final CellLayout rightPage = (CellLayout) getChildAt(mCurrentPage + 1);
if (leftPage != null && leftPage.getIsDragOverlapping()) {
- final Drawable d = getResources().getDrawable(R.drawable.page_hover_left);
+ final Drawable d = getResources().getDrawable(R.drawable.page_hover_left_holo);
d.setBounds(mScrollX, padding, mScrollX + d.getIntrinsicWidth(), height - padding);
d.draw(canvas);
} else if (rightPage != null && rightPage.getIsDragOverlapping()) {
- final Drawable d = getResources().getDrawable(R.drawable.page_hover_right);
+ final Drawable d = getResources().getDrawable(R.drawable.page_hover_right_holo);
d.setBounds(mScrollX + width - d.getIntrinsicWidth(), padding, mScrollX + width, height - padding);
d.draw(canvas);
}