Removed deprecated onBackPressed from AddFragment.kt
This commit is contained in:
		
							parent
							
								
									c269e0aff7
								
							
						
					
					
						commit
						4aa59e2ce8
					
				
							
								
								
									
										2
									
								
								.idea/gradle.xml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.idea/gradle.xml
									
									
									
										generated
									
									
									
								
							@ -7,7 +7,7 @@
 | 
			
		||||
        <option name="testRunner" value="GRADLE" />
 | 
			
		||||
        <option name="distributionType" value="DEFAULT_WRAPPED" />
 | 
			
		||||
        <option name="externalProjectPath" value="$PROJECT_DIR$" />
 | 
			
		||||
        <option name="gradleJvm" value="1.8" />
 | 
			
		||||
        <option name="gradleJvm" value="Android Studio java home" />
 | 
			
		||||
        <option name="modules">
 | 
			
		||||
          <set>
 | 
			
		||||
            <option value="$PROJECT_DIR$" />
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										2
									
								
								.idea/misc.xml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.idea/misc.xml
									
									
									
										generated
									
									
									
								
							@ -7,7 +7,7 @@
 | 
			
		||||
      </map>
 | 
			
		||||
    </option>
 | 
			
		||||
  </component>
 | 
			
		||||
  <component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
 | 
			
		||||
  <component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="1.8" project-jdk-type="JavaSDK">
 | 
			
		||||
    <output url="file://$PROJECT_DIR$/build/classes" />
 | 
			
		||||
  </component>
 | 
			
		||||
  <component name="ProjectType">
 | 
			
		||||
 | 
			
		||||
@ -1,8 +1,3 @@
 | 
			
		||||
//apply plugin: 'com.android.application'
 | 
			
		||||
//apply plugin: 'kotlin-android'
 | 
			
		||||
//apply plugin: "kotlin-kapt"
 | 
			
		||||
//apply plugin: "androidx.navigation.safeargs.kotlin"
 | 
			
		||||
//apply plugin: "kotlin-parcelize"
 | 
			
		||||
plugins {
 | 
			
		||||
    id('com.android.application')
 | 
			
		||||
    id('kotlin-android')
 | 
			
		||||
@ -53,27 +48,28 @@ android {
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    namespace 'com.example.todoapp'
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
dependencies {
 | 
			
		||||
    implementation fileTree(dir: "libs", include: ["*.jar"])
 | 
			
		||||
    implementation 'androidx.core:core-ktx:1.8.0'
 | 
			
		||||
    implementation 'androidx.appcompat:appcompat:1.5.0'
 | 
			
		||||
    implementation 'androidx.core:core-ktx:1.9.0'
 | 
			
		||||
    implementation 'androidx.appcompat:appcompat:1.6.0'
 | 
			
		||||
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
 | 
			
		||||
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
 | 
			
		||||
    testImplementation 'junit:junit:4.13.2'
 | 
			
		||||
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
 | 
			
		||||
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
 | 
			
		||||
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
 | 
			
		||||
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
 | 
			
		||||
 | 
			
		||||
    // Navigation Component
 | 
			
		||||
    implementation 'androidx.navigation:navigation-fragment-ktx:2.5.1'
 | 
			
		||||
    implementation 'androidx.navigation:navigation-ui-ktx:2.5.1'
 | 
			
		||||
    implementation 'androidx.navigation:navigation-fragment-ktx:2.5.3'
 | 
			
		||||
    implementation 'androidx.navigation:navigation-ui-ktx:2.5.3'
 | 
			
		||||
 | 
			
		||||
    // Room components
 | 
			
		||||
    implementation "androidx.room:room-runtime:2.4.3"
 | 
			
		||||
    kapt "androidx.room:room-compiler:2.4.3"
 | 
			
		||||
    implementation "androidx.room:room-ktx:2.4.3"
 | 
			
		||||
    androidTestImplementation "androidx.room:room-testing:2.4.3"
 | 
			
		||||
    implementation "androidx.room:room-runtime:2.5.0"
 | 
			
		||||
    kapt "androidx.room:room-compiler:2.5.0"
 | 
			
		||||
    implementation "androidx.room:room-ktx:2.5.0"
 | 
			
		||||
    androidTestImplementation "androidx.room:room-testing:2.5.0"
 | 
			
		||||
 | 
			
		||||
    // Lifecycle components
 | 
			
		||||
//    implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,5 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
    package="com.example.todoapp">
 | 
			
		||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
 | 
			
		||||
 | 
			
		||||
    <application
 | 
			
		||||
        android:allowBackup="true"
 | 
			
		||||
 | 
			
		||||
@ -3,7 +3,6 @@ package com.example.todoapp
 | 
			
		||||
import androidx.appcompat.app.AppCompatActivity
 | 
			
		||||
import android.os.Bundle
 | 
			
		||||
import androidx.navigation.NavController
 | 
			
		||||
import androidx.navigation.findNavController
 | 
			
		||||
import androidx.navigation.fragment.NavHostFragment
 | 
			
		||||
import androidx.navigation.ui.setupActionBarWithNavController
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -48,7 +48,7 @@ class AddFragment : Fragment() {
 | 
			
		||||
                if (menuItem.itemId == R.id.menu_add) {
 | 
			
		||||
                    insertDataToDb()
 | 
			
		||||
                } else if (menuItem.itemId == android.R.id.home) {
 | 
			
		||||
                    requireActivity().onBackPressed()
 | 
			
		||||
                    requireActivity().onBackPressedDispatcher.onBackPressed()
 | 
			
		||||
                }
 | 
			
		||||
                return true
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
@ -6,10 +6,10 @@ buildscript {
 | 
			
		||||
        mavenCentral()
 | 
			
		||||
    }
 | 
			
		||||
    dependencies {
 | 
			
		||||
        classpath 'com.android.tools.build:gradle:7.2.2'
 | 
			
		||||
        classpath 'com.android.tools.build:gradle:7.4.1'
 | 
			
		||||
 | 
			
		||||
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10"
 | 
			
		||||
        classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.5.1"
 | 
			
		||||
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.0"
 | 
			
		||||
        classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.5.3"
 | 
			
		||||
        // NOTE: Do not place your application dependencies here; they belong
 | 
			
		||||
        // in the individual module build.gradle files
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										2
									
								
								gradle/wrapper/gradle-wrapper.properties
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								gradle/wrapper/gradle-wrapper.properties
									
									
									
									
										vendored
									
									
								
							@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
 | 
			
		||||
distributionPath=wrapper/dists
 | 
			
		||||
zipStoreBase=GRADLE_USER_HOME
 | 
			
		||||
zipStorePath=wrapper/dists
 | 
			
		||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
 | 
			
		||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user