Loading src/com/android/contacts/editor/CompactKindSectionView.java +0 −6 Original line number Diff line number Diff line Loading @@ -417,12 +417,6 @@ public class CompactKindSectionView extends LinearLayout { final View view = mLayoutInflater.inflate( EditorUiUtils.getLayoutResourceId(dataKind.mimeType), mEditors, false); view.setEnabled(isEnabled()); // Hide the types drop downs until the associated edit field is focused if (view instanceof LabeledEditorView) { ((LabeledEditorView) view).setHideTypeInitially(true); } if (view instanceof Editor) { final Editor editor = (Editor) view; editor.setDeletable(true); Loading src/com/android/contacts/editor/EditorAnimator.java +5 −17 Original line number Diff line number Diff line Loading @@ -47,15 +47,7 @@ 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 @@ -79,16 +71,12 @@ 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/EventFieldEditorView.java +0 −6 Original line number Diff line number Diff line Loading @@ -84,9 +84,6 @@ public class EventFieldEditorView extends LabeledEditorView { mDateView.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (!isTypeVisible()) { showType(); } showDialog(R.id.dialog_event_date_picker); } }); Loading Loading @@ -134,9 +131,6 @@ public class EventFieldEditorView extends LabeledEditorView { mDateView.setText(data); mDateView.setTextColor(mPrimaryTextColor); setDeleteButtonVisible(true); if (!isTypeVisible()) { showType(); } } } Loading src/com/android/contacts/editor/KindSectionView.java +0 −6 Original line number Diff line number Diff line Loading @@ -194,13 +194,7 @@ public class KindSectionView extends LinearLayout implements EditorListener { layoutResId + " for MIME type " + mKind.mimeType + " with error " + e.toString()); } // Hide the types drop downs until the associated edit field is focused if (view instanceof LabeledEditorView) { ((LabeledEditorView) view).setHideTypeInitially(true); } view.setEnabled(isEnabled()); if (view instanceof Editor) { Editor editor = (Editor) view; editor.setDeletable(true); Loading src/com/android/contacts/editor/LabeledEditorView.java +3 −41 Original line number Diff line number Diff line Loading @@ -79,8 +79,6 @@ public abstract class LabeledEditorView extends LinearLayout implements Editor, private boolean mWasEmpty = true; private boolean mIsDeletable = true; private boolean mIsAttachedToWindow; private boolean mHideTypeInitially; private boolean mHasTypes; private EditType mType; Loading Loading @@ -239,39 +237,6 @@ public abstract class LabeledEditorView extends LinearLayout implements Editor, } } /** * Whether to hide the type dropdown after values have been set. * By default the drop down is always displayed if there are types to display. */ public void setHideTypeInitially(boolean hideTypeInitially) { mHideTypeInitially = hideTypeInitially; } /** * Whether the type drop down is visible. */ public boolean isTypeVisible() { return mLabel == null ? false : mLabel.getVisibility() == View.VISIBLE; } /** * Makes the type drop down visible if it is not already so, and there are types to display. */ public void showType() { if (mHasTypes && mLabel != null && mLabel.getVisibility() != 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); } } protected void onOptionalFieldVisibilityChange() { if (mListener != null) { mListener.onRequest(EditorListener.EDITOR_FORM_CHANGED); Loading Loading @@ -422,15 +387,12 @@ public abstract class LabeledEditorView extends LinearLayout implements Editor, setVisibility(View.VISIBLE); // Display label selector if multiple types available mHasTypes = RawContactModifier.hasEditTypes(kind); setupLabelButton(mHasTypes); final boolean hasTypes = RawContactModifier.hasEditTypes(kind); setupLabelButton(hasTypes); mLabel.setEnabled(!readOnly && isEnabled()); if (mHasTypes) { if (hasTypes) { mType = RawContactModifier.getCurrentType(entry, kind); rebuildLabel(); if (mHideTypeInitially) { mLabel.setVisibility(View.GONE); } } } Loading Loading
src/com/android/contacts/editor/CompactKindSectionView.java +0 −6 Original line number Diff line number Diff line Loading @@ -417,12 +417,6 @@ public class CompactKindSectionView extends LinearLayout { final View view = mLayoutInflater.inflate( EditorUiUtils.getLayoutResourceId(dataKind.mimeType), mEditors, false); view.setEnabled(isEnabled()); // Hide the types drop downs until the associated edit field is focused if (view instanceof LabeledEditorView) { ((LabeledEditorView) view).setHideTypeInitially(true); } if (view instanceof Editor) { final Editor editor = (Editor) view; editor.setDeletable(true); Loading
src/com/android/contacts/editor/EditorAnimator.java +5 −17 Original line number Diff line number Diff line Loading @@ -47,15 +47,7 @@ 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 @@ -79,16 +71,12 @@ 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/EventFieldEditorView.java +0 −6 Original line number Diff line number Diff line Loading @@ -84,9 +84,6 @@ public class EventFieldEditorView extends LabeledEditorView { mDateView.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (!isTypeVisible()) { showType(); } showDialog(R.id.dialog_event_date_picker); } }); Loading Loading @@ -134,9 +131,6 @@ public class EventFieldEditorView extends LabeledEditorView { mDateView.setText(data); mDateView.setTextColor(mPrimaryTextColor); setDeleteButtonVisible(true); if (!isTypeVisible()) { showType(); } } } Loading
src/com/android/contacts/editor/KindSectionView.java +0 −6 Original line number Diff line number Diff line Loading @@ -194,13 +194,7 @@ public class KindSectionView extends LinearLayout implements EditorListener { layoutResId + " for MIME type " + mKind.mimeType + " with error " + e.toString()); } // Hide the types drop downs until the associated edit field is focused if (view instanceof LabeledEditorView) { ((LabeledEditorView) view).setHideTypeInitially(true); } view.setEnabled(isEnabled()); if (view instanceof Editor) { Editor editor = (Editor) view; editor.setDeletable(true); Loading
src/com/android/contacts/editor/LabeledEditorView.java +3 −41 Original line number Diff line number Diff line Loading @@ -79,8 +79,6 @@ public abstract class LabeledEditorView extends LinearLayout implements Editor, private boolean mWasEmpty = true; private boolean mIsDeletable = true; private boolean mIsAttachedToWindow; private boolean mHideTypeInitially; private boolean mHasTypes; private EditType mType; Loading Loading @@ -239,39 +237,6 @@ public abstract class LabeledEditorView extends LinearLayout implements Editor, } } /** * Whether to hide the type dropdown after values have been set. * By default the drop down is always displayed if there are types to display. */ public void setHideTypeInitially(boolean hideTypeInitially) { mHideTypeInitially = hideTypeInitially; } /** * Whether the type drop down is visible. */ public boolean isTypeVisible() { return mLabel == null ? false : mLabel.getVisibility() == View.VISIBLE; } /** * Makes the type drop down visible if it is not already so, and there are types to display. */ public void showType() { if (mHasTypes && mLabel != null && mLabel.getVisibility() != 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); } } protected void onOptionalFieldVisibilityChange() { if (mListener != null) { mListener.onRequest(EditorListener.EDITOR_FORM_CHANGED); Loading Loading @@ -422,15 +387,12 @@ public abstract class LabeledEditorView extends LinearLayout implements Editor, setVisibility(View.VISIBLE); // Display label selector if multiple types available mHasTypes = RawContactModifier.hasEditTypes(kind); setupLabelButton(mHasTypes); final boolean hasTypes = RawContactModifier.hasEditTypes(kind); setupLabelButton(hasTypes); mLabel.setEnabled(!readOnly && isEnabled()); if (mHasTypes) { if (hasTypes) { mType = RawContactModifier.getCurrentType(entry, kind); rebuildLabel(); if (mHideTypeInitially) { mLabel.setVisibility(View.GONE); } } } Loading