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

Update dependencies and sdk #29

Merged
merged 5 commits into from
Jan 17, 2024
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
52 changes: 38 additions & 14 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
id 'com.google.devtools.ksp'
}

android {
compileSdkVersion 33
defaultConfig {
applicationId 'org.secuso.privacyfriendly2048'
minSdkVersion 21
targetSdkVersion 33
targetSdkVersion 34
compileSdk 34
versionCode 5
versionName "1.3"
}
Expand All @@ -18,32 +22,52 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}

kotlin {
jvmToolchain(17)
}

android.applicationVariants.configureEach { variant ->
variant.outputs.all {
def appName = "pfa-2048"
outputFileName = appName + "-${variant.name}-v${variant.versionName}.apk"
}
}

dataBinding {
enabled = true
}
namespace 'org.secuso.privacyfriendly2048'

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

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.11.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.github.bumptech.glide:glide:4.7.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'

// Backup
implementation project(path: ':backup-api')
def work_version = "2.4.0"
def work_version = "2.9.0"
implementation "androidx.work:work-runtime:$work_version"
implementation "androidx.work:work-runtime-ktx:$work_version"
androidTestImplementation "androidx.work:work-testing:$work_version"
implementation 'androidx.sqlite:sqlite-ktx:2.3.1'
implementation 'androidx.sqlite:sqlite-ktx:2.4.0'

constraints {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0") {
Expand Down
10 changes: 10 additions & 0 deletions app/lint.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<!-- Disable the NotificationPermission check for glide -->
<issue id="NotificationPermission">
<ignore regexp="com.bumptech.glide.request.target.NotificationTarget" />
</issue>

<!-- Set the severity of missing translations to warning instead of error -->
<issue id="MissingTranslation" severity="warning" />
</lint>
3 changes: 1 addition & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?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="org.secuso.privacyfriendly2048">
xmlns:tools="http://schemas.android.com/tools">

<supports-screens
android:anyDensity="true"
Expand Down
8 changes: 1 addition & 7 deletions app/src/main/java/org/secuso/privacyfriendly2048/PF2048.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@
package org.secuso.privacyfriendly2048

import android.app.Application
import android.app.NotificationChannel
import android.app.NotificationManager
import android.os.Build
import android.util.Log
import androidx.appcompat.app.AppCompatDelegate
import androidx.work.Configuration
import org.secuso.privacyfriendly2048.backup.BackupCreator
import org.secuso.privacyfriendly2048.backup.BackupRestorer
Expand All @@ -34,7 +30,5 @@ class PF2048 : Application(), Configuration.Provider {
super.onCreate()
}

override fun getWorkManagerConfiguration(): Configuration {
return Configuration.Builder().setMinimumLoggingLevel(Log.INFO).build()
}
override val workManagerConfiguration = Configuration.Builder().setMinimumLoggingLevel(Log.INFO).build()
}
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ public void updateHighestNumber()

public void check2048()
{
if(won2048 == false)
if(won2048 == false) {
for(int i = 0; i < elements.length; i++)
{
for(int j = 0; j < elements[i].length; j++)
Expand Down Expand Up @@ -866,6 +866,7 @@ public void onClick(DialogInterface dialog, int which) {
}
}
}
}
}


Expand Down Expand Up @@ -1138,18 +1139,19 @@ public void onSaveInstanceState(Bundle savedInstanceState) {

public void saveStateToFile(GameState nS)
{
if(saveState)
try {
if(filename == null)
filename = "state" + n + ".txt";
File file = new File(getFilesDir(), filename);
FileOutputStream fileOut = new FileOutputStream(file);
ObjectOutputStream out = new ObjectOutputStream(fileOut);
out.writeObject(nS);
out.close();
fileOut.close();
} catch (IOException e) {
e.printStackTrace();
if(saveState) {
try {
if (filename == null)
filename = "state" + n + ".txt";
File file = new File(getFilesDir(), filename);
FileOutputStream fileOut = new FileOutputStream(file);
ObjectOutputStream out = new ObjectOutputStream(fileOut);
out.writeObject(nS);
out.close();
fileOut.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public ArrayList<String> getTableNames() {

if (c.moveToFirst()) {
while (!c.isAfterLast()) {
arrTblNames.add(c.getString(c.getColumnIndex("name")));
arrTblNames.add(c.getString(c.getColumnIndexOrThrow("name")));
c.moveToNext();
}
}
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/res/layout-land/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
android:layout_marginStart="@dimen/activity_horizontal_margin"
android:layout_weight="1"
android:background="?attr/selectableItemBackgroundBorderless"
android:onClick="onClick"
android:padding="@dimen/activity_horizontal_margin"
android:src="@drawable/ic_keyboard_arrow_left_black_24dp" />

Expand All @@ -75,7 +74,6 @@
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_weight="1"
android:background="?attr/selectableItemBackgroundBorderless"
android:onClick="onClick"
android:padding="10dp"
android:src="@drawable/ic_keyboard_arrow_right_black_24dp" />
</RelativeLayout>
Expand Down Expand Up @@ -121,7 +119,6 @@
android:layout_weight="3"
android:background="@color/colorPrimary"
android:clickable="false"
android:onClick="onClick"
android:text="@string/new_Game_Button"
android:textColor="@color/white"
android:textStyle="normal" />
Expand All @@ -137,7 +134,6 @@
android:layout_weight="3"
android:background="@color/colorPrimary"
android:clickable="false"
android:onClick="onClick"
android:text="@string/continue_Game_Button"
android:textColor="@color/white"
android:textStyle="normal" />
Expand Down
18 changes: 7 additions & 11 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,13 @@
android:id="@+id/btn_prev"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginStart="@dimen/activity_horizontal_margin"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_weight="1"
android:background="?attr/selectableItemBackgroundBorderless"
android:onClick="onClick"
android:padding="@dimen/activity_horizontal_margin"
android:src="@drawable/ic_keyboard_arrow_left_black_24dp"
android:visibility="invisible" />
Expand All @@ -76,7 +75,6 @@
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_weight="1"
android:background="?attr/selectableItemBackgroundBorderless"
android:onClick="onClick"
android:padding="10dp"
android:src="@drawable/ic_keyboard_arrow_right_black_24dp" />
</RelativeLayout>
Expand All @@ -90,19 +88,19 @@
android:divider="#000"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:weightSum="5"
tools:context=".activities.MainActivity">

<LinearLayout
android:id="@+id/layoutDots"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal">
Expand All @@ -115,12 +113,11 @@
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
android:layout_marginRight="20dp"
android:layout_weight="2"
android:background="@drawable/standalone_button"
android:clickable="false"
android:onClick="onClick"
android:text="@string/new_Game_Button"
android:textColor="@color/white"
android:textSize="25sp"
Expand All @@ -132,12 +129,11 @@
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
android:layout_marginRight="20dp"
android:layout_weight="2"
android:background="@drawable/standalone_button"
android:clickable="false"
android:onClick="onClick"
android:text="@string/continue_Game_Button"
android:textColor="@color/white"
android:textSize="25sp"
Expand Down
12 changes: 8 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,27 @@

buildscript {
repositories {
jcenter()
mavenCentral()
google()
}

ext.kotlin_version = "1.7.20"
ext.kotlin_version = "1.9.10"
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.1.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

plugins {
id 'com.google.devtools.ksp' version "$kotlin_version-1.0.13" apply false
}

allprojects {
repositories {
jcenter()
mavenCentral()
google()
}
}
Expand Down
6 changes: 5 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
android.defaults.buildfeatures.buildconfig=true
android.enableJetifier=true
android.useAndroidX=true
android.nonFinalResIds=false
android.nonTransitiveRClass=false
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip