当前位置: 首页>>代码示例>>Java>>正文


Java ArcMotion.setMinimumVerticalAngle方法代码示例

本文整理汇总了Java中android.transition.ArcMotion.setMinimumVerticalAngle方法的典型用法代码示例。如果您正苦于以下问题:Java ArcMotion.setMinimumVerticalAngle方法的具体用法?Java ArcMotion.setMinimumVerticalAngle怎么用?Java ArcMotion.setMinimumVerticalAngle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.transition.ArcMotion的用法示例。


在下文中一共展示了ArcMotion.setMinimumVerticalAngle方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setMotion

import android.transition.ArcMotion; //导入方法依赖的package包/类
/**
 * 设置自定义 Shared Element切换动画
 * 默认不开启曲线路径切换动画,
 * 开启需要重写setHeaderPicView(),和调用此方法并将isShow值设为true
 *
 * @param imageView 共享的图片
 * @param isShow    是否显示曲线动画
 */
protected void setMotion(ImageView imageView, boolean isShow) {
    if (!isShow) {
        return;
    }
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        //定义ArcMotion
        ArcMotion arcMotion = new ArcMotion();
        arcMotion.setMinimumHorizontalAngle(50f);
        arcMotion.setMinimumVerticalAngle(50f);
        //插值器,控制速度
        Interpolator interpolator = AnimationUtils.loadInterpolator(this, android.R.interpolator.fast_out_slow_in);

        //实例化自定义的ChangeBounds
        CustomChangeBounds changeBounds = new CustomChangeBounds();
        changeBounds.setPathMotion(arcMotion);
        changeBounds.setInterpolator(interpolator);
        changeBounds.addTarget(imageView);
        //将切换动画应用到当前的Activity的进入和返回
        getWindow().setSharedElementEnterTransition(changeBounds);
        getWindow().setSharedElementReturnTransition(changeBounds);
    }
}
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:31,代码来源:BaseHeaderActivity.java

示例2: setMotion

import android.transition.ArcMotion; //导入方法依赖的package包/类
/**
 * 设置自定义 Shared Element切换动画
 */
private void setMotion() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        //定义ArcMotion
        ArcMotion arcMotion = new ArcMotion();
        arcMotion.setMinimumHorizontalAngle(50f);
        arcMotion.setMinimumVerticalAngle(50f);
        //插值器,控制速度
        Interpolator interpolator = AnimationUtils.loadInterpolator(this, android.R.interpolator.fast_out_slow_in);

        //实例化自定义的ChangeBounds
        CustomChangeBounds changeBounds = new CustomChangeBounds();
        changeBounds.setPathMotion(arcMotion);
        changeBounds.setInterpolator(interpolator);
        changeBounds.addTarget(binding.include.ivOnePhoto);
        //将切换动画应用到当前的Activity的进入和返回
        getWindow().setSharedElementEnterTransition(changeBounds);
        getWindow().setSharedElementReturnTransition(changeBounds);
    }
}
 
开发者ID:youlookwhat,项目名称:ScrollShapeUI,代码行数:23,代码来源:NeteasePlaylistActivity.java

示例3: setupSharedEelementTransitions

import android.transition.ArcMotion; //导入方法依赖的package包/类
public void setupSharedEelementTransitions() {
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP)
        return; //Show dialog normally if below Lollipop
    ArcMotion arcMotion = new ArcMotion();
    arcMotion.setMinimumHorizontalAngle(50f);
    arcMotion.setMinimumVerticalAngle(50f);

    Interpolator easeInOut = AnimationUtils.loadInterpolator(this, android.R.interpolator.fast_out_slow_in);

    MorphFabToDialog sharedEnter = new MorphFabToDialog(getBackgroundColor());
    sharedEnter.setPathMotion(arcMotion);
    sharedEnter.setInterpolator(easeInOut);

    MorphDialogToFab sharedReturn = new MorphDialogToFab(getBackgroundColor());
    sharedReturn.setPathMotion(arcMotion);
    sharedReturn.setInterpolator(easeInOut);

    if (ui.container != null) {
        sharedEnter.addTarget(ui.container);
        sharedReturn.addTarget(ui.container);
    }
    getWindow().setSharedElementEnterTransition(sharedEnter);
    getWindow().setSharedElementReturnTransition(sharedReturn);
}
 
开发者ID:AdityaAnand1,项目名称:Morphing-Material-Dialogs,代码行数:25,代码来源:DialogActivity.java

示例4: setupSharedEelementTransitions1

import android.transition.ArcMotion; //导入方法依赖的package包/类
/**
 * 使用方式一:调用setupSharedEelementTransitions1方法
 * 使用这种方式的话需要的类是 MorphDrawable, MorphFabToDialog, MorphDialogToFab
 */
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public void setupSharedEelementTransitions1() {
    ArcMotion arcMotion = new ArcMotion();
    arcMotion.setMinimumHorizontalAngle(50f);
    arcMotion.setMinimumVerticalAngle(50f);

    Interpolator easeInOut = AnimationUtils.loadInterpolator(this, android.R.interpolator.fast_out_slow_in);

    MorphFabToDialog sharedEnter = new MorphFabToDialog();
    sharedEnter.setPathMotion(arcMotion);
    sharedEnter.setInterpolator(easeInOut);

    MorphDialogToFab sharedReturn = new MorphDialogToFab();
    sharedReturn.setPathMotion(arcMotion);
    sharedReturn.setInterpolator(easeInOut);

    if (container != null) {
        sharedEnter.addTarget(container);
        sharedReturn.addTarget(container);
    }
    getWindow().setSharedElementEnterTransition(sharedEnter);
    getWindow().setSharedElementReturnTransition(sharedReturn);
}
 
开发者ID:li-yu,项目名称:Huahui-Android,代码行数:28,代码来源:QueryActivity.java

示例5: setMotion

import android.transition.ArcMotion; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void setMotion() {
    // Activity设置自定义 Shared Element切换动画
    //定义ArcMotion
    ArcMotion arcMotion = new ArcMotion();
    arcMotion.setMinimumHorizontalAngle(50f);
    arcMotion.setMinimumVerticalAngle(50f);
    //插值器,控制速度
    Interpolator interpolator = AnimationUtils
            .loadInterpolator(this, android.R.interpolator.fast_out_slow_in);
    //实例化自定义的ChangeBounds
    CustomChangeBounds changeBounds = new CustomChangeBounds();
    changeBounds.setPathMotion(arcMotion);
    changeBounds.setInterpolator(interpolator);
    changeBounds.addTarget(mBinding.comicThumbnailComicDetails);
    //将切换动画应用到当前的Activity的进入和返回
    getWindow().setSharedElementEnterTransition(changeBounds);
    getWindow().setSharedElementReturnTransition(changeBounds);
}
 
开发者ID:huxizhijian,项目名称:HHComicViewer,代码行数:20,代码来源:ComicDetailsActivity.java

示例6: onCreate

import android.transition.ArcMotion; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_custom_transition_second);
    ViewGroup container = (ViewGroup) findViewById(R.id.container);
    getSupportActionBar().setTitle("第二个Activity");

    /*  自定义 Shared Element切换动画 */

    //定义ArcMotion
    ArcMotion arcMotion = new ArcMotion();
    arcMotion.setMinimumHorizontalAngle(50f);
    arcMotion.setMinimumVerticalAngle(50f);

    // 设置插值器 - 慢进快出
    Interpolator interpolator = AnimationUtils
            .loadInterpolator(this, android.R.interpolator.fast_out_slow_in);

    //实例化自定义的ChangeBounds
    CustomChangeBounds changeBounds = new CustomChangeBounds();
    changeBounds.setPathMotion(arcMotion);
    changeBounds.setInterpolator(interpolator);
    changeBounds.addTarget(container);

    //将切换动画应用到当前的Activity的进入和返回
    getWindow().setSharedElementEnterTransition(changeBounds);
    getWindow().setSharedElementReturnTransition(changeBounds);

}
 
开发者ID:InnoFang,项目名称:Android-Code-Demos,代码行数:30,代码来源:CustomTransitionSecondActivity.java

示例7: setupSharedEelementTransitions2

import android.transition.ArcMotion; //导入方法依赖的package包/类
/**
 * 使用方式二:调用setupSharedEelementTransitions2方法
 * 使用这种方式的话需要的类是 MorphDrawable, MorphTransition
 */
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public void setupSharedEelementTransitions2() {
    ArcMotion arcMotion = new ArcMotion();
    arcMotion.setMinimumHorizontalAngle(50f);
    arcMotion.setMinimumVerticalAngle(50f);

    Interpolator easeInOut = AnimationUtils.loadInterpolator(this, android.R.interpolator.fast_out_slow_in);

    //hujiawei 100是随意给的一个数字,可以修改,需要注意的是这里调用container.getHeight()结果为0
    MorphTransition sharedEnter = new MorphTransition(ContextCompat.getColor(this, R.color.colorPrimary),
            ContextCompat.getColor(this, R.color.white), 100, getResources().getDimensionPixelSize(R.dimen.dialog_corners), true);
    sharedEnter.setPathMotion(arcMotion);
    sharedEnter.setInterpolator(easeInOut);

    MorphTransition sharedReturn = new MorphTransition(ContextCompat.getColor(this, R.color.colorPrimary),
            ContextCompat.getColor(this, R.color.white), getResources().getDimensionPixelSize(R.dimen.dialog_corners), 100, false);
    sharedReturn.setPathMotion(arcMotion);
    sharedReturn.setInterpolator(easeInOut);

    if (container != null) {
        sharedEnter.addTarget(container);
        sharedReturn.addTarget(container);
    }
    getWindow().setSharedElementEnterTransition(sharedEnter);
    getWindow().setSharedElementReturnTransition(sharedReturn);
}
 
开发者ID:li-yu,项目名称:Huahui-Android,代码行数:31,代码来源:QueryActivity.java

示例8: setupSharedElementTransitions

import android.transition.ArcMotion; //导入方法依赖的package包/类
/**
 * Configure the shared element transitions for morphin from a fab <-> dialog. We need to do
 * this in code rather than declaratively as we need to supply the color to transition from/to
 * and the dialog corner radius which is dynamically supplied depending upon where this screen
 * is launched from.
 */
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public static void setupSharedElementTransitions(@NonNull Activity activity,
                                                 @Nullable View mockFab,
                                                 int dialogCornerRadius) {
    if (!activity.getIntent().hasExtra(EXTRA_SHARED_ELEMENT_START_COLOR)) return;

    int startCornerRadius = activity.getIntent()
            .getIntExtra(EXTRA_SHARED_ELEMENT_START_CORNER_RADIUS, -1);

    ArcMotion arcMotion = new ArcMotion();
    arcMotion.setMinimumHorizontalAngle(5f);
    arcMotion.setMinimumVerticalAngle(10f);
    arcMotion.setMaximumAngle(10f);
    int color = activity.getIntent().getIntExtra(EXTRA_SHARED_ELEMENT_START_COLOR, Color.TRANSPARENT);
    Interpolator easeInOut =
            AnimationUtils.loadInterpolator(activity, android.R.interpolator.fast_out_slow_in);
    MorphFabToDialog sharedEnter =
            new MorphFabToDialog(color, dialogCornerRadius, startCornerRadius);
    sharedEnter.setPathMotion(arcMotion);
    sharedEnter.setInterpolator(easeInOut);
    MorphDialogToFab sharedReturn = new MorphDialogToFab(color, startCornerRadius);
    sharedReturn.setPathMotion(arcMotion);
    sharedReturn.setInterpolator(easeInOut);
    if (mockFab != null) {
        sharedEnter.addTarget(mockFab);
        sharedReturn.addTarget(mockFab);
    }

    TransitionSet set = new TransitionSet();
    set.addTransition(sharedEnter);

    //TODO: Elevation flicker is due to FAB still visible
    set.addTransition(new ChangeElevation());

    TransitionSet set2 = new TransitionSet();
    set2.addTransition(sharedReturn);
    set2.addTransition(new ChangeElevation());

    activity.getWindow().setSharedElementEnterTransition(set);
    activity.getWindow().setSharedElementReturnTransition(set2);
}
 
开发者ID:plusCubed,项目名称:anticipate,代码行数:48,代码来源:FabDialogMorphSetup.java


注:本文中的android.transition.ArcMotion.setMinimumVerticalAngle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。