Skip to content

Commit

Permalink
Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
103sbavert committed Mar 28, 2021
1 parent ac13e4d commit 95f3899
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Expand Up @@ -36,8 +36,8 @@ android {
applicationId "com.sbeve.jada"
minSdkVersion 21
targetSdkVersion 30
versionCode 24
versionName 'v4.3.2'
versionCode 25
versionName 'v4.3.3'
}

buildTypes {
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/java/com/sbeve/jada/MyApplication.kt
@@ -1,17 +1,18 @@
package com.sbeve.jada

import android.annotation.SuppressLint
import android.app.Application
import android.content.Context

class MyApplication : Application() {

override fun onCreate() {
super.onCreate()
mContext = this.applicationContext
context = this.applicationContext
}

companion object {
private lateinit var mContext: Context
fun getInstance() = mContext
@SuppressLint("StaticFieldLeak")
lateinit var context: Context
}
}
@@ -1,5 +1,6 @@
package com.sbeve.jada.fragments.main

import android.annotation.SuppressLint
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.sbeve.jada.MyApplication
Expand All @@ -12,7 +13,8 @@ import kotlinx.coroutines.launch
class MainViewModel : ViewModel() {

//get the application context to use it to make the database
private val applicationContext = MyApplication.getInstance()
@SuppressLint("StaticFieldLeak")
private val applicationContext = MyApplication.context

//get the instance of the database
private var roomDatabase = DictionaryDatabase.getInstance(applicationContext)
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/java/com/sbeve/jada/retrofit_utils/Word.kt
Expand Up @@ -19,8 +19,6 @@ data class Definition(
val definition: String,
@SerializedName("example")
val example: String?,
// @SerializedName("synonyms")
// val synonyms: List<String>
)

data class Meaning(
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
@@ -1,10 +1,10 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
kotlin_version = '1.4.30'
nav_version = '2.3.3'
kotlin_version = '1.4.31'
nav_version = '2.3.4'
retrofit_version = "2.9.0"
lifecycle_version = '2.3.0'
lifecycle_version = '2.3.1'
room_version = "2.2.6"
app_compat_version = "1.2.0"
constraint_layout_version = "2.0.4"
Expand All @@ -17,7 +17,7 @@ buildscript {
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.2"
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
}
Expand Down

0 comments on commit 95f3899

Please sign in to comment.