bytedance / scene

Android Single Activity Framework compatible with Fragment.
Apache License 2.0
2.07k stars 197 forks source link

现状和计划 #57

Open qii opened 3 years ago

qii commented 3 years ago

2021.4.6

Scene 的现状是目前的 API 已经满足了产品的需求,开发者本身有其他忙碌的工作,所以迭代的很慢。不过这个库能做的当然还有很多,把目前完成的,开发的,计划的列一下:

已经完成的

1,拆分 com.bytedance.scene:scene,抽出单独的 com.bytedance.scene:scene-navigation,单独拆出来导航库单独方便后续迭代 2,NavigationScene 完善透明 Scene 和不透明 Scene 之间的切换,主要用于动画,适用于本身不透明的页面,在动画过程中先透明,动画后切回不透明的场景

正在开发中的

1,现有 Activity + Fragment 设计的 App,在加入 Scene 后如何处理首页被覆盖的 Fragment 等其生命周期的兼容方案 2,优化 NavigationScene push 的 API,想加入类似官方 Navigation component 的 navOptions DSL 这种

findNavController().navigate(
    R.id.action_fragmentOne_to_fragmentTwo,
    null,
    navOptions { // Use the Kotlin DSL for building NavOptions
        anim {
            enter = android.R.animator.fade_in
            exit = android.R.animator.fade_out
        }
    }
)
navigationScene?.push(TargetScene(), 
    pushOptions {
        anim {
            enter = android.R.animator.fade_in
            exit = android.R.animator.fade_out
        }
    }
)

还需要完善的

1,Scene Router,https://github.com/bytedance/scene/tree/scene_router 支持 Url 跳转,用于组件化解耦 2,Scene Dialog,https://github.com/bytedance/scene/tree/master/library/scene_dialog 解决普通 Dialog 会盖在所有 View 上面,所以封装了一套 Scene Dialog 3,Safe Argument,还没做,用注解来解决 Bundle 类型不安全

Iridescentangle commented 3 years ago

支持大佬 加油

qii commented 3 years ago

jcenter 关门了,以后用 jitpack 好了

Step 1. Add the JitPack repository to your build file

Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Step 2. Add the dependency

dependencies {
            implementation 'com.github.bytedance.scene:scene:v1.2.0'
            implementation 'com.github.bytedance.scene:scene_ui:v1.2.0'
            implementation 'com.github.bytedance.scene:scene_navigation:v1.2.0'
           implementation 'com.github.bytedance.scene:scene_shared_element_animation:v1.2.0'
           implementation 'com.github.bytedance.scene:scene_ktx:v1.2.0'
}

现在主要的问题好像是没法拉到源代码,只能反编译的看

zombiu commented 3 years ago

大佬牛批!

xiaoyaomeng commented 3 years ago

大佬加油哈,等着你的路由呢~

XuJhin commented 2 years ago

这个是不是跟telegram中的思路一样,telegram也是完全抛弃了官方的fragment,自己抽象了fragment(基于view),然后控制生命周期,然后对应的dialog和其他view也是重新写了一套逻辑。但是这样也会引入新的问题,官方的出一些库,如lifecycle,hilt甚至与kotlin协程框架,都得自己去做适配,成本太高了

qii commented 2 years ago

这个是不是跟telegram中的思路一样,telegram也是完全抛弃了官方的fragment,自己抽象了fragment(基于view),然后控制生命周期,然后对应的dialog和其他view也是重新写了一套逻辑。但是这样也会引入新的问题,官方的出一些库,如lifecycle,hilt甚至与kotlin协程框架,都得自己去做适配,成本太高了

若不是 Fragment 坑太多,又何苦如此。。。

est7 commented 1 year ago

android 强推的compose screen + 单activity 这种做法怎么样

qii commented 1 year ago

android 强推的compose screen + 单activity 这种做法怎么样

我还没怎么调研这种玩法

joeyzhao1005 commented 1 month ago

2021.4.6

Scene 的现状是目前的 API 已经满足了产品的需求,开发者本身有其他忙碌的工作,所以迭代的很慢。不过这个库能做的当然还有很多,把目前完成的,开发的,计划的列一下:

已经完成的

1,拆分 com.bytedance.scene:scene,抽出单独的 com.bytedance.scene:scene-navigation,单独拆出来导航库单独方便后续迭代 2,NavigationScene 完善透明 Scene 和不透明 Scene 之间的切换,主要用于动画,适用于本身不透明的页面,在动画过程中先透明,动画后切回不透明的场景

正在开发中的

1,现有 Activity + Fragment 设计的 App,在加入 Scene 后如何处理首页被覆盖的 Fragment 等其生命周期的兼容方案 2,优化 NavigationScene push 的 API,想加入类似官方 Navigation component 的 navOptions DSL 这种

findNavController().navigate(
    R.id.action_fragmentOne_to_fragmentTwo,
    null,
    navOptions { // Use the Kotlin DSL for building NavOptions
        anim {
            enter = android.R.animator.fade_in
            exit = android.R.animator.fade_out
        }
    }
)
navigationScene?.push(TargetScene(), 
    pushOptions {
        anim {
            enter = android.R.animator.fade_in
            exit = android.R.animator.fade_out
        }
    }
)

还需要完善的

1,Scene Router,https://github.com/bytedance/scene/tree/scene_router 支持 Url 跳转,用于组件化解耦 2,Scene Dialog,https://github.com/bytedance/scene/tree/master/library/scene_dialog 解决普通 Dialog 会盖在所有 View 上面,所以封装了一套 Scene Dialog 3,Safe Argument,还没做,用注解来解决 Bundle 类型不安全

2024年了,navOptions的大饼还没烙好 23333

qii commented 1 month ago

其实这个库在公司内部是一直更新的,但我人实在太忙了/太懒了,就没同步到 github 上面,近期同步一些吧,尴尬

joeyzhao1005 commented 1 month ago

其实这个库在公司内部是一直更新的,但我人实在太忙了/太懒了,就没同步到 github 上面,近期同步一些吧,尴尬

加油,等你的更新!

OnClickListener2048 commented 1 month ago

问下 像这种框架级别的代码修改你们是怎么做回归测试呢

qii commented 1 month ago

问下 像这种框架级别的代码修改你们是怎么做回归测试呢

靠单元测试,尽可能的补单元测试了,有些高风险的改动会做成可配置,让 QA 在发版之前的测试中测试实验组,后续再线上做实验慢慢放量观察有没引入 Bug

qii commented 1 week ago

1.3.2 新版已发,源码已经跟 2024.8 抖音和 TikTok 一致,NavigationScene 基本上都重写了,改动太多,回头补 changelog,demo apk 见 https://github.com/bytedance/scene/releases/tag/v1.3.2

dependencies {
    implementation 'com.github.bytedance:scene:v1.3.2'
}

//或者
dependencies {
    implementation 'com.github.bytedance.scene:scene:v1.3.2'
    implementation 'com.github.bytedance.scene:scene_navigation:v1.3.2'
    implementation 'com.github.bytedance.scene:scene_ui:v1.3.2'
    implementation 'com.github.bytedance.scene:scene_dialog:v1.3.2'
    implementation 'com.github.bytedance.scene:scene_shared_element_animation:v1.3.2'
    implementation 'com.github.bytedance.scene:scene_ktx:v1.3.2'
}
est7 commented 1 week ago

1.3.2 新版已发,源码已经跟 2024.8 抖音和 TikTok 一致,NavigationScene 基本上都重写了,改动太多,回头补 changelog

dependencies {
  implementation 'com.github.bytedance:scene:v1.3.2'
}

//或者
dependencies {
  implementation 'com.github.bytedance.scene:scene:v1.3.2'
  implementation 'com.github.bytedance.scene:scene_navigation:v1.3.2'
  implementation 'com.github.bytedance.scene:scene_ui:v1.3.2'
  implementation 'com.github.bytedance.scene:scene_dialog:v1.3.2'
  implementation 'com.github.bytedance.scene:scene_shared_element_animation:v1.3.2'
  implementation 'com.github.bytedance.scene:scene_ktx:v1.3.2'
}

谢谢大佬更新,还有 samples apk 哦~

qii commented 1 week ago

谢谢大佬更新,还有 samples apk 哦~

https://github.com/bytedance/scene/releases/tag/v1.3.2 这里有 apk 下载

est7 commented 1 week ago

谢谢大佬更新,还有 samples apk 哦~

https://github.com/bytedance/scene/releases/tag/v1.3.2 这里有 apk 下载

一片白

qii commented 1 week ago

上传错了,你再试试