本文整理汇总了Java中android.transition.Fade.setDuration方法的典型用法代码示例。如果您正苦于以下问题:Java Fade.setDuration方法的具体用法?Java Fade.setDuration怎么用?Java Fade.setDuration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.transition.Fade
的用法示例。
在下文中一共展示了Fade.setDuration方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.transition.Fade; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
Fade s = new Fade();
s.setDuration(1000);
getWindow().setEnterTransition(s);
super.onCreate(savedInstanceState);
/*setContentView(R.layout.newslayout);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.newscontainer, new NewsFragment())
.commit();
}*/
// ATTENTION: This was auto-generated to implement the App Indexing API.
// See https://g.co/AppIndexing/AndroidStudio for more information.
}
示例2: handleTransitions
import android.transition.Fade; //导入方法依赖的package包/类
@RequiresApi(api = Build.VERSION_CODES.HONEYCOMB)
private void handleTransitions() {
useSysTransition = getIntent().getBooleanExtra(KEY_USE_SYS_TRANSITION, false);
if(useSysTransition) {
ivDetail.setVisibility(View.VISIBLE);
Fade fade = new Fade();
fade.setDuration(500);
getWindow().setEnterTransition(fade);
getWindow().setExitTransition(fade);
ChangeBounds changeBounds = new ChangeBounds();
getWindow().setSharedElementEnterTransition(changeBounds);
}
entity = (TransitionsEntity) getIntent().getSerializableExtra(KEY_ENTITY);
KLog.d(entity);
GlideUtils.displayImage(this, ivDetail, entity.getUrl(), R.drawable.def_placeholder);
}
示例3: openTaskDetail
import android.transition.Fade; //导入方法依赖的package包/类
public void openTaskDetail(){
Task clickedTask = adapter.getTask(mTaskViewPager.getCurrentItem());
Fragment taskDetailFragment = new TaskDetailFragment();
((TaskDetailFragment)taskDetailFragment).setDisplayedTask(clickedTask);
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.LOLLIPOP) {
Explode explode = new Explode();
explode.setDuration(300);
Fade fade = new Fade();
fade.setDuration(400);
taskDetailFragment.setEnterTransition(fade);
setExitTransition(explode);
setReenterTransition(explode);
}
getActivity().getSupportFragmentManager()
.beginTransaction()
.replace(R.id.content_frame, taskDetailFragment)
.addToBackStack(null)
.commit();
}
示例4: onCreate
import android.transition.Fade; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Force trigger System UI cover on this Activity
hideSystemUI();
showSystemUI();
// Avoid flash while transition from former Activity
postponeEnterTransition();
getWindow().setStatusBarColor(Color.TRANSPARENT);
getWindow().setNavigationBarColor(Color.TRANSPARENT);
getWindow().getDecorView().setBackgroundColor(Color.TRANSPARENT);
// Using the fade effect for Activity transition
Fade fade = new Fade();
fade.excludeTarget(android.R.id.statusBarBackground, true);
fade.excludeTarget(android.R.id.navigationBarBackground, true);
fade.excludeTarget(R.id.showing_image_view, true);
fade.setDuration(TRANSITION_DURATION);
applyTransitionToWindow(getWindow(), fade, true, true, true, true, true);
setContentView(R.layout.activity_twitterized_image_showing);
setupViews();
}
示例5: onCreate
import android.transition.Fade; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
getWindow().setAllowEnterTransitionOverlap(true);
getWindow().setAllowReturnTransitionOverlap(true);
setContentView(R.layout.activity_animation);
Fade fade = new Fade();
fade.setDuration(5000);
//fade.addTarget(findViewById(R.id.view));
getWindow().setEnterTransition(fade);
getWindow().setExitTransition(fade);
}
示例6: onCreate
import android.transition.Fade; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
if(BuildUtil.isLargeThanAPI21()){
Fade fade = new Fade();
Explode explode = new Explode();
fade.setDuration(100);
getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
getWindow().setEnterTransition(fade);
getWindow().setExitTransition(fade);
}
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about_us);
getSupportActionBar().setTitle("关于我们");
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
示例7: newInstance
import android.transition.Fade; //导入方法依赖的package包/类
public static FullScreenImageFragment newInstance(ArrayList<Poster> imageList, int position) {
Bundle args = new Bundle();
args.putParcelableArrayList(ARG_IMAGE_LIST, imageList);
args.putInt(ARA_SELECT_POSITION, position);
FullScreenImageFragment fragment = new FullScreenImageFragment();
fragment.setArguments(args);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Fade fade = new Fade();
fade.setDuration(500);
fragment.setEnterTransition(fade);
}
return fragment;
}
示例8: performTransition
import android.transition.Fade; //导入方法依赖的package包/类
private void performTransition()
{
if (isDestroyed())
{
return;
}
Fragment previousFragment = mFragmentManager.findFragmentById(R.id.fragment_container);
Fragment nextFragment = Fragment2.newInstance();
FragmentTransaction fragmentTransaction = mFragmentManager.beginTransaction();
// 1. Exit for Previous Fragment
Fade exitFade = new Fade();
exitFade.setDuration(FADE_DEFAULT_TIME);
previousFragment.setExitTransition(exitFade);
// 2. Shared Elements Transition
TransitionSet enterTransitionSet = new TransitionSet();
enterTransitionSet.addTransition(TransitionInflater.from(this).inflateTransition(android.R.transition.move));
enterTransitionSet.setDuration(MOVE_DEFAULT_TIME);
enterTransitionSet.setStartDelay(FADE_DEFAULT_TIME);
nextFragment.setSharedElementEnterTransition(enterTransitionSet);
// 3. Enter Transition for New Fragment
Fade enterFade = new Fade();
enterFade.setStartDelay(MOVE_DEFAULT_TIME + FADE_DEFAULT_TIME);
enterFade.setDuration(FADE_DEFAULT_TIME);
nextFragment.setEnterTransition(enterFade);
View logo = ButterKnife.findById(this, R.id.fragment1_logo);
fragmentTransaction.addSharedElement(logo, logo.getTransitionName());
fragmentTransaction.replace(R.id.fragment_container, nextFragment);
fragmentTransaction.commitAllowingStateLoss();
}
示例9: onCreate
import android.transition.Fade; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
Fade s = new Fade();
s.setDuration(1000);
getWindow().setEnterTransition(s);
super.onCreate(savedInstanceState);
setContentView(R.layout.framelayout);
Window window = getWindow();
mWeatherView = (WeatherView) findViewById(R.id.weather);
S = getIntent().getStringExtra("city");
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new ForecastFragment())
.commit();
}
// ATTENTION: This was auto-generated to implement the App Indexing API.
// See https://g.co/AppIndexing/AndroidStudio for more information.
mWeatherView.setWeather(Constants.weatherStatus.RAIN)
.setCurrentLifeTime(2000)
.setCurrentFadeOutTime(1000)
.setCurrentParticles(43)
.setFPS(60)
.setCurrentAngle(-5)
.setOrientationMode(Constants.orientationStatus.ENABLE)
.startAnimation();
window.setStatusBarColor(getResources().getColor(R.color.blue_900));
}
示例10: initData
import android.transition.Fade; //导入方法依赖的package包/类
@Override
public void initData(Bundle savedInstanceState) {
if (savedInstanceState != null){
videoInfo = (VideoListInfo.Video) savedInstanceState.getSerializable(Constants.VIDEO_INFO);
}
initMedia();
if (videoInfo.getData().getConsumption() !=null ){
initRecyclerView();
mPresenter.getRelaRelateVideoInfo(videoInfo.getData().getId());
mPresenter.getShareInfo(videoInfo.getData().getId());
}else {
mPresenter.getVideoData(videoInfo.getData().getId());
}
dragBottomView.setDismissedListener(this);
replyDragBottomView.setDismissedListener(this);
if (supportsTransitions()){
Slide slide = new Slide(Gravity.BOTTOM);
slide.setDuration(500L);
slide.excludeTarget(android.R.id.statusBarBackground, true);
slide.excludeTarget(android.R.id.navigationBarBackground, true);
slide.excludeTarget(R.id.rl_screen, true);
slide.excludeTarget(R.id.detail_player, true);
getWindow().setEnterTransition(slide);
getWindow().getEnterTransition().excludeTarget(R.id.frameLayout,true);
getWindow().getEnterTransition().excludeTarget(R.id.fl_loading,true);
Fade fade = new Fade();
fade.setDuration(500L);
getWindow().setReturnTransition(fade);
}
}
示例11: setupWindowTransitions
import android.transition.Fade; //导入方法依赖的package包/类
private void setupWindowTransitions(){
if(TransitionHelper.isSysTransitionEnable()) {
Fade fade = new Fade();
fade.setDuration(500);
getWindow().setExitTransition(fade);
getWindow().setReenterTransition(fade);
}
}
示例12: setUpWindowAnimations
import android.transition.Fade; //导入方法依赖的package包/类
private void setUpWindowAnimations() {
if (android.os.Build.VERSION.SDK_INT >= 21) {
Fade fade = new Fade(2);
fade.setDuration(3000);
getWindow().setExitTransition(fade);
}
}
示例13: setupWindowAnimations
import android.transition.Fade; //导入方法依赖的package包/类
private void setupWindowAnimations() {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
Fade fade = new Fade();
fade.setDuration(1000);
getWindow().setEnterTransition(fade);
Toast.makeText(this, "Animation", Toast.LENGTH_SHORT).show();
Explode slide = new Explode();
slide.setDuration(1000);
getWindow().setReenterTransition(slide);
}
}
示例14: buildEnterTransition
import android.transition.Fade; //导入方法依赖的package包/类
private Visibility buildEnterTransition() {
Fade enterTransition = new Fade();
enterTransition.setDuration(getResources().getInteger(R.integer.anim_duration_long));
// This view will not be affected by enter transition animation
enterTransition.excludeTarget(R.id.square_red, true);
return enterTransition;
}
示例15: onInit
import android.transition.Fade; //导入方法依赖的package包/类
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@Override
protected void onInit(Bundle savedInstanceState) {
Fade fade = new Fade();
fade.setInterpolator(new DecelerateInterpolator());
fade.setDuration(500);//动画持续时间
getWindow().setEnterTransition(fade);
Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.fm_content);
if (fragment == null)
{
getSupportFragmentManager().beginTransaction().add(R.id.fm_content, new NormalFragment()).commit();
}
}