-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5f3ac82
Showing
81 changed files
with
2,526 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Built application files | ||
*.apk | ||
*.ap_ | ||
|
||
# Files for the ART/Dalvik VM | ||
*.dex | ||
|
||
# Java class files | ||
*.class | ||
|
||
# Generated files | ||
bin/ | ||
gen/ | ||
out/ | ||
|
||
# Gradle files | ||
.gradle/ | ||
build/ | ||
app/gradle | ||
|
||
# gradlew | ||
app/gradlew | ||
app/gradlew.bat | ||
|
||
# Local configuration file (sdk path, etc) | ||
local.properties | ||
|
||
# Proguard folder generated by Eclipse | ||
proguard/ | ||
|
||
# Log Files | ||
*.log | ||
|
||
# Android Studio Navigation editor temp files | ||
.navigation/ | ||
|
||
# Android Studio | ||
.idea/ | ||
|
||
# Android Studio captures folder | ||
captures/ | ||
|
||
# IntelliJ | ||
*.iml | ||
.idea/workspace.xml | ||
.idea/tasks.xml | ||
.idea/gradle.xml | ||
.idea/dictionaries | ||
.idea/libraries | ||
|
||
# Keystore files | ||
# Uncomment the following line if you do not want to check your keystore files in. | ||
#*.jks | ||
|
||
# External native build folder generated in Android Studio 2.2 and later | ||
.externalNativeBuild | ||
|
||
# Google Services (e.g. APIs or Firebase) | ||
google-services.json | ||
|
||
# Freeline | ||
freeline.py | ||
freeline/ | ||
freeline_project_description.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 28 | ||
defaultConfig { | ||
applicationId "com.zoopark.zooparkmvp" | ||
minSdkVersion 19 | ||
targetSdkVersion 28 | ||
versionCode 1 | ||
versionName "1.0" | ||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
|
||
javaCompileOptions { | ||
annotationProcessorOptions { | ||
arguments = [moduleName: project.getName()] | ||
} | ||
} | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation fileTree(dir: 'libs', include: ['*.jar']) | ||
implementation 'com.android.support:appcompat-v7:28.0.0' | ||
implementation 'com.android.support.constraint:constraint-layout:1.1.3' | ||
testImplementation 'junit:junit:4.12' | ||
androidTestImplementation 'com.android.support.test:runner:1.0.2' | ||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' | ||
|
||
api project(':lib') | ||
|
||
// Dagger | ||
annotationProcessor rootProject.ext.dependencies['dagger2-compiler'] | ||
annotationProcessor rootProject.ext.dependencies['dagger2-android-processor'] | ||
|
||
// Butterknife | ||
annotationProcessor rootProject.ext.dependencies["butterknife-compiler"] | ||
|
||
// Router | ||
annotationProcessor rootProject.ext.dependencies["arouter-compiler"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
26 changes: 26 additions & 0 deletions
26
app/src/androidTest/java/com/zoopark/zooparkmvp/ExampleInstrumentedTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.zoopark.zooparkmvp; | ||
|
||
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() { | ||
// Context of the app under test. | ||
Context appContext = InstrumentationRegistry.getTargetContext(); | ||
|
||
assertEquals("com.zoopark.zooparkmvp", appContext.getPackageName()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.zoopark.zooparkmvp"> | ||
|
||
<application | ||
android:name="com.zoopark.lib.BaseApplication" | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme"> | ||
|
||
<!-- mvp 配置 --> | ||
<meta-data | ||
android:name="com.zoopark.zooparkmvp.GlobalConfiguration" | ||
android:value="ConfigModule" /> | ||
|
||
<activity android:name=".AnalyseActivity"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
33 changes: 33 additions & 0 deletions
33
app/src/main/java/com/zoopark/zooparkmvp/AnalyseActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.zoopark.zooparkmvp; | ||
|
||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.support.annotation.NonNull; | ||
import android.support.annotation.Nullable; | ||
|
||
import com.zoopark.lib.BaseActivity; | ||
import com.zoopark.lib.BaseApplication; | ||
|
||
|
||
public class AnalyseActivity extends BaseActivity<AnalysePresenter> implements AnalyseContract.View { | ||
|
||
|
||
@Override | ||
public int initView(@Nullable Bundle savedInstanceState) { | ||
return R.layout.activity_main; //如果你不需要框架帮你设置 setContentView(id) 需要自行设置,请返回 0 | ||
} | ||
|
||
|
||
@Override | ||
public void initData(@Nullable Bundle savedInstanceState) { | ||
DaggerAnalyseComponent //如找不到该类,请编译一下项目 | ||
.builder() | ||
.appComponent(((BaseApplication) this.getApplicationContext()).getAppComponent()) | ||
.analyseModule(new AnalyseModule(this)) | ||
.build() | ||
.inject(this); | ||
|
||
} | ||
|
||
|
||
} |
12 changes: 12 additions & 0 deletions
12
app/src/main/java/com/zoopark/zooparkmvp/AnalyseComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.zoopark.zooparkmvp; | ||
|
||
import com.zoopark.lib.inject.component.AppComponent; | ||
import com.zoopark.lib.inject.scope.ActivityScope; | ||
|
||
import dagger.Component; | ||
|
||
@ActivityScope | ||
@Component(modules = AnalyseModule.class, dependencies = AppComponent.class) | ||
public interface AnalyseComponent { | ||
void inject(AnalyseActivity activity); | ||
} |
21 changes: 21 additions & 0 deletions
21
app/src/main/java/com/zoopark/zooparkmvp/AnalyseContract.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.zoopark.zooparkmvp; | ||
|
||
|
||
import com.zoopark.lib.common.Resp; | ||
import com.zoopark.lib.ok.IModel; | ||
import com.zoopark.lib.ok.IView; | ||
|
||
import io.reactivex.Observable; | ||
import retrofit2.http.Query; | ||
|
||
|
||
public interface AnalyseContract { | ||
// 对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息 | ||
interface View extends IView { | ||
} | ||
|
||
// Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存 | ||
interface Model extends IModel { | ||
|
||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
app/src/main/java/com/zoopark/zooparkmvp/AnalyseModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.zoopark.zooparkmvp; | ||
|
||
|
||
import com.zoopark.lib.BaseModel; | ||
import com.zoopark.lib.common.Resp; | ||
import com.zoopark.lib.inject.scope.ActivityScope; | ||
import com.zoopark.lib.repository.IRepositoryManager; | ||
|
||
import java.util.List; | ||
|
||
import javax.inject.Inject; | ||
|
||
import io.reactivex.Observable; | ||
|
||
|
||
@ActivityScope | ||
public class AnalyseModel extends BaseModel implements AnalyseContract.Model { | ||
|
||
@Inject | ||
public AnalyseModel(IRepositoryManager repositoryManager) { | ||
super(repositoryManager); | ||
} | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
app/src/main/java/com/zoopark/zooparkmvp/AnalyseModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.zoopark.zooparkmvp; | ||
|
||
import com.zoopark.lib.inject.scope.ActivityScope; | ||
|
||
import dagger.Module; | ||
import dagger.Provides; | ||
|
||
@Module | ||
public class AnalyseModule { | ||
private AnalyseContract.View view; | ||
|
||
/** | ||
* 构建AnalyseModule时,将View的实现类传进来,这样就可以提供View的实现类给presenter | ||
* | ||
* @param view | ||
*/ | ||
public AnalyseModule(AnalyseContract.View view) { | ||
this.view = view; | ||
} | ||
|
||
@ActivityScope | ||
@Provides | ||
AnalyseContract.View provideAnalyseView() { | ||
return this.view; | ||
} | ||
|
||
@ActivityScope | ||
@Provides | ||
AnalyseContract.Model provideAnalyseModel(AnalyseModel model) { | ||
return model; | ||
} | ||
|
||
|
||
} |
21 changes: 21 additions & 0 deletions
21
app/src/main/java/com/zoopark/zooparkmvp/AnalysePresenter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.zoopark.zooparkmvp; | ||
|
||
|
||
import com.zoopark.lib.inject.scope.ActivityScope; | ||
import com.zoopark.lib.ok.BasePresenter; | ||
|
||
|
||
import javax.inject.Inject; | ||
|
||
|
||
@ActivityScope | ||
public class AnalysePresenter extends BasePresenter<AnalyseContract.Model, AnalyseContract.View> { | ||
|
||
@Inject | ||
public AnalysePresenter(AnalyseContract.Model model, AnalyseContract.View rootView) { | ||
super(model, rootView); | ||
|
||
} | ||
|
||
|
||
} |
Oops, something went wrong.