Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
Merge pull request #25 from MarcDonald/version/1.4.1
Browse files Browse the repository at this point in the history
Version 1.4.1
  • Loading branch information
MarcDonald committed Aug 13, 2019
2 parents 0d73576 + 7eb6a1c commit db9cc57
Show file tree
Hide file tree
Showing 82 changed files with 4,439 additions and 2,698 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Expand Up @@ -25,7 +25,7 @@ If applicable, add screenshots to help explain your problem.

**Device (please complete the following information):**
- Device: [e.g. Samsung S10+]
- App Version (e.g. 1.4.0)
- App Version (e.g. 1.4.0)
- Android Version [e.g. Pie]

**Additional context**
Expand Down
22 changes: 9 additions & 13 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/copyright/MIT.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/copyright/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -72,7 +72,7 @@ Apache 2 License
```
The MIT License (MIT)
Copyright (c) 2018 Marc Donald
Copyright (c) 2019 Marc Donald
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
6 changes: 3 additions & 3 deletions app/build.gradle
Expand Up @@ -12,8 +12,8 @@ android {
applicationId "com.marcdonald.earworm"
minSdkVersion 23
targetSdkVersion 28
versionCode 21
versionName "1.4.0"
versionCode 22
versionName "1.4.1"
setProperty("archivesBaseName", "Earworm-v$versionName")
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand All @@ -38,7 +38,7 @@ dependencies {

// AndroidX
implementation 'androidx.appcompat:appcompat:1.1.0-alpha02'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta1'
implementation 'androidx.preference:preference:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0-alpha01"
Expand Down
83 changes: 53 additions & 30 deletions app/src/main/java/com/marcdonald/earworm/Earworm.kt
@@ -1,3 +1,26 @@
/*
* Copyright (c) 2019 Marc Donald
*
* The MIT License (MIT)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package com.marcdonald.earworm

import android.app.Application
Expand Down Expand Up @@ -28,36 +51,36 @@ import org.kodein.di.generic.singleton
import timber.log.Timber

class Earworm : Application(), KodeinAware {
override val kodein = Kodein.lazy {
import(androidXModule(this@Earworm))
override val kodein = Kodein.lazy {
import(androidXModule(this@Earworm))

// <editor-fold desc="Database">
bind<AppDatabase>() with singleton { ProductionAppDatabase.invoke(applicationContext) }
bind<DAO>() with singleton { instance<AppDatabase>().dao() }
bind<FavouriteItemRepository>() with singleton { FavouriteItemRepositoryImpl.getInstance(instance()) }
// </editor-fold>
// <editor-fold desc="Network">
bind<ConnectivityInterceptor>() with singleton { ConnectivityInterceptorImpl(instance()) }
bind<GithubAPIService>() with singleton { GithubAPIService(instance()) }
// </editor-fold>
// <editor-fold desc="Others">
bind<FileUtils>() with provider { FileUtilsImpl(instance()) }
bind<ThemeUtils>() with provider { ThemeUtilsImpl(instance()) }
// </editor-fold>
// <editor-fold desc="View Model Factories">
bind() from provider { MainFragmentViewModelFactory(instance(), instance()) }
bind() from provider { AddItemViewModelFactory(instance(), instance()) }
bind() from provider { BackupDialogViewModelFactory(instance()) }
bind() from provider { RestoreDialogViewModelFactory(instance(), instance()) }
bind() from provider { UpdateDialogViewModelFactory(instance()) }
// </editor-fold>
}
// <editor-fold desc="Database">
bind<AppDatabase>() with singleton { ProductionAppDatabase.invoke(applicationContext) }
bind<DAO>() with singleton { instance<AppDatabase>().dao() }
bind<FavouriteItemRepository>() with singleton { FavouriteItemRepositoryImpl.getInstance(instance()) }
// </editor-fold>
// <editor-fold desc="Network">
bind<ConnectivityInterceptor>() with singleton { ConnectivityInterceptorImpl(instance()) }
bind<GithubAPIService>() with singleton { GithubAPIService(instance()) }
// </editor-fold>
// <editor-fold desc="Others">
bind<FileUtils>() with provider { FileUtilsImpl(instance()) }
bind<ThemeUtils>() with provider { ThemeUtilsImpl(instance()) }
// </editor-fold>
// <editor-fold desc="View Model Factories">
bind() from provider { MainFragmentViewModelFactory(instance(), instance()) }
bind() from provider { AddItemViewModelFactory(instance(), instance()) }
bind() from provider { BackupDialogViewModelFactory(instance()) }
bind() from provider { RestoreDialogViewModelFactory(instance(), instance()) }
bind() from provider { UpdateDialogViewModelFactory(instance()) }
// </editor-fold>
}

override fun onCreate() {
super.onCreate()
if(BuildConfig.DEBUG) {
Timber.plant(Timber.DebugTree())
Timber.i("Log: Timber Debug Tree planted")
}
}
override fun onCreate() {
super.onCreate()
if(BuildConfig.DEBUG) {
Timber.plant(Timber.DebugTree())
Timber.i("Log: Timber Debug Tree planted")
}
}
}
73 changes: 48 additions & 25 deletions app/src/main/java/com/marcdonald/earworm/MainActivity.kt
@@ -1,3 +1,26 @@
/*
* Copyright (c) 2019 Marc Donald
*
* The MIT License (MIT)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package com.marcdonald.earworm

import android.os.Bundle
Expand All @@ -7,29 +30,29 @@ import com.marcdonald.earworm.mainscreen.MainFragment
import timber.log.Timber

class MainActivity : EarwormActivity() {
private lateinit var mainFrame: CoordinatorLayout

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
bindViews()
setDefaultFragment()
}

private fun bindViews() {
this.mainFrame = findViewById(R.id.frame_main)
}

private fun setDefaultFragment() {
val fragment = MainFragment()

if(intent.action == "com.marcdonald.earworm.intent.ADD_ITEM") {
Timber.d("Log: onCreate: Started from Add Item app shortcut")
val args = Bundle()
args.putBoolean("add_item", true)
fragment.arguments = args
}

setFragment(fragment, supportFragmentManager, R.id.frame_main)
}
private lateinit var mainFrame: CoordinatorLayout

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
bindViews()
setDefaultFragment()
}

private fun bindViews() {
this.mainFrame = findViewById(R.id.frame_main)
}

private fun setDefaultFragment() {
val fragment = MainFragment()

if(intent.action == "com.marcdonald.earworm.intent.ADD_ITEM") {
Timber.d("Log: onCreate: Started from Add Item app shortcut")
val args = Bundle()
args.putBoolean("add_item", true)
fragment.arguments = args
}

setFragment(fragment, supportFragmentManager, R.id.frame_main)
}
}

0 comments on commit db9cc57

Please sign in to comment.