Loading src/com/android/contacts/editor/EditorAnimator.java +17 −5 Original line number Diff line number Diff line Loading @@ -47,7 +47,15 @@ public class EditorAnimator { private AnimatorRunner mRunner = new AnimatorRunner(); public void hideEditorView(final View victim) { removeEditorView(victim, /* removeVictimFromParent =*/ false); } public void removeEditorView(final View victim) { removeEditorView(victim, /* removeVictimFromParent =*/ true); } private void removeEditorView(final View victim, final boolean removeVictimFromParent) { mRunner.endOldAnimation(); final int offset = victim.getHeight(); Loading @@ -71,12 +79,16 @@ public class EditorAnimator { final View view = viewsToMove.get(i); view.setTranslationY(0.0f); } if (removeVictimFromParent) { // Remove our target view (if parent is null, we were run several times by quick // fingers. Just ignore) final ViewGroup victimParent = (ViewGroup) victim.getParent(); if (victimParent != null) { victimParent.removeView(victim); } } else { victim.setVisibility(View.GONE); } } }); } Loading src/com/android/contacts/editor/LabeledEditorView.java +10 −1 Original line number Diff line number Diff line Loading @@ -254,7 +254,16 @@ public abstract class LabeledEditorView extends LinearLayout implements Editor, */ public void showType() { if (mHasTypes && mLabel != null && mLabel.getVisibility() != View.VISIBLE) { mLabel.setVisibility(View.VISIBLE); EditorAnimator.getInstance().slideAndFadeIn(mLabel, mLabel.getHeight()); } } /** * Hides the type drop down if there are types to display and it is not already hidden. */ public void hideType() { if (mHasTypes && mLabel != null && mLabel.getVisibility() != View.GONE) { EditorAnimator.getInstance().hideEditorView(mLabel); } } Loading src/com/android/contacts/editor/TextFieldsEditorView.java +4 −0 Original line number Diff line number Diff line Loading @@ -159,7 +159,11 @@ public class TextFieldsEditorView extends LabeledEditorView { getEditorListener().onRequest(EditorListener.EDITOR_FOCUS_CHANGED); } if (foundFocus && !isTypeVisible()) { // We just got focus and the types are not visible showType(); } else if (isEmpty()) { // We just lost focus and the field is empty hideType(); } // Rebuild the label spinner using the new colors. rebuildLabel(); Loading Loading
src/com/android/contacts/editor/EditorAnimator.java +17 −5 Original line number Diff line number Diff line Loading @@ -47,7 +47,15 @@ public class EditorAnimator { private AnimatorRunner mRunner = new AnimatorRunner(); public void hideEditorView(final View victim) { removeEditorView(victim, /* removeVictimFromParent =*/ false); } public void removeEditorView(final View victim) { removeEditorView(victim, /* removeVictimFromParent =*/ true); } private void removeEditorView(final View victim, final boolean removeVictimFromParent) { mRunner.endOldAnimation(); final int offset = victim.getHeight(); Loading @@ -71,12 +79,16 @@ public class EditorAnimator { final View view = viewsToMove.get(i); view.setTranslationY(0.0f); } if (removeVictimFromParent) { // Remove our target view (if parent is null, we were run several times by quick // fingers. Just ignore) final ViewGroup victimParent = (ViewGroup) victim.getParent(); if (victimParent != null) { victimParent.removeView(victim); } } else { victim.setVisibility(View.GONE); } } }); } Loading
src/com/android/contacts/editor/LabeledEditorView.java +10 −1 Original line number Diff line number Diff line Loading @@ -254,7 +254,16 @@ public abstract class LabeledEditorView extends LinearLayout implements Editor, */ public void showType() { if (mHasTypes && mLabel != null && mLabel.getVisibility() != View.VISIBLE) { mLabel.setVisibility(View.VISIBLE); EditorAnimator.getInstance().slideAndFadeIn(mLabel, mLabel.getHeight()); } } /** * Hides the type drop down if there are types to display and it is not already hidden. */ public void hideType() { if (mHasTypes && mLabel != null && mLabel.getVisibility() != View.GONE) { EditorAnimator.getInstance().hideEditorView(mLabel); } } Loading
src/com/android/contacts/editor/TextFieldsEditorView.java +4 −0 Original line number Diff line number Diff line Loading @@ -159,7 +159,11 @@ public class TextFieldsEditorView extends LabeledEditorView { getEditorListener().onRequest(EditorListener.EDITOR_FOCUS_CHANGED); } if (foundFocus && !isTypeVisible()) { // We just got focus and the types are not visible showType(); } else if (isEmpty()) { // We just lost focus and the field is empty hideType(); } // Rebuild the label spinner using the new colors. rebuildLabel(); Loading