百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
D

Depth

> 设计协作
开源

为您的片段添加一些深度

774 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

为您的片段添加一些深度

Depth

Add some Depth to your fragments The blue comes from the activity background color

In your activity

java
final Depth depth = DepthProvider.getDepth(container);
depth
      .animate()
      .reduce(oldFragment)

      .exit(oldFragment)

      .enter(newFragment)
      .start();

In your fragment

java
private Depth depth;

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    this.depth = DepthProvider.getDepth(container);
    return depth.setupFragment(10f, 10f, inflater.inflate(R.layout.fragment_1, container, false));
}

@Override
public void onViewCreated(final View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    depth.onFragmentReady(this);
}

Customize the animations

java
depth
     .animate()
     .reduce(oldFragment, new ReduceConfiguration()
             .setRotationZ(0f)
             .setRotationX(30f)
             .setDuration(1000)
     )

     .exit(oldFragment, new ExitConfiguration()
             .setFinalXPercent(0f)
             .setFinalYPercent(-1f)
     )
     .enter(newFragment, new EnterConfiguration()
             .setInitialXPercent(0f)
             .setInitialYPercent(1f)
             .setInitialRotationZ(0f)
             .setInitialRotationX(30f)
     )
     .start();

Add multiples DepthLayouts

Don't use depth.setupFragment(

But manually create your own layout with DepthRelativeLayoutContainerand DepthRelativeLayout

xml

    

        

            

            

        

    

    

        

        

    

#Download

In your module

groovy
compile 'com.github.florent37:depth:1.0.0'

Changelog

1.0.0

Initial import

Community

Forked from danielzeller/Depth-LIB-Android- Thanks for their amazing work !

Credits

Author: Florent Champigny

Fiches Plateau Moto : https://www.fiches-plateau-moto.fr/

License

Copyright 2017 florent37, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Java3dandroidanimationdepth

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类设计协作
定价开源

> 相关工具

F
Figma
协作式界面设计工具
S
sketch-wakatime
Sketch plugin for automatic time tracking and metrics generated from your Sketch usage.
Q
QuickColor
Quickly apply fills from the global or document color palettes to selected elements - 🎨