Commit bc5ad9e4 authored by Elodie Gauthier's avatar Elodie Gauthier

fix bug on ElicitationMode. NB: do not update the google-play-services

lib. Use the one in /Dev/ (on https://forge.imag.fr/docman/?group_id=805
)

upgrade Check modes + fix bugs + improve the layouts
+ fix errors in RecordeElicitation

set input "spk_birth_year" to empty if age=0
before the modification we were forced to
entered a date while it is an optional field.

ModeSelection.java: add the treatment of the "non and erase files" case
for CheckMode.

ThumbRespeakActivityLig.java: add a more specific catch
in order to understand why we cannot respeak/translate
an audio file recorded in Elicitation mode.

CheckTranscription.java and CheckWordVariant.java: modification
of the date.

RecordElicitation.java: add the possibility to backup of the current session
when Validate button is pressed.

ModeSelection.java: add the callback to the button "no and erase files"
for all the submodes of Elicitation Mode.

RecordElicitation.java: create a linker file for Elicitation by Text.
parent 9c204d73
......@@ -39,6 +39,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Check transcription mode"
android:layout_marginTop="40dp"
android:layout_marginBottom="20dp"/>
<View
android:layout_width="match_parent"
......@@ -54,20 +55,23 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Please, listen the audio and check the box if the transcription corresponds."
android:layout_marginBottom="25dp" />
android:layout_marginBottom="35dp" />
</TableLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp" >
<TextView
android:id="@+id/transcription_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
android:textSize="20sp"
android:typeface="serif" />
android:textSize="25sp"
android:typeface="serif"
/>
<View
android:id="@+id/view1"
......@@ -82,7 +86,9 @@
android:id="@+id/phrase_player"
android:name="org.lp20.aikuma.ui.ListenFragment"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:textSize="30sp"
/>
</LinearLayout>
......@@ -90,13 +96,16 @@
android:id="@+id/ll_variant"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
android:orientation="vertical"
android:layout_marginTop="20dp">
</LinearLayout>
<LinearLayout
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2" >
android:layout_weight="2"
android:layout_marginTop="30dp"
android:layout_marginBottom="20dp" >
<ImageButton
android:id="@+id/btn_next"
......@@ -106,20 +115,30 @@
android:onClick="onNextClick"
android:src="@drawable/arrow_circle_o_right" />
</LinearLayout>
</RelativeLayout>
<ImageButton
android:id="@+id/btn_validate"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2"
android:onClick="onValidate"
android:src="@drawable/ok_32" />
android:layout_weight="2"
android:layout_marginTop="40dp"
android:layout_toRightOf="@id/btn_next">
<LinearLayout
<ImageButton
android:id="@+id/btn_validate"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2"
android:onClick="onValidate"
android:src="@drawable/ok_32" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
android:orientation="horizontal"
android:layout_marginTop="40dp">
<TextView
android:id="@+id/check_phrase_number"
......
......@@ -38,14 +38,15 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Check variant mode"
android:layout_marginBottom="20dp"/>
android:layout_marginBottom="20dp"
android:layout_marginTop="40dp"/>
<View
android:layout_width="match_parent"
android:layout_height="0.2dp"
android:id="@+id/separator"
android:visibility="visible"
android:background="@android:color/darker_gray"
android:layout_marginBottom="25dp"/>
android:layout_marginBottom="35dp"/>
<TextView
android:id="@+id/maintextView2"
......@@ -64,19 +65,24 @@
android:text="TextView"
android:textSize="30sp"
android:textStyle="bold"
android:typeface="serif" />
android:typeface="serif"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"/>
<LinearLayout
android:id="@+id/ll_variant"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
android:orientation="vertical"
android:textSize="25sp" >
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2" >
android:layout_weight="2"
android:layout_marginTop="20dp" >
<ImageButton
android:id="@+id/btn_next"
android:layout_width="match_parent"
......@@ -92,12 +98,14 @@
android:layout_height="match_parent"
android:layout_weight="2"
android:onClick="onValidate"
android:src="@drawable/ok_32" />
android:src="@drawable/ok_32"
android:layout_marginTop="40dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
android:orientation="horizontal"
android:layout_marginTop="40dp" >
<TextView
android:id="@+id/check_line_number"
......@@ -117,8 +125,7 @@
android:id="@+id/seek_check_progression"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:maxHeight="3dp"
/>
android:maxHeight="3dp" />
</LinearLayout>
......
......@@ -39,7 +39,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Check transcription mode"
android:layout_marginBottom="20dp"/>
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:textSize="30sp"/>
<View
android:layout_width="match_parent"
android:layout_height="0.2dp"
......@@ -54,7 +56,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Please, listen the audio and check the box if the transcription corresponds."
android:layout_marginBottom="25dp" />
android:layout_marginBottom="25dp"
android:textSize="20sp"/>
</TableLayout>
<LinearLayout
......@@ -82,7 +85,8 @@
android:id="@+id/phrase_player"
android:name="org.lp20.aikuma.ui.ListenFragment"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:textSize="23sp"/>
</LinearLayout>
......@@ -96,7 +100,8 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2" >
android:layout_weight="2"
android:layout_marginTop="20dp">
<ImageButton
android:id="@+id/btn_next"
......@@ -114,12 +119,14 @@
android:layout_height="match_parent"
android:layout_weight="2"
android:onClick="onValidate"
android:src="@drawable/ok_32" />
android:src="@drawable/ok_32"
android:layout_marginTop="20dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
android:orientation="horizontal"
android:layout_marginTop="20dp">
<TextView
android:id="@+id/check_phrase_number"
......
......@@ -39,22 +39,24 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Check variant mode"
android:layout_marginBottom="20dp"/>
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:textSize="30sp"/>
<View
android:layout_width="match_parent"
android:layout_height="0.2dp"
android:id="@+id/separator"
android:visibility="visible"
android:background="@android:color/darker_gray"
android:layout_marginBottom="25dp"/>
android:layout_marginBottom="25dp"/>
<TextView
android:id="@+id/maintextView2"
style="@style/SecondTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Please, read the bold line and check the box if the word is a variant."
android:layout_marginBottom="25dp" />
android:layout_marginBottom="25dp"
android:textSize="20sp"/>
</TableLayout>
<TextView
......@@ -79,13 +81,15 @@
android:layout_height="wrap_content"
android:paddingBottom="20dp"
android:text="Variant"
android:textSize="15sp" />
android:textSize="23sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2" >
android:layout_weight="2"
android:layout_marginTop="20dp"
android:layout_marginBottom="10dp">
<ImageButton
android:id="@+id/btn_next"
android:layout_width="match_parent"
......@@ -106,7 +110,8 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
android:orientation="horizontal"
android:layout_marginTop="20dp">
<TextView
android:id="@+id/check_line_number"
......
......@@ -412,7 +412,7 @@
android:id="@+id/textView17"
android:text="@string/speaker_name"
android:layout_height="wrap_content"
style="@style/respeak_TextviewMetadata4"/>
style="@style/respeak_TextviewMetadata2"/>
<EditText
android:id="@+id/respeak_edit_spkr_name"
......
......@@ -5,12 +5,12 @@ import java.io.File;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.LinkedList;
import java.util.Locale;
import java.util.Map;
import java.util.Random;
import java.util.zip.Inflater;
import org.lp20.aikuma.model.Language;
import org.lp20.aikuma.model.RecordingLig;
import org.lp20.aikuma.ui.CheckMode;
import org.lp20.aikuma.ui.CheckTranscription;
import org.lp20.aikuma.ui.CheckWordVariant;
......@@ -19,9 +19,9 @@ import org.lp20.aikuma.ui.RecordElicitation;
import org.lp20.aikuma.ui.RecordingMetadataLig;
import org.lp20.aikuma.ui.RespeakingSelection;
import org.lp20.aikuma.ui.ThumbRespeakActivityLig;
import org.lp20.aikuma.ui.ThumbRespeakSummaryLig;
import org.lp20.aikuma.ui.sensors.LocationDetector;
import org.lp20.aikuma.util.AikumaSettings;
import org.lp20.aikuma.util.FileIO;
import org.lp20.aikuma2.R;
import android.app.Activity;
......@@ -179,7 +179,7 @@ public class ModeSelection extends Activity implements OnClickListener{
@Override
public void onClick(DialogInterface dialog, int which) {
Log.i(TAG,"yes");
Log.i(TAG,"yes, retrieve the session");
retrieveSession();
}
})
......@@ -187,21 +187,21 @@ public class ModeSelection extends Activity implements OnClickListener{
@Override
public void onClick(DialogInterface dialog, int which) {
Log.i(TAG,"no but keep");
Log.i(TAG,"no don't retrieve the session but keep files");
prefsUserSession = getSharedPreferences(getString(R.string.userSession), MODE_PRIVATE);
// TODO complete -> what behaviour to adopt? clear sharedPrefs? removes files ?
//clear sharedPrefs
ed.clear();
// ed.putBoolean(getString(R.string.sessionActive), false);
ed.commit();
}
})
.setNeutralButton("No, but erase files", new DialogInterface.OnClickListener() {
.setNeutralButton("No, and erase files", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Log.i(TAG,"no and erase");
prefsUserSession = getSharedPreferences(getString(R.string.userSession), MODE_PRIVATE);
// TODO complete -> what behaviour to adopt? clear sharedPrefs? removes files ?
Log.i(TAG,"no don't retrieve the session and erase files");
//remove files
eraseFiles();
//clear sharedPrefs
ed.clear();
// ed.putBoolean(getString(R.string.sessionActive), false);
ed.commit();
......@@ -212,13 +212,9 @@ public class ModeSelection extends Activity implements OnClickListener{
public void retrieveSession() {
String mode = prefsUserSession.getString(getString(R.string.sessionMode), null);
Log.d(TAG, "mode retrieval: "+mode);
Intent intent;
// if (mode.compareTo(ThumbRespeakSummaryLig.TAG) == 0) {
//
// } else if (mode.compareTo(RecordElicitation.TAG) == 0) {
//
// } else
if (mode.compareToIgnoreCase(CheckTranscription.TAG) == 0) {
if (mode.compareToIgnoreCase(CheckTranscription.TAG) == 0) {
intent = new Intent(getActivity(), CheckTranscription.class);
} else if (mode.compareToIgnoreCase(CheckWordVariant.TAG) == 0) {
intent = new Intent(getActivity(), CheckWordVariant.class);
......@@ -226,8 +222,8 @@ public class ModeSelection extends Activity implements OnClickListener{
intent = new Intent(getActivity(), ThumbRespeakActivityLig.class);
} else if (mode.compareToIgnoreCase(RecordElicitation.TAG) == 0) {
intent = new Intent(getActivity(), RecordElicitation.class);
}else {
Toast.makeText(getActivity(), "An error ocurred, the session could not be retrieved", Toast.LENGTH_LONG).show();
} else {
Toast.makeText(getActivity(), "An error ocurred. The session could not be retrieved", Toast.LENGTH_LONG).show();
return;
}
startActivity(intent);
......@@ -283,5 +279,70 @@ public class ModeSelection extends Activity implements OnClickListener{
((TextView) ll.findViewById(R.id.session_input_file)).setText(file);
}
}
public void eraseFiles() {
File savedFile;
String savedMode = prefsUserSession.getString(getString(R.string.sessionMode), null);
String savedSubmode = prefsUserSession.getString(getString(R.string.session_submode), "undefined");
Log.d(TAG, "saved mode: "+savedMode);
Log.d(TAG, "saved submode: "+savedSubmode);
/*Check Mode*/
if (savedMode.compareToIgnoreCase(CheckWordVariant.TAG) == 0 || savedMode.compareTo(CheckTranscription.TAG) == 0) {
savedFile = new File(prefsUserSession.getString(getString(R.string.sessionCheckExportFile),"undefined"));
Log.d(TAG, "saved file: "+savedFile);
savedFile.delete();
Log.i(TAG, "saved file erased: "+savedFile);
/*Elicitation Mode*/
} else if (savedMode.compareToIgnoreCase(RecordElicitation.TAG) == 0) {
Log.d(TAG, "saved submode: "+savedSubmode);
String idDevice = Aikuma.getDeviceId();
String savedDate = prefsUserSession.getString(getString(R.string.sessionDate), "");
Language savedRecordLang = new Language(prefsUserSession.getString(getString(R.string.language_name), ""),
prefsUserSession.getString(getString(R.string.languageCode), ""));
String name = savedDate + "_" +
savedRecordLang.getCode() + "_" + idDevice;
//erase linker
File savedTextFile = new File(FileIO.getOwnerPath()+"/recordings/"+name + "/" + name + "_linker.txt");
Log.d(TAG, "saved linker file: "+savedTextFile);
savedTextFile.delete();
Log.i(TAG, "saved file erased: "+savedTextFile);
//erase metadata and audio files
int savedProgress = prefsUserSession.getInt(getString(R.string.currentLine), 0);
Log.d(TAG, "saved progress: "+savedProgress);
for (int i=savedProgress; i>=0; i--) {
File savedMetadataFile = new File(FileIO.getOwnerPath()+"/recordings/"+name + "/" + name + "_" + i + RecordingLig.METADATA_SUFFIX);
File savedWavFile = new File(FileIO.getOwnerPath()+"/recordings/"+name + "/" + name + "_" + i +".wav");
Log.d(TAG, "saved metadata file: "+savedMetadataFile);
Log.d(TAG, "saved metadata file: "+savedWavFile);
savedMetadataFile.delete();
savedWavFile.delete();
Log.i(TAG, "saved metadata file erased: "+savedMetadataFile);
Log.i(TAG, "saved audio erased: "+savedWavFile);
}
/*Respeaking or Translating Mode*/
/*TODO
* Erase the respeaking or translating files if the
* user does not want to save its session
* nor its recordings
*/
} else if (savedMode.compareToIgnoreCase(ThumbRespeakActivityLig.TAG) == 0) {
if (savedSubmode.compareToIgnoreCase(getString(R.string.respeak)) == 0) {
/*TODO
* erase the _rspk files
*/
} else if (savedSubmode.compareToIgnoreCase(getString(R.string.translation)) == 0) {
/*TODO
* erase the _trsl files
*/
}
}
Toast.makeText(this, "Session and files erased.", Toast.LENGTH_LONG).show();
}
}
package org.lp20.aikuma.ui;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Locale;
import java.util.UUID;
import org.apache.commons.io.FileUtils;
import org.lp20.aikuma.Aikuma;
import org.lp20.aikuma.MainActivity;
import org.lp20.aikuma.ModeSelection;
import org.lp20.aikuma.model.Language;
import org.lp20.aikuma.util.AikumaSettings;
import org.lp20.aikuma.util.FileIO;
import org.lp20.aikuma2.R;
import android.app.AlertDialog;
import android.app.FragmentTransaction;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Typeface;
import android.os.Bundle;
......@@ -40,7 +22,6 @@ import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.CheckBox;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.SeekBar;
import android.widget.TextView;
......@@ -52,6 +33,7 @@ public class CheckWordVariant extends AikumaActivity {
//private UUID recordUUID;
private BufferedReader reader;
private BufferedWriter outputFile;
private File checkedFile;
private String variantTextFile;
private int checkboxCount;
private String variantchecked;
......@@ -69,7 +51,7 @@ public class CheckWordVariant extends AikumaActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.check_word_variant);
initProgressBars();
date = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.FRANCE).format(new Date());
date = new SimpleDateFormat("yyyyMMdd-HHmmss", Locale.FRANCE).format(new Date());
prefsUserSession = getSharedPreferences(getString(R.string.userSession), MODE_PRIVATE);
//case: session already exists
if (prefsUserSession.getBoolean(getString(R.string.sessionActive), false)) {
......@@ -103,7 +85,7 @@ public class CheckWordVariant extends AikumaActivity {
}
//creation of output file
File checkedFile = new File(variantchecked);
checkedFile = new File(variantchecked);
//new buffer to write in the output file
try {
......@@ -148,7 +130,7 @@ public class CheckWordVariant extends AikumaActivity {
checkboxCount=0;
final float scale = getResources().getDisplayMetrics().density;
int padding_in_px = (int) (10 * scale + 0.5f);
int tsizepx = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, 10, getResources().getDisplayMetrics());
int tsizepx = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, 23, getResources().getDisplayMetrics());
for (String element : variantlist){
//variant + checkbox
variant = new CheckBox(this);
......@@ -279,22 +261,34 @@ public class CheckWordVariant extends AikumaActivity {
}
public void onValidate(View _view) {
if (saveFile()) {
try {
outputFile.flush();
outputFile.close();
Toast.makeText(this, "File saved in "+variantchecked+".", Toast.LENGTH_LONG).show();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
wordvariant = false;
Log.i(TAG, "boolean value : "+wordvariant);
//si fichier non terminé alors sauver session
try {
//if (reader.readLine() != null) {
String line;
while ((line = reader.readLine()) != null && (line.isEmpty() || line.split(", ").length <= 1)) { continue; } /*
//si fin de fichier (buffer=vide) alors finish
if (nbReadLines == 0) {
Toast.makeText(this, "Nothing to save.", Toast.LENGTH_LONG).show();
checkedFile.delete();
//this.finish();
} else {
try {
outputFile.flush();
outputFile.close();
Toast.makeText(this, "File saved in "+variantchecked+".", Toast.LENGTH_LONG).show();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
wordvariant = false;
Log.i(TAG, "boolean value : "+wordvariant);
//si fichier non terminé alors sauver session
try {
//if (reader.readLine() != null) {
String line;
while ((line = reader.readLine()) != null && (line.isEmpty() || line.split(", ").length <= 1)) { continue; }
if (line == null) { throw new IOException("Empty text file"); }
/*
* sauver nb lignes lues: Boolean nbReadLines
* + mode: Boolean checkMode
* + submode: Boolean checkVariant
......@@ -302,9 +296,9 @@ public class CheckWordVariant extends AikumaActivity {
* + fichier export: String variantchecked
* + date: String date
*/
if((line == null && nbReadLines < totalNumberOfExpressions) || line != null) {
Toast.makeText(this, "session saved", Toast.LENGTH_SHORT).show();
date = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.FRANCE).format(new Date());
if (nbReadLines < totalNumberOfExpressions || line != null) {
Toast.makeText(this, "The session has been saved.", Toast.LENGTH_SHORT).show();
date = new SimpleDateFormat("yyyyMMdd-HHmmss", Locale.FRANCE).format(new Date());
SharedPreferences.Editor ed = prefsUserSession.edit();
ed.putBoolean(getString(R.string.sessionActive), true); //session activated
ed.putInt(getString(R.string.nbReadLines), nbReadLines); //nb lines
......@@ -317,12 +311,11 @@ public class CheckWordVariant extends AikumaActivity {
//save infos
ed.commit();
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
//sinon fin de fichier (buffer=vide) alors finish
this.finish();
}
}
......@@ -336,6 +329,7 @@ public class CheckWordVariant extends AikumaActivity {
* -> afficher un Toast "toutes les cases n'ont pas été cochées"
* -> return false
*/
try {
Log.i("saveFile", "Writing on an existing file");
//retrieve the word from the TextView
......@@ -353,11 +347,12 @@ public class CheckWordVariant extends AikumaActivity {
}
}
outputFile.write("\n");
} catch (IOException e1) {
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
return true;
}
return true;
}
public void onBackPressed() {
......
package org.lp20.aikuma.ui;
import java.io.File;
import java.io.FileFilter;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FilenameFilter;
import java.io.IOException;
import java.util.UUID;
import org.apache.commons.io.FileUtils;
import org.lp20.aikuma.MainActivity;
import org.lp20.aikuma.model.Recording;
import org.lp20.aikuma2.R;
import com.musicg.wave.Wave;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
......@@ -22,18 +12,11 @@ import android.app.DialogFragment;
import android.app.FragmentTransaction;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Environment;
import android.preference.PreferenceManager;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.ListView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;
public class ElicitationMode extends AikumaActivity{
......@@ -173,8 +156,11 @@ public class ElicitationMode extends AikumaActivity{
if (!isSelectionnable(mPath)) {
Log.d(TAG, "not selectionnable");
loadFileList(mPath, fileType);
if(mFileList.length > 0)
if(mFileList.length > 0) {
showAudioFilebrowserDialog();
} else {
Toast.makeText(ElicitationMode.this, "This directory does not contain the expected files.", Toast.LENGTH_SHORT).show();
}
} else {
Log.d(TAG, mPath.getAbsolutePath() + " is selectionnable");
actionSelectedFile();
......
......@@ -2,16 +2,13 @@ package org.lp20.aikuma.ui;
import java.io.File;
import java.io.IOException;
import java.math.BigInteger;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.jar.Attributes;
import org.lp20.aikuma.Aikuma;
import org.lp20.aikuma.MainActivity;
......@@ -22,30 +19,20 @@ import org.lp20.aikuma.model.Recording;
import org.lp20.aikuma.model.RecordingLig;
import org.lp20.aikuma.util.AikumaSettings;
import org.lp20.aikuma2.R;
import org.lp20.aikuma2.R.id;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.FragmentTransaction;
import android.content.Context;