Updating the icon click feedback
> Using BubbleTextView everywhere, removed PagedIconView > There is a brightness feedback on touch and shadow feedback on click, until app launches issue: 16878374 Change-Id: I3dc1149a123c8a75feca6210948398bf2187f1f2
This commit is contained in:
1 parent
f8177d383a
commit
508da15509
16 files changed
+393
-579
No files matched your search
@@ -82,7 +82,6 @@ import android.view.Surface;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.View.OnLongClickListener;
|
||||
import android.view.ViewAnimationUtils;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
|
||||
@@ -1026,10 +1025,6 @@ public class Launcher extends Activity
|
||||
// Resets the previous workspace icon press state
|
||||
mWaitingForResume.setStayPressed(false);
|
||||
}
|
||||
if (mAppsCustomizeContent != null) {
|
||||
// Resets the previous all apps icon press state
|
||||
mAppsCustomizeContent.resetDrawableState();
|
||||
}
|
||||
|
||||
// It is possible that widgets can receive updates while launcher is not in the foreground.
|
||||
// Consequently, the widgets will be inflated in the orientation of the foreground activity
|
||||
@@ -2451,6 +2446,8 @@ public class Launcher extends Activity
|
||||
}
|
||||
} else if (v == mAllAppsButton) {
|
||||
onClickAllAppsButton(v);
|
||||
} else if (tag instanceof AppInfo) {
|
||||
startAppShortcutOrInfoActivity(v);
|
||||
} else if (tag instanceof LauncherAppWidgetInfo) {
|
||||
if (v instanceof PendingAppWidgetHostView) {
|
||||
onClickPendingWidget((PendingAppWidgetHostView) v);
|
||||
@@ -2458,6 +2455,10 @@ public class Launcher extends Activity
|
||||
}
|
||||
}
|
||||
|
||||
public void onClickPagedViewIcon(View v) {
|
||||
startAppShortcutOrInfoActivity(v);
|
||||
}
|
||||
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
return false;
|
||||
}
|
||||
@@ -2538,17 +2539,6 @@ public class Launcher extends Activity
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Event handler for a paged view icon click.
|
||||
* @param v The view that was clicked.
|
||||
* @param appInfo The {link AppInfo} of the view.
|
||||
*/
|
||||
public void onClickPagedViewIcon(View v, AppInfo appInfo) {
|
||||
if (LOGD) Log.d(TAG, "onClickPagedViewIcon");
|
||||
startActivitySafely(v, appInfo.intent, appInfo);
|
||||
getStats().recordLaunch(appInfo.intent);
|
||||
}
|
||||
|
||||
/**
|
||||
* Event handler for an app shortcut click.
|
||||
*
|
||||
@@ -2586,7 +2576,7 @@ public class Launcher extends Activity
|
||||
builder.setPositiveButton(R.string.abandoned_search,
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
startAppShortcutActivity(v);
|
||||
startAppShortcutOrInfoActivity(v);
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -2603,24 +2593,29 @@ public class Launcher extends Activity
|
||||
}
|
||||
|
||||
// Start activities
|
||||
startAppShortcutActivity(v);
|
||||
startAppShortcutOrInfoActivity(v);
|
||||
}
|
||||
|
||||
private void startAppShortcutActivity(View v) {
|
||||
private void startAppShortcutOrInfoActivity(View v) {
|
||||
Object tag = v.getTag();
|
||||
if (!(tag instanceof ShortcutInfo)) {
|
||||
throw new IllegalArgumentException("Input must be a Shortcut");
|
||||
}
|
||||
final ShortcutInfo shortcut = (ShortcutInfo) tag;
|
||||
final Intent intent = shortcut.intent;
|
||||
final ShortcutInfo shortcut;
|
||||
final Intent intent;
|
||||
if (tag instanceof ShortcutInfo) {
|
||||
shortcut = (ShortcutInfo) tag;
|
||||
intent = shortcut.intent;
|
||||
int[] pos = new int[2];
|
||||
v.getLocationOnScreen(pos);
|
||||
intent.setSourceBounds(new Rect(pos[0], pos[1],
|
||||
pos[0] + v.getWidth(), pos[1] + v.getHeight()));
|
||||
|
||||
int[] pos = new int[2];
|
||||
v.getLocationOnScreen(pos);
|
||||
intent.setSourceBounds(new Rect(pos[0], pos[1],
|
||||
pos[0] + v.getWidth(), pos[1] + v.getHeight()));
|
||||
} else if (tag instanceof AppInfo) {
|
||||
shortcut = null;
|
||||
intent = ((AppInfo) tag).intent;
|
||||
} else {
|
||||
throw new IllegalArgumentException("Input must be a Shortcut or AppInfo");
|
||||
}
|
||||
|
||||
boolean success = startActivitySafely(v, intent, tag);
|
||||
|
||||
mStats.recordLaunch(intent, shortcut);
|
||||
|
||||
if (success && v instanceof BubbleTextView) {
|
||||
|
||||
Reference in new issue
Block a user