making size of delete zone & info button larger

- only on XLarge devices
- make application info button inactive when its not visible
- making scroll right "dead" zone bigger so users don't trigger accidental scroll when deleting items

Change-Id: I474de710a80b165d2ce1553c9231a829679132b2
This commit is contained in:
Michael Jurka
2010-10-15 18:07:21 -07:00
parent ab1d8b96f7
commit 3adcb0c4a3
2 changed files with 39 additions and 9 deletions
@@ -21,6 +21,7 @@ import android.content.Context;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;
@@ -98,9 +99,8 @@ public class ApplicationInfoDropTarget extends ImageView implements DropTarget,
public void onDragStart(DragSource source, Object info, int dragAction) {
if (info != null) {
mActive = true;
if (mManageVisibility) {
mActive = true;
// Only show the info icon when an application is selected
if (((ItemInfo)info).itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION) {
setVisibility(VISIBLE);
@@ -111,7 +111,7 @@ public class ApplicationInfoDropTarget extends ImageView implements DropTarget,
}
public boolean isDropEnabled() {
return true;
return mActive;
}
public void onDragEnd() {
@@ -124,6 +124,17 @@ public class ApplicationInfoDropTarget extends ImageView implements DropTarget,
}
}
@Override
public void getHitRect(Rect outRect) {
super.getHitRect(outRect);
if (LauncherApplication.isScreenXLarge()) {
outRect.top -= 50;
outRect.left -= 50;
outRect.bottom += 50;
outRect.right += 50;
}
}
void setLauncher(Launcher launcher) {
mLauncher = launcher;
}