am 61f560d9: Fixing AllApps pressed state (issue 10845969)
* commit '61f560d92ab4b11a61beeb8df97b9952027e08e4': Fixing AllApps pressed state (issue 10845969)
This commit is contained in:
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Copyright (C) 2008 The Android Open Source Project
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
style="@style/WorkspaceIcon"
|
||||||
|
android:focusable="true"
|
||||||
|
android:background="@drawable/focusable_view_bg" />
|
||||||
@@ -28,6 +28,7 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
@@ -126,27 +127,17 @@ public class Hotseat extends FrameLayout {
|
|||||||
// Add the Apps button
|
// Add the Apps button
|
||||||
Context context = getContext();
|
Context context = getContext();
|
||||||
|
|
||||||
Drawable rawIcon =
|
|
||||||
context.getResources().getDrawable(R.drawable.all_apps_button_icon);
|
|
||||||
Bitmap icon = Utilities.createIconBitmap(rawIcon, context);
|
|
||||||
|
|
||||||
LayoutInflater inflater = LayoutInflater.from(context);
|
LayoutInflater inflater = LayoutInflater.from(context);
|
||||||
BubbleTextView allAppsButton = (BubbleTextView)
|
TextView allAppsButton = (TextView)
|
||||||
inflater.inflate(R.layout.application, mContent, false);
|
inflater.inflate(R.layout.all_apps_button, mContent, false);
|
||||||
allAppsButton.setCompoundDrawablesWithIntrinsicBounds(null,
|
Drawable d = context.getResources().getDrawable(R.drawable.all_apps_button_icon);
|
||||||
new FastBitmapDrawable(icon), null, null);
|
d.setBounds(0, 0, Utilities.sIconTextureWidth, Utilities.sIconTextureHeight);
|
||||||
allAppsButton.setContentDescription(context.getString(R.string.all_apps_button_label));
|
allAppsButton.setCompoundDrawables(null, d, null, null);
|
||||||
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.setContentDescription(context.getString(R.string.all_apps_button_label));
|
||||||
|
if (mLauncher != null) {
|
||||||
|
allAppsButton.setOnTouchListener(mLauncher.getHapticFeedbackTouchListener());
|
||||||
|
}
|
||||||
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) {
|
||||||
|
|||||||
@@ -281,6 +281,8 @@ public class Launcher extends Activity
|
|||||||
|
|
||||||
private static HashMap<Long, FolderInfo> sFolders = new HashMap<Long, FolderInfo>();
|
private static HashMap<Long, FolderInfo> sFolders = new HashMap<Long, FolderInfo>();
|
||||||
|
|
||||||
|
private View.OnTouchListener mHapticFeedbackTouchListener;
|
||||||
|
|
||||||
// Related to the auto-advancing of widgets
|
// Related to the auto-advancing of widgets
|
||||||
private final int ADVANCE_MSG = 1;
|
private final int ADVANCE_MSG = 1;
|
||||||
private final int mAdvanceInterval = 20000;
|
private final int mAdvanceInterval = 20000;
|
||||||
@@ -1148,24 +1150,32 @@ public class Launcher extends Activity
|
|||||||
}
|
}
|
||||||
|
|
||||||
mOverviewPanel = findViewById(R.id.overview_panel);
|
mOverviewPanel = findViewById(R.id.overview_panel);
|
||||||
findViewById(R.id.widget_button).setOnClickListener(new OnClickListener() {
|
View widgetButton = findViewById(R.id.widget_button);
|
||||||
|
widgetButton.setOnClickListener(new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View arg0) {
|
public void onClick(View arg0) {
|
||||||
showAllApps(true, AppsCustomizePagedView.ContentType.Widgets);
|
showAllApps(true, AppsCustomizePagedView.ContentType.Widgets);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
findViewById(R.id.wallpaper_button).setOnClickListener(new OnClickListener() {
|
widgetButton.setOnTouchListener(getHapticFeedbackTouchListener());
|
||||||
|
|
||||||
|
View wallpaperButton = findViewById(R.id.wallpaper_button);
|
||||||
|
wallpaperButton.setOnClickListener(new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View arg0) {
|
public void onClick(View arg0) {
|
||||||
startWallpaper();
|
startWallpaper();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
findViewById(R.id.settings_button).setOnClickListener(new OnClickListener() {
|
wallpaperButton.setOnTouchListener(getHapticFeedbackTouchListener());
|
||||||
|
|
||||||
|
View settingsButton = findViewById(R.id.settings_button);
|
||||||
|
settingsButton.setOnClickListener(new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View arg0) {
|
public void onClick(View arg0) {
|
||||||
startSettings();
|
startSettings();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
settingsButton.setOnTouchListener(getHapticFeedbackTouchListener());
|
||||||
mOverviewPanel.setAlpha(0f);
|
mOverviewPanel.setAlpha(0f);
|
||||||
|
|
||||||
// Setup the workspace
|
// Setup the workspace
|
||||||
@@ -2274,6 +2284,26 @@ public class Launcher extends Activity
|
|||||||
v.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
|
v.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void performHapticFeedbackOnTouchDown(View v) {
|
||||||
|
// Provide the same haptic feedback that the system offers for virtual keys.
|
||||||
|
v.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
|
||||||
|
}
|
||||||
|
|
||||||
|
public View.OnTouchListener getHapticFeedbackTouchListener() {
|
||||||
|
if (mHapticFeedbackTouchListener == null) {
|
||||||
|
mHapticFeedbackTouchListener = new View.OnTouchListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onTouch(View v, MotionEvent event) {
|
||||||
|
if ((event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_DOWN) {
|
||||||
|
v.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return mHapticFeedbackTouchListener;
|
||||||
|
}
|
||||||
|
|
||||||
public void onClickAppMarketButton(View v) {
|
public void onClickAppMarketButton(View v) {
|
||||||
if (!DISABLE_MARKET_BUTTON) {
|
if (!DISABLE_MARKET_BUTTON) {
|
||||||
if (mAppMarketIntent != null) {
|
if (mAppMarketIntent != null) {
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ final class Utilities {
|
|||||||
|
|
||||||
private static int sIconWidth = -1;
|
private static int sIconWidth = -1;
|
||||||
private static int sIconHeight = -1;
|
private static int sIconHeight = -1;
|
||||||
private static int sIconTextureWidth = -1;
|
public static int sIconTextureWidth = -1;
|
||||||
private static int sIconTextureHeight = -1;
|
public static int sIconTextureHeight = -1;
|
||||||
|
|
||||||
private static final Paint sBlurPaint = new Paint();
|
private static final Paint sBlurPaint = new Paint();
|
||||||
private static final Paint sGlowColorPressedPaint = new Paint();
|
private static final Paint sGlowColorPressedPaint = new Paint();
|
||||||
|
|||||||
Reference in New Issue
Block a user