mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 08:16:49 +00:00
Adding new assets.
Change-Id: I20c8ceae997290781923caf195f6f87e283b1b7f
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user