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

Unverified Commit 7ba8e375 authored by yuichiro fujiwara's avatar yuichiro fujiwara Committed by Michael Bestas
Browse files

Place MyInfo shortcut on drawer

MyInfo screen can be launched from the navigation drawer.

Bug: 38188686
Change-Id: I0ad1a44a19d14b736368553dd8102eb776c5c51b
parent 512f12a4
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="32dp"
        android:height="32dp"
        android:viewportWidth="32.0"
        android:viewportHeight="32.0">
    <path
        android:pathData="M15.8,1C7.5,1 0.9,7.7 1,16c0.1,8.3 6.9,15 15.2,15S31.1,24.3 31,16C30.9,7.7 24.1,1 15.8,1z"
        android:fillColor="#4185F3"/>
    <path
        android:pathData="M16,12.3m-3.8,0a3.8,3.8 0,1 1,7.6 0a3.8,3.8 0,1 1,-7.6 0"
        android:fillAlpha="0.2"
        android:fillColor="#FFFFFF"
        android:strokeAlpha="0.2"/>
    <path
        android:pathData="M23.5,23.5h-15v-1.9c0,-2.5 5,-3.8 7.5,-3.8s7.5,1.3 7.5,3.8V23.5z"
        android:fillAlpha="0.2"
        android:fillColor="#FFFFFF"
        android:strokeAlpha="0.2"/>
</vector>
+31 −0
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"
    style="@style/DrawerItemStyle">

    <ImageView
        android:id="@+id/icon"
        style="@style/DrawerItemIconStyle"/>

    <LinearLayout
        android:id="@+id/secondline_container"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:layout_gravity="center_vertical"
        android:orientation="vertical">

        <TextView
            android:id="@+id/title"
            android:textAlignment="viewStart"
            style="@style/DrawerSecondLineTitleTextStyle" />

        <TextView
            android:id="@+id/summary"
            android:textAlignment="viewStart"
            style="@style/DrawerSecondLineSummaryTextStyle" />

    </LinearLayout>

</LinearLayout>
+3 −0
Original line number Diff line number Diff line
@@ -47,6 +47,9 @@
    <!-- An ID to be used for tagging text for copy in legacy fields. -->
    <item name="text_to_copy" type="id"/>

    <!-- Menu ID for profile item -->
    <item type="id" name="nav_myprofile" />

    <!-- Menu group ID for settings and help & feedback  -->
    <item type="id" name="nav_misc" />

+9 −0
Original line number Diff line number Diff line
@@ -593,4 +593,13 @@ background and text color. See also android:style/Widget.Holo.TextView.ListSepar
        <item name="android:paddingStart">@dimen/drawer_side_padding</item>
        <item name="android:paddingEnd">@dimen/drawer_label_header_end_padding</item>
    </style>

    <style name="DrawerSecondLineTitleTextStyle" parent="DrawerItemTextStyle">
        <item name="android:layout_width">match_parent</item>
    </style>

    <style name="DrawerSecondLineSummaryTextStyle" parent="DrawerItemTextStyle">
        <item name="android:textColor">@color/quantum_black_secondary_text</item>
        <item name="android:layout_width">match_parent</item>
    </style>
</resources>
+19 −0
Original line number Diff line number Diff line
@@ -1214,6 +1214,25 @@ public class PeopleActivity extends AppCompatContactsActivity implements
        onFilterMenuItemClicked(intent);
    }

    /*
     * Behavior when select MyInfo on Navigation drawer.
     * Launch in the same way as from Settings->MyInfo.
     * Refer to DisplayOptionsPreferenceFragment's onPreferenceClick.
     */
    @Override
    public void onProfileViewSelected(long profileContactId) {
        if (profileContactId != -1) {
            final Uri uri = ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI,
                    profileContactId);
            ImplicitIntentsUtil.startQuickContact(this, uri, ScreenType.ME_CONTACT);
        } else {
            final Intent intent = new Intent(Intent.ACTION_INSERT,
                    ContactsContract.Contacts.CONTENT_URI);
            intent.putExtra(ContactEditorFragment.INTENT_EXTRA_NEW_LOCAL_PROFILE, true);
            ImplicitIntentsUtil.startActivityInApp(this, intent);
        }
    }

    public boolean isGroupView() {
        return mCurrentView == ContactsView.GROUP_VIEW;
    }
Loading