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

Commit 4d0f4522 authored by Wenyi Wang's avatar Wenyi Wang
Browse files

Make labels view have grey app bar (1/2)

- Set toolbar and status color programmatically
- Create GroupActivityTheme and override colorPrimaryDark
  so that status bar color doesn't turn blue on drawer opened.

Bug: 30416708

Test: manual - open a label

Change-Id: Ic3cb97fa5f64748b99b334875226afddfd4aa7b5
parent c55b39d3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -268,7 +268,7 @@

        <!-- Displays the members of a group in a list -->
        <activity android:name=".activities.GroupMembersActivity"
            android:theme="@style/PeopleActivityTheme">
            android:theme="@style/GroupActivityTheme">

            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
+3 −1
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@
    <color name="action_bar_button_text_color">#FFFFFF</color>

    <color name="actionbar_background_color">@color/primary_color</color>
    <color name="actionbar_background_color_dark">@color/primary_color_dark</color>

    <color name="contextual_selection_bar_color">#f6f6f6</color>
    <!-- Color of the status bar above the contextual selection bar. -->
@@ -37,6 +36,9 @@
    <color name="primary_color_dark">#0277bd</color>
    <color name="primary_color">#0288d1</color>

    <color name="group_primary_color_dark">#546E7A</color>
    <color name="group_primary_color">#607D8B</color>

    <!-- Color of the selected tab underline -->
    <color name="contacts_accent_color">#FFFFFF</color>

+5 −0
Original line number Diff line number Diff line
@@ -103,6 +103,11 @@
        <item name="android:listSelector">?android:attr/listChoiceBackgroundIndicator</item>
    </style>

    <style name="GroupActivityTheme" parent="@style/PeopleActivityTheme">
        <item name="android:colorPrimaryDark">@color/group_primary_color_dark</item>
        <item name="colorPrimaryDark">@color/group_primary_color_dark</item>
    </style>

    <style name="PeopleThemeAppCompat" parent="Theme.AppCompat.Light">
        <!-- Styles that require AppCompat compatibility, remember to update both sets -->
        <item name="android:actionBarStyle">@style/ContactsActionBarStyleAppCompat</item>
+3 −2
Original line number Diff line number Diff line
@@ -584,8 +584,9 @@ public class ActionBarAdapter implements OnCloseListener {
                    mActivity, R.color.contextual_selection_bar_status_bar_color);
            runStatusBarAnimation(/* colorTo */ cabStatusBarColor);
        } else {
            final int normalStatusBarColor = ContextCompat.getColor(
                    mActivity, R.color.primary_color_dark);
            final int normalStatusBarColor = mActivity instanceof GroupMembersActivity
                    ? ContextCompat.getColor(mActivity, R.color.group_primary_color_dark)
                    : ContextCompat.getColor(mActivity, R.color.primary_color_dark);
            if (shouldAnimate) {
                runStatusBarAnimation(/* colorTo */ normalStatusBarColor);
            } else {
+6 −1
Original line number Diff line number Diff line
@@ -20,20 +20,22 @@ import android.app.FragmentTransaction;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.graphics.drawable.ColorDrawable;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.provider.ContactsContract.RawContacts;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.GravityCompat;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.FrameLayout;
import android.widget.Toast;

import com.android.contacts.ContactSaveService;
import com.android.contacts.ContactsDrawerActivity;
import com.android.contacts.R;
import com.android.contacts.common.GroupMetaData;
import com.android.contacts.common.logging.ListEvent;
import com.android.contacts.common.logging.Logger;
import com.android.contacts.common.logging.ScreenEvent.ScreenType;
@@ -196,6 +198,9 @@ public class GroupMembersActivity extends ContactsDrawerActivity implements
        // Set up the view
        setContentView(R.layout.group_members_activity);

        findViewById(R.id.toolbar_frame).setBackgroundColor(
                ContextCompat.getColor(this, R.color.group_primary_color));

        // Set up the action bar
        mActionBarAdapter = new ActionBarAdapter(this, this, getSupportActionBar(),
                /* portraitTabs */ null, /* landscapeTabs */ null, mToolbar,