Made Launcher and AllApps use the new Tabs holo theme.
Style temp settings removed, now provided by default:
https://android-git.corp.google.com/g/#change,76118
Hacks to focus first tab removed as it has been fixed in:
https://android-git.corp.google.com/g/#change,75393
Bug 3008765
Change-Id: Id9121cf3bfc3be08380bec1a45cf447b5fe96422
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index baec7e3..9eddbf2 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -17,15 +17,15 @@
package com.android.launcher2;
-import android.animation.Animator;
-import android.animation.AnimatorListenerAdapter;
-import android.animation.ValueAnimator;
import com.android.common.Search;
import com.android.launcher.R;
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
+import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
-import android.animation.AnimatorSet;
+import android.animation.ValueAnimator;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
@@ -53,7 +53,6 @@
import android.database.ContentObserver;
import android.graphics.Bitmap;
import android.graphics.Canvas;
-import android.graphics.Color;
import android.graphics.Rect;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
@@ -90,11 +89,9 @@
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
-import android.widget.RelativeLayout;
import android.widget.TabHost;
import android.widget.TabHost.OnTabChangeListener;
import android.widget.TabHost.TabContentFactory;
-import android.widget.TabWidget;
import android.widget.TextView;
import android.widget.Toast;
@@ -301,18 +298,6 @@
mHomeCustomizationDrawer.addTab(mHomeCustomizationDrawer.newTabSpec(SHORTCUTS_TAG)
.setIndicator(shortcutsLabel).setContent(contentFactory));
- // TEMP: just styling the tab widget to be a bit nicer until we get the actual
- // new assets
- TabWidget tabWidget = mHomeCustomizationDrawer.getTabWidget();
- for (int i = 0; i < tabWidget.getChildCount(); ++i) {
- RelativeLayout tab = (RelativeLayout) tabWidget.getChildTabViewAt(i);
- TextView text = (TextView) tab.getChildAt(1);
- text.setTextSize(20.0f);
- text.setPadding(20, 0, 20, 0);
- text.setShadowLayer(1.0f, 0.0f, 1.0f, Color.BLACK);
- tab.setBackgroundDrawable(null);
- }
-
mHomeCustomizationDrawer.setOnTabChangedListener(new OnTabChangeListener() {
public void onTabChanged(String tabId) {
// animate the changing of the tab content by fading pages in and out
@@ -322,6 +307,7 @@
"alpha", alpha, 0.0f);
alphaAnim.setDuration(duration);
alphaAnim.addListener(new AnimatorListenerAdapter() {
+ @Override
public void onAnimationEnd(Animator animation) {
String tag = mHomeCustomizationDrawer.getCurrentTabTag();
if (tag == WIDGETS_TAG) {
@@ -351,11 +337,6 @@
alphaAnim.start();
}
});
-
- // TEMP: Working around a bug in tab host where the current tab does not initially have
- // a highlight on it by selecting something else, then selecting the actual tab we want..
- mHomeCustomizationDrawer.setCurrentTab(1);
- mHomeCustomizationDrawer.setCurrentTab(0);
}
setupViews();
@@ -424,6 +405,7 @@
final LocaleConfiguration localeConfiguration = sLocaleConfiguration;
new Thread("WriteLocaleConfiguration") {
+ @Override
public void run() {
writeConfiguration(Launcher.this, localeConfiguration);
}
@@ -2306,9 +2288,11 @@
Animator anim = ObjectAnimator.ofFloat(view, "alpha", show ? 1.0f : 0.0f);
anim.setDuration(duration);
anim.addListener(new AnimatorListenerAdapter() {
+ @Override
public void onAnimationStart(Animator animation) {
if (showing) showToolbarButton(view);
}
+ @Override
public void onAnimationEnd(Animator animation) {
if (hiding) hideToolbarButton(view);
}
@@ -2409,6 +2393,7 @@
scaleAnim.setDuration(duration);
scaleAnim.setInterpolator(new DecelerateInterpolator());
scaleAnim.addListener(new AnimatorListenerAdapter() {
+ @Override
public void onAnimationStart(Animator animation) {
// Prepare the position
toView.setTranslationX(0.0f);
@@ -2472,6 +2457,7 @@
scaleAnim.setDuration(duration);
scaleAnim.setInterpolator(new AccelerateInterpolator());
mStateAnimation.addListener(new AnimatorListenerAdapter() {
+ @Override
public void onAnimationEnd(Animator animation) {
fromView.setVisibility(View.GONE);
fromView.setScaleX(1.0f);
@@ -2531,10 +2517,12 @@
if (mStateAnimation != null) mStateAnimation.cancel();
mStateAnimation = new AnimatorSet();
mStateAnimation.addListener(new AnimatorListenerAdapter() {
+ @Override
public void onAnimationStart(Animator animation) {
toView.setVisibility(View.VISIBLE);
toView.setY(toViewStartY);
}
+ @Override
public void onAnimationEnd(Animator animation) {
fromView.setVisibility(View.GONE);
}