Migrate to latest SDK version

Fix build issues
This commit is contained in:
Geoffroy Bonneville
2023-12-19 22:45:40 +01:00
parent 1cf5d8b880
commit f7a8b99231
15 changed files with 286 additions and 53 deletions

View File

@@ -1,15 +1,14 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 31
buildToolsVersion '28.0.3'
compileSdk 34
defaultConfig {
applicationId "com.wismna.geoffroy.donext"
minSdkVersion 19
targetSdkVersion 31
versionCode 29
versionName "1.8"
minSdkVersion 21
targetSdkVersion 34
versionCode 30
versionName "1.9"
javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
@@ -20,9 +19,13 @@ android {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
zipAlignEnabled true
}
}
namespace 'com.wismna.geoffroy.donext'
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
sonarqube {
properties {
@@ -36,29 +39,29 @@ sonarqube {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.5.0-alpha03'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.10.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.percentlayout:percentlayout:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.browser:browser:1.3.0'
implementation 'net.danlew:android.joda:2.9.7'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
testImplementation 'junit:junit:4.12'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'androidx.browser:browser:1.7.0'
implementation 'net.danlew:android.joda:2.12.5'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
// App Center
def appCenterSdkVersion = '1.9.0'
def appCenterSdkVersion = '5.0.4'
implementation "com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}"
implementation "com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}"
// Room components
def roomVersion = "2.4.0-alpha04"
def roomVersion = "2.6.1"
implementation "androidx.room:room-runtime:$roomVersion"
annotationProcessor "androidx.room:room-compiler:$roomVersion"
testImplementation "androidx.room:room-testing:$roomVersion"
// Lifecycle components
def lifecycleVersion = '2.3.1'
def lifecycleVersion = '2.6.2'
implementation "androidx.lifecycle:lifecycle-viewmodel:$lifecycleVersion"
implementation "androidx.lifecycle:lifecycle-livedata:$lifecycleVersion"
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycleVersion"

View File

@@ -0,0 +1,171 @@
{
"formatVersion": 1,
"database": {
"version": 6,
"identityHash": "a911cf75d24949c0b24bd212cacc860c",
"entities": [
{
"tableName": "tasks",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `name` TEXT, `description` TEXT, `cycle` INTEGER NOT NULL, `priority` INTEGER NOT NULL, `done` INTEGER NOT NULL, `deleted` INTEGER NOT NULL, `displayorder` INTEGER NOT NULL, `todayorder` INTEGER NOT NULL, `list` INTEGER NOT NULL, `duedate` TEXT, `todaydate` TEXT, FOREIGN KEY(`list`) REFERENCES `tasklist`(`_id`) ON UPDATE NO ACTION ON DELETE NO ACTION )",
"fields": [
{
"fieldPath": "_id",
"columnName": "_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "description",
"columnName": "description",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "cycle",
"columnName": "cycle",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "priority",
"columnName": "priority",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "done",
"columnName": "done",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "deleted",
"columnName": "deleted",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "order",
"columnName": "displayorder",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "todayOrder",
"columnName": "todayorder",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "taskList",
"columnName": "list",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "dueDate",
"columnName": "duedate",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "todayDate",
"columnName": "todaydate",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"autoGenerate": true,
"columnNames": [
"_id"
]
},
"indices": [
{
"name": "index_tasks_list",
"unique": false,
"columnNames": [
"list"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_tasks_list` ON `${TABLE_NAME}` (`list`)"
}
],
"foreignKeys": [
{
"table": "tasklist",
"onDelete": "NO ACTION",
"onUpdate": "NO ACTION",
"columns": [
"list"
],
"referencedColumns": [
"_id"
]
}
]
},
{
"tableName": "tasklist",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `name` TEXT, `visible` INTEGER NOT NULL, `displayorder` INTEGER NOT NULL, `taskCount` INTEGER NOT NULL)",
"fields": [
{
"fieldPath": "_id",
"columnName": "_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "visible",
"columnName": "visible",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "order",
"columnName": "displayorder",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "taskCount",
"columnName": "taskCount",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": true,
"columnNames": [
"_id"
]
},
"indices": [],
"foreignKeys": []
}
],
"views": [
{
"viewName": "TodayTasksView",
"createSql": "CREATE VIEW `${VIEW_NAME}` AS SELECT * FROM tasks WHERE todaydate = date('now','localtime')"
}
],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'a911cf75d24949c0b24bd212cacc860c')"
]
}
}

View File

@@ -1,14 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.wismna.geoffroy.donext">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:name=".DoNext"
android:allowBackup="true"
android:fullBackupContent="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<meta-data
android:name="android.max_aspect"
@@ -16,9 +12,7 @@
<activity
android:name=".activities.MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="stateAlwaysHidden"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

View File

@@ -1,5 +1,8 @@
package com.wismna.geoffroy.donext.fragments;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.os.Build;
import android.os.Bundle;
@@ -7,7 +10,6 @@ import androidx.annotation.Nullable;
import android.view.View;
import android.widget.TextView;
import com.wismna.geoffroy.donext.BuildConfig;
import com.wismna.geoffroy.donext.R;
/**
@@ -30,9 +32,16 @@ public class AboutDialogFragment extends DynamicDialogFragment {
public void onStart() {
super.onStart();
TextView versionDonext = findViewById(R.id.version_donext);
Resources resources = getResources();
versionDonext.setText(resources.getString(R.string.about_version_donext, BuildConfig.VERSION_NAME));
try {
Context context = getContext();
assert context != null;
PackageInfo pInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
TextView versionDonext = findViewById(R.id.version_donext);
versionDonext.setText(resources.getString(R.string.about_version_donext, pInfo.versionName));
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
TextView versionAndroid = findViewById(R.id.version_android);
versionAndroid.setText(resources.getString(R.string.about_version_android, Build.VERSION.SDK_INT));