summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/CustomizeTrayTabHost.java
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2011-05-17 18:21:03 -0700
committerMichael Jurka <mikejurka@google.com>2011-05-18 14:24:52 -0700
commit4c6016fab10685eea750c092f1ffa3e862c85df2 (patch)
treee14cba7d3f84490aae7e3fbc0a35c18d4a795af2 /src/com/android/launcher2/CustomizeTrayTabHost.java
parentd1d48a68409c5f0777e608f83950b41a2306f3f3 (diff)
downloadandroid_packages_apps_Trebuchet-4c6016fab10685eea750c092f1ffa3e862c85df2.tar.gz
android_packages_apps_Trebuchet-4c6016fab10685eea750c092f1ffa3e862c85df2.tar.bz2
android_packages_apps_Trebuchet-4c6016fab10685eea750c092f1ffa3e862c85df2.zip
Allow determining # of rows/columns for All Apps and Customize at run time
Diffstat (limited to 'src/com/android/launcher2/CustomizeTrayTabHost.java')
-rw-r--r--src/com/android/launcher2/CustomizeTrayTabHost.java29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/com/android/launcher2/CustomizeTrayTabHost.java b/src/com/android/launcher2/CustomizeTrayTabHost.java
index 2c47895d2..ab50cf161 100644
--- a/src/com/android/launcher2/CustomizeTrayTabHost.java
+++ b/src/com/android/launcher2/CustomizeTrayTabHost.java
@@ -115,17 +115,6 @@ public class CustomizeTrayTabHost extends TabHost implements LauncherTransitiona
}
}
});
-
- // Set the width of the tab bar properly
- int pageWidth = customizePagedView.getPageContentWidth();
- TabWidget customizeTabBar = (TabWidget) findViewById(com.android.internal.R.id.tabs);
- if (customizeTabBar == null) throw new Resources.NotFoundException();
- int tabWidgetPadding = 0;
- final int childCount = tabWidget.getChildCount();
- if (childCount > 0) {
- tabWidgetPadding += tabWidget.getChildAt(0).getPaddingLeft() * 2;
- }
- customizeTabBar.getLayoutParams().width = pageWidth + tabWidgetPadding;
}
@Override
@@ -150,7 +139,23 @@ public class CustomizeTrayTabHost extends TabHost implements LauncherTransitiona
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
- mFirstLayout = false;
+ if (mFirstLayout) {
+ mFirstLayout = false;
+
+ final CustomizePagedView customizePagedView =
+ (CustomizePagedView) findViewById(R.id.customization_drawer_tab_contents);
+ TabWidget tabWidget = (TabWidget) findViewById(com.android.internal.R.id.tabs);
+ // Set the width of the tab bar properly
+ int pageWidth = customizePagedView.getPageContentWidth();
+ TabWidget customizeTabBar = (TabWidget) findViewById(com.android.internal.R.id.tabs);
+ if (customizeTabBar == null) throw new Resources.NotFoundException();
+ int tabWidgetPadding = 0;
+ final int childCount = tabWidget.getChildCount();
+ if (childCount > 0) {
+ tabWidgetPadding += tabWidget.getChildAt(0).getPaddingLeft() * 2;
+ }
+ customizeTabBar.getLayoutParams().width = pageWidth + tabWidgetPadding;
+ }
super.onLayout(changed, l, t, r, b);
}