From 35c8d31d423027103361a7850736a953323b2226 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 20 Oct 2023 18:18:15 +0200 Subject: [PATCH] update gradle and gradle plugin --- build.gradle | 2 +- gradle.properties | 3 +++ gradle/wrapper/gradle-wrapper.properties | 2 +- .../services/XmppConnectionService.java | 13 +++---------- .../conversations/ui/forms/FormFieldWrapper.java | 3 +-- .../ui/widget/SwipeRefreshListFragment.java | 3 +-- 6 files changed, 10 insertions(+), 16 deletions(-) diff --git a/build.gradle b/build.gradle index 4c6e7cacc..7df1a88f2 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.1.2' } } diff --git a/gradle.properties b/gradle.properties index 431e485f2..d8fa158ee 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,6 @@ android.useAndroidX=true android.enableJetifier=true +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=true +android.nonFinalResIds=false org.gradle.jvmargs=-Xmx4096m diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9d41003b2..a2c87f5ef 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 diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index 9b4b85d52..137a24c31 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -1538,16 +1538,9 @@ public class XmppConnectionService extends Service { final Intent intent = new Intent(this, EventReceiver.class); intent.setAction(ACTION_PING); try { - final PendingIntent pendingIntent; - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - pendingIntent = - PendingIntent.getBroadcast( - this, requestCode, intent, PendingIntent.FLAG_IMMUTABLE); - } else { - pendingIntent = - PendingIntent.getBroadcast( - this, requestCode, intent, 0); - } + final PendingIntent pendingIntent = + PendingIntent.getBroadcast( + this, requestCode, intent, PendingIntent.FLAG_IMMUTABLE); alarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, timeToWake, pendingIntent); } catch (RuntimeException e) { Log.e(Config.LOGTAG, "unable to schedule alarm for ping", e); diff --git a/src/main/java/eu/siacs/conversations/ui/forms/FormFieldWrapper.java b/src/main/java/eu/siacs/conversations/ui/forms/FormFieldWrapper.java index ecc935fa9..4dcef5432 100644 --- a/src/main/java/eu/siacs/conversations/ui/forms/FormFieldWrapper.java +++ b/src/main/java/eu/siacs/conversations/ui/forms/FormFieldWrapper.java @@ -9,7 +9,6 @@ import android.view.View; import java.util.List; -import eu.siacs.conversations.R; import eu.siacs.conversations.ui.util.StyledAttributes; import eu.siacs.conversations.xmpp.forms.Field; @@ -58,7 +57,7 @@ public abstract class FormFieldWrapper { int start = label.length(); int end = label.length() + 2; spannableString.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), start, end, 0); - spannableString.setSpan(new ForegroundColorSpan(StyledAttributes.getColor(context,R.attr.colorAccent)), start, end, 0); + spannableString.setSpan(new ForegroundColorSpan(StyledAttributes.getColor(context, androidx.appcompat.R.attr.colorAccent)), start, end, 0); } return spannableString; } diff --git a/src/main/java/eu/siacs/conversations/ui/widget/SwipeRefreshListFragment.java b/src/main/java/eu/siacs/conversations/ui/widget/SwipeRefreshListFragment.java index b1ef6165a..5f5d6a8cf 100644 --- a/src/main/java/eu/siacs/conversations/ui/widget/SwipeRefreshListFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/widget/SwipeRefreshListFragment.java @@ -26,7 +26,6 @@ import android.widget.ListView; import androidx.fragment.app.ListFragment; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; -import eu.siacs.conversations.R; import eu.siacs.conversations.ui.util.StyledAttributes; /** @@ -57,7 +56,7 @@ public class SwipeRefreshListFragment extends ListFragment { final Context context = getActivity(); if (context != null) { - mSwipeRefreshLayout.setColorSchemeColors(StyledAttributes.getColor(context, R.attr.colorAccent)); + mSwipeRefreshLayout.setColorSchemeColors(StyledAttributes.getColor(context, androidx.appcompat.R.attr.colorAccent)); } if (onRefreshListener != null) {