-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/caches/build_file_checksums.ser | ||
/.idea/libraries | ||
/.idea/modules.xml | ||
/.idea/workspace.xml | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# ArtGallery | ||
A sample android app | ||
|
||
### Scenario | ||
Used https://jsonplaceholder.typicode.com/ as a public api to generate fake data for testing | ||
|
||
At a glance: | ||
|
||
- Created a list of Album | ||
- In the Item of each Album, showed user name. | ||
- When user taps on Album, new page will be shown which includes list of photos. | ||
- when user taps on photo, show image bigger. | ||
- Were Written tests to completely cover Exceptions/Expectations | ||
- And: | ||
- Supported orientation change | ||
- Supported offline mode |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
apply plugin: 'com.android.application' | ||
apply plugin: 'kotlin-android' | ||
apply plugin: 'kotlin-android-extensions' | ||
apply plugin: 'kotlin-kapt' | ||
|
||
android { | ||
compileSdkVersion 28 | ||
defaultConfig { | ||
applicationId "com.android.artgallery" | ||
minSdkVersion 15 | ||
targetSdkVersion 28 | ||
versionCode 1 | ||
versionName "1.0" | ||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
multiDexEnabled = true | ||
vectorDrawables.useSupportLibrary = true | ||
dataBinding { | ||
enabled = true | ||
} | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
androidExtensions{ | ||
experimental = true | ||
} | ||
|
||
dependencies { | ||
implementation fileTree(dir: 'libs', include: ['*.jar']) | ||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" | ||
implementation 'com.android.support:appcompat-v7:28.0.0' | ||
implementation 'com.android.support.constraint:constraint-layout:1.1.3' | ||
implementation 'com.android.support:support-v4:28.0.0' | ||
implementation 'com.android.support:recyclerview-v7:28.0.0' | ||
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' | ||
implementation 'com.squareup.retrofit2:retrofit:2.5.0' | ||
implementation 'com.squareup.retrofit2:converter-moshi:2.5.0' | ||
implementation 'com.squareup.retrofit2:converter-gson:2.4.0' | ||
implementation 'com.squareup.okhttp3:okhttp:3.12.0' | ||
implementation 'com.google.code.gson:gson:2.8.2' | ||
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.1' | ||
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.0.1' | ||
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0' | ||
implementation 'io.reactivex.rxjava2:rxjava:2.2.0' | ||
implementation "com.squareup.retrofit2:adapter-rxjava2:2.3.0" | ||
implementation "org.jetbrains.anko:anko:$anko_version" | ||
implementation 'com.google.dagger:dagger:2.15' | ||
kapt 'com.google.dagger:dagger-compiler:2.15' | ||
implementation 'com.android.support:cardview-v7:28.0.0' | ||
implementation "android.arch.persistence.room:runtime:$room_version" | ||
implementation "android.arch.persistence.room:rxjava2:$room_version" | ||
kapt "android.arch.persistence.room:compiler:$room_version" | ||
implementation "com.google.dagger:dagger:$daggerLibVersion" | ||
kapt "com.google.dagger:dagger-compiler:$daggerLibVersion" | ||
implementation "com.google.dagger:dagger-android:$daggerAndroidLibVersion" | ||
implementation "com.google.dagger:dagger-android-support:$daggerAndroidLibVersion" | ||
kapt "com.google.dagger:dagger-android-processor:$daggerLibVersion" | ||
implementation "android.arch.lifecycle:extensions:1.1.1" | ||
kapt "android.arch.lifecycle:compiler:1.1.1" | ||
implementation 'com.squareup.picasso:picasso:2.71828' | ||
implementation 'com.android.support:design:28.0.0' | ||
} |
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,24 @@ | ||
package com.android.artgallery | ||
|
||
import android.support.test.InstrumentationRegistry | ||
import android.support.test.runner.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.getTargetContext() | ||
assertEquals("com.android.artgallery", appContext.packageName) | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.android.artgallery"> | ||
|
||
|
||
<uses-permission android:name="android.permission.INTERNET"/> | ||
|
||
<application | ||
android:name=".MainApplication" | ||
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"> | ||
|
||
|
||
<activity android:name=".presentation.gallery.GalleryActivity" | ||
android:theme="@style/NoTheme"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN"/> | ||
|
||
<category android:name="android.intent.category.LAUNCHER"/> | ||
</intent-filter> | ||
</activity> | ||
|
||
<activity android:name=".presentation.detailphoto.PhotoDetailActivity" | ||
android:theme="@style/AppTheme.NoActionBar"/> | ||
</application> | ||
|
||
</manifest> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.android.artgallery | ||
|
||
import android.app.Activity | ||
import android.app.Application | ||
import com.android.artgallery.di.component.DaggerApplicationComponent | ||
import dagger.android.DispatchingAndroidInjector | ||
import dagger.android.HasActivityInjector | ||
import javax.inject.Inject | ||
import kotlin.properties.Delegates | ||
|
||
class MainApplication : Application(), HasActivityInjector { | ||
|
||
@Inject | ||
lateinit var activityInjector: DispatchingAndroidInjector<Activity> | ||
|
||
override fun onCreate() { | ||
super.onCreate() | ||
|
||
DaggerApplicationComponent | ||
.builder() | ||
.application(this) | ||
.build() | ||
.inject(this) | ||
} | ||
|
||
override fun activityInjector() = activityInjector | ||
|
||
companion object { | ||
|
||
private val TAG = MainApplication::class.java.simpleName | ||
var instance: MainApplication by Delegates.notNull() | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package com.android.artgallery.data.source | ||
|
||
data class Album(var userId:Long,var id:Long,var title:String) |