summaryrefslogtreecommitdiffstats
path: root/app/src/main/java/app/fedilab/android/mastodon/activities/ReorderTimelinesActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/app/fedilab/android/mastodon/activities/ReorderTimelinesActivity.java')
-rw-r--r--app/src/main/java/app/fedilab/android/mastodon/activities/ReorderTimelinesActivity.java47
1 files changed, 31 insertions, 16 deletions
diff --git a/app/src/main/java/app/fedilab/android/mastodon/activities/ReorderTimelinesActivity.java b/app/src/main/java/app/fedilab/android/mastodon/activities/ReorderTimelinesActivity.java
index a0cdd2673..b298ea21b 100644
--- a/app/src/main/java/app/fedilab/android/mastodon/activities/ReorderTimelinesActivity.java
+++ b/app/src/main/java/app/fedilab/android/mastodon/activities/ReorderTimelinesActivity.java
@@ -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.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
@@ -31,7 +33,6 @@ import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.lifecycle.ViewModelProvider;
-
import androidx.preference.PreferenceManager;
import androidx.recyclerview.widget.ItemTouchHelper;
import androidx.recyclerview.widget.LinearLayoutManager;
@@ -49,6 +50,7 @@ import app.fedilab.android.activities.MainActivity;
import app.fedilab.android.databinding.ActivityReorderTabsBinding;
import app.fedilab.android.databinding.PopupSearchInstanceBinding;
import app.fedilab.android.mastodon.client.entities.app.BottomMenu;
+import app.fedilab.android.mastodon.client.entities.app.CachedBundle;
import app.fedilab.android.mastodon.client.entities.app.InstanceSocial;
import app.fedilab.android.mastodon.client.entities.app.Pinned;
import app.fedilab.android.mastodon.client.entities.app.PinnedTimeline;
@@ -285,12 +287,16 @@ public class ReorderTimelinesActivity extends BaseBarActivity implements OnStart
}
}
reorderTabAdapter.notifyItemInserted(pinned.pinnedTimelines.size());
- Bundle b = new Bundle();
- b.putBoolean(Helper.RECEIVE_REDRAW_TOPBAR, true);
+ Bundle args = new Bundle();
+ args.putBoolean(Helper.RECEIVE_REDRAW_TOPBAR, true);
Intent intentBD = new Intent(Helper.BROADCAST_DATA);
- intentBD.putExtras(b);
- intentBD.setPackage(BuildConfig.APPLICATION_ID);
- sendBroadcast(intentBD);
+ new CachedBundle(ReorderTimelinesActivity.this).insertBundle(args, currentAccount, bundleId -> {
+ Bundle bundle = new Bundle();
+ bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
+ intentBD.putExtras(bundle);
+ intentBD.setPackage(BuildConfig.APPLICATION_ID);
+ sendBroadcast(intentBD);
+ });
});
} else {
runOnUiThread(() -> Toasty.warning(ReorderTimelinesActivity.this, getString(R.string.toast_instance_unavailable), Toast.LENGTH_LONG).show());
@@ -374,20 +380,29 @@ public class ReorderTimelinesActivity extends BaseBarActivity implements OnStart
super.onPause();
if (changes) {
//Update menu
- Bundle b = new Bundle();
- b.putBoolean(Helper.RECEIVE_REDRAW_TOPBAR, true);
+ Bundle args = new Bundle();
+ args.putBoolean(Helper.RECEIVE_REDRAW_TOPBAR, true);
Intent intentBD = new Intent(Helper.BROADCAST_DATA);
- intentBD.putExtras(b);
- intentBD.setPackage(BuildConfig.APPLICATION_ID);
- sendBroadcast(intentBD);
+ new CachedBundle(ReorderTimelinesActivity.this).insertBundle(args, currentAccount, bundleId -> {
+ Bundle bundle = new Bundle();
+ bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
+ intentBD.putExtras(bundle);
+ intentBD.setPackage(BuildConfig.APPLICATION_ID);
+ sendBroadcast(intentBD);
+ });
+
}
if (bottomChanges) {
- Bundle b = new Bundle();
- b.putBoolean(Helper.RECEIVE_REDRAW_BOTTOM, true);
+ Bundle args = new Bundle();
+ args.putBoolean(Helper.RECEIVE_REDRAW_BOTTOM, true);
Intent intentBD = new Intent(Helper.BROADCAST_DATA);
- intentBD.putExtras(b);
- intentBD.setPackage(BuildConfig.APPLICATION_ID);
- sendBroadcast(intentBD);
+ new CachedBundle(ReorderTimelinesActivity.this).insertBundle(args, currentAccount, bundleId -> {
+ Bundle bundle = new Bundle();
+ bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
+ intentBD.putExtras(bundle);
+ intentBD.setPackage(BuildConfig.APPLICATION_ID);
+ sendBroadcast(intentBD);
+ });
}
}