Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
skydoves committed Feb 23, 2020
1 parent 0579ad9 commit dafd389
Show file tree
Hide file tree
Showing 108 changed files with 2,945 additions and 34 deletions.
16 changes: 16 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.

# More details are here: https://help.github.com/articles/about-codeowners/

# The '*' pattern is global owners.
# Not adding in this PR, but I'd like to try adding a global owner set with the entire team.
# One interpretation of their docs is that global owners are added only if not removed
# by a more local rule.

# Order is important. The last matching pattern has the most precedence.
# The folders are ordered as follows:

# In each subsection folders are ordered first by depth, then alphabetically.
# This should make it easy to add new rules without breaking existing ones.
* @skydoves
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: skydoves
custom: ["https://www.paypal.me/skydoves", "https://www.buymeacoffee.com/skydoves"]
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/Bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Bug report
about: Something is crashing or not working as intended

---

**Please complete the following information:**
- Library Version [e.g. v1.0.0]
- Affected Device(s) [e.g. Samsung Galaxy s10 with Android 9.0]

**Describe the Bug:**

Add a clear description about the problem.

**Expected Behavior:**

A clear description of what you expected to happen.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/Feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem?**

A clear and concise description of what the problem is.

**Describe the solution you'd like:**

A clear and concise description of what you want to happen.

**Describe alternatives you've considered:**

A clear description of any alternative solutions you've considered.
18 changes: 18 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Guidelines
Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.

### Types of changes
What types of changes does your code introduce?

- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

### Preparing a pull request for review
Ensure your change is properly formatted by running:

```gradle
$ ./gradlew spotlessApply
```

Please correct any failures before requesting a review.
43 changes: 9 additions & 34 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Built application files
*.apk
*.aar
*.ap_
*.aab

# Files for the ART/Dalvik VM
*.dex
Expand All @@ -14,13 +12,16 @@
bin/
gen/
out/
# Uncomment the following line in case you need and you don't have the release build type files in your app
# release/

# Gradle files
/.idea
.gradle/
build/

# DS_Store
*.DS_Store
**/DS_Store

# Local configuration file (sdk path, etc)
local.properties

Expand All @@ -36,50 +37,24 @@ proguard/
# Android Studio captures folder
captures/

# IntelliJ
# Intellij
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
# Android Studio 3 in .gitignore file.
.idea/caches
.idea/modules.xml
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
.idea/navEditor.xml

# Keystore files
# Uncomment the following lines if you do not want to check your keystore files in.
#*.jks
#*.keystore
*.jks

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
.cxx/

# Google Services (e.g. APIs or Firebase)
# google-services.json
google-services.json

# Freeline
freeline.py
freeline/
freeline_project_description.json

# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md

# Version control
vcs.xml

# lint
lint/intermediates/
lint/generated/
lint/outputs/
lint/tmp/
# lint/reports/
freeline_project_description.json
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
77 changes: 77 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from: '../dependencies.gradle'

android {
compileSdkVersion versions.compileSdk
defaultConfig {
applicationId "com.skydoves.disneymotions"
minSdkVersion versions.minSdk
targetSdkVersion versions.compileSdk
versionCode versions.versionCode
versionName versions.versionName
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
dataBinding {
enabled = true
}
androidExtensions {
experimental = true
}
}

dependencies {
// kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$versions.kotlin"

// android supports
implementation "com.google.android.material:material:$versions.materialVersion"
implementation "androidx.constraintlayout:constraintlayout:$versions.constraintVersion"

// architecture components
implementation "androidx.lifecycle:lifecycle-extensions:$versions.lifecycleVersion"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$versions.lifecycleVersion"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$versions.lifecycleVersion"
implementation "androidx.room:room-runtime:$versions.roomVersion"
kapt "androidx.room:room-compiler:$versions.roomVersion"
testImplementation "androidx.arch.core:core-testing:$versions.archCompomentVersion"

// koin
implementation "org.koin:koin-android:$versions.koinVersion"
implementation "org.koin:koin-android-scope:$versions.koinVersion"
implementation "org.koin:koin-android-viewmodel:$versions.koinVersion"

// network
implementation "com.squareup.retrofit2:retrofit:$versions.retrofitVersion"
implementation "com.squareup.okhttp3:logging-interceptor:$versions.okhttpVersion"
implementation "com.squareup.retrofit2:converter-gson:$versions.retrofitVersion"

// coroutines
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$versions.coroutinesVersion"
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$versions.coroutinesVersion"
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$versions.coroutinesVersion"

// glide
implementation "com.github.bumptech.glide:glide:$versions.glideVersion"
implementation "com.github.florent37:glidepalette:$versions.glidePaletteVersion"
kapt "com.github.bumptech.glide:compiler:$versions.glideVersion"

// adapter
implementation "com.github.skydoves:baserecyclerviewadapter:$versions.baseAdapter"

// whatIf
implementation "com.github.skydoves:whatif:$versions.whatIfVersion"

// debugging
implementation "com.jakewharton.timber:timber:$versions.timberVersion"
}

apply from: '../spotless.gradle'
29 changes: 29 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.skydoves.disneymotions">

<uses-permission android:name="android.permission.INTERNET" />

<application
android:name=".DisneyApplication"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="AllowBackup,GoogleAppIndexingWarning">
<activity
android:name=".view.ui.details.PosterDetailActivity"
android:launchMode="singleTop" />
<activity android:name=".view.ui.main.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
50 changes: 50 additions & 0 deletions app/src/main/java/com/skydoves/disneymotions/DisneyApplication.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Designed and developed by 2020 skydoves (Jaewoong Eum)
*
* 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://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.
*/

@file:Suppress("unused")

package com.skydoves.disneymotions

import android.app.Application
import com.bumptech.glide.request.target.ViewTarget
import com.skydoves.disneymotions.di.networkModule
import com.skydoves.disneymotions.di.persistenceModule
import com.skydoves.disneymotions.di.repositoryModule
import com.skydoves.disneymotions.di.viewModelModule
import org.koin.android.ext.koin.androidContext
import org.koin.core.context.startKoin
import timber.log.Timber

class DisneyApplication : Application() {

override fun onCreate() {
super.onCreate()

ViewTarget.setTagId(R.string.app_name)

startKoin {
androidContext(this@DisneyApplication)
modules(networkModule)
modules(persistenceModule)
modules(repositoryModule)
modules(viewModelModule)
}

if (BuildConfig.DEBUG) {
Timber.plant(Timber.DebugTree())
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Designed and developed by 2020 skydoves (Jaewoong Eum)
*
* 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://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 com.skydoves.disneymotions.base

import androidx.annotation.LayoutRes
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding

/**
* DatabindingActivity is an abstract class for providing [DataBindingUtil].
* provides implementations of only [ViewDataBinding] from an abstract information.
* Do not modify this class. This is a first-level abstraction class.
* If you want to add more specifications, make another class which extends [DatabindingActivity].
*/
abstract class DatabindingActivity : AppCompatActivity() {

protected inline fun <reified T : ViewDataBinding> binding(
@LayoutRes resId: Int
): Lazy<T> = lazy { DataBindingUtil.setContentView<T>(this, resId) }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Designed and developed by 2020 skydoves (Jaewoong Eum)
*
* 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://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 com.skydoves.disneymotions.base

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.annotation.LayoutRes
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding
import androidx.fragment.app.Fragment

/**
* ViewModelFragment is an abstract class for providing [DataBindingUtil].
* provides implementations of only [ViewDataBinding] from an abstract information.
* Do not modify this class. This is a first-level abstraction class.
* If you want to add more specifications, make another class which extends [DatabindingFragment].
*/
abstract class DatabindingFragment : Fragment() {

protected inline fun <reified T : ViewDataBinding> binding(
inflater: LayoutInflater,
@LayoutRes resId: Int,
container: ViewGroup?
): T = DataBindingUtil.inflate(inflater, resId, container, false)
}
Loading

0 comments on commit dafd389

Please sign in to comment.