Premier commit - Incorporation dans la machinerie git

This commit is contained in:
Mysaa 2021-05-19 19:49:38 +02:00
commit 882c0c4494
33 changed files with 1138 additions and 0 deletions

12
.gitignore vendored Normal file
View File

@ -0,0 +1,12 @@
.gradle
/local.properties
/.idea
.DS_Store
/build
/captures
.externalNativeBuild
app/build
gradle/
gradlew
gradlew.bat

19
TikTokMurder.iml Normal file
View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="TikTokMurder" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="java-gradle" name="Java-Gradle">
<configuration>
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
<option name="BUILDABLE" value="false" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

3
app/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
/build
/debug
/release

132
app/app.iml Normal file
View File

@ -0,0 +1,132 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":app" />
<option name="LAST_SUCCESSFUL_SYNC_AGP_VERSION" value="3.6.0" />
<option name="LAST_KNOWN_AGP_VERSION" value="3.6.0" />
</configuration>
</facet>
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="debug" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
<afterSyncTasks>
<task>generateDebugSources</task>
</afterSyncTasks>
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
<option name="TEST_RES_FOLDERS_RELATIVE_PATH" value="" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7">
<output url="file://$MODULE_DIR$/build/intermediates/javac/debug/classes" />
<output-test url="file://$MODULE_DIR$/build/intermediates/javac/debugUnitTest/classes" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/aidl_source_output_dir/debug/out" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/ap_generated_sources/debug/out" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/renderscript_source_output_dir/debug/out" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/aidl_source_output_dir/debugAndroidTest/out" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/renderscript_source_output_dir/debugAndroidTest/out" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/ap_generated_sources/debugAndroidTest/out" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/ap_generated_sources/debugUnitTest/out" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="jdk" jdkName="Android API 29 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="TEST" name="Gradle: junit:junit:4.12@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.hamcrest:hamcrest-integration:1.3@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.hamcrest:hamcrest-library:1.3@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.hamcrest:hamcrest-core:1.3@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: net.sf.kxml:kxml2:2.3.0@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.squareup:javawriter:2.1.1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: javax.inject:javax.inject:1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.google.code.findbugs:jsr305:2.0.1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: androidx.test.ext:junit:1.1.1@aar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: androidx.test.espresso:espresso-core:3.2.0@aar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: androidx.test:runner:1.2.0@aar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: androidx.test:core:1.2.0@aar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: androidx.test:monitor:1.2.0@aar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: androidx.test.espresso:espresso-idling-resource:3.2.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.collection:collection:1.1.0@jar" level="project" />
<orderEntry type="library" name="Gradle: androidx.arch.core:core-common:2.1.0@jar" level="project" />
<orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-common:2.1.0@jar" level="project" />
<orderEntry type="library" name="Gradle: androidx.annotation:annotation:1.1.0@jar" level="project" />
<orderEntry type="library" name="Gradle: androidx.constraintlayout:constraintlayout-solver:1.1.3@jar" level="project" />
<orderEntry type="library" name="Gradle: org.yaml:snakeyaml:1.25@jar" level="project" />
<orderEntry type="library" name="Gradle: androidx.appcompat:appcompat:1.1.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.fragment:fragment:1.1.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.appcompat:appcompat-resources:1.1.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.drawerlayout:drawerlayout:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.viewpager:viewpager:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.loader:loader:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.activity:activity:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.vectordrawable:vectordrawable-animated:1.1.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.vectordrawable:vectordrawable:1.1.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.customview:customview:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.core:core:1.1.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.cursoradapter:cursoradapter:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.versionedparcelable:versionedparcelable:1.1.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-viewmodel:2.1.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-runtime:2.1.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.savedstate:savedstate:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.interpolator:interpolator:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-livedata:2.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-livedata-core:2.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.arch.core:core-runtime:2.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.constraintlayout:constraintlayout:1.1.3@aar" level="project" />
</component>
</module>

37
app/build.gradle Normal file
View File

@ -0,0 +1,37 @@
apply plugin: 'com.android.application'
android {
signingConfigs {
debug {
storeFile file('/home/mysaa/Documents/bernard-android.jks')
storePassword 'modulo63'
keyPassword 'néant is all(like 42)'
}
}
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.bernard.tiktokmurder"
minSdkVersion 23
targetSdkVersion 29
versionCode 2
versionName "1.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'org.yaml:snakeyaml:1.25'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.bernard.tiktokmurder">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="@drawable/tiktokmurder_icon"
android:label="@string/app_name"
android:roundIcon="@drawable/tiktokmurder_icon_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
</application>
</manifest>

View File

@ -0,0 +1,411 @@
package com.bernard.tiktokmurder;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import android.Manifest;
import android.content.Context;
import android.content.DialogInterface;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.database.DataSetObserver;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.widget.Spinner;
import android.widget.SpinnerAdapter;
import android.widget.TextView;
import android.widget.Toast;
import org.w3c.dom.Text;
import org.yaml.snakeyaml.Yaml;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.nio.file.CopyOption;
import java.nio.file.Files;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class MainActivity extends AppCompatActivity {
//public static final int DATA_ACCESS_PERMISSION_REQUEST = 44242;
public static DateFormat dateFormat = SimpleDateFormat.getTimeInstance();
public static final String murderFileName = "murder.yml";
private boolean shouldUpdateText = false;
Button leftArrow,rightArrow;
Spinner playerSelect;
ListView actionList;
long[][] triggeredTime;
String[] playerNames;
String[][] playerActions;
Long[][] playerActionBaseTime;
ActionListAdapter[] adapteurs;
protected void generateData(){
Log.i("generateData","Tentative de génération des données");
Yaml yaml = new Yaml();
File murderFile = new File(this.getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS),murderFileName);
Log.i("MurderFile","Recherche du fichier à "+murderFile);
InputStream ist;
List<String> playerNames = new ArrayList<>();
List<String> commonActions = new ArrayList<>();
List<Long> commonActionsBaseTime = new ArrayList<>();
Map<String,List<String>> playerActions = new HashMap<>();
Map<String,List<Long>> playerActionsBaseTime = new HashMap<>();
try {
if (!murderFile.exists()) {
ist = this.getResources().openRawResource(R.raw.default_murder);
FileOutputStream fos = new FileOutputStream(murderFile);
byte[] data = new byte[ist.available()];
ist.read(data);
fos.write(data);
fos.close();
ist.reset();
}else
ist = new FileInputStream(murderFile);
Map<String, Object> donnees = yaml.load(ist);
if(donnees.containsKey("actionsCommunes")){
Map<String,String> actionsCommunes = (Map<String, String>) donnees.get("actionsCommunes");
for(Map.Entry<String,String> action : actionsCommunes.entrySet()){
commonActions.add(action.getKey());
commonActionsBaseTime.add(parseTime(action.getValue()));
}
}
if(donnees.containsKey("joueurs")){
Map<String,Object> joueurs = (Map<String, Object>) donnees.get("joueurs");
for(String joueur : joueurs.keySet()){
playerNames.add(joueur);
List<String> pActions=new ArrayList<>();
List<Long> pActionsBasetime = new ArrayList<>();
Object joueurPreData = joueurs.get(joueur);
if(joueurPreData==null){
}else {
Map<String, Object> joueurData = (Map<String, Object>) joueurPreData;
if (joueurData.containsKey("actions")) {
Map<String, String> actions = (Map<String, String>) joueurData.get("actions");
for (Map.Entry<String, String> paction : actions.entrySet()) {
pActions.add(paction.getKey());
pActionsBasetime.add(parseTime(paction.getValue()));
}
}
}
playerActions.put(joueur,pActions);
playerActionsBaseTime.put(joueur,pActionsBasetime);
}
}
// Maintenant, on crée les tableaux
this.triggeredTime = new long[playerNames.size()][];
this.playerNames = new String[playerNames.size()];
playerNames.toArray(this.playerNames);
this.playerActions = new String[playerActions.size()][];
this.playerActionBaseTime = new Long[playerActions.size()][];
int commonLength = commonActions.size();
String[] commonActionsArray = new String[commonLength];
Long[] commonActionsBaseTimeArray = new Long[commonLength];
commonActions.toArray(commonActionsArray);
commonActionsBaseTime.toArray(commonActionsBaseTimeArray);
for (int i = 0; i < this.playerNames.length; i++){
int pactionsCount = commonLength+playerActions.get(this.playerNames[i]).size();
this.playerActions[i] = new String[pactionsCount];
System.arraycopy(commonActionsArray,0,this.playerActions[i],0,commonLength);
System.arraycopy(playerActions.get(this.playerNames[i]).toArray(),0,this.playerActions[i],commonLength,pactionsCount-commonLength);
this.playerActionBaseTime[i] = new Long[pactionsCount];
System.arraycopy(commonActionsBaseTimeArray,0,this.playerActionBaseTime[i],0,commonLength);
System.arraycopy(playerActionsBaseTime.get(this.playerNames[i]).toArray(),0,this.playerActionBaseTime[i],commonLength,pactionsCount-commonLength);
this.triggeredTime[i] = new long[pactionsCount];
Arrays.fill(this.triggeredTime[i],0L);
}
}catch(Exception err){
Log.e("MurderRead","J'ai pas réussi a lire le fichier, même si il est censé exister",err);
Toast.makeText(this,"Impossible de lire le fichier "+murderFileName,Toast.LENGTH_LONG).show();
}
}
public static long parseTime(String str){
Matcher reconizeur = Pattern.compile("(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s?)?").matcher(str);
if(!reconizeur.matches())
throw new IllegalArgumentException("Le temps '"+str+"' n'a pas été compris");
Log.d("tempsLu",str);
for (int i = 0; i <= reconizeur.groupCount(); i++)
Log.d("tempsLu",i+"->"+(reconizeur.group(i)==null?"null":reconizeur.group(i)));
long h=0,m=0,s=0;
if(reconizeur.group(2)!=null)h = Long.parseLong(reconizeur.group(2));
if(reconizeur.group(4)!=null)m = Long.parseLong(reconizeur.group(4));
if(reconizeur.group(6)!=null)s = Long.parseLong(reconizeur.group(6));
return 1000*(s+60*(m+60*h));
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.d("onCreate","Je demmande la permission"+ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE)+ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE));
/*
if(ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED ||
ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED){
ActivityCompat.requestPermissions(this,new String[]{Manifest.permission.READ_EXTERNAL_STORAGE,Manifest.permission.WRITE_EXTERNAL_STORAGE},DATA_ACCESS_PERMISSION_REQUEST);
setContentView(R.layout.activity_main);
}else{
setContentView(R.layout.activity_main);
generateData();
initUI();
}
*/
setContentView(R.layout.activity_main);
generateData();
initUI();
}
/*
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
switch (requestCode){
case DATA_ACCESS_PERMISSION_REQUEST:
if(grantResults.length>0 && grantResults[0]==PackageManager.PERMISSION_GRANTED){
generateData();
initUI();
}else{
Toast.makeText(this,R.string.permission_denied_show_anger,Toast.LENGTH_SHORT).show();
}
}
}
*/
void initUI(){
leftArrow = findViewById(R.id.leftPlayerSelect);
rightArrow = findViewById(R.id.rightPlayerSelect);
playerSelect = findViewById(R.id.playerSelect);
actionList = findViewById(R.id.actionListAdapter);
leftArrow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Log.e("ui","coucou");
prevPlayer();
}
});
rightArrow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
nextPlayer();
}
});
playerSelect.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
selectPlayer(position);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
ArrayAdapter<String> playerAdapter = new ArrayAdapter<>(this,android.R.layout.simple_spinner_dropdown_item,playerNames);
playerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
playerSelect.setAdapter(playerAdapter);
adapteurs = new ActionListAdapter[playerNames.length];
triggeredTime = new long[playerNames.length][];
for(int i = 0;i<playerNames.length;i++) {
this.triggeredTime[i] = new long[playerActions[i].length];
Arrays.fill(this.triggeredTime[i],0L);
adapteurs[i] = new ActionListAdapter(playerActions[i], playerActionBaseTime[i],triggeredTime[i], this);
}
selectPlayer(0);
Thread textUpdaterThread = new Thread(new Runnable() {
@Override
public void run() {
while(shouldUpdateText) {
runOnUiThread(new Runnable() {
@Override
public void run() {
for (ActionListAdapter adapteur : adapteurs) adapteur.updateTimer();
}
});
try{Thread.sleep(150);}
catch(InterruptedException e){Log.e("ScreenUpdater","La mise a jour des champs de texte a été interrompue. :/ (Ca devrait toujours fonctionner néanmoins",e);}
}
}
});
shouldUpdateText = true;
textUpdaterThread.start();
}
void selectPlayer(int i){
if(adapteurs.length>i)actionList.setAdapter(adapteurs[i]);
}
void nextPlayer(){
playerSelect.setSelection((playerSelect.getSelectedItemPosition()+1)%playerSelect.getCount());
}
void prevPlayer(){
playerSelect.setSelection((playerSelect.getSelectedItemPosition()-1)%playerSelect.getCount());
}
@Override
public void onBackPressed() {
new AlertDialog.Builder(this)
.setIcon(android.R.drawable.ic_dialog_alert)
.setTitle(R.string.quitTitle)
.setMessage(R.string.quitText)
.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
}
})
.setNegativeButton(android.R.string.no,null)
.show();
}
public class ActionListAdapter extends BaseAdapter implements View.OnClickListener {
String[] actionNames;
Long[] actionsBaseTime;
Button[] boutons;
Button boutonZero;// Pour corriger le bug du buton zéro
TextView[] timeLeftText;
TextView timeLeftZero;
Context ctx;
long[] triggeredTime;
ActionListAdapter(String[] actionNames, Long[] actionsBaseTime, long[] triggeredTime, Context ctx){
this.ctx = ctx;
this.actionNames = actionNames;
this.actionsBaseTime = actionsBaseTime;
this.triggeredTime = triggeredTime;
this.timeLeftText = new TextView[actionNames.length];
this.boutons = new Button[actionNames.length];
}
@Override
public int getCount() {
return actionNames.length;
}
@Override
public Object getItem(int position) {
return actionNames[position];
}
@Override
public long getItemId(int position) {
return getItem(position).hashCode();
}
@Override
public View getView(int i, View convertView, ViewGroup parent) {
if(convertView==null){
convertView = ((LayoutInflater) ctx
.getSystemService(Context.LAYOUT_INFLATER_SERVICE))
.inflate(R.layout.action_item,parent,false);
if(i==0)boutonZero = boutons[i];
boutons[i] = convertView.findViewById(R.id.launchActionButton);
Log.d("Clicked","J'ai créé le bouton pour "+i+" sur "+parent+" et c'est "+boutons[i]);
boutons[i].setOnClickListener(this);
if(i==0)timeLeftZero = timeLeftText[i];
timeLeftText[i] = convertView.findViewById(R.id.timeLeftText);
TextView titleText = convertView.findViewById(R.id.actionTitle);
titleText.setText(actionNames[i] +" --- "+ beautyfulTime(actionsBaseTime[i]));
}
return convertView;
}
public void triggerAction(int i){
if(i==0 && boutonZero!=null)this.boutonZero.setEnabled(false);
this.boutons[i].setEnabled(false);
triggeredTime[i] = System.currentTimeMillis();
updateTimer();
}
public void updateTimer(){
long time = System.currentTimeMillis();
for(int i=0;i<actionNames.length;i++){
if(timeLeftText[i]!=null) {
long deltat = triggeredTime[i] + actionsBaseTime[i] - time;
if (deltat <= 0) {
if(i==0 && timeLeftZero!=null)timeLeftZero.setText(R.string.disponible);
timeLeftText[i].setText(R.string.disponible);
if (i==0 && boutonZero!=null && !boutonZero.isEnabled()) this.boutonZero.setEnabled(true);
if (!boutons[i].isEnabled()) this.boutons[i].setEnabled(true);
} else {
if(i==0 && timeLeftZero!=null)timeLeftZero.setText(getString(R.string.timeLeft, beautyfulTime(deltat), dateFormat.format(new Date(time + deltat))));
timeLeftText[i].setText(getString(R.string.timeLeft, beautyfulTime(deltat), dateFormat.format(new Date(time + deltat))));
}
}
}
}
@Override
public void onClick(View v) {
Log.d("Clicked",v+"---"+Arrays.toString(this.boutons));
if(v instanceof Button){
for (int i = 0; i < boutons.length; i++) {
if(boutons[i] == v){
triggerAction(i);
}
}
if(v==boutonZero)triggerAction(0);
}
}
}
public static String beautyfulTime(long ms){
long h=ms/1000/60/60,m=(ms/1000/60)%60,s=(ms/1000)%60;
return (h==0?"":h+"h") + (m==0?"":(m>9?m+"m":"0"+m+"m")) + (s==0?"":(s>9?s+"s":"0"+s+"s"));
}
}

View File

@ -0,0 +1,34 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeWidth="1"
android:strokeColor="#00000000">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>

View File

@ -0,0 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#008577"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>

View File

@ -0,0 +1,51 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="30dp"
android:height="30dp"
android:viewportWidth="30"
android:viewportHeight="30">
<path
android:pathData="M8.65,0.4588L21.35,0.4588A8.1912,8.1912 0,0 1,29.5412 8.65L29.5412,21.35A8.1912,8.1912 0,0 1,21.35 29.5412L8.65,29.5412A8.1912,8.1912 0,0 1,0.4588 21.35L0.4588,8.65A8.1912,8.1912 0,0 1,8.65 0.4588z"
android:strokeAlpha="1"
android:strokeLineJoin="round"
android:strokeWidth="0.17236134"
android:fillColor="#4d7844"
android:strokeColor="#00000000"
android:fillType="nonZero"
android:fillAlpha="1"
android:strokeLineCap="round"/>
<path
android:pathData="m16.5115,3.2216c1.4923,0.2876 2.9302,0.9957 4.0867,2.0761 1.5444,1.4427 2.5868,3.5492 2.5868,6.2043 0,2.2233 -0.8155,4.7895 -3.8491,6.7193 -4.2296,2.6905 -4.0887,10.607 -4.0887,10.607 0,0.083 -0.1244,0.1244 -0.2488,0.1244 -0.1244,0 -0.2488,-0.0415 -0.2488,-0.1244 0,0 0.1442,-7.9165 -4.0854,-10.607 -1.2149,-0.7728 -2.074,-1.6477 -2.6675,-2.5617 -2.7818,1.005 -3.7346,-2.6765 -1.1678,-3.6608 -0.0278,-0.1633 -0.0138,-0.3329 -0.0138,-0.4967 0,-4.6477 3.1944,-7.6144 6.6835,-8.2823 0,-0.5776 -0.0678,-1.2218 0.2528,-1.4877 0.2732,-0.2266 0.8953,-0.2238 1.2419,-0.2238 0.3154,0 0.997,0.0172 1.2572,0.2051 0.361,0.2607 0.2612,0.8855 0.2612,1.5084z"
android:strokeAlpha="1"
android:strokeLineJoin="miter"
android:strokeWidth="0.24575846"
android:fillColor="#383838"
android:strokeColor="#000000"
android:fillAlpha="1"
android:strokeLineCap="butt"/>
<path
android:pathData="m24.4149,12.0153 l-0.6945,-0.0628v-0.605c0,-0.3328 -0.0244,-0.8583 -0.0542,-1.1678l-0.0542,-0.5628 0.7712,-0.156c0.4241,-0.0858 0.8239,-0.1698 0.8883,-0.1866 0.0942,-0.0246 0.1263,0.0255 0.164,0.2558 0.0922,0.5631 0.1635,1.8144 0.1247,2.1881 -0.0456,0.4387 0.0742,0.4076 -1.1452,0.2973zM8.5566,19.8033c-0.1415,-0.1105 -0.3677,-0.2979 -0.5028,-0.4164 -0.2849,-0.2501 -1.0116,-0.9881 -1.0011,-1.0166 0.0081,-0.0219 1.4151,-1.2631 1.4318,-1.2631 0.006,0 0.1667,0.1552 0.3572,0.3449 0.1905,0.1897 0.4832,0.4539 0.6504,0.5871 0.1672,0.1332 0.338,0.27 0.3796,0.304l0.0756,0.0618 -0.5395,0.7717c-0.2967,0.4245 -0.5517,0.7842 -0.5667,0.7995 -0.021,0.0213 -0.0869,-0.0188 -0.2845,-0.1731zM21.7158,18.2741 L21.0516,17.561 21.2445,17.3622c0.3148,-0.3244 0.6203,-0.6891 0.8412,-1.0042l0.0895,-0.1276 0.7969,0.5308c0.4383,0.2919 0.7996,0.5332 0.8029,0.536 0.0182,0.0156 -0.4242,0.6129 -0.6848,0.9247 -0.1688,0.2019 -0.5055,0.5701 -0.6298,0.6885l-0.0804,0.0767zM8.709,4.0706c-0.2958,-0.3346 -0.5755,-0.6581 -0.6215,-0.7187l-0.0836,-0.1103 0.4344,-0.3467c0.6839,-0.5458 1.8196,-1.2596 1.8909,-1.1883 0.0422,0.0422 0.812,1.6719 0.812,1.7191 0,0.0242 -0.0165,0.0439 -0.0366,0.0439 -0.0815,0 -1.0711,0.6258 -1.4405,0.9109 -0.2174,0.1678 -0.4002,0.3036 -0.4063,0.3018 -0.006,-0.002 -0.253,-0.2772 -0.5488,-0.6118zM5.5323,9.2655c-0.4738,-0.1007 -0.8686,-0.1904 -0.8775,-0.1993 -0.058,-0.058 0.4207,-1.5667 0.6817,-2.1481l0.1422,-0.3167 0.8417,0.4214 0.8417,0.4213 -0.1347,0.2847c-0.1309,0.2768 -0.4192,1.1275 -0.5181,1.5289 -0.0269,0.1093 -0.064,0.197 -0.0823,0.1949 -0.0183,-0.002 -0.4209,-0.0863 -0.8947,-0.1871zM20.8318,4.8113c-0.5531,-0.4928 -1.1804,-0.9257 -1.8262,-1.2604l-0.2412,-0.125 0.4219,-0.8971c0.2321,-0.4934 0.4292,-0.8971 0.4381,-0.8971 0.0267,0 0.5603,0.291 0.8098,0.4415 0.5769,0.3482 1.2432,0.8477 1.6858,1.2639l0.1295,0.1218 -0.6681,0.7125 -0.6681,0.7125z"
android:strokeAlpha="1"
android:strokeLineJoin="round"
android:strokeWidth="0.24600001"
android:fillColor="#383838"
android:strokeColor="#000400"
android:fillAlpha="1"
android:strokeLineCap="round"/>
<path
android:pathData="M15.0005,11.2878m-2.7266,0a2.7266,2.7266 0,1 1,5.4532 0a2.7266,2.7266 0,1 1,-5.4532 0"
android:strokeAlpha="1"
android:strokeLineJoin="round"
android:strokeWidth="0.24600001"
android:fillColor="#818181"
android:strokeColor="#000400"
android:fillAlpha="1"
android:strokeLineCap="round"/>
<path
android:pathData="m14.5521,8.9326 l0.4484,2.3553 0.9737,-0.652"
android:strokeAlpha="1"
android:strokeLineJoin="round"
android:strokeWidth="0.16500001"
android:fillColor="#00000000"
android:strokeColor="#000000"
android:strokeLineCap="round"/>
</vector>

View File

@ -0,0 +1,51 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="30dp"
android:height="30dp"
android:viewportWidth="30"
android:viewportHeight="30">
<path
android:pathData="M15,0.4588L15,0.4588A14.5412,14.5412 0,0 1,29.5412 15L29.5412,15A14.5412,14.5412 0,0 1,15 29.5412L15,29.5412A14.5412,14.5412 0,0 1,0.4588 15L0.4588,15A14.5412,14.5412 0,0 1,15 0.4588z"
android:strokeAlpha="1"
android:strokeLineJoin="round"
android:strokeWidth="0.17236134"
android:fillColor="#4d7844"
android:strokeColor="#00000000"
android:fillType="nonZero"
android:fillAlpha="1"
android:strokeLineCap="round"/>
<path
android:pathData="m16.5115,3.2216c1.4923,0.2876 2.9302,0.9957 4.0867,2.0761 1.5444,1.4427 2.5868,3.5492 2.5868,6.2043 0,2.2233 -0.8155,4.7895 -3.8491,6.7193 -4.2296,2.6905 -4.0887,10.607 -4.0887,10.607 0,0.083 -0.1244,0.1244 -0.2488,0.1244 -0.1244,0 -0.2488,-0.0415 -0.2488,-0.1244 0,0 0.1442,-7.9165 -4.0854,-10.607 -1.2149,-0.7728 -2.074,-1.6477 -2.6675,-2.5617 -2.7818,1.005 -3.7346,-2.6765 -1.1678,-3.6608 -0.0278,-0.1633 -0.0138,-0.3329 -0.0138,-0.4967 0,-4.6477 3.1944,-7.6144 6.6835,-8.2823 0,-0.5776 -0.0678,-1.2218 0.2528,-1.4877 0.2732,-0.2266 0.8953,-0.2238 1.2419,-0.2238 0.3154,0 0.997,0.0172 1.2572,0.2051 0.361,0.2607 0.2612,0.8855 0.2612,1.5084z"
android:strokeAlpha="1"
android:strokeLineJoin="miter"
android:strokeWidth="0.24575846"
android:fillColor="#383838"
android:strokeColor="#000000"
android:fillAlpha="1"
android:strokeLineCap="butt"/>
<path
android:pathData="m24.4149,12.0153 l-0.6945,-0.0628v-0.605c0,-0.3328 -0.0244,-0.8583 -0.0542,-1.1678l-0.0542,-0.5628 0.7712,-0.156c0.4241,-0.0858 0.8239,-0.1698 0.8883,-0.1866 0.0942,-0.0246 0.1263,0.0255 0.164,0.2558 0.0922,0.5631 0.1635,1.8144 0.1247,2.1881 -0.0456,0.4387 0.0742,0.4076 -1.1452,0.2973zM8.5566,19.8033c-0.1415,-0.1105 -0.3677,-0.2979 -0.5028,-0.4164 -0.2849,-0.2501 -1.0116,-0.9881 -1.0011,-1.0166 0.0081,-0.0219 1.4151,-1.2631 1.4318,-1.2631 0.006,0 0.1667,0.1552 0.3572,0.3449 0.1905,0.1897 0.4832,0.4539 0.6504,0.5871 0.1672,0.1332 0.338,0.27 0.3796,0.304l0.0756,0.0618 -0.5395,0.7717c-0.2967,0.4245 -0.5517,0.7842 -0.5667,0.7995 -0.021,0.0213 -0.0869,-0.0188 -0.2845,-0.1731zM21.7158,18.2741 L21.0516,17.561 21.2445,17.3622c0.3148,-0.3244 0.6203,-0.6891 0.8412,-1.0042l0.0895,-0.1276 0.7969,0.5308c0.4383,0.2919 0.7996,0.5332 0.8029,0.536 0.0182,0.0156 -0.4242,0.6129 -0.6848,0.9247 -0.1688,0.2019 -0.5055,0.5701 -0.6298,0.6885l-0.0804,0.0767zM8.709,4.0706c-0.2958,-0.3346 -0.5755,-0.6581 -0.6215,-0.7187l-0.0836,-0.1103 0.4344,-0.3467c0.6839,-0.5458 1.8196,-1.2596 1.8909,-1.1883 0.0422,0.0422 0.812,1.6719 0.812,1.7191 0,0.0242 -0.0165,0.0439 -0.0366,0.0439 -0.0815,0 -1.0711,0.6258 -1.4405,0.9109 -0.2174,0.1678 -0.4002,0.3036 -0.4063,0.3018 -0.006,-0.002 -0.253,-0.2772 -0.5488,-0.6118zM5.5323,9.2655c-0.4738,-0.1007 -0.8686,-0.1904 -0.8775,-0.1993 -0.058,-0.058 0.4207,-1.5667 0.6817,-2.1481l0.1422,-0.3167 0.8417,0.4214 0.8417,0.4213 -0.1347,0.2847c-0.1309,0.2768 -0.4192,1.1275 -0.5181,1.5289 -0.0269,0.1093 -0.064,0.197 -0.0823,0.1949 -0.0183,-0.002 -0.4209,-0.0863 -0.8947,-0.1871zM20.8318,4.8113c-0.5531,-0.4928 -1.1804,-0.9257 -1.8262,-1.2604l-0.2412,-0.125 0.4219,-0.8971c0.2321,-0.4934 0.4292,-0.8971 0.4381,-0.8971 0.0267,0 0.5603,0.291 0.8098,0.4415 0.5769,0.3482 1.2432,0.8477 1.6858,1.2639l0.1295,0.1218 -0.6681,0.7125 -0.6681,0.7125z"
android:strokeAlpha="1"
android:strokeLineJoin="round"
android:strokeWidth="0.24600001"
android:fillColor="#383838"
android:strokeColor="#000400"
android:fillAlpha="1"
android:strokeLineCap="round"/>
<path
android:pathData="M15.0005,11.2878m-2.7266,0a2.7266,2.7266 0,1 1,5.4532 0a2.7266,2.7266 0,1 1,-5.4532 0"
android:strokeAlpha="1"
android:strokeLineJoin="round"
android:strokeWidth="0.24600001"
android:fillColor="#818181"
android:strokeColor="#000400"
android:fillAlpha="1"
android:strokeLineCap="round"/>
<path
android:pathData="m14.5521,8.9326 l0.4484,2.3553 0.9737,-0.652"
android:strokeAlpha="1"
android:strokeLineJoin="round"
android:strokeWidth="0.16500001"
android:fillColor="#00000000"
android:strokeColor="#000000"
android:strokeLineCap="round"/>
</vector>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="wrap_content">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:text="@string/trigger_button"
android:id="@+id/launchActionButton"
android:layout_alignParentEnd="true"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/actionTitle"
android:layout_alignParentTop="true"
android:layout_alignEnd="@id/launchActionButton"
android:layout_alignParentStart="true"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/timeLeftText"
android:layout_alignParentBottom="true"
android:layout_alignEnd="@id/launchActionButton"
android:layout_alignParentStart="true"/>
</RelativeLayout>

View File

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true"
android:id="@+id/topPlayerSelectLayout">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:text="@string/left_arrow"
android:id="@+id/leftPlayerSelect"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:text="@string/right_arrow"
android:id="@+id/rightPlayerSelect"/>
<Spinner
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:layout_toEndOf="@id/leftPlayerSelect"
android:layout_toStartOf="@id/rightPlayerSelect"
android:id="@+id/playerSelect"/>
</RelativeLayout>
<ListView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true"
android:layout_below="@id/topPlayerSelectLayout"
android:id="@+id/actionListAdapter"/>
</RelativeLayout>

View File

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

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -0,0 +1,10 @@
actionsCommunes:
Doudou : 23s
Chanter : 42s
joueurs:
Bernard :
actions:
DominerLeMonde: 42s
Jach :
actions:
Python: 2h15m

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">TikTokMurder</string>
<string name="trigger_button">Trigger</string>
<string name="disponible">Available</string>
<string name="timeLeft">%1$s left, resetting at %2$s</string>
<string name="quitTitle">Seriously</string>
<string name="quitText">Do you really want to quit ?! Timers will be reset !</string>
<string name="permission_denied_show_anger">How do you want me to work then !</string>
</resources>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#008577</color>
<color name="colorPrimaryDark">#00574B</color>
<color name="colorAccent">#D81B60</color>
</resources>

View File

@ -0,0 +1,11 @@
<resources>
<string name="app_name">TikTokMurder</string>
<string name="left_arrow" translatable="false">&lt;</string>
<string name="right_arrow" translatable="false">&gt;</string>
<string name="trigger_button">Go</string>
<string name="disponible">Disponible</string>
<string name="timeLeft">Reste %1$s, reset à %2$s</string>
<string name="permission_denied_show_anger">Que voulez vous &#8230;</string>
<string name="quitTitle">Really ?!</string>
<string name="quitText">Voulez-vous vraiment quitter ? Cela remettera les chronos à zéro !</string>
</resources>

View File

@ -0,0 +1,11 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>

27
build.gradle Normal file
View File

@ -0,0 +1,27 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

20
gradle.properties Normal file
View File

@ -0,0 +1,20 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# 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
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

2
settings.gradle Normal file
View File

@ -0,0 +1,2 @@
include ':app'
rootProject.name='TikTokMurder'