Switch to Kotlin

This commit is contained in:
Matthieu 2020-02-28 17:08:54 +01:00
parent 5d4bd309bd
commit a63c7ccb97
28 changed files with 463 additions and 198 deletions

View File

@ -6,12 +6,12 @@ android:
# The SDK version used to compile your project # The SDK version used to compile your project
- android-29 - android-29
# The SDK version used by the system image # The SDK version used by the system image
- android-22 - android-23
# The system image, to run an emulator during the tests # The system image, to run an emulator during the tests
- sys-img-armeabi-v7a-android-22 - sys-img-armeabi-v7a-android-23
before_script: before_script:
# Emulator Management: Create, Start and Wait # Emulator Management: Create, Start and Wait
- echo no | android create avd --force -n test -t android-22 --abi armeabi-v7a - echo no | android create avd --force -n test -t android-23 --abi armeabi-v7a
- emulator -avd test -no-audio -no-window & - emulator -avd test -no-audio -no-window &
- android-wait-for-emulator - android-wait-for-emulator
- adb shell input keyevent 82 - adb shell input keyevent 82

View File

@ -1,12 +1,15 @@
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'jacoco'
android { android {
compileSdkVersion 29 compileSdkVersion 29
buildToolsVersion "29.0.3" buildToolsVersion "29.0.2"
defaultConfig { defaultConfig {
applicationId "ch.epfl.sdp" applicationId "com.h.pixeldroid"
minSdkVersion 21 minSdkVersion 23
targetSdkVersion 29 targetSdkVersion 29
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
@ -15,6 +18,9 @@ android {
} }
buildTypes { buildTypes {
debug {
testCoverageEnabled true
}
release { release {
minifyEnabled false minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
@ -25,10 +31,37 @@ android {
dependencies { dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
} }
tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
jacoco.excludes = ['jdk.internal.*']
}
task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest', 'createDebugCoverageReport']) {
reports {
xml.enabled = true
html.enabled = true
}
def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*']
def debugTree = fileTree(dir: "$project.buildDir/intermediates/classes/debug", excludes: fileFilter)
def kotlinDebugTree = fileTree(dir: "$project.buildDir/tmp/kotlin-classes/", excludes: fileFilter)
def javaMainSrc = "$project.projectDir/src/main/java"
def kotlinMainSrc = "$project.projectDir/src/main/kotlin"
sourceDirectories = files([javaMainSrc, kotlinMainSrc])
classDirectories = files([debugTree, kotlinDebugTree])
executionData = fileTree(dir: project.buildDir, includes: [
'jacoco/testDebugUnitTest.exec', 'outputs/code-coverage/connected/*coverage.ec'
])
}

View File

@ -1,27 +0,0 @@
package ch.epfl.sdp;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("ch.epfl.sdp", appContext.getPackageName());
}
}

View File

@ -0,0 +1,24 @@
package com.h.pixeldroid
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.h.pixeldroid", appContext.packageName)
}
}

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ch.epfl.sdp"> package="com.h.pixeldroid">
<application <application
android:allowBackup="true" android:allowBackup="true"

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

View File

@ -1,14 +0,0 @@
package ch.epfl.sdp;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}

View File

@ -0,0 +1,12 @@
package com.h.pixeldroid
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}
}

View File

@ -2,29 +2,261 @@
xmlns:aapt="http://schemas.android.com/aapt" xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp" android:width="108dp"
android:height="108dp" android:height="108dp"
android:viewportWidth="108" android:viewportWidth="50"
android:viewportHeight="108"> android:viewportHeight="50">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z"> <group>
<aapt:attr name="android:fillColor"> <clip-path
<gradient android:pathData="M0,0.1121h50v49.7758h-50z"/>
android:endX="85.84757" <path
android:endY="92.4963" android:pathData="M24.9918,24.9583C20.9257,19.3956 13.1501,18.1207 7.6245,22.1108C2.0989,26.1009 0.9157,33.8449 4.9817,39.4076L5.2894,39.8285C-1.3415,31.1558 -1.6677,18.9901 4.9426,10.0752L5.0603,9.9188C9.1557,4.4767 16.9375,3.4317 22.4414,7.5847C27.9453,11.7378 29.0872,19.5162 24.9918,24.9583Z"
android:startX="42.9492" android:strokeWidth="1"
android:startY="49.59793" android:fillType="evenOdd"
android:type="linear"> android:strokeColor="#00000000">
<item <aapt:attr name="android:fillColor">
android:color="#44000000" <gradient
android:offset="0.0" /> android:startY="23.743584"
<item android:startX="29.0872"
android:color="#00000000" android:endY="25.312634"
android:offset="1.0" /> android:endX="-1.6677"
</gradient> android:type="linear">
</aapt:attr> <item android:offset="0" android:color="#FFFF5C34"/>
<item android:offset="1" android:color="#FFEB0256"/>
</gradient>
</aapt:attr>
</path> </path>
<path <path
android:pathData="M24.9918,24.9583C18.5188,27.1476 15.1139,34.1806 17.3868,40.6668C19.6597,47.153 26.7496,50.6363 33.2226,48.4469L33.6514,48.3019C25.6016,51.1822 16.2234,49.7969 9.1383,43.8517C7.6813,42.6291 6.3973,41.2776 5.2894,39.8285L4.9817,39.4076C0.9157,33.8449 2.0989,26.1009 7.6245,22.1108C13.1501,18.1207 20.9257,19.3956 24.9918,24.9583Z"
android:strokeWidth="1"
android:fillType="evenOdd"
android:strokeColor="#00000000">
<aapt:attr name="android:fillColor">
<gradient
android:startY="51.1822"
android:startX="11.747686"
android:endY="23.182472"
android:endX="23.500092"
android:type="linear">
<item android:offset="0" android:color="#FFA63FDB"/>
<item android:offset="1" android:color="#FFFF257E"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M24.9918,24.9583C25.0334,31.8039 30.6286,37.3871 37.4889,37.4287C44.3492,37.4704 49.8768,31.9547 49.8352,25.109L49.8342,24.9523C49.9075,30.6314 48.0362,36.3412 44.1198,41.0086C41.2364,44.4449 37.604,46.8876 33.6514,48.3019L33.2226,48.4469C26.7496,50.6363 19.6597,47.153 17.3868,40.6668C15.1139,34.1806 18.5188,27.1476 24.9918,24.9583Z"
android:strokeWidth="1"
android:fillType="evenOdd"
android:strokeColor="#00000000">
<aapt:attr name="android:fillColor">
<gradient
android:startY="37.7943"
android:startX="20.236319"
android:endY="42.29559"
android:endX="47.92959"
android:type="linear">
<item android:offset="0" android:color="#FF00FFF0"/>
<item android:offset="1" android:color="#FF0087FF"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M24.9918,24.9583C31.5292,27.1133 38.5153,23.5928 40.5956,17.0951C42.676,10.5974 39.0628,3.583 32.5254,1.428L31.9903,1.2516C35.1401,2.2106 38.1577,3.8096 40.8453,6.0648C46.6841,10.9641 49.7437,17.9348 49.8342,24.9523L49.8352,25.109C49.8768,31.9547 44.3492,37.4704 37.4889,37.4287C30.6286,37.3871 25.0334,31.8039 24.9918,24.9583Z"
android:strokeWidth="1"
android:fillType="evenOdd"
android:strokeColor="#00000000">
<aapt:attr name="android:fillColor">
<gradient
android:startY="4.8781443"
android:startX="45.204914"
android:endY="28.231733"
android:endX="30.171661"
android:type="linear">
<item android:offset="0" android:color="#FF17C934"/>
<item android:offset="1" android:color="#FF03FF6E"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M24.9918,24.9583C29.0872,19.5162 27.9454,11.7378 22.4414,7.5847C16.9375,3.4317 9.1557,4.4766 5.0603,9.9188L4.9427,10.0752C5.236,9.6795 5.5431,9.2903 5.8638,8.908C12.392,1.128 22.7591,-1.5589 31.9903,1.2516L32.5254,1.428C39.0628,3.583 42.676,10.5974 40.5956,17.0951C38.5153,23.5928 31.5293,27.1133 24.9918,24.9583Z"
android:strokeWidth="1"
android:fillType="evenOdd"
android:strokeColor="#00000000">
<aapt:attr name="android:fillColor">
<gradient
android:startY="30.529022"
android:startX="23.80935"
android:endY="-1.5589"
android:endX="16.474056"
android:type="linear">
<item android:offset="0" android:color="#FFFFB000"/>
<item android:offset="1" android:color="#FFFF7725"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M24.9918,24.9583C29.0872,19.5162 27.9454,11.7378 22.4414,7.5847C16.9375,3.4317 9.1557,4.4766 5.0603,9.9188L4.9427,10.0752C5.236,9.6795 5.5431,9.2903 5.8638,8.908C12.392,1.128 22.7591,-1.5589 31.9903,1.2516L32.5254,1.428C39.0628,3.583 42.676,10.5974 40.5956,17.0951C38.5153,23.5928 31.5293,27.1133 24.9918,24.9583Z"
android:strokeWidth="1"
android:fillAlpha="0.1"
android:fillType="evenOdd"
android:strokeColor="#00000000">
<aapt:attr name="android:fillColor">
<gradient
android:startY="30.529022"
android:startX="23.80935"
android:endY="-1.5589"
android:endX="16.474056"
android:type="linear">
<item android:offset="0" android:color="#FFFFB000"/>
<item android:offset="1" android:color="#FFFF7725"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M32.3343,1.365L32.5254,1.428C39.0628,3.583 42.676,10.5974 40.5956,17.0951C38.5153,23.5928 31.5293,27.1133 24.9918,24.9583C25.5982,24.1525 26.0898,23.2955 26.4693,22.4066C30.2903,23.1891 34.3854,21.9267 37.0439,18.7585C40.9242,14.1341 40.2745,7.2004 35.5927,3.272C34.5924,2.4326 33.489,1.7984 32.3343,1.365Z"
android:strokeAlpha="0.5049107"
android:strokeWidth="1"
android:fillType="evenOdd"
android:strokeColor="#00000000"
android:fillAlpha="0.5049107">
<aapt:attr name="android:fillColor">
<gradient
android:startY="30.180696"
android:startX="33.8339"
android:endY="1.365"
android:endX="30.39612"
android:type="linear">
<item android:offset="0" android:color="#FFFFB000"/>
<item android:offset="1" android:color="#FFFF7725"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M32.3343,1.365L32.5254,1.428C39.0628,3.583 42.676,10.5974 40.5956,17.0951C38.5153,23.5928 31.5293,27.1133 24.9918,24.9583C25.5982,24.1525 26.0898,23.2955 26.4693,22.4066C30.2903,23.1891 34.3854,21.9267 37.0439,18.7585C40.9242,14.1341 40.2745,7.2004 35.5927,3.272C34.5924,2.4326 33.489,1.7984 32.3343,1.365Z"
android:strokeAlpha="0.5049107"
android:strokeWidth="1"
android:fillColor="#000000"
android:fillAlpha="0.25052592"
android:fillType="evenOdd"
android:strokeColor="#00000000"/>
<path
android:pathData="M49.8003,24.7486L49.7995,24.9498C49.7701,31.8332 44.2155,37.4371 37.393,37.4665C30.5704,37.4958 25.0634,31.9396 25.0928,25.0562C26.0465,25.3839 27.0135,25.5866 27.9761,25.6729C28.4126,29.5486 30.8788,33.0532 34.7135,34.6025C40.3107,36.8639 46.7041,34.1034 48.9936,28.4368C49.4828,27.226 49.745,25.9807 49.8003,24.7486Z"
android:strokeAlpha="0.5442522"
android:strokeWidth="1"
android:fillType="evenOdd"
android:strokeColor="#00000000"
android:fillAlpha="0.5442522">
<aapt:attr name="android:fillColor">
<gradient
android:startY="32.34891"
android:startX="4.9363155"
android:endY="33.933968"
android:endX="55.098465"
android:type="linear">
<item android:offset="0" android:color="#FF9EE85D"/>
<item android:offset="1" android:color="#FF0ED061"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M49.8003,24.7486L49.7995,24.9498C49.7701,31.8332 44.2155,37.4371 37.393,37.4665C30.5704,37.4958 25.0634,31.9396 25.0928,25.0562C26.0465,25.3839 27.0135,25.5866 27.9761,25.6729C28.4126,29.5486 30.8788,33.0532 34.7135,34.6025C40.3107,36.8639 46.7041,34.1034 48.9936,28.4368C49.4828,27.226 49.745,25.9807 49.8003,24.7486Z"
android:strokeAlpha="0.5442522"
android:strokeWidth="1"
android:fillColor="#000000"
android:fillAlpha="0.27206448"
android:fillType="evenOdd"
android:strokeColor="#00000000"/>
<path
android:pathData="M33.3906,48.2815L33.2,48.3462C26.682,50.5594 19.5751,47.1319 17.3261,40.6907C15.0771,34.2493 18.5379,27.2334 25.0557,25.0202C25.0563,26.0286 25.1795,27.0089 25.4113,27.9471C21.8889,29.6218 19.3782,33.0946 19.1617,37.2248C18.8458,43.2532 23.5374,48.3996 29.6407,48.7195C30.9447,48.7878 32.2076,48.6303 33.3906,48.2815Z"
android:strokeAlpha="0.562221"
android:strokeWidth="1"
android:fillType="evenOdd"
android:strokeColor="#00000000"
android:fillAlpha="0.562221">
<aapt:attr name="android:fillColor">
<gradient
android:startY="54.854748"
android:startX="23.411625"
android:endY="23.98902"
android:endX="15.0771"
android:type="linear">
<item android:offset="0" android:color="#FF21EFE3"/>
<item android:offset="1" android:color="#FF2598FF"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M33.3906,48.2815L33.2,48.3462C26.682,50.5594 19.5751,47.1319 17.3261,40.6907C15.0771,34.2493 18.5379,27.2334 25.0557,25.0202C25.0563,26.0286 25.1795,27.0089 25.4113,27.9471C21.8889,29.6218 19.3782,33.0946 19.1617,37.2248C18.8458,43.2532 23.5374,48.3996 29.6407,48.7195C30.9447,48.7878 32.2076,48.6303 33.3906,48.2815Z"
android:strokeAlpha="0.562221"
android:strokeWidth="1"
android:fillColor="#000000"
android:fillType="evenOdd"
android:strokeColor="#00000000"
android:fillAlpha="0.562221"/>
<path
android:pathData="M4.8631,39.3239L4.7483,39.1585C0.8243,33.5032 2.16,25.7268 7.7319,21.7895C13.3038,17.8522 21.0017,19.2449 24.9259,24.9003C23.9567,25.1789 23.0483,25.5675 22.2102,26.0488C19.6296,23.1245 15.5994,21.6682 11.5695,22.5986C5.6875,23.9565 2.0336,29.8849 3.4085,35.84C3.7022,37.1123 4.2018,38.2829 4.8631,39.3239Z"
android:strokeAlpha="0.5841518"
android:strokeWidth="1"
android:fillType="evenOdd"
android:strokeColor="#00000000"
android:fillAlpha="0.5841518">
<aapt:attr name="android:fillColor">
<gradient
android:startY="30.350138"
android:startX="24.9259"
android:endY="33.809223"
android:endX="-20.782555"
android:type="linear">
<item android:offset="0" android:color="#FFA63FDB"/>
<item android:offset="1" android:color="#FFFF257E"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M4.8631,39.3239L4.7483,39.1585C0.8243,33.5032 2.16,25.7268 7.7319,21.7895C13.3038,17.8522 21.0017,19.2449 24.9259,24.9003C23.9567,25.1789 23.0483,25.5675 22.2102,26.0488C19.6296,23.1245 15.5994,21.6682 11.5695,22.5986C5.6875,23.9565 2.0336,29.8849 3.4085,35.84C3.7022,37.1123 4.2018,38.2829 4.8631,39.3239Z"
android:strokeAlpha="0.5841518"
android:strokeWidth="1"
android:fillColor="#000000"
android:fillAlpha="0.29387823"
android:fillType="evenOdd"
android:strokeColor="#00000000"/>
<path
android:pathData="M4.9719,10.2404L5.0936,10.0802C9.2597,4.6005 17.0682,3.4678 22.5346,7.5503C28.001,11.6328 29.0553,19.3844 24.8892,24.864C24.3248,24.0283 23.6746,23.2846 22.9577,22.6363C24.9415,19.2782 25.0811,14.9953 22.9509,11.4501C19.8418,6.2756 13.0745,4.6326 7.8358,7.7803C6.7165,8.4529 5.7576,9.2897 4.9719,10.2404Z"
android:strokeAlpha="0.18013392"
android:strokeWidth="1"
android:fillType="evenOdd"
android:strokeColor="#00000000"
android:fillAlpha="0.18013392">
<aapt:attr name="android:fillColor">
<gradient
android:startY="15.408332"
android:startX="29.0553"
android:endY="16.330711"
android:endX="4.9719"
android:type="linear">
<item android:offset="0" android:color="#FFFF5C34"/>
<item android:offset="1" android:color="#FFEB0256"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M4.9719,10.2404L5.0936,10.0802C9.2597,4.6005 17.0682,3.4678 22.5346,7.5503C28.001,11.6328 29.0553,19.3844 24.8892,24.864C24.3248,24.0283 23.6746,23.2846 22.9577,22.6363C24.9415,19.2782 25.0811,14.9953 22.9509,11.4501C19.8418,6.2756 13.0745,4.6326 7.8358,7.7803C6.7165,8.4529 5.7576,9.2897 4.9719,10.2404Z"
android:strokeAlpha="0.18013392"
android:strokeWidth="1"
android:fillColor="#000000"
android:fillAlpha="0.13921526"
android:fillType="evenOdd"
android:strokeColor="#00000000"/>
<path
android:pathData="M23.0332,30.2725L27.5781,30.2725C31.8595,30.2725 35.3302,26.9088 35.3302,22.7596C35.3302,18.6103 31.8595,15.2467 27.5781,15.2467L21.0185,15.2467C18.5485,15.2467 16.5461,17.1872 16.5461,19.581L16.5461,36.451L23.0332,30.2725Z"
android:strokeWidth="1"
android:fillColor="#000000"
android:fillAlpha="1"
android:fillType="nonZero"
android:strokeColor="#00000000"/>
<path
android:pathData="M23.0332,30.2725L27.5781,30.2725C31.8595,30.2725 35.3302,26.9088 35.3302,22.7596C35.3302,18.6103 31.8595,15.2467 27.5781,15.2467L21.0185,15.2467C18.5485,15.2467 16.5461,17.1872 16.5461,19.581L16.5461,36.451L23.0332,30.2725Z"
android:strokeWidth="1"
android:fillColor="#FFFFFF" android:fillColor="#FFFFFF"
android:fillType="nonZero" android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z" android:strokeColor="#00000000"/>
android:strokeWidth="1" </group>
android:strokeColor="#00000000" /> </vector>
</vector>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" /> <background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground" /> <foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon> </adaptive-icon>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" /> <background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground" /> <foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon> </adaptive-icon>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#FFFFFF</color>
</resources>

View File

@ -1,17 +0,0 @@
package ch.epfl.sdp;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}

View File

@ -0,0 +1,17 @@
package com.h.pixeldroid
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}

View File

@ -1,15 +1,15 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules. // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript { buildscript {
ext.kotlin_version = '1.3.61'
repositories { repositories {
google() google()
jcenter() jcenter()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.5.3' classpath 'com.android.tools.build:gradle:3.6.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files

View File

@ -17,4 +17,5 @@ org.gradle.jvmargs=-Xmx1536m
android.useAndroidX=true android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX # Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official

View File

@ -1,4 +1,4 @@
#Thu Feb 27 23:25:34 CET 2020 #Fri Feb 28 15:51:25 CET 2020
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

200
gradlew vendored
View File

@ -10,22 +10,22 @@
# Resolve links: $0 may be a link # Resolve links: $0 may be a link
PRG="$0" PRG="$0"
# Need this for relative symlinks. # Need this for relative symlinks.
while [ -h "$PRG" ] ; do while [ -h "$PRG" ]; do
ls=`ls -ld "$PRG"` ls=$(ls -ld "$PRG")
link=`expr "$ls" : '.*-> \(.*\)$'` link=$(expr "$ls" : '.*-> \(.*\)$')
if expr "$link" : '/.*' > /dev/null; then if expr "$link" : '/.*' >/dev/null; then
PRG="$link" PRG="$link"
else else
PRG=`dirname "$PRG"`"/$link" PRG=$(dirname "$PRG")"/$link"
fi fi
done done
SAVED="`pwd`" SAVED="$(pwd)"
cd "`dirname \"$PRG\"`/" >/dev/null cd "$(dirname \"$PRG\")/" >/dev/null
APP_HOME="`pwd -P`" APP_HOME="$(pwd -P)"
cd "$SAVED" >/dev/null cd "$SAVED" >/dev/null
APP_NAME="Gradle" APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"` APP_BASE_NAME=$(basename "$0")
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS="" DEFAULT_JVM_OPTS=""
@ -33,15 +33,15 @@ DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum" MAX_FD="maximum"
warn () { warn() {
echo "$*" echo "$*"
} }
die () { die() {
echo echo
echo "$*" echo "$*"
echo echo
exit 1 exit 1
} }
# OS specific support (must be 'true' or 'false'). # OS specific support (must be 'true' or 'false').
@ -49,115 +49,115 @@ cygwin=false
msys=false msys=false
darwin=false darwin=false
nonstop=false nonstop=false
case "`uname`" in case "$(uname)" in
CYGWIN* ) CYGWIN*)
cygwin=true cygwin=true
;; ;;
Darwin* ) Darwin*)
darwin=true darwin=true
;; ;;
MINGW* ) MINGW*)
msys=true msys=true
;; ;;
NONSTOP* ) NONSTOP*)
nonstop=true nonstop=true
;; ;;
esac esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM. # Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then if [ -n "$JAVA_HOME" ]; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ]; then
# IBM's JDK on AIX uses strange locations for the executables # IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java" JAVACMD="$JAVA_HOME/jre/sh/java"
else else
JAVACMD="$JAVA_HOME/bin/java" JAVACMD="$JAVA_HOME/bin/java"
fi fi
if [ ! -x "$JAVACMD" ] ; then if [ ! -x "$JAVACMD" ]; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the Please set the JAVA_HOME variable in your environment to match the
location of your Java installation." location of your Java installation."
fi fi
else else
JAVACMD="java" JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the Please set the JAVA_HOME variable in your environment to match the
location of your Java installation." location of your Java installation."
fi fi
# Increase the maximum file descriptors if we can. # Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ]; then
MAX_FD_LIMIT=`ulimit -H -n` MAX_FD_LIMIT=$(ulimit -H -n)
if [ $? -eq 0 ] ; then if [ $? -eq 0 ]; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then
MAX_FD="$MAX_FD_LIMIT" MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi fi
ulimit -n $MAX_FD
if [ $? -ne 0 ]; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi fi
# For Darwin, add options to specify how the application appears in the dock # For Darwin, add options to specify how the application appears in the dock
if $darwin; then if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi fi
# For Cygwin, switch paths to Windows format before running java # For Cygwin, switch paths to Windows format before running java
if $cygwin ; then if $cygwin; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"` APP_HOME=$(cygpath --path --mixed "$APP_HOME")
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` CLASSPATH=$(cygpath --path --mixed "$CLASSPATH")
JAVACMD=`cygpath --unix "$JAVACMD"` JAVACMD=$(cygpath --unix "$JAVACMD")
# We build the pattern for arguments to be converted via cygpath # We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` ROOTDIRSRAW=$(find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null)
SEP="" SEP=""
for dir in $ROOTDIRSRAW ; do for dir in $ROOTDIRSRAW; do
ROOTDIRS="$ROOTDIRS$SEP$dir" ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|" SEP="|"
done done
OURCYGPATTERN="(^($ROOTDIRS))" OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments # Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then if [ "$GRADLE_CYGPATTERN" != "" ]; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@"; do
CHECK=$(echo "$arg" | egrep -c "$OURCYGPATTERN" -)
CHECK2=$(echo "$arg" | egrep -c "^-") ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ]; then ### Added a condition
eval $(echo args$i)=$(cygpath --path --ignore --mixed "$arg")
else
eval $(echo args$i)="\"$arg\""
fi fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh i=$((i + 1))
i=0 done
for arg in "$@" ; do case $i in
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 0) set -- ;;
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 3) set -- "$args0" "$args1" "$args2" ;;
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
else 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
eval `echo args$i`="\"$arg\"" 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
fi 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
i=$((i+1)) 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
done 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
case $i in esac
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi fi
# Escape application args # Escape application args
save () { save() {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done for i; do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/"; done
echo " " echo " "
} }
APP_ARGS=$(save "$@") APP_ARGS=$(save "$@")