Commit 2edfd8c9 authored by Thomas's avatar Thomas
Browse files

All accounts are cached in db before being in Intent

parent 2e20e78b
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -662,7 +662,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
                Intent intentAccount = new Intent(activity, ProfileActivity.class);
                Bundle args = new Bundle();
                args.putSerializable(Helper.ARG_ACCOUNT, account);
                new CachedBundle(activity).insertBundle(args, bundleId -> {
                new CachedBundle(activity).insertBundle(args, currentAccount, bundleId -> {
                    Bundle bundleCached = new Bundle();
                    bundleCached.putLong(Helper.ARG_INTENT_ID, bundleId);
                    intentAccount.putExtras(bundleCached);
@@ -673,7 +673,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
                Intent intentContext = new Intent(activity, ContextActivity.class);
                Bundle args = new Bundle();
                args.putSerializable(Helper.ARG_STATUS, status);
                new CachedBundle(activity).insertBundle(args, bundleId -> {
                new CachedBundle(activity).insertBundle(args, currentAccount, bundleId -> {
                    Bundle bundleCached = new Bundle();
                    bundleCached.putLong(Helper.ARG_INTENT_ID, bundleId);
                    intentContext.putExtras(bundleCached);
@@ -1048,7 +1048,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
                                    Intent intent = new Intent(activity, ProfileActivity.class);
                                    Bundle args = new Bundle();
                                    args.putSerializable(Helper.ARG_ACCOUNT, account);
                                    new CachedBundle(activity).insertBundle(args, bundleId -> {
                                    new CachedBundle(activity).insertBundle(args, currentAccount, bundleId -> {
                                        Bundle bundle = new Bundle();
                                        bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
                                        intent.putExtras(bundle);
@@ -1435,7 +1435,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
            Intent intent = new Intent(BaseMainActivity.this, ProfileActivity.class);
            Bundle args = new Bundle();
            args.putSerializable(Helper.ARG_ACCOUNT, currentAccount.mastodon_account);
            new CachedBundle(BaseMainActivity.this).insertBundle(args, bundleId -> {
            new CachedBundle(BaseMainActivity.this).insertBundle(args, currentAccount, bundleId -> {
                Bundle bundle = new Bundle();
                bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
                intent.putExtras(bundle);
+3 −1
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@ package app.fedilab.android.activities;
 * see <http://www.gnu.org/licenses>. */


import static app.fedilab.android.BaseMainActivity.currentAccount;

import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
@@ -122,7 +124,7 @@ public class AboutActivity extends BaseBarActivity {
                        Intent intent = new Intent(AboutActivity.this, ProfileActivity.class);
                        Bundle args = new Bundle();
                        args.putSerializable(Helper.ARG_ACCOUNT, account);
                        new CachedBundle(AboutActivity.this).insertBundle(args, bundleId -> {
                        new CachedBundle(AboutActivity.this).insertBundle(args, currentAccount, bundleId -> {
                            Bundle bundle = new Bundle();
                            bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
                            intent.putExtras(bundle);
+3 −1
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@ package app.fedilab.android.mastodon.activities;
 * see <http://www.gnu.org/licenses>. */


import static app.fedilab.android.BaseMainActivity.currentAccount;

import android.app.Activity;
import android.graphics.PorterDuff;
import android.os.Bundle;
@@ -66,7 +68,7 @@ public class AccountReportActivity extends BaseBarActivity {
        Bundle args = getIntent().getExtras();
        if (args != null) {
            long bundleId = args.getLong(Helper.ARG_INTENT_ID, -1);
            new CachedBundle(AccountReportActivity.this).getBundle(bundleId, this::initializeAfterBundle);
            new CachedBundle(AccountReportActivity.this).getBundle(bundleId, currentAccount, this::initializeAfterBundle);
        } else {
            initializeAfterBundle(null);
        }
+1 −1
Original line number Diff line number Diff line
@@ -488,7 +488,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
        if(b != null) {
            long bundleId = b.getLong(Helper.ARG_INTENT_ID, -1);
            if(bundleId != -1 ) {
                new CachedBundle(ComposeActivity.this).getBundle(bundleId, this::initializeAfterBundle);
                new CachedBundle(ComposeActivity.this).getBundle(bundleId, currentAccount, this::initializeAfterBundle);
            } else {
                initializeAfterBundle(b);
            }
+1 −1
Original line number Diff line number Diff line
@@ -263,7 +263,7 @@ public class EditProfileActivity extends BaseBarActivity {
        Bundle args = new Bundle();
        args.putBoolean(Helper.RECEIVE_REDRAW_PROFILE, true);
        args.putSerializable(Helper.ARG_ACCOUNT, account);
        new CachedBundle(EditProfileActivity.this).insertBundle(args, bundleId -> {
        new CachedBundle(EditProfileActivity.this).insertBundle(args, currentAccount, bundleId -> {
            Bundle bundle = new Bundle();
            bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
            Intent intentBD = new Intent(Helper.BROADCAST_DATA);
Loading