Browse Source

Fixed flickering

This is why AndroidX was required
main
M66B 6 years ago
parent
commit
7c39cc9cd1
10 changed files with 17 additions and 17 deletions
  1. +1
    -1
      app/src/main/java/eu/faircode/email/FragmentAccount.java
  2. +1
    -1
      app/src/main/java/eu/faircode/email/FragmentAccounts.java
  3. +1
    -1
      app/src/main/java/eu/faircode/email/FragmentCompose.java
  4. +1
    -1
      app/src/main/java/eu/faircode/email/FragmentFolder.java
  5. +2
    -2
      app/src/main/java/eu/faircode/email/FragmentFolders.java
  6. +1
    -1
      app/src/main/java/eu/faircode/email/FragmentIdentities.java
  7. +1
    -1
      app/src/main/java/eu/faircode/email/FragmentIdentity.java
  8. +5
    -5
      app/src/main/java/eu/faircode/email/FragmentMessage.java
  9. +2
    -2
      app/src/main/java/eu/faircode/email/FragmentMessages.java
  10. +2
    -2
      app/src/main/java/eu/faircode/email/FragmentSetup.java

+ 1
- 1
app/src/main/java/eu/faircode/email/FragmentAccount.java View File

@ -202,7 +202,7 @@ public class FragmentAccount extends FragmentEx {
long id = (args == null ? -1 : args.getLong("id", -1));
// Observe
DB.getInstance(getContext()).account().liveAccount(id).observe(this, new Observer<EntityAccount>() {
DB.getInstance(getContext()).account().liveAccount(id).observe(getViewLifecycleOwner(), new Observer<EntityAccount>() {
@Override
public void onChanged(@Nullable EntityAccount account) {
etName.setText(account == null ? null : account.name);


+ 1
- 1
app/src/main/java/eu/faircode/email/FragmentAccounts.java View File

@ -90,7 +90,7 @@ public class FragmentAccounts extends FragmentEx {
super.onActivityCreated(savedInstanceState);
// Observe accounts
DB.getInstance(getContext()).account().liveAccounts().observe(this, new Observer<List<EntityAccount>>() {
DB.getInstance(getContext()).account().liveAccounts().observe(getViewLifecycleOwner(), new Observer<List<EntityAccount>>() {
@Override
public void onChanged(@Nullable List<EntityAccount> accounts) {
adapter.set(accounts);


+ 1
- 1
app/src/main/java/eu/faircode/email/FragmentCompose.java View File

@ -190,7 +190,7 @@ public class FragmentCompose extends FragmentEx {
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
DB.getInstance(getContext()).identity().liveIdentities(true).observe(FragmentCompose.this, new Observer<List<EntityIdentity>>() {
DB.getInstance(getContext()).identity().liveIdentities(true).observe(getViewLifecycleOwner(), new Observer<List<EntityIdentity>>() {
@Override
public void onChanged(@Nullable final List<EntityIdentity> identities) {
Collections.sort(identities, new Comparator<EntityIdentity>() {


+ 1
- 1
app/src/main/java/eu/faircode/email/FragmentFolder.java View File

@ -101,7 +101,7 @@ public class FragmentFolder extends FragmentEx {
long id = (args == null ? -1 : args.getLong("id"));
// Observe
DB.getInstance(getContext()).folder().liveFolder(id).observe(this, new Observer<EntityFolder>() {
DB.getInstance(getContext()).folder().liveFolder(id).observe(getViewLifecycleOwner(), new Observer<EntityFolder>() {
@Override
public void onChanged(@Nullable EntityFolder folder) {
if (folder != null) {


+ 2
- 2
app/src/main/java/eu/faircode/email/FragmentFolders.java View File

@ -90,7 +90,7 @@ public class FragmentFolders extends FragmentEx {
DB db = DB.getInstance(getContext());
// Observe account
db.account().liveAccount(account).observe(this, new Observer<EntityAccount>() {
db.account().liveAccount(account).observe(getViewLifecycleOwner(), new Observer<EntityAccount>() {
@Override
public void onChanged(@Nullable EntityAccount account) {
setSubtitle(account.name);
@ -98,7 +98,7 @@ public class FragmentFolders extends FragmentEx {
});
// Observe folders
db.folder().liveFolders(account).observe(this, new Observer<List<TupleFolderEx>>() {
db.folder().liveFolders(account).observe(getViewLifecycleOwner(), new Observer<List<TupleFolderEx>>() {
@Override
public void onChanged(@Nullable List<TupleFolderEx> folders) {
adapter.set(folders);


+ 1
- 1
app/src/main/java/eu/faircode/email/FragmentIdentities.java View File

@ -90,7 +90,7 @@ public class FragmentIdentities extends FragmentEx {
super.onActivityCreated(savedInstanceState);
// Observe identities
DB.getInstance(getContext()).identity().liveIdentities().observe(this, new Observer<List<EntityIdentity>>() {
DB.getInstance(getContext()).identity().liveIdentities().observe(getViewLifecycleOwner(), new Observer<List<EntityIdentity>>() {
@Override
public void onChanged(@Nullable List<EntityIdentity> identities) {
adapter.set(identities);


+ 1
- 1
app/src/main/java/eu/faircode/email/FragmentIdentity.java View File

@ -231,7 +231,7 @@ public class FragmentIdentity extends FragmentEx {
long id = (args == null ? -1 : args.getLong("id", -1));
// Observer
DB.getInstance(getContext()).identity().liveIdentity(id).observe(this, new Observer<EntityIdentity>() {
DB.getInstance(getContext()).identity().liveIdentity(id).observe(getViewLifecycleOwner(), new Observer<EntityIdentity>() {
@Override
public void onChanged(@Nullable EntityIdentity identity) {
etName.setText(identity == null ? null : identity.name);


+ 5
- 5
app/src/main/java/eu/faircode/email/FragmentMessage.java View File

@ -238,7 +238,7 @@ public class FragmentMessage extends FragmentEx {
final DB db = DB.getInstance(getContext());
// Observe message
db.message().liveMessage(id).observe(this, new Observer<TupleMessageEx>() {
db.message().liveMessage(id).observe(getViewLifecycleOwner(), new Observer<TupleMessageEx>() {
@Override
public void onChanged(@Nullable final TupleMessageEx message) {
if (message == null || message.ui_hide) {
@ -267,8 +267,8 @@ public class FragmentMessage extends FragmentEx {
tvFrom.setTextColor(colorUnseen);
tvTime.setTextColor(colorUnseen);
db.attachment().liveAttachments(id).removeObservers(FragmentMessage.this);
db.attachment().liveAttachments(id).observe(FragmentMessage.this,
db.attachment().liveAttachments(id).removeObservers(getViewLifecycleOwner());
db.attachment().liveAttachments(id).observe(getViewLifecycleOwner(),
new Observer<List<TupleAttachment>>() {
@Override
public void onChanged(@Nullable List<TupleAttachment> attachments) {
@ -291,8 +291,8 @@ public class FragmentMessage extends FragmentEx {
bottom_navigation.setTag(message.folderType);
db.folder().liveFolders(message.account).removeObservers(FragmentMessage.this);
db.folder().liveFolders(message.account).observe(FragmentMessage.this, new Observer<List<TupleFolderEx>>() {
db.folder().liveFolders(message.account).removeObservers(getViewLifecycleOwner());
db.folder().liveFolders(message.account).observe(getViewLifecycleOwner(), new Observer<List<TupleFolderEx>>() {
@Override
public void onChanged(@Nullable final List<TupleFolderEx> folders) {
boolean hasTrash = false;


+ 2
- 2
app/src/main/java/eu/faircode/email/FragmentMessages.java View File

@ -118,7 +118,7 @@ public class FragmentMessages extends FragmentEx {
setSubtitle(R.string.title_folder_unified);
messages = new LivePagedListBuilder<>(db.message().pagedUnifiedInbox(debug), PAGE_SIZE).build();
} else {
db.folder().liveFolderEx(folder).observe(this, new Observer<TupleFolderEx>() {
db.folder().liveFolderEx(folder).observe(getViewLifecycleOwner(), new Observer<TupleFolderEx>() {
@Override
public void onChanged(@Nullable TupleFolderEx folder) {
setSubtitle(folder == null ? null : Helper.localizeFolderName(getContext(), folder.name));
@ -132,7 +132,7 @@ public class FragmentMessages extends FragmentEx {
}
Log.i(Helper.TAG, "Observing messages");
messages.observe(this, new Observer<PagedList<TupleMessageEx>>() {
messages.observe(getViewLifecycleOwner(), new Observer<PagedList<TupleMessageEx>>() {
@Override
public void onChanged(@Nullable PagedList<TupleMessageEx> messages) {
Log.i(Helper.TAG, "Submit messages=" + messages.size());


+ 2
- 2
app/src/main/java/eu/faircode/email/FragmentSetup.java View File

@ -178,14 +178,14 @@ public class FragmentSetup extends FragmentEx {
DB db = DB.getInstance(getContext());
db.account().liveAccounts(true).observe(this, new Observer<List<EntityAccount>>() {
db.account().liveAccounts(true).observe(getViewLifecycleOwner(), new Observer<List<EntityAccount>>() {
@Override
public void onChanged(@Nullable List<EntityAccount> accounts) {
tvAccountDone.setVisibility(accounts.size() > 0 ? View.VISIBLE : View.INVISIBLE);
}
});
db.identity().liveIdentities(true).observe(this, new Observer<List<EntityIdentity>>() {
db.identity().liveIdentities(true).observe(getViewLifecycleOwner(), new Observer<List<EntityIdentity>>() {
@Override
public void onChanged(@Nullable List<EntityIdentity> identities) {
tvIdentityDone.setVisibility(identities.size() > 0 ? View.VISIBLE : View.INVISIBLE);


Loading…
Cancel
Save