Bläddra i källkod

update dependencies + gradle

Noah Vogt 3 år sedan
förälder
incheckning
44b20b623d

+ 48 - 42
app/build.gradle

@@ -8,14 +8,15 @@ android {
     aaptOptions.cruncherEnabled = false
     aaptOptions.cruncherEnabled = false
     aaptOptions.useNewCruncher = false
     aaptOptions.useNewCruncher = false
 
 
-    compileSdkVersion 30
+    compileSdkVersion 32
 
 
     defaultConfig {
     defaultConfig {
         applicationId "com.noahvogt.miniprojekt"
         applicationId "com.noahvogt.miniprojekt"
         minSdkVersion 16
         minSdkVersion 16
-        targetSdkVersion 30
+        targetSdkVersion 32
         versionCode 1
         versionCode 1
         versionName "1.0"
         versionName "1.0"
+        multiDexEnabled true
 
 
         ndk {
         ndk {
             abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
             abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
@@ -27,67 +28,72 @@ android {
             }
             }
             buildPython "/usr/bin/python3.8"
             buildPython "/usr/bin/python3.8"
         }
         }
-    packagingOptions {
-        exclude 'META-INF/NOTICE.md'
+        packagingOptions {
+            exclude 'META-INF/NOTICE.md'
+            exclude 'META-INF/LICENSE.md'
 
 
-        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+            testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
 
 
-        javaCompileOptions {
-            annotationProcessorOptions {
-                arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
+            javaCompileOptions {
+                annotationProcessorOptions {
+                    arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
+                }
             }
             }
         }
         }
-    }
 
 
 
 
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
 
 
-    buildTypes {
-        release {
-            minifyEnabled false
-            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+        buildTypes {
+            release {
+                minifyEnabled false
+                proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+            }
+        }
+        compileOptions {
+            sourceCompatibility JavaVersion.VERSION_1_8
+            targetCompatibility JavaVersion.VERSION_1_8
         }
         }
     }
     }
-    compileOptions {
-        sourceCompatibility JavaVersion.VERSION_1_8
-        targetCompatibility JavaVersion.VERSION_1_8
-    }
-}
-}
 
 
-dependencies {
+    dependencies {
 
 
-    implementation 'com.google.code.gson:gson:2.8.7'
+        implementation 'com.google.code.gson:gson:2.8.7'
 
 
-    implementation 'androidx.work:work-runtime:2.6.0'
+        implementation 'androidx.work:work-runtime:2.7.1'
 
 
 
 
-    implementation 'androidx.appcompat:appcompat:1.2.0'
-    implementation 'com.google.android.material:material:1.3.0'
-    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
+        implementation 'androidx.appcompat:appcompat:1.4.1'
+        implementation 'com.google.android.material:material:1.5.0'
+        implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
 
 
-    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
+        implementation 'androidx.legacy:legacy-support-v4:1.0.0'
 
 
-    implementation 'androidx.navigation:navigation-fragment:2.3.5'
-    implementation 'androidx.navigation:navigation-ui:2.3.5'
+        implementation 'androidx.navigation:navigation-fragment:2.4.0'
+        implementation 'androidx.navigation:navigation-ui:2.4.0'
 
 
-    /* Room components */
-    implementation 'androidx.room:room-runtime:2.3.0'
-    annotationProcessor 'androidx.room:room-compiler:2.3.0'
-    androidTestImplementation 'androidx.room:room-testing:2.3.0'
+        /* Room components */
+        implementation 'androidx.room:room-runtime:2.4.1'
+        annotationProcessor 'androidx.room:room-compiler:2.4.1'
+        androidTestImplementation 'androidx.room:room-testing:2.4.1'
 
 
-    /* lifecycle components */
-    implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
-    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
-    implementation 'androidx.lifecycle:lifecycle-common-java8:2.3.1'
+        /* lifecycle components */
+        implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.0'
+        implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0'
+        implementation 'androidx.lifecycle:lifecycle-common-java8:2.4.0'
 
 
-    implementation 'androidx.recyclerview:recyclerview:1.2.0'
-    implementation 'androidx.preference:preference:1.1.1'
+        implementation 'androidx.recyclerview:recyclerview:1.2.1'
+        implementation 'androidx.preference:preference:1.2.0'
 
 
-    testImplementation 'junit:junit:4.+'
-    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
-    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
+        testImplementation 'junit:junit:4.13.2'
+        androidTestImplementation 'androidx.test.ext:junit:1.1.3'
+        androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
 
 
 
 
+        /* jakarta mail api */
+        implementation group: 'com.sun.mail', name: 'jakarta.mail', version: '2.0.1'
 
 
-}
+        implementation 'com.android.support:multidex:1.0.3'
+
+    }
+}

+ 5 - 3
app/src/main/AndroidManifest.xml

@@ -10,11 +10,13 @@
         android:roundIcon="@mipmap/ic_launcher_round"
         android:roundIcon="@mipmap/ic_launcher_round"
         android:supportsRtl="true"
         android:supportsRtl="true"
         android:theme="@style/Theme.MiniProjekt">
         android:theme="@style/Theme.MiniProjekt">
-        <activity android:name=".ui.editor.NewDraftMessageActivity"></activity>
+        <activity
+            android:name=".ui.editor.NewDraftMessageActivity"
+            android:exported="true" />
         <activity
         <activity
             android:name="com.noahvogt.snailmail.MainActivity"
             android:name="com.noahvogt.snailmail.MainActivity"
-            android:label="@string/app_name"
-            android:theme="@style/Theme.MiniProjekt.NoActionBar">
+            android:theme="@style/Theme.MiniProjekt.NoActionBar"
+            android:exported="true">
             <intent-filter>
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <action android:name="android.intent.action.MAIN" />
 
 

+ 6 - 1
app/src/main/java/com/noahvogt/snailmail/MainActivity.java

@@ -1,5 +1,6 @@
 package com.noahvogt.snailmail;
 package com.noahvogt.snailmail;
 
 
+import android.app.Activity;
 import android.content.Context;
 import android.content.Context;
 import android.content.DialogInterface;
 import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.Intent;
@@ -27,6 +28,7 @@ import com.google.gson.reflect.TypeToken;
 import com.noahvogt.snailmail.database.Message;
 import com.noahvogt.snailmail.database.Message;
 
 
 import androidx.lifecycle.ViewModelProvider;
 import androidx.lifecycle.ViewModelProvider;
+import androidx.navigation.fragment.NavHostFragment;
 import androidx.recyclerview.widget.LinearLayoutManager;
 import androidx.recyclerview.widget.LinearLayoutManager;
 import androidx.recyclerview.widget.RecyclerView;
 import androidx.recyclerview.widget.RecyclerView;
 
 
@@ -100,7 +102,10 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
                 R.id.nav_home, R.id.nav_gallery, R.id.nav_slideshow, R.id.nav_archive, R.id.nav_spam)
                 R.id.nav_home, R.id.nav_gallery, R.id.nav_slideshow, R.id.nav_archive, R.id.nav_spam)
                 .setDrawerLayout(drawer)
                 .setDrawerLayout(drawer)
                 .build();
                 .build();
-        NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
+        final NavHostFragment navHostFragment = (NavHostFragment) getSupportFragmentManager().findFragmentById(R.id.nav_host_fragment);
+        assert navHostFragment != null;
+        final NavController navController = navHostFragment.getNavController();
+        //NavController navController = Navigation.findNavController(MainActivity.this, R.id.nav_host_fragment);
         NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
         NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
         NavigationUI.setupWithNavController(navigationView, navController);
         NavigationUI.setupWithNavController(navigationView, navController);
 
 

+ 1 - 1
app/src/main/res/layout/content_main.xml

@@ -7,7 +7,7 @@
     app:layout_behavior="@string/appbar_scrolling_view_behavior"
     app:layout_behavior="@string/appbar_scrolling_view_behavior"
     tools:showIn="@layout/app_bar_main">
     tools:showIn="@layout/app_bar_main">
 
 
-    <fragment
+    <androidx.fragment.app.FragmentContainerView
         android:id="@+id/nav_host_fragment"
         android:id="@+id/nav_host_fragment"
         android:name="androidx.navigation.fragment.NavHostFragment"
         android:name="androidx.navigation.fragment.NavHostFragment"
         android:layout_width="match_parent"
         android:layout_width="match_parent"

+ 4 - 4
build.gradle

@@ -2,13 +2,13 @@
 buildscript {
 buildscript {
     repositories {
     repositories {
         google()
         google()
-        jcenter()
+        mavenCentral()
         maven { url "https://chaquo.com/maven" }
         maven { url "https://chaquo.com/maven" }
     }
     }
     dependencies {
     dependencies {
-        classpath 'com.android.tools.build:gradle:4.2.0'
+        classpath 'com.android.tools.build:gradle:7.1.1'
         classpath "com.chaquo.python:gradle:9.1.0"
         classpath "com.chaquo.python:gradle:9.1.0"
-        classpath 'com.android.tools.build:gradle:4.2.2'
+        classpath 'com.android.tools.build:gradle:7.1.1'
         // NOTE: Do not place your application dependencies here; they belong
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files
         // in the individual module build.gradle files
     }
     }
@@ -17,7 +17,7 @@ buildscript {
 allprojects {
 allprojects {
     repositories {
     repositories {
         google()
         google()
-        jcenter()
+        mavenCentral()
     }
     }
 }
 }
 
 

+ 1 - 1
gradle/wrapper/gradle-wrapper.properties

@@ -1,6 +1,6 @@
 #Tue Aug 31 15:54:45 CEST 2021
 #Tue Aug 31 15:54:45 CEST 2021
 distributionBase=GRADLE_USER_HOME
 distributionBase=GRADLE_USER_HOME
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
 distributionPath=wrapper/dists
 distributionPath=wrapper/dists
 zipStorePath=wrapper/dists
 zipStorePath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStoreBase=GRADLE_USER_HOME