summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher2/AppsCustomizeTabHost.java9
-rw-r--r--src/com/android/launcher2/Hotseat.java12
-rw-r--r--src/com/android/launcher2/Launcher.java27
-rw-r--r--src/com/android/launcher2/LauncherProvider.java3
4 files changed, 44 insertions, 7 deletions
diff --git a/src/com/android/launcher2/AppsCustomizeTabHost.java b/src/com/android/launcher2/AppsCustomizeTabHost.java
index 25f67cb48..404b088dc 100644
--- a/src/com/android/launcher2/AppsCustomizeTabHost.java
+++ b/src/com/android/launcher2/AppsCustomizeTabHost.java
@@ -108,11 +108,16 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
// Create the tabs
TextView tabView;
+ String label;
+ label = mContext.getString(R.string.all_apps_button_label);
tabView = (TextView) mLayoutInflater.inflate(R.layout.tab_widget_indicator, tabs, false);
- tabView.setText(mContext.getString(R.string.all_apps_button_label));
+ tabView.setText(label);
+ tabView.setContentDescription(label);
addTab(newTabSpec(APPS_TAB_TAG).setIndicator(tabView).setContent(contentFactory));
+ label = mContext.getString(R.string.widgets_tab_label);
tabView = (TextView) mLayoutInflater.inflate(R.layout.tab_widget_indicator, tabs, false);
- tabView.setText(mContext.getString(R.string.widgets_tab_label));
+ tabView.setText(label);
+ tabView.setContentDescription(label);
addTab(newTabSpec(WIDGETS_TAB_TAG).setIndicator(tabView).setContent(contentFactory));
setOnTabChangedListener(this);
diff --git a/src/com/android/launcher2/Hotseat.java b/src/com/android/launcher2/Hotseat.java
index f1fb6ab1c..f7fa38007 100644
--- a/src/com/android/launcher2/Hotseat.java
+++ b/src/com/android/launcher2/Hotseat.java
@@ -21,6 +21,7 @@ import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.LayoutInflater;
+import android.view.MotionEvent;
import android.view.View;
import android.widget.FrameLayout;
@@ -103,6 +104,17 @@ public class Hotseat extends FrameLayout {
context.getResources().getDrawable(R.drawable.all_apps_button_icon), null, null);
// allAppsButton.setText(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() {
@Override
public void onClick(android.view.View v) {
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 6d95555a1..dc7b77e86 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -246,7 +246,9 @@ public final class Launcher extends Activity
private Runnable mBuildLayersRunnable = new Runnable() {
public void run() {
- mWorkspace.buildPageHardwareLayers();
+ if (mWorkspace != null) {
+ mWorkspace.buildPageHardwareLayers();
+ }
}
};
@@ -559,6 +561,7 @@ public final class Launcher extends Activity
if (!mWorkspaceLoading) {
mWorkspace.post(mBuildLayersRunnable);
}
+ clearTypedText();
}
@Override
@@ -748,8 +751,19 @@ public final class Launcher extends Activity
mAppsCustomizeTabHost.findViewById(R.id.apps_customize_pane_content);
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)
dragController.setDragScoller(mWorkspace);
dragController.setScrollView(mDragLayer);
@@ -1248,6 +1262,7 @@ public final class Launcher extends Activity
// Remove all pending runnables
mHandler.removeMessages(ADVANCE_MSG);
mHandler.removeMessages(0);
+ mWorkspace.removeCallbacks(mBuildLayersRunnable);
// Stop callbacks from LauncherModel
LauncherApplication app = ((LauncherApplication) getApplication());
@@ -1302,7 +1317,6 @@ public final class Launcher extends Activity
if (initialQuery == null) {
// Use any text typed in the launcher as the initial query
initialQuery = getTypedText();
- clearTypedText();
}
if (appSearchData == null) {
appSearchData = new Bundle();
@@ -1731,9 +1745,12 @@ public final class Launcher extends Activity
* @param v The view that was clicked.
*/
public void onClickAllAppsButton(View v) {
+ showAllApps(true);
+ }
+
+ public void onTouchDownAllAppsButton(View v) {
// Provide the same haptic feedback that the system offers for virtual keys.
v.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
- showAllApps(true);
}
public void onClickAppMarketButton(View v) {
diff --git a/src/com/android/launcher2/LauncherProvider.java b/src/com/android/launcher2/LauncherProvider.java
index 53f7b428b..6cec101ab 100644
--- a/src/com/android/launcher2/LauncherProvider.java
+++ b/src/com/android/launcher2/LauncherProvider.java
@@ -602,6 +602,9 @@ public class LauncherProvider extends ContentProvider {
if (c != null && c.moveToNext()) {
id = c.getLong(maxIdIndex);
}
+ if (c != null) {
+ c.close();
+ }
if (id == -1) {
throw new RuntimeException("Error: could not query max id");