Comments (11)
用 rootSceneComponentFactory,拦截创建个新的 Scene,把你的 Object 通过构造方法传入
from scene.
返回true就是强制支持销毁恢复,只允许序列化的对象传递,不允许Scene有其他其他的构造方法
from scene.
是的
from scene.
感谢
from scene.
那么当在 Scene 中 Push 另一个 Scene 时需要传输对象时呢?应该如何做
from scene.
你要支持销毁恢复吗?(就是那个 supportResotre),不支持的话(就是返回false),直接把你的对象放入构造方法参数呗,支持的话(就是返回true),写个 XXXXXScene.newIntance(YYY),只能把支持序列化的对象放入 Scene.setArguments
from scene.
你要支持销毁恢复吗?(就是那个 supportResotre),不支持的话(就是返回false),直接把你的对象放入构造方法参数呗,支持的话(就是返回true),写个 XXXXXScene.newIntance(YYY),只能把支持序列化的对象放入 Scene.setArguments
是这样吗
oneScene.requireNavigationScene().push(`TwoScene(obj, obj1)`, PushOptions.Builder().setAnimation( SharedElementSceneTransitionExecutor( map, Slide() ) ).build())
TwoScene(obj, obj1)
但是好像会出错,昨天晚上好像是看到说不允许有参数,请问有示例代码吗@qii
from scene.
class MainActivity : SceneActivity() {
override fun getHomeSceneClass(): Class<out Scene> {
return MainScene::class.java
}
override fun supportRestore(): Boolean {
return false //这里返回false
}
}
from scene.
@qii 另外,Activity 或 Fragment 如何与 Scene 通信
例如 Activity 有一个下载任务,下载完后我需要通知 Scene 已经下载完成
from scene.
在同个Activity内吗?如果是,用 ViewModel+LiveData,如果不是,用类似 EventBus 这种,订阅一个单例,下载完成的地方给这个单例发消息
from scene.
ViewModel+LiveData
是指 Activity 与 Scene 使用同一个 ViewModel 吗
activity:
ViewModelProviders.of(this).get(MyViewModel::class.java)
scene:
ViewModelProviders.of(activity).get(MyViewModel::class.java)
from scene.
Related Issues (20)
- SceneContainerActivity透明主题 HOT 4
- need release resources on OnDestroyView? HOT 4
- Viewpager2 adapter HOT 2
- Why not using material components? HOT 1
- Deep linking? HOT 1
- Demo singleTask 用法和singleTop 一样啊,不会清除要启动的sense 栈上面的sense HOT 1
- scene跨进程打开另外一个页面 可以解决白屏问题吗? HOT 5
- 出现空指针 HOT 2
- 出现崩溃 HOT 2
- 现状和计划 HOT 8
- 如何在Scene里面监听按键 HOT 1
- 无法拉取新版本更新依赖的问题。 HOT 8
- 关于权限请求的问题 HOT 1
- 觉得这个项目和Jetpack Compose 很适合一起使用 HOT 1
- 结合ViewBinding使用的回收时机 HOT 1
- 绑定到Fragment时onViewCreated生命周期 HOT 5
- JCenter deprecated HOT 1
- Compose兼容 HOT 8
- 项目编译不过 HOT 2
- BottomNavigationViewScene的底部menu点击事件回调能否传出来? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scene.