GoodsApplication.kt 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. //package apkbuild
  2. //
  3. //import com.enation.javashop.android.jrouter.JRouter
  4. //import com.enation.javashop.android.lib.base.BaseApplication
  5. //import com.enation.javashop.net.engine.config.NetEngineConfig
  6. //import com.enation.javashop.net.engine.plugin.exception.RestfulExceptionInterceptor
  7. //import com.enation.javashop.utils.base.config.BaseConfig
  8. //import com.squareup.leakcanary.LeakCanary
  9. //import io.reactivex.Observable
  10. //import io.reactivex.android.schedulers.AndroidSchedulers
  11. //import io.reactivex.schedulers.Schedulers
  12. //import io.reactivex.functions.Function3
  13. //
  14. ///**
  15. // * 单Moudle编译 Application
  16. // */
  17. //class GoodsApplication:BaseApplication() {
  18. // /**
  19. // * @author LDD
  20. // * @From Application
  21. // * @Date 2018/1/11 下午12:50
  22. // * @Note 应用启动时调用
  23. // */
  24. // override fun onCreate() {
  25. // super.onCreate()
  26. // Observable.zip(initRouter().subscribeOn(Schedulers.newThread()),
  27. // initLeaks().subscribeOn(Schedulers.newThread()),
  28. // initFrame().subscribeOn(Schedulers.newThread()),
  29. // Function3<String,String,String,String> { _ , _ , _ -> return@Function3 "" }).
  30. // observeOn(AndroidSchedulers.mainThread()).subscribe({})
  31. // }
  32. //
  33. // /**
  34. // * @author LDD
  35. // * @From Application
  36. // * @Date 2018/1/11 下午12:50
  37. // * @Note 初始化路由
  38. // * @return rx观察者
  39. // */
  40. // private fun initRouter(): Observable<String> {
  41. // return Observable.create {
  42. // JRouter.init(this)
  43. // JRouter.openDebug()
  44. // JRouter.openLog()
  45. // JRouter.prepare().create("/welcome/launch").seek()
  46. // }
  47. // }
  48. //
  49. // /**
  50. // * @author LDD
  51. // * @From Application
  52. // * @Date 2018/1/11 下午12:50
  53. // * @Note 初始化内存检测器
  54. // * @return rx观察者
  55. // */
  56. // private fun initLeaks(): Observable<String> {
  57. // return Observable.create {
  58. // LeakCanary.install(this)
  59. // }
  60. // }
  61. //
  62. // /**
  63. // * @author LDD
  64. // * @From Application
  65. // * @Date 2018/1/11 下午12:50
  66. // * @Note 初始化内部框架
  67. // * @return rx观察者
  68. // */
  69. // private fun initFrame(): Observable<String> {
  70. // return Observable.create {
  71. // if (android.os.Build.VERSION.SDK_INT> android.os.Build.VERSION_CODES.LOLLIPOP){
  72. // BaseConfig.getInstance().addActivity("HomeActivity")
  73. // }else{
  74. // BaseConfig.getInstance().closeScrollBack()
  75. // }
  76. // NetEngineConfig.init(baseContext)
  77. // .openLogger()
  78. // .addNetInterceptor(RestfulExceptionInterceptor())
  79. // }
  80. // }
  81. //}