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

Commit eac83ece authored by Flavio Lerda's avatar Flavio Lerda Committed by Android (Google) Code Review
Browse files

Merge "Use ActionBar in call log details activity."

parents c73d43f3 d44e83a5
Loading
Loading
Loading
Loading
+1 −18
Original line number Diff line number Diff line
@@ -20,29 +20,12 @@
    android:orientation="horizontal"
    android:gravity="top"
>
    <LinearLayout
        android:id="@+id/action_bar"
        android:layout_width="match_parent"
        android:layout_height="@dimen/call_detail_action_bar_height"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:orientation="horizontal"
        android:background="@drawable/call_log_action_bar_bg"
    >
        <ImageView
            android:id="@+id/action_bar_home"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:src="@drawable/ic_call_log_home"
        />
    </LinearLayout>

    <FrameLayout
        android:id="@+id/voicemail_status"
        android:layout_below="@id/action_bar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:visibility="gone"
    >
        <include layout="@layout/call_log_voicemail_status"/>
+1 −2
Original line number Diff line number Diff line
@@ -53,8 +53,7 @@
        <item name="call_log_voicemail_status_text_color">#000000</item>
    </style>

    <style name="CallDetailActivityTheme" parent="android:Theme.Holo">
        <item name="android:windowNoTitle">true</item>
    <style name="CallDetailActivityTheme" parent="android:Theme.Holo.SplitActionBarWhenNarrow">
        <item name="android:gravity">top</item>
        <item name="call_detail_transparent_background">#CC000000</item>
        <item name="call_detail_contact_background_overlay_alpha">0.25</item>
+26 −10
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import com.android.contacts.voicemail.VoicemailStatusHelper;
import com.android.contacts.voicemail.VoicemailStatusHelper.StatusMessage;
import com.android.contacts.voicemail.VoicemailStatusHelperImpl;

import android.app.ActionBar;
import android.app.FragmentManager;
import android.app.ListActivity;
import android.content.ContentResolver;
@@ -81,7 +82,6 @@ public class CallDetailActivity extends ListActivity implements
    private CallTypeHelper mCallTypeHelper;
    private PhoneNumberHelper mPhoneNumberHelper;
    private PhoneCallDetailsHelper mPhoneCallDetailsHelper;
    private View mHomeActionView;
    private ImageView mMainActionView;
    private ImageView mContactBackgroundView;

@@ -156,20 +156,12 @@ public class CallDetailActivity extends ListActivity implements
        mStatusMessageView = findViewById(R.id.voicemail_status);
        mStatusMessageText = (TextView) findViewById(R.id.voicemail_status_message);
        mStatusMessageAction = (TextView) findViewById(R.id.voicemail_status_action);
        mHomeActionView = findViewById(R.id.action_bar_home);
        mMainActionView = (ImageView) findViewById(R.id.main_action);
        mContactBackgroundView = (ImageView) findViewById(R.id.contact_background);
        mDefaultCountryIso = ContactsUtils.getCurrentCountryIso(this);
        mContactPhotoManager = ContactPhotoManager.getInstance(this);
        getListView().setOnItemClickListener(this);
        mHomeActionView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // We want this to start the call log if this activity was not started from the
                // call log itself.
                CallDetailActivity.this.finish();
            }
        });
        configureActionBar();
    }

    @Override
@@ -654,8 +646,32 @@ public class CallDetailActivity extends ListActivity implements
                        new Intent(Intent.ACTION_DIAL, mPhoneNumberHelper.getCallUri(mNumber)));
                return true;

            case android.R.id.home: {
                onHomeSelected();
                return true;
            }

            default:
                throw new IllegalArgumentException();
        }
    }

    private void configureActionBar() {
        ActionBar actionBar = getActionBar();
        if (actionBar != null) {
            actionBar.setDisplayOptions(ActionBar.DISPLAY_HOME_AS_UP | ActionBar.DISPLAY_SHOW_HOME,
                    ActionBar.DISPLAY_HOME_AS_UP | ActionBar.DISPLAY_SHOW_TITLE
                    | ActionBar.DISPLAY_SHOW_HOME);
            actionBar.setIcon(R.drawable.ic_ab_dialer_holo_dark);
        }
    }

    /** Invoked when the user presses the home button in the action bar. */
    private void onHomeSelected() {
        Intent intent = new Intent(Intent.ACTION_VIEW, Calls.CONTENT_URI);
        // This will open the call log even if the detail view has been opened directly.
        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        startActivity(intent);
        finish();
    }
}