Skip to content

Commit

Permalink
添加几个模拟依赖的组件
Browse files Browse the repository at this point in the history
  • Loading branch information
byhook committed Jun 19, 2018
1 parent 5ebcd6f commit 4e68e91
Show file tree
Hide file tree
Showing 28 changed files with 361 additions and 1 deletion.
1 change: 1 addition & 0 deletions download/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
6 changes: 6 additions & 0 deletions download/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apply from: '../module.gradle'

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':common')
}
21 changes: 21 additions & 0 deletions download/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.onzhou.module.download;

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.onzhou.module.download.test", appContext.getPackageName());
}
}
7 changes: 7 additions & 0 deletions download/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.onzhou.module.download" >

<application>
<activity android:name=".DownloadActivity" />
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.onzhou.module.download;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

/**
* @author: andy
* @date: 2018-06-19
**/
public class DownloadActivity extends AppCompatActivity {

public static void intentStart(Context ctx) {
Intent intent = new Intent(ctx, DownloadActivity.class);
ctx.startActivity(intent);
}

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_download);
}
}
14 changes: 14 additions & 0 deletions download/src/main/res/layout/activity_download.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="10dp"
android:text="下载模块" />

</LinearLayout>
3 changes: 3 additions & 0 deletions download/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<string name="app_name">download</string>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.onzhou.module.download;

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);
}
}
1 change: 1 addition & 0 deletions liveroom/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
6 changes: 6 additions & 0 deletions liveroom/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apply from: '../module.gradle'

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':common')
}
21 changes: 21 additions & 0 deletions liveroom/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.onzhou.module.liveroom;

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.onzhou.module.liveroom.test", appContext.getPackageName());
}
}
7 changes: 7 additions & 0 deletions liveroom/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.onzhou.module.liveroom" >

<application>
<activity android:name=".LiveRoomActivity" />
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.onzhou.module.liveroom;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

/**
* @author: andy
* @date: 2018-06-19
**/
public class LiveRoomActivity extends AppCompatActivity {

public static void intentStart(Context ctx) {
Intent intent = new Intent(ctx, LiveRoomActivity.class);
ctx.startActivity(intent);
}

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_live_room);
}
}
14 changes: 14 additions & 0 deletions liveroom/src/main/res/layout/activity_live_room.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="10dp"
android:text="直播间" />

</LinearLayout>
3 changes: 3 additions & 0 deletions liveroom/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<string name="app_name">liveroom</string>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.onzhou.module.liveroom;

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);
}
}
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include ':app', ':common', ':video'
include ':app', ':common', ':video', ':liveroom', ':upload', ':download'
1 change: 1 addition & 0 deletions upload/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
6 changes: 6 additions & 0 deletions upload/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apply from: '../module.gradle'

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':common')
}
21 changes: 21 additions & 0 deletions upload/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.onzhou.module.upload;

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.onzhou.module.upload.test", appContext.getPackageName());
}
}
7 changes: 7 additions & 0 deletions upload/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.onzhou.module.upload" >

<application>
<activity android:name=".UploadActivity" />
</application>
</manifest>
25 changes: 25 additions & 0 deletions upload/src/main/java/com/onzhou/module/upload/UploadActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.onzhou.module.upload;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

/**
* @author: andy
* @date: 2018-06-19
**/
public class UploadActivity extends AppCompatActivity {

public static void intentStart(Context ctx) {
Intent intent = new Intent(ctx, UploadActivity.class);
ctx.startActivity(intent);
}

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_upload);
}
}
14 changes: 14 additions & 0 deletions upload/src/main/res/layout/activity_upload.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="10dp"
android:text="上传模块" />

</LinearLayout>
3 changes: 3 additions & 0 deletions upload/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<string name="app_name">upload</string>
</resources>
17 changes: 17 additions & 0 deletions upload/src/test/java/com/onzhou/module/upload/ExampleUnitTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.onzhou.module.upload;

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 comments on commit 4e68e91

Please sign in to comment.