issues #906,#907,#908,#911 closed

parent ec7a00d4
...@@ -10,7 +10,7 @@ android { ...@@ -10,7 +10,7 @@ android {
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
resValue "string", "db_name", "PCB.db" resValue "string", "db_name", "PCB.db"
resValue "integer", "db_version", "2" resValue "integer", "db_version", "3"
resValue "string", "app_version", "0.1" resValue "string", "app_version", "0.1"
resValue "string", "core_vocabulary", "core_vocabulary" resValue "string", "core_vocabulary", "core_vocabulary"
resValue "string", "apk", "to_be_set_in_subproject" resValue "string", "apk", "to_be_set_in_subproject"
......
...@@ -153,7 +153,7 @@ public class PCBDBHelper extends SQLiteOpenHelper { ...@@ -153,7 +153,7 @@ public class PCBDBHelper extends SQLiteOpenHelper {
Cursor cursor = db.query("collection_detail", null, "id_stu=?", new String[]{String.valueOf(id_stu)}, null, null, null, null); Cursor cursor = db.query("collection_detail", null, "id_stu=?", new String[]{String.valueOf(id_stu)}, null, null, null, null);
Log.i(LOG_TAG, "Local recovering " + cursor.getCount() + " pictos for student " + id_stu + " from local DB"); Log.i(LOG_TAG, "Local recovering " + cursor.getCount() + " pictos for student " + id_stu + " from local DB");
cursor.moveToFirst(); cursor.moveToFirst();
do{ if (cursor.getCount()>0) do{
Picto picto = new Picto(cursor.getInt(1), cursor.getString(2), cursor.getString(3), cursor.getString(4)); Picto picto = new Picto(cursor.getInt(1), cursor.getString(2), cursor.getString(3), cursor.getString(4));
vocabulary.loadPicto(picto); vocabulary.loadPicto(picto);
}while (cursor.moveToNext()); }while (cursor.moveToNext());
......
...@@ -139,7 +139,7 @@ public class Vocabulary implements Iterable<Picto> { ...@@ -139,7 +139,7 @@ public class Vocabulary implements Iterable<Picto> {
try { try {
Log.i(this.getClass().getCanonicalName(), "Picto added while offline. Picto translation: '" + Log.i(this.getClass().getCanonicalName(), "Picto added while offline. Picto translation: '" +
picto.get_translation() + "', id:" + picto.get_id() + " Local status?" + picto.local_status()); picto.get_translation() + "', id:" + picto.get_id() + " Local status?" + picto.local_status());
new PictoUploader(picto).upload(PCBcontext.getContext()); new PictoUploader(picto).upload();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
Log.e(this.getClass().getName(), " Picto json error from server: " + picto.toString()); Log.e(this.getClass().getName(), " Picto json error from server: " + picto.toString());
......
package com.yottacode.pictogram.net; package com.yottacode.pictogram.net;
import android.content.Context;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.util.Log; import android.util.Log;
...@@ -134,13 +133,13 @@ public class PictoUploader { ...@@ -134,13 +133,13 @@ public class PictoUploader {
@Override @Override
public void result(JSONObject result) { public void result(JSONObject result) {
Log.i(this.getClass().getCanonicalName(), " Attributes uploaded: " + result.toString()); Log.i(this.getClass().getCanonicalName(), " Attributes uploaded: " + result.toString());
listener.success(true); listener.success(true,result.toString());
} }
@Override @Override
public void error(RestapiWrapper.HTTPException e) { public void error(RestapiWrapper.HTTPException e) {
Log.e(this.getClass().getCanonicalName(), " Error uploading attributes: " + e.getLocalizedMessage()); Log.e(this.getClass().getCanonicalName(), " Error uploading attributes: " + e.getLocalizedMessage());
listener.success(false); listener.success(false,e.getLocalizedMessage());
} }
}); });
...@@ -169,13 +168,13 @@ public class PictoUploader { ...@@ -169,13 +168,13 @@ public class PictoUploader {
@Override @Override
public void result(JSONObject result) { public void result(JSONObject result) {
Log.i(this.getClass().getCanonicalName(), "Uploaded translation result: " + result.toString()); Log.i(this.getClass().getCanonicalName(), "Uploaded translation result: " + result.toString());
listener.success(true); listener.success(true,result.toString());
} }
@Override @Override
public void error(RestapiWrapper.HTTPException e) { public void error(RestapiWrapper.HTTPException e) {
Log.e(this.getClass().getCanonicalName(), "Error uploading translation: " + e.getLocalizedMessage()+" Picto:"+params.get("picto")+" Lang:"+params.get("lang")+" Text:"+params.get("text")); Log.e(this.getClass().getCanonicalName(), "Error uploading translation: " + e.getLocalizedMessage()+" Picto:"+params.get("picto")+" Lang:"+params.get("lang")+" Text:"+params.get("text"));
listener.success(false); listener.success(false,e.getMessage());
} }
}); });
} }
...@@ -187,7 +186,7 @@ public class PictoUploader { ...@@ -187,7 +186,7 @@ public class PictoUploader {
* iii) to upload the expression * iii) to upload the expression
* *
**/ **/
public void upload(final Context context) throws IOException { public void upload() throws IOException {
final int local_img_id = this.picto.get_id(); final int local_img_id = this.picto.get_id();
final boolean imgUpload_success = uploadImg(this.picto); final boolean imgUpload_success = uploadImg(this.picto);
...@@ -195,11 +194,15 @@ public class PictoUploader { ...@@ -195,11 +194,15 @@ public class PictoUploader {
iPictoUploaderListener listener = new iPictoUploaderListener() { iPictoUploaderListener listener = new iPictoUploaderListener() {
int elements_uploaded = 0; int elements_uploaded = 0;
@Override @Override
public void success(boolean success) { public void success(boolean success, String msg) {
if (success) elements_uploaded++; if (success) elements_uploaded++;
else else {
GUITools.show_alert(PCBcontext.getActivityContext(), R.string.upload_error,PictoUploader.this.picto.get_translation()); int errmsg =
msg.contains("Error: Picto already in student's vocabulary")
? R.string.upload_duplicated
: R.string.upload_error;
GUITools.show_alert(PCBcontext.getActivityContext(), errmsg, PictoUploader.this.picto.get_translation());
}
if (elements_uploaded == 2) { if (elements_uploaded == 2) {
PCBcontext.getPcbdb().deletePicto(local_img_id); PCBcontext.getPcbdb().deletePicto(local_img_id);
PictoUploader.this.picto.delete_bitmap(PCBcontext.getContext()); PictoUploader.this.picto.delete_bitmap(PCBcontext.getContext());
...@@ -262,6 +265,6 @@ public class PictoUploader { ...@@ -262,6 +265,6 @@ public class PictoUploader {
* Created by Fernando on 28/07/2016. * Created by Fernando on 28/07/2016.
*/ */
public static interface iPictoUploaderListener { public static interface iPictoUploaderListener {
void success(boolean success); void success(boolean success, String s);
} }
} }
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
<string name="notNewCats">Including new categories is not allowed</string> <string name="notNewCats">Including new categories is not allowed</string>
<string name="upload_error">It cannot be uploaded. It will be tried again later</string> <string name="upload_error">It cannot be uploaded. It will be tried again later</string>
<string name="upload_ok">It was correctly uploaded</string> <string name="upload_ok">It was correctly uploaded</string>
<string name="upload_duplicated">Pictogram is part of the collecion. Please, select a different one</string>
<!--online/offline status--> <!--online/offline status-->
<string name="pictogram_offline">Pictogram offline</string> <string name="pictogram_offline">Pictogram offline</string>
<string name="pictogram_online">Pictogram online</string> <string name="pictogram_online">Pictogram online</string>
......
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
<string name="notNewCats">No puede añadir nuevas categorias</string> <string name="notNewCats">No puede añadir nuevas categorias</string>
<string name="upload_error">Pictograma local no pudo subirse al servidor. Se intentará más tarde</string> <string name="upload_error">Pictograma local no pudo subirse al servidor. Se intentará más tarde</string>
<string name="upload_ok">Pictograma local se subió correctamente al servidor</string> <string name="upload_ok">Pictograma local se subió correctamente al servidor</string>
<string name="upload_duplicated">Pictograma ya presente en la colección. Utilice otra imagen</string>
<!--online/offline status--> <!--online/offline status-->
<string name="pictogram_offline">Pictogram offline</string> <string name="pictogram_offline">Pictogram offline</string>
<string name="pictogram_online">Pictogram online</string> <string name="pictogram_online">Pictogram online</string>
......
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
<string name="notNewCats">No puede añadir nuevas categorias</string> <string name="notNewCats">No puede añadir nuevas categorias</string>
<string name="upload_error">No pudo subirse al servidor. Se intentará más adelante</string> <string name="upload_error">No pudo subirse al servidor. Se intentará más adelante</string>
<string name="upload_ok">Se subió correctamente al servidor</string> <string name="upload_ok">Se subió correctamente al servidor</string>
<string name="upload_duplicated">Pictograma ya presente en la colección. Utilice otra imagen</string>
<string name="title_activity_img_label">img_label</string> <string name="title_activity_img_label">img_label</string>
......
...@@ -105,14 +105,6 @@ ...@@ -105,14 +105,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" 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/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/jni" 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/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" 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/assets" type="java-test-resource" />
...@@ -121,6 +113,14 @@ ...@@ -121,6 +113,14 @@
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<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/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/24.2.1/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/24.2.1/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/24.2.1/jars" />
......
...@@ -7,18 +7,13 @@ import android.content.Intent; ...@@ -7,18 +7,13 @@ import android.content.Intent;
import android.database.Cursor; import android.database.Cursor;
import android.net.Uri; import android.net.Uri;
import android.provider.MediaStore; import android.provider.MediaStore;
import android.text.InputType;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import com.yottacode.pictogram.dao.Picto; import com.yottacode.pictogram.dao.Picto;
import com.yottacode.pictogram.grammar.Vocabulary;
import com.yottacode.pictogram.grammar.iLocalPicto;
import com.yottacode.pictogram.net.PictoUploader;
import com.yottacode.pictogram.tabletlibrary.R; import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tools.PCBcontext; import com.yottacode.pictogram.tools.PCBcontext;
...@@ -58,109 +53,53 @@ public class PictoMenu { ...@@ -58,109 +53,53 @@ public class PictoMenu {
*/ */
public void addPicto(final int row,final int col, final int cat) { public void addPicto(final int row,final int col, final int cat) {
final String [] items = new String [] {activity.getString(R.string.dialogCamera), activity.getString(R.string.dialogGallery)}; final String[] items = new String[]{activity.getString(R.string.dialogCamera), activity.getString(R.string.dialogGallery)};
ArrayAdapter<String> adapter = new ArrayAdapter<>(activity, android.R.layout.select_dialog_item, items); ArrayAdapter<String> adapter = new ArrayAdapter<>(activity, android.R.layout.select_dialog_item, items);
AlertDialog.Builder builder = new AlertDialog.Builder(activity); AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle(activity.getString(R.string.dialogTitle)); builder.setTitle(activity.getString(R.string.dialogTitle));
builder.setAdapter( adapter, new DialogInterface.OnClickListener() { builder.setAdapter(adapter, new DialogInterface.OnClickListener() {
public void onClick( DialogInterface dialog, int item ) { public void onClick(DialogInterface dialog, int item) {
if (item == 0) { //Pick from camera addPicto(row,col,cat,item);
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
activity.startActivityForResult(cameraIntent,CAMERA_PIC_REQUEST);
} else { //Pick from file
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
activity.startActivityForResult(intent,GALLERY_PIC_REQUEST);
}
//Enviar al PictogramActivity los datos necesarios para crear el picto despues
if (PCBcontext.getPcbdb().getCurrentUser().has_categories()) {
activity.getIntent().putExtra("cat", cat);
activity.getIntent().putExtra(Picto.JSON_ATTTRS.ROW, row);
activity.getIntent().putExtra(Picto.JSON_ATTTRS.COLUMN, col);
} else {
activity.getIntent().putExtra(Picto.JSON_ATTTRS.FREE_ROW, row);
activity.getIntent().putExtra(Picto.JSON_ATTTRS.FREE_COLUMN, col);
}
} }
} ); });
builder.setNegativeButton(activity.getString(R.string.dialogCancel),new DialogInterface.OnClickListener() { builder.setNegativeButton(activity.getString(R.string.dialogCancel), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,int id) { public void onClick(DialogInterface dialog, int id) {
// if this button is clicked, just close // if this button is clicked, just close
// the dialog box and do nothing // the dialog box and do nothing
dialog.cancel(); dialog.cancel();
} }
}); });
final AlertDialog dialog = builder.create();
dialog.show();
}
final AlertDialog dialog = builder.create(); public void addPicto(int row, int col, int cat, int source) {
dialog.show(); if (source== 0) { //Pick from camera
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
activity.startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);
} else { //Pick from file
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
activity.startActivityForResult(intent, GALLERY_PIC_REQUEST);
}
/*Intent intent = new Intent(Intent.ACTION_PICK); //Enviar al PictogramActivity los datos necesarios para crear el picto despues
intent.setType("image*//*");
if (PCBcontext.getPcbdb().getCurrentUser().has_categories()) { if (PCBcontext.getPcbdb().getCurrentUser().has_categories()) {
activity.getIntent().putExtra("cat", cat);
activity.getIntent().putExtra(Picto.JSON_ATTTRS.ROW, row); activity.getIntent().putExtra(Picto.JSON_ATTTRS.ROW, row);
activity.getIntent().putExtra(Picto.JSON_ATTTRS.COLUMN, col); activity.getIntent().putExtra(Picto.JSON_ATTTRS.COLUMN, col);
} else { } else {
activity.getIntent().putExtra(Picto.JSON_ATTTRS.FREE_ROW, row); activity.getIntent().putExtra(Picto.JSON_ATTTRS.FREE_ROW, row);
activity.getIntent().putExtra(Picto.JSON_ATTTRS.FREE_COLUMN, col); activity.getIntent().putExtra(Picto.JSON_ATTTRS.FREE_COLUMN, col);
} }
activity.startActivityForResult(intent,CAMERA_PIC_REQUEST);*/
} }
/**
* función para la edición de un texto asociado a una nueva imagen y guardar el nuevo picto
*/
/*public void chooseTextAndSavePicto(final String selectedImagePath, final int row, final int col, final int freeRow, final int freeColumn) {
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle(activity.getResources().getString(R.string.enterImgLabel));
// Set up the input
final EditText input = new EditText(activity);
input.setInputType(InputType.TYPE_CLASS_TEXT);
builder.setView(input);
// Set up the buttons
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
int cat = activity.getCurrentCategory() != null
? activity.getCurrentCategory().get_id()
: Picto.NO_CATEGORY;
PCBcontext.getVocabulary().saveLocalPicto(
selectedImagePath,
input.getText().toString(),
cat,
row,
col,
freeRow,
freeColumn,
new iLocalPicto() {
@Override
public void saved(Picto localPicto) {
activity.refresh();
try {
if (PCBcontext.is_user_online())
new PictoUploader(localPicto).upload(activity);
} catch (IOException e) {
Log.e(Vocabulary.class.getCanonicalName(), e.getMessage());
}
}
});
}
});
builder.show();
}*/
/** /**
* Función para la selección de una foto del carrete * Función para la selección de una foto del carrete
...@@ -397,13 +336,7 @@ public class PictoMenu { ...@@ -397,13 +336,7 @@ public class PictoMenu {
ll.setVisibility(View.GONE); ll.setVisibility(View.GONE);
ll.removeAllViewsInLayout(); ll.removeAllViewsInLayout();
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); addPicto(p.get_row(),p.get_column(),p.get_category(),0);
if(p!=null) {
//cameraIntent.putExtra("pictoLegend", p.get_translation());
activity.setPicto(p);
}
activity.startActivityForResult(cameraIntent,CAMERA_PIC_REQUEST);
} }
public void menuDisabled(){} public void menuDisabled(){}
} }
...@@ -422,15 +355,7 @@ public class PictoMenu { ...@@ -422,15 +355,7 @@ public class PictoMenu {
{ {
ll.setVisibility(View.GONE); ll.setVisibility(View.GONE);
ll.removeAllViewsInLayout(); ll.removeAllViewsInLayout();
if(p!=null) { addPicto(p.get_row(),p.get_column(),p.get_category(),1);
//cameraIntent.putExtra("pictoLegend", p.get_translation());
activity.setPicto(p);
}
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
activity.startActivityForResult(intent,GALLERY_PIC_REQUEST);
//addPicto(p.get_row(),p.get_column());
} }
public void menuDisabled(){} public void menuDisabled(){}
} }
......
...@@ -1151,7 +1151,8 @@ protected void showOnlyTape(boolean onlyTape) { ...@@ -1151,7 +1151,8 @@ protected void showOnlyTape(boolean onlyTape) {
// Set up the buttons // Set up the buttons
int cat = category != -1 ? category : Picto.NO_CATEGORY; int cat = category != -1 ? category : Picto.NO_CATEGORY;
Log.e(LOG_TAG,"CTSA 1"); Log.i(LOG_TAG,"Uploading "+legend+" at row "+"row"+", col "+col);
PCBcontext.getVocabulary().saveLocalPicto( PCBcontext.getVocabulary().saveLocalPicto(
selectedImagePath, selectedImagePath,
legend, legend,
...@@ -1163,11 +1164,10 @@ Log.e(LOG_TAG,"CTSA 1"); ...@@ -1163,11 +1164,10 @@ Log.e(LOG_TAG,"CTSA 1");
new iLocalPicto() { new iLocalPicto() {
@Override @Override
public void saved(Picto localPicto) { public void saved(Picto localPicto) {
Log.e(LOG_TAG,"CTSA 2");
refresh(); refresh();
try { try {
if (PCBcontext.is_user_online()) if (PCBcontext.is_user_online())
new PictoUploader(localPicto).upload(PCBcontext.getContext()); new PictoUploader(localPicto).upload();
} catch (IOException e) { } catch (IOException e) {
Log.e(Vocabulary.class.getCanonicalName(), e.getMessage()); Log.e(Vocabulary.class.getCanonicalName(), e.getMessage());
} }
......
...@@ -52,6 +52,7 @@ public class EditPictoActivity extends Activity { ...@@ -52,6 +52,7 @@ public class EditPictoActivity extends Activity {
final EditText legend = (EditText) findViewById(R.id.edtLegend); final EditText legend = (EditText) findViewById(R.id.edtLegend);
final ImageButton okButton = (ImageButton) findViewById(R.id.okButton); final ImageButton okButton = (ImageButton) findViewById(R.id.okButton);
final ImageButton cancelButton = (ImageButton) findViewById(R.id.cancelButton); final ImageButton cancelButton = (ImageButton) findViewById(R.id.cancelButton);
String transcription=getIntent().getExtras().getString(TRANSCRIPTION);
cropImageView.setFixedAspectRatio(true); cropImageView.setFixedAspectRatio(true);
cropImageView.setGuidelines(2); cropImageView.setGuidelines(2);
...@@ -79,7 +80,8 @@ public class EditPictoActivity extends Activity { ...@@ -79,7 +80,8 @@ public class EditPictoActivity extends Activity {
cropImageView.setImageBitmap(imagePicto); cropImageView.setImageBitmap(imagePicto);
cropImageView.setMaxWidth(imagePicto.getWidth()); cropImageView.setMaxWidth(imagePicto.getWidth());
cropImageView.setMaxHeight(imagePicto.getHeight()); cropImageView.setMaxHeight(imagePicto.getHeight());
if (transcription!=null && transcription.length()>0)
legend.setText(transcription);
//Gestion de botones //Gestion de botones
okButton.setOnClickListener(new View.OnClickListener() { okButton.setOnClickListener(new View.OnClickListener() {
......
...@@ -93,26 +93,28 @@ ...@@ -93,26 +93,28 @@
android:layout_column="2" android:layout_column="2"
/> />
<ImageButton <ImageButton
android:id="@+id/okButton" android:id="@+id/cancelButton"
android:layout_width="80dp" android:layout_width="80dp"
android:layout_height="80dp" android:layout_height="80dp"
android:background="@drawable/session_fail"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:background="@drawable/session_ok"
android:clickable="false"
android:layout_row="1" android:layout_row="1"
android:layout_column="3" android:layout_column="3"/>
android:elevation="1dp" />
<ImageButton <ImageButton
android:id="@+id/cancelButton" android:id="@+id/okButton"
android:layout_width="80dp" android:layout_width="80dp"
android:layout_height="80dp" android:layout_height="80dp"
android:background="@drawable/session_fail" android:background="@drawable/session_ok"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:clickable="false"
android:layout_row="1" android:layout_row="1"
android:layout_column="3"/> android:layout_column="3"
android:elevation="1dp" />
</GridLayout> </GridLayout>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<string name="session_loading">Downloading instructions</string> <string name="session_loading">Downloading instructions</string>
<string name="session_empty">Student without any method</string> <string name="session_empty">Student without any method</string>
<string name="session_notclosed">Last session was not closed. Please close from </string> <string name="session_notclosed">Last session was not closed. Please close from </string>
<string name="session_closed_ok">Session upload ok</string> <string name="session_closed_ok">Session uploupload ok</string>
<string name="session_closed_fail">Session not uploaded. Please, try it from</string> <string name="session_closed_fail">Session not uploaded. Please, try it from</string>
<string name="session_pause_error">Pause session failed</string> <string name="session_pause_error">Pause session failed</string>
<string name="session_noinet">No server conexion. Internet conexion is available?</string> <string name="session_noinet">No server conexion. Internet conexion is available?</string>
......
...@@ -42,13 +42,6 @@ ...@@ -42,13 +42,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/jni" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/rs" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/shaders" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/DevFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/DevFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/res" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/resources" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/assets" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/assets" type="java-test-resource" />
...@@ -57,6 +50,13 @@ ...@@ -57,6 +50,13 @@
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/jni" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/rs" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/shaders" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/DevFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/DevFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/res" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/resources" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/assets" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/assets" type="java-resource" />
...@@ -105,14 +105,6 @@ ...@@ -105,14 +105,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" 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/main/shaders" isTestSource="false" />
<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/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" /> <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/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
...@@ -121,6 +113,14 @@ ...@@ -121,6 +113,14 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" 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/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/jni" 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/intermediates/assets" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
......
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 sign in to comment