Bladeren bron

删掉无用模块

weizhengliang 2 jaren geleden
bovenliggende
commit
2d43addaad
100 gewijzigde bestanden met toevoegingen van 1 en 8036 verwijderingen
  1. 1 0
      .gitignore
  2. 0 1
      extra/.gitignore
  3. 0 129
      extra/build.gradle
  4. 0 21
      extra/proguard-rules.pro
  5. 0 26
      extra/src/androidTest/java/com/enation/javashop/android/component/extra/ExampleInstrumentedTest.java
  6. 0 13
      extra/src/main/AndroidManifest.xml
  7. 0 15
      extra/src/main/ApkBuildDir/AndroidManifest.xml
  8. 0 81
      extra/src/main/code/apkbuild/ExtraApplication.kt
  9. 0 114
      extra/src/main/code/com/wdkl/ncs/android/component/extra/activity/ScanActivity.kt
  10. 0 15
      extra/src/main/code/com/wdkl/ncs/android/component/extra/di/ExtraComponent.kt
  11. 0 24
      extra/src/main/code/com/wdkl/ncs/android/component/extra/launch/ExtraLaunch.kt
  12. 0 28
      extra/src/main/res/layout/my_camera.xml
  13. 0 59
      extra/src/main/res/layout/scan_act_lay.xml
  14. 0 3
      extra/src/main/res/values/strings.xml
  15. 0 17
      extra/src/test/java/com/enation/javashop/android/component/extra/ExampleUnitTest.java
  16. 0 1
      hello/.gitignore
  17. 0 125
      hello/build.gradle
  18. 0 21
      hello/proguard-rules.pro
  19. 0 24
      hello/src/androidTest/java/com/wdkl/ncs/android/component/hello/ExampleInstrumentedTest.kt
  20. 0 13
      hello/src/main/AndroidManifest.xml
  21. 0 56
      hello/src/main/java/com/wdkl/ncs/android/component/hello/activity/HelloActivity.kt
  22. 0 112
      hello/src/main/java/com/wdkl/ncs/android/component/hello/activity/HelloListActivity.kt
  23. 0 45
      hello/src/main/java/com/wdkl/ncs/android/component/hello/adapter/HelloItemAdapter.kt
  24. 0 12
      hello/src/main/java/com/wdkl/ncs/android/component/hello/di/HelloComponent.kt
  25. 0 21
      hello/src/main/java/com/wdkl/ncs/android/component/hello/launch/HelloLaunch.kt
  26. 0 30
      hello/src/main/res/layout/hello_act_lay.xml
  27. 0 30
      hello/src/main/res/layout/hello_list_act_lay.xml
  28. 0 30
      hello/src/main/res/layout/hello_list_item_lay.xml
  29. 0 3
      hello/src/main/res/values/strings.xml
  30. 0 17
      hello/src/test/java/com/wdkl/ncs/android/component/hello/ExampleUnitTest.kt
  31. 0 1
      home/.gitignore
  32. 0 129
      home/build.gradle
  33. 0 25
      home/proguard-rules.pro
  34. 0 26
      home/src/androidTest/java/com/enation/javashop/android/component/home/ExampleInstrumentedTest.java
  35. 0 16
      home/src/main/AndroidManifest.xml
  36. 0 24
      home/src/main/ApkBuildDir/AndroidManifest.xml
  37. 0 81
      home/src/main/code/apkbuild/HomeApplication.kt
  38. 0 184
      home/src/main/code/com/wdkl/ncs/android/component/home/activity/HomeActivity.kt
  39. 0 113
      home/src/main/code/com/wdkl/ncs/android/component/home/adapter/ChildCategoryAdapter.kt
  40. 0 132
      home/src/main/code/com/wdkl/ncs/android/component/home/adapter/FloorBannerAdapter.kt
  41. 0 136
      home/src/main/code/com/wdkl/ncs/android/component/home/adapter/FloorCornerBannerAdapter.kt
  42. 0 99
      home/src/main/code/com/wdkl/ncs/android/component/home/adapter/FloorFiveImageAdapter.kt
  43. 0 98
      home/src/main/code/com/wdkl/ncs/android/component/home/adapter/FloorFourImageAdapter.kt
  44. 0 97
      home/src/main/code/com/wdkl/ncs/android/component/home/adapter/FloorLeftOneRightTwoAdapter.kt
  45. 0 96
      home/src/main/code/com/wdkl/ncs/android/component/home/adapter/FloorLeftRightAdapter.kt
  46. 0 147
      home/src/main/code/com/wdkl/ncs/android/component/home/adapter/FloorMenuAdapter.kt
  47. 0 96
      home/src/main/code/com/wdkl/ncs/android/component/home/adapter/FloorRightOneLeftTwoAdapter.kt
  48. 0 223
      home/src/main/code/com/wdkl/ncs/android/component/home/adapter/FloorSecKillAdapter.kt
  49. 0 90
      home/src/main/code/com/wdkl/ncs/android/component/home/adapter/FloorSingleImageAdapter.kt
  50. 0 89
      home/src/main/code/com/wdkl/ncs/android/component/home/adapter/FloorTextAdapter.kt
  51. 0 96
      home/src/main/code/com/wdkl/ncs/android/component/home/adapter/FloorThreeImageAdapter.kt
  52. 0 90
      home/src/main/code/com/wdkl/ncs/android/component/home/adapter/FloorTitleAdapter.kt
  53. 0 93
      home/src/main/code/com/wdkl/ncs/android/component/home/adapter/ParentCategoryAdapter.kt
  54. 0 104
      home/src/main/code/com/wdkl/ncs/android/component/home/agreement/FloorActionAgreement.kt
  55. 0 37
      home/src/main/code/com/wdkl/ncs/android/component/home/binding/HomeFragmentBindHelper.kt
  56. 0 23
      home/src/main/code/com/wdkl/ncs/android/component/home/di/HomeComponent.kt
  57. 0 404
      home/src/main/code/com/wdkl/ncs/android/component/home/fragment/CategoryFragment.kt
  58. 0 346
      home/src/main/code/com/wdkl/ncs/android/component/home/fragment/HomeFragment.kt
  59. 0 27
      home/src/main/code/com/wdkl/ncs/android/component/home/launch/HomeLaunch.kt
  60. 0 20
      home/src/main/res/layout/banner_corner_image_lay.xml
  61. 0 14
      home/src/main/res/layout/banner_image_lay.xml
  62. 0 137
      home/src/main/res/layout/category_frag_lay.xml
  63. 0 36
      home/src/main/res/layout/category_parent_item.xml
  64. 0 53
      home/src/main/res/layout/categroy_child_item.xml
  65. 0 36
      home/src/main/res/layout/categroy_left_item.xml
  66. 0 18
      home/src/main/res/layout/floor_corner_item_banner_lay.xml
  67. 0 18
      home/src/main/res/layout/floor_item_banner_lay.xml
  68. 0 46
      home/src/main/res/layout/floor_item_five_image_lay.xml
  69. 0 38
      home/src/main/res/layout/floor_item_four_image_lay.xml
  70. 0 31
      home/src/main/res/layout/floor_item_left_right_lay.xml
  71. 0 39
      home/src/main/res/layout/floor_item_lone_rtwo_image_lay.xml
  72. 0 38
      home/src/main/res/layout/floor_item_ltwo_rone_image_lay.xml
  73. 0 25
      home/src/main/res/layout/floor_item_menu_lay.xml
  74. 0 488
      home/src/main/res/layout/floor_item_seckill_lay.xml
  75. 0 17
      home/src/main/res/layout/floor_item_single_image_lay.xml
  76. 0 17
      home/src/main/res/layout/floor_item_text_lay.xml
  77. 0 31
      home/src/main/res/layout/floor_item_three_image_lay.xml
  78. 0 17
      home/src/main/res/layout/floor_item_title_lay.xml
  79. 0 47
      home/src/main/res/layout/home_act_lay.xml
  80. 0 182
      home/src/main/res/layout/home_frag_lay.xml
  81. 0 3
      home/src/main/res/values/strings.xml
  82. 0 17
      home/src/test/java/com/enation/javashop/android/component/home/ExampleUnitTest.java
  83. 0 1
      libwebrtc/.gitignore
  84. 0 48
      libwebrtc/build.gradle
  85. BIN
      libwebrtc/libs/arm64-v8a/libjingle_peerconnection_so.so
  86. BIN
      libwebrtc/libs/armeabi-v7a/libjingle_peerconnection_so.so
  87. 0 21
      libwebrtc/proguard-rules.pro
  88. 0 2
      libwebrtc/src/main/AndroidManifest.xml
  89. 0 51
      libwebrtc/src/main/java/modules/audio_device/android/java/src/org/webrtc/voiceengine/BuildInfo.java
  90. 0 324
      libwebrtc/src/main/java/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioEffects.java
  91. 0 378
      libwebrtc/src/main/java/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioManager.java
  92. 0 409
      libwebrtc/src/main/java/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioRecord.java
  93. 0 524
      libwebrtc/src/main/java/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java
  94. 0 388
      libwebrtc/src/main/java/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioUtils.java
  95. 0 46
      libwebrtc/src/main/java/rtc_base/java/src/org/webrtc/ContextUtils.java
  96. 0 22
      libwebrtc/src/main/java/rtc_base/java/src/org/webrtc/Loggable.java
  97. 0 199
      libwebrtc/src/main/java/rtc_base/java/src/org/webrtc/Logging.java
  98. 0 2
      libwebrtc/src/main/java/rtc_base/java/src/org/webrtc/OWNERS
  99. 0 45
      libwebrtc/src/main/java/rtc_base/java/src/org/webrtc/Size.java
  100. 0 0
      libwebrtc/src/main/java/rtc_base/java/src/org/webrtc/ThreadUtils.java

+ 1 - 0
.gitignore

@@ -9,3 +9,4 @@
 .externalNativeBuild
 /.gradle
 /.idea
+/release

+ 0 - 1
extra/.gitignore

@@ -1 +0,0 @@
-/build

+ 0 - 129
extra/build.gradle

@@ -1,129 +0,0 @@
-
-if (componentTag){
-    apply plugin: 'com.android.application'
-    apply plugin: 'com.enation.javashop.aspectjrt'
-}else{
-    apply plugin: 'com.android.library'
-}
-apply plugin: 'kotlin-android'
-apply plugin: 'kotlin-android-extensions'
-apply plugin: 'kotlin-kapt'
-
-kapt {
-    arguments {
-        arg("moduleName", project.getName())
-    }
-}
-
-android {
-    compileSdkVersion target_sdk_version
-    buildToolsVersion build_tools_version
-
-    defaultConfig {
-        if (componentTag){
-            applicationId "com.wdkl.ncs.android.component.extra"
-            multiDexEnabled true
-        }
-        minSdkVersion min_sdk_version
-        targetSdkVersion target_sdk_version
-        versionCode app_version_code
-        versionName app_version
-        dataBinding {
-            enabled = true
-        }
-        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
-
-    }
-    lintOptions {
-        abortOnError false
-    }
-
-    buildTypes {
-        release {
-            minifyEnabled false
-            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
-        }
-    }
-    sourceSets {
-        main.java.srcDirs += 'src/main/code'
-        if(componentTag){
-            main.manifest.srcFile 'src/main/ApkBuildDir/AndroidManifest.xml'
-        }else{
-            main.manifest.srcFile 'src/main/AndroidManifest.xml'
-            main.java {
-                exclude 'apkbuild/**'
-            }
-        }
-    }
-
-    compileOptions {
-        sourceCompatibility JavaVersion.VERSION_1_8
-        targetCompatibility JavaVersion.VERSION_1_8
-    }
-}
-
-dependencies {
-    compile fileTree(include: ['*.jar'], dir: 'libs')
-    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
-        exclude group: 'com.android.support', module: 'support-annotations'
-    })
-    /**
-     * 单元测试
-     */
-    testCompile 'junit:junit:4.12'
-
-    /**
-     *  Android基础依赖库
-     */
-    compile "com.android.support:design:$support_library_version"
-    compile "com.android.support:support-v4:$support_library_version"
-    compile "com.android.support:cardview-v7:$support_library_version"
-
-    /**
-     * 公共库依赖
-     */
-    compile project(':middleware')
-
-    /**
-     * 内存泄漏监控
-     */
-    if(componentTag){
-        debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1'
-        releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
-        testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
-    }
-
-    /**
-     * Dagger编译依赖
-     */
-    kapt 'com.google.dagger:dagger-compiler:2.7'
-
-    /**
-     * Kotlin依赖
-     */
-    kapt 'com.android.databinding:compiler:2.3.3'
-
-    /**
-     * 路由注解处理器
-     */
-    kapt "com.enation.geamtear:jrouter-compiler:$router_version"
-
-    /**
-     *  constraint-layout布局依赖
-     */
-    compile 'com.android.support.constraint:constraint-layout:1.1.0-beta5'
-
-}
-
-/**
- * kawo组件化框架配置
- */
-if(componentTag){
-    kawo {
-        /**
-         * Aop注解排除Jar
-         */
-        aspectExcludeJarFilter 'com.enation.geamtear.pay','AlipaySdk'
-    }
-}
-

+ 0 - 21
extra/proguard-rules.pro

@@ -1,21 +0,0 @@
-# Add project specific ProGuard rules here.
-# You can control the set of applied configuration files using the
-# proguardFiles setting in build.gradle.
-#
-# For more details, see
-#   http://developer.android.com/guide/developing/tools/proguard.html
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-#   public *;
-#}
-
-# Uncomment this to preserve the line number information for
-# debugging stack traces.
-#-keepattributes SourceFile,LineNumberTable
-
-# If you keep the line number information, uncomment this to
-# hide the original source file name.
-#-renamesourcefileattribute SourceFile

+ 0 - 26
extra/src/androidTest/java/com/enation/javashop/android/component/extra/ExampleInstrumentedTest.java

@@ -1,26 +0,0 @@
-package com.wdkl.ncs.android.component.extra;
-
-import android.content.Context;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import static org.junit.Assert.*;
-
-/**
- * Instrumented test, which will execute on an Android device.
- *
- * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
- */
-@RunWith(AndroidJUnit4.class)
-public class ExampleInstrumentedTest {
-    @Test
-    public void useAppContext() throws Exception {
-        // Context of the app under test.
-        Context appContext = InstrumentationRegistry.getTargetContext();
-
-        assertEquals("com.wdkl.ncs.android.component.extra.test", appContext.getPackageName());
-    }
-}

+ 0 - 13
extra/src/main/AndroidManifest.xml

@@ -1,13 +0,0 @@
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-          package="com.wdkl.ncs.android.component.extra">
-    <application android:allowBackup="true"
-                 android:label="@string/app_name"
-                 android:supportsRtl="true"
-        >
-
-        <activity android:name=".activity.ScanActivity"
-                  android:launchMode="singleTask"
-            />
-    </application>
-
-</manifest>

+ 0 - 15
extra/src/main/ApkBuildDir/AndroidManifest.xml

@@ -1,15 +0,0 @@
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-          package="com.enation.javashop.android.welcome">
-    <uses-permission android:name="android.permission.INTERNET"/>
-
-    <application
-        android:allowBackup="true"
-        android:label="@string/app_name"
-        android:theme="@style/Theme.AppCompat.Light.NoActionBar"
-        android:name="apkbuild.ExtraApplication"
-        android:supportsRtl="true">
-    </application>
-</manifest>
-
-    <!--单独Module调试 需要往Application作用域下加入皮肤-->
-    <!--android:theme="@style/Theme.AppCompat.Light.NoActionBar"-->

+ 0 - 81
extra/src/main/code/apkbuild/ExtraApplication.kt

@@ -1,81 +0,0 @@
-//package apkbuild
-//
-//import com.enation.javashop.android.jrouter.JRouter
-//import com.wdkl.ncs.android.lib.base.BaseApplication
-//import com.enation.javashop.net.engine.config.NetEngineConfig
-//import com.enation.javashop.net.engine.plugin.exception.RestfulExceptionInterceptor
-//import com.enation.javashop.utils.base.config.BaseConfig
-//import com.squareup.leakcanary.LeakCanary
-//import io.reactivex.Observable
-//import io.reactivex.android.schedulers.AndroidSchedulers
-//import io.reactivex.schedulers.Schedulers
-//import io.reactivex.functions.Function3
-//
-///**
-// * 单Moudle编译 Application
-// */
-//class ExtraApplication:BaseApplication() {
-//    /**
-//     * @author LDD
-//     * @From   Application
-//     * @Date   2018/1/11 下午12:50
-//     * @Note   应用启动时调用
-//     */
-//    override fun onCreate() {
-//        super.onCreate()
-//        Observable.zip(initRouter().subscribeOn(Schedulers.newThread()),
-//                initLeaks().subscribeOn(Schedulers.newThread()),
-//                initFrame().subscribeOn(Schedulers.newThread()),
-//                Function3<String,String,String,String> { _ , _ , _ -> return@Function3 "" }).
-//                observeOn(AndroidSchedulers.mainThread()).subscribe({})
-//    }
-//
-//    /**
-//     * @author  LDD
-//     * @From    Application
-//     * @Date   2018/1/11 下午12:50
-//     * @Note   初始化路由
-//     * @return rx观察者
-//     */
-//    private fun initRouter(): Observable<String> {
-//        return Observable.create {
-//            JRouter.init(this)
-//            JRouter.openDebug()
-//            JRouter.openLog()
-//            JRouter.prepare().create("/welcome/launch").seek()
-//        }
-//    }
-//
-//    /**
-//     * @author  LDD
-//     * @From    Application
-//     * @Date   2018/1/11 下午12:50
-//     * @Note   初始化内存检测器
-//     * @return rx观察者
-//     */
-//    private fun initLeaks(): Observable<String> {
-//        return Observable.create {
-//            LeakCanary.install(this)
-//        }
-//    }
-//
-//    /**
-//     * @author  LDD
-//     * @From    Application
-//     * @Date   2018/1/11 下午12:50
-//     * @Note   初始化内部框架
-//     * @return rx观察者
-//     */
-//    private fun initFrame(): Observable<String> {
-//        return Observable.create {
-//            if (android.os.Build.VERSION.SDK_INT> android.os.Build.VERSION_CODES.LOLLIPOP){
-//                BaseConfig.getInstance().addActivity("HomeActivity")
-//            }else{
-//                BaseConfig.getInstance().closeScrollBack()
-//            }
-//            NetEngineConfig.init(baseContext)
-//                    .openLogger()
-//                    .addNetInterceptor(RestfulExceptionInterceptor())
-//        }
-//    }
-//}

+ 0 - 114
extra/src/main/code/com/wdkl/ncs/android/component/extra/activity/ScanActivity.kt

@@ -1,114 +0,0 @@
-package com.wdkl.ncs.android.component.extra.activity
-
-import android.app.PendingIntent.getActivity
-import android.graphics.Bitmap
-import android.graphics.BitmapFactory
-import android.graphics.Color
-import android.os.Message
-import android.util.Log
-import com.wdkl.ncs.android.component.extra.R
-import com.wdkl.ncs.android.component.extra.databinding.ScanActLayBinding
-import com.wdkl.ncs.android.component.extra.launch.ExtraLaunch
-import com.enation.javashop.android.jrouter.external.annotation.Router
-import com.wdkl.ncs.android.lib.base.BaseActivity
-import com.wdkl.ncs.android.lib.base.GalleryActivity
-import com.wdkl.ncs.android.lib.utils.*
-import com.wdkl.ncs.android.middleware.logic.contract.extra.ScanContract
-import com.wdkl.ncs.android.middleware.logic.presenter.extra.ScanPresenter
-import com.enation.javashop.net.engine.model.NetState
-import com.enation.javashop.photoutils.model.TResult
-import com.enation.javashop.photoutils.uitl.RxGetPhotoUtils
-import com.uuzuche.lib_zxing.activity.CaptureFragment
-import com.uuzuche.lib_zxing.activity.CodeUtils
-import com.uuzuche.lib_zxing.camera.CameraManager
-import kotlinx.android.synthetic.main.scan_act_lay.*
-
-/**
- * 扫一扫
- */
-@Router(path = "/extra/scan")
-class ScanActivity :GalleryActivity<ScanPresenter,ScanActLayBinding>(),ScanContract.View,CodeUtils.AnalyzeCallback {
-
-    private lateinit var captureFragment : CaptureFragment
-
-    private var lightOpen = false
-
-    override fun getLayId(): Int {
-        return R.layout.scan_act_lay
-    }
-
-    override fun bindDagger() {
-        ExtraLaunch.component.inject(this)
-    }
-
-    override fun init() {
-        AppTool.SystemUI.ImmersiveWithBottomBarColor(this, Color.BLACK)
-        captureFragment = CaptureFragment()
-        // 为二维码扫描界面设置定制化界面
-        CodeUtils.setFragmentArgs(captureFragment, R.layout.my_camera)
-        captureFragment.analyzeCallback = this
-        supportFragmentManager.beginTransaction().replace(R.id.scan_frame, captureFragment).commit()
-        scan_topbar.setTopHolderVisibility(false)
-                .setLineBgColor(Color.TRANSPARENT)
-    }
-
-    override fun bindEvent() {
-        scan_topbar.setLeftClickListener {
-            pop()
-        }
-        light.setOnClickListener {
-            if(lightOpen){
-                light.setImageResource(R.drawable.javashop_icon_light_close)
-            }else{
-                light.setImageResource(R.drawable.javashop_icon_light_open)
-            }
-            CodeUtils.isLightEnable(!lightOpen)
-            lightOpen = !lightOpen
-        }
-        album.setOnClickListener {
-            RxGetPhotoUtils.init(this).configCompress(true,true,true,102400,800,800).getPhotoFromGallery(false)
-        }
-    }
-
-    override fun onAnalyzeSuccess(mBitmap: Bitmap, result: String) {
-//        if (result.contains("goods/") && result.contains("su=")){
-//            push("/goods/detail",{
-//                it.withInt("goodsId", RegularHelper().getMiddleString(result,"goods/","\\?su=")[0].toInt())
-//            })
-//        }
-        val obtain = Message.obtain()
-        obtain.what = R.id.restart_preview
-        captureFragment.handler.sendMessageDelayed(obtain, 500)
-    }
-
-    override fun onAnalyzeFailed() {
-
-    }
-
-    override fun takeSuccess(result: TResult) {
-        val filePath = result.image.compressPath
-        CodeUtils.analyzeBitmap(filePath,this)
-    }
-
-    override fun onError(message: String, type: Int) {
-        dismissDialog()
-        showMessage(message)
-    }
-
-    override fun complete(message: String, type: Int) {
-        dismissDialog()
-        showMessage(message)
-    }
-
-    override fun start() {
-        showDialog()
-    }
-
-    override fun networkMonitor(state: NetState) {
-
-    }
-
-    override fun destory() {
-
-    }
-}

+ 0 - 15
extra/src/main/code/com/wdkl/ncs/android/component/extra/di/ExtraComponent.kt

@@ -1,15 +0,0 @@
-package com.wdkl.ncs.android.component.extra.di
-
-import com.wdkl.ncs.android.component.extra.activity.ScanActivity
-import com.wdkl.ncs.android.middleware.di.ApplicationComponent
-import dagger.Component
-
-/**
- * Created by LDD on 2018/11/5.
- */
-@Component(dependencies = arrayOf(ApplicationComponent::class))
-interface ExtraComponent {
-
-    fun inject(activity:ScanActivity)
-
-}

+ 0 - 24
extra/src/main/code/com/wdkl/ncs/android/component/extra/launch/ExtraLaunch.kt

@@ -1,24 +0,0 @@
-package com.wdkl.ncs.android.component.extra.launch
-
-import com.wdkl.ncs.android.component.extra.di.DaggerExtraComponent
-import com.wdkl.ncs.android.component.extra.di.ExtraComponent
-import com.enation.javashop.android.jrouter.external.annotation.Router
-import com.wdkl.ncs.android.lib.base.BaseLaunch
-import com.wdkl.ncs.android.middleware.di.DaggerManager
-
-/**
- *  扩展模块 启动入口
- */
-@Router(path = "/extra/launch")
-class ExtraLaunch : BaseLaunch(){
-
-    companion object {
-        lateinit var component : ExtraComponent
-    }
-
-    override fun moduleInit() {
-        component = DaggerExtraComponent.builder()
-                .applicationComponent(DaggerManager.APPLICATION_COMPONENT)
-                .build()
-    }
-}

+ 0 - 28
extra/src/main/res/layout/my_camera.xml

@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent" >
-
-    <SurfaceView
-        android:id="@+id/preview_view"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        />
-
-    <com.uuzuche.lib_zxing.view.ViewfinderView
-        android:id="@+id/viewfinder_view"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        app:inner_width="200dp"
-        app:inner_height="200dp"
-        app:inner_margintop="150dp"
-        app:inner_corner_color="@color/color_white"
-        app:inner_corner_length="30dp"
-        app:inner_corner_width="5dp"
-        app:inner_scan_bitmap="@drawable/javashop_qr_indicator"
-        app:inner_scan_speed="10"
-        app:inner_scan_iscircle="false"
-        />
-
-</FrameLayout>

+ 0 - 59
extra/src/main/res/layout/scan_act_lay.xml

@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<layout xmlns:app="http://schemas.android.com/apk/res-auto"
-        xmlns:bind="http://schemas.android.com/apk/res-auto">
-    <android.support.constraint.ConstraintLayout
-        xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent">
-        <FrameLayout
-            android:id="@+id/scan_frame"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent">
-        </FrameLayout>
-        <com.wdkl.ncs.android.lib.widget.CommonActionBar
-            android:layout_width="match_parent"
-            android:layout_height="0dp"
-            android:id="@+id/scan_topbar"
-            app:title_text="扫啊扫"
-            bind:auto_topbar_height="@{true}"
-            app:holder_visibility="false"
-            app:left_image="@drawable/javashop_back_white"
-            app:background_color="@color/color_mask"
-            app:title_text_color="@color/color_white"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintDimensionRatio="h,5:1"
-            />
-        <android.support.constraint.ConstraintLayout
-            android:layout_width="match_parent"
-            android:layout_height="0dp"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintDimensionRatio="h,3:1"
-            android:background="#77000000"
-            >
-            <ImageView
-                android:id="@+id/light"
-                android:layout_height="match_parent"
-                android:layout_width="0dp"
-                app:layout_constraintLeft_toLeftOf="parent"
-                app:layout_constraintRight_toRightOf="parent"
-                app:layout_constraintWidth_percent="0.2"
-                app:layout_constraintHorizontal_bias="0.3"
-                android:src="@drawable/javashop_icon_light_close"
-                />
-
-            <ImageView
-                android:id="@+id/album"
-                android:layout_height="match_parent"
-                android:layout_width="0dp"
-                app:layout_constraintLeft_toLeftOf="parent"
-                app:layout_constraintRight_toRightOf="parent"
-                app:layout_constraintWidth_percent="0.2"
-                app:layout_constraintHorizontal_bias="0.7"
-                android:src="@drawable/javashop_icon_album_normal"
-                />
-        </android.support.constraint.ConstraintLayout>
-    </android.support.constraint.ConstraintLayout>
-</layout>

+ 0 - 3
extra/src/main/res/values/strings.xml

@@ -1,3 +0,0 @@
-<resources>
-    <string name="app_name">extra</string>
-</resources>

+ 0 - 17
extra/src/test/java/com/enation/javashop/android/component/extra/ExampleUnitTest.java

@@ -1,17 +0,0 @@
-package com.wdkl.ncs.android.component.extra;
-
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-/**
- * Example local unit test, which will execute on the development machine (host).
- *
- * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
- */
-public class ExampleUnitTest {
-    @Test
-    public void addition_isCorrect() throws Exception {
-        assertEquals(4, 2 + 2);
-    }
-}

+ 0 - 1
hello/.gitignore

@@ -1 +0,0 @@
-/build

+ 0 - 125
hello/build.gradle

@@ -1,125 +0,0 @@
-if (componentTag){
-    apply plugin: 'com.android.application'
-    apply plugin: 'com.enation.javashop.aspectjrt'
-}else{
-    apply plugin: 'com.android.library'
-}
-
-apply plugin: 'kotlin-android'
-apply plugin: 'kotlin-android-extensions'
-apply plugin: 'kotlin-kapt'
-
-kapt {
-    arguments {
-        arg("moduleName", project.getName())
-    }
-}
-
-android {
-    compileSdkVersion target_sdk_version
-    buildToolsVersion build_tools_version
-
-    defaultConfig {
-        if (componentTag){
-            applicationId "com.wdkl.ncs.android.component.hello"
-            multiDexEnabled true
-        }
-        minSdkVersion min_sdk_version
-        targetSdkVersion target_sdk_version
-        versionCode app_version_code
-        versionName app_version
-        dataBinding {
-            enabled = true
-        }
-        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
-
-    }
-
-    lintOptions {
-        abortOnError false
-    }
-    buildTypes {
-        release {
-            minifyEnabled false
-            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
-        }
-    }
-    sourceSets {
-        main.java.srcDirs += 'src/main/java'
-        if(componentTag){
-            main.manifest.srcFile 'src/main/ApkBuildDir/AndroidManifest.xml'
-        }else{
-            main.manifest.srcFile 'src/main/AndroidManifest.xml'
-            main.java {
-                exclude 'apkbuild/**'
-            }
-        }
-    }
-
-    compileOptions {
-        sourceCompatibility JavaVersion.VERSION_1_8
-        targetCompatibility JavaVersion.VERSION_1_8
-    }
-}
-
-dependencies {
-    compile fileTree(dir: 'libs', include: ['*.jar'])
-    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
-        exclude group: 'com.android.support', module: 'support-annotations'
-    })
-    /**
-     * 单元测试
-     */
-    testCompile 'junit:junit:4.12'
-
-    /**
-     *  Android基础依赖库
-     */
-    compile "com.android.support:design:$support_library_version"
-    compile "com.android.support:support-v4:$support_library_version"
-    compile "com.android.support:cardview-v7:$support_library_version"
-    compile "com.android.support:appcompat-v7:$support_library_version"
-
-    /**
-     * 公共库依赖
-     */
-    compile project(':middleware')
-
-    if(componentTag){
-        debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1'
-        releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
-        testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
-    }
-
-    /**
-     * Dagger编译依赖
-     */
-    kapt 'com.google.dagger:dagger-compiler:2.7'
-
-    /**
-     * Kotlin依赖
-     */
-    kapt 'com.android.databinding:compiler:2.3.3'
-
-    /**
-     * 路由注解处理器
-     */
-    kapt "com.enation.geamtear:jrouter-compiler:$router_version"
-
-    /**
-     *  constraint-layout布局依赖
-     */
-    compile 'com.android.support.constraint:constraint-layout:1.1.0-beta5'
-}
-
-/**
- * kawo组件化框架配置
- */
-if(componentTag){
-    kawo {
-        /**
-         * Aop注解排除Jar
-         */
-        aspectExcludeJarFilter 'com.enation.geamtear.pay','AlipaySdk'
-    }
-}

+ 0 - 21
hello/proguard-rules.pro

@@ -1,21 +0,0 @@
-# Add project specific ProGuard rules here.
-# You can control the set of applied configuration files using the
-# proguardFiles setting in build.gradle.
-#
-# For more details, see
-#   http://developer.android.com/guide/developing/tools/proguard.html
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-#   public *;
-#}
-
-# Uncomment this to preserve the line number information for
-# debugging stack traces.
-#-keepattributes SourceFile,LineNumberTable
-
-# If you keep the line number information, uncomment this to
-# hide the original source file name.
-#-renamesourcefileattribute SourceFile

+ 0 - 24
hello/src/androidTest/java/com/wdkl/ncs/android/component/hello/ExampleInstrumentedTest.kt

@@ -1,24 +0,0 @@
-package com.wdkl.ncs.android.component.hello
-
-import android.support.test.InstrumentationRegistry
-import android.support.test.runner.AndroidJUnit4
-
-import org.junit.Test
-import org.junit.runner.RunWith
-
-import org.junit.Assert.*
-
-/**
- * Instrumented test, which will execute on an Android device.
- *
- * See [testing documentation](http://d.android.com/tools/testing).
- */
-@RunWith(AndroidJUnit4::class)
-class ExampleInstrumentedTest {
-    @Test
-    fun useAppContext() {
-        // Context of the app under test.
-        val appContext = InstrumentationRegistry.getTargetContext()
-        assertEquals("com.wdkl.ncs.android.component.hello", appContext.packageName)
-    }
-}

+ 0 - 13
hello/src/main/AndroidManifest.xml

@@ -1,13 +0,0 @@
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.wdkl.ncs.android.component.hello">
-
-    <application
-        android:allowBackup="true"
-        android:label="@string/app_name"
-        android:supportsRtl="true">
-        <activity android:name=".activity.HelloActivity">
-        </activity>
-        <activity android:name=".activity.HelloListActivity"></activity>
-    </application>
-
-</manifest>

+ 0 - 56
hello/src/main/java/com/wdkl/ncs/android/component/hello/activity/HelloActivity.kt

@@ -1,56 +0,0 @@
-package com.wdkl.ncs.android.component.hello.activity
-
-import android.app.Activity
-import android.graphics.Color
-import android.os.Bundle
-import com.enation.javashop.android.jrouter.external.annotation.Router
-import com.enation.javashop.net.engine.model.NetState
-import com.wdkl.ncs.android.component.hello.R
-import com.wdkl.ncs.android.component.hello.databinding.HelloActLayBinding
-import com.wdkl.ncs.android.component.hello.launch.HelloLaunch
-import com.wdkl.ncs.android.lib.base.BaseActivity
-import com.wdkl.ncs.android.lib.base.BaseContract
-import com.wdkl.ncs.android.lib.utils.AppTool
-import com.wdkl.ncs.android.middleware.logic.contract.hello.HelloActivityContract
-import com.wdkl.ncs.android.middleware.logic.presenter.hello.HelloActivityPresenter
-import com.wdkl.ncs.android.middleware.model.ChildCategoryShell
-import kotlinx.android.synthetic.main.hello_act_lay.*
-
-@Router(path = "/hello/main")
-class HelloActivity : BaseActivity<HelloActivityPresenter, HelloActLayBinding>(), HelloActivityContract.View {
-    override fun getLayId(): Int {
-        return R.layout.hello_act_lay
-    }
-
-    override fun bindDagger() {
-        HelloLaunch.component.inject(this)
-    }
-
-    override fun init() {
-        AppTool.SystemUI.showNavigationBar(this,false)
-        AppTool.SystemUI.ImmersiveWithBottomBarColor(this, Color.BLACK)
-        presenter.loadData(0)
-    }
-
-    override fun bindEvent() {
-    }
-
-    override fun destory() {
-    }
-
-    override fun onError(message: String, type: Int) {
-    }
-
-    override fun complete(message: String, type: Int) {
-    }
-
-    override fun start() {
-    }
-
-    override fun networkMonitor(state: NetState) {
-    }
-
-    override fun showData(categoryList: ArrayList<ChildCategoryShell>) {
-        hello_api_data.setText(categoryList[0].toString())
-    }
-}

+ 0 - 112
hello/src/main/java/com/wdkl/ncs/android/component/hello/activity/HelloListActivity.kt

@@ -1,112 +0,0 @@
-package com.wdkl.ncs.android.component.hello.activity
-
-import android.util.Log
-import com.alibaba.android.vlayout.DelegateAdapter
-import com.alibaba.android.vlayout.VirtualLayoutManager
-import com.enation.javashop.android.jrouter.external.annotation.Autowired
-import com.enation.javashop.android.jrouter.external.annotation.Router
-import com.enation.javashop.net.engine.model.NetState
-import com.scwang.smartrefresh.layout.footer.ClassicsFooter
-import com.wdkl.ncs.android.component.hello.R
-import com.wdkl.ncs.android.component.hello.adapter.HelloItemAdapter
-import com.wdkl.ncs.android.component.hello.databinding.HelloListActLayBinding
-import com.wdkl.ncs.android.component.hello.launch.HelloLaunch
-import com.wdkl.ncs.android.lib.base.BaseActivity
-import com.wdkl.ncs.android.lib.utils.pop
-import com.wdkl.ncs.android.lib.utils.push
-import com.wdkl.ncs.android.lib.utils.showMessage
-import com.wdkl.ncs.android.middleware.logic.contract.hello.HelloListActivityContract
-import com.wdkl.ncs.android.middleware.logic.presenter.hello.HelloListActivityPresenter
-import com.wdkl.ncs.android.middleware.model.JavaShopItem
-import com.wdkl.ncs.android.middleware.model.ShopItem
-import kotlinx.android.synthetic.main.hello_list_act_lay.*
-
-@Router(path = "/hello/list")
-class HelloListActivity : BaseActivity<HelloListActivityPresenter, HelloListActLayBinding>(), HelloListActivityContract.View {
-    override fun bindDagger() {
-        HelloLaunch.component.inject(this)
-    }
-
-    override fun onError(message: String, type: Int) {
-        dismissDialog()
-        showMessage(message)
-    }
-
-    override fun complete(message: String, type: Int) {
-        dismissDialog()
-        showMessage(message)
-    }
-
-    override fun start() {
-        showDialog()
-    }
-
-    override fun networkMonitor(state: NetState) {
-
-    }
-
-    override fun destory() {
-
-    }
-
-    private var page :Int = 1
-    private val adapter = HelloItemAdapter(ArrayList())
-
-    //@Autowired(name= "keyword",required = true)
-    @JvmField var keyword: String = "8"
-
-    private lateinit var virtualLayoutManager: VirtualLayoutManager
-
-    private lateinit var delegateAdapter: DelegateAdapter
-
-    override fun getLayId(): Int {
-        return R.layout.hello_list_act_lay
-    }
-
-    override fun init() {
-        /**初始化LayoutMannager*/
-        virtualLayoutManager = VirtualLayoutManager(this.activity)
-
-        /**初始化适配器*/
-        delegateAdapter = DelegateAdapter(virtualLayoutManager)
-        delegateAdapter.addAdapter(adapter)
-        mViewBinding.refresh.setRefreshFooter(ClassicsFooter(activity))
-        /**配置到RecycleView*/
-        listView.layoutManager = virtualLayoutManager
-        listView.adapter = delegateAdapter
-        presenter.loadData(keyword,page)
-    }
-
-    override fun bindEvent() {
-        refresh.setOnLoadMoreListener {
-            page += 1
-            presenter.loadData(keyword,page)
-        }
-//        adapter.setOnItemClickListener { data, _ ->
-//            push("/shop/detail",{postcard ->
-//                postcard.withInt("shopId", data.shopId)
-//            })
-//        }
-    }
-
-    override fun render(data: ArrayList<JavaShopItem>) {
-        if (page == 1){
-            refresh.resetNoMoreData()
-            if (data.size >0){
-                adapter.data.clear()
-                adapter.data.addAll(data)
-                Log.i("abc1"," " + data.size);
-                adapter.notifyDataSetChanged()
-            }
-            refresh.finishLoadMore()
-        }else {
-            if (data.size > 0) {
-                adapter.data.addAll(data)
-                adapter.notifyDataSetChanged()
-                refresh.finishLoadMore()
-            }else{
-                refresh.finishLoadMoreWithNoMoreData()
-            }
-        }
-    }
-}

+ 0 - 45
hello/src/main/java/com/wdkl/ncs/android/component/hello/adapter/HelloItemAdapter.kt

@@ -1,45 +0,0 @@
-package com.wdkl.ncs.android.component.hello.adapter
-
-import android.util.Log
-import android.view.View
-import android.view.ViewGroup
-import com.alibaba.android.vlayout.LayoutHelper
-import com.alibaba.android.vlayout.layout.LinearLayoutHelper
-import com.wdkl.ncs.android.component.hello.R
-import com.wdkl.ncs.android.component.hello.databinding.HelloListItemLayBinding
-import com.wdkl.ncs.android.lib.adapter.BaseDelegateAdapter
-import com.wdkl.ncs.android.lib.utils.BaseRecyclerViewHolder
-import com.wdkl.ncs.android.middleware.model.JavaShopItem
-import com.wdkl.ncs.android.middleware.model.ShopItem
-import kotlinx.android.synthetic.main.hello_list_item_lay.view.*
-
-class HelloItemAdapter(val data:ArrayList<JavaShopItem>) : BaseDelegateAdapter<BaseRecyclerViewHolder<HelloListItemLayBinding>,JavaShopItem>(){
-    override fun dataProvider(): Any {
-        return data
-    }
-
-    override fun itemFilter(position: Int): Boolean {
-        return true
-    }
-
-    override fun getItemCount(): Int {
-        return data.size
-    }
-
-    override fun onCreateLayoutHelper(): LayoutHelper {
-        Log.i("abc",data.toString());
-        return LinearLayoutHelper(0,data.size)
-    }
-
-    override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): BaseRecyclerViewHolder<HelloListItemLayBinding> {
-        return BaseRecyclerViewHolder.build(parent, R.layout.hello_list_item_lay)
-    }
-
-    override fun onBindViewHolder(holder: BaseRecyclerViewHolder<HelloListItemLayBinding>?, position: Int) {
-        holder?.bind {
-            binding ->
-            val itemData = getItem(position)
-            binding.helloListItemTv.text = itemData.shopName
-        }
-    }
-}

+ 0 - 12
hello/src/main/java/com/wdkl/ncs/android/component/hello/di/HelloComponent.kt

@@ -1,12 +0,0 @@
-package com.wdkl.ncs.android.component.hello.di
-
-import com.wdkl.ncs.android.component.hello.activity.HelloActivity
-import com.wdkl.ncs.android.component.hello.activity.HelloListActivity
-import com.wdkl.ncs.android.middleware.di.ApplicationComponent
-import dagger.Component
-
-@Component(dependencies = arrayOf(ApplicationComponent::class))
-interface HelloComponent{
-    fun inject(activity: HelloActivity)
-    fun inject(activity: HelloListActivity)
-}

+ 0 - 21
hello/src/main/java/com/wdkl/ncs/android/component/hello/launch/HelloLaunch.kt

@@ -1,21 +0,0 @@
-package com.wdkl.ncs.android.component.hello.launch
-
-import com.enation.javashop.android.jrouter.external.annotation.Router
-import com.wdkl.ncs.android.component.hello.di.DaggerHelloComponent
-import com.wdkl.ncs.android.component.hello.di.HelloComponent
-import com.wdkl.ncs.android.lib.base.BaseLaunch
-import com.wdkl.ncs.android.middleware.di.DaggerManager
-
-@Router(path = "/hello/launch")
-class HelloLaunch : BaseLaunch() {
-    companion object {
-        lateinit var component:HelloComponent
-    }
-
-    override fun moduleInit() {
-        component = DaggerHelloComponent
-                .builder()
-                .applicationComponent(DaggerManager.APPLICATION_COMPONENT)
-                .build()
-    }
-}

+ 0 - 30
hello/src/main/res/layout/hello_act_lay.xml

@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<layout>
-<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    tools:context=".activity.HelloActivity">
-
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Hello World!"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintLeft_toLeftOf="parent"
-        app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintTop_toTopOf="parent" />
-
-    <TextView
-        android:id="@+id/hello_api_data"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintLeft_toLeftOf="parent"
-        app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintTop_toTopOf="parent"
-        />
-
-</android.support.constraint.ConstraintLayout>
-</layout>

+ 0 - 30
hello/src/main/res/layout/hello_list_act_lay.xml

@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<layout>
-    <android.support.constraint.ConstraintLayout
-        xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        xmlns:bind="http://schemas.android.com/apk/res-auto"
-        xmlns:app="http://schemas.android.com/apk/res-auto">
-
-        <TextView
-            android:layout_width="match_parent"
-            android:layout_height="20sp"
-            android:text="@string/app_name"/>
-
-        <com.scwang.smartrefresh.layout.SmartRefreshLayout
-            android:id="@+id/refresh"
-            android:layout_width="match_parent"
-            bind:srlEnableRefresh="true"
-            bind:srlEnableLoadMore="true"
-            android:layout_height="match_parent"
-            >
-            <android.support.v7.widget.RecyclerView
-                android:id="@+id/listView"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                ></android.support.v7.widget.RecyclerView>
-        </com.scwang.smartrefresh.layout.SmartRefreshLayout>
-
-    </android.support.constraint.ConstraintLayout>
-</layout>

+ 0 - 30
hello/src/main/res/layout/hello_list_item_lay.xml

@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<layout>
-    <android.support.constraint.ConstraintLayout
-        xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        xmlns:app="http://schemas.android.com/apk/res-auto">
-        <android.support.constraint.ConstraintLayout
-            android:layout_width="match_parent"
-            android:layout_height="0dp"
-            app:layout_constraintTop_toTopOf="parent"
-            app:layout_constraintDimensionRatio="h,5:1">
-            <TextView
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:text="@string/app_name"/>
-            <TextView
-                android:id="@+id/hello_list_item_tv"
-                android:layout_width="match_parent"
-                android:layout_height="20sp"
-                app:layout_constraintBottom_toBottomOf="parent"
-                app:layout_constraintRight_toRightOf="parent"
-                android:textSize="15sp"
-                android:gravity="center_vertical"
-                android:textColor="@color/javashop_color_white"
-                android:background="#77000000"
-                />
-        </android.support.constraint.ConstraintLayout>
-    </android.support.constraint.ConstraintLayout>
-</layout>

+ 0 - 3
hello/src/main/res/values/strings.xml

@@ -1,3 +0,0 @@
-<resources>
-    <string name="app_name">hello</string>
-</resources>

+ 0 - 17
hello/src/test/java/com/wdkl/ncs/android/component/hello/ExampleUnitTest.kt

@@ -1,17 +0,0 @@
-package com.wdkl.ncs.android.component.hello
-
-import org.junit.Test
-
-import org.junit.Assert.*
-
-/**
- * Example local unit test, which will execute on the development machine (host).
- *
- * See [testing documentation](http://d.android.com/tools/testing).
- */
-class ExampleUnitTest {
-    @Test
-    fun addition_isCorrect() {
-        assertEquals(4, 2 + 2)
-    }
-}

+ 0 - 1
home/.gitignore

@@ -1 +0,0 @@
-/build

+ 0 - 129
home/build.gradle

@@ -1,129 +0,0 @@
-
-if (componentTag){
-    apply plugin: 'com.android.application'
-    apply plugin: 'com.enation.javashop.aspectjrt'
-}else{
-    apply plugin: 'com.android.library'
-}
-
-apply plugin: 'kotlin-android'
-apply plugin: 'kotlin-android-extensions'
-apply plugin: 'kotlin-kapt'
-
-
-kapt {
-    arguments {
-        arg("moduleName", project.getName())
-    }
-}
-
-android {
-    compileSdkVersion target_sdk_version
-    buildToolsVersion build_tools_version
-
-    defaultConfig {
-        if (componentTag){
-            applicationId "com.wdkl.ncs.android.component.home"
-            multiDexEnabled true
-        }
-        minSdkVersion min_sdk_version
-        targetSdkVersion target_sdk_version
-        versionCode app_version_code
-        versionName app_version
-        dataBinding {
-            enabled = true
-        }
-        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
-
-    }
-
-  
-
-    lintOptions {
-        abortOnError false
-    }
-    buildTypes {
-        release {
-            minifyEnabled false
-            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
-        }
-    }
-    sourceSets {
-        main.java.srcDirs += 'src/main/code'
-        if(componentTag){
-            main.manifest.srcFile 'src/main/ApkBuildDir/AndroidManifest.xml'
-        }else{
-            main.manifest.srcFile 'src/main/AndroidManifest.xml'
-            main.java {
-                exclude 'apkbuild/**'
-            }
-        }
-    }
-
-    compileOptions {
-        sourceCompatibility JavaVersion.VERSION_1_8
-        targetCompatibility JavaVersion.VERSION_1_8
-    }
-}
-
-dependencies {
-    compile fileTree(dir: 'libs', include: ['*.jar'])
-    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
-        exclude group: 'com.android.support', module: 'support-annotations'
-    })
-    /**
-     * 单元测试
-     */
-    testCompile 'junit:junit:4.12'
-
-    /**
-     *  Android基础依赖库
-     */
-    compile "com.android.support:design:$support_library_version"
-    compile "com.android.support:support-v4:$support_library_version"
-    compile "com.android.support:cardview-v7:$support_library_version"
-    compile "com.android.support:appcompat-v7:$support_library_version"
-
-    /**
-     * 公共库依赖
-     */
-    compile project(':middleware')
-
-    if(componentTag){
-        debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1'
-        releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
-        testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
-    }
-
-    /**
-     * Dagger编译依赖
-     */
-    kapt 'com.google.dagger:dagger-compiler:2.7'
-
-    /**
-     * Kotlin依赖
-     */
-    kapt 'com.android.databinding:compiler:2.3.3'
-
-    /**
-     * 路由注解处理器
-     */
-    kapt "com.enation.geamtear:jrouter-compiler:$router_version"
-
-    /**
-     *  constraint-layout布局依赖
-     */
-    compile 'com.android.support.constraint:constraint-layout:1.1.0-beta5'
-}
-
-/**
- * kawo组件化框架配置
- */
-if(componentTag){
-    kawo {
-        /**
-         * Aop注解排除Jar
-         */
-        aspectExcludeJarFilter 'com.enation.geamtear.pay','AlipaySdk'
-    }
-}

+ 0 - 25
home/proguard-rules.pro

@@ -1,25 +0,0 @@
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in /Users/Android/MAC_SDK/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the proguardFiles
-# directive in build.gradle.
-#
-# For more details, see
-#   http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-#   public *;
-#}
-
-# Uncomment this to preserve the line number information for
-# debugging stack traces.
-#-keepattributes SourceFile,LineNumberTable
-
-# If you keep the line number information, uncomment this to
-# hide the original source file name.
-#-renamesourcefileattribute SourceFile

+ 0 - 26
home/src/androidTest/java/com/enation/javashop/android/component/home/ExampleInstrumentedTest.java

@@ -1,26 +0,0 @@
-package com.wdkl.ncs.android.component.home;
-
-import android.content.Context;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import static org.junit.Assert.*;
-
-/**
- * Instrumentation test, which will execute on an Android device.
- *
- * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
- */
-@RunWith(AndroidJUnit4.class)
-public class ExampleInstrumentedTest {
-    @Test
-    public void useAppContext() throws Exception {
-        // Context of the app under test.
-        Context appContext = InstrumentationRegistry.getTargetContext();
-
-        assertEquals("com.wdkl.ncs.android.component.home.test", appContext.getPackageName());
-    }
-}

+ 0 - 16
home/src/main/AndroidManifest.xml

@@ -1,16 +0,0 @@
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-
-          package="com.wdkl.ncs.android.component.home"
->
-
-    <application android:allowBackup="true"
-                 android:label="@string/app_name"
-                 android:supportsRtl="true"
-    >
-
-    <activity android:name=".activity.HomeActivity"
-              android:launchMode="singleTask"
-        />
-    </application>
-
-</manifest>

+ 0 - 24
home/src/main/ApkBuildDir/AndroidManifest.xml

@@ -1,24 +0,0 @@
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-
-          package="com.wdkl.ncs.android.component.home"
->
-    <uses-permission android:name="android.permission.INTERNET"/>
-
-    <application android:allowBackup="true"
-                 android:label="@string/app_name"
-                 android:name="apkbuild.HomeApplication"
-                 android:supportsRtl="true"
-                 android:theme="@style/MyAppTheme"
-    >
-        <activity android:name=".activity.HomeActivity"
-                  android:screenOrientation="portrait"
-            >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN"/>
-
-                <category android:name="android.intent.category.LAUNCHER"/>
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>

+ 0 - 81
home/src/main/code/apkbuild/HomeApplication.kt

@@ -1,81 +0,0 @@
-//package apkbuild
-//
-//import com.enation.javashop.android.jrouter.JRouter
-//import com.wdkl.ncs.android.lib.base.BaseApplication
-//import com.enation.javashop.net.engine.config.NetEngineConfig
-//import com.enation.javashop.net.engine.plugin.exception.RestfulExceptionInterceptor
-//import com.enation.javashop.utils.base.config.BaseConfig
-//import com.squareup.leakcanary.LeakCanary
-//import io.reactivex.Observable
-//import io.reactivex.android.schedulers.AndroidSchedulers
-//import io.reactivex.schedulers.Schedulers
-//import io.reactivex.functions.Function3
-//
-///**
-// * 单Moudle编译 Application
-// */
-//class HomeApplication :BaseApplication() {
-//    /**
-//     * @author LDD
-//     * @From   Application
-//     * @Date   2018/1/11 下午12:50
-//     * @Note   应用启动时调用
-//     */
-//    override fun onCreate() {
-//        super.onCreate()
-//        Observable.zip(initRouter().subscribeOn(Schedulers.newThread()),
-//                initLeaks().subscribeOn(Schedulers.newThread()),
-//                initFrame().subscribeOn(Schedulers.newThread()),
-//                Function3<String,String,String,String> { _ , _ , _ -> return@Function3 "" }).
-//                observeOn(AndroidSchedulers.mainThread()).subscribe({})
-//    }
-//
-//    /**
-//     * @author  LDD
-//     * @From    Application
-//     * @Date   2018/1/11 下午12:50
-//     * @Note   初始化路由
-//     * @return rx观察者
-//     */
-//    private fun initRouter(): Observable<String> {
-//        return Observable.create {
-//            JRouter.init(this)
-//            JRouter.openDebug()
-//            JRouter.openLog()
-//            JRouter.prepare().create("/home/launch").seek()
-//        }
-//    }
-//
-//    /**
-//     * @author  LDD
-//     * @From    Application
-//     * @Date   2018/1/11 下午12:50
-//     * @Note   初始化内存检测器
-//     * @return rx观察者
-//     */
-//    private fun initLeaks(): Observable<String> {
-//        return Observable.create {
-//            LeakCanary.install(this)
-//        }
-//    }
-//
-//    /**
-//     * @author  LDD
-//     * @From    Application
-//     * @Date   2018/1/11 下午12:50
-//     * @Note   初始化内部框架
-//     * @return rx观察者
-//     */
-//    private fun initFrame(): Observable<String> {
-//        return Observable.create {
-//           // if (android.os.Build.VERSION.SDK_INT> android.os.Build.VERSION_CODES.LOLLIPOP){
-//                BaseConfig.getInstance().addActivity("HomeActivity")
-//           // }else{
-//           //     BaseConfig.getInstance().closeScrollBack()
-//           // }
-//            NetEngineConfig.init(baseContext)
-//                    .openLogger()
-//                    .addNetInterceptor(RestfulExceptionInterceptor())
-//        }
-//    }
-//}

+ 0 - 184
home/src/main/code/com/wdkl/ncs/android/component/home/activity/HomeActivity.kt

@@ -1,184 +0,0 @@
-package com.wdkl.ncs.android.component.home.activity
-
-import android.graphics.Color
-import com.wdkl.ncs.android.component.home.R
-import com.wdkl.ncs.android.component.home.fragment.CategoryFragment
-import com.wdkl.ncs.android.component.home.fragment.HomeFragment
-import com.wdkl.ncs.android.component.home.launch.HomeLaunch
-import com.enation.javashop.android.jrouter.external.annotation.Router
-import com.wdkl.ncs.android.lib.base.BaseActivity
-import com.wdkl.ncs.android.lib.utils.*
-import com.wdkl.ncs.android.lib.vo.filter
-import com.wdkl.ncs.android.middleware.logic.contract.home.HomeActivityContract
-import com.wdkl.ncs.android.middleware.logic.presenter.home.HomeActivityPresenter
-import com.wdkl.ncs.android.middleware.model.MemberViewModel
-import com.enation.javashop.android.widget.navigationview.NavigationModel
-import com.enation.javashop.net.engine.model.NetState
-import com.wdkl.ncs.android.component.home.databinding.HomeActLayBinding
-import kotlinx.android.synthetic.main.home_act_lay.*
-
-/**
- * @author  LDD
- * @Date   2018/1/16 下午1:35
- * @From   com.wdkl.ncs.android.component.home.activity
- * @Note   首页Activity
- */
-@Router(path = "/home/main")
-class HomeActivity : BaseActivity<HomeActivityPresenter, HomeActLayBinding>(),HomeActivityContract.View {
-
-    /**
-     * @Name  clickTime
-     * @Type  Long
-     * @Note  返回键点击间隔时间
-     */
-    private var clickTime :Long = 0
-
-    /**
-     * @author LDD
-     * @From   HomeActivity
-     * @Date   2018/1/16 下午1:37
-     * @Note   提供LayoutId
-     * @return LayoutId
-     */
-    override fun getLayId(): Int {
-        return R.layout.home_act_lay
-    }
-
-    /**
-     * @author LDD
-     * @From   HomeActivity
-     * @Date   2018/1/16 下午1:38
-     * @Note   依赖注入
-     */
-    override fun bindDagger() {
-        HomeLaunch.component.inject(this)
-    }
-
-    /**
-     * @author LDD
-     * @From   HomeActivity
-     * @Date   2018/1/16 下午1:38
-     * @Note   页面初始化
-     */
-    override fun init() {
-        homePageDo()
-        AppTool.SystemUI.ImmersiveWithBottomBarColor(this,Color.BLACK)
-        mViewBinding.homeActViewpager.setFragments(arrayListOf(HomeFragment(),CategoryFragment()),supportFragmentManager)
-        mViewBinding.homeActNavigationview.then {
-            self ->
-            self.setNomalColor(R.color.javashop_color_navigation_nomal)
-            self.setSelectColor(R.color.javashop_color_navigation_select)
-            self.withViewPager(mViewBinding.homeActViewpager)
-        }
-        presenter.isLogin()
-    }
-
-    /**
-     * @author LDD
-     * @From   HomeActivity
-     * @Date   2018/1/16 下午1:39
-     * @Note   绑定事件
-     */
-    override fun bindEvent() {
-        mViewBinding.homeActNavigationview.then {
-            self ->
-            val home = NavigationModel("首页",R.drawable.javashop_navigation_home_select,R.drawable.javashop_navigation_home_nomal)
-            val category = NavigationModel("分类",R.drawable.javashop_navigation_category_select,R.drawable.javashop_navigation_category_nomal)
-            val person = NavigationModel("我的",R.drawable.javashop_navigation_person_select,R.drawable.javashop_navigation_person_nomal)
-            self.setData(arrayListOf(home,category,person)) { index ->
-                home_act_viewpager.setCurrentItem(index,false)
-            }
-        }
-    }
-
-    /**
-     * @author LDD
-     * @From   HomeActivity
-     * @Date   2018/1/16 下午1:39
-     * @Note   页面销毁回调
-     */
-    override fun destory() {
-        debugLog("HomeActivity","Destory")
-    }
-
-    fun toMember(){
-        home_act_viewpager.setCurrentItem(3,false)
-    }
-
-    /**
-     * @author LDD
-     * @From   HomeActivity
-     * @Date   2018/1/16 下午1:40
-     * @Note   判断用户登录状态
-     * @param  userInfo  用户信息
-     */
-    override fun onUserState(userInfo: MemberViewModel) {
-
-    }
-
-    /**
-     * @author LDD
-     * @From   HomeActivity
-     * @Date   2018/1/16 下午1:41
-     * @Note   显示错误信息
-     * @param  message 错误信息
-     */
-    override fun onError(message: String, type: Int) {
-        dismissDialog()
-        showMessage(message)
-    }
-
-    /**
-     * @author LDD
-     * @From   HomeActivity
-     * @Date   2018/1/16 下午1:41
-     * @Note   显示完成信息
-     * @param  message 完成信息
-     */
-    override fun complete(message: String, type: Int) {
-        dismissDialog()
-    }
-
-    /**
-     * @author LDD
-     * @From   HomeActivity
-     * @Date   2018/1/16 下午1:42
-     * @Note   操作开始
-     */
-    override fun start() {
-        showDialog()
-    }
-
-    /**
-     * @author LDD
-     * @From    HomeActivity
-     * @Date   2018/1/29 上午9:21
-     * @Note   ...
-     * @param  ...
-     */
-    override fun onBackPressed() {
-        if(System.currentTimeMillis() - clickTime < 1000){
-            super.onBackPressed()
-        }else{
-            clickTime = System.currentTimeMillis()
-            showMessage("再按一次退出JavaShop")
-        }
-    }
-
-    /**
-     * @author LDD
-     * @From   WelcomeActivity
-     * @Date   2018/1/16 下午1:45
-     * @Note   网络变化回调
-     * @param  state  网络状态
-     */
-    override fun networkMonitor(state: NetState) {
-        state.filter(onMobile = {
-
-        },onWifi = {
-
-        },offline = {
-
-        })
-    }
-}

+ 0 - 113
home/src/main/code/com/wdkl/ncs/android/component/home/adapter/ChildCategoryAdapter.kt

@@ -1,113 +0,0 @@
-package com.wdkl.ncs.android.component.home.adapter
-
-import android.databinding.DataBindingUtil
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import com.alibaba.android.vlayout.LayoutHelper
-import com.alibaba.android.vlayout.VirtualLayoutManager
-import com.wdkl.ncs.android.component.home.R
-import com.wdkl.ncs.android.component.home.databinding.CategroyChildItemBinding
-import com.wdkl.ncs.android.lib.adapter.BaseDelegateAdapter
-import com.wdkl.ncs.android.lib.utils.BaseRecyclerViewHolder
-import com.wdkl.ncs.android.lib.utils.getColorCompatible
-import com.wdkl.ncs.android.middleware.model.ChildCategoryViewModel
-import com.enation.javashop.utils.base.tool.ScreenTool
-
-/**
- * @author LDD
- * @Date   2018/1/30 下午2:54
- * @From   com.wdkl.ncs.android.component.home.adapter
- * @Note   三级分类适配器
- */
-class ChildCategoryAdapter constructor(private val mLayoutHelper: LayoutHelper, var data: List<ChildCategoryViewModel>) : BaseDelegateAdapter<BaseRecyclerViewHolder<CategroyChildItemBinding>, ChildCategoryViewModel>() {
-
-    /**
-     * @author LDD
-     * @From   ChildCategoryAdapter
-     * @Date   2018/2/6 上午10:50
-     * @Note   数据提供者
-     * @return 数据源
-     */
-    override fun dataProvider(): Any {
-        return data
-    }
-
-    /**
-     * @Name  repairCount
-     * @Type  Int
-     * @Note  需要填充的数量
-     */
-    private var repairCount: Int = 0
-
-
-    init {
-        /**填充数量不到3的倍数的数据量*/
-        repairCount = 3 - (data.size % 3)
-        if (repairCount == 3) repairCount = 0
-    }
-
-    /**
-     * @author LDD
-     * @From   ChildCategoryAdapter
-     * @Date   2018/1/30 下午2:56
-     * @Note   获取layoutHelper
-     * @return layouthelper
-     */
-    override fun onCreateLayoutHelper(): LayoutHelper {
-        return mLayoutHelper
-    }
-
-    /**
-     * @author LDD
-     * @From   ChildCategoryAdapter
-     * @Date   2018/1/30 下午2:57
-     * @Note   获取ViewHolder
-     */
-    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseRecyclerViewHolder<CategroyChildItemBinding> {
-        val binding = DataBindingUtil.inflate<CategroyChildItemBinding>(LayoutInflater.from(parent.context),R.layout.categroy_child_item,parent,false)
-        return BaseRecyclerViewHolder(binding)
-    }
-
-    /**
-     * @author LDD
-     * @From   ChildCategoryAdapter
-     * @Date   2018/1/30 下午2:57
-     * @Note   绑定数据
-     */
-    override fun onBindViewHolder(holder: BaseRecyclerViewHolder<CategroyChildItemBinding>, position: Int) {
-        holder.itemView.setBackgroundColor(holder.itemView.context.getColorCompatible(R.color.javashop_color_category_right_child_bg))
-        if (position >= data.size){
-            holder.getBinding().categoryChildItemTv.visibility = View.GONE
-            holder.getBinding().categoryChildItemIv.visibility = View.GONE
-        }else{
-            holder.itemView.layoutParams = VirtualLayoutManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ((ScreenTool.getScreenWidth(holder.getBinding().root.context)*0.7- ScreenTool.dip2px(holder.getBinding().root.context,20f))/3*1.4).toInt())
-            holder.getBinding().categoryChildItemTv.visibility = View.VISIBLE
-            holder.getBinding().categoryChildItemIv.visibility = View.VISIBLE
-            holder.getBinding().data = data[position]
-        }
-    }
-
-    /**
-     * @author LDD
-     * @From   ChildCategoryAdapter
-     * @Date   2018/1/30 下午2:57
-     * @Note   item个数
-     */
-    override fun getItemCount(): Int {
-        return data.size + repairCount
-    }
-
-    /**
-     * @author LDD
-     * @From   ChildCategoryAdapter
-     * @Date   2018/1/30 下午2:58
-     * @Note   item过滤器 过滤不需要绑定事件的item
-     * @param  position item坐标
-     * @return 是否需要绑定
-     */
-    override fun itemFilter(position: Int): Boolean {
-        return position <= data.size-1
-    }
-
-}

+ 0 - 132
home/src/main/code/com/wdkl/ncs/android/component/home/adapter/FloorBannerAdapter.kt

@@ -1,132 +0,0 @@
-package com.wdkl.ncs.android.component.home.adapter
-
-import android.content.Context
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import android.widget.ImageView
-import com.alibaba.android.vlayout.LayoutHelper
-import com.alibaba.android.vlayout.VirtualLayoutManager
-import com.alibaba.android.vlayout.layout.LinearLayoutHelper
-import com.bumptech.glide.Glide
-import com.bumptech.glide.load.engine.DiskCacheStrategy
-import com.wdkl.ncs.android.component.home.R
-import com.wdkl.ncs.android.component.home.agreement.FloorActionAgreement
-import com.wdkl.ncs.android.component.home.databinding.FloorItemBannerLayBinding
-import com.wdkl.ncs.android.lib.adapter.BaseDelegateAdapter
-import com.wdkl.ncs.android.lib.base.BaseControl
-import com.wdkl.ncs.android.lib.base.LIFE_CYCLE_PAUSE
-import com.wdkl.ncs.android.lib.base.LIFE_CYCLE_RESUME
-import com.wdkl.ncs.android.lib.utils.BaseRecyclerViewHolder
-import com.wdkl.ncs.android.lib.utils.then
-import com.wdkl.ncs.android.middleware.model.BannerModel
-import com.enation.javashop.utils.base.tool.ScreenTool
-import com.zhouwei.mzbanner.holder.MZViewHolder
-import java.lang.ref.WeakReference
-
-/**
- * 单个图片item
- */
-class FloorBannerAdapter(val lifeController : WeakReference<BaseControl>,val data : ArrayList<BannerModel>,val agreement: FloorActionAgreement) :BaseDelegateAdapter<BaseRecyclerViewHolder<FloorItemBannerLayBinding>,ArrayList<BannerModel>>() {
-
-    private var render = false
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:26
-     * @Note   数据提供者
-     */
-    override fun dataProvider(): Any {
-        return data
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   item过滤
-     * @param  position Item坐标
-     */
-    override fun itemFilter(position: Int): Boolean {
-        return true
-    }
-
-    override fun getItemViewType(position: Int): Int {
-        return 1
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   创建ViewHolder
-     */
-    override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): BaseRecyclerViewHolder<FloorItemBannerLayBinding> {
-        return BaseRecyclerViewHolder.build(parent,R.layout.floor_item_banner_lay)
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   获取Item总数
-     */
-    override fun getItemCount(): Int {
-        return 1
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:28
-     * @Note   创建LayoutHelper
-     */
-    override fun onCreateLayoutHelper(): LayoutHelper {
-        return LinearLayoutHelper(0,1).then { self ->
-        }
-    }
-
-    override fun onBindViewHolder(holder: BaseRecyclerViewHolder<FloorItemBannerLayBinding>?, position: Int) {
-        if (render){
-            return
-        }
-        holder?.itemView?.layoutParams = VirtualLayoutManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, (ScreenTool.getScreenWidth(holder?.databinding?.root?.context!!)*0.5).toInt())
-        holder?.bind {self ->
-            render = true
-            self.banner.setBannerPageClickListener { view, i ->
-                agreement.event(data[i])
-            }
-            self.banner.setPages(data.toList()) {return@setPages BannerViewHolder()}
-            lifeController.get()?.addLifeCycleListener { state ->
-                if (state == LIFE_CYCLE_PAUSE){
-                    self.banner.pause()
-                }else if (state == LIFE_CYCLE_RESUME){
-                    self.banner.start()
-                }
-            }
-            self.banner.start()
-        }
-
-    }
-}
-
-class BannerViewHolder : MZViewHolder<BannerModel>{
-
-    private var imageView : ImageView? = null
-
-    override fun onBind(p0: Context, p1: Int, p2: BannerModel) {
-        Glide.with(p0)
-                .load(p2.image)
-                .diskCacheStrategy(DiskCacheStrategy.ALL)
-                .dontAnimate()
-                .into(imageView)
-    }
-
-    override fun createView(p0: Context): View {
-        var view = LayoutInflater.from(p0).inflate(R.layout.banner_image_lay,null)
-        imageView = view.findViewById(R.id.image)
-        return view
-    }
-
-}

+ 0 - 136
home/src/main/code/com/wdkl/ncs/android/component/home/adapter/FloorCornerBannerAdapter.kt

@@ -1,136 +0,0 @@
-package com.wdkl.ncs.android.component.home.adapter
-
-import android.content.Context
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import android.widget.ImageView
-import com.alibaba.android.vlayout.LayoutHelper
-import com.alibaba.android.vlayout.VirtualLayoutManager
-import com.alibaba.android.vlayout.layout.LinearLayoutHelper
-import com.bumptech.glide.Glide
-import com.bumptech.glide.load.engine.DiskCacheStrategy
-import com.wdkl.ncs.android.component.home.R
-import com.wdkl.ncs.android.component.home.agreement.FloorActionAgreement
-import com.wdkl.ncs.android.component.home.databinding.FloorCornerItemBannerLayBinding
-import com.wdkl.ncs.android.lib.adapter.BaseDelegateAdapter
-import com.wdkl.ncs.android.lib.base.BaseControl
-import com.wdkl.ncs.android.lib.base.LIFE_CYCLE_PAUSE
-import com.wdkl.ncs.android.lib.base.LIFE_CYCLE_RESUME
-import com.wdkl.ncs.android.lib.utils.BaseRecyclerViewHolder
-import com.wdkl.ncs.android.lib.utils.dpToPx
-import com.wdkl.ncs.android.lib.utils.then
-import com.wdkl.ncs.android.middleware.model.BannerModel
-import com.enation.javashop.utils.base.tool.ScreenTool
-import com.zhouwei.mzbanner.holder.MZViewHolder
-import java.lang.ref.WeakReference
-
-/**
- * 单个图片item
- */
-class FloorCornerBannerAdapter(val lifeController : WeakReference<BaseControl>,val data : ArrayList<BannerModel>,val agreement: FloorActionAgreement) :BaseDelegateAdapter<BaseRecyclerViewHolder<FloorCornerItemBannerLayBinding>,ArrayList<BannerModel>>() {
-
-    private var render = false
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:26
-     * @Note   数据提供者
-     */
-    override fun dataProvider(): Any {
-        return data
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   item过滤
-     * @param  position Item坐标
-     */
-    override fun itemFilter(position: Int): Boolean {
-        return true
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   创建ViewHolder
-     */
-    override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): BaseRecyclerViewHolder<FloorCornerItemBannerLayBinding> {
-        return BaseRecyclerViewHolder.build(parent,R.layout.floor_corner_item_banner_lay)
-    }
-
-
-    override fun getItemViewType(position: Int): Int {
-        return 2
-    }
-
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   获取Item总数
-     */
-    override fun getItemCount(): Int {
-        return 1
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:28
-     * @Note   创建LayoutHelper
-     */
-    override fun onCreateLayoutHelper(): LayoutHelper {
-        return LinearLayoutHelper(0,1).then { self ->
-            self.setMargin(5.dpToPx(),0,5.dpToPx(),5.dpToPx())
-        }
-    }
-
-    override fun onBindViewHolder(holder: BaseRecyclerViewHolder<FloorCornerItemBannerLayBinding>?, position: Int) {
-        if (render){
-            return
-        }
-        holder?.itemView?.layoutParams = VirtualLayoutManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, (ScreenTool.getScreenWidth(holder?.databinding?.root?.context!!)*0.3).toInt())
-        holder?.bind {self ->
-            render = true
-            self.banner.setBannerPageClickListener { view, i ->
-                agreement.event(data[i])
-            }
-            self.banner.setPages(data.toList(),{return@setPages BannerCornerViewHolder()})
-            lifeController.get()?.addLifeCycleListener { state ->
-                if (state == LIFE_CYCLE_PAUSE){
-                    self.banner.pause()
-                }else if (state == LIFE_CYCLE_RESUME){
-                    self.banner.start()
-                }
-            }
-            self.banner.start()
-        }
-
-    }
-}
-
-class BannerCornerViewHolder : MZViewHolder<BannerModel>{
-
-    private var imageView : ImageView? = null
-
-    override fun onBind(p0: Context, p1: Int, p2: BannerModel) {
-        Glide.with(p0)
-                .load(p2.image)
-                .diskCacheStrategy(DiskCacheStrategy.ALL)
-                .dontAnimate()
-                .into(imageView)
-    }
-
-    override fun createView(p0: Context): View {
-        var view = LayoutInflater.from(p0).inflate(R.layout.banner_corner_image_lay,null)
-        imageView = view.findViewById(R.id.image)
-        return view
-    }
-
-}

+ 0 - 99
home/src/main/code/com/wdkl/ncs/android/component/home/adapter/FloorFiveImageAdapter.kt

@@ -1,99 +0,0 @@
-package com.wdkl.ncs.android.component.home.adapter
-
-import android.view.ViewGroup
-import com.alibaba.android.vlayout.LayoutHelper
-import com.alibaba.android.vlayout.VirtualLayoutManager
-import com.alibaba.android.vlayout.layout.LinearLayoutHelper
-import com.wdkl.ncs.android.component.home.R
-import com.wdkl.ncs.android.component.home.agreement.FloorActionAgreement
-import com.wdkl.ncs.android.component.home.databinding.FloorItemFiveImageLayBinding
-import com.wdkl.ncs.android.component.home.databinding.FloorItemSingleImageLayBinding
-import com.wdkl.ncs.android.lib.adapter.BaseDelegateAdapter
-import com.wdkl.ncs.android.lib.utils.BaseRecyclerViewHolder
-import com.wdkl.ncs.android.lib.utils.dpToPx
-import com.wdkl.ncs.android.lib.utils.then
-import com.wdkl.ncs.android.middleware.model.FloorItem
-import com.wdkl.ncs.android.middleware.model.FloorViewModel
-import com.enation.javashop.imagepluin.utils.GlideUtils
-import com.enation.javashop.utils.base.tool.ScreenTool
-import jp.wasabeef.glide.transformations.RoundedCornersTransformation
-
-/**
- * 单个图片item
- */
-class FloorFiveImageAdapter(val data : FloorViewModel,val agreement: FloorActionAgreement) :BaseDelegateAdapter<BaseRecyclerViewHolder<FloorItemFiveImageLayBinding>,FloorItem>() {
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:26
-     * @Note   数据提供者
-     */
-    override fun dataProvider(): Any {
-        return data
-    }
-
-
-    override fun getItemViewType(position: Int): Int {
-        return 3
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   item过滤
-     * @param  position Item坐标
-     */
-    override fun itemFilter(position: Int): Boolean {
-        return true
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   创建ViewHolder
-     */
-    override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): BaseRecyclerViewHolder<FloorItemFiveImageLayBinding> {
-        return BaseRecyclerViewHolder.build(parent,R.layout.floor_item_five_image_lay)
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   获取Item总数
-     */
-    override fun getItemCount(): Int {
-        return 1
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:28
-     * @Note   创建LayoutHelper
-     */
-    override fun onCreateLayoutHelper(): LayoutHelper {
-        return LinearLayoutHelper(0,1).then { self ->
-            self.setMargin(5.dpToPx(),0,5.dpToPx(),5.dpToPx())
-        }
-    }
-
-    override fun onBindViewHolder(holder: BaseRecyclerViewHolder<FloorItemFiveImageLayBinding>?, position: Int) {
-        holder?.itemView?.layoutParams = VirtualLayoutManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, (ScreenTool.getScreenWidth(holder?.databinding?.root?.context!!)*0.2).toInt())
-        holder?.bind { self ->
-            loadImageRound(data.itemList[0].getImageValue(),self.imageA,RoundedCornersTransformation.CornerType.LEFT)
-            loadImage(data.itemList[1].getImageValue(),self.imageB)
-            loadImage(data.itemList[2].getImageValue(),self.imageC)
-            loadImage(data.itemList[3].getImageValue(),self.imageD)
-            loadImageRound(data.itemList[4].getImageValue(),self.imageE,RoundedCornersTransformation.CornerType.RIGHT)
-            agreement.floorHandle(self.imageA,data.itemList[0])
-            agreement.floorHandle(self.imageB,data.itemList[1])
-            agreement.floorHandle(self.imageC,data.itemList[2])
-            agreement.floorHandle(self.imageD,data.itemList[3])
-            agreement.floorHandle(self.imageE,data.itemList[4])
-        }
-    }
-}

+ 0 - 98
home/src/main/code/com/wdkl/ncs/android/component/home/adapter/FloorFourImageAdapter.kt

@@ -1,98 +0,0 @@
-package com.wdkl.ncs.android.component.home.adapter
-
-import android.view.ViewGroup
-import com.alibaba.android.vlayout.LayoutHelper
-import com.alibaba.android.vlayout.VirtualLayoutManager
-import com.alibaba.android.vlayout.layout.LinearLayoutHelper
-import com.wdkl.ncs.android.component.home.R
-import com.wdkl.ncs.android.component.home.agreement.FloorActionAgreement
-import com.wdkl.ncs.android.component.home.databinding.FloorItemFourImageLayBinding
-import com.wdkl.ncs.android.component.home.databinding.FloorItemSingleImageLayBinding
-import com.wdkl.ncs.android.lib.adapter.BaseDelegateAdapter
-import com.wdkl.ncs.android.lib.utils.BaseRecyclerViewHolder
-import com.wdkl.ncs.android.lib.utils.dpToPx
-import com.wdkl.ncs.android.lib.utils.then
-import com.wdkl.ncs.android.middleware.model.FloorItem
-import com.wdkl.ncs.android.middleware.model.FloorViewModel
-import com.enation.javashop.imagepluin.utils.GlideUtils
-import com.enation.javashop.utils.base.tool.ScreenTool
-import jp.wasabeef.glide.transformations.RoundedCornersTransformation
-
-/**
- * 单个图片item
- */
-class FloorFourImageAdapter(val data : FloorViewModel,val agreement: FloorActionAgreement) :BaseDelegateAdapter<BaseRecyclerViewHolder<FloorItemFourImageLayBinding>,FloorItem>() {
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:26
-     * @Note   数据提供者
-     */
-    override fun dataProvider(): Any {
-        return data
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   item过滤
-     * @param  position Item坐标
-     */
-    override fun itemFilter(position: Int): Boolean {
-        return true
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   创建ViewHolder
-     */
-    override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): BaseRecyclerViewHolder<FloorItemFourImageLayBinding> {
-        return BaseRecyclerViewHolder.build(parent,R.layout.floor_item_four_image_lay)
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   获取Item总数
-     */
-    override fun getItemCount(): Int {
-        return 1
-    }
-
-
-    override fun getItemViewType(position: Int): Int {
-        return 4
-    }
-
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:28
-     * @Note   创建LayoutHelper
-     */
-    override fun onCreateLayoutHelper(): LayoutHelper {
-        return LinearLayoutHelper(0,1).then { self ->
-            self.setMargin(5.dpToPx(),0,5.dpToPx(),5.dpToPx())
-        }
-    }
-
-    override fun onBindViewHolder(holder: BaseRecyclerViewHolder<FloorItemFourImageLayBinding>?, position: Int) {
-        holder?.itemView?.layoutParams = VirtualLayoutManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, (ScreenTool.getScreenWidth(holder?.databinding?.root?.context!!)*0.25).toInt())
-        holder?.bind { self ->
-            loadImageRound(data.itemList[0].getImageValue(),self.imageA,RoundedCornersTransformation.CornerType.LEFT)
-            loadImage(data.itemList[1].getImageValue(),self.imageB)
-            loadImage(data.itemList[2].getImageValue(),self.imageC)
-            loadImageRound(data.itemList[3].getImageValue(),self.imageD,RoundedCornersTransformation.CornerType.RIGHT)
-            agreement.floorHandle(self.imageA,data.itemList[0])
-            agreement.floorHandle(self.imageB,data.itemList[1])
-            agreement.floorHandle(self.imageC,data.itemList[2])
-            agreement.floorHandle(self.imageD,data.itemList[3])
-        }
-    }
-}

+ 0 - 97
home/src/main/code/com/wdkl/ncs/android/component/home/adapter/FloorLeftOneRightTwoAdapter.kt

@@ -1,97 +0,0 @@
-package com.wdkl.ncs.android.component.home.adapter
-
-import android.view.ViewGroup
-import com.alibaba.android.vlayout.LayoutHelper
-import com.alibaba.android.vlayout.VirtualLayoutManager
-import com.alibaba.android.vlayout.layout.LinearLayoutHelper
-import com.wdkl.ncs.android.component.home.R
-import com.wdkl.ncs.android.component.home.agreement.FloorActionAgreement
-import com.wdkl.ncs.android.component.home.databinding.FloorItemLoneRtwoImageLayBinding
-import com.wdkl.ncs.android.component.home.databinding.FloorItemSingleImageLayBinding
-import com.wdkl.ncs.android.component.home.databinding.FloorItemThreeImageLayBinding
-import com.wdkl.ncs.android.lib.adapter.BaseDelegateAdapter
-import com.wdkl.ncs.android.lib.utils.BaseRecyclerViewHolder
-import com.wdkl.ncs.android.lib.utils.dpToPx
-import com.wdkl.ncs.android.lib.utils.then
-import com.wdkl.ncs.android.middleware.model.FloorItem
-import com.wdkl.ncs.android.middleware.model.FloorViewModel
-import com.enation.javashop.imagepluin.utils.GlideUtils
-import com.enation.javashop.utils.base.tool.ScreenTool
-import jp.wasabeef.glide.transformations.RoundedCornersTransformation
-
-/**
- * 单个图片item
- */
-class FloorLeftOneRightTwoAdapter(val data : FloorViewModel,val agreement: FloorActionAgreement) :BaseDelegateAdapter<BaseRecyclerViewHolder<FloorItemLoneRtwoImageLayBinding>,FloorItem>() {
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:26
-     * @Note   数据提供者
-     */
-    override fun dataProvider(): Any {
-        return data
-    }
-
-
-    override fun getItemViewType(position: Int): Int {
-        return 5
-    }
-
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   item过滤
-     * @param  position Item坐标
-     */
-    override fun itemFilter(position: Int): Boolean {
-        return true
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   创建ViewHolder
-     */
-    override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): BaseRecyclerViewHolder<FloorItemLoneRtwoImageLayBinding> {
-        return BaseRecyclerViewHolder.build(parent,R.layout.floor_item_lone_rtwo_image_lay)
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   获取Item总数
-     */
-    override fun getItemCount(): Int {
-        return 1
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:28
-     * @Note   创建LayoutHelper
-     */
-    override fun onCreateLayoutHelper(): LayoutHelper {
-        return LinearLayoutHelper(0,1).then { self ->
-            self.setMargin(5.dpToPx(),0,5.dpToPx(),5.dpToPx())
-        }
-    }
-
-    override fun onBindViewHolder(holder: BaseRecyclerViewHolder<FloorItemLoneRtwoImageLayBinding>?, position: Int) {
-        holder?.itemView?.layoutParams = VirtualLayoutManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, (ScreenTool.getScreenWidth(holder?.databinding?.root?.context!!)*0.5).toInt())
-        holder?.bind { self ->
-            loadImageRound(data.itemList[0].getImageValue(),self.imageA,RoundedCornersTransformation.CornerType.LEFT)
-            loadImageRound(data.itemList[1].getImageValue(),self.imageB,RoundedCornersTransformation.CornerType.TOP_RIGHT)
-            loadImageRound(data.itemList[2].getImageValue(),self.imageC,RoundedCornersTransformation.CornerType.BOTTOM_RIGHT)
-            agreement.floorHandle(self.imageA,data.itemList[0])
-            agreement.floorHandle(self.imageB,data.itemList[1])
-            agreement.floorHandle(self.imageC,data.itemList[2])
-        }
-    }
-}

+ 0 - 96
home/src/main/code/com/wdkl/ncs/android/component/home/adapter/FloorLeftRightAdapter.kt

@@ -1,96 +0,0 @@
-package com.wdkl.ncs.android.component.home.adapter
-
-import android.view.ViewGroup
-import com.alibaba.android.vlayout.LayoutHelper
-import com.alibaba.android.vlayout.VirtualLayoutManager
-import com.alibaba.android.vlayout.layout.LinearLayoutHelper
-import com.wdkl.ncs.android.component.home.R
-import com.wdkl.ncs.android.component.home.agreement.FloorActionAgreement
-import com.wdkl.ncs.android.component.home.databinding.FloorItemLeftRightLayBinding
-import com.wdkl.ncs.android.component.home.databinding.FloorItemSingleImageLayBinding
-import com.wdkl.ncs.android.lib.adapter.BaseDelegateAdapter
-import com.wdkl.ncs.android.lib.utils.BaseRecyclerViewHolder
-import com.wdkl.ncs.android.lib.utils.dpToPx
-import com.wdkl.ncs.android.lib.utils.then
-import com.wdkl.ncs.android.middleware.model.FloorItem
-import com.wdkl.ncs.android.middleware.model.FloorViewModel
-import com.enation.javashop.imagepluin.utils.GlideUtils
-import com.enation.javashop.utils.base.tool.ScreenTool
-import jp.wasabeef.glide.transformations.RoundedCornersTransformation
-
-/**
- * 单个图片item
- */
-class FloorLeftRightAdapter(val data : FloorViewModel,val agreement: FloorActionAgreement) :BaseDelegateAdapter<BaseRecyclerViewHolder<FloorItemLeftRightLayBinding>,FloorItem>() {
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:26
-     * @Note   数据提供者
-     */
-    override fun dataProvider(): Any {
-        return data
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   item过滤
-     * @param  position Item坐标
-     */
-    override fun itemFilter(position: Int): Boolean {
-        return true
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   创建ViewHolder
-     */
-    override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): BaseRecyclerViewHolder<FloorItemLeftRightLayBinding> {
-        return BaseRecyclerViewHolder.build(parent,R.layout.floor_item_left_right_lay)
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   获取Item总数
-     */
-    override fun getItemCount(): Int {
-        return 1
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:28
-     * @Note   创建LayoutHelper
-     */
-    override fun onCreateLayoutHelper(): LayoutHelper {
-        return LinearLayoutHelper(0,1).then { self ->
-            self.setMargin(5.dpToPx(),0,5.dpToPx(),5.dpToPx())
-        }
-    }
-
-
-    override fun getItemViewType(position: Int): Int {
-        return 6
-    }
-
-
-    override fun onBindViewHolder(holder: BaseRecyclerViewHolder<FloorItemLeftRightLayBinding>?, position: Int) {
-        holder?.itemView?.layoutParams = VirtualLayoutManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, (ScreenTool.getScreenWidth(holder?.databinding?.root?.context!!)*0.25).toInt())
-        holder?.bind { self ->
-            loadImageRound(data.itemList[0].getImageValue(),self.imageA,RoundedCornersTransformation.CornerType.LEFT)
-            loadImage(data.itemList[1].getImageValue(),self.imageB)
-            loadImageRound(data.itemList[2].getImageValue(),self.imageC,RoundedCornersTransformation.CornerType.RIGHT)
-            agreement.floorHandle(self.imageA,data.itemList[0])
-            agreement.floorHandle(self.imageB,data.itemList[1])
-            agreement.floorHandle(self.imageC,data.itemList[2])
-        }
-    }
-}

+ 0 - 147
home/src/main/code/com/wdkl/ncs/android/component/home/adapter/FloorMenuAdapter.kt

@@ -1,147 +0,0 @@
-package com.wdkl.ncs.android.component.home.adapter
-
-import android.content.Context
-import android.graphics.Color
-import android.util.TypedValue
-import android.view.Gravity
-import android.view.View
-import android.view.ViewGroup
-import android.widget.ImageView
-import android.widget.LinearLayout
-import android.widget.TextView
-import com.alibaba.android.vlayout.LayoutHelper
-import com.alibaba.android.vlayout.VirtualLayoutManager
-import com.alibaba.android.vlayout.layout.LinearLayoutHelper
-import com.wdkl.ncs.android.component.home.R
-import com.wdkl.ncs.android.component.home.agreement.FloorActionAgreement
-import com.wdkl.ncs.android.component.home.databinding.FloorItemMenuLayBinding
-import com.wdkl.ncs.android.component.home.databinding.FloorItemSingleImageLayBinding
-import com.wdkl.ncs.android.lib.adapter.BaseDelegateAdapter
-import com.wdkl.ncs.android.lib.utils.BaseRecyclerViewHolder
-import com.wdkl.ncs.android.lib.utils.dpToPx
-import com.wdkl.ncs.android.lib.utils.then
-import com.wdkl.ncs.android.middleware.model.FloorItem
-import com.wdkl.ncs.android.middleware.model.FloorMenuModel
-import com.wdkl.ncs.android.middleware.model.FloorViewModel
-import com.enation.javashop.imagepluin.utils.GlideUtils
-import com.enation.javashop.utils.base.tool.ScreenTool
-
-/**
- * 单个图片item
- */
-class FloorMenuAdapter(val data : ArrayList<FloorMenuModel>,val agreement: FloorActionAgreement) :BaseDelegateAdapter<BaseRecyclerViewHolder<FloorItemMenuLayBinding>,FloorItem>() {
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:26
-     * @Note   数据提供者
-     */
-    override fun dataProvider(): Any {
-        return data
-    }
-
-
-    override fun getItemViewType(position: Int): Int {
-        return 7
-    }
-
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   item过滤
-     * @param  position Item坐标
-     */
-    override fun itemFilter(position: Int): Boolean {
-        return true
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   创建ViewHolder
-     */
-    override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): BaseRecyclerViewHolder<FloorItemMenuLayBinding> {
-        return BaseRecyclerViewHolder.build(parent,R.layout.floor_item_menu_lay)
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   获取Item总数
-     */
-    override fun getItemCount(): Int {
-        return 1
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:28
-     * @Note   创建LayoutHelper
-     */
-    override fun onCreateLayoutHelper(): LayoutHelper {
-        return LinearLayoutHelper(0,1).then { self ->
-            self.setMargin(5.dpToPx(),5.dpToPx(),5.dpToPx(),5.dpToPx())
-        }
-    }
-
-    override fun onBindViewHolder(holder: BaseRecyclerViewHolder<FloorItemMenuLayBinding>?, position: Int) {
-        holder?.itemView?.layoutParams = VirtualLayoutManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, (ScreenTool.getScreenWidth(holder?.databinding?.root?.context!!)*0.4).toInt())
-        holder?.bind { self ->
-            self.root.setBackgroundResource(R.drawable.javashop_corners_common)
-            self.menuB.removeAllViews()
-            self.menuA.removeAllViews()
-            data.forEachIndexed { index, item ->
-                if (index > 4){
-                    self.menuB.addView(createMenuItem(self.root.context,item))
-                }else{
-                    self.menuA.addView(createMenuItem(self.root.context,item))
-                }
-            }
-        }
-    }
-
-
-    fun createMenuItem(context: Context,menuItem :FloorMenuModel) :View{
-
-        val parent = LinearLayout(context)
-        parent.orientation = LinearLayout.VERTICAL
-        parent.gravity = Gravity.CENTER
-        val itemSize :Int = (ScreenTool.getScreenWidth(context)/5).toInt() - 2.dpToPx()
-
-        val layoutParams = LinearLayout.LayoutParams(itemSize,itemSize).then { self ->
-            self.gravity = Gravity.CENTER
-        }
-
-        parent.layoutParams = layoutParams
-
-
-        val image = ImageView(context).then { self ->
-            self.scaleType = ImageView.ScaleType.FIT_XY
-            self.layoutParams = LinearLayout.LayoutParams((itemSize*0.6).toInt(),(itemSize*0.6).toInt())
-        }
-
-        val tv = TextView(context).then { self ->
-            self.layoutParams = LinearLayout.LayoutParams(itemSize,(itemSize*0.3).toInt())
-            self.gravity = Gravity.CENTER
-            self.setTextColor(Color.parseColor("#474747"))
-            self.setTextSize(TypedValue.COMPLEX_UNIT_PX, (itemSize*0.15).toFloat())
-        }
-
-        parent.addView(image)
-        parent.addView(tv)
-
-        loadImage(menuItem.image,image)
-        tv.text = menuItem.text
-
-        agreement.floorHandle(parent,menuItem)
-        return parent
-
-    }
-
-}

+ 0 - 96
home/src/main/code/com/wdkl/ncs/android/component/home/adapter/FloorRightOneLeftTwoAdapter.kt

@@ -1,96 +0,0 @@
-package com.wdkl.ncs.android.component.home.adapter
-
-import android.view.ViewGroup
-import com.alibaba.android.vlayout.LayoutHelper
-import com.alibaba.android.vlayout.VirtualLayoutManager
-import com.alibaba.android.vlayout.layout.LinearLayoutHelper
-import com.wdkl.ncs.android.component.home.R
-import com.wdkl.ncs.android.component.home.agreement.FloorActionAgreement
-import com.wdkl.ncs.android.component.home.databinding.FloorItemLtwoRoneImageLayBinding
-import com.wdkl.ncs.android.component.home.databinding.FloorItemSingleImageLayBinding
-import com.wdkl.ncs.android.lib.adapter.BaseDelegateAdapter
-import com.wdkl.ncs.android.lib.utils.BaseRecyclerViewHolder
-import com.wdkl.ncs.android.lib.utils.dpToPx
-import com.wdkl.ncs.android.lib.utils.then
-import com.wdkl.ncs.android.middleware.model.FloorItem
-import com.wdkl.ncs.android.middleware.model.FloorViewModel
-import com.enation.javashop.imagepluin.utils.GlideUtils
-import com.enation.javashop.utils.base.tool.ScreenTool
-import jp.wasabeef.glide.transformations.RoundedCornersTransformation
-
-/**
- * 单个图片item
- */
-class FloorRightOneLeftTwoAdapter(val data : FloorViewModel,val agreement: FloorActionAgreement) :BaseDelegateAdapter<BaseRecyclerViewHolder<FloorItemLtwoRoneImageLayBinding>,FloorItem>() {
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:26
-     * @Note   数据提供者
-     */
-    override fun dataProvider(): Any {
-        return data
-    }
-
-
-    override fun getItemViewType(position: Int): Int {
-        return 8
-    }
-
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   item过滤
-     * @param  position Item坐标
-     */
-    override fun itemFilter(position: Int): Boolean {
-        return true
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   创建ViewHolder
-     */
-    override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): BaseRecyclerViewHolder<FloorItemLtwoRoneImageLayBinding> {
-        return BaseRecyclerViewHolder.build(parent,R.layout.floor_item_ltwo_rone_image_lay)
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   获取Item总数
-     */
-    override fun getItemCount(): Int {
-        return 1
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:28
-     * @Note   创建LayoutHelper
-     */
-    override fun onCreateLayoutHelper(): LayoutHelper {
-        return LinearLayoutHelper(0,1).then { self ->
-            self.setMargin(5.dpToPx(),0,5.dpToPx(),5.dpToPx())
-        }
-    }
-
-    override fun onBindViewHolder(holder: BaseRecyclerViewHolder<FloorItemLtwoRoneImageLayBinding>?, position: Int) {
-        holder?.itemView?.layoutParams = VirtualLayoutManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, (ScreenTool.getScreenWidth(holder?.databinding?.root?.context!!)*0.5).toInt())
-        holder?.bind { self ->
-            loadImageRound(data.itemList[0].getImageValue(),self.imageA,RoundedCornersTransformation.CornerType.TOP_LEFT)
-            loadImageRound(data.itemList[1].getImageValue(),self.imageB,RoundedCornersTransformation.CornerType.BOTTOM_LEFT)
-            loadImageRound(data.itemList[2].getImageValue(),self.imageC,RoundedCornersTransformation.CornerType.RIGHT)
-            agreement.floorHandle(self.imageA,data.itemList[0])
-            agreement.floorHandle(self.imageB,data.itemList[1])
-            agreement.floorHandle(self.imageC,data.itemList[2])
-        }
-    }
-}

+ 0 - 223
home/src/main/code/com/wdkl/ncs/android/component/home/adapter/FloorSecKillAdapter.kt

@@ -1,223 +0,0 @@
-package com.wdkl.ncs.android.component.home.adapter
-
-import android.support.v7.widget.RecyclerView
-import android.text.SpannableStringBuilder
-import android.text.Spanned
-import android.text.style.AbsoluteSizeSpan
-import android.text.style.StrikethroughSpan
-import android.view.ViewGroup
-import com.alibaba.android.vlayout.LayoutHelper
-import com.alibaba.android.vlayout.VirtualLayoutManager
-import com.alibaba.android.vlayout.layout.LinearLayoutHelper
-import com.wdkl.ncs.android.component.home.R
-import com.wdkl.ncs.android.component.home.databinding.FloorItemSeckillLayBinding
-import com.wdkl.ncs.android.lib.adapter.BaseDelegateAdapter
-import com.wdkl.ncs.android.lib.base.BaseFragment
-import com.wdkl.ncs.android.lib.base.LIFE_CYCLE_DESTORY
-import com.wdkl.ncs.android.lib.utils.*
-import com.wdkl.ncs.android.middleware.model.GoodsItemViewModel
-import com.wdkl.ncs.android.middleware.model.SecKillListViewModel
-import com.enation.javashop.utils.base.tool.BaseToolActivity
-import com.enation.javashop.utils.base.tool.ScreenTool
-import java.lang.ref.WeakReference
-import java.util.*
-
-/**
- * 单个图片item
- */
-class FloorSecKillAdapter(val weakControl :WeakReference<BaseFragment<*, *>>, complete :()->Unit,val data : ArrayList<GoodsItemViewModel>, val time :SecKillListViewModel , val next :SecKillListViewModel?) :BaseDelegateAdapter<BaseRecyclerViewHolder<FloorItemSeckillLayBinding>,ArrayList<GoodsItemViewModel>>() {
-
-    /**
-     * @Name  timer
-     * @Type  TimeEngine
-     * @Note  倒计时引擎
-     */
-    var timer :TimeEngine  = TimeEngine.build(if(next == null){((TimeHandle.getCurrentDay24Mill() - System.currentTimeMillis()) / 1000)}else{next.distanceTime.toLong()}).needSingleProcess()
-
-
-    override fun onDetachedFromRecyclerView(recyclerView: RecyclerView?) {
-        super.onDetachedFromRecyclerView(recyclerView)
-        timer.destory()
-    }
-
-
-    override fun getItemViewType(position: Int): Int {
-        return 9
-    }
-
-
-    /**初始化*/
-    init {
-
-        timer.setComplete(complete)
-
-        weakControl.get()?.addLifeCycleListener {
-            state ->
-            if (state == LIFE_CYCLE_DESTORY){
-                timer.destory()
-            }
-        }
-
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:26
-     * @Note   数据提供者
-     */
-    override fun dataProvider(): Any {
-        return data
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   item过滤
-     * @param  position Item坐标
-     */
-    override fun itemFilter(position: Int): Boolean {
-        return true
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   创建ViewHolder
-     */
-    override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): BaseRecyclerViewHolder<FloorItemSeckillLayBinding> {
-        return BaseRecyclerViewHolder.build(parent,R.layout.floor_item_seckill_lay)
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   获取Item总数
-     */
-    override fun getItemCount(): Int {
-        return 1
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:28
-     * @Note   创建LayoutHelper
-     */
-    override fun onCreateLayoutHelper(): LayoutHelper {
-        return LinearLayoutHelper(0,1).then { self ->
-            self.setMargin(5.dpToPx(),0,5.dpToPx(),5.dpToPx())
-        }
-    }
-
-    override fun onBindViewHolder(holder: BaseRecyclerViewHolder<FloorItemSeckillLayBinding>?, position: Int) {
-        holder?.itemView?.layoutParams = VirtualLayoutManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, (ScreenTool.getScreenWidth(holder?.databinding?.root?.context!!)*0.4).toInt())
-        holder?.bind { self ->
-            self.root.setOnClickListener {
-                self.root.context.to<BaseToolActivity>().push("/promotion/seckill/main")
-            }
-                timer.execute(call = { _, hour, min, sec ->
-                    weakControl.get()!!.activity.runOnUiThread {
-                        self.hourTv.text = (if (hour < 10){ "0$hour"  } else { "$hour" })
-                        self.minTv.text = (if (min < 10){ "0$min"  } else { "$min" })
-                        self.secTv.text = (if (sec < 10){ "0$sec"  } else { "$sec" })
-                    }
-                })
-
-           self.title.text = String.format("%2d点场",time.text.toInt()!!)
-            if (data.getOrNull(0) != null){
-                self.goods1.setOnClickListener {
-                    self.root.context.to<BaseToolActivity>(). push("/goods/detail",{
-                        it.withInt("goodsId",data[0].goodsId)
-                    })
-                }
-                self.goods1.visable()
-                self.orgPrice1.text = SpannableStringBuilder(String.format("¥%.0f",data[0].orginPrice)).then { self ->
-                    self.setSpan(AbsoluteSizeSpan(5.dpToPx()), 0, 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
-                    self.setSpan(StrikethroughSpan(), 0, String.format("¥%.0f",data[0].orginPrice).length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
-                }
-                self.price1.text = SpannableStringBuilder(String.format("¥%.0f",data[0].goodsPrice)).then { self ->
-                    self.setSpan(AbsoluteSizeSpan(8.dpToPx()), 0, 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
-                }
-                loadImage(data[0].goodsImage,self.image1)
-            }else{
-                self.goods1.invisable()
-            }
-            if (data.getOrNull(1) != null){
-                self.goods2.visable()
-                self.goods2.setOnClickListener {
-                    self.root.context.to<BaseToolActivity>(). push("/goods/detail",{
-                        it.withInt("goodsId",data[1].goodsId)
-                    })
-                }
-                self.orgPrice2.text = SpannableStringBuilder(String.format("¥%.0f",data[1].orginPrice)).then { self ->
-                    self.setSpan(AbsoluteSizeSpan(5.dpToPx()), 0, 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
-                    self.setSpan(StrikethroughSpan(), 0, String.format("¥%.0f",data[1].orginPrice).length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
-                }
-                self.price2.text = SpannableStringBuilder(String.format("¥%.0f",data[1].goodsPrice)).then { self ->
-                    self.setSpan(AbsoluteSizeSpan(8.dpToPx()), 0, 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
-                }
-                loadImage(data[1].goodsImage,self.image2)
-            }else{
-                self.goods2.invisable()
-            }
-            if (data.getOrNull(2) != null){
-                self.goods3.visable()
-                self.goods3.setOnClickListener {
-                    self.root.context.to<BaseToolActivity>(). push("/goods/detail",{
-                        it.withInt("goodsId",data[2].goodsId)
-                    })
-                }
-                self.orgPrice3.text = SpannableStringBuilder(String.format("¥%.0f",data[2].orginPrice)).then { self ->
-                    self.setSpan(AbsoluteSizeSpan(5.dpToPx()), 0, 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
-                    self.setSpan(StrikethroughSpan(), 0, String.format("¥%.0f",data[2].orginPrice).length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
-                }
-                self.price3.text = SpannableStringBuilder(String.format("¥%.0f",data[2].goodsPrice)).then { self ->
-                    self.setSpan(AbsoluteSizeSpan(8.dpToPx()), 0, 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
-                }
-                loadImage(data[2].goodsImage,self.image3)
-            }else{
-                self.goods3.invisable()
-            }
-            if (data.getOrNull(3) != null){
-                self.goods4.visable()
-                self.goods4.setOnClickListener {
-                    self.root.context.to<BaseToolActivity>(). push("/goods/detail",{
-                        it.withInt("goodsId",data[3].goodsId)
-                    })
-                }
-                self.orgPrice4.text = SpannableStringBuilder(String.format("¥%.0f",data[3].orginPrice)).then { self ->
-                    self.setSpan(AbsoluteSizeSpan(5.dpToPx()), 0, 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
-                    self.setSpan(StrikethroughSpan(), 0, String.format("¥%.0f",data[3].orginPrice).length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
-                }
-                self.price4.text = SpannableStringBuilder(String.format("¥%.0f",data[3].goodsPrice)).then { self ->
-                    self.setSpan(AbsoluteSizeSpan(8.dpToPx()), 0, 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
-                }
-                loadImage(data[3].goodsImage,self.image4)
-            }else{
-                self.goods4.invisable()
-            }
-            if (data.getOrNull(4) != null){
-                self.goods5.visable()
-                self.goods5.setOnClickListener {
-                    self.root.context.to<BaseToolActivity>(). push("/goods/detail",{
-                        it.withInt("goodsId",data[4].goodsId)
-                    })
-                }
-                self.orgPrice5.text = SpannableStringBuilder(String.format("¥%.0f",data[4].orginPrice)).then { self ->
-                    self.setSpan(AbsoluteSizeSpan(5.dpToPx()), 0, 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
-                    self.setSpan(StrikethroughSpan(), 0, String.format("¥%.0f",data[4].orginPrice).length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
-                }
-                self.price5.text = SpannableStringBuilder(String.format("¥%.0f",data[4].goodsPrice)).then { self ->
-                    self.setSpan(AbsoluteSizeSpan(8.dpToPx()), 0, 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
-                }
-                loadImage(data[4].goodsImage,self.image5)
-            }else{
-                self.goods5.invisable()
-            }
-        }
-    }
-}

+ 0 - 90
home/src/main/code/com/wdkl/ncs/android/component/home/adapter/FloorSingleImageAdapter.kt

@@ -1,90 +0,0 @@
-package com.wdkl.ncs.android.component.home.adapter
-
-import android.view.ViewGroup
-import com.alibaba.android.vlayout.LayoutHelper
-import com.alibaba.android.vlayout.VirtualLayoutManager
-import com.alibaba.android.vlayout.layout.LinearLayoutHelper
-import com.wdkl.ncs.android.component.home.R
-import com.wdkl.ncs.android.component.home.agreement.FloorActionAgreement
-import com.wdkl.ncs.android.component.home.databinding.FloorItemSingleImageLayBinding
-import com.wdkl.ncs.android.lib.adapter.BaseDelegateAdapter
-import com.wdkl.ncs.android.lib.utils.BaseRecyclerViewHolder
-import com.wdkl.ncs.android.lib.utils.dpToPx
-import com.wdkl.ncs.android.lib.utils.then
-import com.wdkl.ncs.android.middleware.model.FloorItem
-import com.wdkl.ncs.android.middleware.model.FloorViewModel
-import com.enation.javashop.imagepluin.utils.GlideUtils
-import com.enation.javashop.utils.base.tool.ScreenTool
-
-/**
- * 单个图片item
- */
-class FloorSingleImageAdapter(val data : FloorViewModel,val agreement: FloorActionAgreement) :BaseDelegateAdapter<BaseRecyclerViewHolder<FloorItemSingleImageLayBinding>,FloorItem>() {
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:26
-     * @Note   数据提供者
-     */
-    override fun dataProvider(): Any {
-        return data
-    }
-
-
-    override fun getItemViewType(position: Int): Int {
-        return 10
-    }
-
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   item过滤
-     * @param  position Item坐标
-     */
-    override fun itemFilter(position: Int): Boolean {
-        return true
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   创建ViewHolder
-     */
-    override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): BaseRecyclerViewHolder<FloorItemSingleImageLayBinding> {
-        return BaseRecyclerViewHolder.build(parent,R.layout.floor_item_single_image_lay)
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   获取Item总数
-     */
-    override fun getItemCount(): Int {
-        return 1
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:28
-     * @Note   创建LayoutHelper
-     */
-    override fun onCreateLayoutHelper(): LayoutHelper {
-        return LinearLayoutHelper(0,1).then { self ->
-            self.setMargin(5.dpToPx(),0,5.dpToPx(),5.dpToPx())
-        }
-    }
-
-    override fun onBindViewHolder(holder: BaseRecyclerViewHolder<FloorItemSingleImageLayBinding>?, position: Int) {
-        holder?.itemView?.layoutParams = VirtualLayoutManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, (ScreenTool.getScreenWidth(holder?.databinding?.root?.context!!)*0.3).toInt())
-        holder?.bind { self ->
-            loadImageRound(data.itemList[0].getImageValue(),self.imageA)
-            agreement.floorHandle(self.imageA,data.itemList[0])
-        }
-    }
-}

+ 0 - 89
home/src/main/code/com/wdkl/ncs/android/component/home/adapter/FloorTextAdapter.kt

@@ -1,89 +0,0 @@
-package com.wdkl.ncs.android.component.home.adapter
-
-import android.view.ViewGroup
-import com.alibaba.android.vlayout.LayoutHelper
-import com.alibaba.android.vlayout.VirtualLayoutManager
-import com.alibaba.android.vlayout.layout.LinearLayoutHelper
-import com.wdkl.ncs.android.component.home.R
-import com.wdkl.ncs.android.component.home.agreement.FloorActionAgreement
-import com.wdkl.ncs.android.component.home.databinding.FloorItemSingleImageLayBinding
-import com.wdkl.ncs.android.component.home.databinding.FloorItemTextLayBinding
-import com.wdkl.ncs.android.lib.adapter.BaseDelegateAdapter
-import com.wdkl.ncs.android.lib.utils.BaseRecyclerViewHolder
-import com.wdkl.ncs.android.lib.utils.then
-import com.wdkl.ncs.android.middleware.model.FloorItem
-import com.wdkl.ncs.android.middleware.model.FloorViewModel
-import com.enation.javashop.imagepluin.utils.GlideUtils
-import com.enation.javashop.utils.base.tool.ScreenTool
-
-/**
- * 单个图片item
- */
-class FloorTextAdapter(val data : FloorViewModel,val agreement: FloorActionAgreement) :BaseDelegateAdapter<BaseRecyclerViewHolder<FloorItemTextLayBinding>,FloorItem>() {
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:26
-     * @Note   数据提供者
-     */
-    override fun dataProvider(): Any {
-        return data
-    }
-
-
-    override fun getItemViewType(position: Int): Int {
-        return 11
-    }
-
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   item过滤
-     * @param  position Item坐标
-     */
-    override fun itemFilter(position: Int): Boolean {
-        return true
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   创建ViewHolder
-     */
-    override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): BaseRecyclerViewHolder<FloorItemTextLayBinding> {
-        return BaseRecyclerViewHolder.build(parent,R.layout.floor_item_text_lay)
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   获取Item总数
-     */
-    override fun getItemCount(): Int {
-        return 1
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:28
-     * @Note   创建LayoutHelper
-     */
-    override fun onCreateLayoutHelper(): LayoutHelper {
-        return LinearLayoutHelper(0,1).then { self ->
-            self.setMargin(10,0,10,0)
-        }
-    }
-
-    override fun onBindViewHolder(holder: BaseRecyclerViewHolder<FloorItemTextLayBinding>?, position: Int) {
-        holder?.bind { self ->
-            self.text.text = data.itemList[0].getImageValue()
-            agreement.floorHandle(self.text,data.itemList[0])
-        }
-    }
-}

+ 0 - 96
home/src/main/code/com/wdkl/ncs/android/component/home/adapter/FloorThreeImageAdapter.kt

@@ -1,96 +0,0 @@
-package com.wdkl.ncs.android.component.home.adapter
-
-import android.view.ViewGroup
-import com.alibaba.android.vlayout.LayoutHelper
-import com.alibaba.android.vlayout.VirtualLayoutManager
-import com.alibaba.android.vlayout.layout.LinearLayoutHelper
-import com.wdkl.ncs.android.component.home.R
-import com.wdkl.ncs.android.component.home.agreement.FloorActionAgreement
-import com.wdkl.ncs.android.component.home.databinding.FloorItemSingleImageLayBinding
-import com.wdkl.ncs.android.component.home.databinding.FloorItemThreeImageLayBinding
-import com.wdkl.ncs.android.lib.adapter.BaseDelegateAdapter
-import com.wdkl.ncs.android.lib.utils.BaseRecyclerViewHolder
-import com.wdkl.ncs.android.lib.utils.dpToPx
-import com.wdkl.ncs.android.lib.utils.then
-import com.wdkl.ncs.android.middleware.model.FloorItem
-import com.wdkl.ncs.android.middleware.model.FloorViewModel
-import com.enation.javashop.imagepluin.utils.GlideUtils
-import com.enation.javashop.utils.base.tool.ScreenTool
-import jp.wasabeef.glide.transformations.RoundedCornersTransformation
-
-/**
- * 单个图片item
- */
-class FloorThreeImageAdapter(val data : FloorViewModel,val agreement: FloorActionAgreement) :BaseDelegateAdapter<BaseRecyclerViewHolder<FloorItemThreeImageLayBinding>,FloorItem>() {
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:26
-     * @Note   数据提供者
-     */
-    override fun dataProvider(): Any {
-        return data
-    }
-
-
-    override fun getItemViewType(position: Int): Int {
-        return 12
-    }
-
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   item过滤
-     * @param  position Item坐标
-     */
-    override fun itemFilter(position: Int): Boolean {
-        return true
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   创建ViewHolder
-     */
-    override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): BaseRecyclerViewHolder<FloorItemThreeImageLayBinding> {
-        return BaseRecyclerViewHolder.build(parent,R.layout.floor_item_three_image_lay)
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   获取Item总数
-     */
-    override fun getItemCount(): Int {
-        return 1
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:28
-     * @Note   创建LayoutHelper
-     */
-    override fun onCreateLayoutHelper(): LayoutHelper {
-        return LinearLayoutHelper(0,1).then { self ->
-            self.setMargin(5.dpToPx(),0,5.dpToPx(),5.dpToPx())
-        }
-    }
-
-    override fun onBindViewHolder(holder: BaseRecyclerViewHolder<FloorItemThreeImageLayBinding>?, position: Int) {
-        holder?.itemView?.layoutParams = VirtualLayoutManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, (ScreenTool.getScreenWidth(holder?.databinding?.root?.context!!)/3).toInt())
-        holder?.bind { self ->
-            loadImageRound(data.itemList[0].getImageValue(),self.imageA,RoundedCornersTransformation.CornerType.LEFT)
-            loadImage(data.itemList[1].getImageValue(),self.imageB)
-            loadImageRound(data.itemList[2].getImageValue(),self.imageC,RoundedCornersTransformation.CornerType.RIGHT)
-            agreement.floorHandle(self.imageA,data.itemList[0])
-            agreement.floorHandle(self.imageB,data.itemList[1])
-            agreement.floorHandle(self.imageC,data.itemList[2])
-        }
-    }
-}

+ 0 - 90
home/src/main/code/com/wdkl/ncs/android/component/home/adapter/FloorTitleAdapter.kt

@@ -1,90 +0,0 @@
-package com.wdkl.ncs.android.component.home.adapter
-
-import android.view.ViewGroup
-import com.alibaba.android.vlayout.LayoutHelper
-import com.alibaba.android.vlayout.VirtualLayoutManager
-import com.alibaba.android.vlayout.layout.LinearLayoutHelper
-import com.wdkl.ncs.android.component.home.R
-import com.wdkl.ncs.android.component.home.agreement.FloorActionAgreement
-import com.wdkl.ncs.android.component.home.databinding.FloorItemSingleImageLayBinding
-import com.wdkl.ncs.android.component.home.databinding.FloorItemTitleLayBinding
-import com.wdkl.ncs.android.lib.adapter.BaseDelegateAdapter
-import com.wdkl.ncs.android.lib.utils.BaseRecyclerViewHolder
-import com.wdkl.ncs.android.lib.utils.dpToPx
-import com.wdkl.ncs.android.lib.utils.then
-import com.wdkl.ncs.android.middleware.model.FloorItem
-import com.wdkl.ncs.android.middleware.model.FloorViewModel
-import com.enation.javashop.imagepluin.utils.GlideUtils
-import com.enation.javashop.utils.base.tool.ScreenTool
-
-/**
- * 单个图片item
- */
-class FloorTitleAdapter(val data : FloorViewModel,val agreement: FloorActionAgreement) :BaseDelegateAdapter<BaseRecyclerViewHolder<FloorItemTitleLayBinding>,FloorItem>() {
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:26
-     * @Note   数据提供者
-     */
-    override fun dataProvider(): Any {
-        return data
-    }
-
-
-    override fun getItemViewType(position: Int): Int {
-        return 13
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   item过滤
-     * @param  position Item坐标
-     */
-    override fun itemFilter(position: Int): Boolean {
-        return true
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   创建ViewHolder
-     */
-    override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): BaseRecyclerViewHolder<FloorItemTitleLayBinding> {
-        return BaseRecyclerViewHolder.build(parent,R.layout.floor_item_title_lay)
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:27
-     * @Note   获取Item总数
-     */
-    override fun getItemCount(): Int {
-        return 1
-    }
-
-    /**
-     * @author LDD
-     * @From   SingleImageAdapter
-     * @Date   2018/8/16 下午5:28
-     * @Note   创建LayoutHelper
-     */
-    override fun onCreateLayoutHelper(): LayoutHelper {
-        return LinearLayoutHelper(0,1).then { self ->
-            self.setMargin(5.dpToPx(),0,5.dpToPx(),5.dpToPx())
-        }
-    }
-
-    override fun onBindViewHolder(holder: BaseRecyclerViewHolder<FloorItemTitleLayBinding>?, position: Int) {
-        holder?.itemView?.layoutParams = VirtualLayoutManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, (ScreenTool.getScreenWidth(holder?.databinding?.root?.context!!)*0.12).toInt())
-        holder?.bind { self ->
-            loadImage(data.itemList[0].getImageValue(),self.image)
-            agreement.floorHandle(self.image,data.itemList[0])
-        }
-    }
-}

+ 0 - 93
home/src/main/code/com/wdkl/ncs/android/component/home/adapter/ParentCategoryAdapter.kt

@@ -1,93 +0,0 @@
-package com.wdkl.ncs.android.component.home.adapter
-
-import android.databinding.DataBindingUtil
-import android.view.LayoutInflater
-import android.view.ViewGroup
-import com.alibaba.android.vlayout.LayoutHelper
-import com.alibaba.android.vlayout.VirtualLayoutManager
-import com.alibaba.android.vlayout.layout.LinearLayoutHelper
-import com.wdkl.ncs.android.component.home.R
-import com.wdkl.ncs.android.component.home.databinding.CategoryParentItemBinding
-import com.wdkl.ncs.android.lib.adapter.BaseDelegateAdapter
-import com.wdkl.ncs.android.lib.utils.BaseRecyclerViewHolder
-import com.enation.javashop.utils.base.tool.ScreenTool
-
-/**
- * @author LDD
- * @Date   2018/1/30 下午2:50
- * @From   com.wdkl.ncs.android.component.home.adapter
- * @Note   二级分类适配器
- */
-class ParentCategoryAdapter(val name : String) : BaseDelegateAdapter<BaseRecyclerViewHolder<CategoryParentItemBinding>,String>() {
-
-
-    /**
-     * @author LDD
-     * @From   ParentCategoryAdapter
-     * @Date   2018/2/8 下午3:27
-     * @Note   数据员提供者
-     * @return 数据源
-     */
-    override fun dataProvider(): Any {
-        return name
-    }
-
-    /**
-     * @author LDD
-     * @From   ParentCategoryAdapter
-     * @Date   2018/2/8 下午3:28
-     * @Note   响应事件拦截方法
-     * @param  position 坐标
-     * @return 是否相应
-     */
-    override fun itemFilter(position: Int): Boolean {
-        return false
-    }
-
-    /**
-     * @author LDD
-     * @From   ParentCategoryAdapter
-     * @Date   2018/1/30 下午2:52
-     * @Note   获取LayoutHelper
-     * @return LayoutHelper
-     */
-    override fun onCreateLayoutHelper(): LayoutHelper {
-        return LinearLayoutHelper(0,1)
-    }
-
-    /**
-     * @author LDD
-     * @From   ParentCategoryAdapter
-     * @Date   2018/1/30 下午2:52
-     * @Note   ViewHolder创建
-     */
-    override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): BaseRecyclerViewHolder<CategoryParentItemBinding> {
-        return BaseRecyclerViewHolder(DataBindingUtil.inflate(LayoutInflater.from(parent?.context),R.layout.category_parent_item,parent,false))
-    }
-
-    /**
-     * @author LDD
-     * @From   ParentCategoryAdapter
-     * @Date   2018/1/30 下午2:53
-     * @Note   绑定数据
-     */
-    override fun onBindViewHolder(holder: BaseRecyclerViewHolder<CategoryParentItemBinding>?, position: Int) {
-        holder?.itemView?.layoutParams = VirtualLayoutManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, (ScreenTool.dip2px(holder?.itemView?.context,35f)))
-        holder?.bind {
-                binding ->
-                binding.name = name
-            }
-    }
-
-    /**
-     * @author LDD
-     * @From   ParentCategoryAdapter
-     * @Date   2018/1/30 下午2:53
-     * @Note   获取item总数
-     * @return item总数
-     */
-    override fun getItemCount(): Int {
-        return 1
-    }
-
-}

+ 0 - 104
home/src/main/code/com/wdkl/ncs/android/component/home/agreement/FloorActionAgreement.kt

@@ -1,104 +0,0 @@
-package com.wdkl.ncs.android.component.home.agreement
-
-import android.view.MenuItem
-import android.view.View
-import com.wdkl.ncs.android.middleware.model.BannerModel
-import com.wdkl.ncs.android.middleware.model.FloorItem
-import com.wdkl.ncs.android.middleware.model.FloorMenuModel
-
-/**
- * Created by LDD on 2018/10/16.
- */
-interface FloorActionAgreement {
-
-    fun pointMall()
-
-    fun secKill()
-
-    fun groupMall()
-
-    fun couponHall()
-
-    fun toShop(id :Int)
-
-    fun toWeb(url :String)
-
-    fun searchGoodsForKeyWord(keyword :String)
-
-    fun searchGoodsForCatrgory(catId :Int,text :String)
-
-    fun goods(goodsId :Int)
-
-    fun floorHandle(view :View , item :Any){
-
-        view.setOnClickListener {
-            event(item)
-        }
-
-    }
-
-    fun event(item :Any){
-        if (item is BannerModel){
-            if(item.action == "URL"){
-                if(item.value.contains("point")){
-                    pointMall()
-                }else if(item.value.contains("group")){
-                    groupMall()
-                }else if(item.value.contains("sec")){
-                    secKill()
-                }else{
-                    toWeb(item.value)
-                }
-            }else if(item.action == "KEYWORD"){
-                searchGoodsForKeyWord(item.value)
-            }else if(item.action == "GOODS"){
-                goods(item.value.toInt())
-            }else if(item.action == "CATEGORY"){
-                searchGoodsForCatrgory(item.value.toInt(),"搜索结果")
-            }else if(item.action == "SHOP"){
-                toShop(item.value.toInt())
-            }
-        }
-        if (item is FloorItem){
-            if(item.opt!!.type == "URL"){
-                if(item.opt!!.value.contains("point")){
-                    pointMall()
-                }else if(item.opt!!.value.contains("group")){
-                    groupMall()
-                }else if(item.opt!!.value.contains("sec")){
-                    secKill()
-                }else{
-                    toWeb(item.opt!!.value)
-                }
-            }else if(item.opt!!.type == "KEYWORD"){
-                searchGoodsForKeyWord(item.opt!!.value)
-            }else if(item.opt!!.type == "GOODS"){
-                goods(item.opt!!.value.toInt())
-            }else if(item.opt!!.type == "CATEGORY"){
-                searchGoodsForCatrgory(item.opt!!.value.toInt(),"搜索结果")
-            }else if(item.opt!!.type == "SHOP"){
-                toShop(item.opt!!.value.toInt())
-            }
-        }
-        if (item is FloorMenuModel){
-            if (item.action.contains("points-mall")){
-                pointMall()
-            }else if (item.action.contains("group-buy")){
-                groupMall()
-            }else if (item.action.contains("seckill")){
-                secKill()
-            }else if (item.action.contains("goods")){
-                goods(item.action.removePrefix("/goods/").toInt())
-            }else if(item.action.contains("coupons")){
-                couponHall()
-            }else{
-                toWeb(item.action)
-            }
-        }
-    }
-
-
-
-
-
-}

+ 0 - 37
home/src/main/code/com/wdkl/ncs/android/component/home/binding/HomeFragmentBindHelper.kt

@@ -1,37 +0,0 @@
-package com.wdkl.ncs.android.component.home.binding
-
-import android.databinding.BindingAdapter
-import android.databinding.ObservableField
-import android.support.constraint.ConstraintLayout
-
-/**
- * @author LDD
- * @From   com.wdkl.ncs.android.component.home.binding
- * @Date   2018/1/30 下午3:03
- * @Note   首页UIVM
- */
-class HomeFragmentBindHelper {
-
-    /**
-     * @Name  scrollY
-     * @Type  ObservableField<Int>
-     * @Note  滑动距离
-     */
-    val scrollY = ObservableField(0)
-
-    /**
-     * @Name  image
-     * @Type  String
-     * @Note  测试图片
-     */
-    var image = "http://onghqryqs.bkt.clouddn.com/ChMkJlauzbOIb6JqABF4o12gc_AAAH9HgF1sh0AEXi7441.jpeg"
-
-    /**
-     * @Name  isHide
-     * @Type  ObservableField<Boolean>
-     * @Note  是否隐藏
-     */
-    val isHide  = ObservableField(true)
-
-
-}

+ 0 - 23
home/src/main/code/com/wdkl/ncs/android/component/home/di/HomeComponent.kt

@@ -1,23 +0,0 @@
-package com.wdkl.ncs.android.component.home.di
-
-import com.wdkl.ncs.android.component.home.activity.HomeActivity
-import com.wdkl.ncs.android.component.home.fragment.CategoryFragment
-import com.wdkl.ncs.android.component.home.fragment.HomeFragment
-import com.wdkl.ncs.android.middleware.di.ApplicationComponent
-import dagger.Component
-
-/**
- * @author LDD
- * @Date   2018/1/22 下午2:43
- * @From   com.wdkl.ncs.android.component.home.di
- * @Note   依赖注入入口
- */
-@Component(dependencies = arrayOf(ApplicationComponent::class))
-interface HomeComponent {
-
-    fun inject(activity: HomeActivity)
-
-    fun inject(activity: HomeFragment)
-
-    fun inject(activity: CategoryFragment)
-}

+ 0 - 404
home/src/main/code/com/wdkl/ncs/android/component/home/fragment/CategoryFragment.kt

@@ -1,404 +0,0 @@
-package com.wdkl.ncs.android.component.home.fragment
-
-import android.support.constraint.ConstraintLayout
-import android.support.v7.widget.RecyclerView
-import android.view.View
-import android.view.ViewGroup
-import android.widget.AbsListView
-import com.alibaba.android.vlayout.DelegateAdapter
-import com.alibaba.android.vlayout.LayoutHelper
-import com.alibaba.android.vlayout.VirtualLayoutManager
-import com.alibaba.android.vlayout.layout.GridLayoutHelper
-import com.alibaba.android.vlayout.layout.LinearLayoutHelper
-import com.wdkl.ncs.android.component.home.R
-import com.wdkl.ncs.android.component.home.activity.HomeActivity
-import com.wdkl.ncs.android.component.home.adapter.ChildCategoryAdapter
-import com.wdkl.ncs.android.component.home.adapter.ParentCategoryAdapter
-import com.wdkl.ncs.android.component.home.databinding.CategoryFragLayBinding
-import com.wdkl.ncs.android.component.home.databinding.CategroyLeftItemBinding
-import com.wdkl.ncs.android.component.home.launch.HomeLaunch
-import com.wdkl.ncs.android.lib.adapter.ListViewBaseAdapter
-import com.wdkl.ncs.android.lib.adapter.VlayoutHolderAdapter
-import com.wdkl.ncs.android.lib.base.BaseFragment
-import com.wdkl.ncs.android.lib.utils.*
-import com.wdkl.ncs.android.lib.vo.filter
-import com.wdkl.ncs.android.middleware.logic.contract.home.CategoryFragmentContract
-import com.wdkl.ncs.android.middleware.logic.presenter.home.CategoryFragmentPresenter
-import com.wdkl.ncs.android.middleware.model.ChildCategoryShell
-import com.wdkl.ncs.android.middleware.model.ChildCategoryViewModel
-import com.wdkl.ncs.android.middleware.model.ParentCategoryViewModel
-import com.enation.javashop.net.engine.model.NetState
-import com.enation.javashop.utils.base.tool.ScreenTool
-import kotlinx.android.synthetic.main.category_frag_lay.*
-import kotlin.collections.ArrayList
-
-/**
- * @author LDD
- * @Date   2018/1/22 下午12:38
- * @From   com.wdkl.ncs.android.component.home.fragment
- * @Note   分类Fragment
- */
-class CategoryFragment :BaseFragment<CategoryFragmentPresenter,CategoryFragLayBinding>(),CategoryFragmentContract.View {
-
-    /**
-     * 左侧列表数据
-     */
-    private val leftViewData = ArrayList<ParentCategoryViewModel>()
-
-    /**
-     * 右侧列表布局控制器
-     */
-    private lateinit var virtualLayoutManager :VirtualLayoutManager
-
-    /**
-     * 右侧列表视图父适配器
-     */
-    private lateinit var delegateAdapter :DelegateAdapter
-
-
-    /** 适配器列表设置 */
-    val adapterList = ArrayList<DelegateAdapter.Adapter<*>>()
-    /**
-     * 占位视图
-     */
-    private val holderView = VlayoutHolderAdapter(object :VlayoutHolderAdapter.HolderCallBack{
-        override fun bindView(holder: RecyclerView.ViewHolder) {
-            holder.itemView.layoutParams = VirtualLayoutManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, (ScreenTool.dip2px(holder.itemView.context,10f)))
-            holder.itemView.setBackgroundResource(R.color.javashop_color_category_rv_bg)
-        }
-
-        override fun layoutHelperProvider(): LayoutHelper {
-            return LinearLayoutHelper(0,1)
-        }
-
-        override fun viewHolderProvider(parent : ViewGroup): RecyclerView.ViewHolder {
-            return VlayoutHolderAdapter.PlaceHolder(View(parent.context))
-        }
-
-    })
-
-    /**
-     * @author LDD
-     * @From   CategoryFragment
-     * @Date   2018/1/22 下午2:46
-     * @Note   提供layoutId
-     * @return layoutId
-     */
-    override fun getLayId(): Int {
-        return R.layout.category_frag_lay
-    }
-
-    /**
-     * @author LDD
-     * @From   CategoryFragment
-     * @Date   2018/1/22 下午2:46
-     * @Note   依赖注入初始化
-     */
-    override fun bindDagger() {
-        HomeLaunch.component.inject(this)
-    }
-
-    /**
-     * @author LDD
-     * @From   CategoryFragment
-     * @Date   2018/1/22 下午2:47
-     * @Note   初始化页面
-     */
-    override fun init() {
-        mViewDataBinding.categorySearchLay.setOnClickListener(OnClickListenerAntiViolence({
-            push("/search/main")
-        }))
-        initLeft()
-        initRight()
-    }
-
-    /**
-     * @author LDD
-     * @From   CategoryFragment
-     * @Date   2018/1/22 下午2:47
-     * @Note   绑定事件
-     */
-    override fun bindEvent() {
-        category_frag_my_iv.setOnClickListener {
-            activity.to<HomeActivity>().toMember()
-        }
-        category_frag_scan_iv.setOnClickListener {
-            push("/extra/scan")
-        }
-    }
-
-    /**
-     * @author LDD
-     * @From   CategoryFragment
-     * @Date   2018/1/22 下午2:47
-     * @Note   页面销毁时调用
-     */
-    override fun destory() {
-
-    }
-
-    /**
-     * @author LDD
-     * @From   CategoryFragment
-     * @Date   2018/1/22 下午2:47
-     * @Note   展示子分类
-     * @param  childCategoryList 子分类数据
-     */
-    override fun showChildCatList(childCategoryList: ArrayList<ChildCategoryShell>) {
-
-        if(delegateAdapter.adaptersCount > 0){
-            delegateAdapter.removeAdapters(adapterList)
-        }
-
-        /** 适配器列表设置 */
-        adapterList.then { self ->
-
-            self.clear()
-
-            /**循环设置*/
-            childCategoryList.forEach { item ->
-
-                /** 添加二级分类视图 */
-                self.add(ParentCategoryAdapter(item.parentName))
-
-                /** 初始化三级分类适配器 */
-                val childAdapter = ChildCategoryAdapter(GridLayoutHelper(3).then {
-                    self ->
-                    /** 设置视图不自动展开 */
-                    self.setAutoExpand(false)
-                },item.item)
-
-                /** 设置Item点击事件 */
-                childAdapter.setOnItemClickListener { data, position ->
-                    childClick(data)
-                }
-
-                self.add(childAdapter)
-
-                /** 添加占位视图 */
-                self.add(holderView)
-
-            }
-
-        }
-        /**重置LayoutHelper*/
-        virtualLayoutManager.setLayoutHelpers(ArrayList<LayoutHelper>().then {self ->
-            adapterList.forEach {
-                self.add(it.onCreateLayoutHelper())
-            }
-        })
-        /** 添加适配器 */
-        delegateAdapter.addAdapters(adapterList)
-        /** 通知视图更新 */
-        delegateAdapter.notifyDataSetChanged()
-        /** 刷新视图 */
-        category_right_rv.scrollToPosition(0)
-
-        category_right_rv.scrollToPosition(0)
-
-    }
-
-    /**
-     * 子分类点击事件
-     */
-    private fun childClick(data :ChildCategoryViewModel){
-        push("/goods/list",{
-            it.withInt("category",data.catId)
-            it.withString("hint",data.name)
-        })
-    }
-
-    /**
-     * @author LDD
-     * @From   CategoryFragment
-     * @Date   2018/1/22 下午2:48
-     * @Note   展示父分类列表
-     * @param  parentCategoryList  父分类数据
-     */
-    override fun showParentCatList(parentCategoryList: ArrayList<ParentCategoryViewModel>) {
-        leftViewData.addAll(parentCategoryList)
-        listViewAdapter.notifyDataSetChanged()
-        presenter.loadChildCat(parentCategoryList[0].parentId)
-    }
-
-    /**
-     * @author LDD
-     * @From   CategoryFragment
-     * @Date   2018/1/22 下午2:49
-     * @Note   逻辑错误时 展示错误信息
-     * @param  message 错误信息
-     */
-    override fun onError(message: String, type: Int) {
-    }
-
-    /**
-     * @author LDD
-     * @From   CategoryFragment
-     * @Date   2018/1/22 下午2:50
-     * @Note   耗时操作完成时调用
-     * @param  message 信息
-     */
-    override fun complete(message: String, type: Int) {
-
-    }
-
-    /**
-     * @author LDD
-     * @From   CategoryFragment
-     * @Date   2018/1/22 下午2:50
-     * @Note   耗时操作开始
-     */
-    override fun start() {
-
-    }
-
-    /**
-     * @author LDD
-     * @From   CategoryFragment
-     * @Date   2018/1/22 下午2:50
-     * @Note   网络状态监听
-     * @param  state 网络状态
-     */
-    override fun networkMonitor(state: NetState) {
-        state.filter(onMobile = {
-
-        },onWifi = {
-
-        },offline = {
-
-        })
-    }
-
-    /**
-     * @author LDD
-     * @From   CategoryFragment
-     * @Date   2018/1/29 下午8:43
-     * @Note   初始化父分类
-     */
-    private fun initLeft(){
-        mViewDataBinding.categoryLeftLv.adapter = listViewAdapter
-        presenter.loadParentCat()
-    }
-
-    /**
-     * @author LDD
-     * @From   CategoryFragment
-     * @Date   2018/1/29 下午8:44
-     * @Note   初始化子分类
-     */
-    private fun initRight(){
-        virtualLayoutManager =  VirtualLayoutManager(this.activity)
-        delegateAdapter = DelegateAdapter(virtualLayoutManager)
-        mViewDataBinding.categoryRightRv.layoutManager = virtualLayoutManager
-        mViewDataBinding.categoryRightRv.adapter = delegateAdapter
-    }
-
-    /**
-     * @Name  listViewAdapter
-     * @Type  ListViewBaseAdapter<ParentCategory, CategroyLeftItemBinding>
-     * @Note  父分类的适配器 单例 懒加载
-     */
-    private val listViewAdapter :ListViewBaseAdapter<ParentCategoryViewModel, CategroyLeftItemBinding> by lazy {
-        object: ListViewBaseAdapter<ParentCategoryViewModel, CategroyLeftItemBinding>(context,R.layout.categroy_left_item,leftViewData),AbsListView.OnScrollListener{
-
-            /**
-             * @Name  firstPostion
-             * @Type  int
-             * @Note  屏幕上显示的第一个item坐标
-             */
-            private var firstPostion = 0
-
-            /**
-             * 初始化时调用
-             */
-            init {
-                mViewDataBinding.categoryLeftLv.setOnScrollListener(this)
-            }
-
-            /**
-             * @author LDD
-             * @From   AbsListView.OnScrollListener
-             * @Date   2018/1/30 下午1:37
-             * @Note   滑动回调
-             */
-            override fun onScroll(view: AbsListView?, firstVisibleItem: Int, visibleItemCount: Int, totalItemCount: Int) {
-                firstPostion= firstVisibleItem
-            }
-
-            /**
-             * @author LDD
-             * @From   AbsListView.OnScrollListener
-             * @Date   2018/1/30 下午1:38
-             * @Note   滑动状态改变
-             */
-            override fun onScrollStateChanged(view: AbsListView?, scrollState: Int) {
-
-            }
-
-            /**
-             * @author LDD
-             * @From   CategoryFragment
-             * @Date   2018/1/30 下午1:38
-             * @Note   填充视图
-             * @param  binding  databinding
-             * @param  data     数据
-             * @param  position 坐标
-             */
-            override fun fillItem(binding: CategroyLeftItemBinding, data: ParentCategoryViewModel, position: Int) {
-                binding.itemData = data
-            }
-
-            /**
-             * @author LDD
-             * @From   CategoryFragment
-             * @Date   2018/1/30 下午1:39
-             * @Note   单击事件
-             * @param  data 数据
-             * @param  position 坐标
-             */
-            override fun itemClick(data: ParentCategoryViewModel, position: Int) {
-                for (i in 0 until leftViewData.size){
-                    if (i == position){
-                        leftViewData[i].selected.set(true)
-                        presenter.loadChildCat(leftViewData[i].parentId)
-                    }else{
-                        leftViewData[i].selected.set(false)
-                    }
-                }
-                scroll(position)
-            }
-
-            /**
-             * @author LDD
-             * @From   CategoryFragment
-             * @Date   2018/1/30 下午1:40
-             * @Note   重新调整item大小
-             * @param  convertView item
-             */
-            override fun reSize(convertView: View) {
-                convertView.layoutParams.height = ((ScreenTool.getScreenHeight(context)-ScreenTool.dip2px(context,50f))*0.87/9).toInt()
-                convertView.layoutParams.width = (ScreenTool.getScreenWidth(context)*0.23).toInt()
-            }
-
-            /**
-             * @author LDD
-             * @From   CategoryFragment
-             * @Date   2018/1/30 下午1:40
-             * @Note   滑动具体操作
-             * @param  position 需要滑动的position
-             */
-            private fun scroll(position:Int){
-                if (position < (firstPostion + 4)) {
-                    category_left_lv.post {
-                        category_left_lv.smoothScrollToPosition(position - 4 )
-                    }
-                } else {
-                    category_left_lv.post {
-                        category_left_lv.smoothScrollToPosition(position + 4 )
-                    }
-                }
-
-            }
-        }
-    }
-}

+ 0 - 346
home/src/main/code/com/wdkl/ncs/android/component/home/fragment/HomeFragment.kt

@@ -1,346 +0,0 @@
-package com.wdkl.ncs.android.component.home.fragment
-
-import android.support.constraint.ConstraintLayout
-import android.support.v7.widget.RecyclerView
-import android.view.View
-import com.alibaba.android.vlayout.DelegateAdapter
-import com.alibaba.android.vlayout.VirtualLayoutManager
-import com.wdkl.ncs.android.component.home.R
-import com.wdkl.ncs.android.component.home.activity.HomeActivity
-import com.wdkl.ncs.android.component.home.adapter.*
-import com.wdkl.ncs.android.component.home.agreement.FloorActionAgreement
-import com.wdkl.ncs.android.component.home.binding.HomeFragmentBindHelper
-import com.wdkl.ncs.android.component.home.databinding.HomeFragLayBinding
-import com.wdkl.ncs.android.component.home.launch.HomeLaunch
-import com.wdkl.ncs.android.lib.adapter.BaseDelegateAdapter
-import com.wdkl.ncs.android.lib.adapter.VlayoutItemType
-import com.wdkl.ncs.android.lib.base.BaseFragment
-import com.wdkl.ncs.android.lib.utils.*
-import com.wdkl.ncs.android.lib.vo.filter
-import com.wdkl.ncs.android.middleware.logic.contract.home.HomeFragmentContract
-import com.wdkl.ncs.android.middleware.logic.presenter.home.HomeFragmentPresenter
-import com.wdkl.ncs.android.middleware.model.*
-import com.enation.javashop.net.engine.model.NetState
-import com.enation.javashop.utils.base.tool.ScreenTool
-import com.google.gson.Gson
-import com.scwang.smartrefresh.layout.header.ClassicsHeader
-import kotlinx.android.synthetic.main.home_frag_lay.*
-import java.util.logging.Handler
-
-/**
- * @author LDD
- * @Date   2018/1/19 下午5:27
- * @From   com.wdkl.ncs.android.component.home.fragment
- * @Note   主页Fragment
- */
-class HomeFragment : BaseFragment<HomeFragmentPresenter,HomeFragLayBinding>(),HomeFragmentContract.View ,FloorActionAgreement{
-
-    /**
-     * @Name  adapterList
-     * @Type  ArrayList<DelegateAdapter.Adapter<*>>
-     * @Note  适配器列表
-     */
-    private var adapterList: ArrayList<DelegateAdapter.Adapter<*>> = ArrayList()
-
-    /**
-     * @Name  virtualLayoutManager
-     * @Type  VirtualLayoutManager
-     * @Note  VLayoutManager
-     */
-    private lateinit var virtualLayoutManager: VirtualLayoutManager
-
-    /**
-     * @Name  delegateAdapter
-     * @Type  DelegateAdapter
-     * @Note  七巧板适配器
-     */
-    private lateinit var delegateAdapter: DelegateAdapter
-
-    /**
-     * @Name  topbarHeight
-     * @Type  Int
-     * @Note  标题栏高度 为当前设备屏幕高度的13%
-     */
-    private var topbarHeight = 0
-
-    /**
-     * @author LDD
-     * @Date   2018/1/19 下午5:29
-     * @From   com.wdkl.ncs.android.component.home.fragment.HomeFragment
-     * @Note   databindingViewModel
-     */
-    private var bindHelper = HomeFragmentBindHelper()
-
-    /**
-     * @author LDD
-     * @From   HomeFragment
-     * @Date   2018/1/19 下午5:32
-     * @Note   提供layoutID
-     * @return layoutId
-     */
-    override fun getLayId(): Int {
-        return R.layout.home_frag_lay
-    }
-
-    /**
-     * @author LDD
-     * @From   HomeFragment
-     * @Date   2018/1/19 下午5:33
-     * @Note   初始化依赖注入
-     */
-    override fun bindDagger() {
-        HomeLaunch.component.inject(this)
-    }
-
-    /**
-     * @author LDD
-     * @From   HomeFragment
-     * @Date   2018/1/19 下午5:33
-     * @Note   初始化操作
-     */
-    override fun init() {
-        mViewDataBinding.homeData = bindHelper
-        mViewDataBinding.homeFragToolbarSearchLay.setOnClickListener(OnClickListenerAntiViolence({
-            push("/search/main")
-        }))
-        /**初始化列表*/
-        virtualLayoutManager = VirtualLayoutManager(this.activity)
-        delegateAdapter = DelegateAdapter(virtualLayoutManager)
-        mViewDataBinding.homeFragFloorView.layoutManager = virtualLayoutManager
-        mViewDataBinding.homeFragFloorView.adapter = delegateAdapter
-        /**为不同的Item设置不同的缓存*/
-        val viewPool = RecyclerView.RecycledViewPool()
-        viewPool.setMaxRecycledViews(1, 10)
-        viewPool.setMaxRecycledViews(2, 10)
-        viewPool.setMaxRecycledViews(3, 10)
-        viewPool.setMaxRecycledViews(4, 10)
-        viewPool.setMaxRecycledViews(5, 10)
-        viewPool.setMaxRecycledViews(6, 10)
-        viewPool.setMaxRecycledViews(7, 10)
-        viewPool.setMaxRecycledViews(8, 10)
-        viewPool.setMaxRecycledViews(9, 10)
-        viewPool.setMaxRecycledViews(10, 10)
-        viewPool.setMaxRecycledViews(11, 10)
-        viewPool.setMaxRecycledViews(12, 10)
-        viewPool.setMaxRecycledViews(13, 10)
-        mViewDataBinding.homeFragFloorView.recycledViewPool = viewPool
-        presenter.loadFloor()
-    }
-
-    /**
-     * @author LDD
-     * @From   HomeFragment
-     * @Date   2018/1/19 下午5:33
-     * @Note   绑定事件
-     */
-    override fun bindEvent() {
-        home_frag_toolbar_my_lay.setOnClickListener {
-            activity.to<HomeActivity>().toMember()
-        }
-        mViewDataBinding.homeFragFloorView.setOnScrollObserver { _, _, _, _ ->
-            val scrollY = virtualLayoutManager.getScollYDistance()
-            if (bindHelper.isHide.get() != scrollY <= topbarHeight){
-                bindHelper.isHide.set(scrollY <= topbarHeight)
-            }
-            bindHelper.scrollY.set(if(scrollY < 0) 0 else scrollY)
-        }
-        configRefresh()
-        home_frag_toolbar_scan_lay.setOnClickListener {
-            push("/extra/scan")
-        }
-    }
-
-    /**
-     * @author LDD
-     * @From   HomeFragment
-     * @Date   2018/1/19 下午5:34
-     * @Note   页面销毁回调
-     */
-    override fun destory() {
-        debugLog("HomeFragment","Destory")
-    }
-
-    /**
-     * @author LDD
-     * @From   HomeFragment
-     * @Date   2018/8/16 下午4:08
-     * @Note   渲染楼层
-     * @param  data  数据
-     */
-    override fun renderFloor(data: ArrayList<Any>) {
-        home_frag_tangram_refreshlayout.finishRefresh()
-        if (adapterList.count() > 0){
-            adapterList.filter {
-                return@filter it is FloorSecKillAdapter
-            }.getOrNull(0)?.to<FloorSecKillAdapter>()?.timer?.destory()
-        }
-        adapterList.clear()
-        adapterList.add(FloorBannerAdapter(this.weak(),data[0] as ArrayList<BannerModel>,this))
-        adapterList.add(FloorMenuAdapter(data[1] as ArrayList<FloorMenuModel>,this))
-        if (data[2].to<SecKillListViewModel>().text != ""){
-            adapterList.add(FloorSecKillAdapter(weak(),{
-                presenter.loadFloor()
-            }, data[4] as ArrayList<GoodsItemViewModel>, data[2] as SecKillListViewModel,if(data[3] is String){null}else{data[3] as SecKillListViewModel}))
-        }
-        for (i in 5..(data.count() - 1)){
-            val item = data[i] as FloorViewModel
-            if (item.typeId == 23){
-                adapterList.add(FloorSingleImageAdapter(item,this))
-            }else if (item.typeId == 24){
-                adapterList.add(FloorLeftOneRightTwoAdapter(item,this))
-            }else if (item.typeId == 25){
-                adapterList.add(FloorRightOneLeftTwoAdapter(item,this))
-            }else if (item.typeId == 26){
-                adapterList.add(FloorThreeImageAdapter(item,this))
-            }else if (item.typeId == 27){
-                adapterList.add(FloorFiveImageAdapter(item,this))
-            }else if (item.typeId == 28){
-                adapterList.add(FloorCornerBannerAdapter(this.weak(),ArrayList(item.mapBanner()),this))
-            }else if (item.typeId == 29){
-                adapterList.add(FloorFourImageAdapter(item,this))
-            }else if (item.typeId == 30){
-                adapterList.add(FloorTitleAdapter(item,this))
-            }else if (item.typeId == 31){
-                adapterList.add(FloorFourImageAdapter(item,this))
-            }else if (item.typeId == 32){
-                adapterList.add(FloorLeftRightAdapter(item,this))
-            }else if (item.typeId == 37){
-
-            }else if (item.typeId == 42){
-                adapterList.add(FloorTextAdapter(item,this))
-            }
-        }
-        delegateAdapter.clear()
-        delegateAdapter.addAdapters(adapterList)
-        delegateAdapter.notifyDataSetChanged()
-    }
-
-    override fun pointMall() {
-//        push("/promotion/pointshop/main")
-        push("/hello/main")
-    }
-
-    override fun secKill() {
-        //push("/promotion/seckill/main")
-    }
-
-    override fun groupMall() {
-        push("/promotion/groupbuy/main")
-    }
-
-    override fun couponHall() {
-        //push("/promotion/coupon/hall")
-        push("/hello/list")
-    }
-
-    override fun toShop(id: Int) {
-        push("/shop/detail",{postcard ->
-            postcard.withInt("shopId", id)
-        })
-    }
-
-    override fun toWeb(url: String) {
-        push("/common/web",{
-            //标题
-            it.withString("title","外部网页")
-            //URL
-            it.withString("url",url)
-        })
-    }
-
-    override fun searchGoodsForKeyWord(keyword: String) {
-        push("/goods/list",{
-            it.withString("keyword",keyword)
-            it.withString("hint",keyword)
-        })
-    }
-
-    override fun searchGoodsForCatrgory(catId: Int, text: String) {
-        push("/goods/list",{
-            it.withInt("category",catId)
-            it.withString("hint","搜索结果")
-        })
-    }
-
-    override fun goods(goodsId: Int) {
-        push("/goods/detail",{
-            it.withInt("goodsId",goodsId)
-        })
-    }
-
-    /**
-     * @author LDD
-     * @From   HomeFragment
-     * @Date   2018/1/19 下午5:35
-     * @Note   处理错误信息
-     * @param  message  错误信息
-     */
-    override fun onError(message: String, type: Int) {
-        getUtils().dismissDialog()
-        errorLog("error",message)
-        showMessage(message)
-    }
-
-    /**
-     * @author LDD
-     * @From   HomeFragment
-     * @Date   2018/1/19 下午5:36
-     * @Note   操作完成
-     * @param  message 完成信息
-     */
-    override fun complete(message: String, type: Int) {
-        getUtils().dismissDialog()
-    }
-
-    /**
-     * @author LDD
-     * @From   HomeFragment
-     * @Date   2018/1/19 下午5:37
-     * @Note   耗时加载开始
-     */
-    override fun start() {
-        getUtils().showDialog()
-    }
-
-    /**
-     * @author LDD
-     * @From   HomeFragment
-     * @Date   2018/1/19 下午5:37
-     * @Note   配置刷新监听处理
-     */
-    private fun configRefresh(){
-        mViewDataBinding.homeFragTangramRefreshlayout.setHeaderHeight((ScreenTool.getScreenWidth(activity) * 0.5).pxToDp().toFloat())
-        mViewDataBinding.homeFragTangramRefreshlayout.setRefreshHeader(ClassicsHeader(activity))
-        mViewDataBinding.homeFragTangramRefreshlayout.setOnMultiPurposeListener(SmartHideViewHelper({
-            home_frag_toolbar.visibility = View.GONE
-            home_frag_floor_view.setOnTouchListener { _, _ ->
-                true
-            }
-        }, {
-            home_frag_toolbar.visibility = View.VISIBLE
-            home_frag_floor_view.setOnTouchListener { _, _ ->
-                false
-            }
-        }))
-        mViewDataBinding.homeFragTangramRefreshlayout.setOnRefreshListener {
-            presenter.loadFloor()
-        }
-    }
-
-    /**
-     * @author LDD
-     * @From   HomeFragment
-     * @Date   2018/1/19 下午5:39
-     * @Note   处理网络状态
-     * @param  state 网络状态
-     */
-    override fun networkMonitor(state: NetState) {
-        state.filter(onWifi = {
-
-        },onMobile = {
-
-        },offline = {
-
-        })
-    }
-}

+ 0 - 27
home/src/main/code/com/wdkl/ncs/android/component/home/launch/HomeLaunch.kt

@@ -1,27 +0,0 @@
-package com.wdkl.ncs.android.component.home.launch
-
-import com.wdkl.ncs.android.component.home.di.DaggerHomeComponent
-import com.wdkl.ncs.android.component.home.di.HomeComponent
-import com.enation.javashop.android.jrouter.external.annotation.Router
-import com.wdkl.ncs.android.lib.base.BaseLaunch
-import com.wdkl.ncs.android.middleware.di.DaggerManager
-
-/**
- * @author LDD
- * @Date   2018/1/22 下午2:44
- * @From   com.wdkl.ncs.android.component.home.launch
- * @Note   home模块启动类 代替Application 在壳工程Application中反射调用
- */
-@Router(path = "/home/launch")
-class HomeLaunch : BaseLaunch() {
-    companion object {
-        lateinit var component:HomeComponent
-    }
-
-    override fun moduleInit() {
-        component = DaggerHomeComponent.builder()
-                .applicationComponent(DaggerManager.APPLICATION_COMPONENT)
-                .build()
-    }
-
-}

+ 0 - 20
home/src/main/res/layout/banner_corner_image_lay.xml

@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<android.support.constraint.ConstraintLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    xmlns:app="http://schemas.android.com/apk/res-auto">
-    <android.support.v7.widget.CardView
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        app:cardCornerRadius="10dp"
-        android:background="@color/color_white"
-        >
-        <ImageView
-            android:id="@+id/image"
-            android:scaleType="centerCrop"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"/>
-    </android.support.v7.widget.CardView>
-
-</android.support.constraint.ConstraintLayout>

+ 0 - 14
home/src/main/res/layout/banner_image_lay.xml

@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<android.support.constraint.ConstraintLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    xmlns:app="http://schemas.android.com/apk/res-auto">
-
-        <ImageView
-            android:id="@+id/image"
-            android:scaleType="centerCrop"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"/>
-
-</android.support.constraint.ConstraintLayout>

+ 0 - 137
home/src/main/res/layout/category_frag_lay.xml

@@ -1,137 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<layout xmlns:app="http://schemas.android.com/apk/res-auto"
-        xmlns:bind="http://schemas.android.com/apk/res-auto"
-        xmlns:tools="http://schemas.android.com/tools">
-<android.support.constraint.ConstraintLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-    <android.support.constraint.ConstraintLayout
-        android:id="@+id/cayegory_frag_topbar"
-        android:layout_width="match_parent"
-        android:layout_height="0dp"
-        bind:auto_topbar_height="@{true}"
-        bind:backgroundColor="@{@color/javashop_color_common_topbar_bg}"
-        app:layout_constraintLeft_toLeftOf="parent"
-        app:layout_constraintTop_toTopOf="parent"
-        app:layout_constraintRight_toRightOf="parent"
-        >
-        <View
-            android:id="@+id/category_frag_toolbar_holder"
-            android:layout_width="0dp"
-            android:layout_height="0dp"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintTop_toTopOf="parent"
-            bind:status_bar="@{1}"
-            android:background="@color/javashop_color_holder_color"
-            />
-        <ImageView
-            android:id="@+id/category_frag_scan_iv"
-            android:layout_width="0dp"
-            android:layout_height="0dp"
-            android:src="@drawable/javashop_category_scan"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintDimensionRatio="w,1:1"
-            app:layout_constraintHeight_default="percent"
-            app:layout_constraintHeight_percent="0.3"
-            app:layout_constraintTop_toBottomOf="@id/category_frag_toolbar_holder"
-            app:layout_constraintBottom_toBottomOf="parent"
-            android:layout_marginLeft="10dp"
-            />
-        <ImageView
-            android:id="@+id/category_frag_my_iv"
-            android:layout_width="0dp"
-            android:src="@drawable/javashop_category_my"
-            android:layout_height="0dp"
-            app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintDimensionRatio="w,1:1"
-            app:layout_constraintHeight_default="percent"
-            app:layout_constraintHeight_percent="0.35"
-            app:layout_constraintTop_toBottomOf="@id/category_frag_toolbar_holder"
-            app:layout_constraintBottom_toBottomOf="parent"
-            android:layout_marginRight="10dp"
-            />
-        <android.support.constraint.ConstraintLayout
-            android:id="@+id/category_search_lay"
-            android:layout_width="0dp"
-            android:layout_height="0dp"
-            android:layout_marginLeft="10dp"
-            android:layout_marginRight="10dp"
-            app:layout_constraintTop_toBottomOf="@id/category_frag_toolbar_holder"
-            app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintLeft_toRightOf="@id/category_frag_scan_iv"
-            app:layout_constraintRight_toLeftOf="@id/category_frag_my_iv"
-            android:background="@drawable/javashop_search_bg"
-            app:layout_constraintHeight_default="percent"
-            app:layout_constraintHeight_percent="0.45"
-            >
-            <ImageView
-                android:layout_width="0dp"
-                android:layout_height="0dp"
-                android:layout_marginLeft="5dp"
-                app:layout_constraintHeight_default="percent"
-                app:layout_constraintHeight_percent="0.6"
-                app:layout_constraintLeft_toLeftOf="parent"
-                app:layout_constraintTop_toTopOf="parent"
-                app:layout_constraintBottom_toBottomOf="parent"
-                app:layout_constraintDimensionRatio="w,1:1"
-                android:src="@drawable/javashop_category_search_find"
-                />
-
-            <TextView
-                android:layout_width="0dp"
-                android:layout_height="0dp"
-                android:ellipsize="end"
-                android:gravity="center_vertical"
-                android:lines="1"
-                android:paddingBottom="5dp"
-                android:paddingTop="5dp"
-                android:text="请输入你想搜索的关键词"
-                android:textColor="@color/javashop_color_search_tc"
-                app:autoSizeMaxTextSize="20sp"
-                app:autoSizeMinTextSize="1sp"
-                app:autoSizeStepGranularity="2sp"
-                app:autoSizeTextType="uniform"
-                app:layout_constraintBottom_toBottomOf="parent"
-                app:layout_constraintLeft_toLeftOf="parent"
-                app:layout_constraintRight_toRightOf="parent"
-                app:layout_constraintTop_toTopOf="parent"
-                app:layout_constraintWidth_default="percent"
-                app:layout_constraintWidth_percent="0.75"
-                tools:ignore="MissingPrefix"
-                />
-        </android.support.constraint.ConstraintLayout>
-        <View style="@style/gray_line"
-              app:layout_constraintBottom_toBottomOf="parent"/>
-    </android.support.constraint.ConstraintLayout>
-    <ListView
-        android:id="@+id/category_left_lv"
-        android:layout_width="0dp"
-        android:layout_height="0dp"
-        app:layout_constraintLeft_toLeftOf="parent"
-        app:layout_constraintTop_toBottomOf="@id/cayegory_frag_topbar"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintWidth_default="percent"
-        app:layout_constraintWidth_percent="0.23"
-        android:scrollbars="none"
-        android:dividerHeight="1px"
-        android:background="@color/javashop_color_category_left_lv"
-        >
-    </ListView>
-    <android.support.v7.widget.RecyclerView
-        android:id="@+id/category_right_rv"
-        android:layout_width="0dp"
-        android:layout_height="0dp"
-        app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintTop_toBottomOf="@id/cayegory_frag_topbar"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintWidth_default="percent"
-        app:layout_constraintWidth_percent="0.77"
-        android:background="@color/javashop_color_category_rv_bg"
-        android:paddingLeft="10dp"
-        android:paddingRight="10dp"
-        >
-    </android.support.v7.widget.RecyclerView>
-</android.support.constraint.ConstraintLayout>
-</layout>

+ 0 - 36
home/src/main/res/layout/category_parent_item.xml

@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<layout>
-    <data>
-        <variable
-            name="name"
-            type="String"/>
-    </data>
-<android.support.constraint.ConstraintLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
-    xmlns:tools="http://schemas.android.com/tools">
-
-    <TextView
-        android:id="@+id/category_parent_item_tv"
-        android:layout_width="0dp"
-        android:layout_height="0dp"
-        android:gravity="center_vertical"
-        android:textColor="@color/javashop_color_category_parent_tc"
-        android:layout_margin="2dp"
-        app:autoSizeMaxTextSize="100sp"
-        app:autoSizeMinTextSize="1sp"
-        app:autoSizeStepGranularity="2sp"
-        android:text="@{name}"
-        app:autoSizeTextType="uniform"
-        tools:ignore="MissingPrefix"
-        app:layout_constraintTop_toTopOf="parent"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintWidth_default="percent"
-        app:layout_constraintHeight_default="percent"
-        app:layout_constraintWidth_percent="1"
-        app:layout_constraintHeight_percent="0.5"
-        />
-</android.support.constraint.ConstraintLayout>
-</layout>

+ 0 - 53
home/src/main/res/layout/categroy_child_item.xml

@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<layout>
-    <data>
-        <variable
-            name="data"
-            type="com.wdkl.ncs.android.middleware.model.ChildCategoryViewModel"/>
-    </data>
-<android.support.constraint.ConstraintLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:background="@color/javashop_color_category_child_bg"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
-    xmlns:bind="http://schemas.android.com/apk/res-auto"
-    xmlns:tools="http://schemas.android.com/tools">
-    <ImageView
-        android:id="@+id/category_child_item_iv"
-        android:layout_width="0dp"
-        android:layout_height="0dp"
-        android:scaleType="centerCrop"
-        android:layout_marginTop="10dp"
-        app:layout_constraintTop_toTopOf="parent"
-        app:layout_constraintLeft_toLeftOf="parent"
-        app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintWidth_default="percent"
-        app:layout_constraintWidth_percent="0.8"
-        app:layout_constraintDimensionRatio="h,1:1"
-        bind:url="@{data.imageUrl}"
-        />
-    <TextView
-        android:id="@+id/category_child_item_tv"
-        android:layout_width="0dp"
-        android:layout_height="0dp"
-        android:gravity="center"
-        android:textColor="@color/javashop_color_category_child_tc"
-        android:layout_margin="2dp"
-        app:autoSizeMaxTextSize="100sp"
-        app:autoSizeMinTextSize="1sp"
-        app:autoSizeStepGranularity="2sp"
-        app:autoSizeTextType="uniform"
-        tools:ignore="MissingPrefix"
-        android:text="@{data.name}"
-        app:layout_constraintTop_toBottomOf="@id/category_child_item_iv"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintLeft_toLeftOf="parent"
-        app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintWidth_default="percent"
-        app:layout_constraintWidth_percent="1"
-        app:layout_constraintDimensionRatio="h,4.65:1"
-        app:layout_constraintVertical_bias="0.2"
-        />
-</android.support.constraint.ConstraintLayout>
-</layout>

+ 0 - 36
home/src/main/res/layout/categroy_left_item.xml

@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<layout>
-    <data>
-        <variable
-            name="itemData"
-            type="com.wdkl.ncs.android.middleware.model.ParentCategoryViewModel"/>
-    </data>
-<android.support.constraint.ConstraintLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:background="@{itemData.selected.get() ? @drawable/javashop_category_left_item_select_bg : @drawable/javashop_category_left_item_nomal_bg}"
-    android:layout_height="50dp"
-    android:layout_width="match_parent"
-    >
-    <TextView
-        android:layout_width="0dp"
-        android:layout_height="0dp"
-        app:layout_constraintLeft_toLeftOf="parent"
-        app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintTop_toTopOf="parent"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:autoSizeMaxTextSize="100sp"
-        app:autoSizeMinTextSize="1sp"
-        app:autoSizeStepGranularity="2sp"
-        app:autoSizeTextType="uniform"
-        tools:ignore="MissingPrefix"
-        android:text="@{itemData.bind_name.get()}"
-        android:gravity="center"
-        android:textColor="@{itemData.selected.get() ? @color/javashop_color_category_left_item_select_tc : @color/javashop_color_category_left_item_nomal_tc}"
-        app:layout_constraintWidth_default="percent"
-        app:layout_constraintWidth_percent="1"
-        app:layout_constraintDimensionRatio="h,4.5:1"
-        />
-</android.support.constraint.ConstraintLayout>
-</layout>

+ 0 - 18
home/src/main/res/layout/floor_corner_item_banner_lay.xml

@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<layout xmlns:app="http://schemas.android.com/apk/res-auto">
-    <LinearLayout
-        xmlns:android="http://schemas.android.com/apk/res/android"
-        android:orientation="horizontal"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent">
-        <com.zhouwei.mzbanner.MZBannerView
-            android:id="@+id/banner"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            app:open_mz_mode="false"
-            app:canLoop="true"
-            app:indicatorAlign="center"
-            app:indicatorPaddingTop="10dp"
-            />
-    </LinearLayout>
-</layout>

+ 0 - 18
home/src/main/res/layout/floor_item_banner_lay.xml

@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<layout xmlns:app="http://schemas.android.com/apk/res-auto">
-    <LinearLayout
-        xmlns:android="http://schemas.android.com/apk/res/android"
-        android:orientation="horizontal"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent">
-        <com.zhouwei.mzbanner.MZBannerView
-            android:id="@+id/banner"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            app:open_mz_mode="false"
-            app:canLoop="true"
-            app:indicatorAlign="center"
-            app:indicatorPaddingTop="10dp"
-            />
-    </LinearLayout>
-</layout>

+ 0 - 46
home/src/main/res/layout/floor_item_five_image_lay.xml

@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<layout>
-    <LinearLayout
-        android:orientation="horizontal"
-        xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="match_parent"
-        xmlns:bind="http://schemas.android.com/apk/res-auto"
-        android:layout_height="match_parent">
-        <ImageView
-            android:id="@+id/imageA"
-            android:layout_width="0dp"
-            android:layout_height="match_parent"
-            android:scaleType="fitXY"
-            android:layout_weight="1"
-            />
-        <ImageView
-            android:id="@+id/imageB"
-            android:layout_weight="1"
-            android:layout_width="0dp"
-            android:layout_height="match_parent"
-            android:scaleType="fitXY"
-            />
-        <ImageView
-            android:id="@+id/imageC"
-            android:layout_weight="1"
-            android:layout_width="0dp"
-            android:layout_height="match_parent"
-            android:scaleType="centerCrop"
-            />
-        <ImageView
-            android:id="@+id/imageD"
-            android:layout_weight="1"
-            android:layout_width="0dp"
-            android:layout_height="match_parent"
-            android:scaleType="fitXY"
-            />
-        <ImageView
-            android:id="@+id/imageE"
-            android:layout_weight="1"
-            android:src="@drawable/image_error"
-            android:layout_width="0dp"
-            android:layout_height="match_parent"
-            android:scaleType="fitXY"
-            />
-    </LinearLayout>
-</layout>

+ 0 - 38
home/src/main/res/layout/floor_item_four_image_lay.xml

@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<layout>
-    <LinearLayout
-        android:orientation="horizontal"
-        xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="match_parent"
-        xmlns:bind="http://schemas.android.com/apk/res-auto"
-        android:layout_height="match_parent">
-        <ImageView
-            android:id="@+id/imageA"
-            android:layout_width="0dp"
-            android:layout_height="match_parent"
-            android:scaleType="fitXY"
-            android:layout_weight="1"
-            />
-        <ImageView
-            android:id="@+id/imageB"
-            android:layout_weight="1"
-            android:layout_width="0dp"
-            android:layout_height="match_parent"
-            android:scaleType="fitXY"
-            />
-        <ImageView
-            android:id="@+id/imageC"
-            android:layout_weight="1"
-            android:layout_width="0dp"
-            android:layout_height="match_parent"
-            android:scaleType="fitXY"
-            />
-        <ImageView
-            android:id="@+id/imageD"
-            android:layout_weight="1"
-            android:layout_width="0dp"
-            android:layout_height="match_parent"
-            android:scaleType="fitXY"
-            />
-    </LinearLayout>
-</layout>

+ 0 - 31
home/src/main/res/layout/floor_item_left_right_lay.xml

@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<layout>
-    <LinearLayout
-        android:orientation="horizontal"
-        xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="match_parent"
-        xmlns:bind="http://schemas.android.com/apk/res-auto"
-        android:layout_height="match_parent">
-        <ImageView
-            android:id="@+id/imageA"
-            android:layout_width="0dp"
-            android:layout_height="match_parent"
-            android:scaleType="fitXY"
-            android:layout_weight="0.5"
-            />
-        <ImageView
-            android:id="@+id/imageB"
-            android:layout_width="0dp"
-            android:layout_height="match_parent"
-            android:scaleType="fitXY"
-            android:layout_weight="0.25"
-            />
-        <ImageView
-            android:id="@+id/imageC"
-            android:layout_width="0dp"
-            android:layout_height="match_parent"
-            android:scaleType="fitXY"
-            android:layout_weight="0.25"
-            />
-    </LinearLayout>
-</layout>

+ 0 - 39
home/src/main/res/layout/floor_item_lone_rtwo_image_lay.xml

@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<layout>
-    <LinearLayout
-        android:orientation="horizontal"
-        xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="match_parent"
-        xmlns:bind="http://schemas.android.com/apk/res-auto"
-        android:layout_height="match_parent">
-        <ImageView
-            android:id="@+id/imageA"
-            android:layout_width="0dp"
-            android:layout_height="match_parent"
-            android:scaleType="fitXY"
-            android:layout_weight="1"
-            />
-        <LinearLayout
-            android:layout_weight="1"
-            android:layout_width="0dp"
-            android:layout_height="match_parent"
-            android:orientation="vertical"
-            >
-            <ImageView
-                android:id="@+id/imageB"
-                android:layout_weight="1"
-                android:layout_width="match_parent"
-                android:layout_height="0dp"
-                android:scaleType="fitXY"
-                />
-            <ImageView
-                android:id="@+id/imageC"
-                android:layout_weight="1"
-                android:layout_width="match_parent"
-                android:layout_height="0dp"
-                android:scaleType="fitXY"
-                />
-        </LinearLayout>
-
-    </LinearLayout>
-</layout>

+ 0 - 38
home/src/main/res/layout/floor_item_ltwo_rone_image_lay.xml

@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<layout>
-    <LinearLayout
-        android:orientation="horizontal"
-        xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="match_parent"
-        xmlns:bind="http://schemas.android.com/apk/res-auto"
-        android:layout_height="match_parent">
-        <LinearLayout
-            android:layout_weight="1"
-            android:layout_width="0dp"
-            android:layout_height="match_parent"
-            android:orientation="vertical"
-            >
-            <ImageView
-                android:id="@+id/imageA"
-                android:layout_weight="1"
-                android:layout_width="match_parent"
-                android:layout_height="0dp"
-                android:scaleType="fitXY"
-                />
-            <ImageView
-                android:id="@+id/imageB"
-                android:layout_weight="1"
-                android:layout_width="match_parent"
-                android:layout_height="0dp"
-                android:scaleType="fitXY"
-                />
-        </LinearLayout>
-        <ImageView
-            android:id="@+id/imageC"
-            android:layout_width="0dp"
-            android:layout_height="match_parent"
-            android:scaleType="fitXY"
-            android:layout_weight="1"
-            />
-    </LinearLayout>
-</layout>

+ 0 - 25
home/src/main/res/layout/floor_item_menu_lay.xml

@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<layout>
-    <LinearLayout
-        android:orientation="vertical"
-        xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="match_parent"
-        android:layout_height="150dp">
-        <LinearLayout
-            android:id="@+id/menu_a"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_weight="1"
-            android:orientation="horizontal"
-            >
-        </LinearLayout>
-        <LinearLayout
-            android:id="@+id/menu_b"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_weight="1"
-            android:orientation="horizontal"
-            >
-        </LinearLayout>
-    </LinearLayout>
-</layout>

+ 0 - 488
home/src/main/res/layout/floor_item_seckill_lay.xml

@@ -1,488 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<layout>
-    <android.support.constraint.ConstraintLayout
-        xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="match_parent"
-        android:layout_height="160dp"
-        xmlns:app="http://schemas.android.com/apk/res-auto"
-        xmlns:tools="http://schemas.android.com/tools"
-        android:background="@drawable/javashop_corners_common"
-        >
-        <ImageView
-            android:id="@+id/logo"
-            android:layout_width="0dp"
-            android:layout_height="0dp"
-            app:layout_constraintHeight_percent="0.135"
-            app:layout_constraintWidth_percent="0.2"
-            app:layout_constraintTop_toTopOf="parent"
-            app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintVertical_bias="0.07"
-            android:paddingTop="3dp"
-            android:paddingBottom="3dp"
-            android:layout_marginLeft="5dp"
-            app:layout_constraintHorizontal_bias="0"
-            android:src="@drawable/javashop_icon_seckill_black"
-            />
-        <android.support.constraint.ConstraintLayout
-            android:layout_width="0dp"
-            android:layout_height="0dp"
-            app:layout_constraintWidth_percent="0.35"
-            android:layout_marginRight="5dp"
-            app:layout_constraintRight_toRightOf="parent"
-            android:paddingRight="5dp"
-            app:layout_constraintTop_toTopOf="@id/logo"
-            app:layout_constraintBottom_toBottomOf="@id/logo"
-            android:background="@drawable/javashop_fillet_red_big_bg"
-            >
-            <TextView
-                android:id="@+id/sec_tv"
-                android:layout_width="0dp"
-                android:layout_height="0dp"
-                android:background="@color/transparent"
-                app:layout_constraintTop_toTopOf="parent"
-                app:layout_constraintBottom_toBottomOf="parent"
-                app:layout_constraintLeft_toLeftOf="parent"
-                app:layout_constraintRight_toRightOf="parent"
-                app:layout_constraintHeight_percent="9"
-                app:layout_constraintDimensionRatio="w,1:1"
-                app:layout_constraintHorizontal_bias="1"
-                android:textColor="#ff4e5a"
-                android:gravity="center"
-                android:text="00"
-                style="@style/auto_text_size"
-                android:textStyle="bold"
-                app:autoSizeMaxTextSize="25sp"
-                app:autoSizeMinTextSize="1sp"
-                app:autoSizeStepGranularity="2sp"
-                app:autoSizeTextType="uniform"
-                tools:ignore="MissingPrefix"
-                />
-
-            <TextView
-                android:id="@+id/colon_a"
-                android:layout_width="0dp"
-                android:layout_height="0dp"
-                app:layout_constraintTop_toTopOf="@id/sec_tv"
-                app:layout_constraintBottom_toBottomOf="@id/sec_tv"
-                app:layout_constraintWidth_percent="0.02"
-                app:layout_constraintRight_toLeftOf="@id/sec_tv"
-                android:textColor="#ff4e5a"
-                android:text=":"
-                android:gravity="center"
-                style="@style/auto_text_size"
-                android:textStyle="bold"
-                app:autoSizeMaxTextSize="25sp"
-                app:autoSizeMinTextSize="1sp"
-                app:autoSizeStepGranularity="2sp"
-                app:autoSizeTextType="uniform"
-                tools:ignore="MissingPrefix"
-                />
-
-            <TextView
-                android:id="@+id/min_tv"
-                android:layout_width="0dp"
-                android:layout_height="0dp"
-                app:layout_constraintTop_toTopOf="@id/sec_tv"
-                app:layout_constraintBottom_toBottomOf="@id/sec_tv"
-                app:layout_constraintDimensionRatio="w,1:1"
-                app:layout_constraintRight_toLeftOf="@id/colon_a"
-                android:textColor="#ff4e5a"
-                android:background="@color/transparent"
-                android:gravity="center"
-                android:text="00"
-                style="@style/auto_text_size"
-                android:textStyle="bold"
-                android:visibility="visible"
-                app:autoSizeMaxTextSize="25sp"
-                app:autoSizeMinTextSize="1sp"
-                app:autoSizeStepGranularity="2sp"
-                app:autoSizeTextType="uniform"
-                tools:ignore="MissingPrefix"
-                />
-
-            <TextView
-                android:id="@+id/colon_b"
-                android:layout_width="0dp"
-                android:layout_height="0dp"
-                app:layout_constraintTop_toTopOf="@id/sec_tv"
-                app:layout_constraintBottom_toBottomOf="@id/sec_tv"
-                app:layout_constraintWidth_percent="0.02"
-                app:layout_constraintRight_toLeftOf="@id/min_tv"
-                android:textColor="#ff4e5a"
-                android:text=":"
-                android:gravity="center"
-                style="@style/auto_text_size"
-                android:textStyle="bold"
-                app:autoSizeMaxTextSize="25sp"
-                app:autoSizeMinTextSize="1sp"
-                app:autoSizeStepGranularity="2sp"
-                app:autoSizeTextType="uniform"
-                tools:ignore="MissingPrefix"
-                />
-
-            <TextView
-                android:id="@+id/hour_tv"
-                android:layout_width="0dp"
-                android:layout_height="0dp"
-                app:layout_constraintTop_toTopOf="@id/sec_tv"
-                app:layout_constraintBottom_toBottomOf="@id/sec_tv"
-                app:layout_constraintDimensionRatio="w,1:1"
-                app:layout_constraintRight_toLeftOf="@id/colon_b"
-                android:textColor="#ff4e5a"
-                android:background="@color/transparent"
-                android:gravity="center"
-                style="@style/auto_text_size"
-                android:visibility="visible"
-                android:text="00"
-                android:textStyle="bold"
-                app:autoSizeMaxTextSize="25sp"
-                app:autoSizeMinTextSize="1sp"
-                app:autoSizeStepGranularity="2sp"
-                app:autoSizeTextType="uniform"
-                tools:ignore="MissingPrefix"
-                />
-            <TextView
-                android:id="@+id/title"
-                android:text="10点场"
-                android:paddingLeft="2dp"
-                android:paddingRight="2dp"
-                android:paddingTop="1dp"
-                android:paddingBottom="1dp"
-                android:textStyle="bold"
-                android:gravity="center"
-                style="@style/auto_text_size"
-                app:autoSizeMaxTextSize="100sp"
-                app:autoSizeMinTextSize="1sp"
-                app:autoSizeStepGranularity="2sp"
-                app:autoSizeTextType="uniform"
-                tools:ignore="MissingPrefix"
-                android:textColor="@color/color_white"
-                android:layout_height="0dp"
-                android:layout_width="0dp"
-                app:layout_constraintHeight_percent="1"
-                app:layout_constraintRight_toRightOf="parent"
-                app:layout_constraintLeft_toLeftOf="parent"
-                app:layout_constraintBottom_toBottomOf="parent"
-                app:layout_constraintTop_toTopOf="parent"
-                app:layout_constraintHorizontal_bias="0"
-                app:layout_constraintDimensionRatio="w,2.5:1"
-                android:background="@drawable/javashop_corners_red_left"
-                />
-        </android.support.constraint.ConstraintLayout>
-        <LinearLayout
-            android:layout_width="0dp"
-            android:layout_height="0dp"
-            android:orientation="horizontal"
-            android:layout_marginTop="10dp"
-            android:paddingLeft="5dp"
-            android:paddingRight="5dp"
-            app:layout_constraintTop_toBottomOf="@id/logo"
-            app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintRight_toRightOf="parent"
-            >
-            <android.support.constraint.ConstraintLayout
-                android:layout_width="0dp"
-                android:layout_height="match_parent"
-                android:layout_weight="1"
-                android:id="@+id/goods1"
-                >
-                <ImageView
-                    android:id="@+id/image1"
-                    android:layout_width="0dp"
-                    android:layout_height="0dp"
-                    app:layout_constraintTop_toTopOf="parent"
-                    app:layout_constraintLeft_toLeftOf="parent"
-                    app:layout_constraintRight_toRightOf="parent"
-                    app:layout_constraintBottom_toBottomOf="parent"
-                    app:layout_constraintWidth_percent="0.9"
-                    app:layout_constraintDimensionRatio="h,1:1"
-                    app:layout_constraintVertical_bias="0"
-                    android:src="@mipmap/ic_launcher"
-                    android:scaleType="centerCrop"
-                    />
-                <TextView
-                    android:id="@+id/org_price1"
-                    android:layout_width="0dp"
-                    android:layout_height="0dp"
-                    app:layout_constraintHeight_percent="0.135"
-                    android:gravity="center"
-                    app:layout_constraintLeft_toLeftOf="parent"
-                    app:layout_constraintRight_toRightOf="parent"
-                    app:layout_constraintBottom_toBottomOf="parent"
-                    style="@style/auto_text_size"
-                    android:textStyle="bold"
-                    app:autoSizeMaxTextSize="25sp"
-                    app:autoSizeMinTextSize="1sp"
-                    android:layout_marginBottom="5dp"
-                    app:autoSizeStepGranularity="2sp"
-                    app:autoSizeTextType="uniform"
-                    tools:ignore="MissingPrefix"
-                    android:textColor="#c0c0c1"
-                    android:text="¥4678"
-                    />
-                <TextView
-                    android:id="@+id/price1"
-                    android:layout_width="0dp"
-                    android:layout_height="0dp"
-                    android:gravity="center"
-                    app:layout_constraintLeft_toLeftOf="parent"
-                    app:layout_constraintRight_toRightOf="parent"
-                    app:layout_constraintBottom_toTopOf="@id/org_price1"
-                    app:layout_constraintTop_toBottomOf="@id/image1"
-                    style="@style/auto_text_size"
-                    android:textStyle="bold"
-                    app:autoSizeMaxTextSize="25sp"
-                    app:autoSizeMinTextSize="1sp"
-                    app:autoSizeStepGranularity="2sp"
-                    app:autoSizeTextType="uniform"
-                    tools:ignore="MissingPrefix"
-                    android:textColor="@color/javashop_color_navy"
-                    android:text="¥4678"
-                    />
-            </android.support.constraint.ConstraintLayout>
-            <android.support.constraint.ConstraintLayout
-                android:layout_width="0dp"
-                android:layout_height="match_parent"
-                android:layout_weight="1"
-                android:id="@+id/goods2"
-                >
-                <ImageView
-                    android:id="@+id/image2"
-                    android:layout_width="0dp"
-                    android:layout_height="0dp"
-                    app:layout_constraintTop_toTopOf="parent"
-                    app:layout_constraintLeft_toLeftOf="parent"
-                    app:layout_constraintRight_toRightOf="parent"
-                    app:layout_constraintBottom_toBottomOf="parent"
-                    app:layout_constraintWidth_percent="0.9"
-                    app:layout_constraintDimensionRatio="h,1:1"
-                    app:layout_constraintVertical_bias="0"
-                    android:src="@mipmap/ic_launcher"
-                    android:scaleType="centerCrop"
-                    />
-                <TextView
-                    android:id="@+id/org_price2"
-                    android:layout_width="0dp"
-                    android:layout_height="0dp"
-                    app:layout_constraintHeight_percent="0.135"
-                    android:gravity="center"
-                    app:layout_constraintLeft_toLeftOf="parent"
-                    app:layout_constraintRight_toRightOf="parent"
-                    app:layout_constraintBottom_toBottomOf="parent"
-                    style="@style/auto_text_size"
-                    android:textStyle="bold"
-                    app:autoSizeMaxTextSize="25sp"
-                    app:autoSizeMinTextSize="1sp"
-                    app:autoSizeStepGranularity="2sp"
-                    app:autoSizeTextType="uniform"
-                    tools:ignore="MissingPrefix"
-                    android:textColor="#c0c0c1"
-                    android:layout_marginBottom="5dp"
-                    android:text="¥4678"
-                    />
-                <TextView
-                    android:id="@+id/price2"
-                    android:layout_width="0dp"
-                    android:layout_height="0dp"
-                    android:gravity="center"
-                    app:layout_constraintLeft_toLeftOf="parent"
-                    app:layout_constraintRight_toRightOf="parent"
-                    app:layout_constraintBottom_toTopOf="@id/org_price2"
-                    app:layout_constraintTop_toBottomOf="@id/image2"
-                    style="@style/auto_text_size"
-                    android:textStyle="bold"
-                    app:autoSizeMaxTextSize="25sp"
-                    app:autoSizeMinTextSize="1sp"
-                    app:autoSizeStepGranularity="2sp"
-                    app:autoSizeTextType="uniform"
-                    tools:ignore="MissingPrefix"
-                    android:textColor="@color/javashop_color_navy"
-                    android:text="¥4678"
-                    />
-            </android.support.constraint.ConstraintLayout>
-            <android.support.constraint.ConstraintLayout
-                android:layout_width="0dp"
-                android:layout_height="match_parent"
-                android:layout_weight="1"
-                android:id="@+id/goods3"
-                >
-                <ImageView
-                    android:id="@+id/image3"
-                    android:layout_width="0dp"
-                    android:layout_height="0dp"
-                    app:layout_constraintTop_toTopOf="parent"
-                    app:layout_constraintLeft_toLeftOf="parent"
-                    app:layout_constraintRight_toRightOf="parent"
-                    app:layout_constraintBottom_toBottomOf="parent"
-                    app:layout_constraintWidth_percent="0.9"
-                    app:layout_constraintDimensionRatio="h,1:1"
-                    app:layout_constraintVertical_bias="0"
-                    android:src="@mipmap/ic_launcher"
-                    android:scaleType="centerCrop"
-                    />
-                <TextView
-                    android:id="@+id/org_price3"
-                    android:layout_width="0dp"
-                    android:layout_height="0dp"
-                    app:layout_constraintHeight_percent="0.135"
-                    android:gravity="center"
-                    app:layout_constraintLeft_toLeftOf="parent"
-                    app:layout_constraintRight_toRightOf="parent"
-                    app:layout_constraintBottom_toBottomOf="parent"
-                    style="@style/auto_text_size"
-                    android:textStyle="bold"
-                    app:autoSizeMaxTextSize="25sp"
-                    app:autoSizeMinTextSize="1sp"
-                    app:autoSizeStepGranularity="2sp"
-                    app:autoSizeTextType="uniform"
-                    tools:ignore="MissingPrefix"
-                    android:textColor="#c0c0c1"
-                    android:layout_marginBottom="5dp"
-                    android:text="¥4678"
-                    />
-                <TextView
-                    android:id="@+id/price3"
-                    android:layout_width="0dp"
-                    android:layout_height="0dp"
-                    android:gravity="center"
-                    app:layout_constraintLeft_toLeftOf="parent"
-                    app:layout_constraintRight_toRightOf="parent"
-                    app:layout_constraintBottom_toTopOf="@id/org_price3"
-                    app:layout_constraintTop_toBottomOf="@id/image3"
-                    style="@style/auto_text_size"
-                    android:textStyle="bold"
-                    app:autoSizeMaxTextSize="25sp"
-                    app:autoSizeMinTextSize="1sp"
-                    app:autoSizeStepGranularity="2sp"
-                    app:autoSizeTextType="uniform"
-                    tools:ignore="MissingPrefix"
-                    android:textColor="@color/javashop_color_navy"
-                    android:text="¥4678"
-                    />
-            </android.support.constraint.ConstraintLayout>
-            <android.support.constraint.ConstraintLayout
-                android:layout_width="0dp"
-                android:layout_height="match_parent"
-                android:layout_weight="1"
-                android:id="@+id/goods4"
-                >
-                <ImageView
-                    android:id="@+id/image4"
-                    android:layout_width="0dp"
-                    android:layout_height="0dp"
-                    app:layout_constraintTop_toTopOf="parent"
-                    app:layout_constraintLeft_toLeftOf="parent"
-                    app:layout_constraintRight_toRightOf="parent"
-                    app:layout_constraintBottom_toBottomOf="parent"
-                    app:layout_constraintWidth_percent="0.9"
-                    app:layout_constraintDimensionRatio="h,1:1"
-                    app:layout_constraintVertical_bias="0"
-                    android:src="@mipmap/ic_launcher"
-                    android:scaleType="centerCrop"
-                    />
-                <TextView
-                    android:id="@+id/org_price4"
-                    android:layout_width="0dp"
-                    android:layout_height="0dp"
-                    app:layout_constraintHeight_percent="0.135"
-                    android:gravity="center"
-                    app:layout_constraintLeft_toLeftOf="parent"
-                    app:layout_constraintRight_toRightOf="parent"
-                    app:layout_constraintBottom_toBottomOf="parent"
-                    style="@style/auto_text_size"
-                    android:textStyle="bold"
-                    app:autoSizeMaxTextSize="25sp"
-                    app:autoSizeMinTextSize="1sp"
-                    app:autoSizeStepGranularity="2sp"
-                    app:autoSizeTextType="uniform"
-                    tools:ignore="MissingPrefix"
-                    android:textColor="#c0c0c1"
-                    android:layout_marginBottom="5dp"
-                    android:text="¥4678"
-                    />
-                <TextView
-                    android:id="@+id/price4"
-                    android:layout_width="0dp"
-                    android:layout_height="0dp"
-                    android:gravity="center"
-                    app:layout_constraintLeft_toLeftOf="parent"
-                    app:layout_constraintRight_toRightOf="parent"
-                    app:layout_constraintBottom_toTopOf="@id/org_price4"
-                    app:layout_constraintTop_toBottomOf="@id/image4"
-                    style="@style/auto_text_size"
-                    android:textStyle="bold"
-                    app:autoSizeMaxTextSize="25sp"
-                    app:autoSizeMinTextSize="1sp"
-                    app:autoSizeStepGranularity="2sp"
-                    app:autoSizeTextType="uniform"
-                    tools:ignore="MissingPrefix"
-                    android:textColor="@color/javashop_color_navy"
-                    android:text="¥4678"
-                    />
-            </android.support.constraint.ConstraintLayout>
-            <android.support.constraint.ConstraintLayout
-                android:layout_width="0dp"
-                android:layout_height="match_parent"
-                android:layout_weight="1"
-                android:id="@+id/goods5"
-                >
-                <ImageView
-                    android:id="@+id/image5"
-                    android:layout_width="0dp"
-                    android:layout_height="0dp"
-                    app:layout_constraintTop_toTopOf="parent"
-                    app:layout_constraintLeft_toLeftOf="parent"
-                    app:layout_constraintRight_toRightOf="parent"
-                    app:layout_constraintBottom_toBottomOf="parent"
-                    app:layout_constraintWidth_percent="0.9"
-                    app:layout_constraintDimensionRatio="h,1:1"
-                    app:layout_constraintVertical_bias="0"
-                    android:src="@mipmap/ic_launcher"
-                    android:scaleType="centerCrop"
-                    />
-                <TextView
-                    android:id="@+id/org_price5"
-                    android:layout_width="0dp"
-                    android:layout_height="0dp"
-                    app:layout_constraintHeight_percent="0.135"
-                    android:gravity="center"
-                    app:layout_constraintLeft_toLeftOf="parent"
-                    app:layout_constraintRight_toRightOf="parent"
-                    app:layout_constraintBottom_toBottomOf="parent"
-                    style="@style/auto_text_size"
-                    android:textStyle="bold"
-                    app:autoSizeMaxTextSize="25sp"
-                    app:autoSizeMinTextSize="1sp"
-                    app:autoSizeStepGranularity="2sp"
-                    app:autoSizeTextType="uniform"
-                    tools:ignore="MissingPrefix"
-                    android:textColor="#c0c0c1"
-                    android:layout_marginBottom="5dp"
-                    android:text="¥4678"
-                    />
-                <TextView
-                    android:id="@+id/price5"
-                    android:layout_width="0dp"
-                    android:layout_height="0dp"
-                    android:gravity="center"
-                    app:layout_constraintLeft_toLeftOf="parent"
-                    app:layout_constraintRight_toRightOf="parent"
-                    app:layout_constraintBottom_toTopOf="@id/org_price5"
-                    app:layout_constraintTop_toBottomOf="@id/image5"
-                    style="@style/auto_text_size"
-                    android:textStyle="bold"
-                    app:autoSizeMaxTextSize="25sp"
-                    app:autoSizeMinTextSize="1sp"
-                    app:autoSizeStepGranularity="2sp"
-                    app:autoSizeTextType="uniform"
-                    tools:ignore="MissingPrefix"
-                    android:textColor="@color/javashop_color_navy"
-                    android:text="¥4678"
-                    />
-            </android.support.constraint.ConstraintLayout>
-        </LinearLayout>
-    </android.support.constraint.ConstraintLayout>
-</layout>

+ 0 - 17
home/src/main/res/layout/floor_item_single_image_lay.xml

@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<layout>
-    <LinearLayout
-        android:orientation="horizontal"
-        xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="match_parent"
-        xmlns:bind="http://schemas.android.com/apk/res-auto"
-        android:layout_height="match_parent">
-        <ImageView
-            android:id="@+id/imageA"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:scaleType="fitXY"
-            android:layout_weight="1"
-            />
-    </LinearLayout>
-</layout>

+ 0 - 17
home/src/main/res/layout/floor_item_text_lay.xml

@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<layout>
-    <LinearLayout
-        android:orientation="horizontal"
-        xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content">
-        <TextView
-            android:id="@+id/text"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:layout_weight="1"
-            android:textColor="#090909"
-            android:textSize="15sp"
-            />
-    </LinearLayout>
-</layout>

+ 0 - 31
home/src/main/res/layout/floor_item_three_image_lay.xml

@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<layout>
-    <LinearLayout
-        android:orientation="horizontal"
-        xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="match_parent"
-        xmlns:bind="http://schemas.android.com/apk/res-auto"
-        android:layout_height="match_parent">
-        <ImageView
-            android:id="@+id/imageA"
-            android:layout_width="0dp"
-            android:layout_height="match_parent"
-            android:scaleType="fitXY"
-            android:layout_weight="1"
-            />
-        <ImageView
-            android:id="@+id/imageB"
-            android:layout_weight="1"
-            android:layout_width="0dp"
-            android:layout_height="match_parent"
-            android:scaleType="fitXY"
-            />
-        <ImageView
-            android:id="@+id/imageC"
-            android:layout_weight="1"
-            android:layout_width="0dp"
-            android:layout_height="match_parent"
-            android:scaleType="fitXY"
-            />
-    </LinearLayout>
-</layout>

+ 0 - 17
home/src/main/res/layout/floor_item_title_lay.xml

@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<layout>
-    <LinearLayout
-        android:orientation="horizontal"
-        xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="match_parent"
-        xmlns:bind="http://schemas.android.com/apk/res-auto"
-        android:layout_height="match_parent">
-        <ImageView
-            android:id="@+id/image"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:scaleType="fitXY"
-            android:layout_weight="1"
-            />
-    </LinearLayout>
-</layout>

+ 0 - 47
home/src/main/res/layout/home_act_lay.xml

@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<layout xmlns:bind="http://schemas.android.com/tools"
-        xmlns:app="http://schemas.android.com/apk/res-auto">
-    <android.support.constraint.ConstraintLayout
-        xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        >
-        <View
-            android:id="@+id/holder"
-            android:layout_width="match_parent"
-            android:layout_height="50dp"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintBottom_toBottomOf="parent"
-            android:background="@drawable/javashop_home_bottom_bar_mask"
-            />
-        <com.enation.javashop.android.widget.navigationview.FragmentPagerView
-            android:id="@+id/home_act_viewpager"
-            android:layout_width="0dp"
-            android:layout_height="0dp"
-            app:layout_constraintTop_toTopOf="parent"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintBottom_toTopOf="@+id/holder"
-            >
-        </com.enation.javashop.android.widget.navigationview.FragmentPagerView>
-        <View
-            android:layout_width="match_parent"
-            android:layout_height="60dp"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintBottom_toBottomOf="parent"
-            android:background="@drawable/javashop_home_bottom_bar_mask"
-            />
-        <com.enation.javashop.android.widget.navigationview.NavigationView
-            android:id="@+id/home_act_navigationview"
-            android:layout_width="match_parent"
-            android:layout_height="50dp"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintBottom_toBottomOf="parent"
-            bind:backgroundColor="@{@color/javashop_color_home_navigation_bg}"
-            >
-        </com.enation.javashop.android.widget.navigationview.NavigationView>
-    </android.support.constraint.ConstraintLayout>
-</layout>

+ 0 - 182
home/src/main/res/layout/home_frag_lay.xml

@@ -1,182 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<layout>
-    <data>
-        <variable name="homeData" type="com.wdkl.ncs.android.component.home.binding.HomeFragmentBindHelper"/>
-    </data>
-<android.support.constraint.ConstraintLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:background="@color/javashop_color_white"
-    xmlns:bind="http://schemas.android.com/apk/res-auto"
-    xmlns:app="http://schemas.android.com/apk/res-auto">
-    <com.scwang.smartrefresh.layout.SmartRefreshLayout
-        android:id="@+id/home_frag_tangram_refreshlayout"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        app:layout_constraintTop_toTopOf="parent"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintLeft_toLeftOf="parent"
-        app:srlEnableRefresh="true"
-        app:srlEnableLoadMore="false"
-        android:background="@color/javashop_color_cyan"
-        >
-        <android.support.v7.widget.RecyclerView
-        android:id="@+id/home_frag_floor_view"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:background="#EEF2F3"
-        />
-    </com.scwang.smartrefresh.layout.SmartRefreshLayout>
-    <android.support.constraint.ConstraintLayout
-        android:id="@+id/home_frag_toolbar"
-        android:layout_width="match_parent"
-        android:layout_height="50dp"
-        bind:auto_topbar_height="@{true}"
-        app:layout_constraintLeft_toLeftOf="parent"
-        app:layout_constraintRight_toRightOf="parent"
-        bind:layout_constraintTop_toTopOf="parent"
-        bind:alpha="@{homeData.scrollY.get()}"
-        android:background="@color/javashop_color_white"
-        >
-        <View
-            android:id="@+id/home_frag_toolbar_holder"
-            android:layout_width="0dp"
-            android:background="@{homeData.scrollY.get() > 30 ? @color/javashop_color_holder_color : @color/javashop_color_transparent }"
-            android:layout_height="0dp"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintRight_toRightOf="parent"
-            bind:layout_constraintTop_toTopOf="parent"
-            bind:status_bar="@{1}"
-            />
-        <LinearLayout
-            android:id="@+id/home_frag_toolbar_scan_lay"
-            android:padding="5dp"
-            android:layout_width="0dp"
-            android:layout_height="0dp"
-            android:gravity="center"
-            android:orientation="vertical"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintTop_toBottomOf="@id/home_frag_toolbar_holder"
-            app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintHeight_default="percent"
-            app:layout_constraintHeight_percent="0.65"
-            app:layout_constraintDimensionRatio="w,1:1">
-            <ImageView
-                android:id="@+id/home_frag_toolbar_scan_iv"
-                android:layout_width="match_parent"
-                android:layout_height="0dp"
-                android:layout_weight="2"
-                android:padding="4dp"
-                android:src="@{homeData.isHide().get() ? @drawable/javashop_scan_white : @drawable/javashop_scan_black}"
-                />
-            <TextView
-                android:gravity="center"
-                android:layout_weight="1"
-                android:id="@+id/home_frag_toolbar_scan_tv"
-                android:layout_width="match_parent"
-                android:layout_height="0dp"
-                app:autoSizeMaxTextSize="100sp"
-                app:autoSizeMinTextSize="1sp"
-                app:autoSizeStepGranularity="2sp"
-                android:textColor="@{homeData.isHide().get() ? @color/javashop_color_white :@color/javashop_color_black}"
-                android:text="@string/javashop_qrcode_name"
-                app:autoSizeTextType="uniform"
-                tools:ignore="MissingPrefix"
-                />
-        </LinearLayout>
-
-        <LinearLayout
-            android:id="@+id/home_frag_toolbar_my_lay"
-            android:padding="5dp"
-            android:layout_width="0dp"
-            android:layout_height="0dp"
-            android:gravity="center"
-            android:orientation="vertical"
-            app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintTop_toBottomOf="@id/home_frag_toolbar_holder"
-            app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintHeight_default="percent"
-            app:layout_constraintHeight_percent="0.65"
-            app:layout_constraintDimensionRatio="w,1:1">
-            <ImageView
-                android:id="@+id/home_frag_toolbar_my_iv"
-                android:layout_width="match_parent"
-                android:layout_height="0dp"
-                android:padding="2dp"
-                android:layout_weight="2"
-                android:src="@{homeData.isHide().get() ? @drawable/javashop_my_white : @drawable/javashop_my_black}"
-                />
-            <TextView
-                android:gravity="center"
-                android:layout_weight="1"
-                android:id="@+id/home_frag_toolbar_my_tv"
-                android:layout_width="match_parent"
-                android:layout_height="0dp"
-                app:autoSizeMaxTextSize="100sp"
-                app:autoSizeMinTextSize="1sp"
-                app:autoSizeStepGranularity="2sp"
-                android:textColor="@{homeData.isHide().get() ? @color/javashop_color_white : @color/javashop_color_black}"
-                android:text="@string/javashop_navigation_persion_title"
-                app:autoSizeTextType="uniform"
-                tools:ignore="MissingPrefix"
-                />
-        </LinearLayout>
-
-        <android.support.constraint.ConstraintLayout
-            android:layout_width="0dp"
-            android:layout_height="0dp"
-            android:id="@+id/home_frag_toolbar_search_lay"
-            app:layout_constraintHeight_default="percent"
-            app:layout_constraintHeight_percent="0.4"
-            app:layout_constraintTop_toBottomOf="@id/home_frag_toolbar_holder"
-            app:layout_constraintRight_toLeftOf="@id/home_frag_toolbar_my_lay"
-            app:layout_constraintLeft_toRightOf="@id/home_frag_toolbar_scan_lay"
-            app:layout_constraintBottom_toBottomOf="parent"
-            android:background="@{homeData.isHide().get() ? @drawable/javashop_home_frag_toolbar_search_white_bg : @drawable/javashop_home_frag_toolbar_search_gray_bg}"
-            >
-            <ImageView
-                android:id="@+id/home_frag_toolbar_search_iv"
-                android:layout_width="0dp"
-                android:layout_height="0dp"
-                android:layout_marginLeft="5dp"
-                app:layout_constraintHeight_default="percent"
-                app:layout_constraintHeight_percent="0.6
-"
-                app:layout_constraintLeft_toLeftOf="parent"
-                app:layout_constraintTop_toTopOf="parent"
-                app:layout_constraintBottom_toBottomOf="parent"
-                app:layout_constraintDimensionRatio="w,1:1"
-                android:src="@{homeData.isHide().get() ? @drawable/javashop_find_black : @drawable/javashop_find_white}"
-                />
-
-            <TextView
-                android:id="@+id/home_frag_toolbar_search_tv"
-                android:layout_width="0dp"
-                android:layout_height="31dp"
-                android:ellipsize="end"
-                android:gravity="center_vertical"
-                android:lines="1"
-                android:paddingBottom="5dp"
-                android:paddingTop="5dp"
-                android:text="请输入你想搜索的关键词"
-                android:textColor="@{homeData.isHide().get() ? @color/javashop_color_searcher_tv_gray : @color/javashop_color_white}"
-                app:autoSizeMaxTextSize="20sp"
-                app:autoSizeMinTextSize="1sp"
-                app:autoSizeStepGranularity="2sp"
-                app:autoSizeTextType="uniform"
-                app:layout_constraintBottom_toBottomOf="parent"
-                app:layout_constraintLeft_toLeftOf="parent"
-                app:layout_constraintRight_toRightOf="parent"
-                app:layout_constraintTop_toTopOf="parent"
-                app:layout_constraintWidth_default="percent"
-                app:layout_constraintWidth_percent="0.75"
-                tools:ignore="MissingPrefix"
-                />
-        </android.support.constraint.ConstraintLayout>
-
-    </android.support.constraint.ConstraintLayout>
-</android.support.constraint.ConstraintLayout>
-</layout>

+ 0 - 3
home/src/main/res/values/strings.xml

@@ -1,3 +0,0 @@
-<resources>
-    <string name="app_name">Home</string>
-</resources>

+ 0 - 17
home/src/test/java/com/enation/javashop/android/component/home/ExampleUnitTest.java

@@ -1,17 +0,0 @@
-package com.wdkl.ncs.android.component.home;
-
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-/**
- * Example local unit test, which will execute on the development machine (host).
- *
- * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
- */
-public class ExampleUnitTest {
-    @Test
-    public void addition_isCorrect() throws Exception {
-        assertEquals(4, 2 + 2);
-    }
-}

+ 0 - 1
libwebrtc/.gitignore

@@ -1 +0,0 @@
-/build

+ 0 - 48
libwebrtc/build.gradle

@@ -1,48 +0,0 @@
-apply plugin: 'com.android.library'
-
-android {
-    compileSdkVersion target_sdk_version
-    buildToolsVersion build_tools_version
-
-    defaultConfig {
-        minSdkVersion min_sdk_version
-        targetSdkVersion target_sdk_version
-        versionCode app_version_code
-        versionName app_version
-
-        ndk {
-            abiFilters 'armeabi-v7a','arm64-v8a'
-        }
-    }
-
-    buildTypes {
-        release {
-            minifyEnabled false
-            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
-        }
-    }
-
-    sourceSets.main {
-        jniLibs.srcDirs = ['libs']
-        java.srcDirs = [
-                "src/main/java/sdk/android/api",
-                "src/main/java/sdk/android/src/java",
-                "src/main/java/rtc_base/java/src",
-                "src/main/java/modules/audio_device/android/java/src",
-        ]
-    }
-
-    compileOptions {
-        sourceCompatibility JavaVersion.VERSION_1_8
-        targetCompatibility JavaVersion.VERSION_1_8
-    }
-
-    lintOptions {
-        checkReleaseBuilds false
-        abortOnError false
-    }
-}
-
-dependencies {
-    implementation fileTree(dir: 'libs', include: ['*.jar'])
-}

BIN
libwebrtc/libs/arm64-v8a/libjingle_peerconnection_so.so


BIN
libwebrtc/libs/armeabi-v7a/libjingle_peerconnection_so.so


+ 0 - 21
libwebrtc/proguard-rules.pro

@@ -1,21 +0,0 @@
-# Add project specific ProGuard rules here.
-# You can control the set of applied configuration files using the
-# proguardFiles setting in build.gradle.
-#
-# For more details, see
-#   http://developer.android.com/guide/developing/tools/proguard.html
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-#   public *;
-#}
-
-# Uncomment this to preserve the line number information for
-# debugging stack traces.
-#-keepattributes SourceFile,LineNumberTable
-
-# If you keep the line number information, uncomment this to
-# hide the original source file name.
-#-renamesourcefileattribute SourceFile

+ 0 - 2
libwebrtc/src/main/AndroidManifest.xml

@@ -1,2 +0,0 @@
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="org.webrtc" />

+ 0 - 51
libwebrtc/src/main/java/modules/audio_device/android/java/src/org/webrtc/voiceengine/BuildInfo.java

@@ -1,51 +0,0 @@
-/*
- *  Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-package org.webrtc.voiceengine;
-
-import android.os.Build;
-
-public final class BuildInfo {
-  public static String getDevice() {
-    return Build.DEVICE;
-  }
-
-  public static String getDeviceModel() {
-    return Build.MODEL;
-  }
-
-  public static String getProduct() {
-    return Build.PRODUCT;
-  }
-
-  public static String getBrand() {
-    return Build.BRAND;
-  }
-
-  public static String getDeviceManufacturer() {
-    return Build.MANUFACTURER;
-  }
-
-  public static String getAndroidBuildId() {
-    return Build.ID;
-  }
-
-  public static String getBuildType() {
-    return Build.TYPE;
-  }
-
-  public static String getBuildRelease() {
-    return Build.VERSION.RELEASE;
-  }
-
-  public static int getSdkVersion() {
-    return Build.VERSION.SDK_INT;
-  }
-}

+ 0 - 324
libwebrtc/src/main/java/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioEffects.java

@@ -1,324 +0,0 @@
-/*
- *  Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-package org.webrtc.voiceengine;
-
-import android.media.audiofx.AcousticEchoCanceler;
-import android.media.audiofx.AudioEffect;
-import android.media.audiofx.AudioEffect.Descriptor;
-import android.media.audiofx.NoiseSuppressor;
-import android.os.Build;
-
-import org.webrtc.Logging;
-
-import java.util.List;
-import java.util.UUID;
-
-// This class wraps control of three different platform effects. Supported
-// effects are: AcousticEchoCanceler (AEC) and NoiseSuppressor (NS).
-// Calling enable() will active all effects that are
-// supported by the device if the corresponding |shouldEnableXXX| member is set.
-public class WebRtcAudioEffects {
-  private static final boolean DEBUG = false;
-
-  private static final String TAG = "WebRtcAudioEffects";
-
-  // UUIDs for Software Audio Effects that we want to avoid using.
-  // The implementor field will be set to "The Android Open Source Project".
-  private static final UUID AOSP_ACOUSTIC_ECHO_CANCELER =
-      UUID.fromString("bb392ec0-8d4d-11e0-a896-0002a5d5c51b");
-  private static final UUID AOSP_NOISE_SUPPRESSOR =
-      UUID.fromString("c06c8400-8e06-11e0-9cb6-0002a5d5c51b");
-
-  // Contains the available effect descriptors returned from the
-  // AudioEffect.getEffects() call. This result is cached to avoid doing the
-  // slow OS call multiple times.
-  private static   Descriptor[] cachedEffects;
-
-  // Contains the audio effect objects. Created in enable() and destroyed
-  // in release().
-  private   AcousticEchoCanceler aec;
-  private   NoiseSuppressor ns;
-
-  // Affects the final state given to the setEnabled() method on each effect.
-  // The default state is set to "disabled" but each effect can also be enabled
-  // by calling setAEC() and setNS().
-  // To enable an effect, both the shouldEnableXXX member and the static
-  // canUseXXX() must be true.
-  private boolean shouldEnableAec;
-  private boolean shouldEnableNs;
-
-  // Checks if the device implements Acoustic Echo Cancellation (AEC).
-  // Returns true if the device implements AEC, false otherwise.
-  public static boolean isAcousticEchoCancelerSupported() {
-    // Note: we're using isAcousticEchoCancelerEffectAvailable() instead of
-    // AcousticEchoCanceler.isAvailable() to avoid the expensive getEffects()
-    // OS API call.
-    return isAcousticEchoCancelerEffectAvailable();
-  }
-
-  // Checks if the device implements Noise Suppression (NS).
-  // Returns true if the device implements NS, false otherwise.
-  public static boolean isNoiseSuppressorSupported() {
-    // Note: we're using isNoiseSuppressorEffectAvailable() instead of
-    // NoiseSuppressor.isAvailable() to avoid the expensive getEffects()
-    // OS API call.
-    return isNoiseSuppressorEffectAvailable();
-  }
-
-  // Returns true if the device is blacklisted for HW AEC usage.
-  public static boolean isAcousticEchoCancelerBlacklisted() {
-    List<String> blackListedModels = WebRtcAudioUtils.getBlackListedModelsForAecUsage();
-    boolean isBlacklisted = blackListedModels.contains(Build.MODEL);
-    if (isBlacklisted) {
-      Logging.w(TAG, Build.MODEL + " is blacklisted for HW AEC usage!");
-    }
-    return isBlacklisted;
-  }
-
-  // Returns true if the device is blacklisted for HW NS usage.
-  public static boolean isNoiseSuppressorBlacklisted() {
-    List<String> blackListedModels = WebRtcAudioUtils.getBlackListedModelsForNsUsage();
-    boolean isBlacklisted = blackListedModels.contains(Build.MODEL);
-    if (isBlacklisted) {
-      Logging.w(TAG, Build.MODEL + " is blacklisted for HW NS usage!");
-    }
-    return isBlacklisted;
-  }
-
-  // Returns true if the platform AEC should be excluded based on its UUID.
-  // AudioEffect.queryEffects() can throw IllegalStateException.
-  private static boolean isAcousticEchoCancelerExcludedByUUID() {
-    if (Build.VERSION.SDK_INT < 18)
-      return false;
-    for (Descriptor d : getAvailableEffects()) {
-      if (d.type.equals(AudioEffect.EFFECT_TYPE_AEC)
-          && d.uuid.equals(AOSP_ACOUSTIC_ECHO_CANCELER)) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  // Returns true if the platform NS should be excluded based on its UUID.
-  // AudioEffect.queryEffects() can throw IllegalStateException.
-  private static boolean isNoiseSuppressorExcludedByUUID() {
-    if (Build.VERSION.SDK_INT < 18)
-      return false;
-    for (Descriptor d : getAvailableEffects()) {
-      if (d.type.equals(AudioEffect.EFFECT_TYPE_NS) && d.uuid.equals(AOSP_NOISE_SUPPRESSOR)) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  // Returns true if the device supports Acoustic Echo Cancellation (AEC).
-  private static boolean isAcousticEchoCancelerEffectAvailable() {
-    if (Build.VERSION.SDK_INT < 18)
-      return false;
-    return isEffectTypeAvailable(AudioEffect.EFFECT_TYPE_AEC);
-  }
-
-  // Returns true if the device supports Noise Suppression (NS).
-  private static boolean isNoiseSuppressorEffectAvailable() {
-    if (Build.VERSION.SDK_INT < 18)
-      return false;
-    return isEffectTypeAvailable(AudioEffect.EFFECT_TYPE_NS);
-  }
-
-  // Returns true if all conditions for supporting the HW AEC are fulfilled.
-  // It will not be possible to enable the HW AEC if this method returns false.
-  public static boolean canUseAcousticEchoCanceler() {
-    boolean canUseAcousticEchoCanceler = isAcousticEchoCancelerSupported()
-        && !WebRtcAudioUtils.useWebRtcBasedAcousticEchoCanceler()
-        && !isAcousticEchoCancelerBlacklisted() && !isAcousticEchoCancelerExcludedByUUID();
-    Logging.d(TAG, "canUseAcousticEchoCanceler: " + canUseAcousticEchoCanceler);
-    return canUseAcousticEchoCanceler;
-  }
-
-  // Returns true if all conditions for supporting the HW NS are fulfilled.
-  // It will not be possible to enable the HW NS if this method returns false.
-  public static boolean canUseNoiseSuppressor() {
-    boolean canUseNoiseSuppressor = isNoiseSuppressorSupported()
-        && !WebRtcAudioUtils.useWebRtcBasedNoiseSuppressor() && !isNoiseSuppressorBlacklisted()
-        && !isNoiseSuppressorExcludedByUUID();
-    Logging.d(TAG, "canUseNoiseSuppressor: " + canUseNoiseSuppressor);
-    return canUseNoiseSuppressor;
-  }
-
-  public static WebRtcAudioEffects create() {
-    return new WebRtcAudioEffects();
-  }
-
-  private WebRtcAudioEffects() {
-    Logging.d(TAG, "ctor" + WebRtcAudioUtils.getThreadInfo());
-  }
-
-  // Call this method to enable or disable the platform AEC. It modifies
-  // |shouldEnableAec| which is used in enable() where the actual state
-  // of the AEC effect is modified. Returns true if HW AEC is supported and
-  // false otherwise.
-  public boolean setAEC(boolean enable) {
-    Logging.d(TAG, "setAEC(" + enable + ")");
-    if (!canUseAcousticEchoCanceler()) {
-      Logging.w(TAG, "Platform AEC is not supported");
-      shouldEnableAec = false;
-      return false;
-    }
-    if (aec != null && (enable != shouldEnableAec)) {
-      Logging.e(TAG, "Platform AEC state can't be modified while recording");
-      return false;
-    }
-    shouldEnableAec = enable;
-    return true;
-  }
-
-  // Call this method to enable or disable the platform NS. It modifies
-  // |shouldEnableNs| which is used in enable() where the actual state
-  // of the NS effect is modified. Returns true if HW NS is supported and
-  // false otherwise.
-  public boolean setNS(boolean enable) {
-    Logging.d(TAG, "setNS(" + enable + ")");
-    if (!canUseNoiseSuppressor()) {
-      Logging.w(TAG, "Platform NS is not supported");
-      shouldEnableNs = false;
-      return false;
-    }
-    if (ns != null && (enable != shouldEnableNs)) {
-      Logging.e(TAG, "Platform NS state can't be modified while recording");
-      return false;
-    }
-    shouldEnableNs = enable;
-    return true;
-  }
-
-  public void enable(int audioSession) {
-    Logging.d(TAG, "enable(audioSession=" + audioSession + ")");
-    assertTrue(aec == null);
-    assertTrue(ns == null);
-
-    if (DEBUG) {
-      // Add logging of supported effects but filter out "VoIP effects", i.e.,
-      // AEC, AEC and NS. Avoid calling AudioEffect.queryEffects() unless the
-      // DEBUG flag is set since we have seen crashes in this API.
-      for (Descriptor d : AudioEffect.queryEffects()) {
-        if (effectTypeIsVoIP(d.type)) {
-          Logging.d(TAG, "name: " + d.name + ", "
-                  + "mode: " + d.connectMode + ", "
-                  + "implementor: " + d.implementor + ", "
-                  + "UUID: " + d.uuid);
-        }
-      }
-    }
-
-    if (isAcousticEchoCancelerSupported()) {
-      // Create an AcousticEchoCanceler and attach it to the AudioRecord on
-      // the specified audio session.
-      aec = AcousticEchoCanceler.create(audioSession);
-      if (aec != null) {
-        boolean enabled = aec.getEnabled();
-        boolean enable = shouldEnableAec && canUseAcousticEchoCanceler();
-        if (aec.setEnabled(enable) != AudioEffect.SUCCESS) {
-          Logging.e(TAG, "Failed to set the AcousticEchoCanceler state");
-        }
-        Logging.d(TAG, "AcousticEchoCanceler: was " + (enabled ? "enabled" : "disabled")
-                + ", enable: " + enable + ", is now: "
-                + (aec.getEnabled() ? "enabled" : "disabled"));
-      } else {
-        Logging.e(TAG, "Failed to create the AcousticEchoCanceler instance");
-      }
-    }
-
-    if (isNoiseSuppressorSupported()) {
-      // Create an NoiseSuppressor and attach it to the AudioRecord on the
-      // specified audio session.
-      ns = NoiseSuppressor.create(audioSession);
-      if (ns != null) {
-        boolean enabled = ns.getEnabled();
-        boolean enable = shouldEnableNs && canUseNoiseSuppressor();
-        if (ns.setEnabled(enable) != AudioEffect.SUCCESS) {
-          Logging.e(TAG, "Failed to set the NoiseSuppressor state");
-        }
-        Logging.d(TAG, "NoiseSuppressor: was " + (enabled ? "enabled" : "disabled") + ", enable: "
-                + enable + ", is now: " + (ns.getEnabled() ? "enabled" : "disabled"));
-      } else {
-        Logging.e(TAG, "Failed to create the NoiseSuppressor instance");
-      }
-    }
-  }
-
-  // Releases all native audio effect resources. It is a good practice to
-  // release the effect engine when not in use as control can be returned
-  // to other applications or the native resources released.
-  public void release() {
-    Logging.d(TAG, "release");
-    if (aec != null) {
-      aec.release();
-      aec = null;
-    }
-    if (ns != null) {
-      ns.release();
-      ns = null;
-    }
-  }
-
-  // Returns true for effect types in |type| that are of "VoIP" types:
-  // Acoustic Echo Canceler (AEC) or Automatic Gain Control (AGC) or
-  // Noise Suppressor (NS). Note that, an extra check for support is needed
-  // in each comparison since some devices includes effects in the
-  // AudioEffect.Descriptor array that are actually not available on the device.
-  // As an example: Samsung Galaxy S6 includes an AGC in the descriptor but
-  // AutomaticGainControl.isAvailable() returns false.
-  private boolean effectTypeIsVoIP(UUID type) {
-    if (Build.VERSION.SDK_INT < 18)
-      return false;
-
-    return (AudioEffect.EFFECT_TYPE_AEC.equals(type) && isAcousticEchoCancelerSupported())
-        || (AudioEffect.EFFECT_TYPE_NS.equals(type) && isNoiseSuppressorSupported());
-  }
-
-  // Helper method which throws an exception when an assertion has failed.
-  private static void assertTrue(boolean condition) {
-    if (!condition) {
-      throw new AssertionError("Expected condition to be true");
-    }
-  }
-
-  // Returns the cached copy of the audio effects array, if available, or
-  // queries the operating system for the list of effects.
-  private static   Descriptor[] getAvailableEffects() {
-    if (cachedEffects != null) {
-      return cachedEffects;
-    }
-    // The caching is best effort only - if this method is called from several
-    // threads in parallel, they may end up doing the underlying OS call
-    // multiple times. It's normally only called on one thread so there's no
-    // real need to optimize for the multiple threads case.
-    cachedEffects = AudioEffect.queryEffects();
-    return cachedEffects;
-  }
-
-  // Returns true if an effect of the specified type is available. Functionally
-  // equivalent to (NoiseSuppressor|AutomaticGainControl|...).isAvailable(), but
-  // faster as it avoids the expensive OS call to enumerate effects.
-  private static boolean isEffectTypeAvailable(UUID effectType) {
-    Descriptor[] effects = getAvailableEffects();
-    if (effects == null) {
-      return false;
-    }
-    for (Descriptor d : effects) {
-      if (d.type.equals(effectType)) {
-        return true;
-      }
-    }
-    return false;
-  }
-}

+ 0 - 378
libwebrtc/src/main/java/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioManager.java

@@ -1,378 +0,0 @@
-/*
- *  Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-package org.webrtc.voiceengine;
-
-import android.content.Context;
-import android.content.pm.PackageManager;
-import android.media.AudioFormat;
-import android.media.AudioManager;
-import android.media.AudioRecord;
-import android.media.AudioTrack;
-import android.os.Build;
-
-import org.webrtc.ContextUtils;
-import org.webrtc.Logging;
-
-import java.util.Timer;
-import java.util.TimerTask;
-
-// WebRtcAudioManager handles tasks that uses android.media.AudioManager.
-// At construction, storeAudioParameters() is called and it retrieves
-// fundamental audio parameters like native sample rate and number of channels.
-// The result is then provided to the caller by nativeCacheAudioParameters().
-// It is also possible to call init() to set up the audio environment for best
-// possible "VoIP performance". All settings done in init() are reverted by
-// dispose(). This class can also be used without calling init() if the user
-// prefers to set up the audio environment separately. However, it is
-// recommended to always use AudioManager.MODE_IN_COMMUNICATION.
-public class WebRtcAudioManager {
-  private static final boolean DEBUG = false;
-
-  private static final String TAG = "WebRtcAudioManager";
-
-  // TODO(bugs.webrtc.org/8914): disabled by default until AAudio support has
-  // been completed. Goal is to always return false on Android O MR1 and higher.
-  private static final boolean blacklistDeviceForAAudioUsage = true;
-
-  // Use mono as default for both audio directions.
-  private static boolean useStereoOutput;
-  private static boolean useStereoInput;
-
-  private static boolean blacklistDeviceForOpenSLESUsage;
-  private static boolean blacklistDeviceForOpenSLESUsageIsOverridden;
-
-  // Call this method to override the default list of blacklisted devices
-  // specified in WebRtcAudioUtils.BLACKLISTED_OPEN_SL_ES_MODELS.
-  // Allows an app to take control over which devices to exclude from using
-  // the OpenSL ES audio output path
-  // TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
-  @SuppressWarnings("NoSynchronizedMethodCheck")
-  public static synchronized void setBlacklistDeviceForOpenSLESUsage(boolean enable) {
-    blacklistDeviceForOpenSLESUsageIsOverridden = true;
-    blacklistDeviceForOpenSLESUsage = enable;
-  }
-
-  // Call these methods to override the default mono audio modes for the specified direction(s)
-  // (input and/or output).
-  // TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
-  @SuppressWarnings("NoSynchronizedMethodCheck")
-  public static synchronized void setStereoOutput(boolean enable) {
-    Logging.w(TAG, "Overriding default output behavior: setStereoOutput(" + enable + ')');
-    useStereoOutput = enable;
-  }
-
-  // TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
-  @SuppressWarnings("NoSynchronizedMethodCheck")
-  public static synchronized void setStereoInput(boolean enable) {
-    Logging.w(TAG, "Overriding default input behavior: setStereoInput(" + enable + ')');
-    useStereoInput = enable;
-  }
-
-  // TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
-  @SuppressWarnings("NoSynchronizedMethodCheck")
-  public static synchronized boolean getStereoOutput() {
-    return useStereoOutput;
-  }
-
-  // TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
-  @SuppressWarnings("NoSynchronizedMethodCheck")
-  public static synchronized boolean getStereoInput() {
-    return useStereoInput;
-  }
-
-  // Default audio data format is PCM 16 bit per sample.
-  // Guaranteed to be supported by all devices.
-  private static final int BITS_PER_SAMPLE = 16;
-
-  private static final int DEFAULT_FRAME_PER_BUFFER = 256;
-
-  // Private utility class that periodically checks and logs the volume level
-  // of the audio stream that is currently controlled by the volume control.
-  // A timer triggers logs once every 30 seconds and the timer's associated
-  // thread is named "WebRtcVolumeLevelLoggerThread".
-  private static class VolumeLogger {
-    private static final String THREAD_NAME = "WebRtcVolumeLevelLoggerThread";
-    private static final int TIMER_PERIOD_IN_SECONDS = 30;
-
-    private final AudioManager audioManager;
-    private   Timer timer;
-
-    public VolumeLogger(AudioManager audioManager) {
-      this.audioManager = audioManager;
-    }
-
-    public void start() {
-      timer = new Timer(THREAD_NAME);
-      timer.schedule(new LogVolumeTask(audioManager.getStreamMaxVolume(AudioManager.STREAM_RING),
-                         audioManager.getStreamMaxVolume(AudioManager.STREAM_VOICE_CALL)),
-          0, TIMER_PERIOD_IN_SECONDS * 1000);
-    }
-
-    private class LogVolumeTask extends TimerTask {
-      private final int maxRingVolume;
-      private final int maxVoiceCallVolume;
-
-      LogVolumeTask(int maxRingVolume, int maxVoiceCallVolume) {
-        this.maxRingVolume = maxRingVolume;
-        this.maxVoiceCallVolume = maxVoiceCallVolume;
-      }
-
-      @Override
-      public void run() {
-        final int mode = audioManager.getMode();
-        if (mode == AudioManager.MODE_RINGTONE) {
-          Logging.d(TAG, "STREAM_RING stream volume: "
-                  + audioManager.getStreamVolume(AudioManager.STREAM_RING) + " (max="
-                  + maxRingVolume + ")");
-        } else if (mode == AudioManager.MODE_IN_COMMUNICATION) {
-          Logging.d(TAG, "VOICE_CALL stream volume: "
-                  + audioManager.getStreamVolume(AudioManager.STREAM_VOICE_CALL) + " (max="
-                  + maxVoiceCallVolume + ")");
-        }
-      }
-    }
-
-    private void stop() {
-      if (timer != null) {
-        timer.cancel();
-        timer = null;
-      }
-    }
-  }
-
-  private final long nativeAudioManager;
-  private final AudioManager audioManager;
-
-  private boolean initialized;
-  private int nativeSampleRate;
-  private int nativeChannels;
-
-  private boolean hardwareAEC;
-  private boolean hardwareAGC;
-  private boolean hardwareNS;
-  private boolean lowLatencyOutput;
-  private boolean lowLatencyInput;
-  private boolean proAudio;
-  private boolean aAudio;
-  private int sampleRate;
-  private int outputChannels;
-  private int inputChannels;
-  private int outputBufferSize;
-  private int inputBufferSize;
-
-  private final VolumeLogger volumeLogger;
-
-  WebRtcAudioManager(long nativeAudioManager) {
-    Logging.d(TAG, "ctor" + WebRtcAudioUtils.getThreadInfo());
-    this.nativeAudioManager = nativeAudioManager;
-    audioManager =
-        (AudioManager) ContextUtils.getApplicationContext().getSystemService(Context.AUDIO_SERVICE);
-    if (DEBUG) {
-      WebRtcAudioUtils.logDeviceInfo(TAG);
-    }
-    volumeLogger = new VolumeLogger(audioManager);
-    storeAudioParameters();
-    nativeCacheAudioParameters(sampleRate, outputChannels, inputChannels, hardwareAEC, hardwareAGC,
-        hardwareNS, lowLatencyOutput, lowLatencyInput, proAudio, aAudio, outputBufferSize,
-        inputBufferSize, nativeAudioManager);
-    WebRtcAudioUtils.logAudioState(TAG);
-  }
-
-  private boolean init() {
-    Logging.d(TAG, "init" + WebRtcAudioUtils.getThreadInfo());
-    if (initialized) {
-      return true;
-    }
-    Logging.d(TAG, "audio mode is: "
-        + WebRtcAudioUtils.modeToString(audioManager.getMode()));
-    initialized = true;
-    volumeLogger.start();
-    return true;
-  }
-
-  private void dispose() {
-    Logging.d(TAG, "dispose" + WebRtcAudioUtils.getThreadInfo());
-    if (!initialized) {
-      return;
-    }
-    volumeLogger.stop();
-  }
-
-  private boolean isCommunicationModeEnabled() {
-    return (audioManager.getMode() == AudioManager.MODE_IN_COMMUNICATION);
-  }
-
-  private boolean isDeviceBlacklistedForOpenSLESUsage() {
-    boolean blacklisted = blacklistDeviceForOpenSLESUsageIsOverridden
-        ? blacklistDeviceForOpenSLESUsage
-        : WebRtcAudioUtils.deviceIsBlacklistedForOpenSLESUsage();
-    if (blacklisted) {
-      Logging.d(TAG, Build.MODEL + " is blacklisted for OpenSL ES usage!");
-    }
-    return blacklisted;
-  }
-
-  private void storeAudioParameters() {
-    outputChannels = getStereoOutput() ? 2 : 1;
-    inputChannels = getStereoInput() ? 2 : 1;
-    sampleRate = getNativeOutputSampleRate();
-    hardwareAEC = isAcousticEchoCancelerSupported();
-    // TODO(henrika): use of hardware AGC is no longer supported. Currently
-    // hardcoded to false. To be removed.
-    hardwareAGC = false;
-    hardwareNS = isNoiseSuppressorSupported();
-    lowLatencyOutput = isLowLatencyOutputSupported();
-    lowLatencyInput = isLowLatencyInputSupported();
-    proAudio = isProAudioSupported();
-    aAudio = isAAudioSupported();
-    outputBufferSize = lowLatencyOutput ? getLowLatencyOutputFramesPerBuffer()
-                                        : getMinOutputFrameSize(sampleRate, outputChannels);
-    inputBufferSize = lowLatencyInput ? getLowLatencyInputFramesPerBuffer()
-                                      : getMinInputFrameSize(sampleRate, inputChannels);
-  }
-
-  // Gets the current earpiece state.
-  private boolean hasEarpiece() {
-    return ContextUtils.getApplicationContext().getPackageManager().hasSystemFeature(
-        PackageManager.FEATURE_TELEPHONY);
-  }
-
-  // Returns true if low-latency audio output is supported.
-  private boolean isLowLatencyOutputSupported() {
-    return ContextUtils.getApplicationContext().getPackageManager().hasSystemFeature(
-        PackageManager.FEATURE_AUDIO_LOW_LATENCY);
-  }
-
-  // Returns true if low-latency audio input is supported.
-  // TODO(henrika): remove the hardcoded false return value when OpenSL ES
-  // input performance has been evaluated and tested more.
-  public boolean isLowLatencyInputSupported() {
-    // TODO(henrika): investigate if some sort of device list is needed here
-    // as well. The NDK doc states that: "As of API level 21, lower latency
-    // audio input is supported on select devices. To take advantage of this
-    // feature, first confirm that lower latency output is available".
-    return Build.VERSION.SDK_INT >= 21 && isLowLatencyOutputSupported();
-  }
-
-  // Returns true if the device has professional audio level of functionality
-  // and therefore supports the lowest possible round-trip latency.
-  private boolean isProAudioSupported() {
-    return Build.VERSION.SDK_INT >= 23
-        && ContextUtils.getApplicationContext().getPackageManager().hasSystemFeature(
-               PackageManager.FEATURE_AUDIO_PRO);
-  }
-
-  // AAudio is supported on Androio Oreo MR1 (API 27) and higher.
-  // TODO(bugs.webrtc.org/8914): currently disabled by default.
-  private boolean isAAudioSupported() {
-    if (blacklistDeviceForAAudioUsage) {
-      Logging.w(TAG, "AAudio support is currently disabled on all devices!");
-    }
-    return !blacklistDeviceForAAudioUsage && Build.VERSION.SDK_INT >= 27;
-  }
-
-  // Returns the native output sample rate for this device's output stream.
-  private int getNativeOutputSampleRate() {
-    // Override this if we're running on an old emulator image which only
-    // supports 8 kHz and doesn't support PROPERTY_OUTPUT_SAMPLE_RATE.
-    if (WebRtcAudioUtils.runningOnEmulator()) {
-      Logging.d(TAG, "Running emulator, overriding sample rate to 8 kHz.");
-      return 8000;
-    }
-    // Default can be overriden by WebRtcAudioUtils.setDefaultSampleRateHz().
-    // If so, use that value and return here.
-    if (WebRtcAudioUtils.isDefaultSampleRateOverridden()) {
-      Logging.d(TAG, "Default sample rate is overriden to "
-              + WebRtcAudioUtils.getDefaultSampleRateHz() + " Hz");
-      return WebRtcAudioUtils.getDefaultSampleRateHz();
-    }
-    // No overrides available. Deliver best possible estimate based on default
-    // Android AudioManager APIs.
-    final int sampleRateHz = getSampleRateForApiLevel();
-    Logging.d(TAG, "Sample rate is set to " + sampleRateHz + " Hz");
-    return sampleRateHz;
-  }
-
-  private int getSampleRateForApiLevel() {
-    if (Build.VERSION.SDK_INT < 17) {
-      return WebRtcAudioUtils.getDefaultSampleRateHz();
-    }
-    String sampleRateString = audioManager.getProperty(AudioManager.PROPERTY_OUTPUT_SAMPLE_RATE);
-    return (sampleRateString == null) ? WebRtcAudioUtils.getDefaultSampleRateHz()
-                                      : Integer.parseInt(sampleRateString);
-  }
-
-  // Returns the native output buffer size for low-latency output streams.
-  private int getLowLatencyOutputFramesPerBuffer() {
-    assertTrue(isLowLatencyOutputSupported());
-    if (Build.VERSION.SDK_INT < 17) {
-      return DEFAULT_FRAME_PER_BUFFER;
-    }
-    String framesPerBuffer =
-        audioManager.getProperty(AudioManager.PROPERTY_OUTPUT_FRAMES_PER_BUFFER);
-    return framesPerBuffer == null ? DEFAULT_FRAME_PER_BUFFER : Integer.parseInt(framesPerBuffer);
-  }
-
-  // Returns true if the device supports an audio effect (AEC or NS).
-  // Four conditions must be fulfilled if functions are to return true:
-  // 1) the platform must support the built-in (HW) effect,
-  // 2) explicit use (override) of a WebRTC based version must not be set,
-  // 3) the device must not be blacklisted for use of the effect, and
-  // 4) the UUID of the effect must be approved (some UUIDs can be excluded).
-  private static boolean isAcousticEchoCancelerSupported() {
-    return WebRtcAudioEffects.canUseAcousticEchoCanceler();
-  }
-  private static boolean isNoiseSuppressorSupported() {
-    return WebRtcAudioEffects.canUseNoiseSuppressor();
-  }
-
-  // Returns the minimum output buffer size for Java based audio (AudioTrack).
-  // This size can also be used for OpenSL ES implementations on devices that
-  // lacks support of low-latency output.
-  private static int getMinOutputFrameSize(int sampleRateInHz, int numChannels) {
-    final int bytesPerFrame = numChannels * (BITS_PER_SAMPLE / 8);
-    final int channelConfig =
-        (numChannels == 1 ? AudioFormat.CHANNEL_OUT_MONO : AudioFormat.CHANNEL_OUT_STEREO);
-    return AudioTrack.getMinBufferSize(
-               sampleRateInHz, channelConfig, AudioFormat.ENCODING_PCM_16BIT)
-        / bytesPerFrame;
-  }
-
-  // Returns the native input buffer size for input streams.
-  private int getLowLatencyInputFramesPerBuffer() {
-    assertTrue(isLowLatencyInputSupported());
-    return getLowLatencyOutputFramesPerBuffer();
-  }
-
-  // Returns the minimum input buffer size for Java based audio (AudioRecord).
-  // This size can calso be used for OpenSL ES implementations on devices that
-  // lacks support of low-latency input.
-  private static int getMinInputFrameSize(int sampleRateInHz, int numChannels) {
-    final int bytesPerFrame = numChannels * (BITS_PER_SAMPLE / 8);
-    final int channelConfig =
-        (numChannels == 1 ? AudioFormat.CHANNEL_IN_MONO : AudioFormat.CHANNEL_IN_STEREO);
-    return AudioRecord.getMinBufferSize(
-               sampleRateInHz, channelConfig, AudioFormat.ENCODING_PCM_16BIT)
-        / bytesPerFrame;
-  }
-
-  // Helper method which throws an exception  when an assertion has failed.
-  private static void assertTrue(boolean condition) {
-    if (!condition) {
-      throw new AssertionError("Expected condition to be true");
-    }
-  }
-
-  private native void nativeCacheAudioParameters(int sampleRate, int outputChannels,
-      int inputChannels, boolean hardwareAEC, boolean hardwareAGC, boolean hardwareNS,
-      boolean lowLatencyOutput, boolean lowLatencyInput, boolean proAudio, boolean aAudio,
-      int outputBufferSize, int inputBufferSize, long nativeAudioManager);
-}

+ 0 - 409
libwebrtc/src/main/java/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioRecord.java

@@ -1,409 +0,0 @@
-/*
- *  Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-package org.webrtc.voiceengine;
-
-import android.media.AudioFormat;
-import android.media.AudioRecord;
-import android.media.MediaRecorder.AudioSource;
-import android.os.Build;
-import android.os.Process;
-
-import java.lang.System;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import java.util.concurrent.TimeUnit;
-import org.webrtc.Logging;
-import org.webrtc.ThreadUtils;
-
-public class WebRtcAudioRecord {
-  private static final boolean DEBUG = false;
-
-  private static final String TAG = "WebRtcAudioRecord";
-
-  // Default audio data format is PCM 16 bit per sample.
-  // Guaranteed to be supported by all devices.
-  private static final int BITS_PER_SAMPLE = 16;
-
-  // Requested size of each recorded buffer provided to the client.
-  private static final int CALLBACK_BUFFER_SIZE_MS = 10;
-
-  // Average number of callbacks per second.
-  private static final int BUFFERS_PER_SECOND = 1000 / CALLBACK_BUFFER_SIZE_MS;
-
-  // We ask for a native buffer size of BUFFER_SIZE_FACTOR * (minimum required
-  // buffer size). The extra space is allocated to guard against glitches under
-  // high load.
-  private static final int BUFFER_SIZE_FACTOR = 2;
-
-  // The AudioRecordJavaThread is allowed to wait for successful call to join()
-  // but the wait times out afther this amount of time.
-  private static final long AUDIO_RECORD_THREAD_JOIN_TIMEOUT_MS = 2000;
-
-  private static final int DEFAULT_AUDIO_SOURCE = getDefaultAudioSource();
-  private static int audioSource = DEFAULT_AUDIO_SOURCE;
-
-  private final long nativeAudioRecord;
-
-  private   WebRtcAudioEffects effects;
-
-  private ByteBuffer byteBuffer;
-
-  private   AudioRecord audioRecord;
-  private   AudioRecordThread audioThread;
-
-  private static volatile boolean microphoneMute;
-  private byte[] emptyBytes;
-
-  // Audio recording error handler functions.
-  public enum AudioRecordStartErrorCode {
-    AUDIO_RECORD_START_EXCEPTION,
-    AUDIO_RECORD_START_STATE_MISMATCH,
-  }
-
-  public static interface WebRtcAudioRecordErrorCallback {
-    void onWebRtcAudioRecordInitError(String errorMessage);
-    void onWebRtcAudioRecordStartError(AudioRecordStartErrorCode errorCode, String errorMessage);
-    void onWebRtcAudioRecordError(String errorMessage);
-  }
-
-  private static   WebRtcAudioRecordErrorCallback errorCallback;
-
-  public static void setErrorCallback(WebRtcAudioRecordErrorCallback errorCallback) {
-    Logging.d(TAG, "Set error callback");
-    WebRtcAudioRecord.errorCallback = errorCallback;
-  }
-
-  /**
-   * Contains audio sample information. Object is passed using {@link
-   * WebRtcAudioRecord.WebRtcAudioRecordSamplesReadyCallback}
-   */
-  public static class AudioSamples {
-    /** See {@link AudioRecord#getAudioFormat()} */
-    private final int audioFormat;
-    /** See {@link AudioRecord#getChannelCount()} */
-    private final int channelCount;
-    /** See {@link AudioRecord#getSampleRate()} */
-    private final int sampleRate;
-
-    private final byte[] data;
-
-    private AudioSamples(AudioRecord audioRecord, byte[] data) {
-      this.audioFormat = audioRecord.getAudioFormat();
-      this.channelCount = audioRecord.getChannelCount();
-      this.sampleRate = audioRecord.getSampleRate();
-      this.data = data;
-    }
-
-    public int getAudioFormat() {
-      return audioFormat;
-    }
-
-    public int getChannelCount() {
-      return channelCount;
-    }
-
-    public int getSampleRate() {
-      return sampleRate;
-    }
-
-    public byte[] getData() {
-      return data;
-    }
-  }
-
-  /** Called when new audio samples are ready. This should only be set for debug purposes */
-  public static interface WebRtcAudioRecordSamplesReadyCallback {
-    void onWebRtcAudioRecordSamplesReady(AudioSamples samples);
-  }
-
-  private static   WebRtcAudioRecordSamplesReadyCallback audioSamplesReadyCallback;
-
-  public static void setOnAudioSamplesReady(WebRtcAudioRecordSamplesReadyCallback callback) {
-    audioSamplesReadyCallback = callback;
-  }
-
-  /**
-   * Audio thread which keeps calling ByteBuffer.read() waiting for audio
-   * to be recorded. Feeds recorded data to the native counterpart as a
-   * periodic sequence of callbacks using DataIsRecorded().
-   * This thread uses a Process.THREAD_PRIORITY_URGENT_AUDIO priority.
-   */
-  private class AudioRecordThread extends Thread {
-    private volatile boolean keepAlive = true;
-
-    public AudioRecordThread(String name) {
-      super(name);
-    }
-
-    // TODO(titovartem) make correct fix during webrtc:9175
-    @SuppressWarnings("ByteBufferBackingArray")
-    @Override
-    public void run() {
-      Process.setThreadPriority(Process.THREAD_PRIORITY_URGENT_AUDIO);
-      Logging.d(TAG, "AudioRecordThread" + WebRtcAudioUtils.getThreadInfo());
-      assertTrue(audioRecord.getRecordingState() == AudioRecord.RECORDSTATE_RECORDING);
-
-      long lastTime = System.nanoTime();
-      while (keepAlive) {
-        int bytesRead = audioRecord.read(byteBuffer, byteBuffer.capacity());
-        if (bytesRead == byteBuffer.capacity()) {
-          if (microphoneMute) {
-            byteBuffer.clear();
-            byteBuffer.put(emptyBytes);
-          }
-          // It's possible we've been shut down during the read, and stopRecording() tried and
-          // failed to join this thread. To be a bit safer, try to avoid calling any native methods
-          // in case they've been unregistered after stopRecording() returned.
-          if (keepAlive) {
-            nativeDataIsRecorded(bytesRead, nativeAudioRecord);
-          }
-          if (audioSamplesReadyCallback != null) {
-            // Copy the entire byte buffer array.  Assume that the start of the byteBuffer is
-            // at index 0.
-            byte[] data = Arrays.copyOf(byteBuffer.array(), byteBuffer.capacity());
-            audioSamplesReadyCallback.onWebRtcAudioRecordSamplesReady(
-                new AudioSamples(audioRecord, data));
-          }
-        } else {
-          String errorMessage = "AudioRecord.read failed: " + bytesRead;
-          Logging.e(TAG, errorMessage);
-          if (bytesRead == AudioRecord.ERROR_INVALID_OPERATION) {
-            keepAlive = false;
-            reportWebRtcAudioRecordError(errorMessage);
-          }
-        }
-        if (DEBUG) {
-          long nowTime = System.nanoTime();
-          long durationInMs = TimeUnit.NANOSECONDS.toMillis((nowTime - lastTime));
-          lastTime = nowTime;
-          Logging.d(TAG, "bytesRead[" + durationInMs + "] " + bytesRead);
-        }
-      }
-
-      try {
-        if (audioRecord != null) {
-          audioRecord.stop();
-        }
-      } catch (IllegalStateException e) {
-        Logging.e(TAG, "AudioRecord.stop failed: " + e.getMessage());
-      }
-    }
-
-    // Stops the inner thread loop and also calls AudioRecord.stop().
-    // Does not block the calling thread.
-    public void stopThread() {
-      Logging.d(TAG, "stopThread");
-      keepAlive = false;
-    }
-  }
-
-  WebRtcAudioRecord(long nativeAudioRecord) {
-    Logging.d(TAG, "ctor" + WebRtcAudioUtils.getThreadInfo());
-    this.nativeAudioRecord = nativeAudioRecord;
-    if (DEBUG) {
-      WebRtcAudioUtils.logDeviceInfo(TAG);
-    }
-    effects = WebRtcAudioEffects.create();
-  }
-
-  private boolean enableBuiltInAEC(boolean enable) {
-    Logging.d(TAG, "enableBuiltInAEC(" + enable + ')');
-    if (effects == null) {
-      Logging.e(TAG, "Built-in AEC is not supported on this platform");
-      return false;
-    }
-    return effects.setAEC(enable);
-  }
-
-  private boolean enableBuiltInNS(boolean enable) {
-    Logging.d(TAG, "enableBuiltInNS(" + enable + ')');
-    if (effects == null) {
-      Logging.e(TAG, "Built-in NS is not supported on this platform");
-      return false;
-    }
-    return effects.setNS(enable);
-  }
-
-  private int initRecording(int sampleRate, int channels) {
-    Logging.d(TAG, "initRecording(sampleRate=" + sampleRate + ", channels=" + channels + ")");
-    if (audioRecord != null) {
-      reportWebRtcAudioRecordInitError("InitRecording called twice without StopRecording.");
-      return -1;
-    }
-    final int bytesPerFrame = channels * (BITS_PER_SAMPLE / 8);
-    final int framesPerBuffer = sampleRate / BUFFERS_PER_SECOND;
-    byteBuffer = ByteBuffer.allocateDirect(bytesPerFrame * framesPerBuffer);
-    Logging.d(TAG, "byteBuffer.capacity: " + byteBuffer.capacity());
-    emptyBytes = new byte[byteBuffer.capacity()];
-    // Rather than passing the ByteBuffer with every callback (requiring
-    // the potentially expensive GetDirectBufferAddress) we simply have the
-    // the native class cache the address to the memory once.
-    nativeCacheDirectBufferAddress(byteBuffer, nativeAudioRecord);
-
-    // Get the minimum buffer size required for the successful creation of
-    // an AudioRecord object, in byte units.
-    // Note that this size doesn't guarantee a smooth recording under load.
-    final int channelConfig = channelCountToConfiguration(channels);
-    int minBufferSize =
-        AudioRecord.getMinBufferSize(sampleRate, channelConfig, AudioFormat.ENCODING_PCM_16BIT);
-    if (minBufferSize == AudioRecord.ERROR || minBufferSize == AudioRecord.ERROR_BAD_VALUE) {
-      reportWebRtcAudioRecordInitError("AudioRecord.getMinBufferSize failed: " + minBufferSize);
-      return -1;
-    }
-    Logging.d(TAG, "AudioRecord.getMinBufferSize: " + minBufferSize);
-
-    // Use a larger buffer size than the minimum required when creating the
-    // AudioRecord instance to ensure smooth recording under load. It has been
-    // verified that it does not increase the actual recording latency.
-    int bufferSizeInBytes = Math.max(BUFFER_SIZE_FACTOR * minBufferSize, byteBuffer.capacity());
-    Logging.d(TAG, "bufferSizeInBytes: " + bufferSizeInBytes);
-    try {
-      audioRecord = new AudioRecord(audioSource, sampleRate, channelConfig,
-          AudioFormat.ENCODING_PCM_16BIT, bufferSizeInBytes);
-    } catch (IllegalArgumentException e) {
-      reportWebRtcAudioRecordInitError("AudioRecord ctor error: " + e.getMessage());
-      releaseAudioResources();
-      return -1;
-    }
-    if (audioRecord == null || audioRecord.getState() != AudioRecord.STATE_INITIALIZED) {
-      reportWebRtcAudioRecordInitError("Failed to create a new AudioRecord instance");
-      releaseAudioResources();
-      return -1;
-    }
-    if (effects != null) {
-      effects.enable(audioRecord.getAudioSessionId());
-    }
-    logMainParameters();
-    logMainParametersExtended();
-    return framesPerBuffer;
-  }
-
-  private boolean startRecording() {
-    Logging.d(TAG, "startRecording");
-    assertTrue(audioRecord != null);
-    assertTrue(audioThread == null);
-    try {
-      audioRecord.startRecording();
-    } catch (IllegalStateException e) {
-      reportWebRtcAudioRecordStartError(AudioRecordStartErrorCode.AUDIO_RECORD_START_EXCEPTION,
-          "AudioRecord.startRecording failed: " + e.getMessage());
-      return false;
-    }
-    if (audioRecord.getRecordingState() != AudioRecord.RECORDSTATE_RECORDING) {
-      reportWebRtcAudioRecordStartError(
-          AudioRecordStartErrorCode.AUDIO_RECORD_START_STATE_MISMATCH,
-          "AudioRecord.startRecording failed - incorrect state :"
-          + audioRecord.getRecordingState());
-      return false;
-    }
-    audioThread = new AudioRecordThread("AudioRecordJavaThread");
-    audioThread.start();
-    return true;
-  }
-
-  private boolean stopRecording() {
-    Logging.d(TAG, "stopRecording");
-    assertTrue(audioThread != null);
-    audioThread.stopThread();
-    if (!ThreadUtils.joinUninterruptibly(audioThread, AUDIO_RECORD_THREAD_JOIN_TIMEOUT_MS)) {
-      Logging.e(TAG, "Join of AudioRecordJavaThread timed out");
-      WebRtcAudioUtils.logAudioState(TAG);
-    }
-    audioThread = null;
-    if (effects != null) {
-      effects.release();
-    }
-    releaseAudioResources();
-    return true;
-  }
-
-  private void logMainParameters() {
-    Logging.d(TAG, "AudioRecord: "
-            + "session ID: " + audioRecord.getAudioSessionId() + ", "
-            + "channels: " + audioRecord.getChannelCount() + ", "
-            + "sample rate: " + audioRecord.getSampleRate());
-  }
-
-  private void logMainParametersExtended() {
-    if (Build.VERSION.SDK_INT >= 23) {
-      Logging.d(TAG, "AudioRecord: "
-              // The frame count of the native AudioRecord buffer.
-              + "buffer size in frames: " + audioRecord.getBufferSizeInFrames());
-    }
-  }
-
-  // Helper method which throws an exception  when an assertion has failed.
-  private static void assertTrue(boolean condition) {
-    if (!condition) {
-      throw new AssertionError("Expected condition to be true");
-    }
-  }
-
-  private int channelCountToConfiguration(int channels) {
-    return (channels == 1 ? AudioFormat.CHANNEL_IN_MONO : AudioFormat.CHANNEL_IN_STEREO);
-  }
-
-  private native void nativeCacheDirectBufferAddress(ByteBuffer byteBuffer, long nativeAudioRecord);
-
-  private native void nativeDataIsRecorded(int bytes, long nativeAudioRecord);
-
-  @SuppressWarnings("NoSynchronizedMethodCheck")
-  public static synchronized void setAudioSource(int source) {
-    Logging.w(TAG, "Audio source is changed from: " + audioSource
-            + " to " + source);
-    audioSource = source;
-  }
-
-  private static int getDefaultAudioSource() {
-    return AudioSource.VOICE_COMMUNICATION;
-  }
-
-  // Sets all recorded samples to zero if |mute| is true, i.e., ensures that
-  // the microphone is muted.
-  public static void setMicrophoneMute(boolean mute) {
-    Logging.w(TAG, "setMicrophoneMute(" + mute + ")");
-    microphoneMute = mute;
-  }
-
-  // Releases the native AudioRecord resources.
-  private void releaseAudioResources() {
-    Logging.d(TAG, "releaseAudioResources");
-    if (audioRecord != null) {
-      audioRecord.release();
-      audioRecord = null;
-    }
-  }
-
-  private void reportWebRtcAudioRecordInitError(String errorMessage) {
-    Logging.e(TAG, "Init recording error: " + errorMessage);
-    WebRtcAudioUtils.logAudioState(TAG);
-    if (errorCallback != null) {
-      errorCallback.onWebRtcAudioRecordInitError(errorMessage);
-    }
-  }
-
-  private void reportWebRtcAudioRecordStartError(
-      AudioRecordStartErrorCode errorCode, String errorMessage) {
-    Logging.e(TAG, "Start recording error: " + errorCode + ". " + errorMessage);
-    WebRtcAudioUtils.logAudioState(TAG);
-    if (errorCallback != null) {
-      errorCallback.onWebRtcAudioRecordStartError(errorCode, errorMessage);
-    }
-  }
-
-  private void reportWebRtcAudioRecordError(String errorMessage) {
-    Logging.e(TAG, "Run-time recording error: " + errorMessage);
-    WebRtcAudioUtils.logAudioState(TAG);
-    if (errorCallback != null) {
-      errorCallback.onWebRtcAudioRecordError(errorMessage);
-    }
-  }
-}

+ 0 - 524
libwebrtc/src/main/java/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java

@@ -1,524 +0,0 @@
-/*
- *  Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-package org.webrtc.voiceengine;
-
-import android.annotation.TargetApi;
-import android.content.Context;
-import android.media.AudioAttributes;
-import android.media.AudioFormat;
-import android.media.AudioManager;
-import android.media.AudioTrack;
-import android.os.Build;
-import android.os.Process;
-
-import org.webrtc.ContextUtils;
-import org.webrtc.Logging;
-import org.webrtc.ThreadUtils;
-
-import java.nio.ByteBuffer;
-
-public class WebRtcAudioTrack {
-  private static final boolean DEBUG = false;
-
-  private static final String TAG = "WebRtcAudioTrack";
-
-  // Default audio data format is PCM 16 bit per sample.
-  // Guaranteed to be supported by all devices.
-  private static final int BITS_PER_SAMPLE = 16;
-
-  // Requested size of each recorded buffer provided to the client.
-  private static final int CALLBACK_BUFFER_SIZE_MS = 10;
-
-  // Average number of callbacks per second.
-  private static final int BUFFERS_PER_SECOND = 1000 / CALLBACK_BUFFER_SIZE_MS;
-
-  // The AudioTrackThread is allowed to wait for successful call to join()
-  // but the wait times out afther this amount of time.
-  private static final long AUDIO_TRACK_THREAD_JOIN_TIMEOUT_MS = 2000;
-
-  // By default, WebRTC creates audio tracks with a usage attribute
-  // corresponding to voice communications, such as telephony or VoIP.
-  private static final int DEFAULT_USAGE = getDefaultUsageAttribute();
-  private static int usageAttribute = DEFAULT_USAGE;
-
-  // This method overrides the default usage attribute and allows the user
-  // to set it to something else than AudioAttributes.USAGE_VOICE_COMMUNICATION.
-  // NOTE: calling this method will most likely break existing VoIP tuning.
-  // TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
-  @SuppressWarnings("NoSynchronizedMethodCheck")
-  public static synchronized void setAudioTrackUsageAttribute(int usage) {
-    Logging.w(TAG, "Default usage attribute is changed from: "
-        + DEFAULT_USAGE + " to " + usage);
-    usageAttribute = usage;
-  }
-
-  private static int getDefaultUsageAttribute() {
-    if (Build.VERSION.SDK_INT >= 21) {
-      return AudioAttributes.USAGE_VOICE_COMMUNICATION;
-    } else {
-      // Not used on SDKs lower than 21.
-      return 0;
-    }
-  }
-
-  private final long nativeAudioTrack;
-  private final AudioManager audioManager;
-  private final ThreadUtils.ThreadChecker threadChecker = new ThreadUtils.ThreadChecker();
-
-  private ByteBuffer byteBuffer;
-
-  private   AudioTrack audioTrack;
-  private   AudioTrackThread audioThread;
-
-  // Samples to be played are replaced by zeros if |speakerMute| is set to true.
-  // Can be used to ensure that the speaker is fully muted.
-  private static volatile boolean speakerMute;
-  private byte[] emptyBytes;
-
-  // Audio playout/track error handler functions.
-  public enum AudioTrackStartErrorCode {
-    AUDIO_TRACK_START_EXCEPTION,
-    AUDIO_TRACK_START_STATE_MISMATCH,
-  }
-
-  @Deprecated
-  public static interface WebRtcAudioTrackErrorCallback {
-    void onWebRtcAudioTrackInitError(String errorMessage);
-    void onWebRtcAudioTrackStartError(String errorMessage);
-    void onWebRtcAudioTrackError(String errorMessage);
-  }
-
-  // TODO(henrika): upgrade all clients to use this new interface instead.
-  public static interface ErrorCallback {
-    void onWebRtcAudioTrackInitError(String errorMessage);
-    void onWebRtcAudioTrackStartError(AudioTrackStartErrorCode errorCode, String errorMessage);
-    void onWebRtcAudioTrackError(String errorMessage);
-  }
-
-  private static   WebRtcAudioTrackErrorCallback errorCallbackOld;
-  private static   ErrorCallback errorCallback;
-
-  @Deprecated
-  public static void setErrorCallback(WebRtcAudioTrackErrorCallback errorCallback) {
-    Logging.d(TAG, "Set error callback (deprecated");
-    WebRtcAudioTrack.errorCallbackOld = errorCallback;
-  }
-
-  public static void setErrorCallback(ErrorCallback errorCallback) {
-    Logging.d(TAG, "Set extended error callback");
-    WebRtcAudioTrack.errorCallback = errorCallback;
-  }
-
-  /**
-   * Audio thread which keeps calling AudioTrack.write() to stream audio.
-   * Data is periodically acquired from the native WebRTC layer using the
-   * nativeGetPlayoutData callback function.
-   * This thread uses a Process.THREAD_PRIORITY_URGENT_AUDIO priority.
-   */
-  private class AudioTrackThread extends Thread {
-    private volatile boolean keepAlive = true;
-
-    public AudioTrackThread(String name) {
-      super(name);
-    }
-
-    @Override
-    public void run() {
-      Process.setThreadPriority(Process.THREAD_PRIORITY_URGENT_AUDIO);
-      Logging.d(TAG, "AudioTrackThread" + WebRtcAudioUtils.getThreadInfo());
-      assertTrue(audioTrack.getPlayState() == AudioTrack.PLAYSTATE_PLAYING);
-
-      // Fixed size in bytes of each 10ms block of audio data that we ask for
-      // using callbacks to the native WebRTC client.
-      final int sizeInBytes = byteBuffer.capacity();
-
-      while (keepAlive) {
-        // Get 10ms of PCM data from the native WebRTC client. Audio data is
-        // written into the common ByteBuffer using the address that was
-        // cached at construction.
-        nativeGetPlayoutData(sizeInBytes, nativeAudioTrack);
-        // Write data until all data has been written to the audio sink.
-        // Upon return, the buffer position will have been advanced to reflect
-        // the amount of data that was successfully written to the AudioTrack.
-        assertTrue(sizeInBytes <= byteBuffer.remaining());
-        if (speakerMute) {
-          byteBuffer.clear();
-          byteBuffer.put(emptyBytes);
-          byteBuffer.position(0);
-        }
-        int bytesWritten = writeBytes(audioTrack, byteBuffer, sizeInBytes);
-        if (bytesWritten != sizeInBytes) {
-          Logging.e(TAG, "AudioTrack.write played invalid number of bytes: " + bytesWritten);
-          // If a write() returns a negative value, an error has occurred.
-          // Stop playing and report an error in this case.
-          if (bytesWritten < 0) {
-            keepAlive = false;
-            reportWebRtcAudioTrackError("AudioTrack.write failed: " + bytesWritten);
-          }
-        }
-        // The byte buffer must be rewinded since byteBuffer.position() is
-        // increased at each call to AudioTrack.write(). If we don't do this,
-        // next call to AudioTrack.write() will fail.
-        byteBuffer.rewind();
-
-        // TODO(henrika): it is possible to create a delay estimate here by
-        // counting number of written frames and subtracting the result from
-        // audioTrack.getPlaybackHeadPosition().
-      }
-
-      // Stops playing the audio data. Since the instance was created in
-      // MODE_STREAM mode, audio will stop playing after the last buffer that
-      // was written has been played.
-      if (audioTrack != null) {
-        Logging.d(TAG, "Calling AudioTrack.stop...");
-        try {
-          audioTrack.stop();
-          Logging.d(TAG, "AudioTrack.stop is done.");
-        } catch (IllegalStateException e) {
-          Logging.e(TAG, "AudioTrack.stop failed: " + e.getMessage());
-        }
-      }
-    }
-
-    private int writeBytes(AudioTrack audioTrack, ByteBuffer byteBuffer, int sizeInBytes) {
-      if (Build.VERSION.SDK_INT >= 21) {
-        return audioTrack.write(byteBuffer, sizeInBytes, AudioTrack.WRITE_BLOCKING);
-      } else {
-        return audioTrack.write(byteBuffer.array(), byteBuffer.arrayOffset(), sizeInBytes);
-      }
-    }
-
-    // Stops the inner thread loop which results in calling AudioTrack.stop().
-    // Does not block the calling thread.
-    public void stopThread() {
-      Logging.d(TAG, "stopThread");
-      keepAlive = false;
-    }
-  }
-
-  WebRtcAudioTrack(long nativeAudioTrack) {
-    threadChecker.checkIsOnValidThread();
-    Logging.d(TAG, "ctor" + WebRtcAudioUtils.getThreadInfo());
-    this.nativeAudioTrack = nativeAudioTrack;
-    audioManager =
-        (AudioManager) ContextUtils.getApplicationContext().getSystemService(Context.AUDIO_SERVICE);
-    if (DEBUG) {
-      WebRtcAudioUtils.logDeviceInfo(TAG);
-    }
-  }
-
-  private boolean initPlayout(int sampleRate, int channels) {
-    threadChecker.checkIsOnValidThread();
-    Logging.d(TAG, "initPlayout(sampleRate=" + sampleRate + ", channels=" + channels + ")");
-    final int bytesPerFrame = channels * (BITS_PER_SAMPLE / 8);
-    byteBuffer = ByteBuffer.allocateDirect(bytesPerFrame * (sampleRate / BUFFERS_PER_SECOND));
-    Logging.d(TAG, "byteBuffer.capacity: " + byteBuffer.capacity());
-    emptyBytes = new byte[byteBuffer.capacity()];
-    // Rather than passing the ByteBuffer with every callback (requiring
-    // the potentially expensive GetDirectBufferAddress) we simply have the
-    // the native class cache the address to the memory once.
-    nativeCacheDirectBufferAddress(byteBuffer, nativeAudioTrack);
-
-    // Get the minimum buffer size required for the successful creation of an
-    // AudioTrack object to be created in the MODE_STREAM mode.
-    // Note that this size doesn't guarantee a smooth playback under load.
-    // TODO(henrika): should we extend the buffer size to avoid glitches?
-    final int channelConfig = channelCountToConfiguration(channels);
-    final int minBufferSizeInBytes =
-        AudioTrack.getMinBufferSize(sampleRate, channelConfig, AudioFormat.ENCODING_PCM_16BIT);
-    Logging.d(TAG, "AudioTrack.getMinBufferSize: " + minBufferSizeInBytes);
-    // For the streaming mode, data must be written to the audio sink in
-    // chunks of size (given by byteBuffer.capacity()) less than or equal
-    // to the total buffer size |minBufferSizeInBytes|. But, we have seen
-    // reports of "getMinBufferSize(): error querying hardware". Hence, it
-    // can happen that |minBufferSizeInBytes| contains an invalid value.
-    if (minBufferSizeInBytes < byteBuffer.capacity()) {
-      reportWebRtcAudioTrackInitError("AudioTrack.getMinBufferSize returns an invalid value.");
-      return false;
-    }
-
-    // Ensure that prevision audio session was stopped correctly before trying
-    // to create a new AudioTrack.
-    if (audioTrack != null) {
-      reportWebRtcAudioTrackInitError("Conflict with existing AudioTrack.");
-      return false;
-    }
-    try {
-      // Create an AudioTrack object and initialize its associated audio buffer.
-      // The size of this buffer determines how long an AudioTrack can play
-      // before running out of data.
-      if (Build.VERSION.SDK_INT >= 21) {
-        // If we are on API level 21 or higher, it is possible to use a special AudioTrack
-        // constructor that uses AudioAttributes and AudioFormat as input. It allows us to
-        // supersede the notion of stream types for defining the behavior of audio playback,
-        // and to allow certain platforms or routing policies to use this information for more
-        // refined volume or routing decisions.
-        audioTrack = createAudioTrackOnLollipopOrHigher(
-            sampleRate, channelConfig, minBufferSizeInBytes);
-      } else {
-        // Use default constructor for API levels below 21.
-        audioTrack =
-            createAudioTrackOnLowerThanLollipop(sampleRate, channelConfig, minBufferSizeInBytes);
-      }
-    } catch (IllegalArgumentException e) {
-      reportWebRtcAudioTrackInitError(e.getMessage());
-      releaseAudioResources();
-      return false;
-    }
-
-    // It can happen that an AudioTrack is created but it was not successfully
-    // initialized upon creation. Seems to be the case e.g. when the maximum
-    // number of globally available audio tracks is exceeded.
-    if (audioTrack == null || audioTrack.getState() != AudioTrack.STATE_INITIALIZED) {
-      reportWebRtcAudioTrackInitError("Initialization of audio track failed.");
-      releaseAudioResources();
-      return false;
-    }
-    logMainParameters();
-    logMainParametersExtended();
-    return true;
-  }
-
-  private boolean startPlayout() {
-    threadChecker.checkIsOnValidThread();
-    Logging.d(TAG, "startPlayout");
-    assertTrue(audioTrack != null);
-    assertTrue(audioThread == null);
-
-    // Starts playing an audio track.
-    try {
-      audioTrack.play();
-    } catch (IllegalStateException e) {
-      reportWebRtcAudioTrackStartError(AudioTrackStartErrorCode.AUDIO_TRACK_START_EXCEPTION,
-          "AudioTrack.play failed: " + e.getMessage());
-      releaseAudioResources();
-      return false;
-    }
-    if (audioTrack.getPlayState() != AudioTrack.PLAYSTATE_PLAYING) {
-      reportWebRtcAudioTrackStartError(
-          AudioTrackStartErrorCode.AUDIO_TRACK_START_STATE_MISMATCH,
-          "AudioTrack.play failed - incorrect state :"
-          + audioTrack.getPlayState());
-      releaseAudioResources();
-      return false;
-    }
-
-    // Create and start new high-priority thread which calls AudioTrack.write()
-    // and where we also call the native nativeGetPlayoutData() callback to
-    // request decoded audio from WebRTC.
-    audioThread = new AudioTrackThread("AudioTrackJavaThread");
-    audioThread.start();
-    return true;
-  }
-
-  private boolean stopPlayout() {
-    threadChecker.checkIsOnValidThread();
-    Logging.d(TAG, "stopPlayout");
-    assertTrue(audioThread != null);
-    logUnderrunCount();
-    audioThread.stopThread();
-
-    Logging.d(TAG, "Stopping the AudioTrackThread...");
-    audioThread.interrupt();
-    if (!ThreadUtils.joinUninterruptibly(audioThread, AUDIO_TRACK_THREAD_JOIN_TIMEOUT_MS)) {
-      Logging.e(TAG, "Join of AudioTrackThread timed out.");
-      WebRtcAudioUtils.logAudioState(TAG);
-    }
-    Logging.d(TAG, "AudioTrackThread has now been stopped.");
-    audioThread = null;
-    releaseAudioResources();
-    return true;
-  }
-
-  // Get max possible volume index for a phone call audio stream.
-  private int getStreamMaxVolume() {
-    threadChecker.checkIsOnValidThread();
-    Logging.d(TAG, "getStreamMaxVolume");
-    assertTrue(audioManager != null);
-    return audioManager.getStreamMaxVolume(AudioManager.STREAM_VOICE_CALL);
-  }
-
-  // Set current volume level for a phone call audio stream.
-  private boolean setStreamVolume(int volume) {
-    threadChecker.checkIsOnValidThread();
-    Logging.d(TAG, "setStreamVolume(" + volume + ")");
-    assertTrue(audioManager != null);
-    if (isVolumeFixed()) {
-      Logging.e(TAG, "The device implements a fixed volume policy.");
-      return false;
-    }
-    audioManager.setStreamVolume(AudioManager.STREAM_VOICE_CALL, volume, 0);
-    return true;
-  }
-
-  private boolean isVolumeFixed() {
-    if (Build.VERSION.SDK_INT < 21)
-      return false;
-    return audioManager.isVolumeFixed();
-  }
-
-  /** Get current volume level for a phone call audio stream. */
-  private int getStreamVolume() {
-    threadChecker.checkIsOnValidThread();
-    Logging.d(TAG, "getStreamVolume");
-    assertTrue(audioManager != null);
-    return audioManager.getStreamVolume(AudioManager.STREAM_VOICE_CALL);
-  }
-
-  private void logMainParameters() {
-    Logging.d(TAG, "AudioTrack: "
-            + "session ID: " + audioTrack.getAudioSessionId() + ", "
-            + "channels: " + audioTrack.getChannelCount() + ", "
-            + "sample rate: " + audioTrack.getSampleRate() + ", "
-            // Gain (>=1.0) expressed as linear multiplier on sample values.
-            + "max gain: " + AudioTrack.getMaxVolume());
-  }
-
-  // Creates and AudioTrack instance using AudioAttributes and AudioFormat as input.
-  // It allows certain platforms or routing policies to use this information for more
-  // refined volume or routing decisions.
-  @TargetApi(21)
-  private static AudioTrack createAudioTrackOnLollipopOrHigher(
-      int sampleRateInHz, int channelConfig, int bufferSizeInBytes) {
-    Logging.d(TAG, "createAudioTrackOnLollipopOrHigher");
-    // TODO(henrika): use setPerformanceMode(int) with PERFORMANCE_MODE_LOW_LATENCY to control
-    // performance when Android O is supported. Add some logging in the mean time.
-    final int nativeOutputSampleRate =
-        AudioTrack.getNativeOutputSampleRate(AudioManager.STREAM_VOICE_CALL);
-    Logging.d(TAG, "nativeOutputSampleRate: " + nativeOutputSampleRate);
-    if (sampleRateInHz != nativeOutputSampleRate) {
-      Logging.w(TAG, "Unable to use fast mode since requested sample rate is not native");
-    }
-    if (usageAttribute != DEFAULT_USAGE) {
-      Logging.w(TAG, "A non default usage attribute is used: " + usageAttribute);
-    }
-    // Create an audio track where the audio usage is for VoIP and the content type is speech.
-    return new AudioTrack(
-        new AudioAttributes.Builder()
-            .setUsage(usageAttribute)
-            .setContentType(AudioAttributes.CONTENT_TYPE_SPEECH)
-        .build(),
-        new AudioFormat.Builder()
-          .setEncoding(AudioFormat.ENCODING_PCM_16BIT)
-          .setSampleRate(sampleRateInHz)
-          .setChannelMask(channelConfig)
-          .build(),
-        bufferSizeInBytes,
-        AudioTrack.MODE_STREAM,
-        AudioManager.AUDIO_SESSION_ID_GENERATE);
-  }
-
-  @SuppressWarnings("deprecation") // Deprecated in API level 25.
-  private static AudioTrack createAudioTrackOnLowerThanLollipop(
-      int sampleRateInHz, int channelConfig, int bufferSizeInBytes) {
-    return new AudioTrack(AudioManager.STREAM_VOICE_CALL, sampleRateInHz, channelConfig,
-        AudioFormat.ENCODING_PCM_16BIT, bufferSizeInBytes, AudioTrack.MODE_STREAM);
-  }
-
-  private void logBufferSizeInFrames() {
-    if (Build.VERSION.SDK_INT >= 23) {
-      Logging.d(TAG, "AudioTrack: "
-              // The effective size of the AudioTrack buffer that the app writes to.
-              + "buffer size in frames: " + audioTrack.getBufferSizeInFrames());
-    }
-  }
-
-  private void logBufferCapacityInFrames() {
-    if (Build.VERSION.SDK_INT >= 24) {
-      Logging.d(TAG,
-          "AudioTrack: "
-              // Maximum size of the AudioTrack buffer in frames.
-              + "buffer capacity in frames: " + audioTrack.getBufferCapacityInFrames());
-    }
-  }
-
-  private void logMainParametersExtended() {
-    logBufferSizeInFrames();
-    logBufferCapacityInFrames();
-  }
-
-  // Prints the number of underrun occurrences in the application-level write
-  // buffer since the AudioTrack was created. An underrun occurs if the app does
-  // not write audio data quickly enough, causing the buffer to underflow and a
-  // potential audio glitch.
-  // TODO(henrika): keep track of this value in the field and possibly add new
-  // UMA stat if needed.
-  private void logUnderrunCount() {
-    if (Build.VERSION.SDK_INT >= 24) {
-      Logging.d(TAG, "underrun count: " + audioTrack.getUnderrunCount());
-    }
-  }
-
-  // Helper method which throws an exception  when an assertion has failed.
-  private static void assertTrue(boolean condition) {
-    if (!condition) {
-      throw new AssertionError("Expected condition to be true");
-    }
-  }
-
-  private int channelCountToConfiguration(int channels) {
-    return (channels == 1 ? AudioFormat.CHANNEL_OUT_MONO : AudioFormat.CHANNEL_OUT_STEREO);
-  }
-
-  private native void nativeCacheDirectBufferAddress(ByteBuffer byteBuffer, long nativeAudioRecord);
-
-  private native void nativeGetPlayoutData(int bytes, long nativeAudioRecord);
-
-  // Sets all samples to be played out to zero if |mute| is true, i.e.,
-  // ensures that the speaker is muted.
-  public static void setSpeakerMute(boolean mute) {
-    Logging.w(TAG, "setSpeakerMute(" + mute + ")");
-    speakerMute = mute;
-  }
-
-  // Releases the native AudioTrack resources.
-  private void releaseAudioResources() {
-    Logging.d(TAG, "releaseAudioResources");
-    if (audioTrack != null) {
-      audioTrack.release();
-      audioTrack = null;
-    }
-  }
-
-  private void reportWebRtcAudioTrackInitError(String errorMessage) {
-    Logging.e(TAG, "Init playout error: " + errorMessage);
-    WebRtcAudioUtils.logAudioState(TAG);
-    if (errorCallbackOld != null) {
-      errorCallbackOld.onWebRtcAudioTrackInitError(errorMessage);
-    }
-    if (errorCallback != null) {
-      errorCallback.onWebRtcAudioTrackInitError(errorMessage);
-    }
-  }
-
-  private void reportWebRtcAudioTrackStartError(
-      AudioTrackStartErrorCode errorCode, String errorMessage) {
-    Logging.e(TAG, "Start playout error: "  + errorCode + ". " + errorMessage);
-    WebRtcAudioUtils.logAudioState(TAG);
-    if (errorCallbackOld != null) {
-      errorCallbackOld.onWebRtcAudioTrackStartError(errorMessage);
-    }
-    if (errorCallback != null) {
-      errorCallback.onWebRtcAudioTrackStartError(errorCode, errorMessage);
-    }
-  }
-
-  private void reportWebRtcAudioTrackError(String errorMessage) {
-    Logging.e(TAG, "Run-time playback error: " + errorMessage);
-    WebRtcAudioUtils.logAudioState(TAG);
-    if (errorCallbackOld != null) {
-      errorCallbackOld.onWebRtcAudioTrackError(errorMessage);
-    }
-    if (errorCallback != null) {
-      errorCallback.onWebRtcAudioTrackError(errorMessage);
-    }
-  }
-}

+ 0 - 388
libwebrtc/src/main/java/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioUtils.java

@@ -1,388 +0,0 @@
-/*
- *  Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-package org.webrtc.voiceengine;
-
-import static android.media.AudioManager.MODE_IN_CALL;
-import static android.media.AudioManager.MODE_IN_COMMUNICATION;
-import static android.media.AudioManager.MODE_NORMAL;
-import static android.media.AudioManager.MODE_RINGTONE;
-
-import android.content.Context;
-import android.content.pm.PackageManager;
-import android.media.AudioDeviceInfo;
-import android.media.AudioManager;
-import android.media.AudioRecordingConfiguration;
-import android.media.MediaRecorder.AudioSource;
-import android.os.Build;
-import android.os.Process;
-import java.lang.Thread;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-import org.webrtc.ContextUtils;
-import org.webrtc.Logging;
-
-public final class WebRtcAudioUtils {
-  private static final String TAG = "WebRtcAudioUtils";
-
-  // List of devices where we have seen issues (e.g. bad audio quality) using
-  // the low latency output mode in combination with OpenSL ES.
-  // The device name is given by Build.MODEL.
-  private static final String[] BLACKLISTED_OPEN_SL_ES_MODELS = new String[] {
-      // It is recommended to maintain a list of blacklisted models outside
-      // this package and instead call
-      // WebRtcAudioManager.setBlacklistDeviceForOpenSLESUsage(true)
-      // from the client for devices where OpenSL ES shall be disabled.
-  };
-
-  // List of devices where it has been verified that the built-in effect
-  // bad and where it makes sense to avoid using it and instead rely on the
-  // native WebRTC version instead. The device name is given by Build.MODEL.
-  private static final String[] BLACKLISTED_AEC_MODELS = new String[] {
-      // It is recommended to maintain a list of blacklisted models outside
-      // this package and instead call setWebRtcBasedAcousticEchoCanceler(true)
-      // from the client for devices where the built-in AEC shall be disabled.
-  };
-  private static final String[] BLACKLISTED_NS_MODELS = new String[] {
-    // It is recommended to maintain a list of blacklisted models outside
-    // this package and instead call setWebRtcBasedNoiseSuppressor(true)
-    // from the client for devices where the built-in NS shall be disabled.
-  };
-
-  // Use 16kHz as the default sample rate. A higher sample rate might prevent
-  // us from supporting communication mode on some older (e.g. ICS) devices.
-  private static final int DEFAULT_SAMPLE_RATE_HZ = 16000;
-  private static int defaultSampleRateHz = DEFAULT_SAMPLE_RATE_HZ;
-  // Set to true if setDefaultSampleRateHz() has been called.
-  private static boolean isDefaultSampleRateOverridden;
-
-  // By default, utilize hardware based audio effects for AEC and NS when
-  // available.
-  private static boolean useWebRtcBasedAcousticEchoCanceler;
-  private static boolean useWebRtcBasedNoiseSuppressor;
-
-  // Call these methods if any hardware based effect shall be replaced by a
-  // software based version provided by the WebRTC stack instead.
-  // TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
-  @SuppressWarnings("NoSynchronizedMethodCheck")
-  public static synchronized void setWebRtcBasedAcousticEchoCanceler(boolean enable) {
-    useWebRtcBasedAcousticEchoCanceler = enable;
-  }
-
-    // TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
-  @SuppressWarnings("NoSynchronizedMethodCheck")
-  public static synchronized void setWebRtcBasedNoiseSuppressor(boolean enable) {
-    useWebRtcBasedNoiseSuppressor = enable;
-  }
-
-  // TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
-  @SuppressWarnings("NoSynchronizedMethodCheck")
-  public static synchronized void setWebRtcBasedAutomaticGainControl(boolean enable) {
-    // TODO(henrika): deprecated; remove when no longer used by any client.
-    Logging.w(TAG, "setWebRtcBasedAutomaticGainControl() is deprecated");
-  }
-
-  // TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
-  @SuppressWarnings("NoSynchronizedMethodCheck")
-  public static synchronized boolean useWebRtcBasedAcousticEchoCanceler() {
-    if (useWebRtcBasedAcousticEchoCanceler) {
-      Logging.w(TAG, "Overriding default behavior; now using WebRTC AEC!");
-    }
-    return useWebRtcBasedAcousticEchoCanceler;
-  }
-
-  // TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
-  @SuppressWarnings("NoSynchronizedMethodCheck")
-  public static synchronized boolean useWebRtcBasedNoiseSuppressor() {
-    if (useWebRtcBasedNoiseSuppressor) {
-      Logging.w(TAG, "Overriding default behavior; now using WebRTC NS!");
-    }
-    return useWebRtcBasedNoiseSuppressor;
-  }
-
-  // TODO(henrika): deprecated; remove when no longer used by any client.
-  // TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
-  @SuppressWarnings("NoSynchronizedMethodCheck")
-  public static synchronized boolean useWebRtcBasedAutomaticGainControl() {
-    // Always return true here to avoid trying to use any built-in AGC.
-    return true;
-  }
-
-  // Returns true if the device supports an audio effect (AEC or NS).
-  // Four conditions must be fulfilled if functions are to return true:
-  // 1) the platform must support the built-in (HW) effect,
-  // 2) explicit use (override) of a WebRTC based version must not be set,
-  // 3) the device must not be blacklisted for use of the effect, and
-  // 4) the UUID of the effect must be approved (some UUIDs can be excluded).
-  public static boolean isAcousticEchoCancelerSupported() {
-    return WebRtcAudioEffects.canUseAcousticEchoCanceler();
-  }
-  public static boolean isNoiseSuppressorSupported() {
-    return WebRtcAudioEffects.canUseNoiseSuppressor();
-  }
-  // TODO(henrika): deprecated; remove when no longer used by any client.
-  public static boolean isAutomaticGainControlSupported() {
-    // Always return false here to avoid trying to use any built-in AGC.
-    return false;
-  }
-
-  // Call this method if the default handling of querying the native sample
-  // rate shall be overridden. Can be useful on some devices where the
-  // available Android APIs are known to return invalid results.
-  // TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
-  @SuppressWarnings("NoSynchronizedMethodCheck")
-  public static synchronized void setDefaultSampleRateHz(int sampleRateHz) {
-    isDefaultSampleRateOverridden = true;
-    defaultSampleRateHz = sampleRateHz;
-  }
-
-  // TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
-  @SuppressWarnings("NoSynchronizedMethodCheck")
-  public static synchronized boolean isDefaultSampleRateOverridden() {
-    return isDefaultSampleRateOverridden;
-  }
-
-  // TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
-  @SuppressWarnings("NoSynchronizedMethodCheck")
-  public static synchronized int getDefaultSampleRateHz() {
-    return defaultSampleRateHz;
-  }
-
-  public static List<String> getBlackListedModelsForAecUsage() {
-    return Arrays.asList(WebRtcAudioUtils.BLACKLISTED_AEC_MODELS);
-  }
-
-  public static List<String> getBlackListedModelsForNsUsage() {
-    return Arrays.asList(WebRtcAudioUtils.BLACKLISTED_NS_MODELS);
-  }
-
-  // Helper method for building a string of thread information.
-  public static String getThreadInfo() {
-    return "@[name=" + Thread.currentThread().getName() + ", id=" + Thread.currentThread().getId()
-        + "]";
-  }
-
-  // Returns true if we're running on emulator.
-  public static boolean runningOnEmulator() {
-    return Build.HARDWARE.equals("goldfish") && Build.BRAND.startsWith("generic_");
-  }
-
-  // Returns true if the device is blacklisted for OpenSL ES usage.
-  public static boolean deviceIsBlacklistedForOpenSLESUsage() {
-    List<String> blackListedModels = Arrays.asList(BLACKLISTED_OPEN_SL_ES_MODELS);
-    return blackListedModels.contains(Build.MODEL);
-  }
-
-  // Information about the current build, taken from system properties.
-  static void logDeviceInfo(String tag) {
-    Logging.d(tag, "Android SDK: " + Build.VERSION.SDK_INT + ", "
-            + "Release: " + Build.VERSION.RELEASE + ", "
-            + "Brand: " + Build.BRAND + ", "
-            + "Device: " + Build.DEVICE + ", "
-            + "Id: " + Build.ID + ", "
-            + "Hardware: " + Build.HARDWARE + ", "
-            + "Manufacturer: " + Build.MANUFACTURER + ", "
-            + "Model: " + Build.MODEL + ", "
-            + "Product: " + Build.PRODUCT);
-  }
-
-  // Logs information about the current audio state. The idea is to call this
-  // method when errors are detected to log under what conditions the error
-  // occurred. Hopefully it will provide clues to what might be the root cause.
-  static void logAudioState(String tag) {
-    logDeviceInfo(tag);
-    final Context context = ContextUtils.getApplicationContext();
-    final AudioManager audioManager =
-        (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
-    logAudioStateBasic(tag, audioManager);
-    logAudioStateVolume(tag, audioManager);
-    logAudioDeviceInfo(tag, audioManager);
-  }
-
-  // Reports basic audio statistics.
-  private static void logAudioStateBasic(String tag, AudioManager audioManager) {
-    Logging.d(tag, "Audio State: "
-            + "audio mode: " + modeToString(audioManager.getMode()) + ", "
-            + "has mic: " + hasMicrophone() + ", "
-            + "mic muted: " + audioManager.isMicrophoneMute() + ", "
-            + "music active: " + audioManager.isMusicActive() + ", "
-            + "speakerphone: " + audioManager.isSpeakerphoneOn() + ", "
-            + "BT SCO: " + audioManager.isBluetoothScoOn());
-  }
-
-  private static boolean isVolumeFixed(AudioManager audioManager) {
-    if (Build.VERSION.SDK_INT < 21) {
-      return false;
-    }
-    return audioManager.isVolumeFixed();
-  }
-
-  // Adds volume information for all possible stream types.
-  private static void logAudioStateVolume(String tag, AudioManager audioManager) {
-    final int[] streams = {
-        AudioManager.STREAM_VOICE_CALL,
-        AudioManager.STREAM_MUSIC,
-        AudioManager.STREAM_RING,
-        AudioManager.STREAM_ALARM,
-        AudioManager.STREAM_NOTIFICATION,
-        AudioManager.STREAM_SYSTEM
-    };
-    Logging.d(tag, "Audio State: ");
-    // Some devices may not have volume controls and might use a fixed volume.
-    boolean fixedVolume = isVolumeFixed(audioManager);
-    Logging.d(tag, "  fixed volume=" + fixedVolume);
-    if (!fixedVolume) {
-      for (int stream : streams) {
-        StringBuilder info = new StringBuilder();
-        info.append("  " + streamTypeToString(stream) + ": ");
-        info.append("volume=").append(audioManager.getStreamVolume(stream));
-        info.append(", max=").append(audioManager.getStreamMaxVolume(stream));
-        logIsStreamMute(tag, audioManager, stream, info);
-        Logging.d(tag, info.toString());
-      }
-    }
-  }
-
-  private static void logIsStreamMute(
-      String tag, AudioManager audioManager, int stream, StringBuilder info) {
-    if (Build.VERSION.SDK_INT >= 23) {
-      info.append(", muted=").append(audioManager.isStreamMute(stream));
-    }
-  }
-
-  private static void logAudioDeviceInfo(String tag, AudioManager audioManager) {
-    if (Build.VERSION.SDK_INT < 23) {
-      return;
-    }
-    final AudioDeviceInfo[] devices =
-        audioManager.getDevices(AudioManager.GET_DEVICES_ALL);
-    if (devices.length == 0) {
-      return;
-    }
-    Logging.d(tag, "Audio Devices: ");
-    for (AudioDeviceInfo device : devices) {
-      StringBuilder info = new StringBuilder();
-      info.append("  ").append(deviceTypeToString(device.getType()));
-      info.append(device.isSource() ? "(in): " : "(out): ");
-      // An empty array indicates that the device supports arbitrary channel counts.
-      if (device.getChannelCounts().length > 0) {
-        info.append("channels=").append(Arrays.toString(device.getChannelCounts()));
-        info.append(", ");
-      }
-      if (device.getEncodings().length > 0) {
-        // Examples: ENCODING_PCM_16BIT = 2, ENCODING_PCM_FLOAT = 4.
-        info.append("encodings=").append(Arrays.toString(device.getEncodings()));
-        info.append(", ");
-      }
-      if (device.getSampleRates().length > 0) {
-        info.append("sample rates=").append(Arrays.toString(device.getSampleRates()));
-        info.append(", ");
-      }
-      info.append("id=").append(device.getId());
-      Logging.d(tag, info.toString());
-    }
-  }
-
-  // Converts media.AudioManager modes into local string representation.
-  static String modeToString(int mode) {
-    switch (mode) {
-      case MODE_IN_CALL:
-        return "MODE_IN_CALL";
-      case MODE_IN_COMMUNICATION:
-        return "MODE_IN_COMMUNICATION";
-      case MODE_NORMAL:
-        return "MODE_NORMAL";
-      case MODE_RINGTONE:
-        return "MODE_RINGTONE";
-      default:
-        return "MODE_INVALID";
-    }
-  }
-
-  private static String streamTypeToString(int stream) {
-    switch(stream) {
-      case AudioManager.STREAM_VOICE_CALL:
-        return "STREAM_VOICE_CALL";
-      case AudioManager.STREAM_MUSIC:
-        return "STREAM_MUSIC";
-      case AudioManager.STREAM_RING:
-        return "STREAM_RING";
-      case AudioManager.STREAM_ALARM:
-        return "STREAM_ALARM";
-      case AudioManager.STREAM_NOTIFICATION:
-        return "STREAM_NOTIFICATION";
-      case AudioManager.STREAM_SYSTEM:
-        return "STREAM_SYSTEM";
-      default:
-        return "STREAM_INVALID";
-    }
-  }
-
-  // Converts AudioDeviceInfo types to local string representation.
-  private static String deviceTypeToString(int type) {
-    switch (type) {
-      case AudioDeviceInfo.TYPE_UNKNOWN:
-        return "TYPE_UNKNOWN";
-      case AudioDeviceInfo.TYPE_BUILTIN_EARPIECE:
-        return "TYPE_BUILTIN_EARPIECE";
-      case AudioDeviceInfo.TYPE_BUILTIN_SPEAKER:
-        return "TYPE_BUILTIN_SPEAKER";
-      case AudioDeviceInfo.TYPE_WIRED_HEADSET:
-        return "TYPE_WIRED_HEADSET";
-      case AudioDeviceInfo.TYPE_WIRED_HEADPHONES:
-        return "TYPE_WIRED_HEADPHONES";
-      case AudioDeviceInfo.TYPE_LINE_ANALOG:
-        return "TYPE_LINE_ANALOG";
-      case AudioDeviceInfo.TYPE_LINE_DIGITAL:
-        return "TYPE_LINE_DIGITAL";
-      case AudioDeviceInfo.TYPE_BLUETOOTH_SCO:
-        return "TYPE_BLUETOOTH_SCO";
-      case AudioDeviceInfo.TYPE_BLUETOOTH_A2DP:
-        return "TYPE_BLUETOOTH_A2DP";
-      case AudioDeviceInfo.TYPE_HDMI:
-        return "TYPE_HDMI";
-      case AudioDeviceInfo.TYPE_HDMI_ARC:
-        return "TYPE_HDMI_ARC";
-      case AudioDeviceInfo.TYPE_USB_DEVICE:
-        return "TYPE_USB_DEVICE";
-      case AudioDeviceInfo.TYPE_USB_ACCESSORY:
-        return "TYPE_USB_ACCESSORY";
-      case AudioDeviceInfo.TYPE_DOCK:
-        return "TYPE_DOCK";
-      case AudioDeviceInfo.TYPE_FM:
-        return "TYPE_FM";
-      case AudioDeviceInfo.TYPE_BUILTIN_MIC:
-        return "TYPE_BUILTIN_MIC";
-      case AudioDeviceInfo.TYPE_FM_TUNER:
-        return "TYPE_FM_TUNER";
-      case AudioDeviceInfo.TYPE_TV_TUNER:
-        return "TYPE_TV_TUNER";
-      case AudioDeviceInfo.TYPE_TELEPHONY:
-        return "TYPE_TELEPHONY";
-      case AudioDeviceInfo.TYPE_AUX_LINE:
-        return "TYPE_AUX_LINE";
-      case AudioDeviceInfo.TYPE_IP:
-        return "TYPE_IP";
-      case AudioDeviceInfo.TYPE_BUS:
-        return "TYPE_BUS";
-      case AudioDeviceInfo.TYPE_USB_HEADSET:
-        return "TYPE_USB_HEADSET";
-      default:
-        return "TYPE_UNKNOWN";
-    }
-  }
-
-  // Returns true if the device can record audio via a microphone.
-  private static boolean hasMicrophone() {
-    return ContextUtils.getApplicationContext().getPackageManager().hasSystemFeature(
-        PackageManager.FEATURE_MICROPHONE);
-  }
-}

+ 0 - 46
libwebrtc/src/main/java/rtc_base/java/src/org/webrtc/ContextUtils.java

@@ -1,46 +0,0 @@
-/*
- *  Copyright 2017 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-package org.webrtc;
-
-import android.content.Context;
-import org.webrtc.Logging;
-
-/**
- * Class for storing the application context and retrieving it in a static context. Similar to
- * org.chromium.base.ContextUtils.
- */
-public class ContextUtils {
-  private static final String TAG = "ContextUtils";
-  private static Context applicationContext;
-
-  /**
-   * Stores the application context that will be returned by getApplicationContext. This is called
-   * by PeerConnectionFactory.initialize. The application context must be set before creating
-   * a PeerConnectionFactory and must not be modified while it is alive.
-   */
-  public static void initialize(Context applicationContext) {
-    if (applicationContext == null) {
-      throw new IllegalArgumentException(
-          "Application context cannot be null for ContextUtils.initialize.");
-    }
-    ContextUtils.applicationContext = applicationContext;
-  }
-
-  /**
-   * Returns the stored application context.
-   *
-   * @deprecated crbug.com/webrtc/8937
-   */
-  @Deprecated
-  public static Context getApplicationContext() {
-    return applicationContext;
-  }
-}

+ 0 - 22
libwebrtc/src/main/java/rtc_base/java/src/org/webrtc/Loggable.java

@@ -1,22 +0,0 @@
-/*
- *  Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-package org.webrtc;
-
-import org.webrtc.Logging.Severity;
-
-/**
- * Java interface for WebRTC logging. The default implementation uses webrtc.Logging.
- *
- * When injected, the Loggable will receive logging from both Java and native.
- */
-public interface Loggable {
-  public void onLogMessage(String message, Severity severity, String tag);
-}

+ 0 - 199
libwebrtc/src/main/java/rtc_base/java/src/org/webrtc/Logging.java

@@ -1,199 +0,0 @@
-/*
- *  Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-package org.webrtc;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.EnumSet;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Java wrapper for WebRTC logging. Logging defaults to java.util.logging.Logger, but a custom
- * logger implementing the Loggable interface can be injected along with a Severity. All subsequent
- * log messages will then be redirected to the injected Loggable, except those with a severity lower
- * than the specified severity, which will be discarded.
- *
- * It is also possible to switch to native logging (rtc::LogMessage) if one of the following static
- * functions are called from the app:
- * - Logging.enableLogThreads
- * - Logging.enableLogTimeStamps
- * - Logging.enableLogToDebugOutput
- *
- * The priority goes:
- * 1. Injected loggable
- * 2. Native logging
- * 3. Fallback logging.
- * Only one method will be used at a time.
- *
- * Injecting a Loggable or using any of the enable... methods requires that the native library is
- * loaded, using PeerConnectionFactory.initialize.
- */
-public class Logging {
-  private static final Logger fallbackLogger = createFallbackLogger();
-  private static volatile boolean loggingEnabled;
-    private static Loggable loggable;
-  private static Severity loggableSeverity;
-
-  private static Logger createFallbackLogger() {
-    final Logger fallbackLogger = Logger.getLogger("org.webrtc.Logging");
-    fallbackLogger.setLevel(Level.ALL);
-    return fallbackLogger;
-  }
-
-  static void injectLoggable(Loggable injectedLoggable, Severity severity) {
-    if (injectedLoggable != null) {
-      loggable = injectedLoggable;
-      loggableSeverity = severity;
-    }
-  }
-
-  static void deleteInjectedLoggable() {
-    loggable = null;
-  }
-
-  // TODO(solenberg): Remove once dependent projects updated.
-  @Deprecated
-  public enum TraceLevel {
-    TRACE_NONE(0x0000),
-    TRACE_STATEINFO(0x0001),
-    TRACE_WARNING(0x0002),
-    TRACE_ERROR(0x0004),
-    TRACE_CRITICAL(0x0008),
-    TRACE_APICALL(0x0010),
-    TRACE_DEFAULT(0x00ff),
-    TRACE_MODULECALL(0x0020),
-    TRACE_MEMORY(0x0100),
-    TRACE_TIMER(0x0200),
-    TRACE_STREAM(0x0400),
-    TRACE_DEBUG(0x0800),
-    TRACE_INFO(0x1000),
-    TRACE_TERSEINFO(0x2000),
-    TRACE_ALL(0xffff);
-
-    public final int level;
-    TraceLevel(int level) {
-      this.level = level;
-    }
-  }
-
-  // Keep in sync with webrtc/rtc_base/logging.h:LoggingSeverity.
-  public enum Severity { LS_VERBOSE, LS_INFO, LS_WARNING, LS_ERROR, LS_NONE }
-
-  public static void enableLogThreads() {
-    nativeEnableLogThreads();
-  }
-
-  public static void enableLogTimeStamps() {
-    nativeEnableLogTimeStamps();
-  }
-
-  // TODO(solenberg): Remove once dependent projects updated.
-  @Deprecated
-  public static void enableTracing(String path, EnumSet<TraceLevel> levels) {}
-
-  // Enable diagnostic logging for messages of |severity| to the platform debug
-  // output. On Android, the output will be directed to Logcat.
-  // Note: this function starts collecting the output of the RTC_LOG() macros.
-  // TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
-  @SuppressWarnings("NoSynchronizedMethodCheck")
-  public static synchronized void enableLogToDebugOutput(Severity severity) {
-    if (loggable != null) {
-      throw new IllegalStateException(
-          "Logging to native debug output not supported while Loggable is injected. "
-          + "Delete the Loggable before calling this method.");
-    }
-    nativeEnableLogToDebugOutput(severity.ordinal());
-    loggingEnabled = true;
-  }
-
-  public static void log(Severity severity, String tag, String message) {
-    if (tag == null || message == null) {
-      throw new IllegalArgumentException("Logging tag or message may not be null.");
-    }
-    if (loggable != null) {
-      // Filter log messages below loggableSeverity.
-      if (severity.ordinal() < loggableSeverity.ordinal()) {
-        return;
-      }
-      loggable.onLogMessage(message, severity, tag);
-      return;
-    }
-
-    // Try native logging if no loggable is injected.
-    if (loggingEnabled) {
-      nativeLog(severity.ordinal(), tag, message);
-      return;
-    }
-
-    // Fallback to system log.
-    Level level;
-    switch (severity) {
-      case LS_ERROR:
-        level = Level.SEVERE;
-        break;
-      case LS_WARNING:
-        level = Level.WARNING;
-        break;
-      case LS_INFO:
-        level = Level.INFO;
-        break;
-      default:
-        level = Level.FINE;
-        break;
-    }
-    fallbackLogger.log(level, tag + ": " + message);
-  }
-
-  public static void d(String tag, String message) {
-    log(Severity.LS_INFO, tag, message);
-  }
-
-  public static void e(String tag, String message) {
-    log(Severity.LS_ERROR, tag, message);
-  }
-
-  public static void w(String tag, String message) {
-    log(Severity.LS_WARNING, tag, message);
-  }
-
-  public static void e(String tag, String message, Throwable e) {
-    log(Severity.LS_ERROR, tag, message);
-    log(Severity.LS_ERROR, tag, e.toString());
-    log(Severity.LS_ERROR, tag, getStackTraceString(e));
-  }
-
-  public static void w(String tag, String message, Throwable e) {
-    log(Severity.LS_WARNING, tag, message);
-    log(Severity.LS_WARNING, tag, e.toString());
-    log(Severity.LS_WARNING, tag, getStackTraceString(e));
-  }
-
-  public static void v(String tag, String message) {
-    log(Severity.LS_VERBOSE, tag, message);
-  }
-
-  private static String getStackTraceString(Throwable e) {
-    if (e == null) {
-      return "";
-    }
-
-    StringWriter sw = new StringWriter();
-    PrintWriter pw = new PrintWriter(sw);
-    e.printStackTrace(pw);
-    return sw.toString();
-  }
-
-  private static native void nativeEnableLogToDebugOutput(int nativeSeverity);
-  private static native void nativeEnableLogThreads();
-  private static native void nativeEnableLogTimeStamps();
-  private static native void nativeLog(int severity, String tag, String message);
-}

+ 0 - 2
libwebrtc/src/main/java/rtc_base/java/src/org/webrtc/OWNERS

@@ -1,2 +0,0 @@
-magjed@webrtc.org
-sakal@webrtc.org

+ 0 - 45
libwebrtc/src/main/java/rtc_base/java/src/org/webrtc/Size.java

@@ -1,45 +0,0 @@
-/*
- *  Copyright 2016 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-package org.webrtc;
-
-/**
- * Class for representing size of an object. Very similar to android.util.Size but available on all
- * devices.
- */
-public class Size {
-  public int width;
-  public int height;
-
-  public Size(int width, int height) {
-    this.width = width;
-    this.height = height;
-  }
-
-  @Override
-  public String toString() {
-    return width + "x" + height;
-  }
-
-  @Override
-  public boolean equals(Object other) {
-    if (!(other instanceof Size)) {
-      return false;
-    }
-    final Size otherSize = (Size) other;
-    return width == otherSize.width && height == otherSize.height;
-  }
-
-  @Override
-  public int hashCode() {
-    // Use prime close to 2^16 to avoid collisions for normal values less than 2^16.
-    return 1 + 65537 * width + height;
-  }
-}

+ 0 - 0
libwebrtc/src/main/java/rtc_base/java/src/org/webrtc/ThreadUtils.java


Some files were not shown because too many files changed in this diff