assets included, issues #460,#459,#458,#453,#452,#451 in progress, #457,#456,#455,#450,#445 closed

parent 5764eef9
Showing with 177 additions and 47 deletions
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="10daeba4-0692-476d-a3da-642b4123cfdd" name="Default" comment="" />
<list default="true" id="10daeba4-0692-476d-a3da-642b4123cfdd" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
</list>
<ignored path="android.iws" />
<ignored path=".idea/workspace.xml" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
......@@ -20,7 +22,18 @@
<favorites_list name="android" />
</component>
<component name="FileEditorManager">
<leaf />
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="workspace.xml" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/.idea/workspace.xml">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FindManager">
<FindUsagesManager>
......@@ -35,11 +48,18 @@
<projects_view />
</option>
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/.idea/workspace.xml" />
</list>
</option>
</component>
<component name="ProjectFrameBounds">
<option name="x" value="65" />
<option name="y" value="24" />
<option name="width" value="1615" />
<option name="height" value="1026" />
<option name="x" value="-8" />
<option name="y" value="-8" />
<option name="width" value="1936" />
<option name="height" value="1176" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
<OptionsSetting value="true" id="Add" />
......@@ -69,6 +89,13 @@
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="AndroidView">
<subPane />
</pane>
<pane id="Scratches" />
<pane id="Scope">
<subPane subId="Project Files" />
</pane>
<pane id="ProjectPane">
<subPane>
<PATH>
......@@ -82,13 +109,6 @@
<pane id="PackagesPane">
<subPane />
</pane>
<pane id="Scope">
<subPane subId="Project Files" />
</pane>
<pane id="AndroidView">
<subPane />
</pane>
<pane id="Scratches" />
</panes>
</component>
<component name="PropertiesComponent">
......@@ -100,6 +120,12 @@
<property name="MemberChooser.copyJavadoc" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="recentsLimit" value="5" />
<property name="settings.editor.selected.configurable" value="preferences.lookFeel" />
<property name="settings.editor.splitter.proportion" value="0.2" />
<property name="project.structure.last.edited" value="Project" />
<property name="project.structure.proportion" value="0.0" />
<property name="project.structure.side.proportion" value="0.0" />
<property name="editor.config.accepted" value="true" />
</component>
<component name="RunManager">
<configuration default="true" type="AndroidRunConfigurationType" factoryName="Android Application">
......@@ -293,7 +319,7 @@
<servers />
</component>
<component name="ToolWindowManager">
<frame x="65" y="24" width="1615" height="1026" extended-state="6" />
<frame x="-8" y="-8" width="1936" height="1176" extended-state="6" />
<editor active="false" />
<layout>
<window_info id="Palette&#9;" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
......@@ -301,25 +327,25 @@
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.24905898" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.17440401" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.24868283" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.1743941" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32907662" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Android Monitor" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Gradle Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Build Variants" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="true" content_ui="tabs" />
<window_info id="Gradle Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Memory Monitor" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Android Model" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="true" content_ui="tabs" />
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Captures" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
......@@ -352,4 +378,95 @@
</breakpoint-manager>
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/.idea/workspace.xml">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/.idea/workspace.xml">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>
<state key="ArtifactsStructureConfigurable.UI">
<settings>
<artifact-editor />
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="FacetStructureConfigurable.UI">
<settings>
<last-edited>No facets are configured</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="GlobalLibrariesConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="JdkListConfigurable.UI">
<settings>
<last-edited>1.7</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ModuleStructureConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ProjectLibrariesConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>
\ No newline at end of file
......@@ -13,7 +13,7 @@
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
</content>
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="jdk" jdkName="1.7" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
......@@ -415,7 +415,7 @@ public class Device extends SQLiteOpenHelper {
Img.mkDirs(this.context);
copyCoreVocabulary();
} catch (java.io.IOException io) {
throw new RuntimeException("Update database error", io);
throw new RuntimeException("Update database ir cached Images error", io);
}
}
......@@ -438,14 +438,14 @@ public class Device extends SQLiteOpenHelper {
out = new FileOutputStream(outFile);
size+=copyFile(in, out);
} catch(IOException e) {
Log.e(this.getClass().getCanonicalName(), "Failed to copy asset image: " + context.getResources().getString(R.string.core_vocabulary)+File.separatorChar+filename, e);
Log.e(this.getClass().getCanonicalName(), "Failed to copy asset Image: " + context.getResources().getString(R.string.core_vocabulary)+File.separatorChar+filename, e);
}
finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {
Log.e(this.getClass().getCanonicalName(), "Failed to copy asset image: " + filename, e);
Log.e(this.getClass().getCanonicalName(), "Failed to copy asset Image: " + filename, e);
}
}
if (out != null) {
......@@ -453,7 +453,7 @@ public class Device extends SQLiteOpenHelper {
out.close();
filesok++;
} catch (IOException e) {
Log.e(this.getClass().getCanonicalName(), "Failed to copy asset file: " + filename, e);
Log.e(this.getClass().getCanonicalName(), "Failed to copy asset Image: " + filename, e);
}
}
}
......
......@@ -41,10 +41,12 @@ public class PictoItemViewGenerator {
pictoImage.setScaleY(1.0f);
pictoImage.setVisibility(View.GONE);
if (picto==null) {
if (picto == null) {
if (PCBcontext.getPcbdb().getCurrentUser().is_supervisor()) {
layoutWrapper.setVisibility(View.VISIBLE);
layoutWrapper.setBackground(convertView.getResources()
.getDrawable(R.drawable.picto_grid_item_border));
}
} else {
if (!picto.is_invisible() && !picto.is_disabled()) {
layoutWrapper.setAlpha(1.00f);
......
......@@ -92,14 +92,13 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
// Button used for showing the picto category view
ImageButton showPictoCategoriesViewButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_pictogram);
Intent intent = getIntent();
this.mainLayout = (RelativeLayout) findViewById(R.id.pictogramLayout);
this.currentCategory = null;
this.count_deletelong = 0;
......@@ -176,6 +175,7 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
if (tts != null){
tts.shutdown();
}
PCBcontext.getNetService().closeNotifyStatus();
}
/**
......@@ -594,13 +594,10 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
*/
private class OnPictoLongClickListener implements AdapterView.OnItemLongClickListener {
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
Log.d(LOG_TAG, "long click 1");
if (PCBcontext.getPcbdb().getCurrentUser().is_supervisor()) {
Log.d(LOG_TAG, "long click 2");
// Si es supervisor al hacer longClick deshabilito ese pictograma o lo habilito
Picto p = getCurrentPictoGridAdapter().getItem(position);
if (p == null) {
Log.d(LOG_TAG, "long click 3");
// No tengo pictograma. Abro una nueva ventana de selección desde el Carrete del device si no es categoria
if (currentCategory != null) {
Log.d(LOG_TAG, "No tengo pictograma. Abro carrete...");
......@@ -611,7 +608,7 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
} else {
p.alter_status();
pictoCategoryGridAdapter.notifyDataSetChanged();
getCurrentPictoGridAdapter().notifyDataSetChanged();
}
} else {
ClipData.Item item = new ClipData.Item("" + position);
......
......@@ -152,7 +152,7 @@ public class SerialActivity extends Activity {
if (e.no_pwd_found())
GUITools.show_alert(this, R.string.passErrorMsg);
else if (e.no_username_found())
GUITools.show_alert(this, R.string.userErrorMsg,getString(R.string.noInternetConnection));
GUITools.show_alert(this, R.string.userInetErrorMsg);
else if (e.no_supervisor_students())
GUITools.show_alert(this, R.string.noStudentsError);
}
......@@ -233,7 +233,7 @@ public class SerialActivity extends Activity {
e.printStackTrace();
} catch (LoginException e) {
GUITools.show_alert(this, e.no_username_found()
? R.string.userErrorMsg
? R.string.userInetErrorMsg
: R.string.passErrorMsg);
}
} //offline student login
......
......@@ -37,11 +37,22 @@ import java.util.concurrent.TimeUnit;
public class NetService implements Runnable {
public static final String PREFS_NAME = "MyPrefsFile";
private static NotificationCompat.Builder builder;
static final String ping_session="server/ping";
private boolean updated;
public NetService(int delay) {
this.updated=RestapiWrapper.ping(PCBcontext.getContext().getResources().getString(R.string.server), ping_session);
this.builder = new NotificationCompat.Builder(PCBcontext.getContext());
Intent resultIntent = new Intent(PCBcontext.getContext(), PictogramActivity.class);
TaskStackBuilder stackBuilder = TaskStackBuilder.create(PCBcontext.getContext());
stackBuilder.addParentStack(PictogramActivity.class);
stackBuilder.addNextIntent(resultIntent);
PendingIntent resultPendingIntent =
stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
builder.setContentIntent(resultPendingIntent);
Log.i(this.getClass().getName(), "Checking Pictogram server access...");
Log.i(this.getClass().getName(), this.updated ? "Pictogram server access ok" : "Pictogram server access failed, Internet connection available?");
ScheduledThreadPoolExecutor exec = new ScheduledThreadPoolExecutor(1);
......@@ -144,16 +155,7 @@ public class NetService implements Runnable {
});
}
private void notifyStatus() {
NotificationCompat.Builder builder;
int notifyID = 1;
builder = new NotificationCompat.Builder(PCBcontext.getContext());
Intent resultIntent = new Intent(PCBcontext.getContext(), PictogramActivity.class);
TaskStackBuilder stackBuilder = TaskStackBuilder.create(PCBcontext.getContext());
stackBuilder.addParentStack(PictogramActivity.class);
stackBuilder.addNextIntent(resultIntent);
PendingIntent resultPendingIntent =
stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
builder.setContentIntent(resultPendingIntent);
String user="";
if (PCBcontext.getPcbdb()!=null) {
user=PCBcontext.getPcbdb().getCurrentUser().get_name_stu();
......@@ -171,7 +173,14 @@ public class NetService implements Runnable {
NotificationManager mNotificationManager =
(NotificationManager) PCBcontext.getContext().getSystemService(PCBcontext.getContext().NOTIFICATION_SERVICE);
// mId allows you to update the notification later on.
mNotificationManager.notify(notifyID, builder.build());
}
public void closeNotifyStatus(){
int notifyID = 1;
NotificationManager mNotificationManager =
(NotificationManager) PCBcontext.getContext().getSystemService(PCBcontext.getContext().NOTIFICATION_SERVICE);
mNotificationManager.cancel(notifyID);
}
}
......@@ -26,9 +26,9 @@ public class ServerLogin {
error=null;
}
if (error!=null){
if (error.contains("Invalid password") || error.contains("No credentials sent"))
if (error.toLowerCase().contains("password") || error.contains("No credentials sent"))
throw new LoginException(error, LoginException.BAD_PASSWORD);
else if (error.contains("User not found"))
else if (error.toLowerCase().contains("user"))
throw new LoginException(error, LoginException.UNKNOWN_USERNAME);
}
}
......@@ -58,6 +58,7 @@ public class ServerLogin {
@Override
public void result(JSONObject result) {
try {
checkLogin(result);
if (PCBcontext.is_user_offline()) {
......
......@@ -21,6 +21,7 @@
<string name="passErrorMsg">This password is not correct. Try again.</string>
<string name="userErrorTxt">User not found</string>
<string name="userErrorMsg">Unknown user name</string>
<string name="userInetErrorMsg">Unknown new user name because Internet conection is not available</string>
<string name="userLoadingTxt">Loading</string>
<string name="userLoadingMsg">Loading students. Please wait.</string>
<string name="imguserLoadingMsg">Loading images students. Please wait.</string>
......
......@@ -22,6 +22,7 @@
<string name="passErrorMsg">La contraseña indicada no es correcta. Inténtelo de nuevo.</string>
<string name="userErrorTxt">Usuario no encontrado</string>
<string name="userErrorMsg">Nombre de usuario desconocido</string>
<string name="userInetErrorMsg">Nombre de usuario nuevo no se pudo comprobar porque no hay conexión a internet</string>
<string name="userLoadingTxt">Cargando</string>
<string name="userLoadingMsg">Cargando alumnos. Por favor espere.</string>
<string name="imguserLoadingMsg">Cargando imágenes de los alumnos. Por favor espere.</string>
......
......@@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.android.tools.build:gradle:2.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
......
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