diff options
Diffstat (limited to 'app/src/main/java/it/niedermann')
10 files changed, 54 insertions, 4 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/ImportAccountActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/ImportAccountActivity.java index 7910c55de..307c717f4 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/ImportAccountActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/ImportAccountActivity.java @@ -210,6 +210,12 @@ public class ImportAccountActivity extends AppCompatActivity { } @Override + protected void onDestroy() { + super.onDestroy(); + this.binding = null; + } + + @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); AccountImporter.onRequestPermissionsResult(requestCode, permissions, grantResults, this); diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java index ba58104c5..915b5632c 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java @@ -455,6 +455,8 @@ public class MainActivity extends AppCompatActivity implements DeleteStackListen @Override protected void onDestroy() { super.onDestroy(); + this.binding = null; + this.headerBinding = null; if (tabLayoutHelper != null) { tabLayoutHelper.release(); } diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/PickStackActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/PickStackActivity.java index a024f1290..81f91aa82 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/PickStackActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/PickStackActivity.java @@ -118,6 +118,12 @@ public abstract class PickStackActivity extends AppCompatActivity implements Bra } @Override + protected void onDestroy() { + super.onDestroy(); + this.binding = null; + } + + @Override public void onStackPicked(@NonNull Account account, @Nullable Board board, @Nullable Stack stack) { viewModel.setSelected(account, board, stack); applyBrand(board == null diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/PushNotificationActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/PushNotificationActivity.java index 540575d1d..f76187a04 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/PushNotificationActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/PushNotificationActivity.java @@ -74,6 +74,12 @@ public class PushNotificationActivity extends AppCompatActivity { })); } + @Override + protected void onDestroy() { + super.onDestroy(); + this.binding = null; + } + private void openCardOnSubmit(@NonNull Account account, long boardLocalId, long cardLocalId) { DeckLog.info("Starting", EditActivity.class.getSimpleName(), "with [" + account + ", " + boardLocalId + ", " + cardLocalId + "]"); diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/about/AboutActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/about/AboutActivity.java index c37d0bc46..552e9b5fd 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/about/AboutActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/about/AboutActivity.java @@ -1,5 +1,7 @@ package it.niedermann.nextcloud.deck.ui.about; +import static it.niedermann.nextcloud.deck.ui.branding.BrandingUtil.applyBrandToPrimaryTabLayout; + import android.content.Context; import android.content.Intent; import android.os.Bundle; @@ -19,8 +21,6 @@ import it.niedermann.nextcloud.deck.databinding.ActivityAboutBinding; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.ui.exception.ExceptionHandler; -import static it.niedermann.nextcloud.deck.ui.branding.BrandingUtil.applyBrandToPrimaryTabLayout; - public class AboutActivity extends AppCompatActivity { private static final String BUNDLE_KEY_ACCOUNT = "account"; @@ -46,6 +46,12 @@ public class AboutActivity extends AppCompatActivity { new TabLayoutMediator(binding.tabLayout, binding.viewPager, (tab, position) -> tab.setText(tabTitles[position])).attach(); } + @Override + protected void onDestroy() { + super.onDestroy(); + this.binding = null; + } + private static class TabsPagerAdapter extends FragmentStateAdapter { @Nullable diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/archivedboards/ArchivedBoardsActvitiy.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/archivedboards/ArchivedBoardsActvitiy.java index 083606019..4a19b78e3 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/archivedboards/ArchivedBoardsActvitiy.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/archivedboards/ArchivedBoardsActvitiy.java @@ -67,6 +67,12 @@ public class ArchivedBoardsActvitiy extends AppCompatActivity implements DeleteB } + @Override + protected void onDestroy() { + super.onDestroy(); + this.binding = null; + } + @NonNull public static Intent createIntent(@NonNull Context context, @NonNull Account account) { return new Intent(context, ArchivedBoardsActvitiy.class) diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/archivedcards/ArchivedCardsActvitiy.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/archivedcards/ArchivedCardsActvitiy.java index 86aa749e7..ae023a7d8 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/archivedcards/ArchivedCardsActvitiy.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/archivedcards/ArchivedCardsActvitiy.java @@ -69,7 +69,12 @@ public class ArchivedCardsActvitiy extends AppCompatActivity { viewModel.getArchivedFullCardsForBoard(account.getId(), boardId).observe(this, (fullCards) -> adapter.setCardList(fullCards)); }); + } + @Override + protected void onDestroy() { + super.onDestroy(); + this.binding = null; } @NonNull diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/attachments/AttachmentsActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/attachments/AttachmentsActivity.java index 211dc4bb0..855ddf087 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/attachments/AttachmentsActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/attachments/AttachmentsActivity.java @@ -12,7 +12,6 @@ import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.SharedElementCallback; import androidx.core.content.ContextCompat; import androidx.core.graphics.drawable.DrawableCompat; -import androidx.fragment.app.Fragment; import androidx.lifecycle.ViewModelProvider; import androidx.recyclerview.widget.RecyclerView; import androidx.viewpager2.widget.ViewPager2; @@ -141,6 +140,7 @@ public class AttachmentsActivity extends AppCompatActivity implements Attachment protected void onDestroy() { binding.viewPager.unregisterOnPageChangeCallback(onPageChangeCallback); super.onDestroy(); + this.binding = null; } @NonNull diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/EditActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/EditActivity.java index b5317c9a8..292c6466d 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/EditActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/EditActivity.java @@ -98,6 +98,12 @@ public class EditActivity extends AppCompatActivity { loadDataFromIntent(); } + @Override + protected void onDestroy() { + super.onDestroy(); + this.binding = null; + } + private void loadDataFromIntent() { final var args = getIntent().getExtras(); diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/exception/ExceptionActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/exception/ExceptionActivity.java index 31a20bb33..e6a62c4e0 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/exception/ExceptionActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/exception/ExceptionActivity.java @@ -18,12 +18,13 @@ import it.niedermann.nextcloud.exception.ExceptionUtil; public class ExceptionActivity extends AppCompatActivity { private static final String KEY_THROWABLE = "throwable"; + private ActivityExceptionBinding binding; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); - final var binding = ActivityExceptionBinding.inflate(getLayoutInflater()); + binding = ActivityExceptionBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); setSupportActionBar(binding.toolbar); @@ -48,6 +49,12 @@ public class ExceptionActivity extends AppCompatActivity { adapter.setThrowable(this, null, throwable); } + @Override + protected void onDestroy() { + super.onDestroy(); + this.binding = null; + } + @NonNull public static Intent createIntent(@NonNull Context context, Throwable throwable) { return new Intent(context, ExceptionActivity.class) |