Search in sources :

Example 91 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 92 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 93 with ActivityOptionsCompat

use of android.support.v4.app.ActivityOptionsCompat in project EffectiveAndroid by rallat.

the class TopArticleListActivity method onClick.

private void onClick(View view) {
    int position = recyclerView.getChildLayoutPosition(view);
    Article data = adapter.getItem(position);
    View innerContainer = view.findViewById(R.id.container_inner_item);
    Intent startIntent = new Intent(this, ArticleActivity.class);
    startIntent.putExtra(ArticleActivity.EXTRA_ARTICLE, data);
    ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(this, innerContainer, ArticleActivity.TRANSITION_SHARED_ELEMENT);
    ActivityCompat.startActivity(this, startIntent, options.toBundle());
}
Also used : Article(com.israelferrer.effectiveandroid.entities.Article) Intent(android.content.Intent) View(android.view.View) TopArticleListView(com.israelferrer.effectiveandroid.ui.views.TopArticleListView) ArticleRecyclerView(com.israelferrer.effectiveandroid.ui.recycler.ArticleRecyclerView) RecyclerView(android.support.v7.widget.RecyclerView) ActivityOptionsCompat(android.support.v4.app.ActivityOptionsCompat)

Example 94 with ActivityOptionsCompat

use of android.support.v4.app.ActivityOptionsCompat in project seven_develop by seven123456.

the class HomeFragment method initRecyclerHeadView.

private void initRecyclerHeadView(List<HomeBannerInfos> homeBannerInfos) {
    bannerViewAdapter = new BannerViewAdapter(R.layout.recycler_item_banner, homeBannerInfos, getContext());
    bannerLayout.setAdapter(bannerViewAdapter);
    bannerViewAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {

        @Override
        public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
            HomeBannerInfos homeBannerInfos = (HomeBannerInfos) adapter.getItem(position);
            HomeToWebViewInfo homeToWebViewInfo = new HomeToWebViewInfo();
            Intent intent = new Intent(getContext(), HomeNewsDetailActivity.class);
            homeToWebViewInfo.title = homeBannerInfos.getTitle();
            homeToWebViewInfo.imgUrl = homeBannerInfos.getImagePath();
            homeToWebViewInfo.h5Url = homeBannerInfos.getUrl();
            intent.putExtra("newsInfo", homeToWebViewInfo);
            ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation((Activity) getContext(), view.findViewById(R.id.iv_banner_image), getResources().getString(R.string.transition_news_img));
            ActivityCompat.startActivity(getContext(), intent, options.toBundle());
        }
    });
}
Also used : HomeBannerInfos(com.seven.seven.home.model.HomeBannerInfos) HomeToWebViewInfo(com.seven.seven.home.model.HomeToWebViewInfo) BaseQuickAdapter(com.chad.library.adapter.base.BaseQuickAdapter) BannerViewAdapter(com.seven.seven.home.adapter.BannerViewAdapter) MainActivity(com.seven.seven.ui.MainActivity) Activity(android.app.Activity) Intent(android.content.Intent) ErrorLayoutView(com.seven.seven.common.view.ErrorLayoutView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) ActivityOptionsCompat(android.support.v4.app.ActivityOptionsCompat)

Aggregations

ActivityOptionsCompat (android.support.v4.app.ActivityOptionsCompat)94 Intent (android.content.Intent)74 View (android.view.View)32 Pair (android.support.v4.util.Pair)18 RecyclerView (android.support.v7.widget.RecyclerView)15 Activity (android.app.Activity)14 ImageView (android.widget.ImageView)14 TextView (android.widget.TextView)13 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