mirror of
https://codeberg.org/tom79/Fedilab.git
synced 2024-12-22 16:50:04 +02:00
Cached intent for media
This commit is contained in:
parent
09a8b6c43c
commit
504e30c44a
13 changed files with 188 additions and 160 deletions
|
@ -500,7 +500,7 @@ public class ProfileActivity extends BaseActivity {
|
|||
|
||||
binding.accountPp.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(ProfileActivity.this, MediaActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
Bundle args = new Bundle();
|
||||
Attachment attachment = new Attachment();
|
||||
attachment.description = account.acct;
|
||||
attachment.preview_url = account.avatar;
|
||||
|
@ -509,13 +509,17 @@ public class ProfileActivity extends BaseActivity {
|
|||
attachment.type = "image";
|
||||
ArrayList<Attachment> attachments = new ArrayList<>();
|
||||
attachments.add(attachment);
|
||||
b.putSerializable(Helper.ARG_MEDIA_ARRAY, attachments);
|
||||
b.putInt(Helper.ARG_MEDIA_POSITION, 1);
|
||||
intent.putExtras(b);
|
||||
ActivityOptionsCompat options = ActivityOptionsCompat
|
||||
.makeSceneTransitionAnimation(ProfileActivity.this, binding.accountPp, attachment.url);
|
||||
// start the new activity
|
||||
startActivity(intent, options.toBundle());
|
||||
args.putSerializable(Helper.ARG_MEDIA_ARRAY, attachments);
|
||||
args.putInt(Helper.ARG_MEDIA_POSITION, 1);
|
||||
new CachedBundle(ProfileActivity.this).insertBundle(args, currentAccount, bundleId -> {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
|
||||
intent.putExtras(bundle);
|
||||
ActivityOptionsCompat options = ActivityOptionsCompat
|
||||
.makeSceneTransitionAnimation(ProfileActivity.this, binding.accountPp, attachment.url);
|
||||
// start the new activity
|
||||
startActivity(intent, options.toBundle());
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -344,7 +344,7 @@ public class AdminAccountActivity extends BaseActivity {
|
|||
MastodonHelper.loadPPMastodon(binding.accountPp, adminAccount.account);
|
||||
binding.accountPp.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(AdminAccountActivity.this, MediaActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
Bundle args = new Bundle();
|
||||
Attachment attachment = new Attachment();
|
||||
attachment.description = adminAccount.account.acct;
|
||||
attachment.preview_url = adminAccount.account.avatar;
|
||||
|
@ -353,13 +353,17 @@ public class AdminAccountActivity extends BaseActivity {
|
|||
attachment.type = "image";
|
||||
ArrayList<Attachment> attachments = new ArrayList<>();
|
||||
attachments.add(attachment);
|
||||
b.putSerializable(Helper.ARG_MEDIA_ARRAY, attachments);
|
||||
b.putInt(Helper.ARG_MEDIA_POSITION, 1);
|
||||
intent.putExtras(b);
|
||||
ActivityOptionsCompat options = ActivityOptionsCompat
|
||||
.makeSceneTransitionAnimation(AdminAccountActivity.this, binding.accountPp, attachment.url);
|
||||
// start the new activity
|
||||
startActivity(intent, options.toBundle());
|
||||
args.putSerializable(Helper.ARG_MEDIA_ARRAY, attachments);
|
||||
args.putInt(Helper.ARG_MEDIA_POSITION, 1);
|
||||
new CachedBundle(AdminAccountActivity.this).insertBundle(args, currentAccount, bundleId -> {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
|
||||
intent.putExtras(bundle);
|
||||
ActivityOptionsCompat options = ActivityOptionsCompat
|
||||
.makeSceneTransitionAnimation(AdminAccountActivity.this, binding.accountPp, attachment.url);
|
||||
// start the new activity
|
||||
startActivity(intent, options.toBundle());
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -357,7 +357,7 @@ public class AdminReportActivity extends BaseBarActivity {
|
|||
MastodonHelper.loadPPMastodon(binding.accountPp, account);
|
||||
binding.accountPp.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(AdminReportActivity.this, MediaActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
Bundle args = new Bundle();
|
||||
Attachment attachment = new Attachment();
|
||||
attachment.description = account.acct;
|
||||
attachment.preview_url = account.avatar;
|
||||
|
@ -366,13 +366,16 @@ public class AdminReportActivity extends BaseBarActivity {
|
|||
attachment.type = "image";
|
||||
ArrayList<Attachment> attachments = new ArrayList<>();
|
||||
attachments.add(attachment);
|
||||
b.putSerializable(Helper.ARG_MEDIA_ARRAY, attachments);
|
||||
b.putInt(Helper.ARG_MEDIA_POSITION, 1);
|
||||
intent.putExtras(b);
|
||||
ActivityOptionsCompat options = ActivityOptionsCompat
|
||||
.makeSceneTransitionAnimation(AdminReportActivity.this, binding.accountPp, attachment.url);
|
||||
// start the new activity
|
||||
startActivity(intent, options.toBundle());
|
||||
args.putSerializable(Helper.ARG_MEDIA_ARRAY, attachments);
|
||||
args.putInt(Helper.ARG_MEDIA_POSITION, 1);
|
||||
new CachedBundle(AdminReportActivity.this).insertBundle(args, currentAccount, bundleId -> {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
|
||||
intent.putExtras(bundle);
|
||||
ActivityOptionsCompat options = ActivityOptionsCompat
|
||||
.makeSceneTransitionAnimation(AdminReportActivity.this, binding.accountPp, attachment.url);
|
||||
startActivity(intent, options.toBundle());
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -118,6 +118,7 @@ import app.fedilab.android.mastodon.client.entities.api.Poll;
|
|||
import app.fedilab.android.mastodon.client.entities.api.Status;
|
||||
import app.fedilab.android.mastodon.client.entities.api.Tag;
|
||||
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.Languages;
|
||||
import app.fedilab.android.mastodon.client.entities.app.Quotes;
|
||||
|
@ -1366,14 +1367,18 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
|||
}
|
||||
drawerMediaListBinding.getRoot().setOnClickListener(v -> {
|
||||
Intent mediaIntent = new Intent(context, MediaActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
Bundle args = new Bundle();
|
||||
ArrayList<Attachment> attachments = new ArrayList<>();
|
||||
attachments.add(attachment);
|
||||
b.putSerializable(Helper.ARG_MEDIA_ARRAY, attachments);
|
||||
mediaIntent.putExtras(b);
|
||||
ActivityOptionsCompat options = ActivityOptionsCompat
|
||||
.makeSceneTransitionAnimation((Activity) context, drawerMediaListBinding.media, attachment.url);
|
||||
context.startActivity(mediaIntent, options.toBundle());
|
||||
args.putSerializable(Helper.ARG_MEDIA_ARRAY, attachments);
|
||||
new CachedBundle(context).insertBundle(args, currentAccount, bundleId -> {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
|
||||
mediaIntent.putExtras(bundle);
|
||||
ActivityOptionsCompat options = ActivityOptionsCompat
|
||||
.makeSceneTransitionAnimation((Activity) context, drawerMediaListBinding.media, attachment.url);
|
||||
context.startActivity(mediaIntent, options.toBundle());
|
||||
});
|
||||
});
|
||||
holder.binding.simpleMedia.addView(drawerMediaListBinding.getRoot());
|
||||
|
||||
|
|
|
@ -75,19 +75,20 @@ public class ImageAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
|||
}
|
||||
holder.binding.media.setOnClickListener(v -> {
|
||||
Intent mediaIntent = new Intent(context, MediaActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
b.putInt(Helper.ARG_MEDIA_POSITION, position + 1);
|
||||
b.putBoolean(Helper.ARG_MEDIA_ARRAY_PROFILE, true);
|
||||
mediaIntent.putExtras(b);
|
||||
ActivityOptionsCompat options = null;
|
||||
Bundle args = new Bundle();
|
||||
args.putInt(Helper.ARG_MEDIA_POSITION, position + 1);
|
||||
args.putBoolean(Helper.ARG_MEDIA_ARRAY_PROFILE, true);
|
||||
if (attachment != null) {
|
||||
options = ActivityOptionsCompat
|
||||
.makeSceneTransitionAnimation((Activity) context, holder.binding.media, attachment.url);
|
||||
} else {
|
||||
return;
|
||||
new CachedBundle(context).insertBundle(args, currentAccount, bundleId -> {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
|
||||
mediaIntent.putExtras(bundle);
|
||||
ActivityOptionsCompat options = null;
|
||||
options = ActivityOptionsCompat
|
||||
.makeSceneTransitionAnimation((Activity) context, holder.binding.media, attachment.url);
|
||||
context.startActivity(mediaIntent, options.toBundle());
|
||||
});
|
||||
}
|
||||
// start the new activity
|
||||
context.startActivity(mediaIntent, options.toBundle());
|
||||
});
|
||||
|
||||
holder.binding.media.setOnLongClickListener(v -> {
|
||||
|
|
|
@ -14,6 +14,8 @@ package app.fedilab.android.mastodon.ui.drawer;
|
|||
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
|
||||
* see <http://www.gnu.org/licenses>. */
|
||||
|
||||
import static app.fedilab.android.BaseMainActivity.currentAccount;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
@ -38,6 +40,7 @@ import app.fedilab.android.databinding.DrawerSliderBinding;
|
|||
import app.fedilab.android.mastodon.activities.MediaActivity;
|
||||
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.app.CachedBundle;
|
||||
import app.fedilab.android.mastodon.helper.Helper;
|
||||
import jp.wasabeef.glide.transformations.BlurTransformation;
|
||||
|
||||
|
@ -102,14 +105,17 @@ public class SliderAdapter extends SliderViewAdapter<SliderAdapter.SliderAdapter
|
|||
}
|
||||
} else {
|
||||
Intent mediaIntent = new Intent(context, MediaActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
b.putInt(Helper.ARG_MEDIA_POSITION, position + 1);
|
||||
b.putSerializable(Helper.ARG_MEDIA_ARRAY, new ArrayList<>(status.media_attachments));
|
||||
mediaIntent.putExtras(b);
|
||||
ActivityOptionsCompat options = ActivityOptionsCompat
|
||||
.makeSceneTransitionAnimation((Activity) context, viewHolder.binding.ivAutoImageSlider, status.media_attachments.get(0).url);
|
||||
// start the new activity
|
||||
context.startActivity(mediaIntent, options.toBundle());
|
||||
Bundle args = new Bundle();
|
||||
args.putInt(Helper.ARG_MEDIA_POSITION, position + 1);
|
||||
args.putSerializable(Helper.ARG_MEDIA_ARRAY, new ArrayList<>(status.media_attachments));
|
||||
new CachedBundle(context).insertBundle(args, currentAccount, bundleId -> {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
|
||||
mediaIntent.putExtras(bundle);
|
||||
ActivityOptionsCompat options = ActivityOptionsCompat
|
||||
.makeSceneTransitionAnimation((Activity) context, viewHolder.binding.ivAutoImageSlider, status.media_attachments.get(0).url);
|
||||
context.startActivity(mediaIntent, options.toBundle());
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1674,14 +1674,17 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
|||
return;
|
||||
}
|
||||
Intent mediaIntent = new Intent(context, MediaActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
b.putInt(Helper.ARG_MEDIA_POSITION, finalMediaPosition);
|
||||
b.putSerializable(Helper.ARG_MEDIA_ARRAY, new ArrayList<>(statusToDeal.media_attachments));
|
||||
mediaIntent.putExtras(b);
|
||||
ActivityOptionsCompat options = ActivityOptionsCompat
|
||||
.makeSceneTransitionAnimation((Activity) context, layoutMediaBinding.media, statusToDeal.media_attachments.get(0).url);
|
||||
// start the new activity
|
||||
context.startActivity(mediaIntent, options.toBundle());
|
||||
Bundle args = new Bundle();
|
||||
args.putInt(Helper.ARG_MEDIA_POSITION, finalMediaPosition);
|
||||
args.putSerializable(Helper.ARG_MEDIA_ARRAY, new ArrayList<>(statusToDeal.media_attachments));
|
||||
new CachedBundle(context).insertBundle(args, currentAccount, bundleId -> {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
|
||||
mediaIntent.putExtras(bundle);
|
||||
ActivityOptionsCompat options = ActivityOptionsCompat
|
||||
.makeSceneTransitionAnimation((Activity) context, layoutMediaBinding.media, statusToDeal.media_attachments.get(0).url);
|
||||
context.startActivity(mediaIntent, options.toBundle());
|
||||
});
|
||||
});
|
||||
layoutMediaBinding.viewHide.setOnClickListener(v -> {
|
||||
statusToDeal.sensitive = !statusToDeal.sensitive;
|
||||
|
@ -1742,14 +1745,17 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
|||
return;
|
||||
}
|
||||
Intent mediaIntent = new Intent(context, MediaActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
b.putInt(Helper.ARG_MEDIA_POSITION, finalMediaPosition);
|
||||
b.putSerializable(Helper.ARG_MEDIA_ARRAY, new ArrayList<>(statusToDeal.media_attachments));
|
||||
mediaIntent.putExtras(b);
|
||||
ActivityOptionsCompat options = ActivityOptionsCompat
|
||||
.makeSceneTransitionAnimation((Activity) context, layoutMediaBinding.media, statusToDeal.media_attachments.get(0).url);
|
||||
// start the new activity
|
||||
context.startActivity(mediaIntent, options.toBundle());
|
||||
Bundle args = new Bundle();
|
||||
args.putInt(Helper.ARG_MEDIA_POSITION, finalMediaPosition);
|
||||
args.putSerializable(Helper.ARG_MEDIA_ARRAY, new ArrayList<>(statusToDeal.media_attachments));
|
||||
new CachedBundle(context).insertBundle(args, currentAccount, bundleId -> {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
|
||||
mediaIntent.putExtras(bundle);
|
||||
ActivityOptionsCompat options = ActivityOptionsCompat
|
||||
.makeSceneTransitionAnimation((Activity) context, layoutMediaBinding.media, statusToDeal.media_attachments.get(0).url);
|
||||
context.startActivity(mediaIntent, options.toBundle());
|
||||
});
|
||||
});
|
||||
layoutMediaBinding.viewHide.setOnClickListener(v -> {
|
||||
statusToDeal.sensitive = !statusToDeal.sensitive;
|
||||
|
@ -2782,14 +2788,17 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
|||
return;
|
||||
}
|
||||
Intent mediaIntent = new Intent(context, MediaActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
b.putInt(Helper.ARG_MEDIA_POSITION, mediaPosition);
|
||||
b.putSerializable(Helper.ARG_MEDIA_ARRAY, new ArrayList<>(statusToDeal.media_attachments));
|
||||
mediaIntent.putExtras(b);
|
||||
ActivityOptionsCompat options = ActivityOptionsCompat
|
||||
.makeSceneTransitionAnimation((Activity) context, layoutMediaBinding.media, statusToDeal.media_attachments.get(0).url);
|
||||
// start the new activity
|
||||
context.startActivity(mediaIntent, options.toBundle());
|
||||
Bundle args = new Bundle();
|
||||
args.putInt(Helper.ARG_MEDIA_POSITION, mediaPosition);
|
||||
args.putSerializable(Helper.ARG_MEDIA_ARRAY, new ArrayList<>(statusToDeal.media_attachments));
|
||||
new CachedBundle(context).insertBundle(args, currentAccount, bundleId -> {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
|
||||
mediaIntent.putExtras(bundle);
|
||||
ActivityOptionsCompat options = ActivityOptionsCompat
|
||||
.makeSceneTransitionAnimation((Activity) context, layoutMediaBinding.media, statusToDeal.media_attachments.get(0).url);
|
||||
context.startActivity(mediaIntent, options.toBundle());
|
||||
});
|
||||
});
|
||||
layoutMediaBinding.viewHide.setOnClickListener(v -> {
|
||||
statusToDeal.sensitive = !statusToDeal.sensitive;
|
||||
|
@ -3251,15 +3260,19 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
|||
holder.bindingArt.artMedia.setOnClickListener(v -> {
|
||||
if (status.art_attachment != null) {
|
||||
Intent mediaIntent = new Intent(context, MediaActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
b.putInt(Helper.ARG_MEDIA_POSITION, 1);
|
||||
Bundle args = new Bundle();
|
||||
args.putInt(Helper.ARG_MEDIA_POSITION, 1);
|
||||
ArrayList<Attachment> attachments = new ArrayList<>();
|
||||
attachments.add(status.art_attachment);
|
||||
b.putSerializable(Helper.ARG_MEDIA_ARRAY, attachments);
|
||||
mediaIntent.putExtras(b);
|
||||
ActivityOptionsCompat options = ActivityOptionsCompat
|
||||
.makeSceneTransitionAnimation((Activity) context, holder.bindingArt.artMedia, status.art_attachment.url);
|
||||
context.startActivity(mediaIntent, options.toBundle());
|
||||
args.putSerializable(Helper.ARG_MEDIA_ARRAY, attachments);
|
||||
new CachedBundle(context).insertBundle(args, currentAccount, bundleId -> {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
|
||||
mediaIntent.putExtras(bundle);
|
||||
ActivityOptionsCompat options = ActivityOptionsCompat
|
||||
.makeSceneTransitionAnimation((Activity) context, holder.bindingArt.artMedia, status.art_attachment.url);
|
||||
context.startActivity(mediaIntent, options.toBundle());
|
||||
});
|
||||
} else {
|
||||
Toasty.error(context, context.getString(R.string.toast_error), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ package app.fedilab.android.mastodon.ui.drawer;
|
|||
* see <http://www.gnu.org/licenses>. */
|
||||
|
||||
|
||||
import static app.fedilab.android.BaseMainActivity.currentAccount;
|
||||
import static app.fedilab.android.mastodon.ui.drawer.StatusAdapter.prepareRequestBuilder;
|
||||
|
||||
import android.app.Activity;
|
||||
|
@ -77,6 +78,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.Poll;
|
||||
import app.fedilab.android.mastodon.client.entities.api.Status;
|
||||
import app.fedilab.android.mastodon.client.entities.app.CachedBundle;
|
||||
import app.fedilab.android.mastodon.helper.CacheDataSourceFactory;
|
||||
import app.fedilab.android.mastodon.helper.Helper;
|
||||
import app.fedilab.android.mastodon.helper.LongClickLinkMovementMethod;
|
||||
|
@ -191,14 +193,17 @@ public class StatusDirectMessageAdapter extends RecyclerView.Adapter<RecyclerVie
|
|||
return;
|
||||
}
|
||||
Intent mediaIntent = new Intent(context, MediaActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
b.putInt(Helper.ARG_MEDIA_POSITION, mediaPosition);
|
||||
b.putSerializable(Helper.ARG_MEDIA_ARRAY, new ArrayList<>(status.media_attachments));
|
||||
mediaIntent.putExtras(b);
|
||||
ActivityOptionsCompat options = ActivityOptionsCompat
|
||||
.makeSceneTransitionAnimation((Activity) context, layoutMediaBinding.media, status.media_attachments.get(0).url);
|
||||
// start the new activity
|
||||
context.startActivity(mediaIntent, options.toBundle());
|
||||
Bundle args = new Bundle();
|
||||
args.putInt(Helper.ARG_MEDIA_POSITION, mediaPosition);
|
||||
args.putSerializable(Helper.ARG_MEDIA_ARRAY, new ArrayList<>(status.media_attachments));
|
||||
new CachedBundle(context).insertBundle(args, currentAccount, bundleId -> {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
|
||||
mediaIntent.putExtras(bundle);
|
||||
ActivityOptionsCompat options = ActivityOptionsCompat
|
||||
.makeSceneTransitionAnimation((Activity) context, layoutMediaBinding.media, status.media_attachments.get(0).url);
|
||||
context.startActivity(mediaIntent, options.toBundle());
|
||||
});
|
||||
});
|
||||
layoutMediaBinding.viewHide.setOnClickListener(v -> {
|
||||
status.sensitive = !status.sensitive;
|
||||
|
@ -667,14 +672,17 @@ public class StatusDirectMessageAdapter extends RecyclerView.Adapter<RecyclerVie
|
|||
return;
|
||||
}
|
||||
Intent mediaIntent = new Intent(context, MediaActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
b.putInt(Helper.ARG_MEDIA_POSITION, finalMediaPosition);
|
||||
b.putSerializable(Helper.ARG_MEDIA_ARRAY, new ArrayList<>(status.media_attachments));
|
||||
mediaIntent.putExtras(b);
|
||||
ActivityOptionsCompat options = ActivityOptionsCompat
|
||||
.makeSceneTransitionAnimation((Activity) context, layoutMediaBinding.media, status.media_attachments.get(0).url);
|
||||
// start the new activity
|
||||
context.startActivity(mediaIntent, options.toBundle());
|
||||
Bundle args = new Bundle();
|
||||
args.putInt(Helper.ARG_MEDIA_POSITION, finalMediaPosition);
|
||||
args.putSerializable(Helper.ARG_MEDIA_ARRAY, new ArrayList<>(status.media_attachments));
|
||||
new CachedBundle(context).insertBundle(args, currentAccount, bundleId -> {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
|
||||
mediaIntent.putExtras(bundle);
|
||||
ActivityOptionsCompat options = ActivityOptionsCompat
|
||||
.makeSceneTransitionAnimation((Activity) context, layoutMediaBinding.media, status.media_attachments.get(0).url);
|
||||
context.startActivity(mediaIntent, options.toBundle());
|
||||
});
|
||||
});
|
||||
layoutMediaBinding.viewHide.setOnClickListener(v -> {
|
||||
status.sensitive = !status.sensitive;
|
||||
|
|
|
@ -95,7 +95,6 @@ public class FragmentMastodonAccount extends Fragment {
|
|||
}
|
||||
}
|
||||
initializeAfterBundle(getArguments());
|
||||
|
||||
}
|
||||
} else {
|
||||
initializeAfterBundle(null);
|
||||
|
|
|
@ -382,7 +382,6 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
|
|||
}
|
||||
}
|
||||
initializeAfterBundle(getArguments());
|
||||
|
||||
}
|
||||
}
|
||||
return binding.getRoot();
|
||||
|
|
|
@ -114,42 +114,42 @@ public class FragmentNotificationContainer extends Fragment {
|
|||
String[] categoriesArray = excludedCategories.split("\\|");
|
||||
for (String category : categoriesArray) {
|
||||
switch (category) {
|
||||
case "mention":
|
||||
case "mention" -> {
|
||||
excludedCategoriesList.add("mention");
|
||||
dialogView.displayMentions.setChecked(false);
|
||||
break;
|
||||
case "favourite":
|
||||
}
|
||||
case "favourite" -> {
|
||||
excludedCategoriesList.add("favourite");
|
||||
dialogView.displayFavourites.setChecked(false);
|
||||
break;
|
||||
case "reblog":
|
||||
}
|
||||
case "reblog" -> {
|
||||
excludedCategoriesList.add("reblog");
|
||||
dialogView.displayReblogs.setChecked(false);
|
||||
break;
|
||||
case "poll":
|
||||
}
|
||||
case "poll" -> {
|
||||
excludedCategoriesList.add("poll");
|
||||
dialogView.displayPollResults.setChecked(false);
|
||||
break;
|
||||
case "status":
|
||||
}
|
||||
case "status" -> {
|
||||
excludedCategoriesList.add("status");
|
||||
dialogView.displayUpdatesFromPeople.setChecked(false);
|
||||
break;
|
||||
case "follow":
|
||||
}
|
||||
case "follow" -> {
|
||||
excludedCategoriesList.add("follow");
|
||||
dialogView.displayFollows.setChecked(false);
|
||||
break;
|
||||
case "update":
|
||||
}
|
||||
case "update" -> {
|
||||
excludedCategoriesList.add("update");
|
||||
dialogView.displayUpdates.setChecked(false);
|
||||
break;
|
||||
case "admin.sign_up":
|
||||
}
|
||||
case "admin.sign_up" -> {
|
||||
excludedCategoriesList.add("admin.sign_up");
|
||||
dialogView.displaySignups.setChecked(false);
|
||||
break;
|
||||
case "admin.report":
|
||||
}
|
||||
case "admin.report" -> {
|
||||
excludedCategoriesList.add("admin.report");
|
||||
dialogView.displayReports.setChecked(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,45 +53,33 @@ public class FedilabNotificationPageAdapter extends FragmentStatePagerAdapter {
|
|||
FragmentMastodonNotification fragmentMastodonNotification = new FragmentMastodonNotification();
|
||||
if (!extended) {
|
||||
switch (position) {
|
||||
case 0:
|
||||
bundle.putSerializable(Helper.ARG_NOTIFICATION_TYPE, FragmentMastodonNotification.NotificationTypeEnum.ALL);
|
||||
break;
|
||||
case 1:
|
||||
bundle.putSerializable(Helper.ARG_NOTIFICATION_TYPE, FragmentMastodonNotification.NotificationTypeEnum.MENTIONS);
|
||||
break;
|
||||
case 0 ->
|
||||
bundle.putSerializable(Helper.ARG_NOTIFICATION_TYPE, FragmentMastodonNotification.NotificationTypeEnum.ALL);
|
||||
case 1 ->
|
||||
bundle.putSerializable(Helper.ARG_NOTIFICATION_TYPE, FragmentMastodonNotification.NotificationTypeEnum.MENTIONS);
|
||||
}
|
||||
} else {
|
||||
switch (position) {
|
||||
case 0:
|
||||
bundle.putSerializable(Helper.ARG_NOTIFICATION_TYPE, FragmentMastodonNotification.NotificationTypeEnum.ALL);
|
||||
break;
|
||||
case 1:
|
||||
bundle.putSerializable(Helper.ARG_NOTIFICATION_TYPE, FragmentMastodonNotification.NotificationTypeEnum.MENTIONS);
|
||||
break;
|
||||
case 2:
|
||||
bundle.putSerializable(Helper.ARG_NOTIFICATION_TYPE, FragmentMastodonNotification.NotificationTypeEnum.FAVOURITES);
|
||||
break;
|
||||
case 3:
|
||||
bundle.putSerializable(Helper.ARG_NOTIFICATION_TYPE, FragmentMastodonNotification.NotificationTypeEnum.REBLOGS);
|
||||
break;
|
||||
case 4:
|
||||
bundle.putSerializable(Helper.ARG_NOTIFICATION_TYPE, FragmentMastodonNotification.NotificationTypeEnum.POLLS);
|
||||
break;
|
||||
case 5:
|
||||
bundle.putSerializable(Helper.ARG_NOTIFICATION_TYPE, FragmentMastodonNotification.NotificationTypeEnum.TOOTS);
|
||||
break;
|
||||
case 6:
|
||||
bundle.putSerializable(Helper.ARG_NOTIFICATION_TYPE, FragmentMastodonNotification.NotificationTypeEnum.FOLLOWS);
|
||||
break;
|
||||
case 7:
|
||||
bundle.putSerializable(Helper.ARG_NOTIFICATION_TYPE, FragmentMastodonNotification.NotificationTypeEnum.UPDATES);
|
||||
break;
|
||||
case 8:
|
||||
bundle.putSerializable(Helper.ARG_NOTIFICATION_TYPE, FragmentMastodonNotification.NotificationTypeEnum.ADMIN_SIGNUP);
|
||||
break;
|
||||
case 9:
|
||||
bundle.putSerializable(Helper.ARG_NOTIFICATION_TYPE, FragmentMastodonNotification.NotificationTypeEnum.ADMIN_REPORT);
|
||||
break;
|
||||
case 0 ->
|
||||
bundle.putSerializable(Helper.ARG_NOTIFICATION_TYPE, FragmentMastodonNotification.NotificationTypeEnum.ALL);
|
||||
case 1 ->
|
||||
bundle.putSerializable(Helper.ARG_NOTIFICATION_TYPE, FragmentMastodonNotification.NotificationTypeEnum.MENTIONS);
|
||||
case 2 ->
|
||||
bundle.putSerializable(Helper.ARG_NOTIFICATION_TYPE, FragmentMastodonNotification.NotificationTypeEnum.FAVOURITES);
|
||||
case 3 ->
|
||||
bundle.putSerializable(Helper.ARG_NOTIFICATION_TYPE, FragmentMastodonNotification.NotificationTypeEnum.REBLOGS);
|
||||
case 4 ->
|
||||
bundle.putSerializable(Helper.ARG_NOTIFICATION_TYPE, FragmentMastodonNotification.NotificationTypeEnum.POLLS);
|
||||
case 5 ->
|
||||
bundle.putSerializable(Helper.ARG_NOTIFICATION_TYPE, FragmentMastodonNotification.NotificationTypeEnum.TOOTS);
|
||||
case 6 ->
|
||||
bundle.putSerializable(Helper.ARG_NOTIFICATION_TYPE, FragmentMastodonNotification.NotificationTypeEnum.FOLLOWS);
|
||||
case 7 ->
|
||||
bundle.putSerializable(Helper.ARG_NOTIFICATION_TYPE, FragmentMastodonNotification.NotificationTypeEnum.UPDATES);
|
||||
case 8 ->
|
||||
bundle.putSerializable(Helper.ARG_NOTIFICATION_TYPE, FragmentMastodonNotification.NotificationTypeEnum.ADMIN_SIGNUP);
|
||||
case 9 ->
|
||||
bundle.putSerializable(Helper.ARG_NOTIFICATION_TYPE, FragmentMastodonNotification.NotificationTypeEnum.ADMIN_REPORT);
|
||||
}
|
||||
}
|
||||
fragmentMastodonNotification.setArguments(bundle);
|
||||
|
|
|
@ -52,14 +52,12 @@ public class FedilabScheduledPageAdapter extends FragmentStatePagerAdapter {
|
|||
bundle.putString(Helper.ARG_VIEW_MODEL_KEY, "FEDILAB_" + position);
|
||||
FragmentScheduled fragmentScheduled = new FragmentScheduled();
|
||||
switch (position) {
|
||||
case 1:
|
||||
bundle.putSerializable(Helper.ARG_TIMELINE_TYPE, Timeline.TimeLineEnum.SCHEDULED_TOOT_CLIENT);
|
||||
break;
|
||||
case 2:
|
||||
bundle.putSerializable(Helper.ARG_TIMELINE_TYPE, Timeline.TimeLineEnum.SCHEDULED_BOOST);
|
||||
break;
|
||||
default:
|
||||
bundle.putSerializable(Helper.ARG_TIMELINE_TYPE, Timeline.TimeLineEnum.SCHEDULED_TOOT_SERVER);
|
||||
case 1 ->
|
||||
bundle.putSerializable(Helper.ARG_TIMELINE_TYPE, Timeline.TimeLineEnum.SCHEDULED_TOOT_CLIENT);
|
||||
case 2 ->
|
||||
bundle.putSerializable(Helper.ARG_TIMELINE_TYPE, Timeline.TimeLineEnum.SCHEDULED_BOOST);
|
||||
default ->
|
||||
bundle.putSerializable(Helper.ARG_TIMELINE_TYPE, Timeline.TimeLineEnum.SCHEDULED_TOOT_SERVER);
|
||||
}
|
||||
fragmentScheduled.setArguments(bundle);
|
||||
return fragmentScheduled;
|
||||
|
|
Loading…
Reference in a new issue