summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2011-06-01 12:35:55 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-06-01 12:35:55 -0700
commit5cf73001ae38d7ba7e911327764f04b95ed84921 (patch)
tree4b3b33ace4175bacae6422af5692418cb4881553 /src
parent62ddd762cec472b2890dbf8e1b5228cb1696e129 (diff)
parent4179b4e048dd019daca053dc3a7eddf6c464b08b (diff)
downloadandroid_packages_apps_Trebuchet-5cf73001ae38d7ba7e911327764f04b95ed84921.tar.gz
android_packages_apps_Trebuchet-5cf73001ae38d7ba7e911327764f04b95ed84921.tar.bz2
android_packages_apps_Trebuchet-5cf73001ae38d7ba7e911327764f04b95ed84921.zip
Merge "Fixing translateable attribute in strings, and click-through in AppsCustomize."
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher2/AppsCustomizeTabHost.java25
-rw-r--r--src/com/android/launcher2/Workspace.java13
2 files changed, 27 insertions, 11 deletions
diff --git a/src/com/android/launcher2/AppsCustomizeTabHost.java b/src/com/android/launcher2/AppsCustomizeTabHost.java
index 120317795..e40524d3c 100644
--- a/src/com/android/launcher2/AppsCustomizeTabHost.java
+++ b/src/com/android/launcher2/AppsCustomizeTabHost.java
@@ -20,6 +20,7 @@ import android.content.Context;
import android.content.res.Resources;
import android.util.AttributeSet;
import android.view.LayoutInflater;
+import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TabHost;
@@ -35,6 +36,7 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
private static final String WIDGETS_TAB_TAG = "WIDGETS";
private final LayoutInflater mLayoutInflater;
+ private AppsCustomizePagedView mAppsCustomizePane;
public AppsCustomizeTabHost(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -57,15 +59,16 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
setup();
final ViewGroup tabs = (ViewGroup) findViewById(com.android.internal.R.id.tabs);
- final AppsCustomizePagedView content = (AppsCustomizePagedView)
+ final AppsCustomizePagedView appsCustomizePane = (AppsCustomizePagedView)
findViewById(R.id.apps_customize_pane_content);
- if (tabs == null || content == null) throw new Resources.NotFoundException();
+ mAppsCustomizePane = appsCustomizePane;
+ if (tabs == null || mAppsCustomizePane == null) throw new Resources.NotFoundException();
// Configure the tabs content factory to return the same paged view (that we change the
// content filter on)
TabContentFactory contentFactory = new TabContentFactory() {
public View createTabContent(String tag) {
- return content;
+ return appsCustomizePane;
}
};
@@ -80,14 +83,22 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
setOnTabChangedListener(this);
// Set the width of the tab bar to match the content (for now)
- tabs.getLayoutParams().width = content.getPageContentWidth();
+ tabs.getLayoutParams().width = mAppsCustomizePane.getPageContentWidth();
+ }
+
+ @Override
+ public boolean onTouchEvent(MotionEvent event) {
+ // Intercept all touch events up to the bottom of the AppsCustomizePane so they do not fall
+ // through to the workspace and trigger showWorkspace()
+ if (event.getY() < mAppsCustomizePane.getBottom()) {
+ return true;
+ }
+ return super.onTouchEvent(event);
}
@Override
public void onTabChanged(String tabId) {
- final AppsCustomizePagedView content = (AppsCustomizePagedView)
- findViewById(R.id.apps_customize_pane_content);
- content.setContentType(getContentTypeForTabTag(tabId));
+ mAppsCustomizePane.setContentType(getContentTypeForTabTag(tabId));
}
/**
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index f3535f143..f61bb5cc1 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -623,10 +623,15 @@ public class Workspace extends SmoothPagedView
if (mLauncher.isAllAppsVisible() && mShrinkState == ShrinkState.BOTTOM_HIDDEN) {
// Intercept this event so we can show the workspace in full view
// when it is clicked on and it is small
- AllAppsPagedView allApps = (AllAppsPagedView)
- mLauncher.findViewById(R.id.all_apps_paged_view);
- if (allApps != null) {
- allApps.onInterceptTouchEvent(ev);
+ PagedView appsPane = null;
+ if (LauncherApplication.isScreenLarge()) {
+ appsPane = (PagedView) mLauncher.findViewById(R.id.all_apps_paged_view);
+ } else {
+ appsPane = (PagedView) mLauncher.findViewById(R.id.apps_customize_pane_content);
+ }
+
+ if (appsPane != null) {
+ appsPane.onInterceptTouchEvent(ev);
}
return true;
}