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