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;
}
}
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;
}
}
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");
}
}
Aggregations