diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index e13abaa..728a117 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -8,10 +8,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - name: set up JDK 11 - uses: actions/setup-java@v1 - with: - java-version: 11 - - name: Build with Gradle - run: ./gradlew build + - uses: actions/checkout@v4 + - name: set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 17 + - name: Build with Gradle + run: ./gradlew build diff --git a/app/build.gradle b/app/build.gradle index 1c63283..92a108a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,11 +2,23 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' android { - compileSdkVersion 32 + + /** + * compileSdk specifies the Android API level Gradle should use to + * compile your app. This means your app can use the API features included in + * this API level and lower. + */ + compileSdk = 34 + defaultConfig { applicationId "de.synyx.android.meetingroom" + + // Defines the minimum API level required to run the app. minSdkVersion 23 - targetSdkVersion 32 + + // Specifies the API level used to test the app. + targetSdkVersion 34 + versionCode 7 versionName "1.3.2" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/app/src/main/java/de/synyx/android/meeroo/screen/settings/SettingsActivity.java b/app/src/main/java/de/synyx/android/meeroo/screen/settings/SettingsActivity.java index 2f595f5..fbcb035 100644 --- a/app/src/main/java/de/synyx/android/meeroo/screen/settings/SettingsActivity.java +++ b/app/src/main/java/de/synyx/android/meeroo/screen/settings/SettingsActivity.java @@ -1,36 +1,29 @@ package de.synyx.android.meeroo.screen.settings; -import android.app.AlarmManager; -import android.app.PendingIntent; -import android.content.Context; +import static de.synyx.android.meeroo.util.functional.FunctionUtils.mapToArray; +import static de.synyx.android.meeroo.util.functional.FunctionUtils.toArray; +import static de.synyx.android.meeroo.util.functional.FunctionUtils.toMap; + import android.content.Intent; import android.os.Bundle; - import android.preference.ListPreference; import android.preference.MultiSelectListPreference; import android.preference.Preference; import android.preference.PreferenceFragment; import android.preference.PreferenceManager; - import android.view.MenuItem; import androidx.annotation.NonNull; - import androidx.appcompat.app.ActionBar; +import java.util.Map; + import de.synyx.android.meeroo.R; import de.synyx.android.meeroo.config.Registry; import de.synyx.android.meeroo.domain.MeetingRoom; import de.synyx.android.meeroo.preferences.PreferencesService; -import de.synyx.android.meeroo.preferences.PreferencesServiceImpl; import de.synyx.android.meeroo.screen.login.LoginActivity; -import java.util.Map; - -import static de.synyx.android.meeroo.util.functional.FunctionUtils.mapToArray; -import static de.synyx.android.meeroo.util.functional.FunctionUtils.toArray; -import static de.synyx.android.meeroo.util.functional.FunctionUtils.toMap; - public class SettingsActivity extends AppCompatPreferenceActivity { @@ -118,19 +111,14 @@ public void onCreate(Bundle savedInstanceState) { private boolean logout(Preference preference) { Registry.get(PreferencesService.class).logout(); - restartApplication(); + navigateToLogin(); return true; } - private void restartApplication() { - - Intent loginActivityIntent = new Intent(getContext(), LoginActivity.class); - int pendingIntentId = 123; // id not needed - PendingIntent pendingIntent = PendingIntent.getActivity(getContext(), pendingIntentId, loginActivityIntent, PendingIntent.FLAG_CANCEL_CURRENT); - AlarmManager alarmManager = (AlarmManager) getContext().getSystemService(Context.ALARM_SERVICE); - final int delay = 150; - alarmManager.set(AlarmManager.RTC, System.currentTimeMillis() + delay, pendingIntent); - System.exit(0); + private void navigateToLogin() { + Intent intent = new Intent(getContext(), LoginActivity.class); + getContext().startActivity(intent); + getActivity().finish(); } diff --git a/build.gradle b/build.gradle index c7bc4e9..9fc2344 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.2.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" diff --git a/gradle.properties b/gradle.properties index d546dea..16a11ee 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,10 @@ # http://www.gradle.org/docs/current/userguide/build_environment.html # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. +android.defaults.buildfeatures.buildconfig=true android.enableJetifier=true +android.nonFinalResIds=false +android.nonTransitiveRClass=false android.useAndroidX=true org.gradle.jvmargs=-Xmx1536m # When configured, Gradle will run in incubating parallel mode. diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8002f78..3d681e4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip