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

Commit 0353a24d authored by Katherine Kuan's avatar Katherine Kuan Committed by Makoto Onuki
Browse files

New editor flow (for master)

- Added dialog-themed activity that pops up on new contact creation
in 3 cases with a variation of message when there are:
  * 0 writable accounts on the device
  * 1 writable account
  * 2+ writable accounts

- The dialog is displayed whenever a new account is added
to the device or the default account has been removed

- Once an account selection has been made by the user,
we store it in SharedPreferences using ContactEditorUtils

- Slight restyling of the account list adapter

Bug: 5355671

Original CL: Ib3343a5aea972b366a9df41b9419ad9561c2243d

Change-Id: I46f4c5687a5b6eaa68b55a568f0d737ad80dfc5c
parent a2aaa653
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -503,6 +503,13 @@
            android:windowSoftInputMode="adjustResize"
            android:exported="false"/>

        <!-- Accounts changed prompt that can appear when creating a new contact. -->
        <activity
            android:name=".activities.ContactEditorAccountsChangedActivity"
            android:theme="@style/ContactEditorAccountsChangedActivityTheme"
            android:windowSoftInputMode="adjustResize"
            android:exported="false"/>

        <!-- Create a new or edit an existing contact -->
        <activity
            android:name=".activities.ContactEditorActivity"
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@
            android:layout_height="wrap_content"
            android:layout_marginRight="8dip"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:textColor="?android:attr/textColorSecondary"
            android:singleLine="true"
            android:ellipsize="end"/>
    </LinearLayout>
+55 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 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.
-->

<!--
  Layout for account prompt (which includes a ListView) that can appear when
  the user creates a new contact.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <TextView android:id="@+id/text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="15dip"
        android:textAppearance="?android:attr/textAppearanceMedium"/>

    <View
        android:layout_width="match_parent"
        android:layout_height="1dip"
        android:background="?android:attr/listDivider"/>

    <ListView android:id="@+id/account_list"
        android:layout_width="match_parent"
        android:layout_height="0dip"
        android:layout_weight="1"
        android:fadingEdge="none"/>

    <View
        android:layout_width="match_parent"
        android:layout_height="1dip"
        android:background="?android:attr/listDivider"/>

    <Button
        android:id="@+id/add_account_button"
        style="?android:attr/buttonBarButtonStyle"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>

</LinearLayout>
+60 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 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.
-->

<!--
  Layout for account prompt (which just includes text and 2 buttons) that can appear when the user
  creates a new contact.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <TextView android:id="@+id/text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="15dip"
        android:textAppearance="?android:attr/textAppearanceMedium"/>

    <View
        android:layout_width="match_parent"
        android:layout_height="1dip"
        android:background="?android:attr/listDivider"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        style="?android:attr/buttonBarStyle">

        <Button
            android:id="@+id/left_button"
            style="?android:attr/buttonBarButtonStyle"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1" />

        <Button
            android:id="@+id/right_button"
            style="?android:attr/buttonBarButtonStyle"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1" />

    </LinearLayout>

</LinearLayout>
+6 −0
Original line number Diff line number Diff line
@@ -208,6 +208,12 @@
        <item name="android:windowCloseOnTouchOutside">true</item>
    </style>

    <style name="ContactEditorAccountsChangedActivityTheme" parent="@android:style/Theme.Holo.Light.Dialog.NoActionBar.MinWidth">
        <item name="android:windowCloseOnTouchOutside">true</item>
        <item name="android:textColorPrimary">@color/primary_text_color</item>
        <item name="android:textColorSecondary">@color/secondary_text_color</item>
    </style>

    <style name="SectionDivider">
        <item name="android:background">#7e7e87</item>
        <item name="android:layout_height">1dip</item>
Loading