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

Commit

Permalink
Merge pull request #31 from MarcDonald/version/1.2.2
Browse files Browse the repository at this point in the history
Version 1.2.2
  • Loading branch information
MarcDonald committed Jul 8, 2019
2 parents a84297a + ae94e5b commit 714136f
Show file tree
Hide file tree
Showing 264 changed files with 4,305 additions and 96 deletions.
6 changes: 6 additions & 0 deletions .idea/copyright/Apache_2.xml

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

8 changes: 8 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.

22 changes: 19 additions & 3 deletions app/build.gradle
@@ -1,3 +1,19 @@
/*
* Copyright 2019 Marc Donald
*
* 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.
*/

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'
Expand All @@ -14,8 +30,8 @@ android {
applicationId "com.marcdonald.hibi"
minSdkVersion 23
targetSdkVersion 28
versionCode 30
versionName "1.2.1"
versionCode 31
versionName "1.2.2"
setProperty("archivesBaseName", "Hibi-v$versionName")
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand All @@ -40,7 +56,7 @@ dependencies {

// AndroidX
implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
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-alpha02"
Expand Down
20 changes: 19 additions & 1 deletion app/src/main/java/com/marcdonald/hibi/Hibi.kt
@@ -1,3 +1,18 @@
/*
* Copyright 2019 Marc Donald
*
* 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.marcdonald.hibi

import android.app.Application
Expand All @@ -10,6 +25,8 @@ import com.marcdonald.hibi.data.database.ProductionAppDatabase
import com.marcdonald.hibi.data.network.ConnectivityInterceptor
import com.marcdonald.hibi.data.network.ConnectivityInterceptorImpl
import com.marcdonald.hibi.data.network.github.GithubAPIService
import com.marcdonald.hibi.data.network.github.GithubStatusCodeInterceptor
import com.marcdonald.hibi.data.network.github.GithubStatusCodeInterceptorImpl
import com.marcdonald.hibi.data.network.jisho.JishoAPIService
import com.marcdonald.hibi.data.repository.*
import com.marcdonald.hibi.internal.NOTIFICATION_CHANNEL_REMINDER_ID
Expand Down Expand Up @@ -72,8 +89,9 @@ class Hibi : Application(), KodeinAware {
// </editor-fold>
// <editor-fold desc="Connectivity and Jisho API">
bind<ConnectivityInterceptor>() with singleton { ConnectivityInterceptorImpl(instance()) }
bind<GithubStatusCodeInterceptor>() with singleton { GithubStatusCodeInterceptorImpl() }
bind<JishoAPIService>() with singleton { JishoAPIService(instance()) }
bind<GithubAPIService>() with singleton { GithubAPIService(instance()) }
bind<GithubAPIService>() with singleton { GithubAPIService(instance(), instance()) }
// </editor-fold>
// <editor-fold desc="View models">
bind() from provider { MainEntriesViewModelFactory(instance(), instance(), instance()) }
Expand Down
15 changes: 15 additions & 0 deletions app/src/main/java/com/marcdonald/hibi/MainActivity.kt
@@ -1,3 +1,18 @@
/*
* Copyright 2019 Marc Donald
*
* 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.marcdonald.hibi

import android.os.Bundle
Expand Down
15 changes: 15 additions & 0 deletions app/src/main/java/com/marcdonald/hibi/data/database/AppDatabase.kt
@@ -1,3 +1,18 @@
/*
* Copyright 2019 Marc Donald
*
* 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.marcdonald.hibi.data.database

interface AppDatabase {
Expand Down
15 changes: 15 additions & 0 deletions app/src/main/java/com/marcdonald/hibi/data/database/DAO.kt
@@ -1,3 +1,18 @@
/*
* Copyright 2019 Marc Donald
*
* 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.marcdonald.hibi.data.database

import androidx.lifecycle.LiveData
Expand Down
@@ -1,3 +1,18 @@
/*
* Copyright 2019 Marc Donald
*
* 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.marcdonald.hibi.data.database

import android.content.Context
Expand Down
15 changes: 15 additions & 0 deletions app/src/main/java/com/marcdonald/hibi/data/entity/Book.kt
@@ -1,3 +1,18 @@
/*
* Copyright 2019 Marc Donald
*
* 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.marcdonald.hibi.data.entity

import androidx.room.Entity
Expand Down
@@ -1,3 +1,18 @@
/*
* Copyright 2019 Marc Donald
*
* 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.marcdonald.hibi.data.entity

import androidx.room.Entity
Expand Down
15 changes: 15 additions & 0 deletions app/src/main/java/com/marcdonald/hibi/data/entity/Entry.kt
@@ -1,3 +1,18 @@
/*
* Copyright 2019 Marc Donald
*
* 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.marcdonald.hibi.data.entity

import androidx.room.Entity
Expand Down
15 changes: 15 additions & 0 deletions app/src/main/java/com/marcdonald/hibi/data/entity/EntryImage.kt
@@ -1,3 +1,18 @@
/*
* Copyright 2019 Marc Donald
*
* 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.marcdonald.hibi.data.entity

import androidx.room.Entity
Expand Down
15 changes: 15 additions & 0 deletions app/src/main/java/com/marcdonald/hibi/data/entity/NewWord.kt
@@ -1,3 +1,18 @@
/*
* Copyright 2019 Marc Donald
*
* 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.marcdonald.hibi.data.entity

import androidx.room.Entity
Expand Down
15 changes: 15 additions & 0 deletions app/src/main/java/com/marcdonald/hibi/data/entity/Tag.kt
@@ -1,3 +1,18 @@
/*
* Copyright 2019 Marc Donald
*
* 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.marcdonald.hibi.data.entity

import androidx.room.Entity
Expand Down
@@ -1,3 +1,18 @@
/*
* Copyright 2019 Marc Donald
*
* 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.marcdonald.hibi.data.entity

import androidx.room.Entity
Expand Down
@@ -1,3 +1,18 @@
/*
* Copyright 2019 Marc Donald
*
* 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.marcdonald.hibi.data.network

import okhttp3.Interceptor
Expand Down
@@ -1,10 +1,25 @@
/*
* Copyright 2019 Marc Donald
*
* 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.marcdonald.hibi.data.network

import android.content.Context
import android.net.ConnectivityManager
import com.marcdonald.hibi.internal.NoConnectivityException
import okhttp3.Interceptor
import okhttp3.Response
import java.io.IOException

class ConnectivityInterceptorImpl(context: Context) : ConnectivityInterceptor {

Expand All @@ -23,4 +38,6 @@ class ConnectivityInterceptorImpl(context: Context) : ConnectivityInterceptor {
val networkInfo = connectivityManager.activeNetworkInfo
return networkInfo != null && networkInfo.isConnected
}
}
}

class NoConnectivityException : IOException()
@@ -1,3 +1,18 @@
/*
* Copyright 2019 Marc Donald
*
* 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.marcdonald.hibi.data.network.github

import com.marcdonald.hibi.data.network.ConnectivityInterceptor
Expand All @@ -13,9 +28,10 @@ interface GithubAPIService {
suspend fun getNewestVersion(): GithubVersionResponse

companion object {
operator fun invoke(connectivityInterceptor: ConnectivityInterceptor): GithubAPIService {
operator fun invoke(connectivityInterceptor: ConnectivityInterceptor, githubStatusCodeInterceptor: GithubStatusCodeInterceptor): GithubAPIService {
val okHttpClient = OkHttpClient.Builder()
.addInterceptor(connectivityInterceptor)
.addInterceptor(githubStatusCodeInterceptor)
.build()

return Retrofit.Builder()
Expand Down

0 comments on commit 714136f

Please sign in to comment.