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

Commit d3ea4879 authored by Adam Shanks's avatar Adam Shanks
Browse files

Backport of Eclair call log layout

parent e2220b47
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2009 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.
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:state_window_focused="false"
        android:drawable="@android:color/transparent" />
    <item android:state_focused="false" android:state_pressed="true"
        android:drawable="@*android:drawable/list_selector_background_transition" />
    <item android:state_focused="false" android:state_pressed="false"
        android:drawable="@android:drawable/screen_background_dark"/>

</selector>
+20 −20
Original line number Diff line number Diff line
@@ -17,44 +17,44 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="?android:attr/listPreferredItemHeight"
    android:paddingLeft="0dip"
    android:paddingRight="12dip"
    android:paddingLeft="7dip"
>

    <ImageView android:id="@+id/call_icon"
    <com.android.contacts.ui.widget.DontPressWithParentImageView android:id="@+id/call_icon"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"

        android:paddingLeft="14dip"
        android:paddingRight="11dip"
        android:paddingRight="14dip"
        android:layout_alignParentRight="true"

        android:gravity="center_vertical"
        android:src="@android:drawable/sym_action_call"
        android:background="@android:drawable/list_selector_background"
        android:background="@drawable/call_background"
    />

    <View android:id="@+id/divider"
        android:layout_width="1dip"
        android:layout_width="1px"
        android:layout_height="fill_parent"
        android:layout_toRightOf="@id/call_icon"
        android:layout_marginRight="11dip"

        android:layout_marginTop="5dip"
        android:layout_marginBottom="5dip"
        android:layout_toLeftOf="@id/call_icon"
        android:layout_marginLeft="11dip"
        android:background="@drawable/divider_vertical_dark"
    />

    <ImageView android:id="@+id/call_type_icon"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:layout_toLeftOf="@id/divider"
    />

    <TextView android:id="@+id/date"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_toLeftOf="@id/divider"
        android:layout_alignParentBottom="true"
        android:layout_marginBottom="9dip"
        android:layout_marginBottom="8dip"

        android:textAppearance="?android:attr/textAppearanceSmall"
        android:singleLine="true"
@@ -63,7 +63,7 @@
    <TextView android:id="@+id/label"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/divider"
        android:layout_alignParentLeft="true"
        android:layout_alignParentBottom="true"
        android:layout_marginBottom="8dip"
        android:layout_marginTop="-10dip"
@@ -88,18 +88,18 @@
        android:textAppearance="?android:attr/textAppearanceSmall"
    />


    <TextView android:id="@+id/line1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/divider"
        android:layout_toLeftOf="@id/call_type_icon"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_toLeftOf="@+id/call_type_icon"
        android:layout_above="@id/label"
        android:layout_alignWithParentIfMissing="true"

        android:textAppearance="?android:attr/textAppearanceLarge"
        android:singleLine="true"
        android:ellipsize="marquee"
        android:gravity="center_vertical"
    />

+42 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2009 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.
 */

package com.android.contacts.ui.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;

/**
 * Special class to to allow the parent to be pressed without being pressed itself.
 * This way the line of a tab can be pressed, but the image itself is not.
 */
public class DontPressWithParentImageView extends ImageView {

    public DontPressWithParentImageView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public void setPressed(boolean pressed) {
        // If the parent is pressed, do not set to pressed.
        if (pressed && ((View) getParent()).isPressed()) {
            return;
        }
        super.setPressed(pressed);
    }
}