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

Commit af338dd0 authored by Gary Mai's avatar Gary Mai Committed by Android (Google) Code Review
Browse files

Merge "Remove more editor view classes"

parents 9300be76 65971d0f
Loading
Loading
Loading
Loading

res/layout/item_kind_section.xml

deleted100644 → 0
+0 −35
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 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.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<!-- the body surrounding all editors for a specific kind -->

<com.android.contacts.editor.KindSectionView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">

    <ImageView
        android:id="@+id/kind_icon"
        style="@style/EditKindIconStyle" />

    <LinearLayout
        android:id="@+id/kind_editors"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" />

</com.android.contacts.editor.KindSectionView>
 No newline at end of file

res/layout/item_photo_editor.xml

deleted100644 → 0
+0 −84
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2007 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.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<view class="com.android.contacts.editor.PhotoEditorView"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="horizontal" >

    <ImageView
        android:id="@+id/kind_icon"
        android:src="@drawable/ic_camera_alt_black_24dp"
        android:layout_marginTop="13dp"
        android:contentDescription="@string/header_photo_entry"
        style="@style/EditKindIconStyle" />

    <!-- Needs 10dp of top padding, in order get a total of 32dp of padding between this view
        and the previous DataKindSection. Note that EditTexts in other editor.xml files have this
        padding built in. Similarly, we need to add 4dp of start margin to make up for the padding
        that an EditText would have in this image's place. -->
    <ImageView
        android:id="@+id/photo"
        android:layout_width="72dip"
        android:layout_height="72dip"
        android:cropToPadding="true"
        android:scaleType="centerCrop"
        android:layout_marginTop="15dp"
        android:layout_marginStart="4dp"
        android:contentDescription="@string/description_contact_photo"
        android:layout_marginBottom="@dimen/editor_padding_below_photo"
        android:gravity="start" />

    <!-- We want 16dp for the effective marginStart. So we set 12dp, since the private
        @android:dimen/control_inset_material already includes 4dp of padding. -->
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="12dp" >

        <!-- The values applied to this button are complicated:
            1) We want 16dp internal padding in the button. The background drawable is inset
            by private @android:dimen/button_inset_horizontal_material=4dp. Therefore,
            we need paddingStart/End of 20dp.
            2) In order to leave enough room for the 32dp RadioButton, this can only be 46dp.
            This is 2dp less than the default touch target size.
            3) This button will appear to be offset by the private
            @android:dimen/button_inset_vertical_material amount. Therefore, in order to achieve
            15dp of apparent top margin, we only need to apply 9dp. -->
        <Button
            android:id="@+id/change_button"
            android:layout_width="wrap_content"
            android:layout_height="46dp"
            android:textSize="@dimen/editor_form_text_size"
            android:textColor="@color/primary_text_color"
            android:layout_marginTop="9dp"
            android:paddingStart="20dp"
            android:paddingEnd="20dp"
            android:text="@string/change_photo" />

        <!-- Don't explicitly set the layout_height in case we need to rely on text wrapping.
            For one line, we can expect the height to be 32dp with 16dp text size. -->
        <RadioButton
            android:id="@+id/primary_checkbox"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="48dp"
            android:textSize="@dimen/editor_form_text_size"
            android:text="@string/primary_photo" />
    </LinearLayout>
</view>
+0 −58
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- 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.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<!-- A readonly version of item_photo_editor.xml shown in the readonly raw contact editor. -->
<view class="com.android.contacts.editor.PhotoEditorView"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="horizontal" >

    <ImageView
        android:id="@+id/kind_icon"
        android:src="@drawable/ic_camera_alt_black_24dp"
        android:layout_marginTop="0dp"
        android:contentDescription="@string/header_photo_entry"
        style="@style/EditKindIconStyle" />

    <!-- We need to add 2dp of start margin to make up for the padding that a TextView would
        have in this image's place. We add 2dp of top margin, so that icon drawable is a little
        below the top of this ImageView. -->
    <ImageView
        android:id="@+id/photo"
        android:layout_width="72dip"
        android:layout_height="72dip"
        android:cropToPadding="true"
        android:scaleType="centerCrop"
        android:layout_marginTop="2dp"
        android:layout_marginStart="2dp"
        android:contentDescription="@string/description_contact_photo"
        android:layout_marginBottom="@dimen/editor_padding_around_read_only_photo_editor"
        android:gravity="start" />


    <!-- Don't explicitly set the layout_height in case we need to rely on text wrapping.
        For one line, we can expect the height to be 32dp with 16dp text size. -->
    <RadioButton
        android:id="@+id/primary_checkbox"
        android:layout_marginStart="12dp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginEnd="@dimen/editor_delete_button_width"
        android:layout_marginTop="2dp"
        android:textSize="@dimen/editor_form_text_size"
        android:text="@string/primary_photo" />
</view>
+0 −88
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2007 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.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<com.android.contacts.editor.RawContactReadOnlyEditorView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical" >

    <include
        layout="@layout/editor_account_header" />

    <LinearLayout
        android:id="@+id/collapsable_section"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <!-- Want 16dp of apparent top padding. Since TextView has 4dp of inset/padding built in,
            only set marginTop=12dp. -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="@dimen/editor_padding_around_read_only_photo_editor"
            android:layout_marginTop="12dp"
            android:orientation="horizontal">

            <ImageView
                android:id="@+id/kind_icon"
                android:layout_marginTop="2dp"
                android:src="@drawable/ic_person_black_24dp"
                android:contentDescription="@string/header_name_entry"
                style="@style/EditKindIconStyle" />

            <TextView
                android:id="@+id/read_only_name"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginRight="@dimen/editor_delete_button_width"
                android:layout_marginEnd="@dimen/editor_delete_button_width"
                android:singleLine="true"
                android:textSize="@dimen/editor_form_text_size"
                android:textColor="?android:attr/textColorSecondary"
                android:textAlignment="viewStart"
                android:enabled="false"/>

        </LinearLayout>

        <include
            android:id="@+id/edit_photo"
            layout="@layout/item_photo_editor_readonly" />

        <Button
            android:id="@+id/button_edit_externally"
            android:text="@string/edit_contact"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="4dp"
            android:layout_marginBottom="@dimen/editor_padding_below_photo"
            android:layout_marginEnd="13dip"
            android:layout_marginStart="13dip"/>

        <LinearLayout android:id="@+id/sect_general"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"/>

    </LinearLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="@dimen/divider_line_height"
        android:background="@color/divider_line_color_light" />

</com.android.contacts.editor.RawContactReadOnlyEditorView>
+0 −9
Original line number Diff line number Diff line
@@ -90,15 +90,6 @@
        padding between TextView's in the readonly Raw Contact Editor. -->
    <dimen name="editor_padding_between_read_only_editor_views">9dp</dimen>

    <!-- Padding above and below the photo editor. This value is chosen to give 19dp of apparent
        padding between TextView's and the photo's ImageView. -->
    <dimen name="editor_padding_around_read_only_photo_editor">15dp</dimen>

    <!-- Padding below the photo editor. This value is larger than
        editor_padding_between_editor_views, since ImageView's don't have space between the bottom
        of their visual bottom, like an EditText does. -->
    <dimen name="editor_padding_below_photo">9dp</dimen>

    <!-- Width of the Type-Label in the Editor -->
    <dimen name="editor_type_label_width">150dip</dimen>

Loading