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

Commit 35be86e8 authored by Flavio Lerda's avatar Flavio Lerda
Browse files

Pixel-perfect fixes for the call details.

- Fix spacing when voicemail or call/SMS are not available.
- Fix font sizes and use textAppearance wherever possible.
- Fix bug with label not appearing in call/SMS.
- Do not show the label if the name is not present.
- Remove dedicated field for phone number in call/SMS (it is not used).

Bug: 5157649
Change-Id: I32b78236b3f85e4a087545ec993f9794093e48b1
parent fcd462b5
Loading
Loading
Loading
Loading
+9 −21
Original line number Diff line number Diff line
@@ -83,6 +83,7 @@
            android:id="@+id/voicemail_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingBottom="@dimen/call_log_icon_margin"
            android:layout_below="@id/blue_separator"
            android:background="@android:color/black"
        >
@@ -118,7 +119,7 @@
            android:layout_marginLeft="@dimen/call_detail_contact_name_margin"
            android:gravity="center_vertical"
            android:textColor="?attr/call_log_primary_text_color"
            android:textSize="18sp"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:singleLine="true"
        />
        <ImageButton
@@ -134,6 +135,7 @@
        <FrameLayout android:id="@+id/call_and_sms_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="@dimen/call_log_icon_margin"
            android:layout_below="@id/voicemail_container"
            android:background="@android:color/black"
        >
@@ -142,7 +144,6 @@
                android:layout_width="match_parent"
                android:layout_height="@dimen/call_log_list_item_height"
                android:orientation="horizontal"
                android:layout_marginTop="@dimen/call_log_icon_margin"
                android:gravity="center_vertical"
                android:background="@drawable/dialpad_background"
            >
@@ -158,31 +159,18 @@
                    android:background="@drawable/btn_dial"
                >

                    <TextView android:id="@+id/call_and_sms_text1"
                    <TextView android:id="@+id/call_and_sms_text"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textAppearance="?android:attr/textAppearanceLarge"
                        android:textAppearance="?android:attr/textAppearanceMedium"
                    />

                    <LinearLayout android:id="@+id/call_and_sms_line2"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:orientation="horizontal"
                    >
                    <TextView android:id="@+id/call_and_sms_label"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginRight="5dip"
                            android:textAppearance="?android:attr/textAppearanceSmall"
                            android:textStyle="bold"
                        />

                        <TextView android:id="@+id/call_and_sms_number"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textAppearance="?android:attr/textAppearanceSmall"
                        android:textAllCaps="true"
                    />
                    </LinearLayout>

                </LinearLayout>

+3 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="@dimen/call_log_icon_margin"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:textColor="@color/secondary_text_color"
        />
    </LinearLayout>
@@ -48,12 +49,14 @@
        android:id="@+id/date"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:textColor="@color/secondary_text_color"
    />
    <TextView
        android:id="@+id/duration"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:textColor="@color/secondary_text_color"
    />
</LinearLayout>
+99 −105
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
        android:orientation="vertical"
    android:background="@color/voicemail_playback_ui_background"
>
    <!-- Mute, playback, trash buttons. -->
@@ -122,4 +117,3 @@
        />
    </RelativeLayout>
</RelativeLayout>
</LinearLayout>
+11 −20
Original line number Diff line number Diff line
@@ -198,6 +198,7 @@ public class CallDetailActivity extends Activity {
     * playback.  If it doesn't, then hide the voicemail ui.
     */
    private void optionallyHandleVoicemail() {
        View voicemailContainer = findViewById(R.id.voicemail_container);
        if (hasVoicemail()) {
            // Has voicemail: add the voicemail fragment.  Add suitable arguments to set the uri
            // to play and optionally start the playback.
@@ -209,6 +210,7 @@ public class CallDetailActivity extends Activity {
                fragmentArguments.putBoolean(EXTRA_VOICEMAIL_START_PLAYBACK, true);
            }
            playbackFragment.setArguments(fragmentArguments);
            voicemailContainer.setVisibility(View.VISIBLE);
            getFragmentManager().beginTransaction()
                    .add(R.id.voicemail_container, playbackFragment).commit();
            mAsyncQueryHandler.startVoicemailStatusQuery(getVoicemailUri());
@@ -216,6 +218,7 @@ public class CallDetailActivity extends Activity {
        } else {
            // No voicemail uri: hide the status view.
            mStatusMessageView.setVisibility(View.GONE);
            voicemailContainer.setVisibility(View.GONE);
        }
    }

@@ -409,7 +412,8 @@ public class CallDetailActivity extends Activity {
                            getString(R.string.description_call, nameOrNumber));

                    // Only show a label if the number is shown and it is not a SIP address.
                    if (!TextUtils.isEmpty(firstDetails.number)
                    if (!TextUtils.isEmpty(firstDetails.name)
                            && !TextUtils.isEmpty(firstDetails.number)
                            && !PhoneNumberUtils.isUriNumber(firstDetails.number.toString())) {
                        entry.label = Phone.getTypeLabel(mResources, firstDetails.numberType,
                                firstDetails.numberLabel);
@@ -550,7 +554,6 @@ public class CallDetailActivity extends Activity {
        public final String primaryDescription;

        public CharSequence label = null;
        public String number = null;
        /** Icon for the secondary action. */
        public int secondaryIcon = 0;
        /** Intent for the secondary action. If not null, an icon must be defined. */
@@ -583,7 +586,7 @@ public class CallDetailActivity extends Activity {

        ImageView icon = (ImageView) convertView.findViewById(R.id.call_and_sms_icon);
        View divider = convertView.findViewById(R.id.call_and_sms_divider);
        TextView text = (TextView) convertView.findViewById(R.id.call_and_sms_text1);
        TextView text = (TextView) convertView.findViewById(R.id.call_and_sms_text);

        View mainAction = convertView.findViewById(R.id.call_and_sms_main_action);
        mainAction.setOnClickListener(mPrimaryActionListener);
@@ -603,25 +606,13 @@ public class CallDetailActivity extends Activity {
        }
        text.setText(entry.text);

        View line2 = convertView.findViewById(R.id.call_and_sms_line2);
        boolean numberEmpty = TextUtils.isEmpty(entry.number);
        boolean labelEmpty = TextUtils.isEmpty(entry.label) || numberEmpty;
        if (labelEmpty && numberEmpty) {
            line2.setVisibility(View.GONE);
        } else {
            line2.setVisibility(View.VISIBLE);

        TextView label = (TextView) convertView.findViewById(R.id.call_and_sms_label);
            if (labelEmpty) {
        if (TextUtils.isEmpty(entry.label)) {
            label.setVisibility(View.GONE);
        } else {
            label.setText(entry.label);
            label.setVisibility(View.VISIBLE);
        }

            TextView number = (TextView) convertView.findViewById(R.id.call_and_sms_number);
            number.setText(entry.number);
        }
    }

    @Override