Skip to content

Commit 7c63189

Browse files
committed
Android 10 and AndroidX Jetpack libraries refactoring. Github CI build.
1 parent 671b605 commit 7c63189

File tree

14 files changed

+97
-71
lines changed

14 files changed

+97
-71
lines changed

.github/workflows/gradle.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# This workflow will build a Java project with Gradle
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
3+
4+
name: Java CI with Gradle
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Set up JDK 1.8
20+
uses: actions/setup-java@v1
21+
with:
22+
java-version: 1.8
23+
- name: Grant execute permission for gradlew
24+
run: chmod +x gradlew
25+
- name: Build with Gradle
26+
run: ./gradlew build

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ Open-source Android implementation of the popular board game Blokus. With very s
88

99
<a href="https://f-droid.org/packages/org.scoutant.blokish" target="_blank">
1010
<img src="https://f-droid.org/badge/get-it-on.png" alt="Get it on F-Droid" height="100"/></a>
11-
<a href="https://play.google.com/store/apps/details?id=org.scoutant.blokish" target="_blank">
12-
<img src="https://play.google.com/intl/en_us/badges/images/generic/en-play-badge.png" alt="Get it on Google Play" height="100"/></a>
1311

1412
#### The rules
1513
Blokus is family game involving four players and a board with 20 x 20 squares. Like chess or checkers, it's a game for which at any time you can see your opponent's pieces.
@@ -54,6 +52,11 @@ Stephane Coutant, http://scoutant.org
5452

5553
# Changelog
5654

55+
## v3.4, 2020/04 : Android 10 and AndroidX Jetpack libraries refactoring
56+
* build with Android 10, from nom on : available on Android 7+
57+
* refactored Manifest and source dir
58+
* Github-CI build with tests
59+
5760
## v3.3, 2018/06 : locale nl, Android 8.1
5861
* locale nl, credits to Vistaus
5962
* now targetting Android 8.1
@@ -67,12 +70,9 @@ Stephane Coutant, http://scoutant.org
6770
* better german translation
6871

6972
## v3.0, 2015/11 : Network multi-player support with PlayHub
70-
* Network multi-player framework PlayHub. https://bitbucket.org/playhub/playhublibrary, licence GPL v3. Live on https://play.google.com/store/apps/details?id=com.playhub.
73+
* Network multi-player framework PlayHub.
7174
* build with Sdk Android 6.0
7275

73-
![blokish](http://scoutant.org/blokish/blokish-playhub-menu.png)
74-
75-
7676
## v2.4, 2015/06 : Move validation possible directly on piece.
7777
* Smarter move validation : vibration and green color as soon move is valid
7878
* Validation by double tap on piece

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
google()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:3.1.3'
8+
classpath 'com.android.tools.build:gradle:3.6.1'
99
}
1010
}
1111

gradle.properties

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## Project-wide Gradle settings.
2+
#
3+
# For more details on how to configure your build environment visit
4+
# http://www.gradle.org/docs/current/userguide/build_environment.html
5+
#
6+
# Specifies the JVM arguments used for the daemon process.
7+
# The setting is particularly useful for tweaking memory settings.
8+
# Default value: -Xmx10248m -XX:MaxPermSize=256m
9+
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
10+
#
11+
# When configured, Gradle will run in incubating parallel mode.
12+
# This option should only be used with decoupled projects. More details, visit
13+
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
14+
# org.gradle.parallel=true
15+
#Fri May 27 16:34:25 CEST 2016
16+
17+
# android.useDeprecatedNdk=true
18+
android.enableJetifier=true
19+
android.useAndroidX=true

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip

mobile/build.gradle

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,36 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 28
5-
buildToolsVersion "28.0.2"
6-
project.archivesBaseName = "blokish-3.4" // TODO sync with Manifest
4+
compileSdkVersion 29
5+
buildToolsVersion "29.0.3"
6+
project.archivesBaseName = "blokish-3.4" // sync with Manifest
7+
8+
defaultConfig {
9+
applicationId "org.scoutant.blokish"
10+
minSdkVersion 24 // Android 7
11+
targetSdkVersion 29 // Android 10
12+
versionCode 22
13+
versionName "3.4"
14+
project.ext.set("archivesBaseName", "blokish-" + defaultConfig.versionName)
15+
}
716

817
compileOptions {
9-
sourceCompatibility JavaVersion.VERSION_1_7
10-
targetCompatibility JavaVersion.VERSION_1_7
18+
sourceCompatibility JavaVersion.VERSION_1_8
19+
targetCompatibility JavaVersion.VERSION_1_8
1120
}
1221

1322
dependencies {
14-
testImplementation 'junit:junit:4.12'
23+
testImplementation 'junit:junit:4.13'
1524

16-
implementation 'com.android.support:appcompat-v7:28.0.0'
17-
implementation 'com.android.support:support-v4:28.0.0'
18-
implementation 'com.android.support:design:28.0.0'
25+
implementation 'com.google.android.material:material:1.1.0'
26+
implementation "androidx.coordinatorlayout:coordinatorlayout:1.1.0"
27+
implementation 'androidx.appcompat:appcompat:1.1.0'
28+
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
29+
// implementation 'androidx.preference:preference:1.1.0' // TODO migrate preferences
1930

2031
}
2132

2233
lintOptions {
23-
// checkReleaseBuilds false
2434
abortOnError false
2535
}
2636

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.scoutant.blokish"
3-
android:versionCode="22" android:versionName="3.4"
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
package="org.scoutant.blokish"
45
>
5-
<uses-sdk android:minSdkVersion="18" android:targetSdkVersion="28" />
6-
76
<uses-permission android:name="android.permission.VIBRATE"/>
87

98
<uses-feature android:name="android.hardware.screen.portrait" android:required="true"/>
@@ -17,8 +16,8 @@
1716
<activity android:name=".UI"
1817
android:theme="@style/Theme.AppCompat.Light.NoActionBar"
1918
android:exported="true"
20-
android:screenOrientation="portrait"
21-
>
19+
android:screenOrientation="portrait"
20+
tools:ignore="LockedOrientationActivity">
2221
<intent-filter>
2322
<action android:name="android.intent.action.MAIN" />
2423
<category android:name="android.intent.category.LAUNCHER" />
@@ -28,11 +27,11 @@
2827
android:screenOrientation="portrait"
2928
android:parentActivityName=".UI"
3029
android:theme="@style/Theme.Holo.Calendar"
31-
/>
30+
tools:ignore="LockedOrientationActivity" />
3231
<activity android:name=".Help" android:label="Help"
3332
android:screenOrientation="portrait"
3433
android:parentActivityName=".UI"
35-
/>
34+
tools:ignore="LockedOrientationActivity" />
3635
</application>
3736
</manifest>
3837
<!-- TODO issue #4 : when same score : last player wins : adapt the message. -->

mobile/src/main/java/org/scoutant/blokish/GameView.java

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import android.graphics.Point;
2323
import android.graphics.drawable.Drawable;
2424
import android.preference.PreferenceManager;
25-
import android.support.v4.content.ContextCompat;
2625
import android.util.Log;
2726
import android.view.Display;
2827
import android.view.Gravity;
@@ -45,6 +44,8 @@
4544
import java.util.Collections;
4645
import java.util.List;
4746

47+
import androidx.core.content.ContextCompat;
48+
4849
/**
4950
* For DnD approach, refer to http://blog.scoutant.org/index.php?post/2011/02/Approche-naturelle-de-Drag-and-Drop-en-Android
5051
*/
@@ -131,18 +132,6 @@ public GameView(Context context) {
131132
}
132133
}
133134

134-
// View extraMenu = findViewById(R.id.extra_menu_button);
135-
// if (extraMenu!=null && !ViewConfiguration.get(context).hasPermanentMenuKey()) {
136-
// extraMenu.setVisibility(View.VISIBLE);
137-
// extraMenu.setOnClickListener( new OnClickListener() {
138-
// @Override
139-
// public void onClick(View v) {
140-
// ui.openOptionsMenu();
141-
// }
142-
// }
143-
// );
144-
// }
145-
146135
// progress indicator
147136
View iView = new View(context);
148137
iView.setLayoutParams(new FrameLayout.LayoutParams(150, 150, Gravity.CENTER_VERTICAL|Gravity.CENTER_HORIZONTAL));

mobile/src/main/java/org/scoutant/blokish/PieceUI.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import android.os.SystemClock;
2626
import android.os.Vibrator;
2727
import android.preference.PreferenceManager;
28-
import android.support.v4.content.ContextCompat;
2928
import android.util.Log;
3029
import android.view.Display;
3130
import android.view.Gravity;
@@ -44,6 +43,8 @@
4443

4544
import java.util.Calendar;
4645

46+
import androidx.core.content.ContextCompat;
47+
4748
public class PieceUI extends FrameLayout implements OnTouchListener, OnLongClickListener, Comparable<PieceUI> {
4849

4950
public static final int PADDING = 4;

mobile/src/main/java/org/scoutant/blokish/Settings.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import android.preference.PreferenceActivity;
1919
import android.preference.PreferenceFragment;
2020

21-
// TODO refactor settings ! i18n and better layout
2221
/** Magaging app preferences following tutorial : http://jetpad.org/2011/01/creating-a-preference-activity-in-android */
2322
public class Settings extends PreferenceActivity {
2423
@Override

0 commit comments

Comments
 (0)