Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade gradle #1295

Merged
merged 6 commits into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ apply plugin: 'com.android.application'
apply plugin: 'org.greenrobot.greendao'

android {
compileSdkVersion 30
compileSdkVersion 33

defaultConfig {
applicationId "fr.gaulupeau.apps.InThePoche"
minSdkVersion 21
targetSdkVersion 30
targetSdkVersion 33
versionCode 229
versionName "2.4.3"

Expand All @@ -17,15 +17,13 @@ android {
}
}
}

lintOptions {
lintConfig file("lint.xml")
}

packagingOptions {
exclude("META-INF/*.kotlin_module")
resources {
excludes += ['META-INF/*.kotlin_module']
}
}


buildTypes {
release {
minifyEnabled false
Expand All @@ -45,6 +43,10 @@ android {
}
}
}
lint {
lintConfig file('lint.xml')
}
namespace 'fr.gaulupeau.apps.InThePoche'
}

greendao {
Expand All @@ -53,11 +55,11 @@ greendao {
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.media:media:1.4.3'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.media:media:1.6.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.recyclerview:recyclerview:1.3.0'
implementation 'com.google.android.material:material:1.9.0'
implementation 'org.greenrobot:eventbus:3.3.1'
implementation 'org.greenrobot:greendao:3.3.0'
annotationProcessor 'org.greenrobot:eventbus-annotation-processor:3.3.1'
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="fr.gaulupeau.apps.InThePoche"
android:installLocation="auto">
android:installLocation="auto">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="22"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <!-- needed by TTS service for Android P or above -->
Expand Down
13 changes: 13 additions & 0 deletions app/src/main/java/fr/gaulupeau/apps/Poche/tts/TtsService.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package fr.gaulupeau.apps.Poche.tts;

import android.Manifest;
import android.app.Notification;
import android.app.PendingIntent;
import android.app.Service;
Expand All @@ -8,6 +9,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.media.AudioManager;
import android.media.MediaPlayer;
Expand All @@ -26,6 +28,7 @@
import android.util.Log;

import androidx.annotation.NonNull;
import androidx.core.app.ActivityCompat;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;
import androidx.core.util.Pair;
Expand Down Expand Up @@ -1152,6 +1155,16 @@ private void setForegroundAndNotification(boolean forceForeground) {
.from(getApplicationContext());

if (showNotification) {
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED) {
// TODO: Consider calling
// ActivityCompat#requestPermissions
// here to request the missing permissions, and then overriding
// public void onRequestPermissionsResult(int requestCode, String[] permissions,
// int[] grantResults)
// to handle the case where the user grants the permission. See the documentation
// for ActivityCompat#requestPermissions for more details.
return;
}
notificationManager.notify(NOTIFICATION_ID, generateNotification());
} else {
notificationManager.cancel(NOTIFICATION_ID);
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.4'
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'org.greenrobot:greendao-gradle-plugin:3.3.1'
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading