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 4ea332f
Showing
62 changed files
with
1,368 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,11 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/workspace.xml | ||
/.idea/libraries | ||
/.idea | ||
.idea | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild |
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,71 @@ | ||
def globalConfiguration = rootProject.extensions.getByName("ext") | ||
def appDependencies = rootProject.ext.appDependencies | ||
def appTestDependencies = rootProject.ext.appTestDependencies | ||
|
||
apply plugin: 'com.android.application' | ||
apply plugin: 'com.neenbedankt.android-apt' | ||
apply plugin: appDependencies.retroLambda | ||
|
||
android { | ||
|
||
|
||
compileSdkVersion globalConfiguration.getAt("androidCompileSdkVersion"); | ||
buildToolsVersion globalConfiguration.getAt("androidBuildToolsVersion"); | ||
|
||
defaultConfig { | ||
applicationId globalConfiguration.getAt("androidApplicationId") | ||
minSdkVersion globalConfiguration.getAt("androidMinSdkVersion") | ||
targetSdkVersion globalConfiguration.getAt("androidTargetSdkVersion") | ||
versionCode globalConfiguration.getAt("androidVersionCode") | ||
versionName globalConfiguration.getAt("androidVersionName") | ||
testInstrumentationRunner globalConfiguration.getAt("testInstrumentationRunner") | ||
} | ||
|
||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
|
||
packagingOptions { | ||
exclude 'META-INF/rxjava.properties' | ||
} | ||
} | ||
|
||
dependencies { | ||
compile fileTree(dir: 'libs', include: ['*.jar']) | ||
|
||
compile appDependencies.appcompat | ||
compile appDependencies.recycler | ||
compile appDependencies.design | ||
compile appDependencies.support | ||
|
||
compile appDependencies.butterKnife | ||
|
||
compile appDependencies.rxJava | ||
compile appDependencies.rxJava2 | ||
compile appDependencies.rxAndroid | ||
compile appDependencies.rxFingerPrint | ||
compile appDependencies.rxAndroid | ||
|
||
apt appDependencies.daggerCompiler | ||
compile appDependencies.dagger | ||
provided appDependencies.javaxAnnotation | ||
|
||
androidTestCompile appTestDependencies.testingSupportLib | ||
androidTestCompile(appTestDependencies.espresso, { | ||
exclude group: 'com.android.support', module: 'support-annotations' | ||
}) | ||
|
||
testCompile appTestDependencies.junit | ||
|
||
|
||
compile project(':domain') | ||
compile project(':data') | ||
} |
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 C:\Users\el_da\AppData\Local\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://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 *; | ||
#} |
26 changes: 26 additions & 0 deletions
26
app/src/androidTest/java/com/nosmurf/shk/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.nosmurf.shk; | ||
|
||
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.assertEquals; | ||
|
||
/** | ||
* 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.nosmurf.shk", 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,24 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.nosmurf.shk"> | ||
|
||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | ||
|
||
<application | ||
android:name=".view.SecurityHomeKeyApplication" | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme"> | ||
|
||
<activity android:name=".view.activity.MainActivity"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
|
||
</application> | ||
|
||
</manifest> |
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,22 @@ | ||
package com.nosmurf.shk; | ||
|
||
import com.nosmurf.domain.executor.PostExecutionThread; | ||
|
||
import javax.inject.Inject; | ||
import javax.inject.Singleton; | ||
|
||
import rx.Scheduler; | ||
import rx.android.schedulers.AndroidSchedulers; | ||
|
||
@Singleton | ||
public class UIThread implements PostExecutionThread { | ||
|
||
@Inject | ||
public UIThread() { | ||
} | ||
|
||
@Override | ||
public Scheduler getScheduler() { | ||
return AndroidSchedulers.mainThread(); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
app/src/main/java/com/nosmurf/shk/exception/ExceptionManager.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,19 @@ | ||
package com.nosmurf.shk.exception; | ||
|
||
import com.nosmurf.shk.R; | ||
|
||
public class ExceptionManager { | ||
|
||
public ExceptionManager() { | ||
|
||
} | ||
|
||
public static int convert(Exception exception) { | ||
int message = R.string.exception_message_generic; | ||
|
||
// TODO: 23/10/2016 Manage the exceptions. | ||
|
||
return message; | ||
} | ||
|
||
} |
9 changes: 9 additions & 0 deletions
9
app/src/main/java/com/nosmurf/shk/internal/di/PerActivity.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,9 @@ | ||
package com.nosmurf.shk.internal.di; | ||
|
||
import javax.inject.Scope; | ||
|
||
@Scope | ||
public @interface PerActivity { | ||
|
||
|
||
} |
26 changes: 26 additions & 0 deletions
26
app/src/main/java/com/nosmurf/shk/internal/di/component/AppComponent.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.nosmurf.shk.internal.di.component; | ||
|
||
import android.content.Context; | ||
|
||
import com.nosmurf.domain.executor.PostExecutionThread; | ||
import com.nosmurf.domain.repository.Repository; | ||
import com.nosmurf.shk.internal.di.module.AppModule; | ||
import com.nosmurf.shk.view.activity.RootActivity; | ||
|
||
import javax.inject.Singleton; | ||
|
||
import dagger.Component; | ||
|
||
@Singleton | ||
@Component( | ||
modules = AppModule.class | ||
) | ||
public interface AppComponent { | ||
void inject(RootActivity rootActivity); | ||
|
||
Context context(); | ||
|
||
PostExecutionThread postExecutionThread(); | ||
|
||
Repository repository(); | ||
} |
13 changes: 13 additions & 0 deletions
13
app/src/main/java/com/nosmurf/shk/internal/di/component/MainComponent.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,13 @@ | ||
package com.nosmurf.shk.internal.di.component; | ||
|
||
import com.nosmurf.shk.internal.di.PerActivity; | ||
import com.nosmurf.shk.internal.di.module.MainModule; | ||
import com.nosmurf.shk.view.activity.MainActivity; | ||
|
||
import dagger.Component; | ||
|
||
@PerActivity | ||
@Component(dependencies = AppComponent.class, modules = MainModule.class) | ||
public interface MainComponent { | ||
void inject(MainActivity mainActivity); | ||
} |
51 changes: 51 additions & 0 deletions
51
app/src/main/java/com/nosmurf/shk/internal/di/module/AppModule.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,51 @@ | ||
package com.nosmurf.shk.internal.di.module; | ||
|
||
import android.content.Context; | ||
|
||
import com.nosmurf.data.repository.DataRepository; | ||
import com.nosmurf.data.repository.firebase.FirebaseDataSource; | ||
import com.nosmurf.data.repository.firebase.SHKFirebaseDataSource; | ||
import com.nosmurf.domain.executor.PostExecutionThread; | ||
import com.nosmurf.domain.repository.Repository; | ||
import com.nosmurf.shk.UIThread; | ||
import com.nosmurf.shk.view.SecurityHomeKeyApplication; | ||
|
||
import javax.inject.Singleton; | ||
|
||
import dagger.Module; | ||
import dagger.Provides; | ||
|
||
@Module | ||
public class AppModule { | ||
|
||
private SecurityHomeKeyApplication securityHomeKeyApplication; | ||
|
||
public AppModule(SecurityHomeKeyApplication securityHomeKeyApplication) { | ||
this.securityHomeKeyApplication = securityHomeKeyApplication; | ||
} | ||
|
||
@Provides | ||
@Singleton | ||
Context provideContext() { | ||
return this.securityHomeKeyApplication; | ||
} | ||
|
||
@Provides | ||
@Singleton | ||
PostExecutionThread providePostExecutionThread(UIThread uiThread) { | ||
return uiThread; | ||
} | ||
|
||
@Provides | ||
@Singleton | ||
Repository provideRepository(DataRepository dataRepository) { | ||
return dataRepository; | ||
} | ||
|
||
@Provides | ||
@Singleton | ||
FirebaseDataSource provideFirebaseDataSource(SHKFirebaseDataSource shkFirebaseDataSource) { | ||
return shkFirebaseDataSource; | ||
} | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
app/src/main/java/com/nosmurf/shk/internal/di/module/MainModule.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,8 @@ | ||
package com.nosmurf.shk.internal.di.module; | ||
|
||
import dagger.Module; | ||
|
||
@Module | ||
public class MainModule { | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
app/src/main/java/com/nosmurf/shk/navigation/Navigator.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,19 @@ | ||
package com.nosmurf.shk.navigation; | ||
|
||
import android.content.Intent; | ||
import android.net.Uri; | ||
import android.provider.MediaStore; | ||
|
||
import com.nosmurf.shk.view.activity.RootActivity; | ||
|
||
import java.io.File; | ||
|
||
import javax.inject.Inject; | ||
|
||
public class Navigator { | ||
|
||
@Inject | ||
public Navigator() { | ||
|
||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
app/src/main/java/com/nosmurf/shk/presenter/MainPresenter.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.nosmurf.shk.presenter; | ||
|
||
import javax.inject.Inject; | ||
|
||
public class MainPresenter extends Presenter<MainPresenter.View> { | ||
|
||
@Inject | ||
public MainPresenter() { | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
|
||
} | ||
|
||
@Override | ||
public void destroy() { | ||
|
||
} | ||
|
||
public interface View extends Presenter.View{ | ||
|
||
} | ||
} |
Oops, something went wrong.