SpotlessApply

This commit is contained in:
Yogesh Choudhary Paliyal
2022-01-23 11:13:27 +05:30
parent ba975a7dc5
commit ef1103c44c
3 changed files with 4 additions and 8 deletions
@@ -136,6 +136,7 @@ class BackupActivity : AppCompatActivity() {
dialog?.dismiss()
}.show()
} else {
updateItems()
Toast.makeText(
context,
getString(R.string.backup_completed),
@@ -144,9 +145,6 @@ class BackupActivity : AppCompatActivity() {
}
}
}
lifecycleScope.launch {
updateItems()
}
}
private suspend fun updateItems() {
@@ -17,8 +17,7 @@ suspend fun Context?.executeAutoBackup() {
}
}
fun Context?.migrateToDatastore(){
fun Context?.migrateToDatastore() {
this ?: return
val work = OneTimeWorkRequestBuilder<SharedPrefMigrationWorker>().build()
@@ -6,7 +6,6 @@ import androidx.core.content.edit
import androidx.datastore.preferences.core.*
import androidx.hilt.work.HiltWorker
import androidx.work.CoroutineWorker
import androidx.work.Worker
import androidx.work.WorkerParameters
import com.yogeshpaliyal.common.utils.dataStore
import dagger.assisted.Assisted
@@ -42,9 +41,9 @@ class SharedPrefMigrationWorker @AssistedInject constructor(
}
}
}
}catch (e:Exception){
} catch (e: Exception) {
e.printStackTrace()
}
return Result.success()
}
}
}