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

Commit 79658e14 authored by Walter Jang's avatar Walter Jang
Browse files

Remember editor expansion state on rotates (E10)

* Prompt user about discarding changes when back pressed
  on editor (regressed in E5)
* Show a toast and close when no editors (i.e. input
  fields) can be bound.
* Try to clarify the different behavior of
  CompactSectionSectionView for names and groups.

Bug 23589603

Change-Id: If045ddb6d839574dc4109195b0d8841cd6083561
parent 3daa9a34
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -768,6 +768,9 @@
    <!-- Content description for the compact contact editor photo overlay which, when clicked, shows a dialog with the options for changing the contact photo. [CHAR LIMIT=30] -->
    <string name="compact_editor_change_photo_content_description">Change photo</string>

    <!-- Toast message displayed when the editor fails to load for a contacts. [CHAR LIMIT=NONE] -->
    <string name="compact_editor_failed_to_load">Failed to open editor.</string>

    <!-- Quick contact display name with phonetic name -->
    <string name="quick_contact_display_name_with_phonetic"><xliff:g id="display_name">%s</xliff:g> (<xliff:g id="phonetic_name">%s</xliff:g>)</string>
</resources>
+1 −1
Original line number Diff line number Diff line
@@ -273,7 +273,7 @@ abstract public class ContactEditorBaseActivity extends ContactsActivity
    @Override
    public void onBackPressed() {
        if (mFragment != null) {
            mFragment.save(ContactEditor.SaveMode.CLOSE);
            mFragment.revert();
        }
    }

+12 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.Toast;

import java.io.FileNotFoundException;

@@ -353,6 +354,17 @@ public class CompactContactEditorFragment extends ContactEditorBaseFragment impl
        rebindEditorsForNewContact(oldState, oldAccount, newAccount);
    }

    @Override
    public void onBindEditorsFailed() {
        final Activity activity = getActivity();
        if (activity != null && !activity.isFinishing()) {
            Toast.makeText(activity, R.string.compact_editor_failed_to_load,
                    Toast.LENGTH_SHORT).show();
            activity.setResult(Activity.RESULT_CANCELED);
            activity.finish();
        }
    }

    private CompactRawContactsEditorView getContent() {
        return (CompactRawContactsEditorView) mContent;
    }
+136 −129

File changed.

Preview size limit exceeded, changes collapsed.

+88 −26

File changed.

Preview size limit exceeded, changes collapsed.

Loading