use of androidx.core.app.ActivityOptionsCompat in project CloudReader by youlookwhat.
the class OneMovieDetailActivity method start.
/**
* @param context activity
* @param positionData bean
* @param imageView imageView
*/
public static void start(Activity context, SubjectsBean positionData, ImageView imageView) {
Intent intent = new Intent(context, OneMovieDetailActivity.class);
intent.putExtra("bean", positionData);
ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(context, imageView, // 与xml文件对应
CommonUtils.getString(R.string.transition_movie_img));
ActivityCompat.startActivity(context, intent, options.toBundle());
}
use of androidx.core.app.ActivityOptionsCompat in project plaid by nickbutcher.
the class StoryActivity method needsLogin.
private void needsLogin(View triggeringView, int requestCode) {
Intent login = new Intent(StoryActivity.this, LoginActivity.class);
MorphTransform.addExtras(login, ColorUtils.getThemeColor(this, io.plaidapp.core.R.attr.colorSurface), triggeringView.getHeight() / 2);
ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(StoryActivity.this, triggeringView, getString(io.plaidapp.R.string.transition_designer_news_login));
ActivityCompat.startActivityForResult(this, login, requestCode, options.toBundle());
}
use of androidx.core.app.ActivityOptionsCompat in project BetterBatteryStats by asksven.
the class StatsAdapter method showInstalledPackageDetails.
public void showInstalledPackageDetails(Context context, String packageName, View view) {
Intent intentPerms = new Intent(context, PackageInfoActivity.class);
intentPerms.putExtra("package", packageName);
// context.startActivity(intentPerms);
View source_icon = view.findViewById(R.id.icon);
ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(m_parent, source_icon, TRANSITION_NAME);
ActivityCompat.startActivity(m_parent, intentPerms, options.toBundle());
}
use of androidx.core.app.ActivityOptionsCompat in project android-player-samples by BrightcoveOS.
the class MainActivity method itemClicked.
@Override
public void itemClicked(View view, Video video, int position) {
Intent intent = new Intent(this, VideoPlayerActivity.class);
intent.putExtra(VideoPlayerActivity.INTENT_EXTRA_VIDEO_ID, video.getId());
Pair<View, String> imagePair = Pair.create(view, getString(R.string.transition_image));
// noinspection unchecked
ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(this, imagePair);
ActivityCompat.startActivity(this, intent, options.toBundle());
}
use of androidx.core.app.ActivityOptionsCompat in project twicalico by moko256.
the class ShowTweetActivity method updateView.
private void updateView(Post item) {
shareUrl = item.getStatus().getUrl();
long replyTweetId = item.getStatus().getInReplyToStatusId();
if (replyTweetId != -1) {
tweetIsReply.setVisibility(VISIBLE);
tweetIsReply.setOnClickListener(v -> startActivity(GlobalApplicationKt.setAccountKeyForActivity(getIntent(this, replyTweetId), this)));
} else {
tweetIsReply.setVisibility(GONE);
}
statusViewBinder.getTweetSpoilerText().setOnLongClickListener(v -> {
Toast.makeText(this, R.string.did_copy, Toast.LENGTH_SHORT).show();
ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
clipboard.setPrimaryClip(ClipData.newPlainText("spoiler_text", item.getStatus().getSpoilerText()));
return true;
});
statusViewBinder.getTweetContext().setOnLongClickListener(v -> {
Toast.makeText(this, R.string.did_copy, Toast.LENGTH_SHORT).show();
ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
clipboard.setPrimaryClip(ClipData.newPlainText("post_context", item.getStatus().getText()));
return true;
});
statusViewBinder.getUserImage().setOnClickListener(v -> {
ActivityOptionsCompat animation = ActivityOptionsCompat.makeSceneTransitionAnimation(this, v, "icon_image");
startActivity(GlobalApplicationKt.setAccountKeyForActivity(ShowUserActivity.getIntent(this, item.getUser().getId()), this), animation.toBundle());
});
statusViewBinder.setOnQuotedStatusClicked(v -> startActivity(GlobalApplicationKt.setAccountKeyForActivity(ShowTweetActivity.getIntent(this, item.getQuotedRepeatingStatus().getId()), this)));
statusViewBinder.setOnCardClicked(v -> AppCustomTabsKt.launchChromeCustomTabs(this, item.getStatus().getCard().getUrl(), false));
statusViewBinder.getLikeButton().setOnCheckedChangeListener((compoundButton, b) -> {
if (b) {
statusActionModel.createFavorite(item.getId());
} else {
statusActionModel.removeFavorite(item.getId());
}
return Unit.INSTANCE;
});
statusViewBinder.getRepeatButton().setOnCheckedChangeListener((compoundButton, b) -> {
if (b) {
statusActionModel.createRepeat(item.getId());
} else {
statusActionModel.removeRepeat(item.getId());
}
return Unit.INSTANCE;
});
View.OnClickListener replyOnClickListener = v -> startActivity(PostActivity.getIntent(this, item.getStatus().getId(), TwitterStringUtils.convertToReplyTopString(client.getUserCache().get(client.getAccessToken().getUserId()).getScreenName(), item.getUser().getScreenName(), item.getStatus().getMentions()).toString()));
statusViewBinder.getReplyButton().setOnClickListener(replyOnClickListener);
replyFab.setOnClickListener(replyOnClickListener);
statusViewBinder.setStatus(client, requestManager, item.getRepeatedUser(), item.getRepeat(), item.getUser(), item.getStatus(), item.getQuotedRepeatingUser(), item.getQuotedRepeatingStatus());
statusViewBinder.getSendVote().setOnClickListener(v -> statusActionModel.sendVote(statusId, item.getStatus().getPoll().getId(), statusViewBinder.getPollAdapter().getSelections()));
timestampText.setText(DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL).format(item.getStatus().getCreatedAt()));
if (item.getStatus().getSourceName() != null) {
viaText.setText(TwitterStringUtils.appendLinkAtViaText(item.getStatus().getSourceName(), item.getStatus().getSourceWebsite()));
viaText.setMovementMethod(new LinkMovementMethod());
} else {
viaText.setVisibility(GONE);
}
}
Aggregations