Search in sources :

Example 46 with ActivityOptionsCompat

use of android.support.v4.app.ActivityOptionsCompat in project CloudReader by youlookwhat.

the class SlideShadeViewActivity 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, SlideShadeViewActivity.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(android.support.v4.app.ActivityOptionsCompat)

Example 47 with ActivityOptionsCompat

use of android.support.v4.app.ActivityOptionsCompat in project Remindy by abicelis.

the class ProgrammedLocationBasedTaskViewHolder method onClick.

@Override
public void onClick(View view) {
    int id = view.getId();
    switch(id) {
        case R.id.item_task_programmed_location_based_container:
            Pair[] pairs = new Pair[1];
            pairs[0] = new Pair<View, String>(mCategoryIcon, mFragment.getResources().getString(R.string.transition_task_list_category));
            //pairs[1] = new Pair<View, String>(mTitle, mFragment.getResources().getString(R.string.transition_task_list_title));
            //pairs[2] = new Pair<View, String>(mDescription, mFragment.getResources().getString(R.string.transition_task_list_description));
            ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(mFragment.getActivity(), pairs);
            Intent openTaskDetailActivity = new Intent(mFragment.getActivity(), TaskDetailActivity.class);
            openTaskDetailActivity.putExtra(TaskDetailActivity.TASK_ID_TO_DISPLAY, mCurrent.getId());
            openTaskDetailActivity.putExtra(TaskDetailActivity.TASK_POSITION, mReminderPosition);
            if (mClickListener != null) {
                mClickListener.onItemClicked(mReminderPosition, openTaskDetailActivity, options.toBundle());
            }
            break;
    }
}
Also used : Intent(android.content.Intent) ImageView(android.widget.ImageView) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) View(android.view.View) ActivityOptionsCompat(android.support.v4.app.ActivityOptionsCompat) Pair(android.support.v4.util.Pair)

Example 48 with ActivityOptionsCompat

use of android.support.v4.app.ActivityOptionsCompat in project Remindy by abicelis.

the class ProgrammedRepeatingTaskViewHolder method onClick.

@Override
public void onClick(View view) {
    int id = view.getId();
    switch(id) {
        case R.id.item_task_programmed_repeating_container:
            Pair[] pairs = new Pair[1];
            pairs[0] = new Pair<View, String>(mCategoryIcon, mFragment.getResources().getString(R.string.transition_task_list_category));
            //pairs[1] = new Pair<View, String>(mTitle, mFragment.getResources().getString(R.string.transition_task_list_title));
            //pairs[2] = new Pair<View, String>(mDescription, mFragment.getResources().getString(R.string.transition_task_list_description));
            ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(mFragment.getActivity(), pairs);
            Intent openTaskDetailActivity = new Intent(mFragment.getActivity(), TaskDetailActivity.class);
            openTaskDetailActivity.putExtra(TaskDetailActivity.TASK_ID_TO_DISPLAY, mCurrent.getId());
            openTaskDetailActivity.putExtra(TaskDetailActivity.TASK_POSITION, mReminderPosition);
            if (mClickListener != null) {
                mClickListener.onItemClicked(mReminderPosition, openTaskDetailActivity, options.toBundle());
            }
            break;
    }
}
Also used : Intent(android.content.Intent) ImageView(android.widget.ImageView) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) View(android.view.View) ActivityOptionsCompat(android.support.v4.app.ActivityOptionsCompat) Pair(android.support.v4.util.Pair)

Example 49 with ActivityOptionsCompat

use of android.support.v4.app.ActivityOptionsCompat in project Tapad by berict.

the class IntentHelper method intentSharedElementWithExtra.

public void intentSharedElementWithExtra(final Activity activity, final String target_name, final int start_element_id, final String transition_name, final String extra_name, final String extra, int delay, final View v) {
    final String classname = "com.bedrock.padder." + target_name;
    final Class<Object> classToLoad;
    try {
        classToLoad = (Class<Object>) Class.forName(classname);
        Handler handler = new Handler();
        handler.postDelayed(new Runnable() {

            @Override
            public void run() {
                if (Build.VERSION.SDK_INT >= 21) {
                    Intent intent = new Intent(activity, classToLoad);
                    intent.putExtra(extra_name, extra);
                    View view = v.findViewById(start_element_id);
                    ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(activity, // The view which starts the transition
                    view, // The transitionName of the view we’re transitioning to
                    transition_name);
                    ActivityCompat.startActivity(activity, intent, options.toBundle());
                } else {
                    intentWithExtra(activity, target_name, extra_name, extra, 0);
                }
            }
        }, delay);
    } catch (ClassNotFoundException e) {
        Log.i("IntentHelper", "Error, there is no such class");
    }
}
Also used : Handler(android.os.Handler) Intent(android.content.Intent) View(android.view.View) ActivityOptionsCompat(android.support.v4.app.ActivityOptionsCompat)

Aggregations

ActivityOptionsCompat (android.support.v4.app.ActivityOptionsCompat)49 Intent (android.content.Intent)44 View (android.view.View)15 Pair (android.support.v4.util.Pair)12 RecyclerView (android.support.v7.widget.RecyclerView)8 ImageView (android.widget.ImageView)8 TextView (android.widget.TextView)7 Activity (android.app.Activity)5 OnClick (butterknife.OnClick)5 Handler (android.os.Handler)3 TargetApi (android.annotation.TargetApi)1 ActivityOptions (android.app.ActivityOptions)1 Resources (android.content.res.Resources)1 BitmapDrawable (android.graphics.drawable.BitmapDrawable)1 ColorDrawable (android.graphics.drawable.ColorDrawable)1 Bundle (android.os.Bundle)1 CoordinatorLayout (android.support.design.widget.CoordinatorLayout)1 FragmentManager (android.support.v4.app.FragmentManager)1 CardView (android.support.v7.widget.CardView)1 Explode (android.transition.Explode)1