Search in sources :

Example 1 with Explode

use of android.transition.Explode in project UltimateAndroid by cymcsg.

the class DetailActivity1 method setupWindowAnimations.

private void setupWindowAnimations() {
    Explode explode = new Explode();
    explode.setDuration(2000);
    getWindow().setEnterTransition(explode);
}
Also used : Explode(android.transition.Explode)

Example 2 with Explode

use of android.transition.Explode in project UltimateAndroid by cymcsg.

the class MaterialAnimationActivity method setupWindowAnimations.

private void setupWindowAnimations() {
    Explode explode = new Explode();
    explode.setDuration(2000);
    getWindow().setExitTransition(explode);
    Fade fade = new Fade();
    getWindow().setReenterTransition(fade);
}
Also used : Explode(android.transition.Explode) Fade(android.transition.Fade)

Example 3 with Explode

use of android.transition.Explode in project photo-picker-plus-android by chute.

the class BaseActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        getWindow().setEnterTransition(new Explode());
        getWindow().setExitTransition(new Explode());
    }
    setContentView(getLayoutResource());
    Toolbar toolBar = (Toolbar) findViewById(R.id.toolbar);
    if (toolBar != null) {
        toolBar.bringToFront();
        setSupportActionBar(toolBar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setIcon(new ColorDrawable(android.R.color.transparent));
        getSupportActionBar().setTitle(R.string.choose_service);
        setToolBar(toolBar);
    }
}
Also used : Explode(android.transition.Explode) ColorDrawable(android.graphics.drawable.ColorDrawable) Toolbar(android.support.v7.widget.Toolbar)

Example 4 with Explode

use of android.transition.Explode in project GSYVideoPlayer by CarGuo.

the class RecyclerViewActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    // 设置一个exit transition
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
        getWindow().setEnterTransition(new Explode());
        getWindow().setExitTransition(new Explode());
    }
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_recycler_view);
    ButterKnife.bind(this);
    resolveData();
    final RecyclerNormalAdapter recyclerNormalAdapter = new RecyclerNormalAdapter(this, dataList);
    linearLayoutManager = new LinearLayoutManager(this);
    videoList.setLayoutManager(linearLayoutManager);
    videoList.setAdapter(recyclerNormalAdapter);
    videoList.addOnScrollListener(new RecyclerView.OnScrollListener() {

        int firstVisibleItem, lastVisibleItem;

        @Override
        public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
            super.onScrollStateChanged(recyclerView, newState);
        }

        @Override
        public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
            super.onScrolled(recyclerView, dx, dy);
            firstVisibleItem = linearLayoutManager.findFirstVisibleItemPosition();
            lastVisibleItem = linearLayoutManager.findLastVisibleItemPosition();
            //大于0说明有播放
            if (GSYVideoManager.instance().getPlayPosition() >= 0) {
                //当前播放的位置
                int position = GSYVideoManager.instance().getPlayPosition();
                //对应的播放列表TAG
                if (GSYVideoManager.instance().getPlayTag().equals(ListNormalAdapter.TAG) && (position < firstVisibleItem || position > lastVisibleItem)) {
                    //如果滑出去了上面和下面就是否,和今日头条一样
                    GSYVideoPlayer.releaseAllVideos();
                    recyclerNormalAdapter.notifyDataSetChanged();
                }
            }
        }
    });
}
Also used : Explode(android.transition.Explode) RecyclerNormalAdapter(com.example.gsyvideoplayer.adapter.RecyclerNormalAdapter) RecyclerView(android.support.v7.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 5 with Explode

use of android.transition.Explode in project GSYVideoPlayer by CarGuo.

the class ListVideoActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    // 设置一个exit transition
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
        getWindow().setEnterTransition(new Explode());
        getWindow().setExitTransition(new Explode());
    }
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_list_video);
    ButterKnife.bind(this);
    final ListNormalAdapter listNormalAdapter = new ListNormalAdapter(this);
    videoList.setAdapter(listNormalAdapter);
    videoList.setOnScrollListener(new AbsListView.OnScrollListener() {

        @Override
        public void onScrollStateChanged(AbsListView view, int scrollState) {
        }

        @Override
        public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
            int lastVisibleItem = firstVisibleItem + visibleItemCount;
            //大于0说明有播放
            if (GSYVideoManager.instance().getPlayPosition() >= 0) {
                //当前播放的位置
                int position = GSYVideoManager.instance().getPlayPosition();
                //对应的播放列表TAG
                if (GSYVideoManager.instance().getPlayTag().equals(ListNormalAdapter.TAG) && (position < firstVisibleItem || position > lastVisibleItem)) {
                    //如果滑出去了上面和下面就是否,和今日头条一样
                    GSYVideoPlayer.releaseAllVideos();
                    listNormalAdapter.notifyDataSetChanged();
                }
            }
        }
    });
}
Also used : Explode(android.transition.Explode) ListNormalAdapter(com.example.gsyvideoplayer.adapter.ListNormalAdapter) AbsListView(android.widget.AbsListView)

Aggregations

Explode (android.transition.Explode)19 ActivityOptions (android.app.ActivityOptions)3 Intent (android.content.Intent)3 ActivityOptionsCompat (android.support.v4.app.ActivityOptionsCompat)3 Fade (android.transition.Fade)3 TargetApi (android.annotation.TargetApi)2 Point (android.graphics.Point)2 CardView (android.support.v7.widget.CardView)2 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)2 RecyclerView (android.support.v7.widget.RecyclerView)2 Slide (android.transition.Slide)2 View (android.view.View)2 AbsListView (android.widget.AbsListView)2 SampleListener (com.example.gsyvideoplayer.listener.SampleListener)2 ColorDrawable (android.graphics.drawable.ColorDrawable)1 Toolbar (android.support.v7.widget.Toolbar)1 Transition (android.transition.Transition)1 Window (android.view.Window)1 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)1 OnClick (butterknife.OnClick)1