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

Commit 8b3a1d84 authored by yaolu's avatar yaolu
Browse files

Modify provide status busy screen to just show spinner

Bug: 30566541

Test: Manual
https://drive.google.com/open?id=0BxaQ3Ze9jz_cMjA3QV9FMG5WUFk
https://drive.google.com/open?id=0BxaQ3Ze9jz_cbEhDZ2lYRjlLUmM

Change-Id: I381aef4d71300699fbb1ec3d38e4a1c4deec3022
parent f5f2fd4c
Loading
Loading
Loading
Loading
+37 −40
Original line number Diff line number Diff line
@@ -14,64 +14,61 @@
     limitations under the License.
-->

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

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
    android:layout_height="match_parent"
    android:gravity="center_horizontal"
    android:orientation="vertical">

    <ImageView
        android:id="@+id/empty_image"
        android:layout_width="@dimen/contacts_no_account_empty_image_width"
        android:layout_height="wrap_content"
            android:scaleType="centerInside"
        android:adjustViewBounds="true"
        android:scaleType="centerInside"
        android:src="@drawable/contacts_no_account_empty" />

    <TextView
        android:id="@+id/message"
        style="@style/EmptyStateTextStyle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/contacts_no_account_empty_text_padding_top"
        android:layout_gravity="center_horizontal"
            style="@style/EmptyStateTextStyle"/>

        <ProgressBar
            android:id="@+id/progress"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            style="?android:attr/progressBarStyleHorizontal"
            android:indeterminate="true"
            android:layout_gravity="center_horizontal"
            android:layout_marginTop="12dp" />
    </LinearLayout>
        android:layout_marginTop="@dimen/contacts_no_account_empty_text_padding_top" />

    <LinearLayout
        android:id="@+id/buttons_container"
        android:orientation="horizontal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal">
        android:gravity="center_horizontal"
        android:orientation="horizontal">

        <Button
            android:id="@+id/add_account_button"
            style="@style/NoAccountViewButtonStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="@dimen/contacts_no_account_buttons_margin"
            android:text="@string/contacts_unavailable_add_account"
            style="@style/NoAccountViewButtonStyle"/>
            android:text="@string/contacts_unavailable_add_account" />

        <Button
            android:id="@+id/import_contacts_button"
            style="@style/NoAccountViewButtonStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/contacts_unavailable_import_contacts"
            style="@style/NoAccountViewButtonStyle"/>
            android:text="@string/contacts_unavailable_import_contacts" />
    </LinearLayout>

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <ProgressBar
            android:id="@+id/progress"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:indeterminate="true"
            android:visibility="gone" />
    </FrameLayout>
</LinearLayout>
+33 −42
Original line number Diff line number Diff line
@@ -14,61 +14,52 @@
     limitations under the License.
-->

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

    <ImageView
        android:id="@+id/empty_image"
        android:layout_width="@dimen/contacts_no_account_empty_image_width"
        android:layout_height="wrap_content"
        android:scaleType="centerInside"
        android:adjustViewBounds="true"
        android:scaleType="centerInside"
        android:src="@drawable/contacts_no_account_empty" />

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">

    <TextView
        android:id="@+id/message"
        style="@style/EmptyStateTextStyle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/contacts_no_account_empty_text_padding_top"
            style="@style/EmptyStateTextStyle"/>

        <ProgressBar
            android:id="@+id/progress"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            style="?android:attr/progressBarStyleHorizontal"
            android:indeterminate="true"
            android:layout_gravity="center_horizontal"
            android:layout_marginTop="12dp" />
    </LinearLayout>

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
        android:layout_marginTop="@dimen/contacts_no_account_empty_text_padding_top" />

    <Button
        android:id="@+id/add_account_button"
        style="@style/NoAccountViewButtonStyle"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/contacts_no_account_empty_button_padding_top"
            android:text="@string/contacts_unavailable_add_account"
            style="@style/NoAccountViewButtonStyle"/>
        android:text="@string/contacts_unavailable_add_account" />

    <Button
        android:id="@+id/import_contacts_button"
        style="@style/NoAccountViewButtonStyle"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
            android:text="@string/contacts_unavailable_import_contacts"
            style="@style/NoAccountViewButtonStyle"/>
    </LinearLayout>
        android:text="@string/contacts_unavailable_import_contacts" />

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <ProgressBar
            android:id="@+id/progress"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:indeterminate="true"
            android:visibility="gone" />
    </FrameLayout>
</LinearLayout>
+0 −3
Original line number Diff line number Diff line
@@ -231,9 +231,6 @@
    <dimen name="quickcontact_expanding_button_section_height">48dp</dimen>
    <dimen name="quickcontact_expanding_button_section_padding">8dp</dimen>

    <!-- Top margin of the text message when provider status is busy -->
    <dimen name="update_contact_list_top_margin">188dp</dimen>

    <dimen name="expanding_entry_card_item_icon_height">24dp</dimen>
    <dimen name="expanding_entry_card_item_icon_width">24dp</dimen>

+0 −6
Original line number Diff line number Diff line
@@ -508,9 +508,6 @@
    <!-- An option in the 'Contact photo' dialog, if there is already a photo [CHAR LIMIT=50] -->
    <string name="pick_new_photo">Select new photo</string>

    <!-- Text shown in the contacts app while the background process updates contacts after a system upgrade [CHAR LIMIT=300] -->
    <string name="upgrade_in_progress">Contact list is being updated.</string>

    <!-- Title shown in the search result activity of contacts app while searching.  [CHAR LIMIT=20] -->
    <string name="search_results_searching">Searching\u2026</string>

@@ -920,9 +917,6 @@
    <!-- Content description of photo in photo picker indicating a photo from unknown account is selected. -->
    <string name="photo_view_description_checked_no_info">Photo from unknown account checked</string>

    <!-- Text shown in the contacts app while the background process updates contacts after a locale change [CHAR LIMIT=150]-->
    <string name="locale_change_in_progress">Contact list is being updated to reflect the change of language.\n\nPlease wait&#8230;</string>

    <!-- Left drawer menu item to open contacts assistant cards. [CHAR LIMIT=20]-->
    <string name="menu_assistant">Assistant</string>

+5 −21
Original line number Diff line number Diff line
@@ -103,10 +103,9 @@ public class ContactsUnavailableFragment extends Fragment implements OnClickList
        }
        if (providerStatus == ProviderStatusCompat.STATUS_EMPTY) {
            updateViewsForEmptyStatus();
        } else if (providerStatus == ProviderStatusCompat.STATUS_BUSY) {
            updateViewsForBusyStatus(R.string.upgrade_in_progress);
        } else if (providerStatus == ProviderStatusCompat.STATUS_CHANGING_LOCALE) {
            updateViewsForBusyStatus(R.string.locale_change_in_progress);
        } else if (providerStatus == ProviderStatusCompat.STATUS_BUSY
                || providerStatus == ProviderStatusCompat.STATUS_CHANGING_LOCALE) {
            updateViewsForBusyStatus();
        }
    }

@@ -122,22 +121,12 @@ public class ContactsUnavailableFragment extends Fragment implements OnClickList

    /**
     * Update views in the fragment when provider status is busy.
     *
     * @param resId resource ID of the string to show in mMessageView.
     */
    private void updateViewsForBusyStatus(int resId) {
        mMessageView.setText(resId);
        mMessageView.setVisibility(View.VISIBLE);
    private void updateViewsForBusyStatus() {
        mMessageView.setVisibility(View.GONE);
        mImageView.setVisibility(View.GONE);
        updateButtonVisibility(View.GONE);
        mProgress.setVisibility(View.VISIBLE);

        final ViewGroup.MarginLayoutParams layoutParams =
                (ViewGroup.MarginLayoutParams) mMessageView.getLayoutParams();
        final int marginTop =
                (int) getResources().getDimension(R.dimen.update_contact_list_top_margin);
        layoutParams.setMargins(0, marginTop, 0, 0);
        mMessageView.setGravity(Gravity.CENTER_HORIZONTAL);
    }

    @Override
@@ -153,11 +142,6 @@ public class ContactsUnavailableFragment extends Fragment implements OnClickList
        }
    }

    private boolean areContactsAvailable() {
        return (mProviderStatus != null) && mProviderStatus.equals(ProviderStatus.STATUS_NORMAL);
    }


    private void updateButtonVisibility(int visibility) {
        if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
            mAddAccountButton.setVisibility(visibility);