Search in sources :

Example 31 with ActivityOptionsCompat

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

the class ImageAttachmentViewHolder method launchImageViewAttachmentActivity.

private void launchImageViewAttachmentActivity() {
    Pair[] pairs = new Pair[1];
    pairs[0] = new Pair<View, String>(mImage, mActivity.getResources().getString(R.string.transition_image_attachment_image));
    ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(mActivity, pairs);
    Intent goToViewImageAttachmentActivity = new Intent(mActivity, ViewImageAttachmentActivity.class);
    goToViewImageAttachmentActivity.putExtra(ViewImageAttachmentActivity.IMAGE_ATTACHMENT_EXTRA, mCurrent);
    goToViewImageAttachmentActivity.putExtra(ViewImageAttachmentActivity.HOLDER_POSITION_EXTRA, mPosition);
    mActivity.startActivityForResult(goToViewImageAttachmentActivity, ViewImageAttachmentActivity.VIEW_IMAGE_ATTACHMENT_REQUEST_CODE, options.toBundle());
}
Also used : Intent(android.content.Intent) ImageView(android.widget.ImageView) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View) ActivityOptionsCompat(android.support.v4.app.ActivityOptionsCompat) Pair(android.support.v4.util.Pair)

Example 32 with ActivityOptionsCompat

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

the class ProgrammedOneTimeTaskViewHolder method onClick.

@Override
public void onClick(View view) {
    int id = view.getId();
    switch(id) {
        case R.id.item_task_programmed_one_time_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 33 with ActivityOptionsCompat

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

the class UnprogrammedTaskViewHolder method onClick.

@Override
public void onClick(View view) {
    int id = view.getId();
    switch(id) {
        case R.id.item_task_unprogrammed_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 34 with ActivityOptionsCompat

use of android.support.v4.app.ActivityOptionsCompat in project MaterialEverywhere by antoniolg.

the class DetailActivity method launch.

public static void launch(BaseActivity activity, View transitionView, String url) {
    ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(activity, transitionView, EXTRA_IMAGE);
    Intent intent = new Intent(activity, DetailActivity.class);
    intent.putExtra(EXTRA_IMAGE, url);
    ActivityCompat.startActivity(activity, intent, options.toBundle());
}
Also used : Intent(android.content.Intent) ActivityOptionsCompat(android.support.v4.app.ActivityOptionsCompat)

Example 35 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 targetName, final int start_element_id, final String transitionName, final String extraName, final String extra, int delay) {
    final String classname = "com.bedrock.padder." + targetName;
    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(extraName, extra);
                    View view = activity.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
                    transitionName);
                    ActivityCompat.startActivity(activity, intent, options.toBundle());
                } else {
                    intentWithExtra(activity, targetName, extraName, 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)92 Intent (android.content.Intent)72 View (android.view.View)31 Pair (android.support.v4.util.Pair)18 ImageView (android.widget.ImageView)15 TextView (android.widget.TextView)14 RecyclerView (android.support.v7.widget.RecyclerView)13 Activity (android.app.Activity)12 OnClick (butterknife.OnClick)7 ActivityOptions (android.app.ActivityOptions)4 Context (android.content.Context)4 Bundle (android.os.Bundle)4 Handler (android.os.Handler)4 BindView (butterknife.BindView)4 CardView (android.support.v7.widget.CardView)3 Explode (android.transition.Explode)3 AdapterView (android.widget.AdapterView)3 LinearLayout (android.widget.LinearLayout)3 Uri (android.net.Uri)2 LayoutInflater (android.view.LayoutInflater)2