Search in sources :

Example 11 with Explode

use of android.transition.Explode in project Material-Animations by lgvalle.

the class TransitionActivity2 method buildEnterTransition.

private Transition buildEnterTransition() {
    Explode enterTransition = new Explode();
    enterTransition.setDuration(getResources().getInteger(R.integer.anim_duration_long));
    return enterTransition;
}
Also used : Explode(android.transition.Explode)

Example 12 with Explode

use of android.transition.Explode in project Avengers by saulmm.

the class TransitionUtils method buildExplodeTransition.

public static Transition buildExplodeTransition(Integer... exlcudeIds) {
    Explode explodeTransition = new Explode();
    excludeTransitionIds(explodeTransition, exlcudeIds);
    return explodeTransition;
}
Also used : Explode(android.transition.Explode)

Example 13 with Explode

use of android.transition.Explode in project MaterialLogin by fanrunqi.

the class MainActivity method onClick.

@OnClick({ R.id.bt_go, R.id.fab })
public void onClick(View view) {
    switch(view.getId()) {
        case R.id.fab:
            getWindow().setExitTransition(null);
            getWindow().setEnterTransition(null);
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(this, fab, fab.getTransitionName());
                startActivity(new Intent(this, RegisterActivity.class), options.toBundle());
            } else {
                startActivity(new Intent(this, RegisterActivity.class));
            }
            break;
        case R.id.bt_go:
            Explode explode = new Explode();
            explode.setDuration(500);
            getWindow().setExitTransition(explode);
            getWindow().setEnterTransition(explode);
            ActivityOptionsCompat oc2 = ActivityOptionsCompat.makeSceneTransitionAnimation(this);
            Intent i2 = new Intent(this, LoginSuccessActivity.class);
            startActivity(i2, oc2.toBundle());
            break;
    }
}
Also used : Explode(android.transition.Explode) Intent(android.content.Intent) ActivityOptionsCompat(android.support.v4.app.ActivityOptionsCompat) ActivityOptions(android.app.ActivityOptions) OnClick(butterknife.OnClick)

Example 14 with Explode

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

the class RecyclerView2Activity 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_view2);
    ButterKnife.bind(this);
    initView();
    listVideoUtil.setHideActionBar(true);
    //listVideoUtil.setShowFullAnimation(true);
    //listVideoUtil.setAutoRotation(true);
    //listVideoUtil.setFullLandFrist(true);
    listItemRecycler.addOnScrollListener(new RecyclerView.OnScrollListener() {

        @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();
            Debuger.printfLog("firstVisibleItem " + firstVisibleItem + " lastVisibleItem " + lastVisibleItem);
            //大于0说明有播放,//对应的播放列表TAG
            if (listVideoUtil.getPlayPosition() >= 0 && listVideoUtil.getPlayTAG().equals(RecyclerItemViewHolder.TAG)) {
                //当前播放的位置
                int position = listVideoUtil.getPlayPosition();
                //不可视的是时候
                if ((position < firstVisibleItem || position > lastVisibleItem)) {
                    //如果是小窗口就不需要处理
                    if (!listVideoUtil.isSmall() && !listVideoUtil.isFull()) {
                        //小窗口
                        int size = CommonUtil.dip2px(RecyclerView2Activity.this, 150);
                        //actionbar为true才不会掉下面去
                        listVideoUtil.showSmallVideo(new Point(size, size), true, true);
                    }
                } else {
                    if (listVideoUtil.isSmall()) {
                        listVideoUtil.smallVideoToNormal();
                    }
                }
            }
        }
    });
    //小窗口关闭被点击的时候回调处理回复页面
    listVideoUtil.setVideoAllCallBack(new SampleListener() {

        @Override
        public void onPrepared(String url, Object... objects) {
            super.onPrepared(url, objects);
            Debuger.printfLog("Duration " + listVideoUtil.getDuration() + " CurrentPosition " + listVideoUtil.getCurrentPositionWhenPlaying());
        }

        @Override
        public void onQuitSmallWidget(String url, Object... objects) {
            super.onQuitSmallWidget(url, objects);
            //大于0说明有播放,//对应的播放列表TAG
            if (listVideoUtil.getPlayPosition() >= 0 && listVideoUtil.getPlayTAG().equals(ListVideoAdapter.TAG)) {
                //当前播放的位置
                int position = listVideoUtil.getPlayPosition();
                //不可视的是时候
                if ((position < firstVisibleItem || position > lastVisibleItem)) {
                    //释放掉视频
                    listVideoUtil.releaseVideoPlayer();
                    recyclerBaseAdapter.notifyDataSetChanged();
                }
            }
        }
    });
}
Also used : Explode(android.transition.Explode) RecyclerView(android.support.v7.widget.RecyclerView) Point(android.graphics.Point) SampleListener(com.example.gsyvideoplayer.listener.SampleListener) Point(android.graphics.Point)

Example 15 with Explode

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

the class ListVideo2Activity 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_video2);
    ButterKnife.bind(this);
    listVideoUtil = new ListVideoUtil(this);
    listVideoUtil.setFullViewContainer(videoFullContainer);
    listVideoUtil.setHideStatusBar(true);
    //listVideoUtil.setHideActionBar(true);
    listVideoUtil.setNeedLockFull(true);
    listVideoAdapter = new ListVideoAdapter(this, listVideoUtil);
    listVideoAdapter.setRootView(activityListVideo);
    videoList.setAdapter(listVideoAdapter);
    //listVideoUtil.setShowFullAnimation(true);
    //listVideoUtil.setAutoRotation(true);
    //listVideoUtil.setFullLandFrist(true);
    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) {
            ListVideo2Activity.this.firstVisibleItem = firstVisibleItem;
            lastVisibleItem = firstVisibleItem + visibleItemCount;
            //大于0说明有播放,//对应的播放列表TAG
            if (listVideoUtil.getPlayPosition() >= 0 && listVideoUtil.getPlayTAG().equals(ListVideoAdapter.TAG)) {
                //当前播放的位置
                int position = listVideoUtil.getPlayPosition();
                //不可视的是时候
                if ((position < firstVisibleItem || position > lastVisibleItem)) {
                    //如果是小窗口就不需要处理
                    if (!listVideoUtil.isSmall()) {
                        //小窗口
                        int size = CommonUtil.dip2px(ListVideo2Activity.this, 150);
                        listVideoUtil.showSmallVideo(new Point(size, size), false, true);
                    }
                } else {
                    if (listVideoUtil.isSmall()) {
                        listVideoUtil.smallVideoToNormal();
                    }
                }
            }
        }
    });
    //小窗口关闭被点击的时候回调处理回复页面
    listVideoUtil.setVideoAllCallBack(new SampleListener() {

        @Override
        public void onPrepared(String url, Object... objects) {
            super.onPrepared(url, objects);
            Debuger.printfLog("Duration " + listVideoUtil.getDuration() + " CurrentPosition " + listVideoUtil.getCurrentPositionWhenPlaying());
        }

        @Override
        public void onQuitSmallWidget(String url, Object... objects) {
            super.onQuitSmallWidget(url, objects);
            //大于0说明有播放,//对应的播放列表TAG
            if (listVideoUtil.getPlayPosition() >= 0 && listVideoUtil.getPlayTAG().equals(ListVideoAdapter.TAG)) {
                //当前播放的位置
                int position = listVideoUtil.getPlayPosition();
                //不可视的是时候
                if ((position < firstVisibleItem || position > lastVisibleItem)) {
                    //释放掉视频
                    listVideoUtil.releaseVideoPlayer();
                    listVideoAdapter.notifyDataSetChanged();
                }
            }
        }
    });
}
Also used : Explode(android.transition.Explode) ListVideoUtil(com.shuyu.gsyvideoplayer.utils.ListVideoUtil) AbsListView(android.widget.AbsListView) Point(android.graphics.Point) SampleListener(com.example.gsyvideoplayer.listener.SampleListener) ListVideoAdapter(com.example.gsyvideoplayer.adapter.ListVideoAdapter) Point(android.graphics.Point)

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