Skip to content

Commit 5eae0d3

Browse files
authored
Merge pull request #21 from rafi0101/feature/dependency-update_and_codecoverage
dependency update
2 parents 55da2f7 + 79e0943 commit 5eae0d3

File tree

10 files changed

+32
-33
lines changed

10 files changed

+32
-33
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
[![API](https://img.shields.io/badge/API-21%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=21)
88
![Language](https://img.shields.io/badge/language-Kotlin-orange.svg)
99
[![PRWelcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/rafi0101/Android-Room-Database-Backup/pulls)
10+
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/rafi0101/Android-Room-Database-Backu/blob/master/LICENSE)
1011

1112
<div align="center">
1213
<sub>Built with ❤︎ by

app/build.gradle

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ plugins {
55
}
66

77
android {
8-
compileSdkVersion 31
9-
buildToolsVersion "30.0.2"
8+
compileSdkVersion 33
9+
buildToolsVersion "30.0.3"
1010

1111
compileOptions {
1212
sourceCompatibility JavaVersion.VERSION_1_8
@@ -16,7 +16,7 @@ android {
1616
defaultConfig {
1717
applicationId "de.raphaelebner.roomdatabasebackup.sample"
1818
minSdkVersion 21
19-
targetSdkVersion 31
19+
targetSdkVersion 33
2020
versionCode 1
2121
versionName "1.0.3"
2222

@@ -45,21 +45,22 @@ android {
4545
kotlinOptions {
4646
jvmTarget = JavaVersion.VERSION_1_8.toString()
4747
}
48+
namespace 'de.raphaelebner.roomdatabasebackup.sample'
4849
}
4950

5051
dependencies {
5152
implementation fileTree(dir: "libs", include: ["*.jar"])
52-
implementation 'androidx.core:core-ktx:1.7.0'
53-
implementation 'androidx.appcompat:appcompat:1.4.0'
54-
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
53+
implementation 'androidx.core:core-ktx:1.9.0'
54+
implementation 'androidx.appcompat:appcompat:1.5.1'
55+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
5556
implementation project(path: ':core')
5657
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
5758
testImplementation 'junit:junit:4.13.2'
5859
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
5960
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
6061

6162
//ROOM SQLite
62-
def room_version = "2.4.0"
63+
def room_version = "2.4.3"
6364

6465
implementation "androidx.room:room-runtime:$room_version"
6566
kapt "androidx.room:room-compiler:$room_version"
@@ -71,7 +72,7 @@ dependencies {
7172
implementation "androidx.room:room-rxjava2:$room_version"
7273

7374
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
74-
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0"
75+
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1"
7576

7677
// optional - Guava support for Room, including Optional and ListenableFuture
7778
implementation "androidx.room:room-guava:$room_version"
@@ -83,6 +84,6 @@ dependencies {
8384
implementation 'androidx.recyclerview:recyclerview:1.2.1'
8485

8586
//Material Design Implementation
86-
implementation 'com.google.android.material:material:1.4.0'
87+
implementation 'com.google.android.material:material:1.7.0'
8788

8889
}

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="de.raphaelebner.roomdatabasebackup.sample">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
43

54
<application
65
android:allowBackup="true"

app/src/main/java/de/raphaelebner/roomdatabasebackup/sample/ActivityAddEditFruit.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class ActivityAddEditFruit : AppCompatActivity() {
8383
deleteFruit = true
8484
saveFruit()
8585
} else {
86-
super.onBackPressed()
86+
onBackPressedDispatcher.onBackPressed()
8787
}
8888
}
8989

@@ -128,7 +128,7 @@ class ActivityAddEditFruit : AppCompatActivity() {
128128
}
129129
//Back Button
130130
android.R.id.home -> {
131-
super.onBackPressed()
131+
onBackPressedDispatcher.onBackPressed()
132132
true
133133

134134
}

app/src/main/java/de/raphaelebner/roomdatabasebackup/sample/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ class MainActivity : AppCompatActivity(), FruitListAdapter.OnItemClickListener {
185185
.show()
186186
}
187187

188-
val backup = RoomBackup(this)
188+
val backup = RoomBackup(this@MainActivity)
189189
/*---------------------Backup and Restore Database--------------------------*/
190190
btnBackup.setOnClickListener {
191191
backup

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
buildscript {
3-
ext.kotlin_version = '1.6.10'
3+
ext.kotlin_version = '1.7.10'
44
repositories {
55
google()
66
mavenCentral()
77
}
88
dependencies {
9-
classpath 'com.android.tools.build:gradle:7.0.4'
9+
classpath 'com.android.tools.build:gradle:7.3.1'
1010
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1111

1212
// NOTE: Do not place your application dependencies here; they belong
@@ -16,8 +16,8 @@ buildscript {
1616

1717
plugins {
1818
id('io.github.gradle-nexus.publish-plugin') version "1.1.0"
19-
id("org.jetbrains.dokka") version "1.6.10"
20-
id 'org.jetbrains.kotlin.android' version '1.6.10' apply false
19+
id("org.jetbrains.dokka") version "1.7.10"
20+
id 'org.jetbrains.kotlin.android' version '1.7.10' apply false
2121
}
2222

2323
apply from: "${rootDir}/scripts/publish-root.gradle"

core/build.gradle

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ plugins {
77
}
88

99
android {
10-
compileSdkVersion 31
11-
buildToolsVersion "30.0.2"
10+
compileSdkVersion 33
11+
buildToolsVersion "30.0.3"
1212

1313
compileOptions {
1414
sourceCompatibility JavaVersion.VERSION_1_8
@@ -17,7 +17,7 @@ android {
1717

1818
defaultConfig {
1919
minSdkVersion 21
20-
targetSdkVersion 31
20+
targetSdkVersion 33
2121
versionCode 1
2222
versionName '1.0.0-beta10'
2323

@@ -47,6 +47,7 @@ android {
4747
kotlinOptions {
4848
jvmTarget = JavaVersion.VERSION_1_8.toString()
4949
}
50+
namespace 'de.raphaelebner.roomdatabasebackup.core'
5051

5152
}
5253

@@ -60,14 +61,14 @@ apply from: "${rootProject.projectDir}/scripts/publish-module.gradle"
6061

6162
dependencies {
6263
implementation fileTree(dir: "libs", include: ["*.jar"])
63-
implementation 'androidx.core:core-ktx:1.7.0'
64-
implementation 'androidx.appcompat:appcompat:1.4.0'
64+
implementation 'androidx.core:core-ktx:1.9.0'
65+
implementation 'androidx.appcompat:appcompat:1.5.1'
6566
testImplementation 'junit:junit:4.13.2'
6667
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
6768
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
6869

6970
//ROOM SQLite
70-
def room_version = "2.4.0"
71+
def room_version = "2.4.3"
7172

7273
implementation "androidx.room:room-runtime:$room_version"
7374
kapt "androidx.room:room-compiler:$room_version"
@@ -85,7 +86,7 @@ dependencies {
8586
testImplementation "androidx.room:room-testing:$room_version"
8687

8788
//Material Design Implementation
88-
implementation 'com.google.android.material:material:1.4.0'
89+
implementation 'com.google.android.material:material:1.6.1'
8990

9091
//Androidx Security
9192
implementation "androidx.security:security-crypto:1.1.0-alpha03"

core/src/main/AndroidManifest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
22
xmlns:tools="http://schemas.android.com/tools"
3-
package="de.raphaelebner.roomdatabasebackup.core"
43
tools:ignore="ExtraText">
54

65
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

core/src/main/java/de/raphaelebner/roomdatabasebackup/core/RoomBackup.kt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import android.util.Log
1111
import android.widget.Toast
1212
import androidx.activity.ComponentActivity
1313
import androidx.activity.result.contract.ActivityResultContracts
14+
import androidx.activity.result.contract.ActivityResultContracts.CreateDocument
1415
import androidx.fragment.app.FragmentActivity
1516
import androidx.room.RoomDatabase
1617
import androidx.security.crypto.EncryptedSharedPreferences
@@ -330,11 +331,10 @@ class RoomBackup(var context: Context) : FragmentActivity() {
330331
*/
331332
private fun restartApp() {
332333
restartIntent!!.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
333-
context.startActivity(restartIntent)
334334
if (context is Activity) {
335335
(context as Activity).finish()
336336
}
337-
Runtime.getRuntime().exit(0)
337+
context.startActivity(restartIntent)
338338
}
339339

340340
/**
@@ -734,16 +734,14 @@ class RoomBackup(var context: Context) : FragmentActivity() {
734734
/**
735735
* Opens the [ActivityResultContracts.CreateDocument] and prompts the user to select a path for creating the new backup file
736736
*/
737-
private val openBackupfileCreator = (context as ComponentActivity).registerForActivityResult(ActivityResultContracts.CreateDocument()) { result ->
737+
private val openBackupfileCreator = (context as ComponentActivity).registerForActivityResult(CreateDocument("todo/todo")) { result ->
738738
if (result != null) {
739739
val out = context.contentResolver.openOutputStream(result)!!
740740
doBackup(out)
741741
return@registerForActivityResult
742742
}
743743
onCompleteListener?.onComplete(
744-
false,
745-
"failure",
746-
OnCompleteListener.EXIT_CODE_ERROR_BACKUP_FILE_CREATOR
744+
false, "failure", OnCompleteListener.EXIT_CODE_ERROR_BACKUP_FILE_CREATOR
747745
)
748746
}
749747

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip

0 commit comments

Comments
 (0)