Skip to content

Commit

Permalink
chore: upgrade to model-2.0.71
Browse files Browse the repository at this point in the history
Handle renaming from `FIL` to `TGL`.

Refs #156
  • Loading branch information
jo-elimu committed Sep 25, 2024
1 parent 80fe8d0 commit b37bd62
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "ai.elimu.analytics"
minSdkVersion 24
targetSdkVersion 33
versionCode 3001019
versionName "3.1.19-SNAPSHOT"
versionCode 3001020
versionName "3.1.20-SNAPSHOT"
setProperty("archivesBaseName", "${applicationId}-${versionCode}")
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
javaCompileOptions {
Expand Down Expand Up @@ -40,7 +40,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'com.github.elimu-ai:model:model-2.0.66' // See https://jitpack.io/#elimu-ai/model
implementation 'com.github.elimu-ai:model:model-2.0.71' // See https://jitpack.io/#elimu-ai/model

implementation 'com.jakewharton.timber:timber:5.0.1'
implementation 'com.google.android.material:material:1.5.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

public class SharedPreferencesHelper {

private static final String SHARED_PREFS = "shared_prefs";
public static final String SHARED_PREFS = "shared_prefs";

public static final String PREF_APP_VERSION_CODE = "pref_app_version_code";
public static final String PREF_LANGUAGE = "pref_language";
Expand Down
16 changes: 13 additions & 3 deletions app/src/main/java/ai/elimu/analytics/util/VersionHelper.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package ai.elimu.analytics.util;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;

import java.io.File;

import ai.elimu.model.v2.enums.Language;
import timber.log.Timber;

/**
Expand Down Expand Up @@ -49,6 +51,7 @@ public static void updateAppVersion(Context context) {
Timber.i("Upgrading application from version " + oldVersionCode + " to " + newVersionCode + "...");

if (oldVersionCode < 3001015) {
Timber.w("oldVersionCode < 3001015");
// Delete CSV files stored under the old folder structure

File filesDir = context.getFilesDir();
Expand Down Expand Up @@ -109,9 +112,16 @@ public static void updateAppVersion(Context context) {
Timber.w("wordLearningEventsDir.delete(): " + wordLearningEventsDir.delete());
}

// if (oldVersionCode < ???) {
// ...
// }
if (oldVersionCode < 3001020) {
Timber.w("oldVersionCode < 3001020");
// Handle renaming from "FIL" to "TGL"
SharedPreferences sharedPreferences = context.getSharedPreferences(SharedPreferencesHelper.SHARED_PREFS, Context.MODE_PRIVATE);
String languageAsString = sharedPreferences.getString(SharedPreferencesHelper.PREF_LANGUAGE, null);
Timber.w("languageAsString: " + languageAsString);
if ("FIL".equals(languageAsString)) {
SharedPreferencesHelper.storeLanguage(context, Language.TGL);
}
}

// if (oldVersionCode < ???) {
// ...
Expand Down
6 changes: 3 additions & 3 deletions utils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {
defaultConfig {
minSdkVersion 24
targetSdkVersion 33
versionName "3.1.19-SNAPSHOT"
versionName "3.1.20-SNAPSHOT"
setProperty("archivesBaseName", "utils-${versionName}")
}

Expand All @@ -25,7 +25,7 @@ android {
}

dependencies {
implementation 'com.github.elimu-ai:model:model-2.0.66' // See https://jitpack.io/#elimu-ai/model
implementation 'com.github.elimu-ai:model:model-2.0.71' // See https://jitpack.io/#elimu-ai/model
testImplementation 'junit:junit:4.13.2'
}

Expand All @@ -36,7 +36,7 @@ publishing {
utils(MavenPublication) {
groupId 'ai.elimu.analytics'
artifactId 'utils'
version '3.1.19-SNAPSHOT'
version '3.1.20-SNAPSHOT'
artifact("${buildDir}/outputs/aar/utils-${version}-release.aar")
}
}
Expand Down

0 comments on commit b37bd62

Please sign in to comment.