custom_intent
Thomas 10 months ago
parent b052547cc4
commit 09a8b6c43c

@ -79,6 +79,7 @@ import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction; import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProvider;
import androidx.multidex.BuildConfig;
import androidx.navigation.NavController; import androidx.navigation.NavController;
import androidx.navigation.Navigation; import androidx.navigation.Navigation;
import androidx.navigation.ui.AppBarConfiguration; import androidx.navigation.ui.AppBarConfiguration;
@ -220,11 +221,13 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
private final BroadcastReceiver broadcast_error_message = new BroadcastReceiver() { private final BroadcastReceiver broadcast_error_message = new BroadcastReceiver() {
@Override @Override
public void onReceive(android.content.Context context, Intent intent) { public void onReceive(android.content.Context context, Intent intent) {
Bundle b = intent.getExtras(); Bundle args = intent.getExtras();
if (b != null) { if (args != null) {
if (b.getBoolean(Helper.RECEIVE_COMPOSE_ERROR_MESSAGE, false)) { long bundleId = args.getLong(Helper.ARG_INTENT_ID, -1);
String errorMessage = b.getString(Helper.RECEIVE_ERROR_MESSAGE); new CachedBundle(BaseMainActivity.this).getBundle(bundleId, currentAccount, bundle -> {
StatusDraft statusDraft = (StatusDraft) b.getSerializable(Helper.ARG_STATUS_DRAFT); if (bundle.getBoolean(Helper.RECEIVE_COMPOSE_ERROR_MESSAGE, false)) {
String errorMessage = bundle.getString(Helper.RECEIVE_ERROR_MESSAGE);
StatusDraft statusDraft = (StatusDraft) bundle.getSerializable(Helper.ARG_STATUS_DRAFT);
Snackbar snackbar = Snackbar.make(binding.getRoot(), errorMessage, 5000); Snackbar snackbar = Snackbar.make(binding.getRoot(), errorMessage, 5000);
View snackbarView = snackbar.getView(); View snackbarView = snackbar.getView();
TextView textView = snackbarView.findViewById(com.google.android.material.R.id.snackbar_text); TextView textView = snackbarView.findViewById(com.google.android.material.R.id.snackbar_text);
@ -232,12 +235,20 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
snackbar snackbar
.setAction(getString(R.string.open_draft), view -> { .setAction(getString(R.string.open_draft), view -> {
Intent intentCompose = new Intent(context, ComposeActivity.class); Intent intentCompose = new Intent(context, ComposeActivity.class);
intentCompose.putExtra(Helper.ARG_STATUS_DRAFT, statusDraft); Bundle args2 = new Bundle();
args2.putSerializable(Helper.ARG_STATUS_DRAFT, statusDraft);
new CachedBundle(BaseMainActivity.this).insertBundle(args2, currentAccount, bundleId2 -> {
Bundle bundle2 = new Bundle();
bundle2.putLong(Helper.ARG_INTENT_ID, bundleId2);
intentCompose.putExtras(bundle2);
intentCompose.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intentCompose.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intentCompose); context.startActivity(intentCompose);
});
}) })
.show(); .show();
} }
});
} }
} }
}; };
@ -246,13 +257,15 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
private final BroadcastReceiver broadcast_data = new BroadcastReceiver() { private final BroadcastReceiver broadcast_data = new BroadcastReceiver() {
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
Bundle b = intent.getExtras(); Bundle args = intent.getExtras();
if (b != null) { if (args != null) {
if (b.getBoolean(Helper.RECEIVE_REDRAW_TOPBAR, false)) { long bundleId = args.getLong(Helper.ARG_INTENT_ID, -1);
List<MastodonList> mastodonLists = (List<MastodonList>) b.getSerializable(Helper.RECEIVE_MASTODON_LIST); new CachedBundle(BaseMainActivity.this).getBundle(bundleId, currentAccount, bundle -> {
if (bundle.getBoolean(Helper.RECEIVE_REDRAW_TOPBAR, false)) {
List<MastodonList> mastodonLists = (List<MastodonList>) bundle.getSerializable(Helper.RECEIVE_MASTODON_LIST);
redrawPinned(mastodonLists); redrawPinned(mastodonLists);
} }
if (b.getBoolean(Helper.RECEIVE_REDRAW_BOTTOM, false)) { if (bundle.getBoolean(Helper.RECEIVE_REDRAW_BOTTOM, false)) {
bottomMenu = new BottomMenu(BaseMainActivity.this).hydrate(currentAccount, binding.bottomNavView); bottomMenu = new BottomMenu(BaseMainActivity.this).hydrate(currentAccount, binding.bottomNavView);
if (bottomMenu != null) { if (bottomMenu != null) {
//ManageClick on bottom menu items //ManageClick on bottom menu items
@ -296,20 +309,20 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
return true; return true;
}); });
} }
} else if (b.getBoolean(Helper.RECEIVE_RECREATE_ACTIVITY, false)) { } else if (bundle.getBoolean(Helper.RECEIVE_RECREATE_ACTIVITY, false)) {
recreate(); recreate();
} else if (b.getBoolean(Helper.RECEIVE_NEW_MESSAGE, false)) { } else if (bundle.getBoolean(Helper.RECEIVE_NEW_MESSAGE, false)) {
Status statusSent = (Status) b.getSerializable(Helper.RECEIVE_STATUS_ACTION); Status statusSent = (Status) bundle.getSerializable(Helper.RECEIVE_STATUS_ACTION);
String statusEditId = b.getString(Helper.ARG_EDIT_STATUS_ID, null); String statusEditId = bundle.getString(Helper.ARG_EDIT_STATUS_ID, null);
Snackbar.make(binding.displaySnackBar, getString(R.string.message_has_been_sent), Snackbar.LENGTH_LONG) Snackbar.make(binding.displaySnackBar, getString(R.string.message_has_been_sent), Snackbar.LENGTH_LONG)
.setAction(getString(R.string.display), view -> { .setAction(getString(R.string.display), view -> {
Intent intentContext = new Intent(BaseMainActivity.this, ContextActivity.class); Intent intentContext = new Intent(BaseMainActivity.this, ContextActivity.class);
Bundle args = new Bundle(); Bundle args2 = new Bundle();
args.putSerializable(Helper.ARG_STATUS, statusSent); args2.putSerializable(Helper.ARG_STATUS, statusSent);
new CachedBundle(BaseMainActivity.this).insertBundle(args, currentAccount, bundleId -> { new CachedBundle(BaseMainActivity.this).insertBundle(args2, currentAccount, bundleId2 -> {
Bundle bundle = new Bundle(); Bundle bundle2 = new Bundle();
bundle.putLong(Helper.ARG_INTENT_ID, bundleId); bundle.putLong(Helper.ARG_INTENT_ID, bundleId2);
intentContext.putExtras(bundle); intentContext.putExtras(bundle2);
intentContext.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intentContext.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intentContext); startActivity(intentContext);
}); });
@ -334,6 +347,8 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
sendAction(context, Helper.ARG_STATUS_UPDATED, statusSent, null); sendAction(context, Helper.ARG_STATUS_UPDATED, statusSent, null);
} }
} }
});
} }
} }
}; };
@ -707,12 +722,17 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
} }
viewPager.setCurrentItem(position); viewPager.setCurrentItem(position);
} }
Bundle b = new Bundle(); Bundle args = new Bundle();
b.putBoolean(ARG_REFRESH_NOTFICATION, true); args.putBoolean(ARG_REFRESH_NOTFICATION, true);
Intent intentBC = new Intent(Helper.RECEIVE_STATUS_ACTION); Intent intentBC = new Intent(Helper.RECEIVE_STATUS_ACTION);
intentBC.setPackage(BuildConfig.APPLICATION_ID); intentBC.setPackage(BuildConfig.APPLICATION_ID);
intentBC.putExtras(b); new CachedBundle(activity).insertBundle(args, currentAccount, bundleId -> {
Bundle bundle = new Bundle();
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
intentBC.putExtras(bundle);
activity.sendBroadcast(intentBC); activity.sendBroadcast(intentBC);
});
} }
}, 1000); }, 1000);
intent.removeExtra(Helper.INTENT_ACTION); intent.removeExtra(Helper.INTENT_ACTION);

@ -120,9 +120,13 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
private final BroadcastReceiver imageReceiver = new BroadcastReceiver() { private final BroadcastReceiver imageReceiver = new BroadcastReceiver() {
@Override @Override
public void onReceive(android.content.Context context, Intent intent) { public void onReceive(android.content.Context context, Intent intent) {
String imgpath = intent.getStringExtra("imgpath"); Bundle args = intent.getExtras();
float focusX = intent.getFloatExtra("focusX", -2); if (args != null) {
float focusY = intent.getFloatExtra("focusY", -2); long bundleId = args.getLong(Helper.ARG_INTENT_ID, -1);
new CachedBundle(ComposeActivity.this).getBundle(bundleId, currentAccount, bundle -> {
String imgpath = bundle.getString("imgpath");
float focusX = bundle.getFloat("focusX", -2);
float focusY = bundle.getFloat("focusY", -2);
if (imgpath != null) { if (imgpath != null) {
int position = 0; int position = 0;
for (Status status : statusList) { for (Status status : statusList) {
@ -132,7 +136,6 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
if (focusX != -2) { if (focusX != -2) {
attachment.focus = focusX + "," + focusY; attachment.focus = focusX + "," + focusY;
} }
composeAdapter.notifyItemChanged(position); composeAdapter.notifyItemChanged(position);
break; break;
} }
@ -141,6 +144,8 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
position++; position++;
} }
} }
});
}
} }
}; };
private boolean promptSaveDraft; private boolean promptSaveDraft;

@ -41,6 +41,7 @@ import app.fedilab.android.activities.MainActivity;
import app.fedilab.android.databinding.ActivityHashtagBinding; import app.fedilab.android.databinding.ActivityHashtagBinding;
import app.fedilab.android.mastodon.client.entities.api.Filter; import app.fedilab.android.mastodon.client.entities.api.Filter;
import app.fedilab.android.mastodon.client.entities.api.Status; import app.fedilab.android.mastodon.client.entities.api.Status;
import app.fedilab.android.mastodon.client.entities.app.CachedBundle;
import app.fedilab.android.mastodon.client.entities.app.Pinned; import app.fedilab.android.mastodon.client.entities.app.Pinned;
import app.fedilab.android.mastodon.client.entities.app.PinnedTimeline; import app.fedilab.android.mastodon.client.entities.app.PinnedTimeline;
import app.fedilab.android.mastodon.client.entities.app.StatusDraft; import app.fedilab.android.mastodon.client.entities.app.StatusDraft;
@ -158,11 +159,15 @@ public class HashTagActivity extends BaseActivity {
List<Status> statuses = new ArrayList<>(); List<Status> statuses = new ArrayList<>();
statuses.add(status); statuses.add(status);
statusDraft.statusDraftList = statuses; statusDraft.statusDraftList = statuses;
Bundle _b = new Bundle(); Bundle args = new Bundle();
_b.putSerializable(Helper.ARG_STATUS_DRAFT, statusDraft); args.putSerializable(Helper.ARG_STATUS_DRAFT, statusDraft);
intentToot.putExtras(_b); new CachedBundle(HashTagActivity.this).insertBundle(args, currentAccount, bundleId -> {
Bundle bundleCached = new Bundle();
bundleCached.putLong(Helper.ARG_INTENT_ID, bundleId);
intentToot.putExtras(bundleCached);
startActivity(intentToot); startActivity(intentToot);
}); });
});
} }
@Override @Override
@ -188,14 +193,19 @@ public class HashTagActivity extends BaseActivity {
} }
pinnedTag = false; pinnedTag = false;
invalidateOptionsMenu(); invalidateOptionsMenu();
Bundle b = new Bundle(); Bundle args = new Bundle();
b.putBoolean(Helper.RECEIVE_REDRAW_TOPBAR, true); args.putBoolean(Helper.RECEIVE_REDRAW_TOPBAR, true);
Intent intentBD = new Intent(Helper.BROADCAST_DATA); Intent intentBD = new Intent(Helper.BROADCAST_DATA);
intentBD.putExtras(b); new CachedBundle(HashTagActivity.this).insertBundle(args, currentAccount, bundleId -> {
Bundle bundle = new Bundle();
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
intentBD.putExtras(bundle);
intentBD.setPackage(BuildConfig.APPLICATION_ID); intentBD.setPackage(BuildConfig.APPLICATION_ID);
sendBroadcast(intentBD); sendBroadcast(intentBD);
dialog.dismiss(); dialog.dismiss();
}); });
});
unpinConfirm.show(); unpinConfirm.show();
} else { } else {
new Thread(() -> { new Thread(() -> {
@ -243,12 +253,16 @@ public class HashTagActivity extends BaseActivity {
} else { } else {
new Pinned(HashTagActivity.this).insertPinned(pinned); new Pinned(HashTagActivity.this).insertPinned(pinned);
} }
Bundle b = new Bundle(); Bundle args = new Bundle();
b.putBoolean(Helper.RECEIVE_REDRAW_TOPBAR, true); args.putBoolean(Helper.RECEIVE_REDRAW_TOPBAR, true);
Intent intentBD = new Intent(Helper.BROADCAST_DATA); Intent intentBD = new Intent(Helper.BROADCAST_DATA);
intentBD.putExtras(b); new CachedBundle(HashTagActivity.this).insertBundle(args, currentAccount, bundleId -> {
Bundle bundle = new Bundle();
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
intentBD.putExtras(bundle);
intentBD.setPackage(BuildConfig.APPLICATION_ID); intentBD.setPackage(BuildConfig.APPLICATION_ID);
sendBroadcast(intentBD); sendBroadcast(intentBD);
});
pinnedTag = true; pinnedTag = true;
invalidateOptionsMenu(); invalidateOptionsMenu();
} catch (DBException e) { } catch (DBException e) {

@ -15,6 +15,8 @@ package app.fedilab.android.mastodon.activities;
* see <http://www.gnu.org/licenses>. */ * see <http://www.gnu.org/licenses>. */
import static app.fedilab.android.BaseMainActivity.currentAccount;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
@ -45,12 +47,12 @@ import java.util.Objects;
import app.fedilab.android.BaseMainActivity; import app.fedilab.android.BaseMainActivity;
import app.fedilab.android.BuildConfig; import app.fedilab.android.BuildConfig;
import app.fedilab.android.R; import app.fedilab.android.R;
import app.fedilab.android.activities.MainActivity;
import app.fedilab.android.databinding.ActivityListBinding; import app.fedilab.android.databinding.ActivityListBinding;
import app.fedilab.android.databinding.PopupAddListBinding; import app.fedilab.android.databinding.PopupAddListBinding;
import app.fedilab.android.databinding.PopupManageAccountsListBinding; import app.fedilab.android.databinding.PopupManageAccountsListBinding;
import app.fedilab.android.mastodon.client.entities.api.Account; import app.fedilab.android.mastodon.client.entities.api.Account;
import app.fedilab.android.mastodon.client.entities.api.MastodonList; import app.fedilab.android.mastodon.client.entities.api.MastodonList;
import app.fedilab.android.mastodon.client.entities.app.CachedBundle;
import app.fedilab.android.mastodon.client.entities.app.Pinned; import app.fedilab.android.mastodon.client.entities.app.Pinned;
import app.fedilab.android.mastodon.client.entities.app.PinnedTimeline; import app.fedilab.android.mastodon.client.entities.app.PinnedTimeline;
import app.fedilab.android.mastodon.client.entities.app.Timeline; import app.fedilab.android.mastodon.client.entities.app.Timeline;
@ -175,7 +177,7 @@ public class MastodonListActivity extends BaseBarActivity implements MastodonLis
timelinesVM.getAccountsInList(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, mastodonList.id, null, null, 0) timelinesVM.getAccountsInList(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, mastodonList.id, null, null, 0)
.observe(MastodonListActivity.this, accounts -> { .observe(MastodonListActivity.this, accounts -> {
if (accounts != null && accounts.size() > 0) { if (accounts != null && accounts.size() > 0) {
accountsVM.muteAccountsHome(MainActivity.currentAccount, accounts); accountsVM.muteAccountsHome(currentAccount, accounts);
} }
}); });
dialog.dismiss(); dialog.dismiss();
@ -307,14 +309,18 @@ public class MastodonListActivity extends BaseBarActivity implements MastodonLis
} else { } else {
binding.notContent.setVisibility(View.GONE); binding.notContent.setVisibility(View.GONE);
} }
Bundle b = new Bundle(); Bundle args = new Bundle();
b.putBoolean(Helper.RECEIVE_REDRAW_TOPBAR, true); args.putBoolean(Helper.RECEIVE_REDRAW_TOPBAR, true);
Intent intentBD = new Intent(Helper.BROADCAST_DATA); Intent intentBD = new Intent(Helper.BROADCAST_DATA);
b.putSerializable(Helper.RECEIVE_MASTODON_LIST, mastodonListList); args.putSerializable(Helper.RECEIVE_MASTODON_LIST, mastodonListList);
intentBD.putExtras(b); new CachedBundle(MastodonListActivity.this).insertBundle(args, currentAccount, bundleId -> {
Bundle bundle = new Bundle();
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
intentBD.putExtras(bundle);
intentBD.setPackage(BuildConfig.APPLICATION_ID); intentBD.setPackage(BuildConfig.APPLICATION_ID);
sendBroadcast(intentBD); sendBroadcast(intentBD);
}); });
});
alt_bld.setNegativeButton(R.string.cancel, (dialog, id) -> dialog.dismiss()); alt_bld.setNegativeButton(R.string.cancel, (dialog, id) -> dialog.dismiss());
AlertDialog alert = alt_bld.create(); AlertDialog alert = alt_bld.create();
alert.show(); alert.show();
@ -343,14 +349,18 @@ public class MastodonListActivity extends BaseBarActivity implements MastodonLis
} else { } else {
Toasty.error(MastodonListActivity.this, getString(R.string.toast_error), Toasty.LENGTH_LONG).show(); Toasty.error(MastodonListActivity.this, getString(R.string.toast_error), Toasty.LENGTH_LONG).show();
} }
Bundle b = new Bundle(); Bundle args = new Bundle();
b.putBoolean(Helper.RECEIVE_REDRAW_TOPBAR, true); args.putBoolean(Helper.RECEIVE_REDRAW_TOPBAR, true);
Intent intentBD = new Intent(Helper.BROADCAST_DATA); Intent intentBD = new Intent(Helper.BROADCAST_DATA);
b.putSerializable(Helper.RECEIVE_MASTODON_LIST, mastodonListList); args.putSerializable(Helper.RECEIVE_MASTODON_LIST, mastodonListList);
intentBD.putExtras(b); new CachedBundle(MastodonListActivity.this).insertBundle(args, currentAccount, bundleId -> {
Bundle bundle = new Bundle();
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
intentBD.putExtras(bundle);
intentBD.setPackage(BuildConfig.APPLICATION_ID); intentBD.setPackage(BuildConfig.APPLICATION_ID);
sendBroadcast(intentBD); sendBroadcast(intentBD);
}); });
});
dialog.dismiss(); dialog.dismiss();
} else { } else {
popupAddListBinding.addList.setError(getString(R.string.not_valid_list_name)); popupAddListBinding.addList.setError(getString(R.string.not_valid_list_name));
@ -392,12 +402,16 @@ public class MastodonListActivity extends BaseBarActivity implements MastodonLis
new Thread(() -> { new Thread(() -> {
try { try {
new Pinned(MastodonListActivity.this).updatePinned(pinned); new Pinned(MastodonListActivity.this).updatePinned(pinned);
Bundle b = new Bundle(); Bundle args = new Bundle();
b.putBoolean(Helper.RECEIVE_REDRAW_TOPBAR, true); args.putBoolean(Helper.RECEIVE_REDRAW_TOPBAR, true);
Intent intentBD = new Intent(Helper.BROADCAST_DATA); Intent intentBD = new Intent(Helper.BROADCAST_DATA);
intentBD.putExtras(b); new CachedBundle(MastodonListActivity.this).insertBundle(args, currentAccount, bundleId -> {
Bundle bundle = new Bundle();
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
intentBD.putExtras(bundle);
intentBD.setPackage(BuildConfig.APPLICATION_ID); intentBD.setPackage(BuildConfig.APPLICATION_ID);
sendBroadcast(intentBD); sendBroadcast(intentBD);
});
} catch ( } catch (
DBException e) { DBException e) {
e.printStackTrace(); e.printStackTrace();

@ -84,10 +84,10 @@ public class MediaActivity extends BaseTransparentActivity implements OnDownload
private final BroadcastReceiver onDownloadComplete = new BroadcastReceiver() { private final BroadcastReceiver onDownloadComplete = new BroadcastReceiver() {
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
long id = intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1); long id = intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1);
if (downloadID == id) { if (downloadID == id) {
DownloadManager manager = (DownloadManager) context.getSystemService(DOWNLOAD_SERVICE); DownloadManager manager = (DownloadManager) context.getSystemService(DOWNLOAD_SERVICE);
assert manager != null;
Uri uri = manager.getUriForDownloadedFile(downloadID); Uri uri = manager.getUriForDownloadedFile(downloadID);
Intent shareIntent = new Intent(Intent.ACTION_SEND); Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_STREAM, uri); shareIntent.putExtra(Intent.EXTRA_STREAM, uri);

@ -135,7 +135,6 @@ public class ProfileActivity extends BaseActivity {
Bundle args = intent.getExtras(); Bundle args = intent.getExtras();
if (args != null) { if (args != null) {
long bundleId = args.getLong(Helper.ARG_INTENT_ID, -1); long bundleId = args.getLong(Helper.ARG_INTENT_ID, -1);
if (bundleId != -1) {
new CachedBundle(ProfileActivity.this).getBundle(bundleId, currentAccount, bundle -> { new CachedBundle(ProfileActivity.this).getBundle(bundleId, currentAccount, bundle -> {
Account accountReceived = (Account) bundle.getSerializable(Helper.ARG_ACCOUNT); Account accountReceived = (Account) bundle.getSerializable(Helper.ARG_ACCOUNT);
if (bundle.getBoolean(Helper.RECEIVE_REDRAW_PROFILE, false) && accountReceived != null) { if (bundle.getBoolean(Helper.RECEIVE_REDRAW_PROFILE, false) && accountReceived != null) {
@ -144,14 +143,6 @@ public class ProfileActivity extends BaseActivity {
} }
} }
}); });
} else {
Account accountReceived = (Account) args.getSerializable(Helper.ARG_ACCOUNT);
if (args.getBoolean(Helper.RECEIVE_REDRAW_PROFILE, false) && accountReceived != null) {
if (account != null && accountReceived.id != null && account.id != null && accountReceived.id.equalsIgnoreCase(account.id)) {
initializeView(accountReceived);
}
}
}
} }
} }
}; };
@ -926,13 +917,17 @@ public class ProfileActivity extends BaseActivity {
new Pinned(ProfileActivity.this).insertPinned(finalPinned); new Pinned(ProfileActivity.this).insertPinned(finalPinned);
} }
runOnUiThread(() -> { runOnUiThread(() -> {
Bundle b = new Bundle(); Bundle args = new Bundle();
b.putBoolean(Helper.RECEIVE_REDRAW_TOPBAR, true); args.putBoolean(Helper.RECEIVE_REDRAW_TOPBAR, true);
Intent intentBD = new Intent(Helper.BROADCAST_DATA); Intent intentBD = new Intent(Helper.BROADCAST_DATA);
intentBD.putExtras(b); new CachedBundle(ProfileActivity.this).insertBundle(args, currentAccount, bundleId -> {
Bundle bundle = new Bundle();
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
intentBD.putExtras(bundle);
intentBD.setPackage(BuildConfig.APPLICATION_ID); intentBD.setPackage(BuildConfig.APPLICATION_ID);
sendBroadcast(intentBD); sendBroadcast(intentBD);
}); });
});
} catch (DBException e) { } catch (DBException e) {
e.printStackTrace(); e.printStackTrace();
} }

@ -15,6 +15,8 @@ package app.fedilab.android.mastodon.activities;
* see <http://www.gnu.org/licenses>. */ * see <http://www.gnu.org/licenses>. */
import static app.fedilab.android.BaseMainActivity.currentAccount;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
@ -48,6 +50,7 @@ import app.fedilab.android.activities.MainActivity;
import app.fedilab.android.databinding.ActivityReorderTabsBinding; import app.fedilab.android.databinding.ActivityReorderTabsBinding;
import app.fedilab.android.databinding.PopupSearchInstanceBinding; import app.fedilab.android.databinding.PopupSearchInstanceBinding;
import app.fedilab.android.mastodon.client.entities.app.BottomMenu; 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.InstanceSocial;
import app.fedilab.android.mastodon.client.entities.app.Pinned; import app.fedilab.android.mastodon.client.entities.app.Pinned;
import app.fedilab.android.mastodon.client.entities.app.PinnedTimeline; import app.fedilab.android.mastodon.client.entities.app.PinnedTimeline;
@ -284,13 +287,17 @@ public class ReorderTimelinesActivity extends BaseBarActivity implements OnStart
} }
} }
reorderTabAdapter.notifyItemInserted(pinned.pinnedTimelines.size()); reorderTabAdapter.notifyItemInserted(pinned.pinnedTimelines.size());
Bundle b = new Bundle(); Bundle args = new Bundle();
b.putBoolean(Helper.RECEIVE_REDRAW_TOPBAR, true); args.putBoolean(Helper.RECEIVE_REDRAW_TOPBAR, true);
Intent intentBD = new Intent(Helper.BROADCAST_DATA); Intent intentBD = new Intent(Helper.BROADCAST_DATA);
intentBD.putExtras(b); 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); intentBD.setPackage(BuildConfig.APPLICATION_ID);
sendBroadcast(intentBD); sendBroadcast(intentBD);
}); });
});
} else { } else {
runOnUiThread(() -> Toasty.warning(ReorderTimelinesActivity.this, getString(R.string.toast_instance_unavailable), Toast.LENGTH_LONG).show()); runOnUiThread(() -> Toasty.warning(ReorderTimelinesActivity.this, getString(R.string.toast_instance_unavailable), Toast.LENGTH_LONG).show());
} }
@ -373,20 +380,29 @@ public class ReorderTimelinesActivity extends BaseBarActivity implements OnStart
super.onPause(); super.onPause();
if (changes) { if (changes) {
//Update menu //Update menu
Bundle b = new Bundle(); Bundle args = new Bundle();
b.putBoolean(Helper.RECEIVE_REDRAW_TOPBAR, true); args.putBoolean(Helper.RECEIVE_REDRAW_TOPBAR, true);
Intent intentBD = new Intent(Helper.BROADCAST_DATA); Intent intentBD = new Intent(Helper.BROADCAST_DATA);
intentBD.putExtras(b); 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); intentBD.setPackage(BuildConfig.APPLICATION_ID);
sendBroadcast(intentBD); sendBroadcast(intentBD);
});
} }
if (bottomChanges) { if (bottomChanges) {
Bundle b = new Bundle(); Bundle args = new Bundle();
b.putBoolean(Helper.RECEIVE_REDRAW_BOTTOM, true); args.putBoolean(Helper.RECEIVE_REDRAW_BOTTOM, true);
Intent intentBD = new Intent(Helper.BROADCAST_DATA); Intent intentBD = new Intent(Helper.BROADCAST_DATA);
intentBD.putExtras(b); 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); intentBD.setPackage(BuildConfig.APPLICATION_ID);
sendBroadcast(intentBD); sendBroadcast(intentBD);
});
} }
} }

@ -14,6 +14,7 @@ package app.fedilab.android.mastodon.activities.admin;
* You should have received a copy of the GNU General Public License along with Fedilab; if not, * You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */ * see <http://www.gnu.org/licenses>. */
import static app.fedilab.android.BaseMainActivity.currentAccount;
import static app.fedilab.android.mastodon.activities.admin.AdminActionActivity.AdminEnum.ACCOUNT; import static app.fedilab.android.mastodon.activities.admin.AdminActionActivity.AdminEnum.ACCOUNT;
import static app.fedilab.android.mastodon.activities.admin.AdminActionActivity.AdminEnum.DOMAIN; import static app.fedilab.android.mastodon.activities.admin.AdminActionActivity.AdminEnum.DOMAIN;
import static app.fedilab.android.mastodon.activities.admin.AdminActionActivity.AdminEnum.REPORT; import static app.fedilab.android.mastodon.activities.admin.AdminActionActivity.AdminEnum.REPORT;
@ -43,6 +44,7 @@ import app.fedilab.android.databinding.PopupAdminFilterAccountsBinding;
import app.fedilab.android.databinding.PopupAdminFilterReportsBinding; import app.fedilab.android.databinding.PopupAdminFilterReportsBinding;
import app.fedilab.android.mastodon.activities.BaseBarActivity; import app.fedilab.android.mastodon.activities.BaseBarActivity;
import app.fedilab.android.mastodon.client.entities.api.admin.AdminDomainBlock; import app.fedilab.android.mastodon.client.entities.api.admin.AdminDomainBlock;
import app.fedilab.android.mastodon.client.entities.app.CachedBundle;
import app.fedilab.android.mastodon.helper.Helper; import app.fedilab.android.mastodon.helper.Helper;
import app.fedilab.android.mastodon.helper.ThemeHelper; import app.fedilab.android.mastodon.helper.ThemeHelper;
import app.fedilab.android.mastodon.ui.fragment.admin.FragmentAdminAccount; import app.fedilab.android.mastodon.ui.fragment.admin.FragmentAdminAccount;
@ -63,19 +65,22 @@ public class AdminActionActivity extends BaseBarActivity {
private final BroadcastReceiver mReceiver = new BroadcastReceiver() { private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
Bundle b = intent.getExtras(); Bundle args = intent.getExtras();
if (b != null) { if (args != null) {
AdminDomainBlock adminDomainBlock = (AdminDomainBlock) b.getSerializable(Helper.ARG_ADMIN_DOMAINBLOCK); long bundleId = args.getLong(Helper.ARG_INTENT_ID, -1);
AdminDomainBlock adminDomainBlockDelete = (AdminDomainBlock) b.getSerializable(Helper.ARG_ADMIN_DOMAINBLOCK_DELETE); new CachedBundle(AdminActionActivity.this).getBundle(bundleId, currentAccount, bundle -> {
AdminDomainBlock adminDomainBlock = (AdminDomainBlock) bundle.getSerializable(Helper.ARG_ADMIN_DOMAINBLOCK);
AdminDomainBlock adminDomainBlockDelete = (AdminDomainBlock) bundle.getSerializable(Helper.ARG_ADMIN_DOMAINBLOCK_DELETE);
if (adminDomainBlock != null && adminDomainBlock.domain != null && fragmentAdminDomain != null) { if (adminDomainBlock != null && adminDomainBlock.domain != null && fragmentAdminDomain != null) {
fragmentAdminDomain.update(adminDomainBlock); fragmentAdminDomain.update(adminDomainBlock);
} }
if (adminDomainBlockDelete != null && fragmentAdminDomain != null) { if (adminDomainBlockDelete != null && fragmentAdminDomain != null) {
fragmentAdminDomain.delete(adminDomainBlockDelete); fragmentAdminDomain.delete(adminDomainBlockDelete);
} }
} });
} }
}
}; };
@Override @Override

@ -15,6 +15,8 @@ package app.fedilab.android.mastodon.activities.admin;
* see <http://www.gnu.org/licenses>. */ * see <http://www.gnu.org/licenses>. */
import static app.fedilab.android.BaseMainActivity.currentAccount;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.Menu; import android.view.Menu;
@ -37,6 +39,7 @@ import app.fedilab.android.activities.MainActivity;
import app.fedilab.android.databinding.ActivityAdminDomainblockBinding; import app.fedilab.android.databinding.ActivityAdminDomainblockBinding;
import app.fedilab.android.mastodon.activities.BaseBarActivity; import app.fedilab.android.mastodon.activities.BaseBarActivity;
import app.fedilab.android.mastodon.client.entities.api.admin.AdminDomainBlock; import app.fedilab.android.mastodon.client.entities.api.admin.AdminDomainBlock;
import app.fedilab.android.mastodon.client.entities.app.CachedBundle;
import app.fedilab.android.mastodon.helper.Helper; import app.fedilab.android.mastodon.helper.Helper;
import app.fedilab.android.mastodon.viewmodel.mastodon.AdminVM; import app.fedilab.android.mastodon.viewmodel.mastodon.AdminVM;
import es.dmoral.toasty.Toasty; import es.dmoral.toasty.Toasty;
@ -109,10 +112,17 @@ public class AdminDomainBlockActivity extends BaseBarActivity {
} else { } else {
Toasty.error(AdminDomainBlockActivity.this, getString(R.string.toast_error), Toasty.LENGTH_SHORT).show(); Toasty.error(AdminDomainBlockActivity.this, getString(R.string.toast_error), Toasty.LENGTH_SHORT).show();
} }
Intent intent = new Intent(Helper.BROADCAST_DATA).putExtra(Helper.ARG_ADMIN_DOMAINBLOCK, adminDomainBlockResult); Intent intent = new Intent(Helper.BROADCAST_DATA);
Bundle args = new Bundle();
args.putSerializable(Helper.ARG_ADMIN_DOMAINBLOCK, adminDomainBlockResult);
new CachedBundle(AdminDomainBlockActivity.this).insertBundle(args, currentAccount, bundleId -> {
Bundle bundle = new Bundle();
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
intent.putExtras(bundle);
intent.setPackage(BuildConfig.APPLICATION_ID); intent.setPackage(BuildConfig.APPLICATION_ID);
sendBroadcast(intent); sendBroadcast(intent);
finish(); finish();
});
} }
); );
}); });
@ -138,10 +148,18 @@ public class AdminDomainBlockActivity extends BaseBarActivity {
.setPositiveButton(R.string.unblock_domain, (dialog, which) -> { .setPositiveButton(R.string.unblock_domain, (dialog, which) -> {
adminVM.deleteDomain(MainActivity.currentInstance, MainActivity.currentToken, adminDomainBlock.id) adminVM.deleteDomain(MainActivity.currentInstance, MainActivity.currentToken, adminDomainBlock.id)
.observe(AdminDomainBlockActivity.this, adminDomainBlockResult -> { .observe(AdminDomainBlockActivity.this, adminDomainBlockResult -> {
Intent intent = new Intent(Helper.BROADCAST_DATA).putExtra(Helper.ARG_ADMIN_DOMAINBLOCK_DELETE, adminDomainBlock); Intent intent = new Intent(Helper.BROADCAST_DATA);
Bundle args = new Bundle();
args.putSerializable(Helper.ARG_ADMIN_DOMAINBLOCK_DELETE, adminDomainBlock);
new CachedBundle(AdminDomainBlockActivity.this).insertBundle(args, currentAccount, bundleId -> {
Bundle bundle = new Bundle();
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
intent.putExtras(bundle);
intent.setPackage(BuildConfig.APPLICATION_ID); intent.setPackage(BuildConfig.APPLICATION_ID);
sendBroadcast(intent); sendBroadcast(intent);
finish(); finish();
});
} }
); );
dialog.dismiss(); dialog.dismiss();

@ -872,13 +872,17 @@ public class Helper {
*/ */
public static void sendToastMessage(Context context, String type, String content) { public static void sendToastMessage(Context context, String type, String content) {
Intent intentBC = new Intent(context, ToastMessage.class); Intent intentBC = new Intent(context, ToastMessage.class);
Bundle b = new Bundle(); Bundle args = new Bundle();
b.putString(RECEIVE_TOAST_TYPE, type); args.putString(RECEIVE_TOAST_TYPE, type);
b.putString(RECEIVE_TOAST_CONTENT, content); args.putString(RECEIVE_TOAST_CONTENT, content);
intentBC.setAction(Helper.RECEIVE_TOAST_MESSAGE); intentBC.setAction(Helper.RECEIVE_TOAST_MESSAGE);
intentBC.putExtras(b); new CachedBundle(context).insertBundle(args, currentAccount, bundleId -> {
Bundle bundle = new Bundle();
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
intentBC.putExtras(bundle);
intentBC.setPackage(BuildConfig.APPLICATION_ID); intentBC.setPackage(BuildConfig.APPLICATION_ID);
context.sendBroadcast(intentBC); context.sendBroadcast(intentBC);
});
} }
/** /**
@ -1514,12 +1518,16 @@ public class Helper {
* @param activity - Activity * @param activity - Activity
*/ */
public static void recreateMainActivity(Activity activity) { public static void recreateMainActivity(Activity activity) {
Bundle b = new Bundle(); Bundle args = new Bundle();
b.putBoolean(Helper.RECEIVE_RECREATE_ACTIVITY, true); args.putBoolean(Helper.RECEIVE_RECREATE_ACTIVITY, true);
Intent intentBD = new Intent(Helper.BROADCAST_DATA); Intent intentBD = new Intent(Helper.BROADCAST_DATA);
intentBD.putExtras(b); new CachedBundle(activity).insertBundle(args, currentAccount, bundleId -> {
Bundle bundle = new Bundle();
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
intentBD.putExtras(bundle);
intentBD.setPackage(BuildConfig.APPLICATION_ID); intentBD.setPackage(BuildConfig.APPLICATION_ID);
activity.sendBroadcast(intentBD); activity.sendBroadcast(intentBD);
});
} }
public static void showKeyboard(Context context, View view) { public static void showKeyboard(Context context, View view) {

@ -1,6 +1,8 @@
package app.fedilab.android.mastodon.imageeditor; package app.fedilab.android.mastodon.imageeditor;
import static app.fedilab.android.BaseMainActivity.currentAccount;
import android.Manifest; import android.Manifest;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
@ -41,6 +43,7 @@ import java.io.InputStream;
import app.fedilab.android.BuildConfig; import app.fedilab.android.BuildConfig;
import app.fedilab.android.R; import app.fedilab.android.R;
import app.fedilab.android.databinding.ActivityEditImageBinding; import app.fedilab.android.databinding.ActivityEditImageBinding;
import app.fedilab.android.mastodon.client.entities.app.CachedBundle;
import app.fedilab.android.mastodon.helper.CirclesDrawingView; import app.fedilab.android.mastodon.helper.CirclesDrawingView;
import app.fedilab.android.mastodon.helper.Helper; import app.fedilab.android.mastodon.helper.Helper;
import app.fedilab.android.mastodon.imageeditor.base.BaseActivity; import app.fedilab.android.mastodon.imageeditor.base.BaseActivity;
@ -283,7 +286,8 @@ public class EditImageActivity extends BaseActivity implements OnPhotoEditorList
binding.photoEditorView.getSource().setImageURI(Uri.fromFile(new File(imagePath))); binding.photoEditorView.getSource().setImageURI(Uri.fromFile(new File(imagePath)));
if (exit) { if (exit) {
Intent intentImage = new Intent(Helper.INTENT_SEND_MODIFIED_IMAGE); Intent intentImage = new Intent(Helper.INTENT_SEND_MODIFIED_IMAGE);
intentImage.putExtra("imgpath", imagePath); Bundle args = new Bundle();
args.putString("imgpath", imagePath);
CirclesDrawingView.CircleArea circleArea = binding.focusCircle.getTouchedCircle(); CirclesDrawingView.CircleArea circleArea = binding.focusCircle.getTouchedCircle();
if (circleArea != null) { if (circleArea != null) {
//Dimension of the editor containing the image //Dimension of the editor containing the image
@ -323,13 +327,16 @@ public class EditImageActivity extends BaseActivity implements OnPhotoEditorList
} else if (focusY < -1) { } else if (focusY < -1) {
focusY = -1; focusY = -1;
} }
intentImage.putExtra("focusX", focusX); args.putFloat("focusX", focusX);
intentImage.putExtra("focusY", focusY); args.putFloat("focusY", focusY);
} }
new CachedBundle(EditImageActivity.this).insertBundle(args, currentAccount, bundleId -> {
intentImage.putExtras(args);
intentImage.setPackage(BuildConfig.APPLICATION_ID); intentImage.setPackage(BuildConfig.APPLICATION_ID);
sendBroadcast(intentImage); sendBroadcast(intentImage);
finish(); finish();
});
} }
} }

@ -60,6 +60,7 @@ import app.fedilab.android.mastodon.client.entities.api.ScheduledStatus;
import app.fedilab.android.mastodon.client.entities.api.Status; import app.fedilab.android.mastodon.client.entities.api.Status;
import app.fedilab.android.mastodon.client.entities.app.Account; import app.fedilab.android.mastodon.client.entities.app.Account;
import app.fedilab.android.mastodon.client.entities.app.BaseAccount; import app.fedilab.android.mastodon.client.entities.app.BaseAccount;
import app.fedilab.android.mastodon.client.entities.app.CachedBundle;
import app.fedilab.android.mastodon.client.entities.app.CamelTag; import app.fedilab.android.mastodon.client.entities.app.CamelTag;
import app.fedilab.android.mastodon.client.entities.app.PostState; import app.fedilab.android.mastodon.client.entities.app.PostState;
import app.fedilab.android.mastodon.client.entities.app.StatusDraft; import app.fedilab.android.mastodon.client.entities.app.StatusDraft;
@ -223,14 +224,24 @@ public class ComposeWorker extends Worker {
} }
Call<Status> statusCall; Call<Status> statusCall;
if (error) { if (error) {
Bundle b = new Bundle(); Bundle args = new Bundle();
b.putBoolean(Helper.RECEIVE_COMPOSE_ERROR_MESSAGE, true); args.putBoolean(Helper.RECEIVE_COMPOSE_ERROR_MESSAGE, true);
Intent intentBD = new Intent(Helper.INTENT_COMPOSE_ERROR_MESSAGE); Intent intentBD = new Intent(Helper.INTENT_COMPOSE_ERROR_MESSAGE);
b.putSerializable(Helper.RECEIVE_ERROR_MESSAGE, context.getString(R.string.media_cannot_be_uploaded)); args.putSerializable(Helper.RECEIVE_ERROR_MESSAGE, context.getString(R.string.media_cannot_be_uploaded));
b.putSerializable(Helper.ARG_STATUS_DRAFT, dataPost.statusDraft); args.putSerializable(Helper.ARG_STATUS_DRAFT, dataPost.statusDraft);
intentBD.putExtras(b); BaseAccount account = null;
try {
account = new Account(context).getAccountByToken(dataPost.token);
} catch (DBException e) {
e.printStackTrace();
}
new CachedBundle(context).insertBundle(args, account, bundleId -> {
Bundle bundle = new Bundle();
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
intentBD.putExtras(bundle);
intentBD.setPackage(BuildConfig.APPLICATION_ID); intentBD.setPackage(BuildConfig.APPLICATION_ID);
context.sendBroadcast(intentBD); context.sendBroadcast(intentBD);
});
return; return;
} }
if (statuses.get(i).local_only) { if (statuses.get(i).local_only) {
@ -304,30 +315,51 @@ public class ComposeWorker extends Worker {
} }
} }
} else if (statusResponse.errorBody() != null) { } else if (statusResponse.errorBody() != null) {
Bundle b = new Bundle(); Bundle args = new Bundle();
b.putBoolean(Helper.RECEIVE_COMPOSE_ERROR_MESSAGE, true); args.putBoolean(Helper.RECEIVE_COMPOSE_ERROR_MESSAGE, true);
Intent intentBD = new Intent(Helper.INTENT_COMPOSE_ERROR_MESSAGE); Intent intentBD = new Intent(Helper.INTENT_COMPOSE_ERROR_MESSAGE);
b.putSerializable(Helper.ARG_STATUS_DRAFT, dataPost.statusDraft); args.putSerializable(Helper.ARG_STATUS_DRAFT, dataPost.statusDraft);
String err = statusResponse.errorBody().string(); String err = statusResponse.errorBody().string();
if (err.contains("{\"error\":\"")) { if (err.contains("{\"error\":\"")) {
err = err.replaceAll("\\{\"error\":\"(.*)\"\\}", "$1"); err = err.replaceAll("\\{\"error\":\"(.*)\"\\}", "$1");
} }
b.putSerializable(Helper.RECEIVE_ERROR_MESSAGE, err); args.putSerializable(Helper.RECEIVE_ERROR_MESSAGE, err);
intentBD.putExtras(b);
BaseAccount account = null;
try {
account = new Account(context).getAccountByToken(dataPost.token);
} catch (DBException e) {
e.printStackTrace();
}
new CachedBundle(context).insertBundle(args, account, bundleId -> {
Bundle bundle = new Bundle();
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
intentBD.putExtras(bundle);
intentBD.setPackage(BuildConfig.APPLICATION_ID); intentBD.setPackage(BuildConfig.APPLICATION_ID);
context.sendBroadcast(intentBD); context.sendBroadcast(intentBD);
});
return; return;
} }
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
Bundle b = new Bundle(); Bundle args = new Bundle();
b.putBoolean(Helper.RECEIVE_COMPOSE_ERROR_MESSAGE, true); args.putBoolean(Helper.RECEIVE_COMPOSE_ERROR_MESSAGE, true);
b.putSerializable(Helper.ARG_STATUS_DRAFT, dataPost.statusDraft); args.putSerializable(Helper.ARG_STATUS_DRAFT, dataPost.statusDraft);
Intent intentBD = new Intent(Helper.INTENT_COMPOSE_ERROR_MESSAGE); Intent intentBD = new Intent(Helper.INTENT_COMPOSE_ERROR_MESSAGE);
b.putSerializable(Helper.RECEIVE_ERROR_MESSAGE, e.getMessage()); args.putSerializable(Helper.RECEIVE_ERROR_MESSAGE, e.getMessage());
intentBD.putExtras(b); BaseAccount account = null;
try {
account = new Account(context).getAccountByToken(dataPost.token);
} catch (DBException e2) {
e2.printStackTrace();
}
new CachedBundle(context).insertBundle(args, account, bundleId -> {
Bundle bundle = new Bundle();
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
intentBD.putExtras(bundle);
intentBD.setPackage(BuildConfig.APPLICATION_ID); intentBD.setPackage(BuildConfig.APPLICATION_ID);
context.sendBroadcast(intentBD); context.sendBroadcast(intentBD);
});
return; return;
} }
} else { } else {
@ -375,14 +407,24 @@ public class ComposeWorker extends Worker {
} }
if (dataPost.scheduledDate == null && dataPost.token != null && firstSendMessage != null) { if (dataPost.scheduledDate == null && dataPost.token != null && firstSendMessage != null) {
Bundle b = new Bundle(); Bundle args = new Bundle();
b.putBoolean(Helper.RECEIVE_NEW_MESSAGE, true); args.putBoolean(Helper.RECEIVE_NEW_MESSAGE, true);
b.putString(Helper.ARG_EDIT_STATUS_ID, dataPost.statusEditId); args.putString(Helper.ARG_EDIT_STATUS_ID, dataPost.statusEditId);
Intent intentBD = new Intent(Helper.BROADCAST_DATA); Intent intentBD = new Intent(Helper.BROADCAST_DATA);
b.putSerializable(Helper.RECEIVE_STATUS_ACTION, firstSendMessage); args.putSerializable(Helper.RECEIVE_STATUS_ACTION, firstSendMessage);
intentBD.putExtras(b); BaseAccount account = null;
try {
account = new Account(context).getAccountByToken(dataPost.token);
} catch (DBException e2) {
e2.printStackTrace();
}
new CachedBundle(context).insertBundle(args, account, bundleId -> {
Bundle bundle = new Bundle();
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
intentBD.putExtras(bundle);
intentBD.setPackage(BuildConfig.APPLICATION_ID); intentBD.setPackage(BuildConfig.APPLICATION_ID);
context.sendBroadcast(intentBD); context.sendBroadcast(intentBD);
});
} }
} }

@ -2171,9 +2171,15 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
} }
statusDeleted.id = null; statusDeleted.id = null;
statusDraft.statusDraftList.add(statusDeleted); statusDraft.statusDraftList.add(statusDeleted);
intent.putExtra(Helper.ARG_STATUS_DRAFT, statusDraft); Bundle args = new Bundle();
intent.putExtra(Helper.ARG_STATUS_REPLY_ID, statusDeleted.in_reply_to_id); args.putSerializable(Helper.ARG_STATUS_DRAFT, statusDraft);
args.putSerializable(Helper.ARG_STATUS_REPLY_ID, statusDeleted.in_reply_to_id);
new CachedBundle(context).insertBundle(args, currentAccount, bundleId -> {
Bundle bundle = new Bundle();
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
intent.putExtras(bundle);
context.startActivity(intent); context.startActivity(intent);
});
sendAction(context, Helper.ARG_STATUS_DELETED, statusToDeal, null); sendAction(context, Helper.ARG_STATUS_DELETED, statusToDeal, null);
}); });
} }
@ -2194,10 +2200,16 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
statusToDeal.spoilerChecked = true; statusToDeal.spoilerChecked = true;
} }
statusDraft.statusDraftList.add(statusToDeal); statusDraft.statusDraftList.add(statusToDeal);
intent.putExtra(Helper.ARG_STATUS_DRAFT, statusDraft); Bundle args = new Bundle();
intent.putExtra(Helper.ARG_EDIT_STATUS_ID, statusToDeal.id); args.putSerializable(Helper.ARG_STATUS_DRAFT, statusDraft);
intent.putExtra(Helper.ARG_STATUS_REPLY_ID, statusToDeal.in_reply_to_id); args.putString(Helper.ARG_EDIT_STATUS_ID, statusToDeal.id);
args.putString(Helper.ARG_STATUS_REPLY_ID, statusToDeal.in_reply_to_id);
new CachedBundle(context).insertBundle(args, currentAccount, bundleId -> {
Bundle bundle = new Bundle();
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
intent.putExtras(bundle);
context.startActivity(intent); context.startActivity(intent);
});
} else { } else {
Toasty.error(context, context.getString(R.string.toast_error), Toasty.LENGTH_SHORT).show(); Toasty.error(context, context.getString(R.string.toast_error), Toasty.LENGTH_SHORT).show();
} }
@ -2372,10 +2384,14 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
}); });
} else if (itemId == R.id.action_mention) { } else if (itemId == R.id.action_mention) {
Intent intent = new Intent(context, ComposeActivity.class); Intent intent = new Intent(context, ComposeActivity.class);
Bundle b = new Bundle(); Bundle args = new Bundle();
b.putSerializable(Helper.ARG_STATUS_MENTION, statusToDeal); args.putSerializable(Helper.ARG_STATUS_MENTION, statusToDeal);
intent.putExtras(b); new CachedBundle(context).insertBundle(args, currentAccount, bundleId -> {
Bundle bundle = new Bundle();
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
intent.putExtras(bundle);
context.startActivity(intent); context.startActivity(intent);
});
} else if (itemId == R.id.action_open_with) { } else if (itemId == R.id.action_open_with) {
new Thread(() -> { new Thread(() -> {
try { try {
@ -2475,19 +2491,31 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
if (results != null && results.statuses != null && results.statuses.size() > 0) { if (results != null && results.statuses != null && results.statuses.size() > 0) {
Status fetchedStatus = results.statuses.get(0); Status fetchedStatus = results.statuses.get(0);
Intent intent = new Intent(context, ComposeActivity.class); Intent intent = new Intent(context, ComposeActivity.class);
intent.putExtra(Helper.ARG_STATUS_REPLY, fetchedStatus); Bundle args = new Bundle();
args.putSerializable(Helper.ARG_STATUS_REPLY, fetchedStatus);
new CachedBundle(context).insertBundle(args, currentAccount, bundleId -> {
Bundle bundle = new Bundle();
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
intent.putExtras(bundle);
context.startActivity(intent); context.startActivity(intent);
});
} else { } else {
Toasty.info(context, context.getString(R.string.toast_error_search), Toasty.LENGTH_SHORT).show(); Toasty.info(context, context.getString(R.string.toast_error_search), Toasty.LENGTH_SHORT).show();
} }
}); });
} else { } else {
Intent intent = new Intent(context, ComposeActivity.class); Intent intent = new Intent(context, ComposeActivity.class);
intent.putExtra(Helper.ARG_STATUS_REPLY, statusToDeal); Bundle args = new Bundle();
args.putSerializable(Helper.ARG_STATUS_REPLY, statusToDeal);
if (status.reblog != null) { if (status.reblog != null) {
intent.putExtra(Helper.ARG_MENTION_BOOSTER, status.account); args.putSerializable(Helper.ARG_MENTION_BOOSTER, status.account);
} }
new CachedBundle(context).insertBundle(args, currentAccount, bundleId -> {
Bundle bundle = new Bundle();
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
intent.putExtras(bundle);
context.startActivity(intent); context.startActivity(intent);
});
} }
}); });
//For reports //For reports
@ -2811,20 +2839,24 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
* @param id - Id of an account (can be null) * @param id - Id of an account (can be null)
*/ */
public static void sendAction(@NonNull Context context, @NonNull String type, @Nullable Status status, @Nullable String id) { public static void sendAction(@NonNull Context context, @NonNull String type, @Nullable Status status, @Nullable String id) {
Bundle b = new Bundle(); Bundle args = new Bundle();
if (status != null) { if (status != null) {
b.putSerializable(type, status); args.putSerializable(type, status);
} }
if (id != null) { if (id != null) {
b.putString(type, id); args.putString(type, id);
} }
if (type.equals(ARG_TIMELINE_REFRESH_ALL)) { if (type.equals(ARG_TIMELINE_REFRESH_ALL)) {
b.putBoolean(ARG_TIMELINE_REFRESH_ALL, true); args.putBoolean(ARG_TIMELINE_REFRESH_ALL, true);
} }
Intent intentBC = new Intent(Helper.RECEIVE_STATUS_ACTION); Intent intentBC = new Intent(Helper.RECEIVE_STATUS_ACTION);
intentBC.putExtras(b); new CachedBundle(context).insertBundle(args, currentAccount, bundleId -> {
Bundle bundle = new Bundle();
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
intentBC.putExtras(bundle);
intentBC.setPackage(BuildConfig.APPLICATION_ID); intentBC.setPackage(BuildConfig.APPLICATION_ID);
context.sendBroadcast(intentBC); context.sendBroadcast(intentBC);
});
} }

@ -15,9 +15,12 @@ package app.fedilab.android.mastodon.ui.drawer;
* see <http://www.gnu.org/licenses>. */ * see <http://www.gnu.org/licenses>. */
import static app.fedilab.android.BaseMainActivity.currentAccount;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -39,6 +42,7 @@ import app.fedilab.android.databinding.DrawerStatusDraftBinding;
import app.fedilab.android.mastodon.activities.ComposeActivity; import app.fedilab.android.mastodon.activities.ComposeActivity;
import app.fedilab.android.mastodon.client.entities.api.Attachment; import app.fedilab.android.mastodon.client.entities.api.Attachment;
import app.fedilab.android.mastodon.client.entities.api.Status; import app.fedilab.android.mastodon.client.entities.api.Status;
import app.fedilab.android.mastodon.client.entities.app.CachedBundle;
import app.fedilab.android.mastodon.client.entities.app.StatusDraft; import app.fedilab.android.mastodon.client.entities.app.StatusDraft;
import app.fedilab.android.mastodon.exception.DBException; import app.fedilab.android.mastodon.exception.DBException;
import app.fedilab.android.mastodon.helper.Helper; import app.fedilab.android.mastodon.helper.Helper;
@ -100,10 +104,15 @@ public class StatusDraftAdapter extends RecyclerView.Adapter<StatusDraftAdapter.
holder.binding.cardviewContainer.setOnClickListener(v -> { holder.binding.cardviewContainer.setOnClickListener(v -> {
Intent intent = new Intent(context, ComposeActivity.class); Intent intent = new Intent(context, ComposeActivity.class);
intent.putExtra(Helper.ARG_STATUS_DRAFT, statusDraft); Bundle args = new Bundle();
args.putSerializable(Helper.ARG_STATUS_DRAFT, statusDraft);
new CachedBundle(context).insertBundle(args, currentAccount, bundleId -> {
Bundle bundle = new Bundle();
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
intent.putExtras(bundle);
context.startActivity(intent); context.startActivity(intent);
}); });
});
holder.binding.delete.setOnClickListener(v -> { holder.binding.delete.setOnClickListener(v -> {
AlertDialog.Builder unfollowConfirm = new MaterialAlertDialogBuilder(context); AlertDialog.Builder unfollowConfirm = new MaterialAlertDialogBuilder(context);

@ -16,10 +16,12 @@ package app.fedilab.android.mastodon.ui.drawer;
import static androidx.core.text.HtmlCompat.FROM_HTML_MODE_LEGACY; import static androidx.core.text.HtmlCompat.FROM_HTML_MODE_LEGACY;
import static app.fedilab.android.BaseMainActivity.currentAccount;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Build; import android.os.Build;
import android.os.Bundle;
import android.text.Html; import android.text.Html;
import android.text.SpannableString; import android.text.SpannableString;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -44,6 +46,7 @@ import app.fedilab.android.R;
import app.fedilab.android.databinding.DrawerStatusScheduledBinding; import app.fedilab.android.databinding.DrawerStatusScheduledBinding;
import app.fedilab.android.mastodon.activities.ComposeActivity; import app.fedilab.android.mastodon.activities.ComposeActivity;
import app.fedilab.android.mastodon.client.entities.api.ScheduledStatus; import app.fedilab.android.mastodon.client.entities.api.ScheduledStatus;
import app.fedilab.android.mastodon.client.entities.app.CachedBundle;
import app.fedilab.android.mastodon.client.entities.app.ScheduledBoost; import app.fedilab.android.mastodon.client.entities.app.ScheduledBoost;
import app.fedilab.android.mastodon.client.entities.app.StatusDraft; import app.fedilab.android.mastodon.client.entities.app.StatusDraft;
import app.fedilab.android.mastodon.exception.DBException; import app.fedilab.android.mastodon.exception.DBException;
@ -126,10 +129,15 @@ public class StatusScheduledAdapter extends RecyclerView.Adapter<StatusScheduled
holder.binding.cardviewContainer.setOnClickListener(v -> { holder.binding.cardviewContainer.setOnClickListener(v -> {
if (statusDraft != null) { if (statusDraft != null) {
Intent intent = new Intent(context, ComposeActivity.class); Intent intent = new Intent(context, ComposeActivity.class);
intent.putExtra(Helper.ARG_STATUS_DRAFT, statusDraft); Bundle args = new Bundle();
args.putSerializable(Helper.ARG_STATUS_DRAFT, statusDraft);
new CachedBundle(context).insertBundle(args, currentAccount, bundleId -> {
Bundle bundle = new Bundle();
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
intent.putExtras(bundle);
context.startActivity(intent); context.startActivity(intent);
});
} }
}); });
holder.binding.delete.setOnClickListener(v -> { holder.binding.delete.setOnClickListener(v -> {
AlertDialog.Builder unfollowConfirm = new MaterialAlertDialogBuilder(context); AlertDialog.Builder unfollowConfirm = new MaterialAlertDialogBuilder(context);

@ -63,13 +63,15 @@ public class FragmentMastodonContext extends Fragment {
private final BroadcastReceiver receive_action = new BroadcastReceiver() { private final BroadcastReceiver receive_action = new BroadcastReceiver() {
@Override @Override
public void onReceive(android.content.Context context, Intent intent) { public void onReceive(android.content.Context context, Intent intent) {
Bundle b = intent.getExtras(); Bundle args = intent.getExtras();
if (b != null) { if (args != null) {
Status receivedStatus = (Status) b.getSerializable(Helper.ARG_STATUS_ACTION); long bundleId = args.getLong(Helper.ARG_INTENT_ID, -1);
String delete_statuses_for_user = b.getString(Helper.ARG_STATUS_ACCOUNT_ID_DELETED); new CachedBundle(requireActivity()).getBundle(bundleId, currentAccount, bundle -> {
Status status_to_delete = (Status) b.getSerializable(Helper.ARG_STATUS_DELETED); Status receivedStatus = (Status) bundle.getSerializable(Helper.ARG_STATUS_ACTION);
Status statusPosted = (Status) b.getSerializable(Helper.ARG_STATUS_POSTED); String delete_statuses_for_user = bundle.getString(Helper.ARG_STATUS_ACCOUNT_ID_DELETED);
Status status_to_update = (Status) b.getSerializable(Helper.ARG_STATUS_UPDATED); Status status_to_delete = (Status) bundle.getSerializable(Helper.ARG_STATUS_DELETED);
Status statusPosted = (Status) bundle.getSerializable(Helper.ARG_STATUS_POSTED);
Status status_to_update = (Status) bundle.getSerializable(Helper.ARG_STATUS_UPDATED);
if (receivedStatus != null && statusAdapter != null) { if (receivedStatus != null && statusAdapter != null) {
int position = getPosition(receivedStatus); int position = getPosition(receivedStatus);
if (position >= 0) { if (position >= 0) {
@ -124,6 +126,8 @@ public class FragmentMastodonContext extends Fragment {
} }
} }
} }
});
} }
} }
}; };

@ -112,17 +112,19 @@ public class FragmentMastodonDirectMessage extends Fragment {
private final BroadcastReceiver broadcast_data = new BroadcastReceiver() { private final BroadcastReceiver broadcast_data = new BroadcastReceiver() {
@Override @Override
public void onReceive(android.content.Context context, Intent intent) { public void onReceive(android.content.Context context, Intent intent) {
Bundle b = intent.getExtras(); Bundle args = intent.getExtras();
if (b != null) { if (args != null) {
long bundleId = args.getLong(Helper.ARG_INTENT_ID, -1);
if (b.getBoolean(Helper.RECEIVE_NEW_MESSAGE, false)) { new CachedBundle(requireActivity()).getBundle(bundleId, currentAccount, bundle -> {
Status statusReceived = (Status) b.getSerializable(Helper.RECEIVE_STATUS_ACTION); if (bundle.getBoolean(Helper.RECEIVE_NEW_MESSAGE, false)) {
Status statusReceived = (Status) bundle.getSerializable(Helper.RECEIVE_STATUS_ACTION);
if (statusReceived != null) { if (statusReceived != null) {
statuses.add(statusReceived); statuses.add(statusReceived);
statusDirectMessageAdapter.notifyItemInserted(statuses.size() - 1); statusDirectMessageAdapter.notifyItemInserted(statuses.size() - 1);
initiliazeStatus(); initiliazeStatus();
} }
} }
});
} }
} }
}; };

@ -14,6 +14,8 @@ package app.fedilab.android.mastodon.ui.fragment.timeline;
* You should have received a copy of the GNU General Public License along with Fedilab; if not, * You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */ * see <http://www.gnu.org/licenses>. */
import static app.fedilab.android.BaseMainActivity.currentAccount;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
@ -47,6 +49,7 @@ import app.fedilab.android.databinding.FragmentPaginationBinding;
import app.fedilab.android.mastodon.client.entities.api.Notification; import app.fedilab.android.mastodon.client.entities.api.Notification;
import app.fedilab.android.mastodon.client.entities.api.Notifications; import app.fedilab.android.mastodon.client.entities.api.Notifications;
import app.fedilab.android.mastodon.client.entities.api.Status; import app.fedilab.android.mastodon.client.entities.api.Status;
import app.fedilab.android.mastodon.client.entities.app.CachedBundle;
import app.fedilab.android.mastodon.client.entities.app.StatusCache; import app.fedilab.android.mastodon.client.entities.app.StatusCache;
import app.fedilab.android.mastodon.client.entities.app.Timeline; import app.fedilab.android.mastodon.client.entities.app.Timeline;
import app.fedilab.android.mastodon.exception.DBException; import app.fedilab.android.mastodon.exception.DBException;
@ -71,11 +74,13 @@ public class FragmentMastodonNotification extends Fragment implements Notificati
private final BroadcastReceiver receive_action = new BroadcastReceiver() { private final BroadcastReceiver receive_action = new BroadcastReceiver() {
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
Bundle b = intent.getExtras(); Bundle args = intent.getExtras();
if (b != null) { if (args != null) {
Status receivedStatus = (Status) b.getSerializable(Helper.ARG_STATUS_ACTION); long bundleId = args.getLong(Helper.ARG_INTENT_ID, -1);
String delete_all_for_account_id = b.getString(Helper.ARG_DELETE_ALL_FOR_ACCOUNT_ID); new CachedBundle(requireActivity()).getBundle(bundleId, currentAccount, bundle -> {
boolean refreshNotifications = b.getBoolean(Helper.ARG_REFRESH_NOTFICATION, false); Status receivedStatus = (Status) bundle.getSerializable(Helper.ARG_STATUS_ACTION);
String delete_all_for_account_id = bundle.getString(Helper.ARG_DELETE_ALL_FOR_ACCOUNT_ID);
boolean refreshNotifications = bundle.getBoolean(Helper.ARG_REFRESH_NOTFICATION, false);
if (refreshNotifications) { if (refreshNotifications) {
scrollToTop(); scrollToTop();
} else if (receivedStatus != null && notificationAdapter != null) { } else if (receivedStatus != null && notificationAdapter != null) {
@ -108,6 +113,7 @@ public class FragmentMastodonNotification extends Fragment implements Notificati
} }
} }
} }
});
} }
} }
}; };

@ -94,15 +94,17 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
private final BroadcastReceiver receive_action = new BroadcastReceiver() { private final BroadcastReceiver receive_action = new BroadcastReceiver() {
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
Bundle b = intent.getExtras(); Bundle args = intent.getExtras();
if (b != null) { if (args != null) {
Status receivedStatus = (Status) b.getSerializable(Helper.ARG_STATUS_ACTION); long bundleId = args.getLong(Helper.ARG_INTENT_ID, -1);
String delete_statuses_for_user = b.getString(Helper.ARG_STATUS_ACCOUNT_ID_DELETED); new CachedBundle(requireActivity()).getBundle(bundleId, currentAccount, bundle -> {
String delete_all_for_account_id = b.getString(Helper.ARG_DELETE_ALL_FOR_ACCOUNT_ID); Status receivedStatus = (Status) bundle.getSerializable(Helper.ARG_STATUS_ACTION);
Status status_to_delete = (Status) b.getSerializable(Helper.ARG_STATUS_DELETED); String delete_statuses_for_user = bundle.getString(Helper.ARG_STATUS_ACCOUNT_ID_DELETED);
Status status_to_update = (Status) b.getSerializable(Helper.ARG_STATUS_UPDATED); String delete_all_for_account_id = bundle.getString(Helper.ARG_DELETE_ALL_FOR_ACCOUNT_ID);
Status statusPosted = (Status) b.getSerializable(Helper.ARG_STATUS_DELETED); Status status_to_delete = (Status) bundle.getSerializable(Helper.ARG_STATUS_DELETED);
boolean refreshAll = b.getBoolean(Helper.ARG_TIMELINE_REFRESH_ALL, false); Status status_to_update = (Status) bundle.getSerializable(Helper.ARG_STATUS_UPDATED);
Status statusPosted = (Status) bundle.getSerializable(Helper.ARG_STATUS_DELETED);
boolean refreshAll = bundle.getBoolean(Helper.ARG_TIMELINE_REFRESH_ALL, false);
if (receivedStatus != null && statusAdapter != null) { if (receivedStatus != null && statusAdapter != null) {
int position = getPosition(receivedStatus); int position = getPosition(receivedStatus);
if (position >= 0) { if (position >= 0) {
@ -176,6 +178,7 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
} else if (refreshAll) { } else if (refreshAll) {
refreshAllAdapters(); refreshAllAdapters();
} }
});
} }
} }
}; };

Loading…
Cancel
Save