Search in sources :

Example 1 with ActivityOptionsCompat

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());
}
Also used : Intent(android.content.Intent) ActivityOptionsCompat(androidx.core.app.ActivityOptionsCompat)

Example 2 with ActivityOptionsCompat

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());
}
Also used : Intent(android.content.Intent) ActivityOptionsCompat(androidx.core.app.ActivityOptionsCompat)

Example 3 with ActivityOptionsCompat

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());
}
Also used : Intent(android.content.Intent) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView) ActivityOptionsCompat(androidx.core.app.ActivityOptionsCompat)

Example 4 with ActivityOptionsCompat

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());
}
Also used : Intent(android.content.Intent) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) ActivityOptionsCompat(androidx.core.app.ActivityOptionsCompat)

Example 5 with ActivityOptionsCompat

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);
    }
}
Also used : ClipboardManager(android.content.ClipboardManager) Context(android.content.Context) Bundle(android.os.Bundle) StatusActionModel(com.github.moko256.twitlatte.model.base.StatusActionModel) Intent(android.content.Intent) LinkMovementMethod(android.text.method.LinkMovementMethod) AppCompatActivity(androidx.appcompat.app.AppCompatActivity) AppCustomTabsKt(com.github.moko256.twitlatte.intent.AppCustomTabsKt) MenuItem(android.view.MenuItem) ClipData(android.content.ClipData) ActionBar(androidx.appcompat.app.ActionBar) SuppressLint(android.annotation.SuppressLint) ActivityOptionsCompat(androidx.core.app.ActivityOptionsCompat) RequestManager(com.bumptech.glide.RequestManager) TwitterStringUtils(com.github.moko256.twitlatte.text.TwitterStringUtils) Toast(android.widget.Toast) FloatingActionButton(com.google.android.material.floatingactionbutton.FloatingActionButton) Menu(android.view.Menu) ClipboardManager(android.content.ClipboardManager) View(android.view.View) Button(android.widget.Button) VISIBLE(android.view.View.VISIBLE) StatusActionModelImpl(com.github.moko256.twitlatte.model.impl.StatusActionModelImpl) DateFormat(java.text.DateFormat) Post(com.github.moko256.latte.client.base.entity.Post) SwipeRefreshLayout(androidx.swiperefreshlayout.widget.SwipeRefreshLayout) Client(com.github.moko256.twitlatte.entity.Client) CompositeDisposable(io.reactivex.disposables.CompositeDisposable) Unit(kotlin.Unit) TextView(android.widget.TextView) Glide(com.bumptech.glide.Glide) GONE(android.view.View.GONE) LinkMovementMethod(android.text.method.LinkMovementMethod) ActivityOptionsCompat(androidx.core.app.ActivityOptionsCompat) View(android.view.View) TextView(android.widget.TextView)

Aggregations

ActivityOptionsCompat (androidx.core.app.ActivityOptionsCompat)13 Intent (android.content.Intent)11 View (android.view.View)4 TextView (android.widget.TextView)2 SuppressLint (android.annotation.SuppressLint)1 Activity (android.app.Activity)1 ClipData (android.content.ClipData)1 ClipboardManager (android.content.ClipboardManager)1 Context (android.content.Context)1 Bundle (android.os.Bundle)1 LinkMovementMethod (android.text.method.LinkMovementMethod)1 Fade (android.transition.Fade)1 Menu (android.view.Menu)1 MenuItem (android.view.MenuItem)1 GONE (android.view.View.GONE)1 VISIBLE (android.view.View.VISIBLE)1 Button (android.widget.Button)1 ImageView (android.widget.ImageView)1 Toast (android.widget.Toast)1 ActionBar (androidx.appcompat.app.ActionBar)1