android.transition.Transition.setEpicenterCallback()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(161)

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

Transition.setEpicenterCallback介绍

暂无

代码示例

代码示例来源:origin: bluelinelabs/Conductor

public static void setEpicenter(@NonNull Transition transition, @Nullable View view) {
  if (view != null) {
    final Rect epicenter = new Rect();
    getBoundsOnScreen(view, epicenter);
    transition.setEpicenterCallback(new Transition.EpicenterCallback() {
      @Override
      public Rect onGetEpicenter(Transition transition) {
        return epicenter;
      }
    });
  }
}

代码示例来源:origin: bluelinelabs/Conductor

setFromEpicenter(capturedFromSharedElements);
if (enterTransition != null) {
  enterTransition.setEpicenterCallback(new Transition.EpicenterCallback() {
    @Override
    public Rect onGetEpicenter(Transition transition) {

代码示例来源:origin: kingargyle/adt-leanback-support

private static void setSharedElementEpicenter(Transition transition,
    final EpicenterView epicenterView) {
  if (transition != null) {
    transition.setEpicenterCallback(new Transition.EpicenterCallback() {
      private Rect mEpicenter;
      @Override
      public Rect onGetEpicenter(Transition transition) {
        if (mEpicenter == null && epicenterView.epicenter != null) {
          mEpicenter = getBoundsOnScreen(epicenterView.epicenter);
        }
        return mEpicenter;
      }
    });
  }
}

代码示例来源:origin: kingargyle/adt-leanback-support

public static void setEpicenter(Object transitionObject, View view) {
  Transition transition = (Transition) transitionObject;
  final Rect epicenter = getBoundsOnScreen(view);
  transition.setEpicenterCallback(new Transition.EpicenterCallback() {
    @Override
    public Rect onGetEpicenter(Transition transition) {
      return epicenter;
    }
  });
}

相关文章