Commit 7d46add9 authored by blachon's avatar blachon
parents d8b5b391 5338d9c1
......@@ -12,7 +12,7 @@
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin" >
<!-- Back button -->
<!-- Back button
<GridLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -28,6 +28,7 @@
android:layout_marginBottom="20dp"
android:layout_marginTop="20dp" />
</GridLayout>
-->
<TableLayout
android:layout_width="fill_parent"
......
......@@ -12,7 +12,7 @@
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin" >
<!-- Back button -->
<!-- Back button
<GridLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -28,7 +28,7 @@
android:layout_marginBottom="20dp"
android:layout_marginTop="20dp" />
</GridLayout>
-->
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
......
......@@ -12,7 +12,7 @@
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin" >
<!-- Back button -->
<!-- Back button
<GridLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -28,7 +28,7 @@
android:layout_marginBottom="20dp"
android:layout_marginTop="20dp" />
</GridLayout>
-->
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
......
......@@ -12,7 +12,7 @@
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin" >
<!-- Back button -->
<!-- Back button
<GridLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -28,6 +28,7 @@
android:layout_marginBottom="20dp"
android:layout_marginTop="20dp" />
</GridLayout>
-->
<TableLayout
android:layout_width="fill_parent"
......@@ -61,7 +62,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="20dp"
android:text="TextView"
android:text="Lexeme"
android:textSize="30sp"
android:textStyle="bold"
android:typeface="serif" />
......@@ -71,6 +72,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/tv_verif_variante"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="20dp"
android:text="Variant"
android:textSize="15sp" />
</LinearLayout>
<LinearLayout
......
......@@ -244,6 +244,7 @@ public class CheckTranscription extends AikumaActivity {
* + fichier export: String transcriptChecked
* + date: String date
*/
date = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.FRANCE).format(new Date());
SharedPreferences.Editor ed = prefsUserSession.edit();
ed.putBoolean(getString(R.string.sessionActive), true); //session activated
ed.putInt(getString(R.string.sessionProgress), nbReadLines); //nb lines
......@@ -289,5 +290,12 @@ public class CheckTranscription extends AikumaActivity {
public void onBackPressed() {
onValidate(null);
/*
* TODO
* popup 3 choix :
* - oui je veux quitter et enregistrer ma session
* - oui je veux quitter mais ne pas enregistrer
* - annuler (je me suis trompé)
*/
}
}
......@@ -68,6 +68,12 @@ public class CheckWordVariant extends AikumaActivity {
prefsUserSession = getSharedPreferences(getString(R.string.userSession), MODE_PRIVATE);
//case: session already exists
if (prefsUserSession.getBoolean(getString(R.string.sessionActive), false)) {
/*
* TODO rajouter une condition en &&
* soustraire date.now à date session :
* si <5min alors ed.clear
* sinon continue;
*/
//retrieve selected file handled in the last session
variantTextFile = prefsUserSession.getString(getString(R.string.sessionInputFile),null);
Log.i(TAG, "Selected import file: " + variantTextFile);
......@@ -141,6 +147,10 @@ public class CheckWordVariant extends AikumaActivity {
llparent.addView(variant);
checkboxCount+=1;
}
/*
* TODO 3 radiogroup avec des radio buttons plutôt qu'une... + associer un label (=variant)
*/
nbReadLines++;
} catch (FileNotFoundException e1) {
// TODO Auto-generated catch block
......@@ -189,6 +199,9 @@ public class CheckWordVariant extends AikumaActivity {
llparent.addView(variant);
checkboxCount+=1;
}
/*
* TODO si rien n'est coché, désactiver le bouton next
*/
nbReadLines++;
} catch (IOException e) {
Log.e(TAG,"No more words to display or an error occurred: " + e);
......@@ -201,8 +214,6 @@ public class CheckWordVariant extends AikumaActivity {
Toast.makeText(this, "No more words to display. File saved in "+variantchecked+".", Toast.LENGTH_LONG).show();
this.finish();
}
} else {
Toast.makeText(this, "Going to next word...", Toast.LENGTH_LONG).show();
}
}
......@@ -229,6 +240,7 @@ public class CheckWordVariant extends AikumaActivity {
* + fichier export: String variantchecked
* + date: String date
*/
date = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.FRANCE).format(new Date());
SharedPreferences.Editor ed = prefsUserSession.edit();
ed.putBoolean(getString(R.string.sessionActive), true); //session activated
ed.putInt(getString(R.string.sessionProgress), nbReadLines); //nb lines
......@@ -253,6 +265,11 @@ public class CheckWordVariant extends AikumaActivity {
/*
* Write word with its variant(s) checked in a new file
*/
/*
* TODO si les radiogroup ne sont pas tous coché :
* -> 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
......@@ -262,6 +279,9 @@ public class CheckWordVariant extends AikumaActivity {
//if checked
CheckBox checkbox_x = (CheckBox) findViewById(i);
if (checkbox_x.isChecked()) {
/*
* TODO modifier pour prendre en compte le radiogroup
*/
Log.i("CHECKED", checkbox_x.toString());
outputFile.write(", "+checkbox_x.getText());
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment