am 5130e401: Move haptic feedback on All Apps button to touch down
* commit '5130e401a005fcf6afba6e8e72a628fc45f9a287': Move haptic feedback on All Apps button to touch down
This commit is contained in:
commit
2dcda1f72c
3 files changed
+32
-3
No files matched your search
@@ -21,6 +21,7 @@ import android.content.res.Configuration;
|
|||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
|
|
||||||
@@ -103,6 +104,17 @@ public class Hotseat extends FrameLayout {
|
|||||||
context.getResources().getDrawable(R.drawable.all_apps_button_icon), null, null);
|
context.getResources().getDrawable(R.drawable.all_apps_button_icon), null, null);
|
||||||
// allAppsButton.setText(context.getString(R.string.all_apps_button_label));
|
// allAppsButton.setText(context.getString(R.string.all_apps_button_label));
|
||||||
allAppsButton.setContentDescription(context.getString(R.string.all_apps_button_label));
|
allAppsButton.setContentDescription(context.getString(R.string.all_apps_button_label));
|
||||||
|
allAppsButton.setOnTouchListener(new View.OnTouchListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onTouch(View v, MotionEvent event) {
|
||||||
|
if (mLauncher != null &&
|
||||||
|
(event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_DOWN) {
|
||||||
|
mLauncher.onTouchDownAllAppsButton(v);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
allAppsButton.setOnClickListener(new View.OnClickListener() {
|
allAppsButton.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(android.view.View v) {
|
public void onClick(android.view.View v) {
|
||||||
|
|||||||
@@ -749,8 +749,19 @@ public final class Launcher extends Activity
|
|||||||
mAppsCustomizeTabHost.findViewById(R.id.apps_customize_pane_content);
|
mAppsCustomizeTabHost.findViewById(R.id.apps_customize_pane_content);
|
||||||
mAppsCustomizeContent.setup(this, dragController);
|
mAppsCustomizeContent.setup(this, dragController);
|
||||||
|
|
||||||
|
// Get the all apps button
|
||||||
|
mAllAppsButton = findViewById(R.id.all_apps_button);
|
||||||
|
if (mAllAppsButton != null) {
|
||||||
|
mAllAppsButton.setOnTouchListener(new View.OnTouchListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onTouch(View v, MotionEvent event) {
|
||||||
|
if ((event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_DOWN) {
|
||||||
|
onTouchDownAllAppsButton(v);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
// Setup the drag controller (drop targets have to be added in reverse order in priority)
|
// Setup the drag controller (drop targets have to be added in reverse order in priority)
|
||||||
dragController.setDragScoller(mWorkspace);
|
dragController.setDragScoller(mWorkspace);
|
||||||
dragController.setScrollView(mDragLayer);
|
dragController.setScrollView(mDragLayer);
|
||||||
@@ -1731,9 +1742,12 @@ public final class Launcher extends Activity
|
|||||||
* @param v The view that was clicked.
|
* @param v The view that was clicked.
|
||||||
*/
|
*/
|
||||||
public void onClickAllAppsButton(View v) {
|
public void onClickAllAppsButton(View v) {
|
||||||
|
showAllApps(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onTouchDownAllAppsButton(View v) {
|
||||||
// Provide the same haptic feedback that the system offers for virtual keys.
|
// Provide the same haptic feedback that the system offers for virtual keys.
|
||||||
v.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
|
v.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
|
||||||
showAllApps(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClickAppMarketButton(View v) {
|
public void onClickAppMarketButton(View v) {
|
||||||
|
|||||||
@@ -602,6 +602,9 @@ public class LauncherProvider extends ContentProvider {
|
|||||||
if (c != null && c.moveToNext()) {
|
if (c != null && c.moveToNext()) {
|
||||||
id = c.getLong(maxIdIndex);
|
id = c.getLong(maxIdIndex);
|
||||||
}
|
}
|
||||||
|
if (c != null) {
|
||||||
|
c.close();
|
||||||
|
}
|
||||||
|
|
||||||
if (id == -1) {
|
if (id == -1) {
|
||||||
throw new RuntimeException("Error: could not query max id");
|
throw new RuntimeException("Error: could not query max id");
|
||||||
|
|||||||
Reference in new issue
Block a user