summaryrefslogtreecommitdiffstats
path: root/app/src/main/java/app/fedilab/android/mastodon/activities/admin/AdminAccountActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/app/fedilab/android/mastodon/activities/admin/AdminAccountActivity.java')
-rw-r--r--app/src/main/java/app/fedilab/android/mastodon/activities/admin/AdminAccountActivity.java27
1 files changed, 20 insertions, 7 deletions
diff --git a/app/src/main/java/app/fedilab/android/mastodon/activities/admin/AdminAccountActivity.java b/app/src/main/java/app/fedilab/android/mastodon/activities/admin/AdminAccountActivity.java
index f78e0af61..7f0794c34 100644
--- a/app/src/main/java/app/fedilab/android/mastodon/activities/admin/AdminAccountActivity.java
+++ b/app/src/main/java/app/fedilab/android/mastodon/activities/admin/AdminAccountActivity.java
@@ -61,6 +61,7 @@ import app.fedilab.android.mastodon.activities.MediaActivity;
import app.fedilab.android.mastodon.client.entities.api.Attachment;
import app.fedilab.android.mastodon.client.entities.api.admin.AdminAccount;
import app.fedilab.android.mastodon.client.entities.api.admin.AdminIp;
+import app.fedilab.android.mastodon.client.entities.app.CachedBundle;
import app.fedilab.android.mastodon.helper.Helper;
import app.fedilab.android.mastodon.helper.MastodonHelper;
import app.fedilab.android.mastodon.helper.SpannableHelper;
@@ -87,18 +88,32 @@ public class AdminAccountActivity extends BaseActivity {
setContentView(binding.getRoot());
setSupportActionBar(binding.toolbar);
ActionBar actionBar = getSupportActionBar();
- Bundle b = getIntent().getExtras();
+ Bundle args = getIntent().getExtras();
adminAccount = null;
- if (b != null) {
- adminAccount = (AdminAccount) b.getSerializable(Helper.ARG_ACCOUNT);
- account_id = b.getString(Helper.ARG_ACCOUNT_ID, null);
- }
postponeEnterTransition();
//Remove title
if (actionBar != null) {
actionBar.setDisplayShowTitleEnabled(false);
}
+
+ if (args != null) {
+ long bundleId = args.getLong(Helper.ARG_INTENT_ID, -1);
+ new CachedBundle(AdminAccountActivity.this).getBundle(bundleId, this::initializeAfterBundle);
+ } else {
+ initializeAfterBundle(null);
+ }
+
+
+ }
+
+
+ private void initializeAfterBundle(Bundle bundle) {
+
+ if(bundle !=null) {
+ adminAccount = (AdminAccount) bundle.getSerializable(Helper.ARG_ACCOUNT);
+ account_id = bundle.getString(Helper.ARG_ACCOUNT_ID, null);
+ }
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this);
float scale = sharedpreferences.getFloat(getString(R.string.SET_FONT_SCALE), 1.1f);
binding.title.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18 * 1.1f / scale);
@@ -175,8 +190,6 @@ public class AdminAccountActivity extends BaseActivity {
initializeView(adminAccount);
}
});
-
-
}
private void initializeView(AdminAccount adminAccount) {