Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 043fba63 authored by Brian Attwell's avatar Brian Attwell
Browse files

Material design of common edit screen fields

The normal edit screen fields, such as phone number and location,
have been updated to look like the new Material design mocks. I expect
this to be the largest CL needed to finish b/18004959.

Aspects of the Editor that haven't been touched in this CL
- readonly editor
- collapse nickname and phonetic name into StructuredNameEditorView. Then make
  sure the layout is correct
- photo editor
- Material insert/delete interpolators (maybe fast_out_slow_in)
- account header

Some complicated/weird parts of the CL:
-KindSectionView no longer displays an "Add details" button. Instead
 it always shows an additional empty row for each mimeType. The logic
 that handles this is mostly inside #updateEmptyEditors(). A lot of code
 could be deleted from RawContactEditorView because of this.
-LabeledEditorView's adapter displays TextView's inside Spinner. In order
 to make the TextViews look like EditTexts, I set the EditText's background
 (so the 9patch padding is used) and then later remove the background.
-Instead of keeping an expansion_view_container in every single field,
 I only kept it where it was needed. As a result, I needed to add
 null checks into the TextFieldsEditorView base class.
-I made an effort to reduce the depth of the view hierarchy and reduce
 the use of LinearLayout weights for performance reasons, when it was
 easy to do so

Bug: 18004959
Change-Id: I5934ca189b66468834faf3bb995b172ae2f90bed
parent 8f9d84ff
Loading
Loading
Loading
Loading
+3 −10
Original line number Diff line number Diff line
@@ -16,19 +16,12 @@
  -->

<!-- Button to select a date in the contact editor. -->

<Button
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/date_view"
    style="@style/SpinnerButtonStyle"
    android:layout_width="0dip"
    android:layout_width="match_parent"
    android:layout_height="@dimen/editor_min_line_item_height"
    android:layout_weight="1"
    android:gravity="center_vertical"
    android:layout_marginLeft="@dimen/editor_field_left_padding"
    android:layout_marginRight="@dimen/editor_field_right_padding"
    android:layout_marginStart="@dimen/editor_field_left_padding"
    android:layout_marginEnd="@dimen/editor_field_right_padding"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:paddingStart="12dip"
    android:paddingEnd="@dimen/editor_spinner_end_padding_workaround" />
    android:textSize="@dimen/editor_form_text_size"
    android:paddingRight="@dimen/editor_spinner_right_padding_workaround" />
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@
    android:layout_height="@dimen/editor_min_line_item_height"
    android:layout_marginRight="2dip"
    android:layout_marginEnd="2dip"
    android:layout_gravity="bottom">
    android:layout_gravity="center_vertical">
    <ImageView
        android:id="@+id/delete_button"
        android:layout_width="wrap_content"
+1 −4
Original line number Diff line number Diff line
@@ -20,9 +20,6 @@
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/editors"
    android:layout_width="0dip"
    android:layout_weight="1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingLeft="@dimen/editor_field_left_padding"
    android:paddingStart="@dimen/editor_field_left_padding"
    android:orientation="vertical" />
+0 −2
Original line number Diff line number Diff line
@@ -22,8 +22,6 @@
    android:layout_width="0dip"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:paddingLeft="@dimen/editor_field_left_padding"
    android:paddingStart="@dimen/editor_field_left_padding"
    android:orientation="vertical">
    <LinearLayout
         android:id="@+id/editors"
+30 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 The Android Open Source Project
<!--
     Copyright (C) 2014 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
@@ -14,38 +15,16 @@
     limitations under the License.
-->

<com.android.contacts.editor.TextFieldsEditorView
    xmlns:android="http://schemas.android.com/apk/res/android"
<!-- This TextView is displayed inside editor Spinners. In order to make this TextView get laid
    out the same as an EditText, we use the EditText's background and gravity=center_vertical. The
    EditText's background 9patch directly affects padding. -->
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/text1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:orientation="horizontal"
        android:gravity="center_vertical">

        <include
            android:id="@+id/editors"
            layout="@layout/edit_field_list" />

        <include
            android:id="@+id/expansion_view_container"
            layout="@layout/edit_expansion_view"
            android:visibility="gone" />

        <include
            android:id="@+id/spinner"
            layout="@layout/edit_spinner"
            android:visibility="gone" />

        <include
            android:id="@+id/delete_button_container"
            layout="@layout/edit_delete_button"
            android:visibility="gone" />

    </LinearLayout>

</com.android.contacts.editor.TextFieldsEditorView>
    android:layout_height="match_parent"
    android:background="?android:attr/editTextBackground"
    android:gravity="center_vertical"
    android:paddingStart="0dp"
    android:paddingEnd="0dp"
    android:maxLines="1"
    android:ellipsize="end" />
 No newline at end of file
Loading