Loading src/com/android/contacts/editor/CompactRawContactsEditorView.java +10 −1 Original line number Diff line number Diff line Loading @@ -744,6 +744,15 @@ public class CompactRawContactsEditorView extends LinearLayout implements View.O } // Only the last editor should show an empty editor if (lastVisibleKindSectionView != null) { // Hide all empty kind sections except the last one for (int i = 0; i < viewGroup.getChildCount(); i++) { final KindSectionView kindSectionView = (KindSectionView) viewGroup.getChildAt(i); if (kindSectionView != lastVisibleKindSectionView && kindSectionView.areAllEditorsEmpty()) { kindSectionView.setVisibility(View.GONE); } } // Set the last editor to show empty editor fields lastVisibleKindSectionView.setShowOneEmptyEditor(true); lastVisibleKindSectionView.updateEmptyEditors(/* shouldAnimate =*/ false); } Loading src/com/android/contacts/editor/KindSectionView.java +10 −0 Original line number Diff line number Diff line Loading @@ -326,6 +326,16 @@ public class KindSectionView extends LinearLayout implements EditorListener { return emptyEditorViews; } public boolean areAllEditorsEmpty() { for (int i = 0; i < mEditors.getChildCount(); i++) { final View view = mEditors.getChildAt(i); if (!((Editor) view).isEmpty()) { return false; } } return true; } public int getEditorCount() { return mEditors.getChildCount(); } Loading Loading
src/com/android/contacts/editor/CompactRawContactsEditorView.java +10 −1 Original line number Diff line number Diff line Loading @@ -744,6 +744,15 @@ public class CompactRawContactsEditorView extends LinearLayout implements View.O } // Only the last editor should show an empty editor if (lastVisibleKindSectionView != null) { // Hide all empty kind sections except the last one for (int i = 0; i < viewGroup.getChildCount(); i++) { final KindSectionView kindSectionView = (KindSectionView) viewGroup.getChildAt(i); if (kindSectionView != lastVisibleKindSectionView && kindSectionView.areAllEditorsEmpty()) { kindSectionView.setVisibility(View.GONE); } } // Set the last editor to show empty editor fields lastVisibleKindSectionView.setShowOneEmptyEditor(true); lastVisibleKindSectionView.updateEmptyEditors(/* shouldAnimate =*/ false); } Loading
src/com/android/contacts/editor/KindSectionView.java +10 −0 Original line number Diff line number Diff line Loading @@ -326,6 +326,16 @@ public class KindSectionView extends LinearLayout implements EditorListener { return emptyEditorViews; } public boolean areAllEditorsEmpty() { for (int i = 0; i < mEditors.getChildCount(); i++) { final View view = mEditors.getChildAt(i); if (!((Editor) view).isEmpty()) { return false; } } return true; } public int getEditorCount() { return mEditors.getChildCount(); } Loading