diff --git a/.idea/dictionaries/naresh.xml b/.idea/dictionaries/naresh.xml index 4547fe3..7acda35 100644 --- a/.idea/dictionaries/naresh.xml +++ b/.idea/dictionaries/naresh.xml @@ -1,8 +1,10 @@ + eiweblog elektro hsdsans + nareshkumarrao weblog diff --git a/app/build.gradle b/app/build.gradle index 10c20b8..80de0e8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,8 +11,8 @@ android { applicationId "com.nareshkumarrao.eiweblog" minSdkVersion 16 targetSdkVersion 30 - versionCode 8 - versionName "0.10.4" + versionCode 9 + versionName "0.10.5" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/app/release/app-release.apk b/app/release/app-release.apk index e5b0de3..9700d46 100644 Binary files a/app/release/app-release.apk and b/app/release/app-release.apk differ diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json index 44af4c6..ff4cfdc 100644 --- a/app/release/output-metadata.json +++ b/app/release/output-metadata.json @@ -10,8 +10,8 @@ { "type": "SINGLE", "filters": [], - "versionCode": 8, - "versionName": "0.10.4", + "versionCode": 9, + "versionName": "0.10.5", "outputFile": "app-release.apk" } ] diff --git a/app/src/main/java/com/nareshkumarrao/eiweblog/MainActivity.kt b/app/src/main/java/com/nareshkumarrao/eiweblog/MainActivity.kt index 585dc79..7d38aa8 100644 --- a/app/src/main/java/com/nareshkumarrao/eiweblog/MainActivity.kt +++ b/app/src/main/java/com/nareshkumarrao/eiweblog/MainActivity.kt @@ -11,6 +11,7 @@ import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.widget.Toolbar import androidx.viewpager.widget.ViewPager +import androidx.work.ExistingPeriodicWorkPolicy import androidx.work.PeriodicWorkRequestBuilder import androidx.work.WorkManager import androidx.work.WorkRequest @@ -37,15 +38,15 @@ class MainActivity : AppCompatActivity() { Utilities.createNotificationChannel(this) HISUtility.createNotificationChannel(this) - val updateWeblogWorkerRequest: WorkRequest = + val updateWeblogWorkerRequest = PeriodicWorkRequestBuilder(1, TimeUnit.HOURS) .build() - val updateGradesWorkerRequest: WorkRequest = + val updateGradesWorkerRequest = PeriodicWorkRequestBuilder(3, TimeUnit.HOURS) .build() - WorkManager.getInstance(this).enqueue(updateWeblogWorkerRequest) - WorkManager.getInstance(this).enqueue(updateGradesWorkerRequest) + WorkManager.getInstance(this).enqueueUniquePeriodicWork("weblog", ExistingPeriodicWorkPolicy.REPLACE, updateWeblogWorkerRequest) + WorkManager.getInstance(this).enqueueUniquePeriodicWork("grades", ExistingPeriodicWorkPolicy.REPLACE, updateGradesWorkerRequest) Utilities.fetchRepoReleaseInformation(this, ::repoReleaseCallback) } diff --git a/app/src/main/java/com/nareshkumarrao/eiweblog/Utilities.kt b/app/src/main/java/com/nareshkumarrao/eiweblog/Utilities.kt index e9fea5d..0018091 100644 --- a/app/src/main/java/com/nareshkumarrao/eiweblog/Utilities.kt +++ b/app/src/main/java/com/nareshkumarrao/eiweblog/Utilities.kt @@ -167,6 +167,7 @@ internal object Utilities { } val notificationManager: NotificationManager = context?.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager notificationManager.createNotificationChannel(channel) + notificationManager.deleteNotificationChannel("com.nareshkumarrao.eiweblog.update") } }