diff --git a/.gitignore b/.gitignore
index aa724b7..ef26de6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+.idea
*.iml
.gradle
/local.properties
diff --git a/.idea/.gitignore b/.idea/.gitignore
deleted file mode 100644
index 26d3352..0000000
--- a/.idea/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-# Default ignored files
-/shelf/
-/workspace.xml
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
deleted file mode 100644
index 3c7772a..0000000
--- a/.idea/codeStyles/Project.xml
+++ /dev/null
@@ -1,139 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- xmlns:android
-
- ^$
-
-
-
-
-
-
-
-
- xmlns:.*
-
- ^$
-
-
- BY_NAME
-
-
-
-
-
-
- .*:id
-
- http://schemas.android.com/apk/res/android
-
-
-
-
-
-
-
-
- .*:name
-
- http://schemas.android.com/apk/res/android
-
-
-
-
-
-
-
-
- name
-
- ^$
-
-
-
-
-
-
-
-
- style
-
- ^$
-
-
-
-
-
-
-
-
- .*
-
- ^$
-
-
- BY_NAME
-
-
-
-
-
-
- .*
-
- http://schemas.android.com/apk/res/android
-
-
- ANDROID_ATTRIBUTE_ORDER
-
-
-
-
-
-
- .*
-
- .*
-
-
- BY_NAME
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
deleted file mode 100644
index 79ee123..0000000
--- a/.idea/codeStyles/codeStyleConfig.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
deleted file mode 100644
index 61a9130..0000000
--- a/.idea/compiler.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
deleted file mode 100644
index 7e46edd..0000000
--- a/.idea/gradle.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
deleted file mode 100644
index a5f05cd..0000000
--- a/.idea/jarRepositories.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index d5d35ec..0000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/render.experimental.xml b/.idea/render.experimental.xml
deleted file mode 100644
index 8ec256a..0000000
--- a/.idea/render.experimental.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 94a25f7..0000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index 9111880..e66311d 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -5,13 +5,14 @@ plugins {
apply plugin: 'kotlin-kapt'
android {
- compileSdkVersion 30
- buildToolsVersion "30.0.3"
+ namespace "com.example.android2021"
+ compileSdkVersion 34
+ buildToolsVersion "34.0.0"
defaultConfig {
applicationId "com.example.android2021"
minSdkVersion 21
- targetSdkVersion 30
+ targetSdkVersion 34
versionCode 1
versionName "1.0"
flavorDimensions "versionCode"
@@ -55,11 +56,20 @@ android {
}
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
+ sourceCompatibility JavaVersion.VERSION_17
+ targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
- jvmTarget = '1.8'
+ jvmTarget = '17'
+ }
+ buildFeatures {
+ buildConfig = true
+ }
+}
+
+configurations.all {
+ resolutionStrategy {
+ force 'androidx.test:core:1.5.0'
}
}
@@ -83,8 +93,8 @@ dependencies {
implementation 'com.blankj:utilcode:1.30.5'
implementation("com.squareup.okhttp3:okhttp:4.9.0")
implementation 'com.google.code.gson:gson:2.8.6'
- compile 'com.squareup.retrofit2:retrofit:2.3.0'
- compile 'com.squareup.retrofit2:converter-gson:2.3.0' //json转换
+ implementation 'com.squareup.retrofit2:retrofit:2.3.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.3.0' //json转换
implementation 'com.github.bumptech.glide:glide:4.9.0'
kapt 'com.github.bumptech.glide:compiler:4.9.0'
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 55a4c28..f6b4df2 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -24,27 +24,32 @@
+ android:theme="@style/Theme.Android2021.NoActionBar"
+ android:exported="true" />
-
+ android:theme="@style/Theme.Android2021"
+ android:exported="true" />
+
-
+
-
+
\ No newline at end of file
diff --git a/app/src/main/java/com/example/android2021/kt05/Tab01Activity.kt b/app/src/main/java/com/example/android2021/kt05/Tab01Activity.kt
index 569a3cf..e732c59 100644
--- a/app/src/main/java/com/example/android2021/kt05/Tab01Activity.kt
+++ b/app/src/main/java/com/example/android2021/kt05/Tab01Activity.kt
@@ -89,7 +89,7 @@ class Tab01Activity : AppCompatActivity() {
}
} ?:return
val ft = supportFragmentManager.beginTransaction()
- if (!fragment?.isAdded) {
+ if (fragment?.isAdded == false) {
ft.add(R.id.container,fragment)
}
currentFragment?.let {
diff --git a/app/support/manifest/kt03/AndroidManifest.xml b/app/support/manifest/kt03/AndroidManifest.xml
index 53a4ded..fe813cc 100644
--- a/app/support/manifest/kt03/AndroidManifest.xml
+++ b/app/support/manifest/kt03/AndroidManifest.xml
@@ -6,7 +6,7 @@
android:name="com.example.android2021.kt03.SlideActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:screenOrientation="portrait"
- >
+ android:exported="true">
diff --git a/build.gradle b/build.gradle
index e47bb55..abebd59 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,12 +1,12 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
- ext.kotlin_version = "1.4.32"
+ ext.kotlin_version = "1.8.10"
repositories {
google()
jcenter()
}
dependencies {
- classpath "com.android.tools.build:gradle:4.1.2"
+ classpath "com.android.tools.build:gradle:8.3.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 475c095..e411586 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,5 @@
-#Mon Sep 13 17:30:29 CST 2021
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip