當前位置: 首頁>>代碼示例>>Java>>正文


Java ActivityOptions.makeSceneTransitionAnimation方法代碼示例

本文整理匯總了Java中android.app.ActivityOptions.makeSceneTransitionAnimation方法的典型用法代碼示例。如果您正苦於以下問題:Java ActivityOptions.makeSceneTransitionAnimation方法的具體用法?Java ActivityOptions.makeSceneTransitionAnimation怎麽用?Java ActivityOptions.makeSceneTransitionAnimation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.app.ActivityOptions的用法示例。


在下文中一共展示了ActivityOptions.makeSceneTransitionAnimation方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getActivityOptions

import android.app.ActivityOptions; //導入方法依賴的package包/類
private ActivityOptions getActivityOptions(PhotoViewHolder holder) {
    TextView author =
            holder.itemView.findViewById(com.example.android.unsplash.base.R.id.author);
    ImageView photo =
            holder.itemView.findViewById(com.example.android.unsplash.base.R.id.photo);
    Pair authorPair = Pair.create(author, author.getTransitionName());
    Pair photoPair = Pair.create(photo, photo.getTransitionName());
    View decorView = getWindow().getDecorView();
    View statusBackground = decorView.findViewById(android.R.id.statusBarBackground);
    View navBackground = decorView.findViewById(android.R.id.navigationBarBackground);
    Pair statusPair = Pair.create(statusBackground,
            statusBackground.getTransitionName());

    final ActivityOptions options;
    if (navBackground == null) {
        options = ActivityOptions.makeSceneTransitionAnimation(this,
                authorPair, photoPair, statusPair);
    } else {
        Pair navPair = Pair.create(navBackground, navBackground.getTransitionName());
        options = ActivityOptions.makeSceneTransitionAnimation(this,
                authorPair, photoPair, statusPair, navPair);
    }
    return options;
}
 
開發者ID:googlesamples,項目名稱:android-instant-apps,代碼行數:25,代碼來源:MainActivity.java

示例2: start

import android.app.ActivityOptions; //導入方法依賴的package包/類
public static void start(final GarlandViewMainActivity activity,
                         final String name, final String address, final String url,
                         final View card, final View avatar) {
    Intent starter = new Intent(activity, GarlandViewDetailsActivity.class);

    starter.putExtra(BUNDLE_NAME, name);
    starter.putExtra(BUNDLE_INFO, address);
    starter.putExtra(BUNDLE_AVATAR_URL, url);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        final Pair<View, String> p1 = Pair.create(card, activity.getString(R.string.gv_transition_card));
        final Pair<View, String> p2 = Pair.create(avatar, activity.getString(R.string.gv_transition_avatar_border));

        final ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(activity, p1, p2);
        activity.startActivity(starter, options.toBundle());
    } else {
        activity.startActivity(starter);
    }
}
 
開發者ID:Ramotion,項目名稱:showroom-android,代碼行數:20,代碼來源:GarlandViewDetailsActivity.java

示例3: onBuildClicked

import android.app.ActivityOptions; //導入方法依賴的package包/類
@Override
public void onBuildClicked(BuildViewHolder buildViewHolder) {
    BuildViewModel model = buildViewHolder.viewModel;

    Intent i = new Intent(getActivity(), BriefActivity.class);
    i.putExtra(KEY_BUILD_ID, model.getBuildId());    // pass build order record ID

    // speed optimization - pass these so brief activity doesn't need to
    // requery them from the database and can display them instantly
    i.putExtra(KEY_FACTION_ENUM, mFaction);
    i.putExtra(KEY_EXPANSION_ENUM, mCurrentExpansion);
    i.putExtra(KEY_BUILD_NAME, model.getName());

    if (VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
        // create the transition animation - the views in the layouts
        // of both activities are defined with android:transitionName="buildName"
        ActivityOptions options = ActivityOptions
                .makeSceneTransitionAnimation(
                        getActivity(),
                        buildViewHolder.nameText,
                        getString(R.string.transition_build_name));
        getActivity().startActivity(i, options.toBundle());
    } else {
        getActivity().startActivity(i);
    }
}
 
開發者ID:kiwiandroiddev,項目名稱:starcraft-2-build-player,代碼行數:27,代碼來源:RaceFragment.java

示例4: openPostDetailsActivity

import android.app.ActivityOptions; //導入方法依賴的package包/類
private void openPostDetailsActivity(Post post, View v) {
    Intent intent = new Intent(MainActivity.this, PostDetailsActivity.class);
    intent.putExtra(PostDetailsActivity.POST_ID_EXTRA_KEY, post.getId());

    if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {

        View imageView = v.findViewById(R.id.postImageView);
        View authorImageView = v.findViewById(R.id.authorImageView);

        ActivityOptions options = ActivityOptions.
                makeSceneTransitionAnimation(MainActivity.this,
                        new android.util.Pair<>(imageView, getString(R.string.post_image_transition_name)),
                        new android.util.Pair<>(authorImageView, getString(R.string.post_author_image_transition_name))
                );
        startActivityForResult(intent, PostDetailsActivity.UPDATE_POST_REQUEST, options.toBundle());
    } else {
        startActivityForResult(intent, PostDetailsActivity.UPDATE_POST_REQUEST);
    }
}
 
開發者ID:rozdoum,項目名稱:social-app-android,代碼行數:20,代碼來源:MainActivity.java

示例5: start

import android.app.ActivityOptions; //導入方法依賴的package包/類
public static void start(final MainActivity activity,
                         final String name, final String address, final String url,
                         final View card, final View avatar) {
    Intent starter = new Intent(activity, DetailsActivity.class);

    starter.putExtra(BUNDLE_NAME, name);
    starter.putExtra(BUNDLE_INFO, address);
    starter.putExtra(BUNDLE_AVATAR_URL, url);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        final Pair<View, String> p1 = Pair.create(card, activity.getString(R.string.transition_card));
        final Pair<View, String> p2 = Pair.create(avatar, activity.getString(R.string.transition_avatar_border));

        final ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(activity, p1, p2);
        activity.startActivity(starter, options.toBundle());
    } else {
        activity.startActivity(starter);
    }
}
 
開發者ID:Ramotion,項目名稱:garland-view-android,代碼行數:20,代碼來源:DetailsActivity.java

示例6: onStartLocationClick

import android.app.ActivityOptions; //導入方法依賴的package包/類
@Override
public void onStartLocationClick(LinearLayout startLocationLayout,EditText startLocation){
    Log.d("start location","triggered");
    Intent intent = new Intent(getBaseContext(), ChooseLocationActivity.class);
    if(startLocation.getText().length() != 0)
        intent.putExtra(ChooseLocationActivity.ADDRESS_EXTRA, startLocation.getText().toString());
    intent.putExtra(ChooseLocationActivity.TITLE_EXTRA, getResources().getString(R.string.choose_start));
    ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(MainActivity.this, startLocationLayout, getResources().getString(R.string.search_view_transition_name));
    startActivityForResult(intent, START_LOCATION_SEARCH_REQUEST, options.toBundle());
}
 
開發者ID:w86763777,項目名稱:BikeLine,代碼行數:11,代碼來源:MainActivity.java

示例7: licensePressed

import android.app.ActivityOptions; //導入方法依賴的package包/類
@OnClick(R.id.license_image)
public void licensePressed() {
    final Intent intent = new Intent(this, PictureZoomActivity.class);
    final Bundle extras = new Bundle();

    extras.putByteArray("picture", licence.getPhoto());
    intent.putExtras(extras);

    ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(this, headshot, "zoom");
    startActivity(intent, options.toBundle());
}
 
開發者ID:mDL-ILP,項目名稱:mDL-ILP,代碼行數:12,代碼來源:ReadLicenseActivity.java

示例8: makeSceneTransitionAnimation

import android.app.ActivityOptions; //導入方法依賴的package包/類
public static ActivityOptionsCompat21 makeSceneTransitionAnimation(Activity activity, View[] sharedElements, String[] sharedElementNames) {
    Pair[] pairs = null;
    if (sharedElements != null) {
        pairs = new Pair[sharedElements.length];
        for (int i = 0; i < pairs.length; i++) {
            pairs[i] = Pair.create(sharedElements[i], sharedElementNames[i]);
        }
    }
    return new ActivityOptionsCompat21(ActivityOptions.makeSceneTransitionAnimation(activity, pairs));
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:11,代碼來源:ActivityOptionsCompat21.java

示例9: onClick

import android.app.ActivityOptions; //導入方法依賴的package包/類
@OnClick({R.id.bt_go, R.id.fab})
public void onClick(View view) {
    switch (view.getId()) {
        case R.id.fab:
            getWindow().setExitTransition(null);
            getWindow().setEnterTransition(null);

            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                ActivityOptions options =
                        ActivityOptions.makeSceneTransitionAnimation(this, fab, fab.getTransitionName());
                startActivity(new Intent(this, RegisterActivity.class), options.toBundle());
            } else {
                startActivity(new Intent(this, RegisterActivity.class));
            }
            break;
        case R.id.bt_go:
            Explode explode = new Explode();
            explode.setDuration(500);

            getWindow().setExitTransition(explode);
            getWindow().setEnterTransition(explode);
            ActivityOptionsCompat oc2 = ActivityOptionsCompat.makeSceneTransitionAnimation(this);
            Intent i2 = new Intent(this,LoginSuccessActivity.class);
            startActivity(i2, oc2.toBundle());
            break;
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:28,代碼來源:MainActivity.java

示例10: switchToRegister

import android.app.ActivityOptions; //導入方法依賴的package包/類
@Override
public void switchToRegister(FloatingActionButton fab) {
    mActivity.getWindow().setExitTransition(null);
    mActivity.getWindow().setEnterTransition(null);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        ActivityOptions options =
                ActivityOptions.makeSceneTransitionAnimation(mActivity, fab, fab.getTransitionName());
        mActivity.startActivity(new Intent(mActivity, RegisterActivity.class), options.toBundle());
    } else {
        mActivity.startActivity(new Intent(mActivity, RegisterActivity.class));
    }
}
 
開發者ID:InnoFang,項目名稱:FamilyBond,代碼行數:14,代碼來源:LoginPresenter.java

示例11: simpleSharedElementTransition

import android.app.ActivityOptions; //導入方法依賴的package包/類
public void simpleSharedElementTransition(View view) {
    Intent intent = new Intent(this, SimpleSharedTransitionActivity.class);
    ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(this, findViewById(R.id.simple_shared), "test");
    startActivity(intent, options.toBundle());

}
 
開發者ID:teisun,項目名稱:SunmiUI,代碼行數:7,代碼來源:TransitionHomeActivity.java

示例12: onEndLocationClick

import android.app.ActivityOptions; //導入方法依賴的package包/類
@Override
public void onEndLocationClick(LinearLayout endLocationLayout,EditText endLocation){
    Log.d("end location","triggered");
    Intent intent = new Intent(getBaseContext(), ChooseLocationActivity.class);
    if(endLocation.getText().length() != 0)
        intent.putExtra(ChooseLocationActivity.ADDRESS_EXTRA, endLocation.getText().toString());
    intent.putExtra(ChooseLocationActivity.TITLE_EXTRA, getResources().getString(R.string.choose_end));
    ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(MainActivity.this,
            endLocationLayout, getResources().getString(R.string.search_view_transition_name));
    startActivityForResult(intent, END_LOCATION_SEARCH_REQUEST, options.toBundle());
            //overridePendingTransition(R.anim.slide_from_right, R.anim.slide_to_left);
}
 
開發者ID:w86763777,項目名稱:BikeLine,代碼行數:13,代碼來源:MainActivity.java

示例13: onClick

import android.app.ActivityOptions; //導入方法依賴的package包/類
@Override
public void onClick(View v) {
    Intent intent = new Intent(mContext, DetailActivity.class);
    ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(MainActivity.getInstance(), Pair.create((View) cover, "cover"));
    mContext.startActivity(intent, options.toBundle());
}
 
開發者ID:shenhuanet,項目名稱:AndroidOpen,代碼行數:7,代碼來源:RecentAdapter.java

示例14: open

import android.app.ActivityOptions; //導入方法依賴的package包/類
public static void open(AppCompatActivity context, View fab, String title, CharSequence content) {
    Intent intent = getIntent(context, title, content, null, "OK");

    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
        ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(context, fab, "morph_transition");
        context.startActivityForResult(intent, 1, options.toBundle());
    } else
        context.startActivityForResult(intent, 1);
}
 
開發者ID:AdityaAnand1,項目名稱:Morphing-Material-Dialogs,代碼行數:10,代碼來源:DialogActivity.java

示例15: start

import android.app.ActivityOptions; //導入方法依賴的package包/類
public static void start(Activity context, ArrayList<GankModel> meizis, int position, View sharedView) {
    Intent starter = new Intent(context, GalleryActivity.class);
    starter.putExtra(EXTRA_STARTING_GALLERY_POSITION, position);
    starter.putParcelableArrayListExtra("mz", meizis);
    ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(context, sharedView,
            sharedView.getTransitionName());
    context.startActivity(starter, options.toBundle());
}
 
開發者ID:YMlion,項目名稱:leisure-glance,代碼行數:9,代碼來源:GalleryActivity.java


注:本文中的android.app.ActivityOptions.makeSceneTransitionAnimation方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。