android.view.Window.getEnterTransition()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(132)

本文整理了Java中android.view.Window.getEnterTransition()方法的一些代码示例,展示了Window.getEnterTransition()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Window.getEnterTransition()方法的具体详情如下:
包路径:android.view.Window
类名称:Window
方法名:getEnterTransition

Window.getEnterTransition介绍

暂无

代码示例

代码示例来源:origin: naman14/Timber

@TargetApi(21)
@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_playlist_detail);
  action = getIntent().getAction();
  Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
  setSupportActionBar(toolbar);
  getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  getSupportActionBar().setTitle("");
  playlistsMap.put(Constants.NAVIGATE_PLAYLIST_LASTADDED, playlistLastAdded);
  playlistsMap.put(Constants.NAVIGATE_PLAYLIST_RECENT, playlistRecents);
  playlistsMap.put(Constants.NAVIGATE_PLAYLIST_TOPTRACKS, playlistToptracks);
  playlistsMap.put(Constants.NAVIGATE_PLAYLIST_USERCREATED, playlistUsercreated);
  recyclerView = (RecyclerView) findViewById(R.id.recyclerview);
  blurFrame = (ImageView) findViewById(R.id.blurFrame);
  playlistname = (TextView) findViewById(R.id.name);
  foreground = findViewById(R.id.foreground);
  recyclerView.setLayoutManager(new LinearLayoutManager(this));
  setAlbumart();
  animate = getIntent().getBooleanExtra(Constants.ACTIVITY_TRANSITION, false);
  if (animate && TimberUtils.isLollipop()) {
    getWindow().getEnterTransition().addListener(new EnterTransitionListener());
  } else {
    setUpSongs();
  }
}

代码示例来源:origin: kaku2015/ColorfulNews

private void initLazyLoadView() {
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    getWindow().getEnterTransition().addListener(new Transition.TransitionListener() {
      @Override
      public void onTransitionStart(Transition transition) {
      }
      @Override
      public void onTransitionEnd(Transition transition) {
        showToolBarAndPhotoTouchView();
      }
      @Override
      public void onTransitionCancel(Transition transition) {
      }
      @Override
      public void onTransitionPause(Transition transition) {
      }
      @Override
      public void onTransitionResume(Transition transition) {
      }
    });
  } else {
    showToolBarAndPhotoTouchView();
  }
}

代码示例来源:origin: Wing-Li/Material-Animations-CN

private void setupWindowAnimations() {
  // 我们不想定义新的 Enter Transition。
  // 只更改默认的过渡持续时间
  getWindow().getEnterTransition().setDuration(getResources().getInteger(R.integer.anim_duration_long));
}

代码示例来源:origin: wl9739/UITransitionDemo

@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_detail);
  setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
  int imageResId = getIntent().getExtras().getInt(EXTRA_IMAGE);
  mImageView = (ImageView) findViewById(R.id.image);
  mFloatingActionButton = (FloatingActionButton) findViewById(R.id.fabbtn);
  mImageView.setImageResource(imageResId);
  if (savedInstanceState == null) {
    mFloatingActionButton.setScaleX(0);
    mFloatingActionButton.setScaleY(0);
    getWindow().getEnterTransition().addListener(new CustomTransitionListener() {
      @Override
      public void onTransitionEnd(Transition transition) {
        getWindow().getEnterTransition().removeListener(this);
        mFloatingActionButton.animate().scaleX(1).scaleY(1);
      }
    });
  }
}

代码示例来源:origin: rohanoid5/Muzesto

@TargetApi(21)
@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_playlist_detail);
  action = getIntent().getAction();
  playlistsMap.put(Constants.NAVIGATE_PLAYLIST_LASTADDED, playlistLastAdded);
  playlistsMap.put(Constants.NAVIGATE_PLAYLIST_RECENT, playlistRecents);
  playlistsMap.put(Constants.NAVIGATE_PLAYLIST_TOPTRACKS, playlistToptracks);
  playlistsMap.put(Constants.NAVIGATE_PLAYLIST_USERCREATED, playlistUsercreated);
  recyclerView = (RecyclerView) findViewById(R.id.recyclerview);
  blurFrame = (ImageView) findViewById(R.id.blurFrame);
  playlistname = (TextView) findViewById(R.id.name);
  foreground = findViewById(R.id.foreground);
  recyclerView.setLayoutManager(new LinearLayoutManager(this));
  setAlbumart();
  if (TimberUtils.isLollipop() && PreferencesUtility.getInstance(this).getAnimations()) {
    getWindow().getEnterTransition().addListener(new EnterTransitionListener());
  } else {
    setUpSongs();
  }
}

代码示例来源:origin: wl9739/UITransitionDemo

@Override
  public void onTransitionEnd(Transition transition) {
    getWindow().getEnterTransition().removeListener(this);
    mFloatingActionButton.animate().scaleX(1).scaleY(1);
  }
});

代码示例来源:origin: brainysoon/cyberCar

@TargetApi(21)
@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_playlist_detail);
  action = getIntent().getAction();
  playlistsMap.put(Constants.NAVIGATE_PLAYLIST_LASTADDED, playlistLastAdded);
  playlistsMap.put(Constants.NAVIGATE_PLAYLIST_RECENT, playlistRecents);
  playlistsMap.put(Constants.NAVIGATE_PLAYLIST_TOPTRACKS, playlistToptracks);
  playlistsMap.put(Constants.NAVIGATE_PLAYLIST_USERCREATED, playlistUsercreated);
  recyclerView = (RecyclerView) findViewById(R.id.recyclerview);
  blurFrame = (ImageView) findViewById(R.id.blurFrame);
  playlistname = (TextView) findViewById(R.id.name);
  foreground = findViewById(R.id.foreground);
  recyclerView.setLayoutManager(new LinearLayoutManager(this));
  setAlbumart();
  if (TimberUtils.isLollipop() && PreferencesUtility.getInstance(this).getAnimations()) {
    getWindow().getEnterTransition().addListener(new EnterTransitionListener());
  } else {
    setUpSongs();
  }
}

代码示例来源:origin: Wing-Li/Material-Animations-CN

private void setWindowAnimations() {
  Slide slide = new Slide();
  slide.setDuration(getResources().getInteger(R.integer.anim_duration_long));
  slide.setSlideEdge(Gravity.BOTTOM);
  getWindow().setEnterTransition(slide);
  getWindow().getEnterTransition().addListener(new Transition.TransitionListener() {
    @Override
    public void onTransitionStart(Transition transition) {
    }
    @Override
    public void onTransitionEnd(Transition transition) {
      getWindow().getEnterTransition().removeListener(this);
      TransitionManager.go(scene0);
    }
    @Override
    public void onTransitionCancel(Transition transition) {
    }
    @Override
    public void onTransitionPause(Transition transition) {
    }
    @Override
    public void onTransitionResume(Transition transition) {
    }
  });
}

相关文章

微信公众号

最新文章

更多

Window类方法