Bläddra i källkod

1.添加新版首页module

王鹏鹏 2 år sedan
förälder
incheckning
ac05f1b94d

+ 1 - 0
.idea/gradle.xml

@@ -12,6 +12,7 @@
             <option value="$PROJECT_DIR$" />
             <option value="$PROJECT_DIR$/app" />
             <option value="$PROJECT_DIR$/baselib" />
+            <option value="$PROJECT_DIR$/home" />
             <option value="$PROJECT_DIR$/livebroadcast" />
             <option value="$PROJECT_DIR$/login" />
             <option value="$PROJECT_DIR$/personalcenter" />

+ 1 - 0
.idea/misc.xml

@@ -14,6 +14,7 @@
         <entry key="..\:/workspace/hcp-pad/calendarview/src/main/res/drawable-v21/cv_bg_material.xml" value="0.219" />
         <entry key="..\:/workspace/hcp-pad/calendarview/src/main/res/layout/cv_layout_calendar_view.xml" value="0.1" />
         <entry key="..\:/workspace/hcp-pad/calendarview/src/main/res/layout/cv_week_bar.xml" value="0.1" />
+        <entry key="..\:/workspace/hcp-pad/home/src/main/res/layout/activity_home.xml" value="0.1" />
         <entry key="..\:/workspace/hcp-pad/livebroadcast/src/main/res/layout/activity_live_broadcast.xml" value="0.22826086956521738" />
         <entry key="..\:/workspace/hcp-pad/livebroadcast/src/main/res/layout/activity_live_broadcast_list.xml" value="0.21014492753623187" />
         <entry key="..\:/workspace/hcp-pad/livebroadcast/src/main/res/layout/activity_video_player.xml" value="0.22826086956521738" />

+ 1 - 0
app/build.gradle

@@ -103,6 +103,7 @@ dependencies {
     implementation project(path: ':livebroadcast')
     implementation project(path: ':login')
     implementation project(path: ':push')
+    implementation project(path: ':home')
 
     implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
     implementation(rootProject.ext.androidx.kotlin_lib)

+ 2 - 2
baselib/build.gradle

@@ -38,7 +38,7 @@ android {
             buildConfigField "String", "BAIDU_SECRETKEY", "\"4AfYdqAyA9PtLOoNFFsyUogDfxoMBmqS\""
             buildConfigField "Boolean", "SINGLE_MODULE", "${singleModule}"
             buildConfigField "String", "BUGLY_APPID", "\"d400f20398\""
-            buildConfigField "String", "API_URL", "\"http://192.168.0.120:8110\""
+            buildConfigField "String", "API_URL", "\"http://60.205.201.7:8110\""
             proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
         }
 
@@ -52,7 +52,7 @@ android {
             buildConfigField "String", "BAIDU_SECRETKEY", "\"4AfYdqAyA9PtLOoNFFsyUogDfxoMBmqS\""
             buildConfigField "Boolean", "SINGLE_MODULE", "${singleModule}"
             buildConfigField "String", "BUGLY_APPID", "\"ad3db4d529\""
-            buildConfigField "String", "API_URL", "\"http://192.168.0.120:8110\""
+            buildConfigField "String", "API_URL", "\"http://60.205.201.7:8110\""
             proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
         }
     }

+ 1 - 0
home/.gitignore

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

+ 27 - 0
home/build.gradle

@@ -0,0 +1,27 @@
+apply from: "../module.build.gradle"
+apply plugin: 'kotlin-android'
+apply plugin: 'kotlin-kapt'
+
+android {
+
+    buildFeatures {
+        viewBinding true
+    }
+    defaultConfig {
+        // 如果是独立模块,则使用当前组件的包名
+        if (singleModule.toBoolean()) {
+            applicationId "com.yingyangfly.home"
+        }
+    }
+    // 统一资源前缀,规范资源引用
+    resourcePrefix "home_"
+}
+
+dependencies {
+    implementation project(path: ':baselib')
+    implementation(rootProject.ext.androidx.kotlin_lib)
+    implementation(rootProject.ext.androidx.kotlin_core)
+    implementation(rootProject.ext.androidx.appcompat)
+    implementation(rootProject.ext.androidx.material)
+    implementation(rootProject.ext.androidx.constraintlayout)
+}

+ 21 - 0
home/proguard-rules.pro

@@ -0,0 +1,21 @@
+# 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

+ 24 - 0
home/src/androidTest/java/com/yingyangfly/home/ExampleInstrumentedTest.kt

@@ -0,0 +1,24 @@
+package com.yingyangfly.home
+
+import androidx.test.platform.app.InstrumentationRegistry
+import androidx.test.ext.junit.runners.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.getInstrumentation().targetContext
+        assertEquals("com.yingyangfly.home", appContext.packageName)
+    }
+}

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

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.yingyangfly.home">
+
+    <application>
+
+    </application>
+
+</manifest>

+ 7 - 0
home/src/main/java/com/yingyangfly/home/HomeActivity.kt

@@ -0,0 +1,7 @@
+package com.yingyangfly.home
+
+import androidx.appcompat.app.AppCompatActivity
+
+class HomeActivity : AppCompatActivity() {
+
+}

+ 23 - 0
home/src/main/manifest/AndroidManifest.xml

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.yingyang.home">
+
+    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
+    <uses-permission android:name="android.permission.RECORD_AUDIO" />
+    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
+    <uses-permission android:name="android.permission.BLUETOOTH" />
+    <uses-permission android:name="android.permission.CAMERA" />
+    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
+    <uses-feature android:name="android.hardware.camera" />
+    <uses-feature android:name="android.hardware.camera.autofocus" />
+
+    <application>
+
+
+    </application>
+
+</manifest>

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

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout 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"
+
+    tools:ignore="ResourceName">
+
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content">
+
+    </androidx.constraintlayout.widget.ConstraintLayout>
+
+</layout>

+ 10 - 0
home/src/main/res/values/colors.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <color name="purple_200">#FFBB86FC</color>
+    <color name="purple_500">#FF6200EE</color>
+    <color name="purple_700">#FF3700B3</color>
+    <color name="teal_200">#FF03DAC5</color>
+    <color name="teal_700">#FF018786</color>
+    <color name="black">#FF000000</color>
+    <color name="white">#FFFFFFFF</color>
+</resources>

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

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

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

@@ -0,0 +1,3 @@
+<resources xmlns:tools="http://schemas.android.com/tools">
+
+</resources>

+ 17 - 0
home/src/test/java/com/yingyangfly/home/ExampleUnitTest.kt

@@ -0,0 +1,17 @@
+package com.yingyangfly.home
+
+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)
+    }
+}

+ 1 - 0
settings.gradle

@@ -8,3 +8,4 @@ include ':personalcenter'
 include ':livebroadcast'
 include ':login'
 include ':push'
+include ':home'