am 6c7a03a8: Fixed bug where All Apps would appear to animate from the right
* commit '6c7a03a858d6a695d0f6005398cc6f9b3e7dd18d': Fixed bug where All Apps would appear to animate from the right
This commit is contained in:
@@ -48,6 +48,7 @@ public class AllAppsTabbed extends TabHost implements AllAppsView {
|
|||||||
private AllAppsPagedView mAllApps;
|
private AllAppsPagedView mAllApps;
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private final LayoutInflater mInflater;
|
private final LayoutInflater mInflater;
|
||||||
|
private boolean mFirstLayout = true;
|
||||||
|
|
||||||
public AllAppsTabbed(Context context, AttributeSet attrs) {
|
public AllAppsTabbed(Context context, AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
@@ -135,6 +136,11 @@ public class AllAppsTabbed extends TabHost implements AllAppsView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setVisibility(int visibility) {
|
public void setVisibility(int visibility) {
|
||||||
|
if (visibility == View.GONE && mFirstLayout) {
|
||||||
|
// It needs to be INVISIBLE so that it will be measured in the layout.
|
||||||
|
// Otherwise the animations is messed up when we show it for the first time.
|
||||||
|
visibility = View.INVISIBLE;
|
||||||
|
}
|
||||||
final boolean isVisible = (visibility == View.VISIBLE);
|
final boolean isVisible = (visibility == View.VISIBLE);
|
||||||
super.setVisibility(visibility);
|
super.setVisibility(visibility);
|
||||||
float zoom = (isVisible ? 1.0f : 0.0f);
|
float zoom = (isVisible ? 1.0f : 0.0f);
|
||||||
@@ -146,6 +152,12 @@ public class AllAppsTabbed extends TabHost implements AllAppsView {
|
|||||||
return mAllApps.isVisible();
|
return mAllApps.isVisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
||||||
|
mFirstLayout = false;
|
||||||
|
super.onLayout(changed, l, t, r, b);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isAnimating() {
|
public boolean isAnimating() {
|
||||||
return (getAnimation() != null);
|
return (getAnimation() != null);
|
||||||
|
|||||||
Reference in New Issue
Block a user