/Component

A powerful componentized framework.一个强大的组件化框架. 选型的时候你真的好好比较了此框架 和 ARouter 的优缺点了吗?点击后面链接查看比较结果

Primary LanguageJavaApache License 2.0Apache-2.0

English Doc | 中文文档

Component VS ARouter

Component

A powerful componentized framework. Component focuses on improving the user experience. If you have any confusion while using Component, issues are welcomed any time. You can also join our community by scanning the QRCode below to discuss more about the Component

Demo Apk(scan qrcode or click the image to download)

The advantage of Component

There are many componentized framework for Android, and what are advantages of Component?

  • Support standard URI.
  • Support androidx, there is almost no componentized framework can support it.
  • Support lifecycle of Module
  • The design of Component is close to native, less invasive for native code, minimizing the possibility of retaining native code
  • Support autowire of Parameter and Service
  • The Interceptor of Router is running on MainThread
    • The design of Interceptor, we think 90% code is running on MainThread,so the Interceptor of Router is running on MainThread .Then you can operate the UI or Dialog and so on.
    • We provoder the Callback mechanism,then you can do any thing in Interceptor
    • This advantage is very useful
  • An idea plugin can navigate to target Activity and find all the use of target Activity, here is the Plugin
  • Cancel routering, this advantage is very useful
    • You can cancel routering
    • The routering will auto canceled when Activity or Fragment destoried
  • Interceptor of router, more detail see Interceptor Wiki
    • Global Interceptor
    • Local Interceptor
      • page Interceptor
      • The alias name of Interceptor, you can use Interceptor by name anywhere
  • Routering
    • Support standard URI
    • Support custom Intent
    • Support routering api like [Retrofit
    • Idea Plugin can navigate to target Activity and find all the use of target `Activity``
  • Perfect support H5
    • H5 can use URL jump to any Activity
    • Because of page Interceptor, when you routering from H5,you don't need to care whether the target Activity is need login or other or not
    • Not Support get target Activity result from H5, this situation you have to design Type to do as before.
  • You can get ActivityResult with no change of code, also don't need to change any code of BaseActivity
    • As the behavior of system, when Context is Application or Service Context or ContentProvider Context, will not support.
    • In addition to the above points, other situations are all sopport, include Dialog and so on.
  • The Routering and Service is divided
  • Perfect support RxJava2 when you use rx version.
  • Module run alone

hello world

hello world

More usage detail

if you want leran more you can see wiki

Some articles

  • Waht is componentized

Idea Plugin

RouterGo can navigate to target Activity and find all the use of target Activity, you're worth it!

Scan qrcode to join QQ group

License

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.