-
Notifications
You must be signed in to change notification settings - Fork 24
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
1 parent
43abffa
commit 608cea0
Showing
58 changed files
with
1,639 additions
and
132 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
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,86 @@ | ||
/* | ||
* Copyright (C) 2016 Appflate.io | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http:https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
buildscript { | ||
repositories { | ||
mavenCentral() | ||
jcenter() | ||
} | ||
|
||
dependencies { | ||
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' | ||
} | ||
} | ||
|
||
apply plugin: 'com.android.application' | ||
apply plugin: 'android-apt' | ||
apply from: '../quality_tools/findbugs.gradle' | ||
|
||
android { | ||
compileSdkVersion 24 | ||
buildToolsVersion "24" | ||
|
||
defaultConfig { | ||
applicationId "io.appflate.droidmvp.androidsample" | ||
minSdkVersion 10 | ||
targetSdkVersion 24 | ||
versionCode 1 | ||
versionName "1.0" | ||
testInstrumentationRunner 'io.appflate.droidmvp.androidsample.CustomTestRunner' | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
|
||
lintOptions { | ||
warningsAsErrors true | ||
abortOnError true | ||
disable 'InvalidPackage' | ||
} | ||
} | ||
|
||
dependencies { | ||
compile fileTree(dir: 'libs', include: ['*.jar']) | ||
compile 'com.android.support:appcompat-v7:24.0.0' | ||
compile 'com.android.support:design:24.0.0' | ||
compile 'com.jakewharton:butterknife:7.0.1' | ||
compile 'com.google.dagger:dagger:2.2' | ||
compile 'com.squareup.retrofit2:retrofit:2.0.2' | ||
compile 'com.squareup.retrofit2:converter-gson:2.0.2' | ||
compile 'com.google.code.gson:gson:2.4' | ||
compile 'com.google.code.findbugs:annotations:2.0.3' | ||
provided 'javax.annotation:jsr250-api:1.0' | ||
apt 'com.google.dagger:dagger-compiler:2.2' | ||
|
||
//the most important: DroidMVP :) | ||
compile project(':library') | ||
|
||
//Test dependencies | ||
|
||
testCompile 'com.android.support:appcompat-v7:24.0.0' | ||
testCompile 'com.android.support:design:24.0.0' | ||
testCompile 'junit:junit:4.12' | ||
testCompile "org.robolectric:robolectric:3.0" | ||
testCompile 'com.android.support.test.espresso:espresso-core:2.2.2' | ||
testCompile('com.android.support.test.espresso:espresso-contrib:2.2.2') { | ||
exclude group: 'com.android.support', module: 'appcompat' | ||
exclude group: 'com.android.support', module: 'support-v4' | ||
exclude module: 'recyclerview-v7' | ||
} | ||
} |
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,17 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in /Users/andrzejchm/Library/Android/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:https://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 *; | ||
#} |
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,43 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
~ Copyright (C) 2016 Appflate.io | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http:https://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
--> | ||
<manifest xmlns:android="http:https://schemas.android.com/apk/res/android" | ||
xmlns:tools="http:https://schemas.android.com/tools" | ||
package="io.appflate.droidvmp.androidsample"> | ||
|
||
<uses-permission android:name="android.permission.INTERNET"/> | ||
|
||
<application | ||
android:name="io.appflate.droidvmp.androidsample.SampleApplication" | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme" | ||
tools:ignore="AllowBackup,GoogleAppIndexingWarning"> | ||
<activity android:name="io.appflate.droidvmp.androidsample.ui.activities.MainActivity"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN"/> | ||
|
||
<category android:name="android.intent.category.LAUNCHER"/> | ||
<category android:name="android.intent.category.DEFAULT"/> | ||
</intent-filter> | ||
</activity> | ||
<activity android:name="io.appflate.droidvmp.androidsample.ui.activities.RepositoriesActivity"> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
44 changes: 44 additions & 0 deletions
44
sample-dagger/src/main/java/io/appflate/droidvmp/androidsample/SampleApplication.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,44 @@ | ||
/* | ||
* Copyright (C) 2016 Appflate.io | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http:https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.appflate.droidvmp.androidsample; | ||
|
||
import android.app.Application; | ||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; | ||
import io.appflate.droidvmp.androidsample.di.AppComponent; | ||
import io.appflate.droidvmp.androidsample.di.AppModule; | ||
import io.appflate.droidvmp.androidsample.di.DaggerAppComponent; | ||
|
||
/** | ||
* Created by andrzejchm on 22/04/16. | ||
*/ | ||
public class SampleApplication extends Application { | ||
private static final String BASE_URL = "https://api.github.com/"; | ||
static AppComponent appComponent; | ||
|
||
@Override public void onCreate() { | ||
super.onCreate(); | ||
setupGraph(); | ||
} | ||
|
||
@SuppressFBWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD") protected void setupGraph() { | ||
appComponent = DaggerAppComponent.builder().appModule(new AppModule(BASE_URL)).build(); | ||
} | ||
|
||
public static AppComponent getComponent() { | ||
return appComponent; | ||
} | ||
} |
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
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
35 changes: 35 additions & 0 deletions
35
sample-dagger/src/main/java/io/appflate/droidvmp/androidsample/domain/GithubApi.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,35 @@ | ||
/* | ||
* Copyright (C) 2016 Appflate.io | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http:https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.appflate.droidvmp.androidsample.domain; | ||
|
||
import io.appflate.droidvmp.androidsample.model.Repository; | ||
import io.appflate.droidvmp.androidsample.model.User; | ||
import java.util.List; | ||
import retrofit2.Call; | ||
import retrofit2.http.GET; | ||
import retrofit2.http.Path; | ||
|
||
/** | ||
* Created by andrzejchm on 22/04/16. | ||
*/ | ||
public interface GithubApi { | ||
|
||
@GET("users/{username}") Call<User> getUserProfile(@Path("username") String username); | ||
|
||
@GET("users/{username}/repos") Call<List<Repository>> getUserRepositories( | ||
@Path("username") String username); | ||
} |
43 changes: 43 additions & 0 deletions
43
sample-dagger/src/main/java/io/appflate/droidvmp/androidsample/model/Owner.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,43 @@ | ||
/* | ||
* Copyright (C) 2016 Appflate.io | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http:https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.appflate.droidvmp.androidsample.model; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import java.io.Serializable; | ||
|
||
/** | ||
* Created by andrzejchm on 23/04/16. | ||
*/ | ||
public class Owner implements Serializable { | ||
@SerializedName("login") public String login; | ||
@SerializedName("id") public int id; | ||
@SerializedName("avatar_url") public String avatarUrl; | ||
@SerializedName("gravatar_id") public String gravatarId; | ||
@SerializedName("url") public String url; | ||
@SerializedName("html_url") public String htmlUrl; | ||
@SerializedName("followers_url") public String followersUrl; | ||
@SerializedName("following_url") public String followingUrl; | ||
@SerializedName("gists_url") public String gistsUrl; | ||
@SerializedName("starred_url") public String starredUrl; | ||
@SerializedName("subscriptions_url") public String subscriptionsUrl; | ||
@SerializedName("organizations_url") public String organizationsUrl; | ||
@SerializedName("repos_url") public String reposUrl; | ||
@SerializedName("events_url") public String eventsUrl; | ||
@SerializedName("received_events_url") public String receivedEventsUrl; | ||
@SerializedName("type") public String type; | ||
@SerializedName("site_admin") public boolean siteAdmin; | ||
} |
Oops, something went wrong.